1
- const { isUndefined} = require ( 'lodash' ) ;
2
- const parser = require ( 'conventional-commits-parser' ) . sync ;
3
- const filter = require ( 'conventional-commits-filter' ) ;
4
- const debug = require ( 'debug' ) ( 'semantic-release:commit-analyzer' ) ;
5
- const loadParserConfig = require ( './lib/load-parser-config' ) ;
6
- const loadReleaseRules = require ( './lib/load-release-rules' ) ;
7
- const analyzeCommit = require ( './lib/analyze-commit' ) ;
8
- const compareReleaseTypes = require ( './lib/compare-release-types' ) ;
9
- const RELEASE_TYPES = require ( './lib/default-release-types' ) ;
10
- const DEFAULT_RELEASE_RULES = require ( './lib/default-release-rules' ) ;
1
+ import lodash from 'lodash' ;
2
+ const { isUndefined} = lodash ;
3
+ import { sync as parser } from 'conventional-commits-parser' ;
4
+ import filter from 'conventional-commits-filter' ;
5
+ import debug from 'debug' ;
6
+ import loadParserConfig from './lib/load-parser-config.js' ;
7
+ import loadReleaseRules from './lib/load-release-rules.js' ;
8
+ import analyzeCommit from './lib/analyze-commit.js' ;
9
+ import compareReleaseTypes from './lib/compare-release-types.js' ;
10
+ import RELEASE_TYPES from './lib/default-release-types.js' ;
11
+ import DEFAULT_RELEASE_RULES from './lib/default-release-rules.js' ;
12
+
13
+ debug ( 'semantic-release:commit-analyzer' ) ;
11
14
12
15
/**
13
16
* Determine the type of release to create based on a list of commits.
@@ -25,7 +28,7 @@ const DEFAULT_RELEASE_RULES = require('./lib/default-release-rules');
25
28
*/
26
29
async function analyzeCommits ( pluginConfig , context ) {
27
30
const { commits, logger} = context ;
28
- const releaseRules = loadReleaseRules ( pluginConfig , context ) ;
31
+ const releaseRules = await loadReleaseRules ( pluginConfig , context ) ;
29
32
const config = await loadParserConfig ( pluginConfig , context ) ;
30
33
let releaseType = null ;
31
34
@@ -79,4 +82,4 @@ async function analyzeCommits(pluginConfig, context) {
79
82
return releaseType ;
80
83
}
81
84
82
- module . exports = { analyzeCommits} ;
85
+ export { analyzeCommits } ;
0 commit comments