@rtorcato/js-tooling 2.1.1 → 2.2.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.
@@ -2,6 +2,45 @@ import chalk from 'chalk';
2
2
  import fs from 'fs-extra';
3
3
  import path from 'node:path';
4
4
  const PACKAGE = '@rtorcato/js-tooling';
5
+ const NODE_MIN_MAJOR = 22;
6
+ const NODE_LTS_REQUIREMENTS = {
7
+ 22: { minor: 22, patch: 2 },
8
+ 24: { minor: 15, patch: 0 },
9
+ };
10
+ function parseNodeVersion(version) {
11
+ const clean = version.replace(/^v/, '').split('-')[0] ?? '';
12
+ const [maj, min, pat] = clean.split('.').map((n) => Number.parseInt(n, 10) || 0);
13
+ return [maj ?? 0, min ?? 0, pat ?? 0];
14
+ }
15
+ export function evaluateNodeVersion(version) {
16
+ const [major, minor, patch] = parseNodeVersion(version);
17
+ const display = `v${major}.${minor}.${patch}`;
18
+ if (major < NODE_MIN_MAJOR) {
19
+ return {
20
+ check: 'Node',
21
+ status: 'missing',
22
+ detail: `${display} is below required Node ${NODE_MIN_MAJOR}+`,
23
+ hint: `Install Node ${NODE_MIN_MAJOR} LTS or newer (https://nodejs.org)`,
24
+ };
25
+ }
26
+ const lts = NODE_LTS_REQUIREMENTS[major];
27
+ if (lts) {
28
+ const meets = minor > lts.minor || (minor === lts.minor && patch >= lts.patch);
29
+ if (!meets) {
30
+ return {
31
+ check: 'Node',
32
+ status: 'drift',
33
+ detail: `${display} — npm may emit EBADENGINE warnings from transitive deps`,
34
+ hint: `Upgrade to Node ${major}.${lts.minor}.${lts.patch}+ (or 26+) to silence transitive engine warnings`,
35
+ };
36
+ }
37
+ }
38
+ return {
39
+ check: 'Node',
40
+ status: 'ok',
41
+ detail: display,
42
+ };
43
+ }
5
44
  const FILE_CHECKS = [
6
45
  {
7
46
  check: 'TypeScript',
@@ -103,6 +142,7 @@ async function checkPackageJson(dir) {
103
142
  export async function runDoctor(dir) {
104
143
  const targetDir = path.resolve(dir);
105
144
  const results = [];
145
+ results.push(evaluateNodeVersion(process.version));
106
146
  results.push(await checkPackageJson(targetDir));
107
147
  for (const spec of FILE_CHECKS) {
108
148
  results.push(await checkFile(targetDir, spec));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtorcato/js-tooling",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "JavaScript and TypeScript tooling for Node.js, React, Next.js, and Vitest.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -157,26 +157,17 @@
157
157
  "@vitest/coverage-v8": "^4.0.3",
158
158
  "commitizen": "^4.3.1",
159
159
  "conventional-changelog-conventionalcommits": "^9.3.1",
160
- "cross-env": "^10.1.0",
161
160
  "cz-conventional-changelog": "^3.3.0",
162
161
  "esbuild": "^0.25.11",
163
162
  "esbuild-node-externals": "^1.22.0",
164
163
  "eslint": "9.38.0",
165
- "eslint-config-airbnb": "^19.0.4",
166
- "eslint-config-prettier": "10.1.8",
167
- "eslint-config-turbo": "^2.5.8",
168
164
  "eslint-plugin-import": "^2.32.0",
169
165
  "eslint-plugin-jest": "29.0.1",
170
- "eslint-plugin-jsx-a11y": "^6.10.2",
171
- "eslint-plugin-react": "^7.37.5",
172
- "eslint-plugin-react-hooks": "^7.0.0",
173
- "eslint-plugin-vitest": "0.5.4",
174
166
  "jest": "^29.7.0",
175
167
  "husky": "^9.1.7",
176
168
  "is-ci": "^4.1.0",
177
169
  "lint-staged": "^16.2.6",
178
170
  "prettier": "^3.6.2",
179
- "prettier-plugin-tailwindcss": "^0.7.1",
180
171
  "rimraf": "6.0.1",
181
172
  "semantic-release": "^25.0.1",
182
173
  "ts-jest": "^29.4.5",
@@ -188,13 +179,12 @@
188
179
  },
189
180
  "peerDependencies": {
190
181
  "@biomejs/biome": "^2.0.0",
182
+ "@commitlint/cli": "^20.0.0",
183
+ "@commitlint/config-conventional": "^21.0.1",
191
184
  "@commitlint/types": "^20.0.0",
192
185
  "@eslint/js": "^9.0.0",
193
186
  "@ianvs/prettier-plugin-sort-imports": "^4.0.0",
194
- "@commitlint/cli": "^20.0.0",
195
- "@commitlint/config-conventional": "^21.0.1",
196
187
  "@next/eslint-plugin-next": "^16.0.0",
197
- "@playwright/test": "^1.50.0",
198
188
  "@semantic-release/changelog": "^6.0.0",
199
189
  "@semantic-release/commit-analyzer": "^13.0.0",
200
190
  "@semantic-release/exec": "^7.0.0",
@@ -205,27 +195,14 @@
205
195
  "@total-typescript/ts-reset": "^0.6.0",
206
196
  "@typescript-eslint/eslint-plugin": "^8.0.0",
207
197
  "@typescript-eslint/parser": "^8.0.0",
208
- "@vitejs/plugin-react": "^5.0.0",
209
- "commitizen": "^4.0.0",
210
198
  "conventional-changelog-conventionalcommits": "^9.0.0",
211
- "cz-conventional-changelog": "^3.0.0",
212
199
  "esbuild": "^0.25.0 || ^0.27.0 || ^0.28.0",
213
200
  "esbuild-node-externals": "^1.0.0",
214
201
  "eslint": ">=9.0.0",
215
- "eslint-config-airbnb": "^19.0.0",
216
- "eslint-config-prettier": ">=10.0.0",
217
- "eslint-config-turbo": "^2.0.0",
218
202
  "eslint-plugin-import": "^2.0.0",
219
203
  "eslint-plugin-jest": "^29.0.0",
220
- "eslint-plugin-jsx-a11y": "^6.0.0",
221
- "eslint-plugin-react": "^7.0.0",
222
- "eslint-plugin-react-hooks": "^7.0.0",
223
- "eslint-plugin-vitest": "^0.5.0",
224
204
  "jest": "^29.0.0",
225
- "husky": "^9.0.0",
226
- "lint-staged": ">=16.0.0",
227
205
  "prettier": "^3.0.0",
228
- "prettier-plugin-tailwindcss": "^0.7.0",
229
206
  "semantic-release": "^25.0.0",
230
207
  "ts-jest": "^29.0.0",
231
208
  "tsup": "^8.0.0",
@@ -237,27 +214,24 @@
237
214
  "@biomejs/biome": {
238
215
  "optional": true
239
216
  },
240
- "@commitlint/types": {
217
+ "@commitlint/cli": {
241
218
  "optional": true
242
219
  },
243
- "@eslint/js": {
220
+ "@commitlint/config-conventional": {
244
221
  "optional": true
245
222
  },
246
- "@ianvs/prettier-plugin-sort-imports": {
223
+ "@commitlint/types": {
247
224
  "optional": true
248
225
  },
249
- "@commitlint/cli": {
226
+ "@eslint/js": {
250
227
  "optional": true
251
228
  },
252
- "@commitlint/config-conventional": {
229
+ "@ianvs/prettier-plugin-sort-imports": {
253
230
  "optional": true
254
231
  },
255
232
  "@next/eslint-plugin-next": {
256
233
  "optional": true
257
234
  },
258
- "@playwright/test": {
259
- "optional": true
260
- },
261
235
  "@semantic-release/changelog": {
262
236
  "optional": true
263
237
  },
@@ -288,18 +262,9 @@
288
262
  "@typescript-eslint/parser": {
289
263
  "optional": true
290
264
  },
291
- "@vitejs/plugin-react": {
292
- "optional": true
293
- },
294
- "commitizen": {
295
- "optional": true
296
- },
297
265
  "conventional-changelog-conventionalcommits": {
298
266
  "optional": true
299
267
  },
300
- "cz-conventional-changelog": {
301
- "optional": true
302
- },
303
268
  "esbuild": {
304
269
  "optional": true
305
270
  },
@@ -309,48 +274,18 @@
309
274
  "eslint": {
310
275
  "optional": true
311
276
  },
312
- "eslint-config-airbnb": {
313
- "optional": true
314
- },
315
- "eslint-config-prettier": {
316
- "optional": true
317
- },
318
- "eslint-config-turbo": {
319
- "optional": true
320
- },
321
277
  "eslint-plugin-import": {
322
278
  "optional": true
323
279
  },
324
280
  "eslint-plugin-jest": {
325
281
  "optional": true
326
282
  },
327
- "eslint-plugin-jsx-a11y": {
328
- "optional": true
329
- },
330
- "eslint-plugin-react": {
331
- "optional": true
332
- },
333
- "eslint-plugin-react-hooks": {
334
- "optional": true
335
- },
336
- "eslint-plugin-vitest": {
337
- "optional": true
338
- },
339
283
  "jest": {
340
284
  "optional": true
341
285
  },
342
- "husky": {
343
- "optional": true
344
- },
345
- "lint-staged": {
346
- "optional": true
347
- },
348
286
  "prettier": {
349
287
  "optional": true
350
288
  },
351
- "prettier-plugin-tailwindcss": {
352
- "optional": true
353
- },
354
289
  "semantic-release": {
355
290
  "optional": true
356
291
  },
@@ -381,15 +316,6 @@
381
316
  "tooling/**/*.{mjs,ts}"
382
317
  ],
383
318
  "ignoreDependencies": [
384
- "cross-env",
385
- "@playwright/test",
386
- "eslint-config-airbnb",
387
- "eslint-config-prettier",
388
- "eslint-config-turbo",
389
- "eslint-plugin-jsx-a11y",
390
- "eslint-plugin-react",
391
- "eslint-plugin-react-hooks",
392
- "eslint-plugin-vitest",
393
319
  "ts-jest",
394
320
  "@semantic-release/commit-analyzer",
395
321
  "@semantic-release/exec",