@naturalcycles/dev-lib 19.25.1 → 19.25.4
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/lint-staged.config.js +2 -2
- package/dist/bin/dev-lib.js +1 -0
- package/dist/build.util.js +5 -2
- package/dist/lint.util.js +5 -3
- package/package.json +5 -5
|
@@ -155,7 +155,7 @@ if (fs.existsSync(`./scripts`)) {
|
|
|
155
155
|
return [
|
|
156
156
|
biomeCmd,
|
|
157
157
|
eslintConfigPathScripts &&
|
|
158
|
-
`${eslintCmd} --config ${eslintConfigPathScripts} --parser-options=project:scripts/tsconfig.json --cache-location node_modules/.cache/eslint_scripts`,
|
|
158
|
+
`${eslintCmd} --config ${eslintConfigPathScripts} --parser-options=project:scripts/tsconfig.json --parser-options=tsconfigRootDir:. --cache-location node_modules/.cache/eslint_scripts`,
|
|
159
159
|
prettierCmd,
|
|
160
160
|
]
|
|
161
161
|
.filter(Boolean)
|
|
@@ -176,7 +176,7 @@ if (fs.existsSync(`./e2e`)) {
|
|
|
176
176
|
return [
|
|
177
177
|
biomeCmd,
|
|
178
178
|
eslintConfigPathE2e &&
|
|
179
|
-
`${eslintCmd} --config ${eslintConfigPathE2e} --parser-options=project:e2e/tsconfig.json --cache-location ./node_modules/.cache/eslint_e2e`,
|
|
179
|
+
`${eslintCmd} --config ${eslintConfigPathE2e} --parser-options=project:e2e/tsconfig.json --parser-options=tsconfigRootDir:. --cache-location ./node_modules/.cache/eslint_e2e`,
|
|
180
180
|
prettierCmd,
|
|
181
181
|
]
|
|
182
182
|
.filter(Boolean)
|
package/dist/bin/dev-lib.js
CHANGED
|
@@ -65,6 +65,7 @@ const commands = [
|
|
|
65
65
|
desc: 'Run "lint-staged", which runs linter on git staged files.',
|
|
66
66
|
},
|
|
67
67
|
{ name: 'eslint', fn: eslintAll, desc: 'Run eslint on all files.' },
|
|
68
|
+
{ name: 'eslint-no-fix', deprecated: true, fn: async () => await eslintAll({ fix: false }) },
|
|
68
69
|
{
|
|
69
70
|
name: 'eslint --no-fix',
|
|
70
71
|
fn: async () => await eslintAll({ fix: false }),
|
package/dist/build.util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { grey } from '@naturalcycles/nodejs-lib/colors';
|
|
3
3
|
import { exec2 } from '@naturalcycles/nodejs-lib/exec2';
|
|
4
4
|
import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
|
|
5
5
|
import { kpySync } from '@naturalcycles/nodejs-lib/kpy';
|
|
@@ -38,7 +38,7 @@ export async function runTSCInFolder(dir, args = []) {
|
|
|
38
38
|
const tscPath = findPackageBinPath('typescript', 'tsc');
|
|
39
39
|
const cacheLocation = `node_modules/.cache/${dir}.tsbuildinfo`;
|
|
40
40
|
const cacheFound = existsSync(cacheLocation);
|
|
41
|
-
console.log(
|
|
41
|
+
console.log(grey(`tsc ${dir} cache found: ${cacheFound}`));
|
|
42
42
|
await exec2.spawnAsync(tscPath, {
|
|
43
43
|
args: ['-P', tsconfigPath, ...args],
|
|
44
44
|
shell: false,
|
|
@@ -47,6 +47,9 @@ export async function runTSCInFolder(dir, args = []) {
|
|
|
47
47
|
export async function runTSCProd(args = []) {
|
|
48
48
|
const tsconfigPath = [`./tsconfig.prod.json`].find(p => fs2.pathExists(p)) || 'tsconfig.json';
|
|
49
49
|
const tscPath = findPackageBinPath('typescript', 'tsc');
|
|
50
|
+
const cacheLocation = `node_modules/.cache/src.tsbuildinfo`;
|
|
51
|
+
const cacheFound = existsSync(cacheLocation);
|
|
52
|
+
console.log(grey(`tsc src cache found: ${cacheFound}`));
|
|
50
53
|
await exec2.spawnAsync(tscPath, {
|
|
51
54
|
args: ['-P', tsconfigPath, '--noEmit', 'false', '--noCheck', ...args],
|
|
52
55
|
shell: false,
|
package/dist/lint.util.js
CHANGED
|
@@ -9,7 +9,7 @@ import { _filterFalsyValues } from '@naturalcycles/js-lib/object/object.util.js'
|
|
|
9
9
|
import { semver2 } from '@naturalcycles/js-lib/semver';
|
|
10
10
|
import { _truncate } from '@naturalcycles/js-lib/string/string.util.js';
|
|
11
11
|
import { git2 } from '@naturalcycles/nodejs-lib';
|
|
12
|
-
import { boldGrey, dimGrey } from '@naturalcycles/nodejs-lib/colors';
|
|
12
|
+
import { boldGrey, dimGrey, grey } from '@naturalcycles/nodejs-lib/colors';
|
|
13
13
|
import { exec2 } from '@naturalcycles/nodejs-lib/exec2';
|
|
14
14
|
import { fs2 } from '@naturalcycles/nodejs-lib/fs2';
|
|
15
15
|
import { _yargs } from '@naturalcycles/nodejs-lib/yargs';
|
|
@@ -123,13 +123,15 @@ async function runESLint(dir, extensions = eslintExtensions.split(','), fix = tr
|
|
|
123
123
|
const eslintPath = findPackageBinPath('eslint', 'eslint');
|
|
124
124
|
const cacheLocation = `node_modules/.cache/eslint_${dir}`;
|
|
125
125
|
const cacheFound = existsSync(cacheLocation);
|
|
126
|
-
console.log(
|
|
126
|
+
console.log(grey(`eslint ${dir} cache found: ${cacheFound}`));
|
|
127
127
|
await exec2.spawnAsync(eslintPath, {
|
|
128
128
|
args: [
|
|
129
129
|
`--config`,
|
|
130
130
|
eslintConfigPath,
|
|
131
131
|
`${dir}/**/*.{${extensions.join(',')}}`,
|
|
132
132
|
`--parser-options=project:${tsconfigPath}`,
|
|
133
|
+
// The next line fixes the `typescript-eslint` 8.37 bug of resolving tsconfig.json
|
|
134
|
+
`--parser-options=tsconfigRootDir:.`,
|
|
133
135
|
'--cache',
|
|
134
136
|
'--cache-location',
|
|
135
137
|
cacheLocation,
|
|
@@ -159,7 +161,7 @@ export function runPrettier(experimentalCli = true) {
|
|
|
159
161
|
const prettierPath = findPackageBinPath('prettier', 'prettier');
|
|
160
162
|
const cacheLocation = 'node_modules/.cache/prettier';
|
|
161
163
|
const cacheFound = existsSync(cacheLocation);
|
|
162
|
-
console.log(
|
|
164
|
+
console.log(grey(`prettier cache found: ${cacheFound}`));
|
|
163
165
|
// prettier --write 'src/**/*.{js,ts,css,scss,graphql}'
|
|
164
166
|
exec2.spawn(prettierPath, {
|
|
165
167
|
args: [
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/dev-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "19.25.
|
|
4
|
+
"version": "19.25.4",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@biomejs/biome": "
|
|
6
|
+
"@biomejs/biome": "2.1.3",
|
|
7
7
|
"@commitlint/cli": "^19",
|
|
8
8
|
"@commitlint/config-conventional": "^19",
|
|
9
9
|
"@eslint/js": "^9",
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
"micromatch": "^4",
|
|
25
25
|
"mitm": "^1",
|
|
26
26
|
"prettier": "^3",
|
|
27
|
-
"typescript-eslint": "8
|
|
27
|
+
"typescript-eslint": "^8",
|
|
28
28
|
"vue-eslint-parser": "^10"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@biomejs/biome": "^2",
|
|
32
|
-
"eslint": "^9",
|
|
33
31
|
"husky": "^9",
|
|
34
32
|
"stylelint": "^16",
|
|
35
33
|
"stylelint-config-standard-scss": "^15",
|
|
@@ -103,6 +101,8 @@
|
|
|
103
101
|
"test-integration": "tsx ./src/bin/dev-lib.ts test-integration",
|
|
104
102
|
"test-manual": "tsx ./src/bin/dev-lib.ts test-manual",
|
|
105
103
|
"lint": "tsx ./src/bin/dev-lib.ts lint",
|
|
104
|
+
"eslint": "tsx ./src/bin/dev-lib.ts eslint",
|
|
105
|
+
"eslint-no-fix": "tsx ./src/bin/dev-lib.ts eslint-no-fix",
|
|
106
106
|
"lint-staged-debug": "tsx ./src/bin/dev-lib.ts lint-staged"
|
|
107
107
|
}
|
|
108
108
|
}
|