@naturalcycles/dev-lib 13.37.0 → 13.38.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/cfg/eslint-rules.js +0 -48
- package/cfg/eslint-vue-rules.js +52 -0
- package/cfg/eslint-vue2.config.js +1 -0
- package/cfg/eslint-vue3.config.js +1 -0
- package/dist/bin/bt.js +2 -4
- package/dist/bin/btl.js +1 -3
- package/dist/bin/build.js +2 -4
- package/dist/bin/tsc-scripts.js +2 -2
- package/dist/util/tsc.util.d.ts +4 -0
- package/dist/util/tsc.util.js +36 -1
- package/package.json +1 -1
- package/dist/cmd/tsc-scripts.command.d.ts +0 -1
- package/dist/cmd/tsc-scripts.command.js +0 -20
package/cfg/eslint-rules.js
CHANGED
|
@@ -445,53 +445,5 @@ module.exports = {
|
|
|
445
445
|
'@typescript-eslint/dot-notation': 0, // not always desireable
|
|
446
446
|
'@typescript-eslint/consistent-indexed-object-style': 0, // Record looses the name of the key
|
|
447
447
|
'@typescript-eslint/no-unsafe-enum-comparison': 0, // not practically helpful
|
|
448
|
-
// non-default vue rules
|
|
449
|
-
'vue/block-order': [
|
|
450
|
-
'error',
|
|
451
|
-
{
|
|
452
|
-
order: ['script', 'template', 'style'],
|
|
453
|
-
},
|
|
454
|
-
],
|
|
455
|
-
'vue/component-api-style': [2, ['script-setup', 'composition', 'composition-vue2']],
|
|
456
|
-
'vue/component-name-in-template-casing': [
|
|
457
|
-
2,
|
|
458
|
-
'PascalCase',
|
|
459
|
-
{
|
|
460
|
-
registeredComponentsOnly: true,
|
|
461
|
-
},
|
|
462
|
-
],
|
|
463
|
-
'vue/component-options-name-casing': [2, 'PascalCase'],
|
|
464
|
-
'vue/custom-event-name-casing': [2, 'camelCase'],
|
|
465
|
-
'vue/define-emits-declaration': [2, 'type-based'],
|
|
466
|
-
'vue/define-macros-order': 2,
|
|
467
|
-
'vue/define-props-declaration': 2,
|
|
468
|
-
'vue/html-comment-content-spacing': 2,
|
|
469
|
-
'vue/match-component-file-name': [
|
|
470
|
-
2,
|
|
471
|
-
{
|
|
472
|
-
extensions: ['vue', 'jsx'],
|
|
473
|
-
shouldMatchCase: true,
|
|
474
|
-
},
|
|
475
|
-
],
|
|
476
|
-
'vue/match-component-import-name': 2,
|
|
477
|
-
'vue/no-boolean-default': 2,
|
|
478
|
-
'vue/no-deprecated-model-definition': 2,
|
|
479
|
-
'vue/no-multiple-objects-in-class': 2,
|
|
480
|
-
'vue/no-ref-object-destructure': 2,
|
|
481
|
-
'vue/no-required-prop-with-default': 2,
|
|
482
|
-
'vue/no-root-v-if': 2,
|
|
483
|
-
'vue/no-this-in-before-route-enter': 2,
|
|
484
|
-
'vue/padding-line-between-blocks': 2,
|
|
485
|
-
'vue/prefer-define-options': 2,
|
|
486
|
-
'vue/prefer-separate-static-class': 2,
|
|
487
|
-
'vue/require-direct-export': 2,
|
|
488
|
-
'vue/require-emit-validator': 2,
|
|
489
|
-
'vue/require-expose': 2,
|
|
490
|
-
'vue/require-macro-variable-name': 2,
|
|
491
|
-
'vue/require-typed-object-prop': 2,
|
|
492
|
-
'vue/require-typed-ref': 2,
|
|
493
|
-
'vue/v-for-delimiter-style': [2, 'of'],
|
|
494
|
-
'vue/valid-define-options': 2,
|
|
495
|
-
'vue/eqeqeq': 2,
|
|
496
448
|
},
|
|
497
449
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
rules: {
|
|
3
|
+
// non-default vue rules
|
|
4
|
+
'vue/block-order': [
|
|
5
|
+
'error',
|
|
6
|
+
{
|
|
7
|
+
order: ['script', 'template', 'style'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
10
|
+
'vue/component-api-style': [2, ['script-setup', 'composition', 'composition-vue2']],
|
|
11
|
+
'vue/component-name-in-template-casing': [
|
|
12
|
+
2,
|
|
13
|
+
'PascalCase',
|
|
14
|
+
{
|
|
15
|
+
registeredComponentsOnly: true,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
'vue/component-options-name-casing': [2, 'PascalCase'],
|
|
19
|
+
'vue/custom-event-name-casing': [2, 'camelCase'],
|
|
20
|
+
'vue/define-emits-declaration': [2, 'type-based'],
|
|
21
|
+
'vue/define-macros-order': 2,
|
|
22
|
+
'vue/define-props-declaration': 2,
|
|
23
|
+
'vue/html-comment-content-spacing': 2,
|
|
24
|
+
'vue/match-component-file-name': [
|
|
25
|
+
2,
|
|
26
|
+
{
|
|
27
|
+
extensions: ['vue', 'jsx'],
|
|
28
|
+
shouldMatchCase: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'vue/match-component-import-name': 2,
|
|
32
|
+
'vue/no-boolean-default': 2,
|
|
33
|
+
'vue/no-deprecated-model-definition': 2,
|
|
34
|
+
'vue/no-multiple-objects-in-class': 2,
|
|
35
|
+
'vue/no-ref-object-destructure': 2,
|
|
36
|
+
'vue/no-required-prop-with-default': 2,
|
|
37
|
+
'vue/no-root-v-if': 2,
|
|
38
|
+
'vue/no-this-in-before-route-enter': 2,
|
|
39
|
+
'vue/padding-line-between-blocks': 2,
|
|
40
|
+
'vue/prefer-define-options': 2,
|
|
41
|
+
'vue/prefer-separate-static-class': 2,
|
|
42
|
+
'vue/require-direct-export': 2,
|
|
43
|
+
'vue/require-emit-validator': 2,
|
|
44
|
+
'vue/require-expose': 2,
|
|
45
|
+
'vue/require-macro-variable-name': 2,
|
|
46
|
+
'vue/require-typed-object-prop': 2,
|
|
47
|
+
'vue/require-typed-ref': 2,
|
|
48
|
+
'vue/v-for-delimiter-style': [2, 'of'],
|
|
49
|
+
'vue/valid-define-options': 2,
|
|
50
|
+
'vue/eqeqeq': 2,
|
|
51
|
+
},
|
|
52
|
+
}
|
package/dist/bin/bt.js
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
|
|
5
5
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
6
|
-
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
7
6
|
const jest_util_1 = require("../util/jest.util");
|
|
8
7
|
const tsc_util_1 = require("../util/tsc.util");
|
|
9
|
-
(0, script_1.runScript)(() => {
|
|
8
|
+
(0, script_1.runScript)(async () => {
|
|
10
9
|
(0, nodejs_lib_1._emptyDirSync)('./dist'); // it doesn't delete the dir itself, to prevent IDE jumping
|
|
11
10
|
// fs.rmSync('./dist', { recursive: true, force: true })
|
|
12
|
-
(0, tsc_util_1.
|
|
13
|
-
(0, tsc_scripts_command_1.tscScriptsCommand)();
|
|
11
|
+
await (0, tsc_util_1.tscMainAndScripts)(true);
|
|
14
12
|
(0, jest_util_1.runJest)();
|
|
15
13
|
});
|
package/dist/bin/btl.js
CHANGED
|
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
|
|
5
5
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
6
6
|
const lint_all_command_1 = require("../cmd/lint-all.command");
|
|
7
|
-
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
8
7
|
const jest_util_1 = require("../util/jest.util");
|
|
9
8
|
const tsc_util_1 = require("../util/tsc.util");
|
|
10
9
|
(0, script_1.runScript)(async () => {
|
|
11
10
|
await (0, lint_all_command_1.lintAllCommand)();
|
|
12
11
|
(0, nodejs_lib_1._emptyDirSync)('./dist'); // it doesn't delete the dir itself, to prevent IDE jumping
|
|
13
12
|
// fs.rmSync('./dist', { recursive: true, force: true })
|
|
14
|
-
(0, tsc_util_1.
|
|
15
|
-
(0, tsc_scripts_command_1.tscScriptsCommand)();
|
|
13
|
+
await (0, tsc_util_1.tscMainAndScripts)(true);
|
|
16
14
|
(0, jest_util_1.runJest)();
|
|
17
15
|
});
|
package/dist/bin/build.js
CHANGED
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const nodejs_lib_1 = require("@naturalcycles/nodejs-lib");
|
|
5
5
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
6
|
-
const tsc_scripts_command_1 = require("../cmd/tsc-scripts.command");
|
|
7
6
|
const tsc_util_1 = require("../util/tsc.util");
|
|
8
|
-
(0, script_1.runScript)(() => {
|
|
7
|
+
(0, script_1.runScript)(async () => {
|
|
9
8
|
(0, nodejs_lib_1._emptyDirSync)('./dist'); // it doesn't delete the dir itself, to prevent IDE jumping
|
|
10
9
|
// fs.rmSync('./dist', { recursive: true, force: true })
|
|
11
|
-
(0, tsc_util_1.
|
|
12
|
-
(0, tsc_scripts_command_1.tscScriptsCommand)();
|
|
10
|
+
await (0, tsc_util_1.tscMainAndScripts)(true);
|
|
13
11
|
});
|
package/dist/bin/tsc-scripts.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
|
|
5
|
-
const
|
|
6
|
-
(0, script_1.runScript)(
|
|
5
|
+
const tsc_util_1 = require("../util/tsc.util");
|
|
6
|
+
(0, script_1.runScript)(tsc_util_1.tscScripts);
|
package/dist/util/tsc.util.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export declare function tscMainAndScripts(noEmit?: boolean): Promise<void>;
|
|
1
2
|
export declare function tsc(noEmit?: boolean): void;
|
|
3
|
+
export declare function tscAsync(noEmit?: boolean): Promise<void>;
|
|
4
|
+
export declare function tscScripts(): void;
|
|
5
|
+
export declare function tscScriptsAsync(): Promise<void>;
|
|
2
6
|
/**
|
|
3
7
|
* Returns path to /scripts/tsconfig.json
|
|
4
8
|
*/
|
package/dist/util/tsc.util.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureProjectTsconfigScripts = exports.tsc = void 0;
|
|
3
|
+
exports.ensureProjectTsconfigScripts = exports.tscScriptsAsync = exports.tscScripts = exports.tscAsync = exports.tsc = exports.tscMainAndScripts = void 0;
|
|
4
4
|
const fs = require("node:fs");
|
|
5
5
|
const js_lib_1 = require("@naturalcycles/js-lib");
|
|
6
6
|
const colors_1 = require("@naturalcycles/nodejs-lib/dist/colors");
|
|
7
7
|
const fs_1 = require("@naturalcycles/nodejs-lib/dist/fs");
|
|
8
8
|
const paths_cnst_1 = require("../cnst/paths.cnst");
|
|
9
9
|
const exec_util_1 = require("./exec.util");
|
|
10
|
+
async function tscMainAndScripts(noEmit = false) {
|
|
11
|
+
await Promise.all([tscAsync(noEmit), tscScriptsAsync()]);
|
|
12
|
+
}
|
|
13
|
+
exports.tscMainAndScripts = tscMainAndScripts;
|
|
10
14
|
function tsc(noEmit = false) {
|
|
11
15
|
const started = Date.now();
|
|
12
16
|
const args = [noEmit && '--noEmit'].filter(js_lib_1._isTruthy);
|
|
@@ -14,6 +18,37 @@ function tsc(noEmit = false) {
|
|
|
14
18
|
console.log(`${(0, colors_1.boldGrey)('tsc')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
15
19
|
}
|
|
16
20
|
exports.tsc = tsc;
|
|
21
|
+
async function tscAsync(noEmit = false) {
|
|
22
|
+
const started = Date.now();
|
|
23
|
+
const args = [noEmit && '--noEmit'].filter(js_lib_1._isTruthy);
|
|
24
|
+
await (0, exec_util_1.execVoidCommand)('tsc', args);
|
|
25
|
+
console.log(`${(0, colors_1.boldGrey)('tsc')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
26
|
+
}
|
|
27
|
+
exports.tscAsync = tscAsync;
|
|
28
|
+
function tscScripts() {
|
|
29
|
+
if (!fs.existsSync('./scripts')) {
|
|
30
|
+
// ./scripts folder doesn't exist, skipping
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const projectTsconfigPath = ensureProjectTsconfigScripts();
|
|
34
|
+
const args = ['-P', projectTsconfigPath, '--noEmit'];
|
|
35
|
+
const started = Date.now();
|
|
36
|
+
(0, exec_util_1.execVoidCommandSync)(`tsc`, args);
|
|
37
|
+
console.log(`${(0, colors_1.boldGrey)('tsc scripts')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
38
|
+
}
|
|
39
|
+
exports.tscScripts = tscScripts;
|
|
40
|
+
async function tscScriptsAsync() {
|
|
41
|
+
if (!fs.existsSync('./scripts')) {
|
|
42
|
+
// ./scripts folder doesn't exist, skipping
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const projectTsconfigPath = ensureProjectTsconfigScripts();
|
|
46
|
+
const args = ['-P', projectTsconfigPath, '--noEmit'];
|
|
47
|
+
const started = Date.now();
|
|
48
|
+
await (0, exec_util_1.execVoidCommand)(`tsc`, args);
|
|
49
|
+
console.log(`${(0, colors_1.boldGrey)('tsc scripts')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
50
|
+
}
|
|
51
|
+
exports.tscScriptsAsync = tscScriptsAsync;
|
|
17
52
|
/**
|
|
18
53
|
* Returns path to /scripts/tsconfig.json
|
|
19
54
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tscScriptsCommand(): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tscScriptsCommand = void 0;
|
|
4
|
-
const fs = require("node:fs");
|
|
5
|
-
const js_lib_1 = require("@naturalcycles/js-lib");
|
|
6
|
-
const colors_1 = require("@naturalcycles/nodejs-lib/dist/colors");
|
|
7
|
-
const exec_util_1 = require("../util/exec.util");
|
|
8
|
-
const tsc_util_1 = require("../util/tsc.util");
|
|
9
|
-
function tscScriptsCommand() {
|
|
10
|
-
if (!fs.existsSync('./scripts')) {
|
|
11
|
-
// ./scripts folder doesn't exist, skipping
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const projectTsconfigPath = (0, tsc_util_1.ensureProjectTsconfigScripts)();
|
|
15
|
-
const args = ['-P', projectTsconfigPath, '--noEmit'];
|
|
16
|
-
const started = Date.now();
|
|
17
|
-
(0, exec_util_1.execVoidCommandSync)(`tsc`, args);
|
|
18
|
-
console.log(`${(0, colors_1.boldGrey)('tsc scripts')} ${(0, colors_1.dimGrey)(`took ` + (0, js_lib_1._since)(started))}`);
|
|
19
|
-
}
|
|
20
|
-
exports.tscScriptsCommand = tscScriptsCommand;
|