@jcoreio/toolchain 4.11.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/init.cjs +4 -1
- package/util/parseCommitMessage.cjs +18 -2
package/package.json
CHANGED
package/scripts/init.cjs
CHANGED
|
@@ -35,7 +35,7 @@ async function init(args = []) {
|
|
|
35
35
|
|
|
36
36
|
let selectedToolchains = [...toolchains]
|
|
37
37
|
if (isInteractive) {
|
|
38
|
-
;({ selectedToolchains } = await require('../
|
|
38
|
+
;({ selectedToolchains } = await require('../util/prompt')({
|
|
39
39
|
name: 'selectedToolchains',
|
|
40
40
|
type: 'multiselect',
|
|
41
41
|
message: 'Select toolchains to install',
|
|
@@ -80,6 +80,9 @@ async function init(args = []) {
|
|
|
80
80
|
: [...selectedToolchains].map((t) => `${t}@^${version}`)),
|
|
81
81
|
])
|
|
82
82
|
await execa('tc', ['migrate'])
|
|
83
|
+
if (isInteractive) {
|
|
84
|
+
await execa('tc', ['install-optional-deps'])
|
|
85
|
+
}
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
exports.description = 'install toolchains and migrate'
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
const ParseState = require('./ParseState.cjs')
|
|
2
2
|
const ParseError = require('./ParseError.cjs')
|
|
3
3
|
|
|
4
|
+
const validTypes = [
|
|
5
|
+
'build',
|
|
6
|
+
'chore',
|
|
7
|
+
'ci',
|
|
8
|
+
'docs',
|
|
9
|
+
'feat',
|
|
10
|
+
'fix',
|
|
11
|
+
'perf',
|
|
12
|
+
'refactor',
|
|
13
|
+
'revert',
|
|
14
|
+
'style',
|
|
15
|
+
'test',
|
|
16
|
+
]
|
|
17
|
+
|
|
4
18
|
function parseCommitMessage(message) {
|
|
5
19
|
const state = new ParseState(message)
|
|
6
20
|
const type = state.match(/[^(:! )]+/)
|
|
7
|
-
if (!type ||
|
|
21
|
+
if (!type || !validTypes.includes(type[0])) {
|
|
8
22
|
throw new ParseError(
|
|
9
|
-
|
|
23
|
+
`${
|
|
24
|
+
type ? `invalid type: ${type[0]}` : 'must begin with a type'
|
|
25
|
+
} - valid types are: ${validTypes.join(', ')}`,
|
|
10
26
|
0
|
|
11
27
|
)
|
|
12
28
|
}
|