easy-soft-develop 1.0.2 → 2.0.110
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 +96 -3
- package/package.json +32 -22
- 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 +17 -0
- package/src/index.js +34 -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 +511 -0
- package/src/templates/git.template.js +67 -0
- package/src/templates/lint-staged.template.js +35 -0
- package/src/templates/package.template.js +205 -0
- package/src/templates/prettier.template.js +132 -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 +522 -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 +72 -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/tools/update.package.from.package.js +153 -0
- 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
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
const { fileGlobalHeader } = require('./template.config');
|
|
2
|
+
|
|
3
|
+
const folderPath = './develop/config/eslint';
|
|
4
|
+
|
|
5
|
+
const ignoreFileContent = `${fileGlobalHeader}
|
|
6
|
+
const content = \`#
|
|
7
|
+
**/public
|
|
8
|
+
**/lib
|
|
9
|
+
**/es
|
|
10
|
+
**/.history
|
|
11
|
+
**/.vs
|
|
12
|
+
**/.swc
|
|
13
|
+
|
|
14
|
+
*.d.ts
|
|
15
|
+
*.log
|
|
16
|
+
*.zip
|
|
17
|
+
*.txt
|
|
18
|
+
*.7z
|
|
19
|
+
*.min.js
|
|
20
|
+
rollup.config-*.cjs
|
|
21
|
+
|
|
22
|
+
.eslintrc.js
|
|
23
|
+
.prettierrc.js
|
|
24
|
+
.stylelintrc.js
|
|
25
|
+
\`;
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
content,
|
|
29
|
+
};
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
const ignoreFile = {
|
|
33
|
+
folderPath: `${folderPath}/template`,
|
|
34
|
+
fileName: 'ignore.content.js',
|
|
35
|
+
coverFile: false,
|
|
36
|
+
fileContent: ignoreFileContent,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const contentFileContent = `${fileGlobalHeader}
|
|
40
|
+
const mainContent = \`${fileGlobalHeader}
|
|
41
|
+
const { generalConfig } = require('./develop/config/eslint/config');
|
|
42
|
+
|
|
43
|
+
module.exports = generalConfig;
|
|
44
|
+
\`;
|
|
45
|
+
|
|
46
|
+
const packageContent = \`${fileGlobalHeader}
|
|
47
|
+
const { generalConfig } = require('../../develop/config/eslint/config');
|
|
48
|
+
|
|
49
|
+
module.exports = generalConfig;
|
|
50
|
+
\`;
|
|
51
|
+
|
|
52
|
+
module.exports = {
|
|
53
|
+
mainContent,
|
|
54
|
+
packageContent,
|
|
55
|
+
};`;
|
|
56
|
+
|
|
57
|
+
const contentFile = {
|
|
58
|
+
folderPath: `${folderPath}/template`,
|
|
59
|
+
fileName: 'content.js',
|
|
60
|
+
coverFile: true,
|
|
61
|
+
fileContent: contentFileContent,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const configFileContent = `${fileGlobalHeader}
|
|
65
|
+
const { rules } = require('./items/rules');
|
|
66
|
+
const { parserOptions } = require('./items/parser');
|
|
67
|
+
const { pluginCollection } = require('./items/plugins');
|
|
68
|
+
const { extendCollection } = require('./items/extends');
|
|
69
|
+
const { settings } = require('./items/settings');
|
|
70
|
+
|
|
71
|
+
module.exports = {
|
|
72
|
+
generalConfig: {
|
|
73
|
+
extends: [
|
|
74
|
+
...extendCollection,
|
|
75
|
+
],
|
|
76
|
+
env: {
|
|
77
|
+
es6: true,
|
|
78
|
+
browser: true,
|
|
79
|
+
commonjs: true,
|
|
80
|
+
jest: true,
|
|
81
|
+
worker: true,
|
|
82
|
+
shelljs: true,
|
|
83
|
+
node: true,
|
|
84
|
+
},
|
|
85
|
+
plugins: [
|
|
86
|
+
...pluginCollection,
|
|
87
|
+
],
|
|
88
|
+
parser: '@babel/eslint-parser',
|
|
89
|
+
parserOptions: parserOptions,
|
|
90
|
+
rules: rules,
|
|
91
|
+
settings: settings,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const configFile = {
|
|
97
|
+
folderPath: `${folderPath}/config`,
|
|
98
|
+
fileName: 'index.js',
|
|
99
|
+
coverFile: true,
|
|
100
|
+
fileContent: configFileContent,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const ruleEmbedFileContent = `${fileGlobalHeader}
|
|
104
|
+
const coreRules = {
|
|
105
|
+
camelias: 0,
|
|
106
|
+
'no-bitwise': 0,
|
|
107
|
+
'linebreak-style': 0,
|
|
108
|
+
'generator-star-spacing': 0,
|
|
109
|
+
'operator-linebreak': 0,
|
|
110
|
+
'object-curly-newline': 0,
|
|
111
|
+
'no-use-before-define': 0,
|
|
112
|
+
'no-nested-ternary': 0,
|
|
113
|
+
'no-spaced-func': 2,
|
|
114
|
+
'no-this-before-super': 0,
|
|
115
|
+
'no-var': 1,
|
|
116
|
+
'sort-imports': 0,
|
|
117
|
+
'jsx-quotes': ['error', 'prefer-double'],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const reactRules = {
|
|
121
|
+
'react/sort-comp': 0,
|
|
122
|
+
'react/jsx-uses-react': 'off',
|
|
123
|
+
'react/react-in-jsx-scope': 'off',
|
|
124
|
+
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
|
|
125
|
+
'react/jsx-wrap-multilines': 0,
|
|
126
|
+
'react/prop-types': 0,
|
|
127
|
+
'react/forbid-prop-types': 0,
|
|
128
|
+
'react/jsx-one-expression-per-line': 0,
|
|
129
|
+
'react/jsx-props-no-spreading': 0,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const jsxRules = {
|
|
133
|
+
'jsx-a11y/no-noninteractive-element-interactions': 0,
|
|
134
|
+
'jsx-a11y/click-events-have-key-events': 0,
|
|
135
|
+
'jsx-a11y/no-static-element-interactions': 0,
|
|
136
|
+
'jsx-a11y/anchor-is-valid': 0,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const typescriptRules = {
|
|
140
|
+
'@typescript-eslint/no-this-alias': ['off'],
|
|
141
|
+
'@typescript-eslint/no-unused-vars': 0,
|
|
142
|
+
'@typescript-eslint/no-invalid-this': 0,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const unicornRules = {
|
|
146
|
+
'unicorn/filename-case': [
|
|
147
|
+
'error',
|
|
148
|
+
{
|
|
149
|
+
cases: {
|
|
150
|
+
kebabCase: true,
|
|
151
|
+
camelCase: true,
|
|
152
|
+
pascalCase: true,
|
|
153
|
+
snakeCase: true,
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
'unicorn/no-null': 0,
|
|
158
|
+
'unicorn/no-this-assignment': 0,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const compatRules = {
|
|
162
|
+
'compat/compat': 0,
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const importRules = {
|
|
166
|
+
'import/export': 'error',
|
|
167
|
+
'import/first': 'error',
|
|
168
|
+
'import/named': 'error',
|
|
169
|
+
'import/newline-after-import': 'error',
|
|
170
|
+
'import/no-absolute-path': 'error',
|
|
171
|
+
// 开启将会极大增加检测执行时间
|
|
172
|
+
'import/no-cycle': 0,
|
|
173
|
+
'import/no-deprecated': 'error',
|
|
174
|
+
'import/no-duplicates': 'error',
|
|
175
|
+
'import/no-unresolved': 'error',
|
|
176
|
+
'import/no-useless-path-segments': 'error',
|
|
177
|
+
'import/no-unused-modules': 'error',
|
|
178
|
+
'import/order': 0,
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const simpleImportSortRules = {
|
|
182
|
+
'simple-import-sort/imports': [
|
|
183
|
+
'error',
|
|
184
|
+
{
|
|
185
|
+
groups: [
|
|
186
|
+
[
|
|
187
|
+
'^(?!taro-fast-)(?!antd-management-fast-)(?!easy-soft-)[a-zA-Z0-9]',
|
|
188
|
+
'^@(?!/)',
|
|
189
|
+
],
|
|
190
|
+
['^(?!@/)(?!easy-soft-)(?!.)'],
|
|
191
|
+
['^easy-soft-'],
|
|
192
|
+
['^(?!@/)(?!antd-management-fast-)(?!.)'],
|
|
193
|
+
['^antd-management-fast-'],
|
|
194
|
+
['^(?!@/)(?!taro-fast-)(?!.)'],
|
|
195
|
+
['^taro-fast-'],
|
|
196
|
+
['^((@/).*|$)'],
|
|
197
|
+
['^\\\\u0000'],
|
|
198
|
+
['^\\\\.\\\\.(?!/?$)', '^\\\\.\\\\./?$'],
|
|
199
|
+
['^\\\\./(?=.*/)(?!/?$)', '^\\\\.(?!/?$)', '^\\\\./?$'],
|
|
200
|
+
['^.+\\\\.s?less$', '^.+\\\\.s?scss$', '^.+\\\\.s?css$'],
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
'simple-import-sort/exports': 'error',
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
module.exports = {
|
|
208
|
+
rules: {
|
|
209
|
+
...coreRules,
|
|
210
|
+
...reactRules,
|
|
211
|
+
...jsxRules,
|
|
212
|
+
...typescriptRules,
|
|
213
|
+
...unicornRules,
|
|
214
|
+
...compatRules,
|
|
215
|
+
...importRules,
|
|
216
|
+
...simpleImportSortRules,
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
`;
|
|
220
|
+
|
|
221
|
+
const ruleEmbedFile = {
|
|
222
|
+
folderPath: `${folderPath}/config/items/rules`,
|
|
223
|
+
fileName: 'embed.js',
|
|
224
|
+
coverFile: true,
|
|
225
|
+
fileContent: ruleEmbedFileContent,
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const ruleCustomFileContent = `${fileGlobalHeader}
|
|
229
|
+
const customRules = {};
|
|
230
|
+
|
|
231
|
+
module.exports = {
|
|
232
|
+
rules: {
|
|
233
|
+
...customRules,
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
`;
|
|
237
|
+
|
|
238
|
+
const ruleCustomFile = {
|
|
239
|
+
folderPath: `${folderPath}/config/items/rules`,
|
|
240
|
+
fileName: 'custom.js',
|
|
241
|
+
coverFile: false,
|
|
242
|
+
fileContent: ruleCustomFileContent,
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const ruleFileContent = `${fileGlobalHeader}
|
|
246
|
+
const { rules: embedRules } = require('./embed');
|
|
247
|
+
const { rules: customRules } = require('./custom');
|
|
248
|
+
|
|
249
|
+
module.exports = {
|
|
250
|
+
rules: {
|
|
251
|
+
...embedRules,
|
|
252
|
+
...customRules,
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
`;
|
|
256
|
+
|
|
257
|
+
const ruleFile = {
|
|
258
|
+
folderPath: `${folderPath}/config/items/rules`,
|
|
259
|
+
fileName: 'index.js',
|
|
260
|
+
coverFile: true,
|
|
261
|
+
fileContent: ruleFileContent,
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const settingEmbedFileContent = `${fileGlobalHeader}
|
|
265
|
+
const items = {
|
|
266
|
+
'import/parsers': {
|
|
267
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
268
|
+
},
|
|
269
|
+
'import/resolver': {
|
|
270
|
+
node: {
|
|
271
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
272
|
+
moduleDirectory: ['src', 'node_modules'],
|
|
273
|
+
},
|
|
274
|
+
typescript: {
|
|
275
|
+
// always try to resolve types under \`<root>@types\` directory even it doesn't contain any source code, like \`@types/unIst\`
|
|
276
|
+
alwaysTryTypes: true,
|
|
277
|
+
|
|
278
|
+
// use an array of glob patterns
|
|
279
|
+
directory: ['./tsconfig.json', './packages/*/tsconfig.json'],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
module.exports = {
|
|
285
|
+
settings: {
|
|
286
|
+
...items,
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
`;
|
|
290
|
+
|
|
291
|
+
const settingEmbedFile = {
|
|
292
|
+
folderPath: `${folderPath}/config/items/settings`,
|
|
293
|
+
fileName: 'embed.js',
|
|
294
|
+
coverFile: true,
|
|
295
|
+
fileContent: settingEmbedFileContent,
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
const settingCustomFileContent = `${fileGlobalHeader}
|
|
299
|
+
const items = {};
|
|
300
|
+
|
|
301
|
+
module.exports = {
|
|
302
|
+
settings: {
|
|
303
|
+
...items,
|
|
304
|
+
},
|
|
305
|
+
};
|
|
306
|
+
`;
|
|
307
|
+
|
|
308
|
+
const settingCustomFile = {
|
|
309
|
+
folderPath: `${folderPath}/config/items/settings`,
|
|
310
|
+
fileName: 'custom.js',
|
|
311
|
+
coverFile: false,
|
|
312
|
+
fileContent: settingCustomFileContent,
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const settingFileContent = `${fileGlobalHeader}
|
|
316
|
+
const { settings: embedSettings } = require('./embed');
|
|
317
|
+
const { settings: customSettings } = require('./custom');
|
|
318
|
+
|
|
319
|
+
module.exports = {
|
|
320
|
+
settings: {
|
|
321
|
+
...embedSettings,
|
|
322
|
+
...customSettings,
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
`;
|
|
326
|
+
|
|
327
|
+
const settingFile = {
|
|
328
|
+
folderPath: `${folderPath}/config/items/settings`,
|
|
329
|
+
fileName: 'index.js',
|
|
330
|
+
coverFile: true,
|
|
331
|
+
fileContent: settingFileContent,
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const extendEmbedFileContent = `${fileGlobalHeader}
|
|
335
|
+
const extendCollection = [
|
|
336
|
+
'eslint:recommended',
|
|
337
|
+
'plugin:react/recommended',
|
|
338
|
+
'plugin:unicorn/recommended',
|
|
339
|
+
'plugin:promise/recommended',
|
|
340
|
+
'prettier',
|
|
341
|
+
];
|
|
342
|
+
|
|
343
|
+
module.exports = {
|
|
344
|
+
extendCollection: [...extendCollection],
|
|
345
|
+
};
|
|
346
|
+
`;
|
|
347
|
+
|
|
348
|
+
const extendEmbedFile = {
|
|
349
|
+
folderPath: `${folderPath}/config/items/extends`,
|
|
350
|
+
fileName: 'embed.js',
|
|
351
|
+
coverFile: true,
|
|
352
|
+
fileContent: extendEmbedFileContent,
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const extendCustomFileContent = `${fileGlobalHeader}
|
|
356
|
+
const extendCollection = [];
|
|
357
|
+
|
|
358
|
+
module.exports = {
|
|
359
|
+
extendCollection: [...extendCollection],
|
|
360
|
+
};
|
|
361
|
+
`;
|
|
362
|
+
|
|
363
|
+
const extendCustomFile = {
|
|
364
|
+
folderPath: `${folderPath}/config/items/extends`,
|
|
365
|
+
fileName: 'custom.js',
|
|
366
|
+
coverFile: false,
|
|
367
|
+
fileContent: extendCustomFileContent,
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
const extendFileContent = `${fileGlobalHeader}
|
|
371
|
+
const { extendCollection: extendEmbedPlugins } = require('./embed');
|
|
372
|
+
const { extendCollection: extendCustomPlugins } = require('./custom');
|
|
373
|
+
|
|
374
|
+
module.exports = {
|
|
375
|
+
extendCollection: [...extendEmbedPlugins, ...extendCustomPlugins],
|
|
376
|
+
};
|
|
377
|
+
`;
|
|
378
|
+
|
|
379
|
+
const extendFile = {
|
|
380
|
+
folderPath: `${folderPath}/config/items/extends`,
|
|
381
|
+
fileName: 'index.js',
|
|
382
|
+
coverFile: true,
|
|
383
|
+
fileContent: extendFileContent,
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const pluginEmbedFileContent = `${fileGlobalHeader}
|
|
387
|
+
const plugins = [
|
|
388
|
+
'unicorn',
|
|
389
|
+
'simple-import-sort',
|
|
390
|
+
'import',
|
|
391
|
+
'prettier',
|
|
392
|
+
];
|
|
393
|
+
|
|
394
|
+
module.exports = {
|
|
395
|
+
pluginCollection: [...plugins],
|
|
396
|
+
};
|
|
397
|
+
`;
|
|
398
|
+
|
|
399
|
+
const pluginEmbedFile = {
|
|
400
|
+
folderPath: `${folderPath}/config/items/plugins`,
|
|
401
|
+
fileName: 'embed.js',
|
|
402
|
+
coverFile: true,
|
|
403
|
+
fileContent: pluginEmbedFileContent,
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
const pluginCustomFileContent = `${fileGlobalHeader}
|
|
407
|
+
const plugins = [];
|
|
408
|
+
|
|
409
|
+
module.exports = {
|
|
410
|
+
pluginCollection: [...plugins],
|
|
411
|
+
};
|
|
412
|
+
`;
|
|
413
|
+
|
|
414
|
+
const pluginCustomFile = {
|
|
415
|
+
folderPath: `${folderPath}/config/items/plugins`,
|
|
416
|
+
fileName: 'custom.js',
|
|
417
|
+
coverFile: false,
|
|
418
|
+
fileContent: pluginCustomFileContent,
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
const pluginFileContent = `${fileGlobalHeader}
|
|
422
|
+
const { pluginCollection: embedPlugins } = require('./embed');
|
|
423
|
+
const { pluginCollection: customPlugins } = require('./custom');
|
|
424
|
+
|
|
425
|
+
module.exports = {
|
|
426
|
+
pluginCollection: [...embedPlugins, ...customPlugins],
|
|
427
|
+
};
|
|
428
|
+
`;
|
|
429
|
+
|
|
430
|
+
const pluginFile = {
|
|
431
|
+
folderPath: `${folderPath}/config/items/plugins`,
|
|
432
|
+
fileName: 'index.js',
|
|
433
|
+
coverFile: true,
|
|
434
|
+
fileContent: pluginFileContent,
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
const parserEmbedFileContent = `${fileGlobalHeader}
|
|
438
|
+
const parserOptions = {
|
|
439
|
+
requireConfigFile: false,
|
|
440
|
+
babelOptions: {
|
|
441
|
+
presets: ['@babel/preset-react'],
|
|
442
|
+
plugins: [
|
|
443
|
+
['@babel/plugin-proposal-decorators', { legacy: true }],
|
|
444
|
+
['@babel/plugin-proposal-class-properties', { loose: true }],
|
|
445
|
+
],
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
module.exports = {
|
|
450
|
+
parserOptions: { ...parserOptions },
|
|
451
|
+
};
|
|
452
|
+
`;
|
|
453
|
+
|
|
454
|
+
const parserEmbedFile = {
|
|
455
|
+
folderPath: `${folderPath}/config/items/parser`,
|
|
456
|
+
fileName: 'embed.js',
|
|
457
|
+
coverFile: true,
|
|
458
|
+
fileContent: parserEmbedFileContent,
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
const parserCustomFileContent = `${fileGlobalHeader}
|
|
462
|
+
const parserOptions = {};
|
|
463
|
+
|
|
464
|
+
module.exports = {
|
|
465
|
+
parserOptions: { ...parserOptions },
|
|
466
|
+
};
|
|
467
|
+
`;
|
|
468
|
+
|
|
469
|
+
const parserCustomFile = {
|
|
470
|
+
folderPath: `${folderPath}/config/items/parser`,
|
|
471
|
+
fileName: 'custom.js',
|
|
472
|
+
coverFile: false,
|
|
473
|
+
fileContent: parserCustomFileContent,
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
const parserFileContent = `${fileGlobalHeader}
|
|
477
|
+
const { parserOptions: embedParserOptions } = require('./embed');
|
|
478
|
+
const { parserOptions: customParserOptions } = require('./custom');
|
|
479
|
+
|
|
480
|
+
module.exports = {
|
|
481
|
+
parserOptions: { ...embedParserOptions, ...customParserOptions },
|
|
482
|
+
};
|
|
483
|
+
`;
|
|
484
|
+
|
|
485
|
+
const parserFile = {
|
|
486
|
+
folderPath: `${folderPath}/config/items/parser`,
|
|
487
|
+
fileName: 'index.js',
|
|
488
|
+
coverFile: false,
|
|
489
|
+
fileContent: parserFileContent,
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
module.exports = {
|
|
493
|
+
ignoreFile,
|
|
494
|
+
contentFile,
|
|
495
|
+
ruleEmbedFile,
|
|
496
|
+
ruleCustomFile,
|
|
497
|
+
ruleFile,
|
|
498
|
+
configFile,
|
|
499
|
+
extendEmbedFile,
|
|
500
|
+
extendCustomFile,
|
|
501
|
+
extendFile,
|
|
502
|
+
pluginEmbedFile,
|
|
503
|
+
pluginCustomFile,
|
|
504
|
+
pluginFile,
|
|
505
|
+
parserEmbedFile,
|
|
506
|
+
parserCustomFile,
|
|
507
|
+
parserFile,
|
|
508
|
+
settingEmbedFile,
|
|
509
|
+
settingCustomFile,
|
|
510
|
+
settingFile,
|
|
511
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const { fileGlobalHeader } = require('./template.config');
|
|
2
|
+
|
|
3
|
+
const folderPath = './develop/config/git';
|
|
4
|
+
|
|
5
|
+
const attributeFileContent = `${fileGlobalHeader}
|
|
6
|
+
const content = \`*.js eol=lf
|
|
7
|
+
*.jsx eol=lf
|
|
8
|
+
*.json eol=lf
|
|
9
|
+
*.css eol=lf
|
|
10
|
+
*.less eol=lf
|
|
11
|
+
*.scss eol=lf
|
|
12
|
+
\`;
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
content,
|
|
16
|
+
};
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const attributeFile = {
|
|
20
|
+
folderPath: `${folderPath}/template`,
|
|
21
|
+
fileName: 'attributes.content.js',
|
|
22
|
+
coverFile: true,
|
|
23
|
+
fileContent: attributeFileContent,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const ignoreFileContent = `${fileGlobalHeader}
|
|
27
|
+
const content = \`# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
28
|
+
|
|
29
|
+
# dependencies
|
|
30
|
+
**/node_modules
|
|
31
|
+
|
|
32
|
+
# ignore dir
|
|
33
|
+
**/dist
|
|
34
|
+
**/es
|
|
35
|
+
**/.umi
|
|
36
|
+
**/.umi-production
|
|
37
|
+
**/.idea
|
|
38
|
+
**/.history
|
|
39
|
+
**/.vs
|
|
40
|
+
|
|
41
|
+
# ignore file
|
|
42
|
+
*.log
|
|
43
|
+
*.d.ts
|
|
44
|
+
*.bak
|
|
45
|
+
|
|
46
|
+
# ignore special
|
|
47
|
+
rollup.config-*.cjs
|
|
48
|
+
yarn.lock
|
|
49
|
+
package-lock.json
|
|
50
|
+
pnpm-lock.yaml
|
|
51
|
+
.firebase
|
|
52
|
+
.eslintcache
|
|
53
|
+
\`;
|
|
54
|
+
|
|
55
|
+
module.exports = {
|
|
56
|
+
content,
|
|
57
|
+
};
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
const ignoreFile = {
|
|
61
|
+
folderPath: `${folderPath}/template`,
|
|
62
|
+
fileName: 'ignore.content.js',
|
|
63
|
+
coverFile: false,
|
|
64
|
+
fileContent: ignoreFileContent,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
module.exports = { attributeFile, ignoreFile };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const { fileGlobalHeader } = require('./template.config');
|
|
2
|
+
|
|
3
|
+
const folderPath = './develop/config/lint-staged';
|
|
4
|
+
|
|
5
|
+
const contentFileContent = `${fileGlobalHeader}
|
|
6
|
+
const content = \`{
|
|
7
|
+
"*.{md,json}": ["npx prettier --cache --write"],
|
|
8
|
+
"*.{js,jsx}": [
|
|
9
|
+
"npx eslint --ext .js,.jsx,.ts,.tsx",
|
|
10
|
+
"npx prettier --cache --write"
|
|
11
|
+
],
|
|
12
|
+
"*.{css,less,scss}": [
|
|
13
|
+
"stylelint",
|
|
14
|
+
"npx prettier --cache --write"
|
|
15
|
+
],
|
|
16
|
+
"*.{ts,tsx}": [
|
|
17
|
+
"npx eslint --ext .js,.jsx,.ts,.tsx",
|
|
18
|
+
"npx prettier --cache --parser=typescript --write"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
\`;
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
content,
|
|
25
|
+
};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const contentFile = {
|
|
29
|
+
folderPath: `${folderPath}/template`,
|
|
30
|
+
fileName: 'content.js',
|
|
31
|
+
coverFile: false,
|
|
32
|
+
fileContent: contentFileContent,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = { contentFile };
|