Skip to content

Commit 258671f

Browse files
committed
Use 'node20' as target for CDS extractor build
Standardizes the CDS extractor build configs to use a 'node20' as the JS runtime "target". Updates the CDS extractor's package.json file in order to specify required "engines" for `node` and `npm`. Minimizes the `tsconfig.json` config used by the CDS extractor in order to only specify configs required for linting and testing, given that the main build config is now specified in the `esbuild.config.mjs` file.
1 parent 8aafc0a commit 258671f

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

.github/workflows/cds-extractor-dist-bundle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Node.js
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: '18'
27+
node-version: '20'
2828
cache: 'npm'
2929
cache-dependency-path: 'extractors/cds/tools/package-lock.json'
3030

extractors/cds/tools/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.15.0

extractors/cds/tools/esbuild.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { statSync } from 'fs';
22

33
import { build as esbuildFunc } from 'esbuild';
44

5-
const NODE_VERSION_TARGET = 'node18';
5+
const NODE_VERSION_TARGET = 'node20';
66

77
const buildOptions = {
88
banner: {

extractors/cds/tools/package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extractors/cds/tools/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "1.0.0",
44
"description": "CodeQL extractor for DB indexing of .cds.json files produced by the 'cds' compiler.",
55
"main": "dist/cds-extractor.bundle.js",
6+
"engines": {
7+
"node": ">=20.0.0",
8+
"npm": ">=10.0.0"
9+
},
610
"scripts": {
711
"build": "node esbuild.config.mjs",
812
"build:all": "npm run lint:fix && npm run test:coverage && npm run build:validate",
@@ -18,7 +22,6 @@
1822
"test:coverage": "jest --coverage --collectCoverageFrom='src/**/*.ts'"
1923
},
2024
"dependencies": {
21-
"@types/tmp": "^0.2.6",
2225
"child_process": "^1.0.2",
2326
"fs": "^0.0.1-security",
2427
"glob": "^11.0.3",
@@ -34,6 +37,7 @@
3437
"@types/jest": "^30.0.0",
3538
"@types/mock-fs": "^4.13.4",
3639
"@types/node": "^24.0.7",
40+
"@types/tmp": "^0.2.6",
3741
"@typescript-eslint/eslint-plugin": "^8.35.1",
3842
"@typescript-eslint/parser": "^8.35.1",
3943
"esbuild": "^0.19.0",

extractors/cds/tools/tsconfig.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2018",
3+
"target": "ES2020",
44
"module": "commonjs",
5-
"lib": ["ES2018"],
5+
"lib": ["ES2020"],
6+
"strict": true,
67
"allowSyntheticDefaultImports": true,
7-
"declaration": false,
88
"esModuleInterop": true,
99
"forceConsistentCasingInFileNames": true,
10-
"isolatedModules": true,
10+
"moduleResolution": "node",
1111
"noImplicitAny": true,
1212
"noImplicitThis": true,
1313
"noUnusedLocals": true,
1414
"noUnusedParameters": true,
1515
"noImplicitReturns": true,
1616
"noFallthroughCasesInSwitch": true,
17-
"outDir": "./dist",
1817
"resolveJsonModule": true,
19-
"rootDir": ".",
20-
"skipLibCheck": true,
21-
"sourceMap": true,
22-
"strict": true
18+
"skipLibCheck": true
2319
},
2420
"include": [
2521
"*.ts",
26-
"*.js",
27-
"esbuild.config.mjs",
28-
"eslint.config.mjs",
29-
"jest.config.js",
30-
"validate-bundle.js",
3122
"src/**/*.ts",
3223
"test/**/*.ts"
3324
],

0 commit comments

Comments
 (0)