easy-soft-develop 1.0.1 → 2.0.82
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 +112 -0
- package/package.json +34 -10
- package/src/cliCollection/check-all-package-version.js +5 -0
- package/src/cliCollection/clear-all-dependence.js +39 -0
- package/src/cliCollection/commit-refresh.js +12 -0
- package/src/cliCollection/create-assist-scripts.cli.js +19 -0
- package/src/cliCollection/create-lerna-project.js +9 -0
- package/src/cliCollection/create-project-with-template.js +61 -0
- package/src/cliCollection/sleep.js +9 -0
- package/src/cliCollection/update-all-package-version.js +5 -0
- package/src/cliCollection/update-package-from-package.js +149 -0
- package/src/index.js +30 -22
- package/src/project/initProject.js +258 -0
- package/src/templates/babel.config.template.js +21 -0
- package/src/templates/commitlint.config.template.js +124 -0
- package/src/templates/editor.template.js +36 -0
- package/src/templates/eslint.template.js +249 -0
- package/src/templates/git.template.js +67 -0
- package/src/templates/lint-staged.template.js +35 -0
- package/src/templates/package.template.js +190 -0
- package/src/templates/prettier.template.js +133 -0
- package/src/templates/stylelint.template.js +79 -0
- package/src/templates/template.config.js +8 -0
- package/src/tools/clean.js +50 -0
- package/src/tools/commit.refresh.js +40 -0
- package/src/tools/develop.file.js +443 -0
- package/src/tools/initial.environment.js +118 -0
- package/src/tools/meta.js +242 -0
- package/src/tools/package.install.global.develop.dependence.js +92 -0
- package/src/tools/package.script.js +75 -0
- package/src/tools/package.tools.js +33 -0
- package/src/{package.update.js → tools/package.update.js} +16 -11
- package/src/tools/prettier.file.js +11 -0
- package/src/tools/prettier.package.json.js +17 -0
- package/src/{sleep.js → tools/sleep.js} +6 -3
- package/src/clean.js +0 -45
- package/src/commit.refresh.js +0 -40
- package/src/develop.assist.js +0 -110
- package/src/init.env.js +0 -146
- package/src/package.init.global.dependence.dev.js +0 -29
- package/src/package.tools.js +0 -32
- package/src/shell.js +0 -9
package/bin/cli.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { Command } = require('commander');
|
|
4
|
+
|
|
5
|
+
const { getArgCollection } = require('../src/tools/meta');
|
|
6
|
+
const createAssistScripts = require('../src/cliCollection/create-assist-scripts.cli');
|
|
7
|
+
const checkAllPackageVersion = require('../src/cliCollection/check-all-package-version');
|
|
8
|
+
const updateAllPackageVersion = require('../src/cliCollection/update-all-package-version');
|
|
9
|
+
const sleep = require('../src/cliCollection/sleep');
|
|
10
|
+
const commitRefresh = require('../src/cliCollection/commit-refresh');
|
|
11
|
+
const createLernaProject = require('../src/cliCollection/create-lerna-project');
|
|
12
|
+
const clearAllDependence = require('../src/cliCollection/clear-all-dependence');
|
|
13
|
+
const updatePackageFromPackage = require('../src/cliCollection/update-package-from-package');
|
|
14
|
+
const createProjectWithTemplate = require('../src/cliCollection/create-project-with-template');
|
|
15
|
+
|
|
16
|
+
const program = new Command();
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line no-undef
|
|
19
|
+
process.title = 'easy-soft-develop';
|
|
20
|
+
|
|
21
|
+
program.version(require('../package').version).usage('<command> [options]');
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.command('create-assist-scripts')
|
|
25
|
+
.description('create assist script files for your project')
|
|
26
|
+
.action(() => {
|
|
27
|
+
createAssistScripts.run();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
program
|
|
31
|
+
.command('check-all-package-version')
|
|
32
|
+
.description('check all package version for your project')
|
|
33
|
+
.action(() => {
|
|
34
|
+
checkAllPackageVersion.run();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
program
|
|
38
|
+
.command('update-all-package-version')
|
|
39
|
+
.description('update all package version for your project')
|
|
40
|
+
.action(() => {
|
|
41
|
+
updateAllPackageVersion.run();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
program
|
|
45
|
+
.command('sleep')
|
|
46
|
+
.description('sleep A few seconds with you want')
|
|
47
|
+
.option('--second <number>', '')
|
|
48
|
+
.option('--showInfo <bool>', 'show wait second info')
|
|
49
|
+
.action((a, o) => {
|
|
50
|
+
sleep.run(a, o);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
program
|
|
54
|
+
.command('commit-refresh')
|
|
55
|
+
.description('update a flag file when commit')
|
|
56
|
+
.option(
|
|
57
|
+
'--fileName <number>',
|
|
58
|
+
'flag file name, default is "commit.flag.json"',
|
|
59
|
+
)
|
|
60
|
+
.option('--relativeFolder <bool>', 'the folder flag file in it')
|
|
61
|
+
.action((a, o) => {
|
|
62
|
+
commitRefresh.run(a, o);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
program
|
|
66
|
+
.command('create-lerna-project')
|
|
67
|
+
.description('create a lerna project')
|
|
68
|
+
.option('--name <string>', 'project name')
|
|
69
|
+
.action((a, o) => {
|
|
70
|
+
createLernaProject.run(a, o);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
program
|
|
74
|
+
.command('clear-package-all-dependence')
|
|
75
|
+
.description('clear package all dependence in package.json file')
|
|
76
|
+
.option('--path <string>', 'package.json file path')
|
|
77
|
+
.action((a, o) => {
|
|
78
|
+
clearAllDependence.run(a, o);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
program
|
|
82
|
+
.command('update-from-package')
|
|
83
|
+
.description('update package from local or remote package.json file')
|
|
84
|
+
.option('--primaryRemoteUrl <string>', 'remote primary package.json file url')
|
|
85
|
+
.option('--spareRemoteUrl <string>', 'remote spare package.json file url')
|
|
86
|
+
.option(
|
|
87
|
+
'--localFile <string>',
|
|
88
|
+
'local package.json file source path, priority use if localFile has value',
|
|
89
|
+
)
|
|
90
|
+
.option(
|
|
91
|
+
'--agent <char>',
|
|
92
|
+
'web agent for remote , if it has value, will use the agent to access remote url',
|
|
93
|
+
)
|
|
94
|
+
.option('--path <char>', 'the package.json file path will update')
|
|
95
|
+
.action((a, o) => {
|
|
96
|
+
updatePackageFromPackage.run(a, o);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
program
|
|
100
|
+
.command('create-project-with-template')
|
|
101
|
+
.description('update package from local or remote package.json file')
|
|
102
|
+
.option('--templateUrl <string>', 'template url with download')
|
|
103
|
+
.option('--folder <string>', 'folder name create project in it')
|
|
104
|
+
.option(
|
|
105
|
+
'--exampleUrl <string>',
|
|
106
|
+
'example url, if it has value, will prompt info after create',
|
|
107
|
+
)
|
|
108
|
+
.action((a, o) => {
|
|
109
|
+
createProjectWithTemplate.run(a, o);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
program.parse(getArgCollection());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-soft-develop",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.82",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"author": "",
|
|
15
15
|
"main": "src/index.js",
|
|
16
|
+
"bin": {
|
|
17
|
+
"easy-soft-develop": "./bin/cli.js"
|
|
18
|
+
},
|
|
16
19
|
"directories": {
|
|
17
20
|
"src": "src"
|
|
18
21
|
},
|
|
@@ -20,18 +23,42 @@
|
|
|
20
23
|
"src/"
|
|
21
24
|
],
|
|
22
25
|
"scripts": {
|
|
26
|
+
"change:nrm:local": "nrm use local",
|
|
27
|
+
"change:nrm:npm": "nrm use npm",
|
|
23
28
|
"commitlint": "npx commitlint --edit",
|
|
24
|
-
"precz": "git stage -A",
|
|
29
|
+
"precz": "node ./bin/cli.js commit-refresh && git stage -A",
|
|
25
30
|
"cz": "cz",
|
|
26
31
|
"postcz": "git push",
|
|
32
|
+
"publish:npm": "npm run publish:patch:npm",
|
|
33
|
+
"prepublish:patch:npm": "npm run cz&& npm version patch && npm run change:nrm:npm",
|
|
34
|
+
"publish:patch:npm": "npm publish",
|
|
35
|
+
"postpublish:patch:npm": "npm run change:nrm:local",
|
|
36
|
+
"test:bin:check-all-package-version": "node ./bin/cli.js check-all-package-version",
|
|
37
|
+
"test:bin:commit-refresh": "node ./bin/cli.js commit-refresh",
|
|
38
|
+
"test:bin:create-assist-scripts": "node ./bin/cli.js create-assist-scripts",
|
|
39
|
+
"test:bin:create-lerna-project": "node ./bin/cli.js create-lerna-project",
|
|
40
|
+
"test:bin:sleep": "node ./bin/cli.js sleep --second 2 --showInfo true",
|
|
41
|
+
"test:bin:update-all-package-version": "node ./bin/cli.js update-all-package-version",
|
|
27
42
|
"test:commitRefresh": "node ./test/commitRefresh.test.js",
|
|
28
43
|
"test:createCleanScriptFile": "node ./test/createCleanScriptFile.test.js",
|
|
29
44
|
"test:createCommitRefreshScriptFile": "node ./test/createCommitRefreshScriptFile.test.js",
|
|
30
45
|
"test:createPackageCheckAllVersionScriptFile": "node ./test/createPackageCheckAllVersionScriptFile.test.js",
|
|
31
46
|
"test:createPackageUpdateAllVersionScriptFile": "node ./test/createPackageUpdateAllVersionScriptFile.test.js",
|
|
32
|
-
"test:createSleepScriptFile": "node ./test/createSleepScriptFile.test.js"
|
|
47
|
+
"test:createSleepScriptFile": "node ./test/createSleepScriptFile.test.js",
|
|
48
|
+
"test:inner:assignObject": "node ./test/assignObject.test.js",
|
|
49
|
+
"z:prettier:format:all": "npx prettier --write ."
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"commander": "^10.0.0",
|
|
53
|
+
"download": "^8.0.0",
|
|
54
|
+
"download-git-repo": "^3.0.2",
|
|
55
|
+
"fs-extra": "^11.1.0",
|
|
56
|
+
"hpagent": "^1.2.0",
|
|
57
|
+
"ping": "^0.4.2",
|
|
58
|
+
"rimraf": "^4.1.2",
|
|
59
|
+
"shelljs": "^0.8.5",
|
|
60
|
+
"terminal-kit": "^3.0.0"
|
|
33
61
|
},
|
|
34
|
-
"dependencies": {},
|
|
35
62
|
"devDependencies": {
|
|
36
63
|
"@commitlint/cli": "^17.4.2",
|
|
37
64
|
"@commitlint/config-conventional": "^17.4.2",
|
|
@@ -47,12 +74,9 @@
|
|
|
47
74
|
"eslint-plugin-import": "^2.27.5",
|
|
48
75
|
"eslint-plugin-prettier": "^4.2.1",
|
|
49
76
|
"eslint-plugin-promise": "^6.1.1",
|
|
50
|
-
"fs-extra": "^11.1.0",
|
|
51
77
|
"husky": "^8.0.3",
|
|
52
|
-
"lint-staged": "^13.1.
|
|
53
|
-
"prettier": "^2.8.
|
|
54
|
-
"prettier-plugin-packagejson": "^2"
|
|
55
|
-
"rimraf": "^4.1.2",
|
|
56
|
-
"shelljs": "^0.8.5"
|
|
78
|
+
"lint-staged": "^13.1.1",
|
|
79
|
+
"prettier": "^2.8.4",
|
|
80
|
+
"prettier-plugin-packagejson": "^2"
|
|
57
81
|
}
|
|
58
82
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const {
|
|
2
|
+
readJsonFileSync,
|
|
3
|
+
writeJsonFileSync,
|
|
4
|
+
promptSuccess,
|
|
5
|
+
promptInfo,
|
|
6
|
+
isObject,
|
|
7
|
+
checkStringIsEmpty,
|
|
8
|
+
promptError,
|
|
9
|
+
exit,
|
|
10
|
+
} = require('../tools/meta');
|
|
11
|
+
|
|
12
|
+
exports.run = async function (s, o) {
|
|
13
|
+
const {
|
|
14
|
+
_optionValues: { path = '' },
|
|
15
|
+
} = o;
|
|
16
|
+
|
|
17
|
+
if (checkStringIsEmpty(path)) {
|
|
18
|
+
promptError(
|
|
19
|
+
'please input package.json file path, use --help to get help info',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
exit();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
promptInfo(`package.json all dependence will clear`);
|
|
26
|
+
|
|
27
|
+
const packageJson = readJsonFileSync(path);
|
|
28
|
+
|
|
29
|
+
if (isObject(packageJson)) {
|
|
30
|
+
packageJson.dependencies = {};
|
|
31
|
+
packageJson.devDependencies = {};
|
|
32
|
+
|
|
33
|
+
writeJsonFileSync(path, packageJson);
|
|
34
|
+
|
|
35
|
+
promptSuccess('package.json all dependence clear success');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exit();
|
|
39
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const { commitRefresh } = require('../tools/commit.refresh');
|
|
2
|
+
|
|
3
|
+
exports.run = function (s, o) {
|
|
4
|
+
const {
|
|
5
|
+
_optionValues: {
|
|
6
|
+
fileName = 'commit.flag.json',
|
|
7
|
+
relativeFolder = 'develop/flags',
|
|
8
|
+
},
|
|
9
|
+
} = o;
|
|
10
|
+
|
|
11
|
+
commitRefresh(fileName, relativeFolder);
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const {
|
|
2
|
+
createDevelopFiles,
|
|
3
|
+
createCommitlintConfigFile,
|
|
4
|
+
createBabelConfigFile,
|
|
5
|
+
createNcuConfigFile,
|
|
6
|
+
createNpmConfigFile,
|
|
7
|
+
} = require('../tools/develop.file');
|
|
8
|
+
|
|
9
|
+
exports.run = function () {
|
|
10
|
+
createDevelopFiles(
|
|
11
|
+
'develop files will update, please wait a moment',
|
|
12
|
+
'develop files update finish',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
createCommitlintConfigFile();
|
|
16
|
+
createBabelConfigFile();
|
|
17
|
+
createNcuConfigFile();
|
|
18
|
+
createNpmConfigFile();
|
|
19
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const download = require('download-git-repo');
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
promptError,
|
|
5
|
+
exit,
|
|
6
|
+
checkStringIsEmpty,
|
|
7
|
+
promptWarn,
|
|
8
|
+
mkdirSync,
|
|
9
|
+
existDirectorySync,
|
|
10
|
+
promptInfo,
|
|
11
|
+
resolvePath,
|
|
12
|
+
promptSuccess,
|
|
13
|
+
} = require('../tools/meta');
|
|
14
|
+
|
|
15
|
+
exports.run = function (s, o) {
|
|
16
|
+
const {
|
|
17
|
+
_optionValues: { templateUrl, folder, exampleUrl = '' },
|
|
18
|
+
} = o;
|
|
19
|
+
|
|
20
|
+
if (checkStringIsEmpty(folder)) {
|
|
21
|
+
promptWarn('Please enter project folder name');
|
|
22
|
+
|
|
23
|
+
exit();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (checkStringIsEmpty(folder)) {
|
|
27
|
+
promptWarn('project folder name not allow empty');
|
|
28
|
+
|
|
29
|
+
exit();
|
|
30
|
+
} else {
|
|
31
|
+
const folderPath = resolvePath(`./${folder}`);
|
|
32
|
+
|
|
33
|
+
if (existDirectorySync(folderPath)) {
|
|
34
|
+
promptWarn('project folder already exist, please choose another');
|
|
35
|
+
|
|
36
|
+
exit();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
mkdirSync(folderPath);
|
|
40
|
+
|
|
41
|
+
promptInfo(`template url:${templateUrl}`);
|
|
42
|
+
promptInfo(`folder:${folder}`);
|
|
43
|
+
promptInfo('download will start, please wait a moment...');
|
|
44
|
+
|
|
45
|
+
download(templateUrl, folderPath, { clone: false }, (err) => {
|
|
46
|
+
if (!err) {
|
|
47
|
+
promptSuccess('download success');
|
|
48
|
+
|
|
49
|
+
if (!checkStringIsEmpty(exampleUrl)) {
|
|
50
|
+
promptInfo(`we build a example project repo is here: ${exampleUrl}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
promptInfo('please modify info in package.json file');
|
|
54
|
+
} else {
|
|
55
|
+
promptError(err);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exit();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
const download = require('download');
|
|
2
|
+
const agent = require('hpagent');
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
promptSuccess,
|
|
6
|
+
promptLine,
|
|
7
|
+
promptError,
|
|
8
|
+
promptWarn,
|
|
9
|
+
exit,
|
|
10
|
+
readJsonFileSync,
|
|
11
|
+
resolvePath,
|
|
12
|
+
writeJsonFileSync,
|
|
13
|
+
checkStringIsEmpty,
|
|
14
|
+
} = require('../tools/meta');
|
|
15
|
+
|
|
16
|
+
const { HttpsProxyAgent } = agent;
|
|
17
|
+
|
|
18
|
+
function handlePackage({ packageFilePath, packageTempPath }) {
|
|
19
|
+
promptSuccess(`referential package.json :${packageTempPath}`);
|
|
20
|
+
|
|
21
|
+
const packageProjectPath = resolvePath(packageFilePath);
|
|
22
|
+
|
|
23
|
+
const packageJsonTemp = readJsonFileSync(packageTempPath);
|
|
24
|
+
|
|
25
|
+
const packageJsonTarget = readJsonFileSync(packageProjectPath);
|
|
26
|
+
|
|
27
|
+
const dependencies = packageJsonTemp.dependencies;
|
|
28
|
+
const devDependencies = packageJsonTemp.devDependencies;
|
|
29
|
+
|
|
30
|
+
packageJsonTarget.dependencies = dependencies;
|
|
31
|
+
packageJsonTarget.devDependencies = devDependencies;
|
|
32
|
+
|
|
33
|
+
writeJsonFileSync(packageProjectPath, packageJsonTarget, { coverFile: true });
|
|
34
|
+
|
|
35
|
+
promptSuccess(`update package.json success!`);
|
|
36
|
+
|
|
37
|
+
promptLine();
|
|
38
|
+
|
|
39
|
+
exit();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function handleTempPackagePath({ agent, localFile, packageUrl, repo }) {
|
|
43
|
+
let packageTempPath = '';
|
|
44
|
+
|
|
45
|
+
if (localFile) {
|
|
46
|
+
promptSuccess(`use local referential package.json`);
|
|
47
|
+
|
|
48
|
+
promptSuccess(`file path: ${localFile}`);
|
|
49
|
+
|
|
50
|
+
promptLine();
|
|
51
|
+
|
|
52
|
+
packageTempPath = resolvePath(localFile);
|
|
53
|
+
} else {
|
|
54
|
+
promptSuccess(`try ${repo} repo`);
|
|
55
|
+
|
|
56
|
+
if (agent) {
|
|
57
|
+
promptSuccess(`agent: ${agent}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
promptSuccess(`${repo} repo: ${packageUrl}`);
|
|
61
|
+
|
|
62
|
+
await download(packageUrl, resolvePath(`./temp`), {
|
|
63
|
+
...(agent
|
|
64
|
+
? {
|
|
65
|
+
agent: {
|
|
66
|
+
https: new HttpsProxyAgent({
|
|
67
|
+
keepAlive: true,
|
|
68
|
+
keepAliveMsecs: 1000,
|
|
69
|
+
maxSockets: 256,
|
|
70
|
+
maxFreeSockets: 256,
|
|
71
|
+
scheduling: 'lifo',
|
|
72
|
+
proxy: agent,
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
: {}),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
promptSuccess(`use ${repo} repo success!`);
|
|
80
|
+
|
|
81
|
+
packageTempPath = resolvePath(`./temp/package.json`);
|
|
82
|
+
|
|
83
|
+
promptSuccess(`packageTempPath: ${packageTempPath}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return packageTempPath;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
exports.run = async function (s, o) {
|
|
90
|
+
const {
|
|
91
|
+
_optionValues: { path, primaryRemoteUrl, spareRemoteUrl, agent, localFile },
|
|
92
|
+
} = o;
|
|
93
|
+
|
|
94
|
+
if (checkStringIsEmpty(primaryRemoteUrl)) {
|
|
95
|
+
promptError('please input primary remote package.json url');
|
|
96
|
+
|
|
97
|
+
exit();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let packageTempPath = '';
|
|
101
|
+
|
|
102
|
+
promptSuccess(`prepare to update package.json: `);
|
|
103
|
+
|
|
104
|
+
promptLine();
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
packageTempPath = await handleTempPackagePath({
|
|
108
|
+
agent,
|
|
109
|
+
localFile,
|
|
110
|
+
packageUrl: primaryRemoteUrl,
|
|
111
|
+
repo: 'github',
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
if (checkStringIsEmpty(primaryRemoteUrl)) {
|
|
115
|
+
promptError('please input spare remote package.json url');
|
|
116
|
+
|
|
117
|
+
exit();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
promptLine();
|
|
121
|
+
|
|
122
|
+
promptWarn(
|
|
123
|
+
`use github repo failure! switch to gitee, gitee repo possible update delay.`,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
promptLine();
|
|
127
|
+
|
|
128
|
+
try {
|
|
129
|
+
packageTempPath = await handleTempPackagePath({
|
|
130
|
+
agent: '',
|
|
131
|
+
localFile,
|
|
132
|
+
packageUrl: spareRemoteUrl,
|
|
133
|
+
repo: 'gitee',
|
|
134
|
+
});
|
|
135
|
+
} catch (error) {
|
|
136
|
+
promptLine();
|
|
137
|
+
|
|
138
|
+
promptError(error);
|
|
139
|
+
|
|
140
|
+
promptLine();
|
|
141
|
+
|
|
142
|
+
promptWarn('download error, please check network');
|
|
143
|
+
|
|
144
|
+
exit();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
handlePackage(path, packageTempPath);
|
|
149
|
+
};
|
package/src/index.js
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
const { clean } = require('./clean');
|
|
2
|
-
const { commitRefresh } = require('./commit.refresh');
|
|
1
|
+
const { clean } = require('./tools/clean');
|
|
2
|
+
const { commitRefresh } = require('./tools/commit.refresh');
|
|
3
3
|
const {
|
|
4
4
|
createCleanScriptFile,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = require('./develop.assist');
|
|
11
|
-
const { initEnv } = require('./init.env');
|
|
5
|
+
createPackageCheckSpecialVersionScriptFile,
|
|
6
|
+
createInstallGlobalDevDependenceScriptFile,
|
|
7
|
+
createDevelopFiles,
|
|
8
|
+
} = require('./tools/develop.file');
|
|
9
|
+
const { initialEnvironment } = require('./tools/initial.environment');
|
|
12
10
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
prettierAllPackageJson,
|
|
12
|
+
prettierCurrentPackageJson,
|
|
13
|
+
} = require('./tools/prettier.package.json');
|
|
14
|
+
const {
|
|
15
|
+
prettierAllFile,
|
|
16
|
+
prettierChangeFile,
|
|
17
|
+
} = require('./tools/prettier.file');
|
|
18
|
+
const {
|
|
19
|
+
installGlobalDevelopDependencePackages,
|
|
20
|
+
} = require('./tools/package.install.global.develop.dependence');
|
|
21
|
+
const { loopPackage } = require('./tools/package.tools');
|
|
16
22
|
const {
|
|
17
23
|
checkAllPackageVersion,
|
|
18
24
|
updateSpecialPackageVersion,
|
|
19
25
|
updateAllPackageVersion,
|
|
20
|
-
} = require('./package.update');
|
|
21
|
-
const { exec } = require('./
|
|
22
|
-
const { sleep } = require('./sleep');
|
|
26
|
+
} = require('./tools/package.update');
|
|
27
|
+
const { exec } = require('./tools/meta');
|
|
28
|
+
const { sleep } = require('./tools/sleep');
|
|
23
29
|
|
|
24
30
|
module.exports = {
|
|
25
31
|
clean,
|
|
26
32
|
commitRefresh,
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
initialEnvironment,
|
|
34
|
+
installGlobalDevelopDependencePackages,
|
|
29
35
|
loopPackage,
|
|
30
36
|
checkAllPackageVersion,
|
|
31
37
|
updateSpecialPackageVersion,
|
|
@@ -33,9 +39,11 @@ module.exports = {
|
|
|
33
39
|
exec,
|
|
34
40
|
sleep,
|
|
35
41
|
createCleanScriptFile,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
createPackageCheckSpecialVersionScriptFile,
|
|
43
|
+
createInstallGlobalDevDependenceScriptFile,
|
|
44
|
+
createDevelopFiles,
|
|
45
|
+
prettierAllFile,
|
|
46
|
+
prettierChangeFile,
|
|
47
|
+
prettierAllPackageJson,
|
|
48
|
+
prettierCurrentPackageJson,
|
|
41
49
|
};
|