wisdom 13.0.0 → 13.0.1
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/bin/wisdom.js +8 -1
- package/json/bin.json +1 -0
- package/lib/parser.js +1 -1
- package/lib/runner.js +4 -4
- package/lib/traverse.js +5 -5
- package/lib/wisdom.js +14 -3
- package/package.json +1 -1
package/bin/wisdom.js
CHANGED
|
@@ -17,12 +17,19 @@ if (!arg || /^(-h|--help)$/.test(arg)) {
|
|
|
17
17
|
process.exit();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
if (/^(-v|--v)$/.test(arg)) {
|
|
21
|
+
version();
|
|
22
|
+
process.exit();
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
if (!/^(patch|minor|major)$/.test(arg)) {
|
|
21
26
|
console.error(`'%s' is not a wisdom option. See 'wisdom --help'`, arg);
|
|
22
27
|
process.exit();
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
const dryRun = arg.includes('--dry-run');
|
|
31
|
+
|
|
32
|
+
wisdom(arg, {dryRun})
|
|
26
33
|
.on('data', (a) => {
|
|
27
34
|
process.stdout.write(a);
|
|
28
35
|
})
|
package/json/bin.json
CHANGED
package/lib/parser.js
CHANGED
package/lib/runner.js
CHANGED
|
@@ -28,10 +28,10 @@ export const run = async (paths, params) => {
|
|
|
28
28
|
} = params;
|
|
29
29
|
|
|
30
30
|
const [error] = await tryToCatch(traverse, paths, {
|
|
31
|
-
'
|
|
31
|
+
'wisdom': async () => {
|
|
32
32
|
await runWisdom('wisdom', '', version, info, emitter);
|
|
33
33
|
},
|
|
34
|
-
'
|
|
34
|
+
'type': async () => {
|
|
35
35
|
await runWisdom('wisdom:type', type, version, info, emitter);
|
|
36
36
|
},
|
|
37
37
|
'changelog:true': async () => {
|
|
@@ -55,7 +55,7 @@ export const run = async (paths, params) => {
|
|
|
55
55
|
'version': async () => {
|
|
56
56
|
await versionio(version);
|
|
57
57
|
},
|
|
58
|
-
'
|
|
58
|
+
'build': async () => {
|
|
59
59
|
await runWisdom('wisdom:build', '', version, info, emitter);
|
|
60
60
|
},
|
|
61
61
|
'commit': () => {
|
|
@@ -79,7 +79,7 @@ export const run = async (paths, params) => {
|
|
|
79
79
|
'publish': () => {
|
|
80
80
|
execute(`npm publish`, version, cwd);
|
|
81
81
|
},
|
|
82
|
-
'
|
|
82
|
+
'done': async () => {
|
|
83
83
|
await runWisdom('wisdom:done', '', version, info, emitter);
|
|
84
84
|
},
|
|
85
85
|
});
|
package/lib/traverse.js
CHANGED
|
@@ -7,12 +7,12 @@ export const traverse = async (paths, visitors) => {
|
|
|
7
7
|
const [path, value = true] = maybeArray(current);
|
|
8
8
|
|
|
9
9
|
if (path === 'scripts.wisdom') {
|
|
10
|
-
await visitors
|
|
10
|
+
await visitors.wisdom();
|
|
11
11
|
continue;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (path === 'scripts.wisdom:type') {
|
|
15
|
-
await visitors
|
|
15
|
+
await visitors.type();
|
|
16
16
|
continue;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ export const traverse = async (paths, visitors) => {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
if (path === 'scripts:wisdom:build') {
|
|
30
|
-
await visitors
|
|
30
|
+
await visitors.build();
|
|
31
31
|
continue;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -51,8 +51,8 @@ export const traverse = async (paths, visitors) => {
|
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if (path === 'scripts
|
|
55
|
-
await visitors
|
|
54
|
+
if (path === 'scripts.wisdom:done') {
|
|
55
|
+
await visitors.done();
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
58
|
}
|
package/lib/wisdom.js
CHANGED
|
@@ -38,7 +38,7 @@ const setInfoDir = (data) => {
|
|
|
38
38
|
|
|
39
39
|
const getPkg = (data) => data.packageJson;
|
|
40
40
|
|
|
41
|
-
export default (version) => {
|
|
41
|
+
export default (version, {dryRun}) => {
|
|
42
42
|
const emitter = new EventEmitter();
|
|
43
43
|
|
|
44
44
|
const onError = (e) => {
|
|
@@ -50,7 +50,12 @@ export default (version) => {
|
|
|
50
50
|
if (validatePackage({version, emitter, info}))
|
|
51
51
|
return;
|
|
52
52
|
|
|
53
|
-
await publish(
|
|
53
|
+
await publish({
|
|
54
|
+
version,
|
|
55
|
+
info,
|
|
56
|
+
emitter,
|
|
57
|
+
dryRun,
|
|
58
|
+
});
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
readPackageUp()
|
|
@@ -62,7 +67,7 @@ export default (version) => {
|
|
|
62
67
|
return emitter;
|
|
63
68
|
};
|
|
64
69
|
|
|
65
|
-
async function publish(version, info, emitter) {
|
|
70
|
+
async function publish({version, info, emitter, dryRun}) {
|
|
66
71
|
let type = '--';
|
|
67
72
|
|
|
68
73
|
if (!version.indexOf('v')) {
|
|
@@ -84,6 +89,12 @@ async function publish(version, info, emitter) {
|
|
|
84
89
|
});
|
|
85
90
|
|
|
86
91
|
const paths = parse(info);
|
|
92
|
+
|
|
93
|
+
if (dryRun) {
|
|
94
|
+
emitter.emit('data', paths.join('\n'));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
87
98
|
const cwd = InfoDirStore();
|
|
88
99
|
|
|
89
100
|
await run(paths, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wisdom",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
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",
|