@naturalcycles/dev-lib 19.23.0 → 19.25.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.
@@ -73,7 +73,7 @@ const linters = {
73
73
  return [
74
74
  biomeCmd,
75
75
  eslintConfigPathRoot &&
76
- `${eslintCmd} --config ${eslintConfigPathRoot} --cache-location ./node_modules/.cache/eslint_src`,
76
+ `${eslintCmd} --config ${eslintConfigPathRoot} --cache-location node_modules/.cache/eslint_src`,
77
77
  prettierCmd,
78
78
  ]
79
79
  .filter(Boolean)
@@ -146,7 +146,7 @@ const linters = {
146
146
 
147
147
  // /scripts are separate, cause they require separate tsconfig.json
148
148
  if (fs.existsSync(`./scripts`)) {
149
- const eslintConfigPathScripts = ['./scripts/eslint.config.js'].find(p => fs.existsSync(p))
149
+ const eslintConfigPathScripts = ['scripts/eslint.config.js'].find(p => fs.existsSync(p))
150
150
  Object.assign(linters, {
151
151
  // biome, eslint, Prettier
152
152
  './scripts/**/*.{ts,tsx,cts,mts,vue,html}': match => {
@@ -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 --cache-location node_modules/.cache/eslint_scripts`,
159
159
  prettierCmd,
160
160
  ]
161
161
  .filter(Boolean)
@@ -166,7 +166,7 @@ if (fs.existsSync(`./scripts`)) {
166
166
 
167
167
  // /e2e
168
168
  if (fs.existsSync(`./e2e`)) {
169
- const eslintConfigPathE2e = ['./e2e/eslint.config.js'].find(p => fs.existsSync(p))
169
+ const eslintConfigPathE2e = ['e2e/eslint.config.js'].find(p => fs.existsSync(p))
170
170
 
171
171
  Object.assign(linters, {
172
172
  // biome, eslint, Prettier
@@ -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 --cache-location ./node_modules/.cache/eslint_e2e`,
180
180
  prettierCmd,
181
181
  ]
182
182
  .filter(Boolean)
package/cfg/tsconfig.json CHANGED
@@ -56,6 +56,8 @@
56
56
  // ],
57
57
 
58
58
  // Other
59
+ "incremental": true,
60
+ "tsBuildInfoFile": "${configDir}/node_modules/.cache/src.tsbuildinfo",
59
61
  "pretty": true,
60
62
  "newLine": "lf",
61
63
  "experimentalDecorators": true
package/dist/lint.util.js CHANGED
@@ -121,6 +121,10 @@ async function runESLint(dir, extensions = eslintExtensions.split(','), fix = tr
121
121
  return;
122
122
  }
123
123
  const eslintPath = findPackageBinPath('eslint', 'eslint');
124
+ const cacheLocation = `node_modules/.cache/eslint_${dir}`;
125
+ if (existsSync(cacheLocation)) {
126
+ console.log(boldGrey(`eslint ${dir} cache found`));
127
+ }
124
128
  await exec2.spawnAsync(eslintPath, {
125
129
  args: [
126
130
  `--config`,
@@ -129,7 +133,7 @@ async function runESLint(dir, extensions = eslintExtensions.split(','), fix = tr
129
133
  `--parser-options=project:${tsconfigPath}`,
130
134
  '--cache',
131
135
  '--cache-location',
132
- `./node_modules/.cache/eslint_${dir}`,
136
+ cacheLocation,
133
137
  `--no-error-on-unmatched-pattern`,
134
138
  `--report-unused-disable-directives`, // todo: unnecessary with flat, as it's defined in the config
135
139
  fix ? `--fix` : '',
@@ -154,13 +158,17 @@ export function runPrettier(experimentalCli = true) {
154
158
  if (!prettierConfigPath)
155
159
  return;
156
160
  const prettierPath = findPackageBinPath('prettier', 'prettier');
161
+ const cacheLocation = 'node_modules/.cache/prettier';
162
+ if (existsSync(cacheLocation)) {
163
+ console.log(boldGrey('prettier cache found'));
164
+ }
157
165
  // prettier --write 'src/**/*.{js,ts,css,scss,graphql}'
158
166
  exec2.spawn(prettierPath, {
159
167
  args: [
160
168
  `--write`,
161
169
  `--log-level=warn`,
162
170
  '--cache-location',
163
- `node_modules/.cache/prettier`,
171
+ cacheLocation,
164
172
  experimentalCli && `--experimental-cli`,
165
173
  experimentalCli ? '--config-path' : `--config`,
166
174
  prettierConfigPath,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "19.23.0",
4
+ "version": "19.25.0",
5
5
  "dependencies": {
6
6
  "@biomejs/biome": "^2",
7
7
  "@commitlint/cli": "^19",
@@ -5,7 +5,9 @@
5
5
  "extends": "../cfg/tsconfig.json",
6
6
  "compilerOptions": {
7
7
  "rootDir": "${configDir}/..",
8
- "outDir": "${configDir}/../dist"
8
+ "outDir": "${configDir}/../dist/scripts",
9
+ "noEmit": true,
10
+ "tsBuildInfoFile": "${configDir}/../node_modules/.cache/scripts.tsbuildinfo"
9
11
  },
10
12
  "exclude": ["**/__exclude"]
11
13
  }