@naturalcycles/dev-lib 12.1.3 → 12.3.0
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/CHANGELOG.md +28 -0
- package/cfg/eslint-vue.config.js +19 -0
- package/cfg/eslint.config.js +6 -2
- package/cfg/lint-staged.config.js +6 -5
- package/cfg/prettier.config.js +1 -1
- package/dist/bin/bt.js +4 -4
- package/dist/bin/build-copy.js +1 -1
- package/dist/bin/build-prod-esm-cjs.js +1 -1
- package/dist/bin/build-prod.js +1 -1
- package/dist/bin/build.js +3 -3
- package/dist/bin/commitlint-def.js +3 -3
- package/dist/bin/eslint-all.js +1 -1
- package/dist/bin/generate-build-info.js +1 -1
- package/dist/bin/init-from-dev-lib.js +1 -1
- package/dist/bin/lint-all.js +1 -1
- package/dist/bin/lint-circleci.js +1 -1
- package/dist/bin/lint-staged-def.js +1 -1
- package/dist/bin/prettier-all.js +2 -2
- package/dist/bin/stylelint-all.js +2 -2
- package/dist/bin/test-ci.js +2 -2
- package/dist/bin/test-integration-ci.js +2 -2
- package/dist/bin/test-integration.js +2 -2
- package/dist/bin/test-leaks.js +2 -2
- package/dist/bin/test-manual.js +2 -2
- package/dist/bin/test.js +2 -2
- package/dist/bin/tsc-prod.js +1 -1
- package/dist/bin/tsc-scripts.js +1 -1
- package/dist/bin/tslint-all.js +1 -1
- package/dist/bin/update-from-dev-lib.js +1 -1
- package/dist/cmd/build-copy.command.js +1 -1
- package/dist/cmd/build-prod-esm-cjs.command.js +2 -2
- package/dist/cmd/build-prod.command.js +2 -2
- package/dist/cmd/eslint-all.command.js +5 -5
- package/dist/cmd/generate-build-info.command.js +1 -1
- package/dist/cmd/init-from-dev-lib.command.js +1 -1
- package/dist/cmd/lint-all.command.js +10 -10
- package/dist/cmd/lint-circleci.command.js +2 -2
- package/dist/cmd/tsc-prod.command.js +2 -2
- package/dist/cmd/tsc-scripts.command.js +3 -3
- package/dist/cmd/tslint-all.command.js +9 -9
- package/dist/cmd/update-from-dev-lib.command.js +1 -1
- package/dist/index.js +1 -1
- package/dist/util/buildInfo.util.js +5 -5
- package/dist/util/git.util.js +2 -2
- package/dist/util/jest.util.js +5 -5
- package/dist/util/prettier.util.js +1 -1
- package/dist/util/stylelint.util.js +1 -1
- package/dist/util/tsc.util.js +4 -4
- package/dist/util/tslint.util.js +4 -4
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [12.3.0](https://github.com/NaturalCycles/dev-lib/compare/v12.2.0...v12.3.0) (2021-09-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **eslint:** enable eslint-plugin-vue by default ([f554e3c](https://github.com/NaturalCycles/dev-lib/commit/f554e3c30c5945d943e02d8d03e492c55f2fa270))
|
|
7
|
+
|
|
8
|
+
# [12.2.0](https://github.com/NaturalCycles/dev-lib/compare/v12.1.5...v12.2.0) (2021-09-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **eslint:** add `eslint-plugin-prettier` ([a21110e](https://github.com/NaturalCycles/dev-lib/commit/a21110e48d4122b1f1926e6f4863b9e33fe4cad9))
|
|
14
|
+
|
|
15
|
+
## [12.1.5](https://github.com/NaturalCycles/dev-lib/compare/v12.1.4...v12.1.5) (2021-09-14)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* deps ([8792877](https://github.com/NaturalCycles/dev-lib/commit/87928778311b517f0014965dcef91c67aac9854a))
|
|
21
|
+
|
|
22
|
+
## [12.1.4](https://github.com/NaturalCycles/dev-lib/compare/v12.1.3...v12.1.4) (2021-09-10)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* adopt prettier@2.4 ([89fee69](https://github.com/NaturalCycles/dev-lib/commit/89fee69f763ae5e63590541f5e9bdc6bbf8f8c5b))
|
|
28
|
+
|
|
1
29
|
## [12.1.3](https://github.com/NaturalCycles/dev-lib/compare/v12.1.2...v12.1.3) (2021-08-30)
|
|
2
30
|
|
|
3
31
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @naturalcycles/dev-lib/cfg/eslint-vue.config.js
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
extends: [
|
|
6
|
+
'./eslint.config.js',
|
|
7
|
+
'plugin:vue/recommended',
|
|
8
|
+
'prettier', // must go last
|
|
9
|
+
],
|
|
10
|
+
env: {
|
|
11
|
+
browser: true,
|
|
12
|
+
},
|
|
13
|
+
parser: 'vue-eslint-parser',
|
|
14
|
+
parserOptions: {
|
|
15
|
+
parser: '@typescript-eslint/parser',
|
|
16
|
+
extraFileExtensions: ['.vue'],
|
|
17
|
+
},
|
|
18
|
+
rules: {},
|
|
19
|
+
}
|
package/cfg/eslint.config.js
CHANGED
|
@@ -17,10 +17,14 @@ module.exports = {
|
|
|
17
17
|
},
|
|
18
18
|
extends: [
|
|
19
19
|
'eslint:recommended',
|
|
20
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.ts
|
|
20
21
|
'plugin:@typescript-eslint/recommended',
|
|
22
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
|
|
21
23
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
22
24
|
// 'plugin:jest/recommended', // add manually if needed!
|
|
25
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/configs/recommended.js
|
|
23
26
|
'plugin:unicorn/recommended',
|
|
27
|
+
'prettier', // must be last! it only turns off eslint rules that conflict with prettier
|
|
24
28
|
],
|
|
25
29
|
ignorePatterns: ['**/__exclude/**'],
|
|
26
30
|
parser: '@typescript-eslint/parser',
|
|
@@ -30,8 +34,8 @@ module.exports = {
|
|
|
30
34
|
ecmaVersion: 2020,
|
|
31
35
|
},
|
|
32
36
|
plugins: [
|
|
33
|
-
'
|
|
34
|
-
'
|
|
37
|
+
'jsdoc',
|
|
38
|
+
'import',
|
|
35
39
|
'@typescript-eslint',
|
|
36
40
|
'unused-imports',
|
|
37
41
|
// 'jest', // add manually if needed!
|
|
@@ -40,12 +40,13 @@ const linters = {
|
|
|
40
40
|
'./src/**/*.{ts,tsx}': match => {
|
|
41
41
|
const filesList = micromatch.not(match, lintExclude).join(' ')
|
|
42
42
|
if (!filesList) return []
|
|
43
|
+
const filesListNoVue = micromatch.not(filesList, ['**/*.vue']).join(' ')
|
|
43
44
|
return [
|
|
44
|
-
`${eslintCmd} --config ${eslintConfigPathRoot} --parser-options=project:./${tsconfigPathRoot}`,
|
|
45
|
-
tslintCmd
|
|
46
|
-
`${tslintCmd} -p ${tsconfigPathRoot}`,
|
|
47
|
-
prettierCmd
|
|
48
|
-
]
|
|
45
|
+
`${eslintCmd} --config ${eslintConfigPathRoot} --parser-options=project:./${tsconfigPathRoot} ${filesList}`,
|
|
46
|
+
`${tslintCmd} ${filesListNoVue}`,
|
|
47
|
+
`${tslintCmd} -p ${tsconfigPathRoot} ${filesListNoVue}`,
|
|
48
|
+
`${prettierCmd} ${filesList}`,
|
|
49
|
+
]
|
|
49
50
|
},
|
|
50
51
|
|
|
51
52
|
// For all other files we run only Prettier (because e.g TSLint screws *.scss files)
|
package/cfg/prettier.config.js
CHANGED
package/dist/bin/bt.js
CHANGED
|
@@ -6,9 +6,9 @@ const fs = require("fs");
|
|
|
6
6
|
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
7
7
|
const jest_util_1 = require("../util/jest.util");
|
|
8
8
|
const tsc_util_1 = require("../util/tsc.util");
|
|
9
|
-
script_1.runScript(async () => {
|
|
9
|
+
(0, script_1.runScript)(async () => {
|
|
10
10
|
fs.rmSync('./dist', { recursive: true, force: true });
|
|
11
|
-
await tsc_util_1.tsc();
|
|
12
|
-
await tsc_scripts_command_1.tscScriptsCommand();
|
|
13
|
-
await jest_util_1.runJest();
|
|
11
|
+
await (0, tsc_util_1.tsc)();
|
|
12
|
+
await (0, tsc_scripts_command_1.tscScriptsCommand)();
|
|
13
|
+
await (0, jest_util_1.runJest)();
|
|
14
14
|
});
|
package/dist/bin/build-copy.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const build_copy_command_1 = require("../cmd/build-copy.command");
|
|
6
|
-
script_1.runScript(build_copy_command_1.buildCopyCommand);
|
|
6
|
+
(0, script_1.runScript)(build_copy_command_1.buildCopyCommand);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const build_prod_esm_cjs_command_1 = require("../cmd/build-prod-esm-cjs.command");
|
|
6
|
-
script_1.runScript(build_prod_esm_cjs_command_1.buildProdESMCJSCommand);
|
|
6
|
+
(0, script_1.runScript)(build_prod_esm_cjs_command_1.buildProdESMCJSCommand);
|
package/dist/bin/build-prod.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const build_prod_command_1 = require("../cmd/build-prod.command");
|
|
6
|
-
script_1.runScript(build_prod_command_1.buildProdCommand);
|
|
6
|
+
(0, script_1.runScript)(build_prod_command_1.buildProdCommand);
|
package/dist/bin/build.js
CHANGED
|
@@ -5,8 +5,8 @@ const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
7
7
|
const tsc_util_1 = require("../util/tsc.util");
|
|
8
|
-
script_1.runScript(async () => {
|
|
8
|
+
(0, script_1.runScript)(async () => {
|
|
9
9
|
fs.rmSync('./dist', { recursive: true, force: true });
|
|
10
|
-
await tsc_util_1.tsc();
|
|
11
|
-
await tsc_scripts_command_1.tscScriptsCommand();
|
|
10
|
+
await (0, tsc_util_1.tsc)();
|
|
11
|
+
await (0, tsc_scripts_command_1.tscScriptsCommand)();
|
|
12
12
|
});
|
|
@@ -6,13 +6,13 @@ const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
8
8
|
const git_util_1 = require("../util/git.util");
|
|
9
|
-
script_1.runScript(async () => {
|
|
9
|
+
(0, script_1.runScript)(async () => {
|
|
10
10
|
const editMsg = process.argv[process.argv.length - 1] || '.git/COMMIT_EDITMSG';
|
|
11
11
|
console.log(editMsg);
|
|
12
12
|
const cwd = process.cwd();
|
|
13
13
|
const localConfig = `${cwd}/commitlint.config.js`;
|
|
14
14
|
const sharedConfig = `${paths_cnst_1.cfgDir}/commitlint.config.js`;
|
|
15
15
|
const config = fs.existsSync(localConfig) ? localConfig : sharedConfig;
|
|
16
|
-
const env = { GIT_BRANCH: await git_util_1.gitCurrentBranchName() };
|
|
17
|
-
await exec_1.execWithArgs(`commitlint`, [`--edit`, editMsg, `--config`, config], { env });
|
|
16
|
+
const env = { GIT_BRANCH: await (0, git_util_1.gitCurrentBranchName)() };
|
|
17
|
+
await (0, exec_1.execWithArgs)(`commitlint`, [`--edit`, editMsg, `--config`, config], { env });
|
|
18
18
|
});
|
package/dist/bin/eslint-all.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const eslint_all_command_1 = require("../cmd/eslint-all.command");
|
|
6
|
-
script_1.runScript(eslint_all_command_1.eslintAllCommand);
|
|
6
|
+
(0, script_1.runScript)(eslint_all_command_1.eslintAllCommand);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const generate_build_info_command_1 = require("../cmd/generate-build-info.command");
|
|
6
|
-
script_1.runScript(generate_build_info_command_1.generateBuildInfoCommand);
|
|
6
|
+
(0, script_1.runScript)(generate_build_info_command_1.generateBuildInfoCommand);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const init_from_dev_lib_command_1 = require("../cmd/init-from-dev-lib.command");
|
|
6
|
-
script_1.runScript(init_from_dev_lib_command_1.initFromDevLibCommand);
|
|
6
|
+
(0, script_1.runScript)(init_from_dev_lib_command_1.initFromDevLibCommand);
|
package/dist/bin/lint-all.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const lint_all_command_1 = require("../cmd/lint-all.command");
|
|
6
|
-
script_1.runScript(lint_all_command_1.lintAllCommand);
|
|
6
|
+
(0, script_1.runScript)(lint_all_command_1.lintAllCommand);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const lint_circleci_command_1 = require("../cmd/lint-circleci.command");
|
|
6
|
-
script_1.runScript(lint_circleci_command_1.lintCircleCICommand);
|
|
6
|
+
(0, script_1.runScript)(lint_circleci_command_1.lintCircleCICommand);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
7
|
-
script_1.runScript(async () => {
|
|
7
|
+
(0, script_1.runScript)(async () => {
|
|
8
8
|
// const cwd = process.cwd()
|
|
9
9
|
const localConfig = `./lint-staged.config.js`;
|
|
10
10
|
const sharedConfig = `${paths_cnst_1.cfgDir}/lint-staged.config.js`;
|
package/dist/bin/prettier-all.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const prettier_util_1 = require("../util/prettier.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await prettier_util_1.runPrettier();
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, prettier_util_1.runPrettier)();
|
|
8
8
|
});
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const stylelint_util_1 = require("../util/stylelint.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await stylelint_util_1.stylelintAll();
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, stylelint_util_1.stylelintAll)();
|
|
8
8
|
});
|
package/dist/bin/test-ci.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest({ ci: true });
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)({ ci: true });
|
|
8
8
|
});
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest({ integration: true, ci: true });
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)({ integration: true, ci: true });
|
|
8
8
|
});
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest({ integration: true });
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)({ integration: true });
|
|
8
8
|
});
|
package/dist/bin/test-leaks.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest({ leaks: true });
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)({ leaks: true });
|
|
8
8
|
});
|
package/dist/bin/test-manual.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest({ manual: true });
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)({ manual: true });
|
|
8
8
|
});
|
package/dist/bin/test.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const jest_util_1 = require("../util/jest.util");
|
|
6
|
-
script_1.runScript(async () => {
|
|
7
|
-
await jest_util_1.runJest();
|
|
6
|
+
(0, script_1.runScript)(async () => {
|
|
7
|
+
await (0, jest_util_1.runJest)();
|
|
8
8
|
});
|
package/dist/bin/tsc-prod.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const tsc_prod_command_1 = require("../cmd/tsc-prod.command");
|
|
6
|
-
script_1.runScript(tsc_prod_command_1.tscProdCommand);
|
|
6
|
+
(0, script_1.runScript)(tsc_prod_command_1.tscProdCommand);
|
package/dist/bin/tsc-scripts.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
6
|
-
script_1.runScript(tsc_scripts_command_1.tscScriptsCommand);
|
|
6
|
+
(0, script_1.runScript)(tsc_scripts_command_1.tscScriptsCommand);
|
package/dist/bin/tslint-all.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const tslint_all_command_1 = require("../cmd/tslint-all.command");
|
|
6
|
-
script_1.runScript(tslint_all_command_1.tslintAllCommand);
|
|
6
|
+
(0, script_1.runScript)(tslint_all_command_1.tslintAllCommand);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
5
|
const update_from_dev_lib_command_1 = require("../cmd/update-from-dev-lib.command");
|
|
6
|
-
script_1.runScript(update_from_dev_lib_command_1.updateFromDevLibCommand);
|
|
6
|
+
(0, script_1.runScript)(update_from_dev_lib_command_1.updateFromDevLibCommand);
|
|
@@ -17,8 +17,8 @@ async function buildProdESMCJSCommand() {
|
|
|
17
17
|
const cjsPath = cjsExists ? TSCONF_CJS_PATH : TSCONF_PATH;
|
|
18
18
|
const esmPath = esmExists ? TSCONF_ESM_PATH : TSCONF_PATH;
|
|
19
19
|
await Promise.all([
|
|
20
|
-
exec_1.execCommand(`tsc -P ${cjsPath} --outDir ./dist --module commonjs`),
|
|
21
|
-
exec_1.execCommand(`tsc -P ${esmPath} --outDir ./dist-esm --module esnext --declaration false`),
|
|
20
|
+
(0, exec_1.execCommand)(`tsc -P ${cjsPath} --outDir ./dist --module commonjs`),
|
|
21
|
+
(0, exec_1.execCommand)(`tsc -P ${esmPath} --outDir ./dist-esm --module esnext --declaration false`),
|
|
22
22
|
]);
|
|
23
23
|
}
|
|
24
24
|
exports.buildProdESMCJSCommand = buildProdESMCJSCommand;
|
|
@@ -6,7 +6,7 @@ const build_copy_command_1 = require("./build-copy.command");
|
|
|
6
6
|
const tsc_prod_command_1 = require("./tsc-prod.command");
|
|
7
7
|
async function buildProdCommand() {
|
|
8
8
|
fs.rmSync('./dist', { recursive: true, force: true });
|
|
9
|
-
build_copy_command_1.buildCopyCommand();
|
|
10
|
-
await tsc_prod_command_1.tscProdCommand();
|
|
9
|
+
(0, build_copy_command_1.buildCopyCommand)();
|
|
10
|
+
await (0, tsc_prod_command_1.tscProdCommand)();
|
|
11
11
|
}
|
|
12
12
|
exports.buildProdCommand = buildProdCommand;
|
|
@@ -13,14 +13,14 @@ async function eslintAllCommand() {
|
|
|
13
13
|
`${paths_cnst_1.cfgDir}/eslint.config.js`;
|
|
14
14
|
const eslintConfigPathE2e = ['./e2e/.eslintrc.js', './.eslintrc.js'].find(p => fs.existsSync(p)) ||
|
|
15
15
|
`${paths_cnst_1.cfgDir}/eslint.config.js`;
|
|
16
|
-
const tsconfigPath = tslint_util_1.getTSConfigPath();
|
|
17
|
-
const tsconfigPathScripts = tslint_util_1.getTSConfigPathScripts();
|
|
16
|
+
const tsconfigPath = (0, tslint_util_1.getTSConfigPath)();
|
|
17
|
+
const tsconfigPathScripts = (0, tslint_util_1.getTSConfigPathScripts)();
|
|
18
18
|
const tsconfigPathE2e = `./e2e/tsconfig.json`;
|
|
19
19
|
// /src
|
|
20
|
-
await tslint_util_1.runESLint(`./src`, eslintConfigPathRoot, tsconfigPath);
|
|
20
|
+
await (0, tslint_util_1.runESLint)(`./src`, eslintConfigPathRoot, tsconfigPath);
|
|
21
21
|
// /scripts
|
|
22
|
-
await tslint_util_1.runESLint(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts);
|
|
22
|
+
await (0, tslint_util_1.runESLint)(`./scripts`, eslintConfigPathScripts, tsconfigPathScripts);
|
|
23
23
|
// /e2e
|
|
24
|
-
await tslint_util_1.runESLint(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e);
|
|
24
|
+
await (0, tslint_util_1.runESLint)(`./e2e`, eslintConfigPathE2e, tsconfigPathE2e);
|
|
25
25
|
}
|
|
26
26
|
exports.eslintAllCommand = eslintAllCommand;
|
|
@@ -12,7 +12,7 @@ async function generateBuildInfoCommand() {
|
|
|
12
12
|
desc: 'Output directory',
|
|
13
13
|
},
|
|
14
14
|
}).argv;
|
|
15
|
-
const buildInfo = await __1.generateBuildInfo();
|
|
15
|
+
const buildInfo = await (0, __1.generateBuildInfo)();
|
|
16
16
|
console.log(buildInfo);
|
|
17
17
|
if (dir)
|
|
18
18
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -4,7 +4,7 @@ exports.initFromDevLibCommand = void 0;
|
|
|
4
4
|
const fs_1 = require("@naturalcycles/nodejs-lib/dist/fs");
|
|
5
5
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
6
6
|
function initFromDevLibCommand() {
|
|
7
|
-
fs_1.kpySync({
|
|
7
|
+
(0, fs_1.kpySync)({
|
|
8
8
|
baseDir: paths_cnst_1.cfgOverwriteDir,
|
|
9
9
|
outputDir: './',
|
|
10
10
|
dotfiles: true,
|
|
@@ -25,27 +25,27 @@ async function lintAllCommand() {
|
|
|
25
25
|
default: false,
|
|
26
26
|
},
|
|
27
27
|
}).argv;
|
|
28
|
-
const hadChangesBefore = await git_util_1.gitHasUncommittedChanges();
|
|
28
|
+
const hadChangesBefore = await (0, git_util_1.gitHasUncommittedChanges)();
|
|
29
29
|
// Currently we position ESLint before TSLint, but let's monitor if it's ok
|
|
30
|
-
await eslint_all_command_1.eslintAllCommand();
|
|
31
|
-
await tslint_all_command_1.tslintAllCommand();
|
|
32
|
-
await stylelint_util_1.stylelintAll();
|
|
33
|
-
await prettier_util_1.runPrettier();
|
|
30
|
+
await (0, eslint_all_command_1.eslintAllCommand)();
|
|
31
|
+
await (0, tslint_all_command_1.tslintAllCommand)();
|
|
32
|
+
await (0, stylelint_util_1.stylelintAll)();
|
|
33
|
+
await (0, prettier_util_1.runPrettier)();
|
|
34
34
|
if (commitOnChanges || failOnChanges) {
|
|
35
35
|
// detect changes
|
|
36
|
-
const hasChanges = await git_util_1.gitHasUncommittedChanges();
|
|
36
|
+
const hasChanges = await (0, git_util_1.gitHasUncommittedChanges)();
|
|
37
37
|
if (hasChanges) {
|
|
38
38
|
if (hadChangesBefore) {
|
|
39
39
|
console.log(`lint-all: there are changes before running lint-all, will not commit`);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
const msg = 'style(lint-all): ' +
|
|
43
|
-
git_util_1.commitMessageToTitleMessage(await git_util_1.getLastGitCommitMsg()) +
|
|
43
|
+
(0, git_util_1.commitMessageToTitleMessage)(await (0, git_util_1.getLastGitCommitMsg)()) +
|
|
44
44
|
'\n\n[skip ci]';
|
|
45
45
|
// pull, commit, push changes
|
|
46
|
-
await git_util_1.gitPull();
|
|
47
|
-
await git_util_1.gitCommitAll(msg);
|
|
48
|
-
await git_util_1.gitPush();
|
|
46
|
+
await (0, git_util_1.gitPull)();
|
|
47
|
+
await (0, git_util_1.gitCommitAll)(msg);
|
|
48
|
+
await (0, git_util_1.gitPush)();
|
|
49
49
|
}
|
|
50
50
|
// fail on changes
|
|
51
51
|
if (failOnChanges) {
|
|
@@ -7,9 +7,9 @@ async function lintCircleCICommand() {
|
|
|
7
7
|
const commandExistsSync = require('command-exists').sync;
|
|
8
8
|
if (!commandExistsSync('circleci')) {
|
|
9
9
|
// Cannot validate, cause `circleci` binary is not installed
|
|
10
|
-
console.log(`!!\n!! Please install ${colors_1.boldGrey('circleci')} CLI to validate ${colors_1.boldGrey('config.yml')}\n!!\n!! https://circleci.com/docs/2.0/local-cli\n!!`);
|
|
10
|
+
console.log(`!!\n!! Please install ${(0, colors_1.boldGrey)('circleci')} CLI to validate ${(0, colors_1.boldGrey)('config.yml')}\n!!\n!! https://circleci.com/docs/2.0/local-cli\n!!`);
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
await exec_1.execWithArgs('circleci', ['config', 'validate']);
|
|
13
|
+
await (0, exec_1.execWithArgs)('circleci', ['config', 'validate']);
|
|
14
14
|
}
|
|
15
15
|
exports.lintCircleCICommand = lintCircleCICommand;
|
|
@@ -9,7 +9,7 @@ async function tscProdCommand() {
|
|
|
9
9
|
const projectTsconfigPath = `./tsconfig.prod.json`;
|
|
10
10
|
const args = ['-P', projectTsconfigPath];
|
|
11
11
|
const started = Date.now();
|
|
12
|
-
await exec_1.execWithArgs(`tsc`, args);
|
|
13
|
-
console.log(`${colors_1.boldGrey('tsc prod')} ${colors_1.dimGrey(`took ` + js_lib_1._since(started))}`);
|
|
12
|
+
await (0, exec_1.execWithArgs)(`tsc`, args);
|
|
13
|
+
console.log(`${(0, colors_1.boldGrey)('tsc prod')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
14
14
|
}
|
|
15
15
|
exports.tscProdCommand = tscProdCommand;
|
|
@@ -11,10 +11,10 @@ async function tscScriptsCommand() {
|
|
|
11
11
|
// ./scripts folder doesn't exist, skipping
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
const projectTsconfigPath = tsc_util_1.ensureProjectTsconfigScripts();
|
|
14
|
+
const projectTsconfigPath = (0, tsc_util_1.ensureProjectTsconfigScripts)();
|
|
15
15
|
const args = ['-P', projectTsconfigPath, '--noEmit'];
|
|
16
16
|
const started = Date.now();
|
|
17
|
-
await exec_1.execWithArgs(`tsc`, args);
|
|
18
|
-
console.log(`${colors_1.boldGrey('tsc scripts')} ${colors_1.dimGrey(`took ` + js_lib_1._since(started))}`);
|
|
17
|
+
await (0, exec_1.execWithArgs)(`tsc`, args);
|
|
18
|
+
console.log(`${(0, colors_1.boldGrey)('tsc scripts')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
19
19
|
}
|
|
20
20
|
exports.tscScriptsCommand = tscScriptsCommand;
|
|
@@ -10,18 +10,18 @@ async function tslintAllCommand() {
|
|
|
10
10
|
const projectSrcDir = `./src`;
|
|
11
11
|
const projectScriptsDir = `./scripts`;
|
|
12
12
|
const projectE2eDir = `./e2e`;
|
|
13
|
-
const tslintConfigPath = tslint_util_1.getTSLintConfigPath();
|
|
14
|
-
const tsconfigPath = tslint_util_1.getTSConfigPath();
|
|
15
|
-
const tsconfigPathScripts = tslint_util_1.getTSConfigPathScripts();
|
|
13
|
+
const tslintConfigPath = (0, tslint_util_1.getTSLintConfigPath)();
|
|
14
|
+
const tsconfigPath = (0, tslint_util_1.getTSConfigPath)();
|
|
15
|
+
const tsconfigPathScripts = (0, tslint_util_1.getTSConfigPathScripts)();
|
|
16
16
|
const tsconfigPathE2e = `./e2e/tsconfig.json`;
|
|
17
17
|
// /src
|
|
18
|
-
await tslint_util_1.runTSLint(projectSrcDir, lintExclude, tslintConfigPath);
|
|
19
|
-
await tslint_util_1.runTSLint(projectSrcDir, lintExclude, tslintConfigPath, tsconfigPath);
|
|
18
|
+
await (0, tslint_util_1.runTSLint)(projectSrcDir, lintExclude, tslintConfigPath);
|
|
19
|
+
await (0, tslint_util_1.runTSLint)(projectSrcDir, lintExclude, tslintConfigPath, tsconfigPath);
|
|
20
20
|
// /scripts
|
|
21
|
-
await tslint_util_1.runTSLint(projectScriptsDir, lintExclude, tslintConfigPath);
|
|
22
|
-
await tslint_util_1.runTSLint(projectScriptsDir, lintExclude, tslintConfigPath, tsconfigPathScripts);
|
|
21
|
+
await (0, tslint_util_1.runTSLint)(projectScriptsDir, lintExclude, tslintConfigPath);
|
|
22
|
+
await (0, tslint_util_1.runTSLint)(projectScriptsDir, lintExclude, tslintConfigPath, tsconfigPathScripts);
|
|
23
23
|
// /e2e
|
|
24
|
-
await tslint_util_1.runTSLint(projectE2eDir, lintExclude, tslintConfigPath);
|
|
25
|
-
await tslint_util_1.runTSLint(projectE2eDir, lintExclude, tslintConfigPath, tsconfigPathE2e);
|
|
24
|
+
await (0, tslint_util_1.runTSLint)(projectE2eDir, lintExclude, tslintConfigPath);
|
|
25
|
+
await (0, tslint_util_1.runTSLint)(projectE2eDir, lintExclude, tslintConfigPath, tsconfigPathE2e);
|
|
26
26
|
}
|
|
27
27
|
exports.tslintAllCommand = tslintAllCommand;
|
|
@@ -4,7 +4,7 @@ exports.updateFromDevLibCommand = void 0;
|
|
|
4
4
|
const fs_1 = require("@naturalcycles/nodejs-lib/dist/fs");
|
|
5
5
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
6
6
|
function updateFromDevLibCommand() {
|
|
7
|
-
fs_1.kpySync({
|
|
7
|
+
(0, fs_1.kpySync)({
|
|
8
8
|
baseDir: paths_cnst_1.cfgOverwriteDir,
|
|
9
9
|
outputDir: './',
|
|
10
10
|
dotfiles: true,
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,4 @@ const build_prod_command_1 = require("./cmd/build-prod.command");
|
|
|
6
6
|
Object.defineProperty(exports, "buildProdCommand", { enumerable: true, get: function () { return build_prod_command_1.buildProdCommand; } });
|
|
7
7
|
const buildInfo_util_1 = require("./util/buildInfo.util");
|
|
8
8
|
Object.defineProperty(exports, "generateBuildInfo", { enumerable: true, get: function () { return buildInfo_util_1.generateBuildInfo; } });
|
|
9
|
-
tslib_1.__exportStar(require("./util/git.util"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./util/git.util"), exports);
|
|
@@ -4,14 +4,14 @@ exports.generateBuildInfo = void 0;
|
|
|
4
4
|
const time_lib_1 = require("@naturalcycles/time-lib");
|
|
5
5
|
const git_util_1 = require("./git.util");
|
|
6
6
|
async function generateBuildInfo(dev = false) {
|
|
7
|
-
const now = time_lib_1.dayjs();
|
|
7
|
+
const now = (0, time_lib_1.dayjs)();
|
|
8
8
|
const [rev, branchName, repoName, tsCommit] = dev
|
|
9
9
|
? ['devRev', 'devBranch', 'devRepo', now.unix()]
|
|
10
10
|
: await Promise.all([
|
|
11
|
-
git_util_1.gitCurrentCommitSha(),
|
|
12
|
-
git_util_1.gitCurrentBranchName(),
|
|
13
|
-
git_util_1.gitCurrentRepoName(),
|
|
14
|
-
git_util_1.gitCurrentCommitTimestamp(),
|
|
11
|
+
(0, git_util_1.gitCurrentCommitSha)(),
|
|
12
|
+
(0, git_util_1.gitCurrentBranchName)(),
|
|
13
|
+
(0, git_util_1.gitCurrentRepoName)(),
|
|
14
|
+
(0, git_util_1.gitCurrentCommitTimestamp)(),
|
|
15
15
|
]);
|
|
16
16
|
const ts = now.unix();
|
|
17
17
|
const tsStr = now.toPretty();
|
package/dist/util/git.util.js
CHANGED
|
@@ -37,7 +37,7 @@ async function gitCommitAll(msg) {
|
|
|
37
37
|
// const cmd = `git commit -a --no-verify -m "${msg}"`
|
|
38
38
|
const cmd = `git`;
|
|
39
39
|
const args = ['commit', '-a', '--no-verify', '-m', msg];
|
|
40
|
-
exec_util_1.logExec(cmd, args);
|
|
40
|
+
(0, exec_util_1.logExec)(cmd, args);
|
|
41
41
|
const { exitCode } = await execa(cmd, args, {
|
|
42
42
|
// shell: true,
|
|
43
43
|
stdio: 'inherit',
|
|
@@ -76,7 +76,7 @@ async function gitPush() {
|
|
|
76
76
|
if (branchName) {
|
|
77
77
|
args.push('--set-upstream', 'origin', branchName);
|
|
78
78
|
}
|
|
79
|
-
exec_util_1.logExec(cmd, args);
|
|
79
|
+
(0, exec_util_1.logExec)(cmd, args);
|
|
80
80
|
await execa(cmd, args, {
|
|
81
81
|
stdio: 'inherit',
|
|
82
82
|
});
|
package/dist/util/jest.util.js
CHANGED
|
@@ -37,8 +37,8 @@ exports.isRunningAllTests = isRunningAllTests;
|
|
|
37
37
|
* 1. Adds `--silent` if running all tests at once.
|
|
38
38
|
*/
|
|
39
39
|
async function runJest(opt = {}) {
|
|
40
|
-
if (!test_util_1.nodeModuleExists('jest')) {
|
|
41
|
-
console.log(colors_1.dimGrey(`node_modules/${colors_1.white('jest')} not found, skipping tests`));
|
|
40
|
+
if (!(0, test_util_1.nodeModuleExists)('jest')) {
|
|
41
|
+
console.log((0, colors_1.dimGrey)(`node_modules/${(0, colors_1.white)('jest')} not found, skipping tests`));
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
const { ci, integration, manual, leaks } = opt;
|
|
@@ -93,12 +93,12 @@ async function runJest(opt = {}) {
|
|
|
93
93
|
}
|
|
94
94
|
const { NODE_OPTIONS } = process.env;
|
|
95
95
|
if (NODE_OPTIONS) {
|
|
96
|
-
console.log(`${colors_1.dimGrey('NODE_OPTIONS: ' + NODE_OPTIONS)}`);
|
|
96
|
+
console.log(`${(0, colors_1.dimGrey)('NODE_OPTIONS: ' + NODE_OPTIONS)}`);
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
|
-
console.log(`${colors_1.dimGrey('NODE_OPTIONS are not defined')}`);
|
|
99
|
+
console.log(`${(0, colors_1.dimGrey)('NODE_OPTIONS are not defined')}`);
|
|
100
100
|
}
|
|
101
|
-
await exec_1.execWithArgs('jest', js_lib_1._uniq(args), {
|
|
101
|
+
await (0, exec_1.execWithArgs)('jest', (0, js_lib_1._uniq)(args), {
|
|
102
102
|
env,
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -18,6 +18,6 @@ async function runPrettier() {
|
|
|
18
18
|
const prettierConfigPath = [`./prettier.config.js`].find(f => fs.existsSync(f)) || `${paths_cnst_1.cfgDir}/prettier.config.js`;
|
|
19
19
|
// prettier --write 'src/**/*.{js,ts,css,scss,graphql}'
|
|
20
20
|
const args = [`--write`, `--config`, prettierConfigPath, ...prettierPaths];
|
|
21
|
-
await exec_1.execWithArgs('prettier', args);
|
|
21
|
+
await (0, exec_1.execWithArgs)('prettier', args);
|
|
22
22
|
}
|
|
23
23
|
exports.runPrettier = runPrettier;
|
|
@@ -14,6 +14,6 @@ exports.stylelintPaths = [
|
|
|
14
14
|
async function stylelintAll() {
|
|
15
15
|
const config = [`./stylelint.config.js`, `${paths_cnst_1.cfgDir}/stylelint.config.js`].find(f => fs.existsSync(f));
|
|
16
16
|
const args = [`--fix`, `--allow-empty-input`, `--config`, config, ...exports.stylelintPaths];
|
|
17
|
-
await exec_1.execWithArgs('stylelint', args);
|
|
17
|
+
await (0, exec_1.execWithArgs)('stylelint', args);
|
|
18
18
|
}
|
|
19
19
|
exports.stylelintAll = stylelintAll;
|
package/dist/util/tsc.util.js
CHANGED
|
@@ -9,8 +9,8 @@ const fs = require("fs");
|
|
|
9
9
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
10
10
|
async function tsc() {
|
|
11
11
|
const started = Date.now();
|
|
12
|
-
await exec_1.execCommand('tsc');
|
|
13
|
-
console.log(`${colors_1.boldGrey('tsc')} ${colors_1.dimGrey(`took ` + js_lib_1._since(started))}`);
|
|
12
|
+
await (0, exec_1.execCommand)('tsc');
|
|
13
|
+
console.log(`${(0, colors_1.boldGrey)('tsc')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
14
14
|
}
|
|
15
15
|
exports.tsc = tsc;
|
|
16
16
|
/**
|
|
@@ -21,12 +21,12 @@ function ensureProjectTsconfigScripts() {
|
|
|
21
21
|
if (!fs.existsSync(projectTsconfigPath)) {
|
|
22
22
|
// You cannot just use a shared `tsconfig.scripts.json` because of relative paths for `include`
|
|
23
23
|
// So, it will be copied into the project
|
|
24
|
-
fs_1.kpySync({
|
|
24
|
+
(0, fs_1.kpySync)({
|
|
25
25
|
baseDir: `${paths_cnst_1.cfgDir}/init/scripts/`,
|
|
26
26
|
inputPatterns: ['tsconfig.json'],
|
|
27
27
|
outputDir: './scripts',
|
|
28
28
|
});
|
|
29
|
-
console.log(`${colors_1.boldGrey('/scripts/tsconfig.json')} file is automatically added`);
|
|
29
|
+
console.log(`${(0, colors_1.boldGrey)('/scripts/tsconfig.json')} file is automatically added`);
|
|
30
30
|
}
|
|
31
31
|
return projectTsconfigPath;
|
|
32
32
|
}
|
package/dist/util/tslint.util.js
CHANGED
|
@@ -12,13 +12,13 @@ async function runTSLint(dir, excludePaths = [], tslintConfigPath, tsconfigPath)
|
|
|
12
12
|
`--config`,
|
|
13
13
|
tslintConfigPath,
|
|
14
14
|
`${dir}/**/*.{ts,tsx}`,
|
|
15
|
-
...js_lib_1._flatten(excludePaths.map(p => [`-e`, p])),
|
|
15
|
+
...(0, js_lib_1._flatten)(excludePaths.map(p => [`-e`, p])),
|
|
16
16
|
...(tsconfigPath ? [`-p`, tsconfigPath] : []),
|
|
17
17
|
`-t`,
|
|
18
18
|
`stylish`,
|
|
19
19
|
`--fix`,
|
|
20
20
|
];
|
|
21
|
-
await exec_1.execWithArgs('tslint', args);
|
|
21
|
+
await (0, exec_1.execWithArgs)('tslint', args);
|
|
22
22
|
}
|
|
23
23
|
exports.runTSLint = runTSLint;
|
|
24
24
|
function getTSLintConfigPath() {
|
|
@@ -42,11 +42,11 @@ async function runESLint(dir, eslintConfigPath, tsconfigPath) {
|
|
|
42
42
|
const args = [
|
|
43
43
|
`--config`,
|
|
44
44
|
eslintConfigPath,
|
|
45
|
-
`${dir}/**/*.{ts,tsx}`,
|
|
45
|
+
`${dir}/**/*.{ts,tsx,vue}`,
|
|
46
46
|
...(tsconfigPath ? [`--parser-options=project:${tsconfigPath}`] : []),
|
|
47
47
|
`--no-error-on-unmatched-pattern`,
|
|
48
48
|
`--fix`,
|
|
49
49
|
];
|
|
50
|
-
await exec_1.execWithArgs('eslint', args);
|
|
50
|
+
await (0, exec_1.execWithArgs)('eslint', args);
|
|
51
51
|
}
|
|
52
52
|
exports.runESLint = runESLint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prepare": "husky install",
|
|
6
6
|
"tsn-debug": "tsn testScript.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"lint-all": "tsn ./src/bin/lint-all.ts",
|
|
27
27
|
"lint-circleci": "tsn ./src/bin/lint-circleci.ts",
|
|
28
28
|
"eslint-all": "tsn ./src/bin/eslint-all.ts",
|
|
29
|
+
"eslint-print-config": "eslint --print-config src/index.ts > tmp/eslint.config.json",
|
|
29
30
|
"update-from-dev-lib": "tsn ./src/bin/update-from-dev-lib.ts"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
@@ -43,11 +44,13 @@
|
|
|
43
44
|
"@typescript-eslint/parser": "^4.22.1",
|
|
44
45
|
"command-exists": "^1.2.8",
|
|
45
46
|
"eslint": "^7.26.0",
|
|
47
|
+
"eslint-config-prettier": "^8.3.0",
|
|
46
48
|
"eslint-plugin-import": "^2.22.1",
|
|
47
49
|
"eslint-plugin-jest": "^24.3.6",
|
|
48
50
|
"eslint-plugin-jsdoc": "^36.0.2",
|
|
49
|
-
"eslint-plugin-unicorn": "^
|
|
51
|
+
"eslint-plugin-unicorn": "^36.0.0",
|
|
50
52
|
"eslint-plugin-unused-imports": "^1.1.1",
|
|
53
|
+
"eslint-plugin-vue": "^7.18.0",
|
|
51
54
|
"execa": "^5.0.0",
|
|
52
55
|
"fs-extra": "^10.0.0",
|
|
53
56
|
"husky": "^7.0.0",
|