easy-soft-develop 2.1.35 → 2.1.37
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 +4 -4
- package/package.json +3 -3
- package/src/cliCollection/create-repository-project.js +9 -0
- package/src/project/initProject.js +18 -42
- package/src/templates/commitlint.config.template.js +1 -1
- package/src/templates/package.template.js +12 -15
- package/src/tools/develop.file.js +1 -1
- package/src/tools/package.dependence.js +1 -1
- package/types/cliCollection/create-lerna-project.d.ts +1 -1
- package/types/cliCollection/create-repository-project.d.ts +1 -0
- package/types/project/initProject.d.ts +1 -1
- package/src/cliCollection/create-lerna-project.js +0 -9
package/bin/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ const updateAllPackageVersion = require('../src/cliCollection/update-all-package
|
|
|
9
9
|
const sleep = require('../src/cliCollection/sleep');
|
|
10
10
|
const publishToNpm = require('../src/cliCollection/publish-to-npm');
|
|
11
11
|
const commitRefresh = require('../src/cliCollection/commit-refresh');
|
|
12
|
-
const
|
|
12
|
+
const createRepositoryProject = require('../src/cliCollection/create-repository-project');
|
|
13
13
|
const clearAllDependence = require('../src/cliCollection/clear-all-dependence');
|
|
14
14
|
const updatePackageFromPackage = require('../src/cliCollection/update-package-from-package');
|
|
15
15
|
const createProjectWithTemplate = require('../src/cliCollection/create-project-with-template');
|
|
@@ -75,11 +75,11 @@ program
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
program
|
|
78
|
-
.command('create-
|
|
79
|
-
.description('create a
|
|
78
|
+
.command('create-project')
|
|
79
|
+
.description('create a repository project')
|
|
80
80
|
.option('--name <string>', 'project name')
|
|
81
81
|
.action((a, o) => {
|
|
82
|
-
|
|
82
|
+
createRepositoryProject.run(a, o);
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
program
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-soft-develop",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.37",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"test:bin:check-all-package-version": "node ./bin/cli.js check-all-package-version",
|
|
31
31
|
"test:bin:code": "node ./bin/cli.js code --dataPath ./develop/generatorCodeSource/code.json",
|
|
32
32
|
"test:bin:create-assist-scripts": "node ./bin/cli.js create-assist-scripts",
|
|
33
|
-
"test:bin:create-
|
|
33
|
+
"test:bin:create-repository-project": "node ./bin/cli.js create-repository-project",
|
|
34
34
|
"test:bin:publish": "node ./bin/cli.js publish --packages ss --otp true",
|
|
35
35
|
"test:bin:sleep": "node ./bin/cli.js sleep --second 2 --showInfo true",
|
|
36
36
|
"test:bin:update-all-package-version": "node ./bin/cli.js update-all-package-version",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@commitlint/cli": "^17.6.6",
|
|
75
75
|
"@commitlint/config-conventional": "^17.6.6",
|
|
76
|
-
"@commitlint/config-
|
|
76
|
+
"@commitlint/config-pnpm-scopes": "^17.6.6",
|
|
77
77
|
"@commitlint/cz-commitlint": "^17.5.0",
|
|
78
78
|
"commitizen": "^4.3.0",
|
|
79
79
|
"conventional-changelog-conventionalcommits": "^6.1.0",
|
|
@@ -29,13 +29,13 @@ const {
|
|
|
29
29
|
createDevelopInitialEnvironmentConfigFile,
|
|
30
30
|
} = require('../config/develop.initial.environment');
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function createRepositoryProjectFolder(name) {
|
|
33
33
|
mkdirSync(`./${name}`);
|
|
34
34
|
|
|
35
35
|
promptSuccess(`step *: create folder ${name} success`);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function createRepositoryPackageJsonFile(repositoryName) {
|
|
39
39
|
const devDependencies = {};
|
|
40
40
|
|
|
41
41
|
let packages = getGlobalDevelopPackages();
|
|
@@ -51,7 +51,7 @@ function createLernaPackageJsonFile(lernaName) {
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
const packageJson = {
|
|
54
|
-
name:
|
|
54
|
+
name: repositoryName,
|
|
55
55
|
version: '1.0.0',
|
|
56
56
|
author: '',
|
|
57
57
|
workspaces: ['packages/*'],
|
|
@@ -82,36 +82,8 @@ function createPnpmWorkspaceFile() {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"packages": ["packages/*"],
|
|
88
|
-
"version": "independent",
|
|
89
|
-
"npmClient": "pnpm",
|
|
90
|
-
"command": {
|
|
91
|
-
"updated": {
|
|
92
|
-
"conventionalCommits": true,
|
|
93
|
-
"changelogPreset": "conventional-changelog-conventionalcommits"
|
|
94
|
-
},
|
|
95
|
-
"version": {
|
|
96
|
-
"conventionalCommits": true,
|
|
97
|
-
"message": "chore(${packageName}): version",
|
|
98
|
-
"changelogPreset": "conventional-changelog-conventionalcommits"
|
|
99
|
-
},
|
|
100
|
-
"publish": {
|
|
101
|
-
"conventionalCommits": true,
|
|
102
|
-
"message": "chore(${packageName}): publish",
|
|
103
|
-
"changelogPreset": "conventional-changelog-conventionalcommits"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
`;
|
|
108
|
-
|
|
109
|
-
let result = writeFileSync(`./lerna.json`, content, { coverFile: true });
|
|
110
|
-
|
|
111
|
-
if (result) {
|
|
112
|
-
promptSuccess(`step *: create lerna.json success`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
85
|
+
// eslint-disable-next-line no-unused-vars
|
|
86
|
+
function createRepositoryConfigFile(packageName) {}
|
|
115
87
|
|
|
116
88
|
function createProjectFolder(name) {
|
|
117
89
|
mkdirSync(`./packages/`);
|
|
@@ -163,6 +135,9 @@ function createHusky() {
|
|
|
163
135
|
const commitMsg = `#!/bin/sh
|
|
164
136
|
. "$(dirname "$0")/_/husky.sh"
|
|
165
137
|
|
|
138
|
+
echo ---------------------
|
|
139
|
+
echo exec husky commit-msg
|
|
140
|
+
|
|
166
141
|
npx commitlint -e $HUSKY_GIT_PARAMS -V
|
|
167
142
|
`;
|
|
168
143
|
|
|
@@ -171,7 +146,8 @@ npx commitlint -e $HUSKY_GIT_PARAMS -V
|
|
|
171
146
|
const precommit = `#!/bin/sh
|
|
172
147
|
. "$(dirname "$0")/_/husky.sh"
|
|
173
148
|
|
|
174
|
-
|
|
149
|
+
echo ---------------------
|
|
150
|
+
echo exec husky pre-commit
|
|
175
151
|
`;
|
|
176
152
|
|
|
177
153
|
writeFileSync(`./.husky/pre-commit`, precommit, { coverFile: true });
|
|
@@ -249,19 +225,19 @@ function initialEnvironment() {
|
|
|
249
225
|
exec('npx husky install');
|
|
250
226
|
}
|
|
251
227
|
|
|
252
|
-
function
|
|
228
|
+
function createRepositoryProject(name) {
|
|
253
229
|
if (checkStringIsEmpty(name)) {
|
|
254
230
|
promptError(
|
|
255
|
-
'project name disallow empty, please use create-
|
|
231
|
+
'project name disallow empty, please use create-repository-project --name name or get info with create-repository-project --help',
|
|
256
232
|
);
|
|
257
233
|
|
|
258
234
|
return;
|
|
259
235
|
}
|
|
260
|
-
const
|
|
236
|
+
const repositoryName = `mono-${name}`;
|
|
261
237
|
|
|
262
|
-
|
|
238
|
+
createRepositoryProjectFolder(repositoryName);
|
|
263
239
|
|
|
264
|
-
cd(`./${
|
|
240
|
+
cd(`./${repositoryName}`);
|
|
265
241
|
|
|
266
242
|
if (!existDirectorySync(`./.git`)) {
|
|
267
243
|
promptSuccess(`step *: init git(branch main) success`);
|
|
@@ -283,8 +259,8 @@ function createLernaProject(name) {
|
|
|
283
259
|
promptEmptyLine();
|
|
284
260
|
}
|
|
285
261
|
|
|
286
|
-
|
|
287
|
-
|
|
262
|
+
createRepositoryPackageJsonFile(repositoryName);
|
|
263
|
+
createRepositoryConfigFile(name);
|
|
288
264
|
createPnpmWorkspaceFile();
|
|
289
265
|
|
|
290
266
|
createProjectFolder(name);
|
|
@@ -302,4 +278,4 @@ function createLernaProject(name) {
|
|
|
302
278
|
initialEnvironment();
|
|
303
279
|
}
|
|
304
280
|
|
|
305
|
-
module.exports = {
|
|
281
|
+
module.exports = { createRepositoryProject };
|
|
@@ -6,7 +6,7 @@ const contentFileContent = `${fileGlobalHeader}
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
extends: [
|
|
8
8
|
'@commitlint/config-conventional',
|
|
9
|
-
'@commitlint/config-
|
|
9
|
+
'@commitlint/config-pnpm-scopes',
|
|
10
10
|
],
|
|
11
11
|
parserPreset: 'conventional-changelog-conventionalcommits',
|
|
12
12
|
prompt: {
|
|
@@ -73,28 +73,25 @@ const lintScript = {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const prepareScript = {
|
|
76
|
-
prepare: 'npm run z:husky:install && echo do other prepare work with here',
|
|
76
|
+
prepare: 'pnpm changeset init && npm run z:husky:install && echo do other prepare work with here',
|
|
77
77
|
'z:husky:install':'npx husky install'
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
const toolsScript = {
|
|
81
81
|
postinstall: 'npm run z:initial:environment && echo do other postinstall work with here',
|
|
82
82
|
'z:show:info':
|
|
83
|
-
'echo node version && node --version && echo npm version && npm --version
|
|
84
|
-
"z:show:package": "npx lerna ls -a -l",
|
|
83
|
+
'echo node version && node --version && echo npm version && npm --version',
|
|
85
84
|
"z:sleep": "npx easy-soft-develop sleep --second 2 --showInfo false",
|
|
86
85
|
"z:create:assist-scripts": "npx easy-soft-develop create-assist-scripts",
|
|
87
86
|
"z:update:package-from-package": "node ./develop/assists/update-package-from-package.js",
|
|
88
87
|
};
|
|
89
88
|
|
|
90
89
|
const publishScript = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'prez:publish:build': 'npm run z:install && npm run z:cz && npm run z:build:all',
|
|
97
|
-
'z:publish:build': 'npm run z:publish:lerna',
|
|
90
|
+
'prez:publish:repository': 'npm run z:change:npm:registry:local',
|
|
91
|
+
'z:publish:repository': 'npm run z:repository:publish',
|
|
92
|
+
'postz:publish:repository': 'npm run z:publish:npm-all',
|
|
93
|
+
'prez:publish:build': 'npm run z:install && pnpm changeset && pnpm changeset version && npm run z:cz && npm run z:build:all',
|
|
94
|
+
'z:publish:build': 'npm run z:publish:repository',
|
|
98
95
|
};
|
|
99
96
|
|
|
100
97
|
const cleanScript = {
|
|
@@ -106,14 +103,14 @@ const environmentScript = {
|
|
|
106
103
|
"z:initial:environment": "node ./develop/assists/initial.environment.js",
|
|
107
104
|
};
|
|
108
105
|
|
|
109
|
-
const
|
|
110
|
-
'z:
|
|
111
|
-
'z:
|
|
106
|
+
const repositoryScript = {
|
|
107
|
+
'z:repository:publish': 'pnpm -r publish',
|
|
108
|
+
'z:bootstrap':
|
|
112
109
|
'npm run z:clean && npm run z:husky:install && git pull && npm run z:install',
|
|
113
110
|
};
|
|
114
111
|
|
|
115
112
|
const installScript = {
|
|
116
|
-
"z:reinstall": 'npm run z:
|
|
113
|
+
"z:reinstall": 'npm run z:bootstrap',
|
|
117
114
|
"postinstall": "npm run z:initial:environment",
|
|
118
115
|
"prez:install.global.develop.dependence": "npm run z:change:npm:registry:local",
|
|
119
116
|
"z:install.global.develop.dependence": "node ./develop/assists/install.global.develop.dependence",
|
|
@@ -159,7 +156,7 @@ module.exports = {
|
|
|
159
156
|
...publishScript,
|
|
160
157
|
...cleanScript,
|
|
161
158
|
...environmentScript,
|
|
162
|
-
...
|
|
159
|
+
...repositoryScript,
|
|
163
160
|
...installScript,
|
|
164
161
|
...nrmScript,
|
|
165
162
|
...commitScript,
|
|
@@ -16,7 +16,7 @@ function getGlobalDevelopPackages() {
|
|
|
16
16
|
packages = packages.concat([
|
|
17
17
|
'@commitlint/cli',
|
|
18
18
|
'@commitlint/config-conventional',
|
|
19
|
-
'@commitlint/config-
|
|
19
|
+
'@commitlint/config-pnpm-scopes',
|
|
20
20
|
'@commitlint/cz-commitlint',
|
|
21
21
|
'@pmmmwh/react-refresh-webpack-plugin',
|
|
22
22
|
'commitizen',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function run(s: any, o: any): void;
|
|
1
|
+
export function run(s: any, o: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function run(s: any, o: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function createRepositoryProject(name: any): void;
|