wisdom 17.0.4 → 17.2.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/ChangeLog +10 -0
- package/bin/wisdom.js +28 -19
- package/lib/parse-commit-type.js +4 -1
- package/lib/runner.js +2 -2
- package/package.json +2 -2
package/ChangeLog
CHANGED
package/bin/wisdom.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {createRequire} from 'node:module';
|
|
4
3
|
import process from 'node:process';
|
|
5
4
|
import wisdom from '../lib/wisdom.js';
|
|
6
5
|
import {choose} from '../lib/prompts.js';
|
|
7
6
|
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
|
-
|
|
10
|
-
const info = () => require('../package.json');
|
|
11
|
-
|
|
12
7
|
let [arg, option] = process.argv.slice(2);
|
|
13
8
|
|
|
14
9
|
if (arg === '--dry-run') {
|
|
@@ -16,21 +11,20 @@ if (arg === '--dry-run') {
|
|
|
16
11
|
option = '--dry-run';
|
|
17
12
|
}
|
|
18
13
|
|
|
19
|
-
if (!arg)
|
|
14
|
+
if (!arg) {
|
|
20
15
|
arg = await choose();
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
process.exit();
|
|
16
|
+
|
|
17
|
+
if (!arg)
|
|
18
|
+
process.exit(1);
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
if (
|
|
28
|
-
|
|
21
|
+
if (/^(-v|--version)$/.test(arg)) {
|
|
22
|
+
await version();
|
|
29
23
|
process.exit();
|
|
30
24
|
}
|
|
31
25
|
|
|
32
|
-
if (/^(-
|
|
33
|
-
|
|
26
|
+
if (!arg || /^(-h|--help)$/.test(arg)) {
|
|
27
|
+
await help();
|
|
34
28
|
process.exit();
|
|
35
29
|
}
|
|
36
30
|
|
|
@@ -53,13 +47,18 @@ wisdom(arg, {
|
|
|
53
47
|
process.stderr.write(`${e.message}\n`);
|
|
54
48
|
});
|
|
55
49
|
|
|
56
|
-
function version() {
|
|
57
|
-
console.log('v' + info().version);
|
|
50
|
+
async function version() {
|
|
51
|
+
console.log('v' + (await info()).version);
|
|
58
52
|
}
|
|
59
53
|
|
|
60
|
-
function help() {
|
|
61
|
-
const bin =
|
|
62
|
-
|
|
54
|
+
async function help() {
|
|
55
|
+
const {default: bin} = await import('../json/bin.json', {
|
|
56
|
+
with: {
|
|
57
|
+
type: 'json',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const usage = 'Usage: ' + (await info()).name + ' [patch|minor|major]';
|
|
63
62
|
|
|
64
63
|
console.log(usage);
|
|
65
64
|
console.log('Options:');
|
|
@@ -69,3 +68,13 @@ function help() {
|
|
|
69
68
|
console.log(line);
|
|
70
69
|
}
|
|
71
70
|
}
|
|
71
|
+
|
|
72
|
+
async function info() {
|
|
73
|
+
const {default: data} = await import('../package.json', {
|
|
74
|
+
with: {
|
|
75
|
+
type: 'json',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return data;
|
|
80
|
+
}
|
package/lib/parse-commit-type.js
CHANGED
package/lib/runner.js
CHANGED
|
@@ -4,7 +4,7 @@ import {execSync} from 'node:child_process';
|
|
|
4
4
|
import {tryCatch} from 'try-catch';
|
|
5
5
|
import {tryToCatch} from 'try-to-catch';
|
|
6
6
|
import _prepend from 'prepend';
|
|
7
|
-
import
|
|
7
|
+
import {updateVersion} from 'version-io';
|
|
8
8
|
import changelog from 'changelog-io';
|
|
9
9
|
import getEnv from './get-env.js';
|
|
10
10
|
import {release} from './release.js';
|
|
@@ -52,7 +52,7 @@ export const run = async (paths, params) => {
|
|
|
52
52
|
emitter.emit('data', 'changelog: false\n');
|
|
53
53
|
},
|
|
54
54
|
'version': async () => {
|
|
55
|
-
await
|
|
55
|
+
await updateVersion(version);
|
|
56
56
|
},
|
|
57
57
|
'build': async () => {
|
|
58
58
|
await runWisdom('wisdom:build', '', version, info, emitter);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wisdom",
|
|
3
|
-
"version": "17.0
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
5
5
|
"description": "configurable publish releases to github and npm",
|
|
6
6
|
"homepage": "http://github.com/coderaiser/wisdom",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"rendy": "^4.1.3",
|
|
49
49
|
"try-catch": "^4.0.6",
|
|
50
50
|
"try-to-catch": "^4.0.2",
|
|
51
|
-
"version-io": "^
|
|
51
|
+
"version-io": "^6.0.0"
|
|
52
52
|
},
|
|
53
53
|
"license": "MIT",
|
|
54
54
|
"engines": {
|