@pezkuwi/dev 0.85.11 → 0.86.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.
Files changed (69) hide show
  1. package/cjs/packageInfo.js +1 -1
  2. package/cjs/rootJs/index.js +0 -1
  3. package/config/eslint.js +33 -19
  4. package/config/eslint.rules.js +66 -60
  5. package/config/eslint.standard.js +585 -0
  6. package/config/tsconfig.json +8 -0
  7. package/package.json +67 -66
  8. package/packageInfo.js +1 -1
  9. package/rootJs/index.js +1 -2
  10. package/scripts/pezkuwi-dev-build-ts.mjs +46 -21
  11. package/scripts/pezkuwi-exec-node-test.mjs +6 -6
  12. package/scripts/util.mjs +2 -2
  13. package/.skip-deno +0 -0
  14. package/build-deno/README.md +0 -547
  15. package/build-deno/detectOther.ts +0 -2
  16. package/build-deno/index.ts +0 -4
  17. package/build-deno/mod.ts +0 -10
  18. package/build-deno/packageInfo.ts +0 -3
  19. package/build-deno/root.ts +0 -4
  20. package/build-deno/rootJs/Clazz.ts +0 -43
  21. package/build-deno/rootJs/Jsx.tsx +0 -42
  22. package/build-deno/rootJs/JsxChild.tsx +0 -18
  23. package/build-deno/rootJs/augmented.ts +0 -12
  24. package/build-deno/rootJs/dynamic.d.mts +0 -4
  25. package/build-deno/rootJs/dynamic.mjs +0 -13
  26. package/build-deno/rootJs/index.ts +0 -51
  27. package/build-deno/rootJs/testJson.json +0 -5
  28. package/build-deno/rootStatic/zagros.svg +0 -1
  29. package/build-deno/rootTests.ts +0 -57
  30. package/build-deno/types.ts +0 -4
  31. package/build-tsc/detectOther.d.ts +0 -2
  32. package/build-tsc/index.d.ts +0 -1
  33. package/build-tsc/packageInfo.d.ts +0 -6
  34. package/build-tsc/root.d.ts +0 -2
  35. package/build-tsc/rootJs/Clazz.d.ts +0 -18
  36. package/build-tsc/rootJs/Jsx.d.ts +0 -5
  37. package/build-tsc/rootJs/JsxChild.d.ts +0 -9
  38. package/build-tsc/rootJs/augmented.d.ts +0 -8
  39. package/build-tsc/rootJs/index.d.ts +0 -19
  40. package/build-tsc/rootTests.d.ts +0 -2
  41. package/build-tsc/types.d.ts +0 -2
  42. package/build-tsc-cjs/detectOther.js +0 -3
  43. package/build-tsc-cjs/index.js +0 -3
  44. package/build-tsc-cjs/packageInfo.js +0 -4
  45. package/build-tsc-cjs/root.js +0 -6
  46. package/build-tsc-cjs/rootJs/Clazz.js +0 -36
  47. package/build-tsc-cjs/rootJs/Jsx.js +0 -16
  48. package/build-tsc-cjs/rootJs/JsxChild.js +0 -9
  49. package/build-tsc-cjs/rootJs/augmented.js +0 -3
  50. package/build-tsc-cjs/rootJs/index.js +0 -51
  51. package/build-tsc-cjs/rootTests.js +0 -44
  52. package/build-tsc-cjs/types.js +0 -2
  53. package/build-tsc-esm/detectOther.js +0 -1
  54. package/build-tsc-esm/index.js +0 -2
  55. package/build-tsc-esm/packageInfo.js +0 -1
  56. package/build-tsc-esm/root.js +0 -2
  57. package/build-tsc-esm/rootJs/Clazz.js +0 -32
  58. package/build-tsc-esm/rootJs/Jsx.js +0 -13
  59. package/build-tsc-esm/rootJs/JsxChild.js +0 -6
  60. package/build-tsc-esm/rootJs/augmented.js +0 -2
  61. package/build-tsc-esm/rootJs/index.js +0 -39
  62. package/build-tsc-esm/rootTests.js +0 -41
  63. package/build-tsc-esm/types.js +0 -1
  64. package/tsconfig.build.json +0 -18
  65. package/tsconfig.build.tsbuildinfo +0 -1
  66. package/tsconfig.config.json +0 -14
  67. package/tsconfig.scripts.json +0 -14
  68. package/tsconfig.spec.json +0 -18
  69. package/tsconfig.spec.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -1,24 +1,21 @@
