easy-soft-develop 2.1.152 → 2.1.157
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 +1 -1
- package/src/templates/eslint.template.js +1 -0
- package/src/templates/ncu.template.js +45 -0
- package/src/tools/develop.file.js +27 -2
- package/types/templates/eslint.template.d.ts +1 -1
- package/types/templates/ncu.template.d.ts +18 -0
package/package.json
CHANGED
|
@@ -274,7 +274,7 @@ function createRepositoryProject(name) {
|
|
|
274
274
|
createCommitlintConfigFile(`step *: create commitlint.config.js success`);
|
|
275
275
|
createCzConfigFile(`step *: create .czrc success`);
|
|
276
276
|
createBabelConfigFile(`step *: create babel.config.js success`);
|
|
277
|
-
createNcuConfigFile(`step *: create .ncurc.
|
|
277
|
+
createNcuConfigFile(`step *: create .ncurc.js success`);
|
|
278
278
|
createNpmConfigFile(`step *: create .npmrc success`);
|
|
279
279
|
createDevelopFiles('', `step *: create develop folder success`);
|
|
280
280
|
createHusky();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const { fileGlobalHeader } = require('./template.config');
|
|
2
|
+
|
|
3
|
+
const folderPath = './develop/config/ncu';
|
|
4
|
+
|
|
5
|
+
const configFileContent = `${fileGlobalHeader}
|
|
6
|
+
module.exports = {};
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
const configFile = {
|
|
10
|
+
folderPath: `${folderPath}/config`,
|
|
11
|
+
fileName: 'index.js',
|
|
12
|
+
coverFile: false,
|
|
13
|
+
fileContent: configFileContent,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const contentFileContent = `${fileGlobalHeader}
|
|
17
|
+
const mainContent = \`${fileGlobalHeader}
|
|
18
|
+
const { generalConfig } = require('./develop/config/ncu/config');
|
|
19
|
+
|
|
20
|
+
module.exports = generalConfig;
|
|
21
|
+
\`;
|
|
22
|
+
|
|
23
|
+
const packageContent = \`${fileGlobalHeader}
|
|
24
|
+
const { generalConfig } = require("../../develop/config/ncu/config");
|
|
25
|
+
|
|
26
|
+
module.exports = generalConfig;
|
|
27
|
+
\`;
|
|
28
|
+
|
|
29
|
+
module.exports = {
|
|
30
|
+
mainContent,
|
|
31
|
+
packageContent,
|
|
32
|
+
};
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
const contentFile = {
|
|
36
|
+
folderPath: `${folderPath}/template`,
|
|
37
|
+
fileName: 'content.js',
|
|
38
|
+
coverFile: true,
|
|
39
|
+
fileContent: contentFileContent,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
module.exports = {
|
|
43
|
+
configFile,
|
|
44
|
+
contentFile,
|
|
45
|
+
};
|
|
@@ -7,7 +7,6 @@ const {
|
|
|
7
7
|
promptEmptyLine,
|
|
8
8
|
writeFileWithOptionsSync,
|
|
9
9
|
checkStringIsEmpty,
|
|
10
|
-
writeJsonFileSync,
|
|
11
10
|
} = require('./meta');
|
|
12
11
|
const { fileGlobalHeader } = require('../templates/template.config');
|
|
13
12
|
const {
|
|
@@ -60,6 +59,10 @@ const {
|
|
|
60
59
|
contentFile: prettierContentFile,
|
|
61
60
|
configFile: prettierConfigFile,
|
|
62
61
|
} = require('../templates/prettier.template');
|
|
62
|
+
const {
|
|
63
|
+
contentFile: ncuContentFile,
|
|
64
|
+
configFile: ncuConfigFile,
|
|
65
|
+
} = require('../templates/ncu.template');
|
|
63
66
|
const {
|
|
64
67
|
ignoreFile: stylelintIgnoreFile,
|
|
65
68
|
contentFile: stylelintContentFile,
|
|
@@ -210,7 +213,7 @@ function createBabelConfigFile(successMessage = '') {
|
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
function createNcuConfigFile(successMessage = '') {
|
|
213
|
-
let result =
|
|
216
|
+
let result = writeFileWithOptionsSync(ncuContentFile);
|
|
214
217
|
|
|
215
218
|
if (result) {
|
|
216
219
|
if (!checkStringIsEmpty(successMessage)) {
|
|
@@ -381,6 +384,7 @@ function createInitialEnvironmentScriptFiles() {
|
|
|
381
384
|
const { initialEnvironment } = require('easy-soft-develop');
|
|
382
385
|
|
|
383
386
|
const eslintFile = require('../config/eslint/template/content');
|
|
387
|
+
const ncuFile = require('../config/ncu/template/content');
|
|
384
388
|
const eslintIgnoreFile = require('../config/eslint/template/ignore.content');
|
|
385
389
|
const prettierFile = require('../config/prettier/template/content');
|
|
386
390
|
const prettierIgnoreFile = require('../config/prettier/template/ignore.content');
|
|
@@ -400,6 +404,9 @@ const childrenCustomPackageFile = require('../config/package/custom/children.con
|
|
|
400
404
|
const mainEslintFileContent = eslintFile.mainContent;
|
|
401
405
|
const packageEslintFileContent = eslintFile.packageContent;
|
|
402
406
|
|
|
407
|
+
const mainNcuFileContent = ncuFile.mainContent;
|
|
408
|
+
const packageNcuFileContent = ncuFile.packageContent;
|
|
409
|
+
|
|
403
410
|
const eslintIgnoreContent = eslintIgnoreFile.content;
|
|
404
411
|
|
|
405
412
|
const mainPrettierContent = prettierFile.mainContent;
|
|
@@ -428,6 +435,11 @@ const mainFileContentList = [
|
|
|
428
435
|
content: mainEslintFileContent,
|
|
429
436
|
coverFile: true,
|
|
430
437
|
},
|
|
438
|
+
{
|
|
439
|
+
name: '.ncurc.js',
|
|
440
|
+
content: mainNcuFileContent,
|
|
441
|
+
coverFile: true,
|
|
442
|
+
},
|
|
431
443
|
{
|
|
432
444
|
name: '.prettierrc.js',
|
|
433
445
|
content: mainPrettierContent,
|
|
@@ -481,6 +493,11 @@ const packageFileContentList = [
|
|
|
481
493
|
content: packageEslintFileContent,
|
|
482
494
|
coverFile: true,
|
|
483
495
|
},
|
|
496
|
+
{
|
|
497
|
+
name: '.ncurc.js',
|
|
498
|
+
content: packageNcuFileContent,
|
|
499
|
+
coverFile: true,
|
|
500
|
+
},
|
|
484
501
|
{
|
|
485
502
|
name: '.prettierrc.js',
|
|
486
503
|
content: packagePrettierContent,
|
|
@@ -655,6 +672,14 @@ function createDevelopFiles(
|
|
|
655
672
|
|
|
656
673
|
//#endregion
|
|
657
674
|
|
|
675
|
+
//#region ncu
|
|
676
|
+
|
|
677
|
+
writeFileWithOptionsSync(ncuContentFile);
|
|
678
|
+
|
|
679
|
+
writeFileWithOptionsSync(ncuConfigFile);
|
|
680
|
+
|
|
681
|
+
//#endregion
|
|
682
|
+
|
|
658
683
|
//#region stylelint
|
|
659
684
|
|
|
660
685
|
writeFileWithOptionsSync(stylelintIgnoreFile);
|
|
@@ -157,7 +157,7 @@ export namespace settingFile {
|
|
|
157
157
|
export { coverFile_17 as coverFile };
|
|
158
158
|
export { settingFileContent as fileContent };
|
|
159
159
|
}
|
|
160
|
-
declare const ignoreFileContent: '/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst content = `#\n**/public\n**/lib\n**/es\n**/docs\n**/coverage\n**/.history\n**/.vs\n**/.swc\n**/docs\n\n*.d.ts\n*.log\n*.zip\n*.txt\n*.7z\n*.min.js\nrollup.config-*.cjs\n\n.eslintrc.js\n.prettierrc.js\n.stylelintrc.js\n.lintstagedrc\n`;\n\nmodule.exports = {\n content,\n};\n';
|
|
160
|
+
declare const ignoreFileContent: '/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst content = `#\n**/public\n**/lib\n**/es\n**/docs\n**/coverage\n**/.history\n**/.vs\n**/.swc\n**/docs\n\n*.d.ts\n*.log\n*.zip\n*.txt\n*.7z\n*.min.js\nrollup.config-*.cjs\n\n.eslintrc.js\n.ncurc.js\n.prettierrc.js\n.stylelintrc.js\n.lintstagedrc\n`;\n\nmodule.exports = {\n content,\n};\n';
|
|
161
161
|
declare const contentFileContent: "/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst mainContent = `/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst { generalConfig } = require('./develop/config/eslint/config');\n\nmodule.exports = generalConfig;\n`;\n\nconst packageContent = `/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst { generalConfig } = require('../../develop/config/eslint/config');\n\nmodule.exports = generalConfig;\n`;\n\nmodule.exports = {\n mainContent,\n packageContent,\n};";
|
|
162
162
|
declare const ruleEmbedFileContent: "/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst coreRules = {\n camelias: 0,\n 'no-bitwise': 0,\n 'linebreak-style': 0,\n 'generator-star-spacing': 0,\n 'operator-linebreak': 0,\n 'object-curly-newline': 0,\n 'no-use-before-define': 0,\n 'no-nested-ternary': 0,\n 'no-spaced-func': 2,\n 'no-this-before-super': 0,\n 'no-var': 1,\n 'sort-imports': 0,\n 'jsx-quotes': ['error', 'prefer-double'],\n};\n\nconst reactRules = {\n 'react/sort-comp': 0,\n 'react/jsx-uses-react': 2,\n 'react/react-in-jsx-scope': 'off',\n 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],\n 'react/jsx-wrap-multilines': 0,\n 'react/prop-types': 0,\n 'react/forbid-prop-types': 0,\n 'react/jsx-one-expression-per-line': 0,\n 'react/jsx-props-no-spreading': 0,\n};\n\nconst jsxRules = {\n 'jsx-a11y/no-noninteractive-element-interactions': 0,\n 'jsx-a11y/click-events-have-key-events': 0,\n 'jsx-a11y/no-static-element-interactions': 0,\n 'jsx-a11y/anchor-is-valid': 0,\n};\n\nconst typescriptRules = {\n '@typescript-eslint/no-this-alias': ['off'],\n '@typescript-eslint/no-unused-vars': 0,\n '@typescript-eslint/no-invalid-this': 0,\n};\n\nconst unicornRules = {\n 'unicorn/filename-case': [\n 'error',\n {\n cases: {\n kebabCase: true,\n camelCase: true,\n pascalCase: true,\n snakeCase: true,\n },\n },\n ],\n 'unicorn/no-null': 0,\n 'unicorn/no-this-assignment': 0,\n};\n\nconst compatRules = {\n 'compat/compat': 0,\n};\n\nconst importRules = {\n 'import/export': 'error',\n 'import/first': 'error',\n 'import/named': 'error',\n 'import/newline-after-import': 'error',\n 'import/no-absolute-path': 'error',\n // 开启将会极大增加检测执行时间\n 'import/no-cycle': 0,\n 'import/no-deprecated': 'error',\n 'import/no-duplicates': 'error',\n 'import/no-unresolved': 'error',\n 'import/no-useless-path-segments': 'error',\n 'import/no-unused-modules': 'error',\n 'import/order': 0,\n};\n\nconst simpleImportSortRules = {\n 'simple-import-sort/imports': [\n 'error',\n {\n groups: [\n [\n '^(?!taro-fast-)(?!antd-management-fast-)(?!easy-soft-)[a-zA-Z0-9]',\n '^@(?!/)',\n ],\n ['^(?!@/)(?!easy-soft-)(?!.)'],\n ['^easy-soft-'],\n ['^(?!@/)(?!antd-management-fast-)(?!.)'],\n ['^antd-management-fast-'],\n ['^(?!@/)(?!taro-fast-)(?!.)'],\n ['^taro-fast-'],\n ['^((@/).*|$)'],\n ['^\\\\u0000'],\n ['^\\\\.\\\\.(?!/?$)', '^\\\\.\\\\./?$'],\n ['^\\\\./(?=.*/)(?!/?$)', '^\\\\.(?!/?$)', '^\\\\./?$'],\n ['^.+\\\\.s?less$', '^.+\\\\.s?scss$', '^.+\\\\.s?css$'],\n ],\n },\n ],\n 'simple-import-sort/exports': 'error',\n};\n\nmodule.exports = {\n rules: {\n ...coreRules,\n ...reactRules,\n ...jsxRules,\n ...typescriptRules,\n ...unicornRules,\n ...compatRules,\n ...importRules,\n ...simpleImportSortRules,\n },\n};\n";
|
|
163
163
|
declare const ruleCustomFileContent: '/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst customRules = {};\n\nmodule.exports = {\n rules: {\n ...customRules,\n },\n};\n';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export namespace configFile {
|
|
2
|
+
export let folderPath: string;
|
|
3
|
+
export let fileName: string;
|
|
4
|
+
export let coverFile: boolean;
|
|
5
|
+
export { configFileContent as fileContent };
|
|
6
|
+
}
|
|
7
|
+
export namespace contentFile {
|
|
8
|
+
let folderPath_1: string;
|
|
9
|
+
export { folderPath_1 as folderPath };
|
|
10
|
+
let fileName_1: string;
|
|
11
|
+
export { fileName_1 as fileName };
|
|
12
|
+
let coverFile_1: boolean;
|
|
13
|
+
export { coverFile_1 as coverFile };
|
|
14
|
+
export { contentFileContent as fileContent };
|
|
15
|
+
}
|
|
16
|
+
declare const configFileContent: '/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nmodule.exports = {};\n';
|
|
17
|
+
declare const contentFileContent: '/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst mainContent = `/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst { generalConfig } = require(\'./develop/config/ncu/config\');\n\nmodule.exports = generalConfig;\n`;\n\nconst packageContent = `/* eslint-disable no-undef */\n/* eslint-disable import/no-commonjs */\n/* eslint-disable unicorn/prefer-module */\n/* eslint-disable no-useless-escape */\n\nconst { generalConfig } = require("../../develop/config/ncu/config");\n\nmodule.exports = generalConfig;\n`;\n\nmodule.exports = {\n mainContent,\n packageContent,\n};\n';
|
|
18
|
+
export {};
|