easy-soft-develop 2.1.12 → 2.1.13
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/cli.js
CHANGED
|
@@ -57,6 +57,7 @@ program
|
|
|
57
57
|
.command('publish')
|
|
58
58
|
.description('publish public packages to npm')
|
|
59
59
|
.option('--packages <string>', 'the packages will publish')
|
|
60
|
+
.requiredOption('--opt <string>', 'use npm one-time password', false)
|
|
60
61
|
.action((a, o) => {
|
|
61
62
|
publishToNpm.run(a, o);
|
|
62
63
|
});
|
package/package.json
CHANGED
|
@@ -13,13 +13,15 @@ const {
|
|
|
13
13
|
|
|
14
14
|
exports.run = function (s, o) {
|
|
15
15
|
const {
|
|
16
|
-
_optionValues: { packages },
|
|
16
|
+
_optionValues: { packages, opt },
|
|
17
17
|
} = o;
|
|
18
18
|
|
|
19
19
|
if (checkStringIsEmpty(packages)) {
|
|
20
20
|
exit();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const useOpt = !!opt;
|
|
24
|
+
|
|
23
25
|
const packageList = packages.split(',');
|
|
24
26
|
|
|
25
27
|
promptInfo('publish public packages to npm');
|
|
@@ -30,10 +32,16 @@ exports.run = function (s, o) {
|
|
|
30
32
|
|
|
31
33
|
try {
|
|
32
34
|
promptInfo(
|
|
33
|
-
`package ${name}: npm publish --registry https://registry.npmjs.org
|
|
35
|
+
`package ${name}: npm publish --registry https://registry.npmjs.org/${
|
|
36
|
+
useOpt ? ' --opt' : ''
|
|
37
|
+
}`,
|
|
34
38
|
);
|
|
35
39
|
|
|
36
|
-
exec(
|
|
40
|
+
exec(
|
|
41
|
+
`npm publish --registry https://registry.npmjs.org/${
|
|
42
|
+
useOpt ? ' --opt' : ''
|
|
43
|
+
}`,
|
|
44
|
+
);
|
|
37
45
|
|
|
38
46
|
promptEmptyLine();
|
|
39
47
|
} catch (error) {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
const {
|
|
2
|
-
getDevelopInitialEnvironmentConfig,
|
|
3
|
-
} = require('../config/develop.initial.environment');
|
|
4
1
|
const { fileGlobalHeader } = require('./template.config');
|
|
5
2
|
|
|
6
3
|
const folderPath = './develop/config/package';
|
|
@@ -69,11 +66,6 @@ const globalChildPackageFile = {
|
|
|
69
66
|
};
|
|
70
67
|
|
|
71
68
|
function getGlobalMainPackageFileContent() {
|
|
72
|
-
const developInitialEnvironmentConfig = getDevelopInitialEnvironmentConfig();
|
|
73
|
-
|
|
74
|
-
const publishWithOpt =
|
|
75
|
-
developInitialEnvironmentConfig.publishWithOpt || false;
|
|
76
|
-
|
|
77
69
|
return `${fileGlobalHeader}
|
|
78
70
|
const lintScript = {
|
|
79
71
|
'z:lint:staged': 'npx lint-staged',
|
|
@@ -115,7 +107,7 @@ const environmentScript = {
|
|
|
115
107
|
};
|
|
116
108
|
|
|
117
109
|
const lernaScript = {
|
|
118
|
-
'z:lerna:publish': 'lerna publish --yes
|
|
110
|
+
'z:lerna:publish': 'lerna publish --yes',
|
|
119
111
|
'z:lerna:bootstrap':
|
|
120
112
|
'npm run z:clean && npm run z:husky:install && git pull && npm run z:install',
|
|
121
113
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
const {
|
|
2
|
+
getDevelopInitialEnvironmentConfig,
|
|
3
|
+
} = require('../config/develop.initial.environment');
|
|
1
4
|
const { checkInCollection, checkStringIsEmpty, mkdirSync } = require('./meta');
|
|
2
5
|
const {
|
|
3
6
|
promptSuccess,
|
|
@@ -114,12 +117,17 @@ function adjustMainPackageJsonScript({ scripts }) {
|
|
|
114
117
|
testAllProjects.push(`npm run test:${name}`);
|
|
115
118
|
});
|
|
116
119
|
|
|
120
|
+
const developInitialEnvironmentConfig = getDevelopInitialEnvironmentConfig();
|
|
121
|
+
|
|
122
|
+
const publishWithOpt =
|
|
123
|
+
developInitialEnvironmentConfig.publishWithOpt || false;
|
|
124
|
+
|
|
117
125
|
packageJson.scripts = assignObject(
|
|
118
126
|
{
|
|
119
127
|
'z:build:all': 'echo please supplement build all packages commend',
|
|
120
128
|
'z:publish:npm-all': `easy-soft-develop publish --packages ${publishPackageNameList.join(
|
|
121
129
|
',',
|
|
122
|
-
)}`,
|
|
130
|
+
)}${publishWithOpt ? ' --opt' : ''}`,
|
|
123
131
|
},
|
|
124
132
|
globalScript,
|
|
125
133
|
originalScript || {},
|