easy-soft-develop 2.0.161 → 2.0.163
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/package.json +1 -1
- package/src/project/initProject.js +15 -6
- package/src/templates/eslint.template.js +43 -12
- package/src/templates/git.template.js +11 -4
- package/src/templates/jest.template.js +48 -0
- package/src/templates/package.template.js +10 -1
- package/src/tools/develop.file.js +21 -0
- package/src/tools/initial.environment.js +21 -4
- package/src/tools/meta.js +16 -3
- package/src/tools/package.dependence.js +90 -0
- package/src/tools/package.install.global.develop.dependence.js +2 -2
- package/src/tools/package.script.js +1 -70
- package/types/templates/jest.template.d.ts +17 -0
- package/types/tools/meta.d.ts +3 -2
- package/types/tools/package.dependence.d.ts +3 -0
- package/types/tools/package.script.d.ts +0 -1
package/package.json
CHANGED
|
@@ -17,11 +17,12 @@ const {
|
|
|
17
17
|
createNcuConfigFile,
|
|
18
18
|
createNpmConfigFile,
|
|
19
19
|
} = require('../tools/develop.file');
|
|
20
|
+
const { globalScript, packageScript } = require('../tools/package.script');
|
|
20
21
|
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = require('../tools/package.
|
|
22
|
+
getGlobalDevelopPackages,
|
|
23
|
+
getMainDevelopPackages,
|
|
24
|
+
getProjectDevelopPackages,
|
|
25
|
+
} = require('../tools/package.dependence');
|
|
25
26
|
|
|
26
27
|
function createLernaProjectFolder(name) {
|
|
27
28
|
mkdirSync(`./${name}`);
|
|
@@ -32,7 +33,11 @@ function createLernaProjectFolder(name) {
|
|
|
32
33
|
function createLernaPackageJsonFile(lernaName) {
|
|
33
34
|
const devDependencies = {};
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
let packages = getGlobalDevelopPackages();
|
|
37
|
+
|
|
38
|
+
packages = packages.concat(getMainDevelopPackages());
|
|
39
|
+
|
|
40
|
+
packages.forEach((o) => {
|
|
36
41
|
if (checkStringIsEmpty(o)) {
|
|
37
42
|
return;
|
|
38
43
|
}
|
|
@@ -115,7 +120,11 @@ function createProjectFolder(name) {
|
|
|
115
120
|
function createPackageJsonFile(name) {
|
|
116
121
|
const devDependencies = {};
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
let packages = getGlobalDevelopPackages();
|
|
124
|
+
|
|
125
|
+
packages = packages.concat(getProjectDevelopPackages());
|
|
126
|
+
|
|
127
|
+
packages.forEach((o) => {
|
|
119
128
|
if (checkStringIsEmpty(o)) {
|
|
120
129
|
return;
|
|
121
130
|
}
|
|
@@ -65,7 +65,7 @@ const contentFile = {
|
|
|
65
65
|
|
|
66
66
|
const configFileContent = `${fileGlobalHeader}
|
|
67
67
|
const { rules } = require('./items/rules');
|
|
68
|
-
const {
|
|
68
|
+
const { parserJsOptions, parserTsOptions } = require('./items/parser');
|
|
69
69
|
const { pluginCollection } = require('./items/plugins');
|
|
70
70
|
const { extendCollection } = require('./items/extends');
|
|
71
71
|
const { settings } = require('./items/settings');
|
|
@@ -84,11 +84,16 @@ module.exports = {
|
|
|
84
84
|
shelljs: true,
|
|
85
85
|
node: true,
|
|
86
86
|
},
|
|
87
|
-
plugins: [
|
|
88
|
-
|
|
87
|
+
plugins: [...pluginCollection],
|
|
88
|
+
parser: '@babel/eslint-parser',
|
|
89
|
+
parserOptions: parserJsOptions,
|
|
90
|
+
overrides: [
|
|
91
|
+
{
|
|
92
|
+
files: ['*.ts', '*.tsx'],
|
|
93
|
+
parser: '@typescript-eslint/parser',
|
|
94
|
+
parserOptions: parserTsOptions,
|
|
95
|
+
},
|
|
89
96
|
],
|
|
90
|
-
parser: '@typescript-eslint/parser',
|
|
91
|
-
parserOptions: parserOptions,
|
|
92
97
|
rules: rules,
|
|
93
98
|
settings: settings,
|
|
94
99
|
},
|
|
@@ -437,10 +442,26 @@ const pluginFile = {
|
|
|
437
442
|
};
|
|
438
443
|
|
|
439
444
|
const parserEmbedFileContent = `${fileGlobalHeader}
|
|
440
|
-
const
|
|
445
|
+
const parserJsOptions = {
|
|
446
|
+
requireConfigFile: false,
|
|
447
|
+
babelOptions: {
|
|
448
|
+
presets: ['@babel/preset-react'],
|
|
449
|
+
plugins: [
|
|
450
|
+
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
451
|
+
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
452
|
+
],
|
|
453
|
+
},
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const parserTsOptions = {
|
|
457
|
+
ecmaFeatures: {
|
|
458
|
+
jsx: true,
|
|
459
|
+
},
|
|
460
|
+
};
|
|
441
461
|
|
|
442
462
|
module.exports = {
|
|
443
|
-
|
|
463
|
+
parserJsOptions: { ...parserJsOptions },
|
|
464
|
+
parserTsOptions: { ...parserTsOptions },
|
|
444
465
|
};
|
|
445
466
|
`;
|
|
446
467
|
|
|
@@ -452,10 +473,13 @@ const parserEmbedFile = {
|
|
|
452
473
|
};
|
|
453
474
|
|
|
454
475
|
const parserCustomFileContent = `${fileGlobalHeader}
|
|
455
|
-
const
|
|
476
|
+
const parserJsOptions = {};
|
|
477
|
+
|
|
478
|
+
const parserTsOptions = {};
|
|
456
479
|
|
|
457
480
|
module.exports = {
|
|
458
|
-
|
|
481
|
+
parserJsOptions: { ...parserJsOptions },
|
|
482
|
+
parserTsOptions: { ...parserTsOptions },
|
|
459
483
|
};
|
|
460
484
|
`;
|
|
461
485
|
|
|
@@ -467,11 +491,18 @@ const parserCustomFile = {
|
|
|
467
491
|
};
|
|
468
492
|
|
|
469
493
|
const parserFileContent = `${fileGlobalHeader}
|
|
470
|
-
const {
|
|
471
|
-
|
|
494
|
+
const {
|
|
495
|
+
parserJsOptions: embedParserJsOptions,
|
|
496
|
+
parserTsOptions: embedParserTsOptions,
|
|
497
|
+
} = require('./embed');
|
|
498
|
+
const {
|
|
499
|
+
parserJsOptions: customParserJsOptions,
|
|
500
|
+
parserTsOptions: customParserTsOptions,
|
|
501
|
+
} = require('./custom');
|
|
472
502
|
|
|
473
503
|
module.exports = {
|
|
474
|
-
|
|
504
|
+
parserJsOptions: { ...embedParserJsOptions, ...customParserJsOptions },
|
|
505
|
+
parserTsOptions: { ...embedParserTsOptions, ...customParserTsOptions },
|
|
475
506
|
};
|
|
476
507
|
`;
|
|
477
508
|
|
|
@@ -26,24 +26,31 @@ const attributeFile = {
|
|
|
26
26
|
const ignoreFileContent = `${fileGlobalHeader}
|
|
27
27
|
const content = \`# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
28
28
|
|
|
29
|
-
# dependencies
|
|
29
|
+
# ignore dependencies dir
|
|
30
30
|
**/node_modules
|
|
31
31
|
|
|
32
|
-
# ignore dir
|
|
32
|
+
# ignore distribute dir
|
|
33
33
|
**/dist
|
|
34
34
|
**/es
|
|
35
|
+
|
|
36
|
+
# ignore temporary dir
|
|
35
37
|
**/.umi
|
|
36
38
|
**/.umi-production
|
|
39
|
+
|
|
40
|
+
# ignore config dir
|
|
37
41
|
**/.idea
|
|
38
42
|
**/.history
|
|
39
43
|
**/.vs
|
|
40
44
|
|
|
41
|
-
# ignore
|
|
45
|
+
# ignore jest dir
|
|
46
|
+
**/coverage
|
|
47
|
+
|
|
48
|
+
# ignore general file
|
|
42
49
|
*.log
|
|
43
50
|
*.d.ts
|
|
44
51
|
*.bak
|
|
45
52
|
|
|
46
|
-
# ignore special
|
|
53
|
+
# ignore special file
|
|
47
54
|
rollup.config-*.cjs
|
|
48
55
|
yarn.lock
|
|
49
56
|
package-lock.json
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const { fileGlobalHeader } = require('./template.config');
|
|
2
|
+
|
|
3
|
+
const folderPath = './develop/config/jest';
|
|
4
|
+
|
|
5
|
+
const configFileContent = `${fileGlobalHeader}
|
|
6
|
+
const content = \`${fileGlobalHeader}
|
|
7
|
+
module.exports = {
|
|
8
|
+
collectCoverage: true,
|
|
9
|
+
verbose: true,
|
|
10
|
+
};
|
|
11
|
+
\`;
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
content,
|
|
15
|
+
};
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
const configFile = {
|
|
19
|
+
folderPath: `${folderPath}/template`,
|
|
20
|
+
fileName: 'content.js',
|
|
21
|
+
coverFile: true,
|
|
22
|
+
fileContent: configFileContent,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const simpleTestFileContent = `${fileGlobalHeader}
|
|
26
|
+
const content = \`test('jest simple', () => {
|
|
27
|
+
expect(true).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
\`;
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
content,
|
|
33
|
+
};
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const simpleTestFile = {
|
|
37
|
+
folderPath: `${folderPath}/template`,
|
|
38
|
+
fileName: 'simple.test.content.js',
|
|
39
|
+
coverFile: true,
|
|
40
|
+
fileContent: configFileContent,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
configFileContent,
|
|
45
|
+
configFile,
|
|
46
|
+
simpleTestFileContent,
|
|
47
|
+
simpleTestFile,
|
|
48
|
+
};
|
|
@@ -44,12 +44,17 @@ const tscScript = {
|
|
|
44
44
|
'z:tsc:build': 'echo show tsc version and create declaration file && tsc -v && tsc -p ./tsconfig.types.json && echo declaration file generate complete',
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
const jestScript = {
|
|
48
|
+
'z:test': 'cross-env NODE_ENV=test jest',
|
|
49
|
+
};
|
|
50
|
+
|
|
47
51
|
module.exports = {
|
|
48
52
|
...commitScript,
|
|
49
53
|
...documentationScript,
|
|
50
54
|
...lintScript,
|
|
51
55
|
...prettierScript,
|
|
52
56
|
...tscScript,
|
|
57
|
+
...jestScript,
|
|
53
58
|
};
|
|
54
59
|
`;
|
|
55
60
|
|
|
@@ -123,7 +128,7 @@ const nrmScript = {
|
|
|
123
128
|
|
|
124
129
|
const commitScript = {
|
|
125
130
|
commitlint: 'npx commitlint --edit',
|
|
126
|
-
precz: 'npm run z:commit:refresh && git stage -A',
|
|
131
|
+
precz: 'npm run z:test && npm run z:commit:refresh && git stage -A',
|
|
127
132
|
cz: 'cz',
|
|
128
133
|
postcz: 'git push',
|
|
129
134
|
precommit: 'npm run z:lint:staged:quiet',
|
|
@@ -145,6 +150,10 @@ const ncuScript = {
|
|
|
145
150
|
'postz:update:special-package-version': 'npm run z:install',
|
|
146
151
|
};
|
|
147
152
|
|
|
153
|
+
const jestScript = {
|
|
154
|
+
'z:test': '',
|
|
155
|
+
};
|
|
156
|
+
|
|
148
157
|
module.exports = {
|
|
149
158
|
...lintScript,
|
|
150
159
|
...prettierScript,
|
|
@@ -62,6 +62,7 @@ const {
|
|
|
62
62
|
contentFile: stylelintContentFile,
|
|
63
63
|
configFile: stylelintConfigFile,
|
|
64
64
|
} = require('../templates/stylelint.template');
|
|
65
|
+
const { configFile: jestConfigFile } = require('../templates/jest.template');
|
|
65
66
|
|
|
66
67
|
const childrenDevelopPackageConfigContent = `${fileGlobalHeader}
|
|
67
68
|
const childrenDevelopPackageList = [];
|
|
@@ -370,6 +371,8 @@ const editorFile = require('../config/editor/template/content');
|
|
|
370
371
|
const editorAttributesFile = require('../config/git/template/attributes.content');
|
|
371
372
|
const editorIgnoreFile = require('../config/git/template/ignore.content');
|
|
372
373
|
const lintStagedFile = require('../config/lint-staged/template/content');
|
|
374
|
+
const jestFile = require('../config/jest/template/content');
|
|
375
|
+
const jestSimpleTestFile = require('../config/jest/template/simple.test.content');
|
|
373
376
|
const mainNecessaryPackageFile = require('../config/package/template/main.content');
|
|
374
377
|
const childrenNecessaryPackageFile = require('../config/package/template/children.content');
|
|
375
378
|
const mainCustomPackageFile = require('../config/package/custom/main.content');
|
|
@@ -397,6 +400,8 @@ const gitAttributesContent = editorAttributesFile.content;
|
|
|
397
400
|
|
|
398
401
|
const gitIgnoreContent = editorIgnoreFile.content;
|
|
399
402
|
const lintStagedRcContent = lintStagedFile.content;
|
|
403
|
+
const jestContent = jestFile.content;
|
|
404
|
+
const jestSimpleTestContent = jestSimpleTestFile.content;
|
|
400
405
|
|
|
401
406
|
const mainFileContentList = [
|
|
402
407
|
{
|
|
@@ -502,6 +507,16 @@ const packageFileContentList = [
|
|
|
502
507
|
content: lintStagedRcContent,
|
|
503
508
|
coverFile: false,
|
|
504
509
|
},
|
|
510
|
+
{
|
|
511
|
+
name: 'jest.config.js',
|
|
512
|
+
content: jestContent,
|
|
513
|
+
coverFile: false,
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: 'simple.test.js',
|
|
517
|
+
content: jestSimpleTestContent,
|
|
518
|
+
coverFile: true,
|
|
519
|
+
},
|
|
505
520
|
];
|
|
506
521
|
|
|
507
522
|
initialEnvironment({
|
|
@@ -627,6 +642,12 @@ function createDevelopFiles(waitMessage = '', successMessage = '') {
|
|
|
627
642
|
|
|
628
643
|
//#endregion
|
|
629
644
|
|
|
645
|
+
//#region jest
|
|
646
|
+
|
|
647
|
+
writeFileWithOptionsSync(jestConfigFile);
|
|
648
|
+
|
|
649
|
+
//#endregion
|
|
650
|
+
|
|
630
651
|
//#region assists
|
|
631
652
|
|
|
632
653
|
createAssistConfigScriptFile();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { checkInCollection } = require('./meta');
|
|
1
|
+
const { checkInCollection, checkStringIsEmpty } = require('./meta');
|
|
2
2
|
const {
|
|
3
3
|
promptSuccess,
|
|
4
4
|
writeFileSync,
|
|
@@ -44,9 +44,17 @@ function createPackageFile(fileWithContentCollection) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
fileWithContentCollection.forEach((o) => {
|
|
47
|
-
const { name, content, coverFile } = o;
|
|
48
|
-
|
|
49
|
-
writeFileSync(
|
|
47
|
+
const { name, relativePath = '', content, coverFile } = o;
|
|
48
|
+
|
|
49
|
+
writeFileSync(
|
|
50
|
+
`${itemPath}${
|
|
51
|
+
checkStringIsEmpty(relativePath) ? '' : `/${relativePath}`
|
|
52
|
+
}/${name}`,
|
|
53
|
+
content,
|
|
54
|
+
{
|
|
55
|
+
coverFile,
|
|
56
|
+
},
|
|
57
|
+
);
|
|
50
58
|
});
|
|
51
59
|
});
|
|
52
60
|
|
|
@@ -83,9 +91,15 @@ function adjustMainPackageJsonScript({ scripts }) {
|
|
|
83
91
|
});
|
|
84
92
|
|
|
85
93
|
const publishPackageNameList = [];
|
|
94
|
+
const testScript = {};
|
|
95
|
+
const testAllProjects = [];
|
|
86
96
|
|
|
87
97
|
loopPackage(({ name }) => {
|
|
88
98
|
publishPackageNameList.push(name);
|
|
99
|
+
|
|
100
|
+
testScript[`test:${name}`] = `cd packages/${name} && npm run test`;
|
|
101
|
+
|
|
102
|
+
testAllProjects.push(`test:${name}`);
|
|
89
103
|
});
|
|
90
104
|
|
|
91
105
|
packageJson.scripts = assignObject(
|
|
@@ -98,6 +112,9 @@ function adjustMainPackageJsonScript({ scripts }) {
|
|
|
98
112
|
globalScript,
|
|
99
113
|
originalScript || {},
|
|
100
114
|
scripts,
|
|
115
|
+
{
|
|
116
|
+
'z:test': testAllProjects.join(' && '),
|
|
117
|
+
},
|
|
101
118
|
);
|
|
102
119
|
|
|
103
120
|
writeJsonFileSync(mainProjectPath, packageJson, { coverFile: true });
|
package/src/tools/meta.js
CHANGED
|
@@ -193,25 +193,38 @@ function writeFileSync(path, content, options = { coverFile: false }) {
|
|
|
193
193
|
|
|
194
194
|
function writeFileWithFolderAndNameSync(
|
|
195
195
|
folderPath,
|
|
196
|
+
relativePath,
|
|
196
197
|
fileName,
|
|
197
198
|
fileContent,
|
|
198
199
|
coverFile = false,
|
|
199
200
|
) {
|
|
200
201
|
mkdirSync(folderPath);
|
|
201
202
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
203
|
+
if (!checkStringIsEmpty(relativePath)) {
|
|
204
|
+
mkdirSync(`${folderPath}/${relativePath}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return writeFileSync(
|
|
208
|
+
`${folderPath}${
|
|
209
|
+
checkStringIsEmpty(relativePath) ? '' : `/${relativePath}`
|
|
210
|
+
}/${fileName}`,
|
|
211
|
+
fileContent,
|
|
212
|
+
{
|
|
213
|
+
coverFile: coverFile,
|
|
214
|
+
},
|
|
215
|
+
);
|
|
205
216
|
}
|
|
206
217
|
|
|
207
218
|
function writeFileWithOptionsSync({
|
|
208
219
|
folderPath,
|
|
220
|
+
relativePath = '',
|
|
209
221
|
fileName,
|
|
210
222
|
fileContent,
|
|
211
223
|
coverFile = false,
|
|
212
224
|
}) {
|
|
213
225
|
return writeFileWithFolderAndNameSync(
|
|
214
226
|
folderPath,
|
|
227
|
+
relativePath,
|
|
215
228
|
fileName,
|
|
216
229
|
fileContent,
|
|
217
230
|
coverFile,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
function getGlobalDevelopPackages() {
|
|
2
|
+
let packages = [];
|
|
3
|
+
|
|
4
|
+
packages = packages.concat([
|
|
5
|
+
'@babel/core',
|
|
6
|
+
'@babel/eslint-parser',
|
|
7
|
+
'@babel/plugin-external-helpers',
|
|
8
|
+
'@babel/plugin-proposal-class-properties',
|
|
9
|
+
'@babel/plugin-proposal-decorators',
|
|
10
|
+
'@babel/plugin-transform-runtime',
|
|
11
|
+
'@babel/preset-env',
|
|
12
|
+
'@babel/preset-react',
|
|
13
|
+
'@babel/runtime',
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
packages = packages.concat([
|
|
17
|
+
'@commitlint/cli',
|
|
18
|
+
'@commitlint/config-conventional',
|
|
19
|
+
'@commitlint/config-lerna-scopes',
|
|
20
|
+
'@commitlint/cz-commitlint',
|
|
21
|
+
'@pmmmwh/react-refresh-webpack-plugin',
|
|
22
|
+
'commitizen',
|
|
23
|
+
'conventional-changelog-conventionalcommits',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
packages = packages.concat([
|
|
27
|
+
'eslint',
|
|
28
|
+
'eslint-config-airbnb',
|
|
29
|
+
'eslint-config-airbnb-typescript',
|
|
30
|
+
'eslint-config-prettier',
|
|
31
|
+
'eslint-formatter-pretty',
|
|
32
|
+
'eslint-import-resolver-typescript',
|
|
33
|
+
'eslint-plugin-eslint-comments',
|
|
34
|
+
'eslint-plugin-import',
|
|
35
|
+
'eslint-plugin-jest',
|
|
36
|
+
'eslint-plugin-jsx-a11y',
|
|
37
|
+
'eslint-plugin-prettier',
|
|
38
|
+
'eslint-plugin-promise',
|
|
39
|
+
'eslint-plugin-react',
|
|
40
|
+
'eslint-plugin-react-hooks',
|
|
41
|
+
'eslint-plugin-simple-import-sort',
|
|
42
|
+
'eslint-plugin-unicorn',
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
packages = packages.concat(['documentation']);
|
|
46
|
+
|
|
47
|
+
packages = packages.concat([
|
|
48
|
+
'prettier',
|
|
49
|
+
'prettier-plugin-organize-imports',
|
|
50
|
+
'prettier-plugin-packagejson',
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
packages = packages.concat([
|
|
54
|
+
'stylelint',
|
|
55
|
+
'stylelint-config-prettier',
|
|
56
|
+
'stylelint-config-standard',
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
packages = packages.concat(['@typescript-eslint/parser']);
|
|
60
|
+
|
|
61
|
+
packages = packages.concat(['@types/node']);
|
|
62
|
+
|
|
63
|
+
packages = packages.concat('rimraf', 'lint-staged', 'husky');
|
|
64
|
+
|
|
65
|
+
packages = packages.concat('easy-soft-develop');
|
|
66
|
+
|
|
67
|
+
return packages;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getProjectDevelopPackages() {
|
|
71
|
+
let packages = [];
|
|
72
|
+
|
|
73
|
+
packages = packages.concat(['jest']);
|
|
74
|
+
|
|
75
|
+
return packages;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getMainDevelopPackages() {
|
|
79
|
+
let packages = [];
|
|
80
|
+
|
|
81
|
+
packages = packages.concat(['@types/jest']);
|
|
82
|
+
|
|
83
|
+
return packages;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = {
|
|
87
|
+
getGlobalDevelopPackages,
|
|
88
|
+
getMainDevelopPackages,
|
|
89
|
+
getProjectDevelopPackages,
|
|
90
|
+
};
|
|
@@ -8,7 +8,7 @@ const {
|
|
|
8
8
|
writeJsonFileSync,
|
|
9
9
|
exec,
|
|
10
10
|
} = require('./meta');
|
|
11
|
-
const {
|
|
11
|
+
const { getGlobalDevelopPackages } = require('./package.dependence');
|
|
12
12
|
const { loopPackage } = require('./package.tools');
|
|
13
13
|
const { updateSpecialPackageVersion } = require('./package.update');
|
|
14
14
|
const { prettierAllPackageJson } = require('./prettier.package.json');
|
|
@@ -95,7 +95,7 @@ function installDevelopDependencePackages({
|
|
|
95
95
|
childrenSpecialDevelopPackageList = [],
|
|
96
96
|
execInstall = true,
|
|
97
97
|
}) {
|
|
98
|
-
const packages =
|
|
98
|
+
const packages = getGlobalDevelopPackages().concat(globalDevelopPackageList);
|
|
99
99
|
|
|
100
100
|
promptInfo(`${packages.join()} will install`);
|
|
101
101
|
|
|
@@ -4,73 +4,4 @@ const globalScript = {
|
|
|
4
4
|
|
|
5
5
|
const packageScript = {};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
let packages = [];
|
|
9
|
-
|
|
10
|
-
packages = packages.concat([
|
|
11
|
-
'@babel/core',
|
|
12
|
-
'@babel/eslint-parser',
|
|
13
|
-
'@babel/plugin-external-helpers',
|
|
14
|
-
'@babel/plugin-proposal-class-properties',
|
|
15
|
-
'@babel/plugin-proposal-decorators',
|
|
16
|
-
'@babel/plugin-transform-runtime',
|
|
17
|
-
'@babel/preset-env',
|
|
18
|
-
'@babel/preset-react',
|
|
19
|
-
'@babel/runtime',
|
|
20
|
-
]);
|
|
21
|
-
|
|
22
|
-
packages = packages.concat([
|
|
23
|
-
'@commitlint/cli',
|
|
24
|
-
'@commitlint/config-conventional',
|
|
25
|
-
'@commitlint/config-lerna-scopes',
|
|
26
|
-
'@commitlint/cz-commitlint',
|
|
27
|
-
'@pmmmwh/react-refresh-webpack-plugin',
|
|
28
|
-
'commitizen',
|
|
29
|
-
'conventional-changelog-conventionalcommits',
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
packages = packages.concat([
|
|
33
|
-
'eslint',
|
|
34
|
-
'eslint-config-airbnb',
|
|
35
|
-
'eslint-config-airbnb-typescript',
|
|
36
|
-
'eslint-config-prettier',
|
|
37
|
-
'eslint-formatter-pretty',
|
|
38
|
-
'eslint-import-resolver-typescript',
|
|
39
|
-
'eslint-plugin-eslint-comments',
|
|
40
|
-
'eslint-plugin-import',
|
|
41
|
-
'eslint-plugin-jest',
|
|
42
|
-
'eslint-plugin-jsx-a11y',
|
|
43
|
-
'eslint-plugin-prettier',
|
|
44
|
-
'eslint-plugin-promise',
|
|
45
|
-
'eslint-plugin-react',
|
|
46
|
-
'eslint-plugin-react-hooks',
|
|
47
|
-
'eslint-plugin-simple-import-sort',
|
|
48
|
-
'eslint-plugin-unicorn',
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
packages = packages.concat(['documentation']);
|
|
52
|
-
|
|
53
|
-
packages = packages.concat([
|
|
54
|
-
'prettier',
|
|
55
|
-
'prettier-plugin-organize-imports',
|
|
56
|
-
'prettier-plugin-packagejson',
|
|
57
|
-
]);
|
|
58
|
-
|
|
59
|
-
packages = packages.concat([
|
|
60
|
-
'stylelint',
|
|
61
|
-
'stylelint-config-prettier',
|
|
62
|
-
'stylelint-config-standard',
|
|
63
|
-
]);
|
|
64
|
-
|
|
65
|
-
packages = packages.concat(['@typescript-eslint/parser']);
|
|
66
|
-
|
|
67
|
-
packages = packages.concat(['@types/node']);
|
|
68
|
-
|
|
69
|
-
packages = packages.concat('rimraf', 'lint-staged', 'husky');
|
|
70
|
-
|
|
71
|
-
packages = packages.concat('easy-soft-develop');
|
|
72
|
-
|
|
73
|
-
return packages;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
module.exports = { globalScript, packageScript, getGlobalPackages };
|
|
7
|
+
module.exports = { globalScript, packageScript };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const configFileContent: string;
|
|
2
|
+
export namespace configFile {
|
|
3
|
+
export const folderPath: string;
|
|
4
|
+
export const fileName: string;
|
|
5
|
+
export const coverFile: boolean;
|
|
6
|
+
export { configFileContent as fileContent };
|
|
7
|
+
}
|
|
8
|
+
export const simpleTestFileContent: string;
|
|
9
|
+
export namespace simpleTestFile {
|
|
10
|
+
const folderPath_1: string;
|
|
11
|
+
export { folderPath_1 as folderPath };
|
|
12
|
+
const fileName_1: string;
|
|
13
|
+
export { fileName_1 as fileName };
|
|
14
|
+
const coverFile_1: boolean;
|
|
15
|
+
export { coverFile_1 as coverFile };
|
|
16
|
+
export { configFileContent as fileContent };
|
|
17
|
+
}
|
package/types/tools/meta.d.ts
CHANGED
|
@@ -27,9 +27,10 @@ export function readJsonFileSync(path: any): any;
|
|
|
27
27
|
export function writeJsonFileSync(path: any, json: any, options?: {
|
|
28
28
|
coverFile: boolean;
|
|
29
29
|
}): boolean;
|
|
30
|
-
export function writeFileWithFolderAndNameSync(folderPath: any, fileName: any, fileContent: any, coverFile?: boolean): boolean;
|
|
31
|
-
export function writeFileWithOptionsSync({ folderPath, fileName, fileContent, coverFile, }: {
|
|
30
|
+
export function writeFileWithFolderAndNameSync(folderPath: any, relativePath: any, fileName: any, fileContent: any, coverFile?: boolean): boolean;
|
|
31
|
+
export function writeFileWithOptionsSync({ folderPath, relativePath, fileName, fileContent, coverFile, }: {
|
|
32
32
|
folderPath: any;
|
|
33
|
+
relativePath?: string | undefined;
|
|
33
34
|
fileName: any;
|
|
34
35
|
fileContent: any;
|
|
35
36
|
coverFile?: boolean | undefined;
|