1
1
  {
2
2
  "author": "Pezkuwi Team <team@pezkuwichain.app>",
3
- "bugs": "https://github.com/pezkuwichain/pezkuwi-dev/issues",
3
+ "bugs": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/issues",
4
4
  "description": "A collection of shared CI scripts and development environment used by @pezkuwi projects",
5
5
  "engines": {
6
- "node": ">=18"
6
+ "node": ">=20.19"
7
7
  },
8
- "homepage": "https://github.com/pezkuwichain/pezkuwi-dev/tree/master/packages/dev#readme",
8
+ "homepage": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev/tree/master/packages/dev#readme",
9
9
  "license": "Apache-2.0",
10
10
  "name": "@pezkuwi/dev",
11
11
  "repository": {
12
12
  "directory": "packages/dev",
13
13
  "type": "git",
14
- "url": "https://github.com/pezkuwichain/pezkuwi-dev.git"
14
+ "url": "https://git.pezkuwichain.io/pezkuwichain/pezkuwi-dev.git"
15
15
  },
16
16
  "sideEffects": false,
17
17
  "type": "module",
18
- "types": "./index.d.ts",
19
- "version": "0.85.11",
20
- "main": "./cjs/index.js",
21
- "module": "./index.js",
18
+ "version": "0.86.0",
22
19
  "bin": {
23
20
  "pezkuwi-ci-ghact-build": "./scripts/pezkuwi-ci-ghact-build.mjs",
24
21
  "pezkuwi-ci-ghact-docs": "./scripts/pezkuwi-ci-ghact-docs.mjs",
@@ -44,7 +41,12 @@
44
41
  "pezkuwi-exec-tsc": "./scripts/pezkuwi-exec-tsc.mjs",
45
42
  "pezkuwi-exec-webpack": "./scripts/pezkuwi-exec-webpack.mjs"
46
43
  },
44
+ "main": "./cjs/index.js",
45
+ "module": "./index.js",
46
+ "types": "./index.d.ts",
47
47
  "exports": {
48
+ "./cjs/package.json": "./cjs/package.json",
49
+ "./cjs/*": "./cjs/*.js",
48
50
  ".": {
49
51
  "module": {
50
52
  "types": "./index.d.ts",
@@ -59,16 +61,15 @@
59
61
  "default": "./index.js"
60
62
  }
61
63
  },
62
- "./cjs/*": "./cjs/*.js",
63
- "./cjs/package.json": "./cjs/package.json",
64
64
  "./config/eslint": "./config/eslint.js",
65
65
  "./config/eslint.rules": "./config/eslint.rules.js",
66
- "./config/prettier": "./config/prettier.cjs",
66
+ "./config/eslint.standard": "./config/eslint.standard.js",
67
67
  "./config/prettier.cjs": "./config/prettier.cjs",
68
+ "./config/prettier": "./config/prettier.cjs",
68
69
  "./config/rollup": "./config/rollup.js",
69
70
  "./config/tsconfig.json": "./config/tsconfig.json",
70
- "./config/typedoc": "./config/typedoc.cjs",
71
71
  "./config/typedoc.cjs": "./config/typedoc.cjs",
72
+ "./config/typedoc": "./config/typedoc.cjs",
72
73
  "./detectOther": {
73
74
  "module": {
74
75
  "types": "./detectOther.d.ts",
@@ -87,7 +88,7 @@
87
88
  "require": "./cjs/package.json",
88
89
  "default": "./package.json"
89
90
  },
90
- "./packageInfo": {
91
+ "./packageInfo.js": {
91
92
  "module": {
92
93
  "types": "./packageInfo.d.ts",
93
94
  "default": "./packageInfo.js"
@@ -101,7 +102,7 @@
101
102
  "default": "./packageInfo.js"
102
103
  }
103
104
  },
104
- "./packageInfo.js": {
105
+ "./packageInfo": {
105
106
  "module": {
106
107
  "types": "./packageInfo.d.ts",
107
108
  "default": "./packageInfo.js"
@@ -171,9 +172,9 @@
171
172
  "default": "./rootJs/Clazz.js"
172
173
  }
173
174
  },
174
- "./rootJs/dynamic": "./rootJs/dynamic.mjs",
175
175
  "./rootJs/dynamic.d.mts": "./rootJs/dynamic.d.mts",
176
176
  "./rootJs/dynamic.mjs": "./rootJs/dynamic.mjs",
177
+ "./rootJs/dynamic": "./rootJs/dynamic.mjs",
177
178
  "./rootJs/Jsx": {
178
179
  "module": {
179
180
  "types": "./rootJs/Jsx.d.ts",
@@ -218,54 +219,54 @@
218
219
  "default": "./rootTests.js"
219
220
  }
220
221
  },
221
- "./scripts/pezkuwi-ci-ghact-build": "./scripts/pezkuwi-ci-ghact-build.mjs",
222
222
  "./scripts/pezkuwi-ci-ghact-build.mjs": "./scripts/pezkuwi-ci-ghact-build.mjs",
223
- "./scripts/pezkuwi-ci-ghact-docs": "./scripts/pezkuwi-ci-ghact-docs.mjs",
223
+ "./scripts/pezkuwi-ci-ghact-build": "./scripts/pezkuwi-ci-ghact-build.mjs",
224
224
  "./scripts/pezkuwi-ci-ghact-docs.mjs": "./scripts/pezkuwi-ci-ghact-docs.mjs",
225
- "./scripts/pezkuwi-ci-ghpages-force": "./scripts/pezkuwi-ci-ghpages-force.mjs",
225
+ "./scripts/pezkuwi-ci-ghact-docs": "./scripts/pezkuwi-ci-ghact-docs.mjs",
226
226
  "./scripts/pezkuwi-ci-ghpages-force.mjs": "./scripts/pezkuwi-ci-ghpages-force.mjs",
227
- "./scripts/pezkuwi-dev-build-docs": "./scripts/pezkuwi-dev-build-docs.mjs",
227
+ "./scripts/pezkuwi-ci-ghpages-force": "./scripts/pezkuwi-ci-ghpages-force.mjs",
228
228
  "./scripts/pezkuwi-dev-build-docs.mjs": "./scripts/pezkuwi-dev-build-docs.mjs",
229
- "./scripts/pezkuwi-dev-build-ts": "./scripts/pezkuwi-dev-build-ts.mjs",
229
+ "./scripts/pezkuwi-dev-build-docs": "./scripts/pezkuwi-dev-build-docs.mjs",
230
230
  "./scripts/pezkuwi-dev-build-ts.mjs": "./scripts/pezkuwi-dev-build-ts.mjs",
231
- "./scripts/pezkuwi-dev-circular": "./scripts/pezkuwi-dev-circular.mjs",
231
+ "./scripts/pezkuwi-dev-build-ts": "./scripts/pezkuwi-dev-build-ts.mjs",
232
232
  "./scripts/pezkuwi-dev-circular.mjs": "./scripts/pezkuwi-dev-circular.mjs",
233
- "./scripts/pezkuwi-dev-clean-build": "./scripts/pezkuwi-dev-clean-build.mjs",
233
+ "./scripts/pezkuwi-dev-circular": "./scripts/pezkuwi-dev-circular.mjs",
234
234
  "./scripts/pezkuwi-dev-clean-build.mjs": "./scripts/pezkuwi-dev-clean-build.mjs",
235
- "./scripts/pezkuwi-dev-contrib": "./scripts/pezkuwi-dev-contrib.mjs",
235
+ "./scripts/pezkuwi-dev-clean-build": "./scripts/pezkuwi-dev-clean-build.mjs",
236
236
  "./scripts/pezkuwi-dev-contrib.mjs": "./scripts/pezkuwi-dev-contrib.mjs",
237
- "./scripts/pezkuwi-dev-copy-dir": "./scripts/pezkuwi-dev-copy-dir.mjs",
237
+ "./scripts/pezkuwi-dev-contrib": "./scripts/pezkuwi-dev-contrib.mjs",
238
238
  "./scripts/pezkuwi-dev-copy-dir.mjs": "./scripts/pezkuwi-dev-copy-dir.mjs",
239
- "./scripts/pezkuwi-dev-copy-to": "./scripts/pezkuwi-dev-copy-to.mjs",
239
+ "./scripts/pezkuwi-dev-copy-dir": "./scripts/pezkuwi-dev-copy-dir.mjs",
240
240
  "./scripts/pezkuwi-dev-copy-to.mjs": "./scripts/pezkuwi-dev-copy-to.mjs",
241
- "./scripts/pezkuwi-dev-deno-map": "./scripts/pezkuwi-dev-deno-map.mjs",
241
+ "./scripts/pezkuwi-dev-copy-to": "./scripts/pezkuwi-dev-copy-to.mjs",
242
242
  "./scripts/pezkuwi-dev-deno-map.mjs": "./scripts/pezkuwi-dev-deno-map.mjs",
243
- "./scripts/pezkuwi-dev-run-lint": "./scripts/pezkuwi-dev-run-lint.mjs",
243
+ "./scripts/pezkuwi-dev-deno-map": "./scripts/pezkuwi-dev-deno-map.mjs",
244
244
  "./scripts/pezkuwi-dev-run-lint.mjs": "./scripts/pezkuwi-dev-run-lint.mjs",
245
- "./scripts/pezkuwi-dev-run-node-ts": "./scripts/pezkuwi-dev-run-node-ts.mjs",
245
+ "./scripts/pezkuwi-dev-run-lint": "./scripts/pezkuwi-dev-run-lint.mjs",
246
246
  "./scripts/pezkuwi-dev-run-node-ts.mjs": "./scripts/pezkuwi-dev-run-node-ts.mjs",
247
- "./scripts/pezkuwi-dev-run-test": "./scripts/pezkuwi-dev-run-test.mjs",
247
+ "./scripts/pezkuwi-dev-run-node-ts": "./scripts/pezkuwi-dev-run-node-ts.mjs",
248
248
  "./scripts/pezkuwi-dev-run-test.mjs": "./scripts/pezkuwi-dev-run-test.mjs",
249
- "./scripts/pezkuwi-dev-version": "./scripts/pezkuwi-dev-version.mjs",
249
+ "./scripts/pezkuwi-dev-run-test": "./scripts/pezkuwi-dev-run-test.mjs",
250
250
  "./scripts/pezkuwi-dev-version.mjs": "./scripts/pezkuwi-dev-version.mjs",
251
- "./scripts/pezkuwi-dev-yarn-only": "./scripts/pezkuwi-dev-yarn-only.mjs",
251
+ "./scripts/pezkuwi-dev-version": "./scripts/pezkuwi-dev-version.mjs",
252
252
  "./scripts/pezkuwi-dev-yarn-only.mjs": "./scripts/pezkuwi-dev-yarn-only.mjs",
253
- "./scripts/pezkuwi-exec-eslint": "./scripts/pezkuwi-exec-eslint.mjs",
253
+ "./scripts/pezkuwi-dev-yarn-only": "./scripts/pezkuwi-dev-yarn-only.mjs",
254
254
  "./scripts/pezkuwi-exec-eslint.mjs": "./scripts/pezkuwi-exec-eslint.mjs",
255
- "./scripts/pezkuwi-exec-ghpages": "./scripts/pezkuwi-exec-ghpages.mjs",
255
+ "./scripts/pezkuwi-exec-eslint": "./scripts/pezkuwi-exec-eslint.mjs",
256
256
  "./scripts/pezkuwi-exec-ghpages.mjs": "./scripts/pezkuwi-exec-ghpages.mjs",
257
- "./scripts/pezkuwi-exec-ghrelease": "./scripts/pezkuwi-exec-ghrelease.mjs",
257
+ "./scripts/pezkuwi-exec-ghpages": "./scripts/pezkuwi-exec-ghpages.mjs",
258
258
  "./scripts/pezkuwi-exec-ghrelease.mjs": "./scripts/pezkuwi-exec-ghrelease.mjs",
259
- "./scripts/pezkuwi-exec-node-test": "./scripts/pezkuwi-exec-node-test.mjs",
259
+ "./scripts/pezkuwi-exec-ghrelease": "./scripts/pezkuwi-exec-ghrelease.mjs",
260
260
  "./scripts/pezkuwi-exec-node-test.mjs": "./scripts/pezkuwi-exec-node-test.mjs",
261
- "./scripts/pezkuwi-exec-rollup": "./scripts/pezkuwi-exec-rollup.mjs",
261
+ "./scripts/pezkuwi-exec-node-test": "./scripts/pezkuwi-exec-node-test.mjs",
262
262
  "./scripts/pezkuwi-exec-rollup.mjs": "./scripts/pezkuwi-exec-rollup.mjs",
263
- "./scripts/pezkuwi-exec-tsc": "./scripts/pezkuwi-exec-tsc.mjs",
263
+ "./scripts/pezkuwi-exec-rollup": "./scripts/pezkuwi-exec-rollup.mjs",
264
264
  "./scripts/pezkuwi-exec-tsc.mjs": "./scripts/pezkuwi-exec-tsc.mjs",
265
- "./scripts/pezkuwi-exec-webpack": "./scripts/pezkuwi-exec-webpack.mjs",
265
+ "./scripts/pezkuwi-exec-tsc": "./scripts/pezkuwi-exec-tsc.mjs",
266
266
  "./scripts/pezkuwi-exec-webpack.mjs": "./scripts/pezkuwi-exec-webpack.mjs",
267
- "./scripts/util": "./scripts/util.mjs",
267
+ "./scripts/pezkuwi-exec-webpack": "./scripts/pezkuwi-exec-webpack.mjs",
268
268
  "./scripts/util.mjs": "./scripts/util.mjs",
269
+ "./scripts/util": "./scripts/util.mjs",
269
270
  "./types": {
270
271
  "module": {
271
272
  "types": "./types.d.ts",
@@ -282,47 +283,47 @@
282
283
  }
283
284
  },
284
285
  "dependencies": {
285
- "@eslint/js": "^8.56.0",
286
- "@pezkuwi/dev-test": "^0.85.3",
287
- "@pezkuwi/dev-ts": "^0.85.3",
286
+ "@eslint/compat": "^2.1.1",
287
+ "@eslint/js": "^10.0.1",
288
+ "@pezkuwi/dev-test": "^0.86.0",
289
+ "@pezkuwi/dev-ts": "^0.86.0",
288
290
  "@rollup/plugin-alias": "^5.1.1",
289
- "@rollup/plugin-commonjs": "^25.0.8",
291
+ "@rollup/plugin-commonjs": "^29.0.3",
290
292
  "@rollup/plugin-dynamic-import-vars": "^2.1.5",
291
293
  "@rollup/plugin-inject": "^5.0.5",
292
294
  "@rollup/plugin-json": "^6.1.0",
293
- "@rollup/plugin-node-resolve": "^15.3.1",
295
+ "@rollup/plugin-node-resolve": "^16.0.3",
296
+ "@stylistic/eslint-plugin": "^5.10.0",
294
297
  "@tsconfig/strictest": "^2.0.2",
295
- "@typescript-eslint/eslint-plugin": "^6.19.1",
296
- "@typescript-eslint/parser": "^6.19.1",
297
- "eslint": "^8.56.0",
298
- "eslint-config-standard": "^17.1.0",
298
+ "@typescript-eslint/eslint-plugin": "^8.71.1",
299
+ "@typescript-eslint/parser": "^8.71.1",
300
+ "eslint": "^10.12.0",
299
301
  "eslint-import-resolver-node": "^0.3.9",
300
- "eslint-import-resolver-typescript": "^3.6.1",
301
- "eslint-plugin-deprecation": "^2.0.0",
302
+ "eslint-import-resolver-typescript": "^4.4.5",
302
303
  "eslint-plugin-header": "^3.1.1",
303
- "eslint-plugin-import": "^2.29.1",
304
- "eslint-plugin-import-newlines": "^1.3.4",
305
- "eslint-plugin-jest": "^27.6.3",
306
- "eslint-plugin-n": "^16.6.2",
307
- "eslint-plugin-promise": "^6.1.1",
308
- "eslint-plugin-react": "^7.33.2",
309
- "eslint-plugin-react-hooks": "^4.6.0",
310
- "eslint-plugin-simple-import-sort": "^10.0.0",
311
- "eslint-plugin-sort-destructure-keys": "^1.5.0",
312
- "espree": "^9.6.1",
304
+ "eslint-plugin-import-newlines": "^2.0.0",
305
+ "eslint-plugin-import-x": "^4.17.1",
306
+ "eslint-plugin-jest": "^29.16.6",
307
+ "eslint-plugin-n": "^18.4.1",
308
+ "eslint-plugin-promise": "^7.3.0",
309
+ "eslint-plugin-react": "^7.37.5",
310
+ "eslint-plugin-react-hooks": "^7.1.1",
311
+ "eslint-plugin-simple-import-sort": "^14.0.0",
312
+ "eslint-plugin-sort-destructure-keys": "^3.0.0",
313
+ "espree": "^11.2.0",
313
314
  "gh-pages": "^6.1.1",
314
- "gh-release": "^7.0.2",
315
- "globals": "^13.24.0",
315
+ "gh-release": "^8.1.0",
316
+ "globals": "^17.13.0",
316
317
  "json5": "^2.2.3",
317
- "madge": "^6.1.0",
318
+ "madge": "^8.0.0",
318
319
  "rollup": "^4.9.6",
319
320
  "rollup-plugin-cleanup": "^3.2.1",
320
321
  "tslib": "^2.7.0",
321
322
  "typescript": "^5.5.4",
322
323
  "webpack": "^5.89.0",
323
- "webpack-cli": "^5.1.4",
324
- "webpack-dev-server": "^4.15.1",
325
- "webpack-merge": "^5.10.0",
324
+ "webpack-cli": "^7.2.3",
325
+ "webpack-dev-server": "^6.0.0",
326
+ "webpack-merge": "^6.0.1",
326
327
  "webpack-subresource-integrity": "^5.2.0-rc.1",
327
328
  "yargs": "^17.7.2"
328
329
  }
package/packageInfo.js CHANGED
@@ -1 +1 @@
1
- export const packageInfo = { name: '@pezkuwi/dev', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.85.4' };
1
+ export const packageInfo = { name: '@pezkuwi/dev', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.86.0' };
package/rootJs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** This should appear as-is in the output with: 1. extension added, 2. augmented.d.ts correct */
2
2
  import './augmented.js';
3
3
  /** This import should appear as-in in the ouput (cjs without asserts) */
4
- import testJson from '@pezkuwi/dev/rootJs/testJson.json' assert { type: 'json' };
4
+ import testJson from '@pezkuwi/dev/rootJs/testJson.json' with { type: 'json' };
5
5
  /** Double double work, i.e. re-exports */
6
6
  export { Clazz } from './Clazz.js';
7
7
  /** Function to ensure that BigInt does not have the Babel Math.pow() transform */
@@ -14,7 +14,6 @@ export async function dynamic(a, b) {
14
14
  // NOTE we go via this path so it points to the same location in both ESM
15
15
  // and CJS output (a './dynamic' import would be different otherwise)
16
16
  const { sum } = await import('@pezkuwi/dev/rootJs/dynamic.mjs');
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
18
17
  return sum(a, b);
19
18
  }
20
19
  /** Function to ensure we have json correctly imported */
@@ -73,7 +73,12 @@ async function compileJs (compileType, type) {
73
73
 
74
74
  const source = fs.readFileSync(filename, 'utf-8');
75
75
 
76
- // compile with the options aligning with our tsconfig
76
+ // compile with the options aligning with our tsconfig. CJS is emitted
77
+ // under Node's own rules (NodeNext; a lone file is taken as CommonJS):
78
+ // CommonJS with NodeNext resolution kept `import()` of an ES module on
79
+ // TypeScript 5.5 and turned it into require() from 5.6 on, which an ES
80
+ // module cannot answer on Node before 22 (rootEsm.spec "contains
81
+ // import(...) in cjs").
77
82
  const { outputText } = ts.transpileModule(source, {
78
83
  compilerOptions: {
79
84
  esModuleInterop: true,
@@ -82,11 +87,12 @@ async function compileJs (compileType, type) {
82
87
  ? ts.JsxEmit.ReactJSX
83
88
  : undefined,
84
89
  module: type === 'cjs'
85
- ? ts.ModuleKind.CommonJS
90
+ ? ts.ModuleKind.NodeNext
86
91
  : ts.ModuleKind.ESNext,
87
92
  moduleResolution: ts.ModuleResolutionKind.NodeNext,
88
93
  target: TARGET_TSES
89
- }
94
+ },
95
+ fileName: filename
90
96
  });
91
97
 
92
98
  mkdirpSync(path.dirname(outFile));
@@ -448,6 +454,7 @@ function relativePath (value) {
448
454
  if (!value || typeof value !== 'string') {
449
455
  return '';
450
456
  }
457
+
451
458
  return value.startsWith('.') ? value : `./${value}`;
452
459
  }
453
460
 
@@ -938,13 +945,33 @@ function getEnginesVer (currVer) {
938
945
  }
939
946
 
940
947
  /**
941
- * @param {string} repoPath
948
+ * The repository's web address, taken from the root package.json as declared.
949
+ *
950
+ * This used to split on 'https://github.com/', which threw on any other host and,
951
+ * where it did not throw, rewrote every published package back to GitHub. The
952
+ * declared host is the authority; this only normalises its spelling.
953
+ *
954
+ * @param {string} url
955
+ * @returns {string} e.g. https://git.example.org/owner/repo (no trailing .git)
956
+ */
957
+ function repoBaseFromUrl (url) {
958
+ if (!url) {
959
+ throw new Error('package.json has no repository.url');
960
+ }
961
+
962
+ const parsed = new URL(url.replace(/^git\+/, ''));
963
+
964
+ return `${parsed.protocol}//${parsed.host}${parsed.pathname.replace(/\.git$/, '').replace(/\/$/, '')}`;
965
+ }
966
+
967
+ /**
968
+ * @param {string} repoBase
942
969
  * @param {string | null} dir
943
970
  * @param {PkgJson} json
944
971
  */
945
- function orderPackageJson (repoPath, dir, json) {
946
- json.bugs = `https://github.com/${repoPath}/issues`;
947
- json.homepage = `https://github.com/${repoPath}${dir ? `/tree/master/packages/${dir}` : ''}#readme`;
972
+ function orderPackageJson (repoBase, dir, json) {
973
+ json.bugs = `${repoBase}/issues`;
974
+ json.homepage = `${repoBase}${dir ? `/tree/master/packages/${dir}` : ''}#readme`;
948
975
  json.license = !json.license || json.license === 'Apache-2'
949
976
  ? 'Apache-2.0'
950
977
  : json.license;
@@ -954,7 +981,7 @@ function orderPackageJson (repoPath, dir, json) {
954
981
  : {}
955
982
  ),
956
983
  type: 'git',
957
- url: `https://github.com/${repoPath}.git`
984
+ url: `${repoBase}.git`
958
985
  };
959
986
  json.sideEffects = json.sideEffects || false;
960
987
  json.engines = {
@@ -1092,8 +1119,8 @@ function lintInput (dir) {
1092
1119
  // file will also be caught in the net, i.e. we expect all files to conform
1093
1120
  if (n === 0 && (
1094
1121
  !/\/\/ Copyright .* @pezkuwi\//.test(l) &&
1095
- !/\/\/ Auto-generated via `/.test(l) &&
1096
- !/#!\/usr\/bin\/env node/.test(l)
1122
+ !l.includes('// Auto-generated via `') &&
1123
+ !l.includes('#!/usr/bin/env node')
1097
1124
  )) {
1098
1125
  return createError(full, l, n, 'Invalid header definition');
1099
1126
  }
@@ -1254,7 +1281,7 @@ function extractPackageInfoImports (filepath, withDetectImport) {
1254
1281
  .readFileSync(filepath, { encoding: 'utf-8' })
1255
1282
  .split('\n')
1256
1283
  .forEach((l) => {
1257
- const match = l.match(/import \{ packageInfo as (.*) \}/);
1284
+ const match = /import \{ packageInfo as (.*) \}/.exec(l);
1258
1285
 
1259
1286
  if (match) {
1260
1287
  otherImports.push(l);
@@ -1263,8 +1290,8 @@ function extractPackageInfoImports (filepath, withDetectImport) {
1263
1290
  });
1264
1291
 
1265
1292
  otherImports.sort((a, b) => {
1266
- const am = a.match(/\} from '(.*)';/);
1267
- const bm = b.match(/\} from '(.*)';/);
1293
+ const am = /\} from '(.*)';/.exec(a);
1294
+ const bm = /\} from '(.*)';/.exec(b);
1268
1295
 
1269
1296
  if (!am) {
1270
1297
  throw new Error(`Unable to extract from import from ${a}`);
@@ -1284,12 +1311,12 @@ function extractPackageInfoImports (filepath, withDetectImport) {
1284
1311
 
1285
1312
  /**
1286
1313
  * @param {CompileType} compileType
1287
- * @param {string} repoPath
1314
+ * @param {string} repoBase
1288
1315
  * @param {string} dir
1289
1316
  * @param {[string, string][]} locals
1290
1317
  * @returns {Promise<void>}
1291
1318
  */
1292
- async function buildJs (compileType, repoPath, dir, locals) {
1319
+ async function buildJs (compileType, repoBase, dir, locals) {
1293
1320
  const pkgJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), './package.json'), 'utf-8'));
1294
1321
  const { name, version } = pkgJson;
1295
1322
 
@@ -1301,7 +1328,7 @@ async function buildJs (compileType, repoPath, dir, locals) {
1301
1328
 
1302
1329
  console.log(`*** ${name} ${version}`);
1303
1330
 
1304
- orderPackageJson(repoPath, dir, pkgJson);
1331
+ orderPackageJson(repoBase, dir, pkgJson);
1305
1332
 
1306
1333
  // move the tsc-generated *.d.ts build files to build-tsc
1307
1334
  if (fs.existsSync('build')) {
@@ -1471,11 +1498,9 @@ async function main () {
1471
1498
  }
1472
1499
  }
1473
1500
 
1474
- const repoPath = pkg.repository.url
1475
- .split('https://github.com/')[1]
1476
- .split('.git')[0];
1501
+ const repoBase = repoBaseFromUrl(pkg.repository?.url);
1477
1502
 
1478
- orderPackageJson(repoPath, null, pkg);
1503
+ orderPackageJson(repoBase, null, pkg);
1479
1504
  execPm('pezkuwi-exec-tsc --build tsconfig.build.json');
1480
1505
 
1481
1506
  process.chdir('packages');
@@ -1503,7 +1528,7 @@ async function main () {
1503
1528
  for (const dir of dirs) {
1504
1529
  process.chdir(dir);
1505
1530
 
1506
- await buildJs(compileType, repoPath, dir, locals);
1531
+ await buildJs(compileType, repoBase, dir, locals);
1507
1532
 
1508
1533
  process.chdir('..');
1509
1534
  }
@@ -122,7 +122,7 @@ function getFilename (r) {
122
122
  .split('\n')
123
123
  .map((l) => l.trim())
124
124
  .filter((l) => l.startsWith('at ') && (l.includes('.spec.') || l.includes('.test.')))
125
- .map((l) => l.match(/\(.*:\d\d?:\d\d?\)$/)?.[0])
125
+ .map((l) => (/\(.*:\d\d?:\d\d?\)$/.exec(l))?.[0])
126
126
  .map((l) => l?.replace('(', '')?.replace(')', ''));
127
127
 
128
128
  if (stack.length) {
@@ -186,7 +186,7 @@ function complete () {
186
186
 
187
187
  if (typeof r === 'string') {
188
188
  console.log(r); // Node.js <= 18.14
189
- } else if (r.file && r.file.includes('@pezkuwi/dev/scripts')) {
189
+ } else if (r.file?.includes('@pezkuwi/dev/scripts')) {
190
190
  // Ignore internal diagnostics
191
191
  } else {
192
192
  if (lastFilename !== r.file) {
@@ -328,11 +328,11 @@ if (isMainThread) {
328
328
  } else {
329
329
  run({ files: workerData.files, timeout: 3_600_000 })
330
330
  .on('data', () => undefined)
331
- .on('end', () => parentPort && parentPort.postMessage(stats))
331
+ .on('end', () => parentPort?.postMessage(stats))
332
332
  .on('test:coverage', () => undefined)
333
333
  .on('test:diagnostic', (/** @type {DiagStat} */data) => {
334
334
  stats.diag.push(data);
335
- parentPort && parentPort.postMessage({ data: stats, type: 'result' });
335
+ parentPort?.postMessage({ data: stats, type: 'result' });
336
336
  })
337
337
  .on('test:fail', (/** @type {FailStat} */ data) => {
338
338
  const statFail = structuredClone(data);
@@ -343,7 +343,7 @@ if (isMainThread) {
343
343
 
344
344
  stats.fail.push(statFail);
345
345
  stats.total++;
346
- parentPort && parentPort.postMessage({ data: 'x', type: 'progress' });
346
+ parentPort?.postMessage({ data: 'x', type: 'progress' });
347
347
 
348
348
  if (bail) {
349
349
  complete();
@@ -361,7 +361,7 @@ if (isMainThread) {
361
361
  }
362
362
 
363
363
  stats.total++;
364
- parentPort && parentPort.postMessage({ data: symbol, type: 'progress' });
364
+ parentPort?.postMessage({ data: symbol, type: 'progress' });
365
365
  })
366
366
  .on('test:plan', () => undefined)
367
367
  .on('test:start', () => undefined);
package/scripts/util.mjs CHANGED
@@ -83,7 +83,7 @@ export function copyDirSync (src, dest, include, exclude) {
83
83
  if (fs.statSync(srcPath).isDirectory()) {
84
84
  copyDirSync(srcPath, path.join(dest, file), include, exclude);
85
85
  } else if (!include?.length || include.some((e) => file.endsWith(e))) {
86
- if (!exclude || !exclude.some((e) => file.endsWith(e))) {
86
+ if (!exclude?.some((e) => file.endsWith(e))) {
87
87
  copyFileSync(srcPath, dest);
88
88
  }
89
89
  }
@@ -480,7 +480,7 @@ export function topoSort (dirs) {
480
480
  visited[key] = true;
481
481
 
482
482
  node.vertices.forEach((i) => {
483
- if (ancestors.indexOf(i) >= 0) {
483
+ if (ancestors.includes(i)) {
484
484
  console.log('CIRCULAR: closed chain : ' + i + ' is in ' + id);
485
485
 
486
486
  if (nodes[id].vertices.includes(i)) {
package/.skip-deno DELETED
File without changes