Skip to content

Commit 8894980

Browse files
authored
Merge pull request #4401 from GordonSmith/NODEJS_24
fix: Support NodeJS 24 build env.
2 parents 642f418 + 7fe9e1e commit 8894980

11 files changed

Lines changed: 640 additions & 305 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: ${{ github.event_name == 'pull_request' || steps.release.outputs.release_created }}
3838
uses: actions/setup-node@v4
3939
with:
40-
node-version: 20
40+
node-version: 24
4141
registry-url: "https://registry.npmjs.org"
4242
scope: "@hpcc-js"
4343

.github/workflows/update-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: "20"
15+
node-version: 24
1616
registry-url: "https://registry.npmjs.org"
1717
scope: "@hpcc-js"
1818
- run: npm ci

package-lock.json

Lines changed: 275 additions & 296 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test-node": "vitest run --project node",
2424
"test-node-esm": "cd tests/node-esm && npm i && npm test",
2525
"test-node-cjs": "cd tests/node-cjs && npm i && npm test",
26+
"test-type-leaks": "cd tests/type-leaks && npm i && npm test",
2627
"test": "lerna run test",
2728
"test-all": "vitest run",
2829
"publish": "lerna publish from-package --yes",

packages/dgrid-shim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"webpack": "5.98.0",
4646
"webpack-cli": "5.1.4",
4747
"webpack-hasjs-plugin": "1.0.4",
48-
"dojo-webpack-plugin": "3.0.6",
48+
"dojo-webpack-plugin": "3.0.9",
4949
"terser-webpack-plugin": "5.3.14"
5050
},
5151
"repository": {

packages/esbuild-plugins/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
"dependencies": {
4040
"@hpcc-js/wasm-base91": "1.3.1",
4141
"@hpcc-js/wasm-zstd": "1.2.1",
42-
"esbuild": "0.25.2",
42+
"esbuild": "0.25.5",
4343
"esbuild-plugin-umd-wrapper": "3.0.0",
4444
"esbuild-copy-static-files": "0.1.0",
4545
"esbuild-plugin-inline-css": "0.0.1",
4646
"fzstd": "0.1.1",
47-
"vite": "6.3.5",
47+
"vite": "7.0.0",
4848
"vite-plugin-css-injected-by-js": "3.5.2",
49-
"vite-plugin-static-copy": "3.0.2"
49+
"vite-plugin-static-copy": "3.1.0"
5050
},
5151
"keywords": [
5252
"esbuild",

packages/markdown-it-plugins/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@
5454
"dependencies": {
5555
"@hpcc-js/observablehq-compiler": "^3.3.2",
5656
"@observablehq/framework": "1.13.2",
57-
"@observablehq/runtime": "5.9.9"
57+
"@observablehq/runtime": "5.9.9",
58+
"@types/markdown-it": "14.1.2"
59+
},
60+
"peerDependencies": {
61+
"markdown-it": "14.1.0"
5862
},
5963
"devDependencies": {
6064
"@hpcc-js/esbuild-plugins": "^1.4.2",
61-
"@types/markdown-it": "14.1.2",
6265
"apache-arrow": "19.0.1",
6366
"d3-dsv": "3.0.1",
6467
"d3-fetch": "3.0.1",
6568
"dotenv": "16.4.7",
66-
"markdown-it": "14.1.0",
6769
"shiki": "2.5.0",
6870
"tsx": "4.19.3"
6971
},

tests/type-leaks/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Type Dependencies Test
2+
3+
This test suite validates that packages in the HPCC Visualization Framework monorepo do not reference types from third-party libraries unless those libraries are explicitly declared as dependencies or peerDependencies in their `package.json`.
4+
5+
## Purpose
6+
7+
- **Prevents runtime errors**: Ensures that all external type dependencies are properly declared
8+
- **Improves maintainability**: Makes it clear which external libraries each package depends on
9+
- **Enforces consistency**: Ensures all packages follow the same dependency declaration patterns
10+
11+
## What it checks
12+
13+
1. **TypeScript type files**: Scan `index.d.ts`, `index.node.d.ts`, `index.browser.d.ts` files in each package's `types/` directory
14+
2. **Import statements**: Analyzes `import` and `from` statements to find external dependencies
15+
3. **Type imports**: Specifically looks for type-only imports and type references
16+
4. **Dependency validation**: Checks that referenced packages are in the `dependencies` section of `package.json`
17+
18+
## Exclusions
19+
20+
The test ignores:
21+
- **Built-in Node.js modules**: `fs`, `path`, `util`, etc.
22+
- **TypeScript built-ins**: `typescript`, `@types/node`
23+
- **Internal packages**: All `@hpcc-js/*` packages
24+
- **Relative imports**: Local file imports starting with `./` or `../`
25+
- **Dev dependencies**: Types only used in tests or build scripts
26+
27+
## Running the tests
28+
29+
```bash
30+
# From the root directory
31+
npm run test --workspace tests/type-leaks
32+
33+
# Or directly in the types directory
34+
cd tests/type-leaks
35+
npm test
36+
```
37+
38+
## Example violations
39+
40+
If a package imports from `lodash` but doesn't have it in dependencies:
41+
42+
```typescript
43+
// ❌ Violation - lodash not in dependencies
44+
import { debounce } from 'lodash';
45+
46+
// ✅ Correct - lodash in dependencies section of package.json
47+
{
48+
"dependencies": {
49+
"lodash": "^4.17.21"
50+
}
51+
}
52+
```
53+
54+
## Type-only imports
55+
56+
For type-only dependencies, you can use:
57+
58+
```typescript
59+
// Type-only import (still requires dependency declaration)
60+
import type { SomeType } from 'external-library';
61+
62+
// Or in dependencies as a peer dependency for types
63+
{
64+
"peerDependencies": {
65+
"external-library": "^1.0.0"
66+
}
67+
}
68+
```

tests/type-leaks/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "test-types",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"test": "vitest run"
8+
},
9+
"devDependencies": {
10+
"@typescript-eslint/typescript-estree": "^8.29.0",
11+
"glob": "^11.0.0",
12+
"typescript": "^5.8.3",
13+
"vitest": "^3.2.4"
14+
}
15+
}

0 commit comments

Comments
 (0)