diff --git a/javascript/package-lock.json b/javascript/package-lock.json index 3ffbdab8c..969e0f9c1 100644 --- a/javascript/package-lock.json +++ b/javascript/package-lock.json @@ -14,13 +14,13 @@ "devDependencies": { "@biomejs/biome": "^2.4.13", "@cucumber/biome-config": "github:cucumber/biome-config#v0.1.0", + "@tsconfig/recommended": "^1.0.13", "@types/mocha": "10.0.10", - "@types/node": "22.19.19", + "@types/node": "^22.19.19", "commander": "^14.0.0", - "core-js": "3.49.0", "mocha": "11.7.6", "ts-node": "10.9.2", - "typescript": "5.9.3" + "typescript": "6.0.3" } }, "node_modules/@biomejs/biome": { @@ -292,6 +292,13 @@ "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", "dev": true }, + "node_modules/@tsconfig/recommended": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/recommended/-/recommended-1.0.13.tgz", + "integrity": "sha512-sySRuBfMKyKO/j2ZAhR8kSembhjuPEV4Ra3AHtmWLq51+iGaudr45crPSzNC5b7/Ctrh9dfUpBuTlYrH6rM58Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/mocha": { "version": "10.0.10", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", @@ -558,18 +565,6 @@ "node": ">=20" } }, - "node_modules/core-js": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz", - "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -1318,9 +1313,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/javascript/package.json b/javascript/package.json index 8cf8c6e56..411a93d8f 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -2,19 +2,14 @@ "name": "@cucumber/gherkin", "version": "39.1.0", "description": "Gherkin parser", - "main": "dist/src/index.js", - "types": "dist/src/index.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { - "build:cjs": "tsc --build tsconfig.build-cjs.json", - "build:esm": "tsc --build tsconfig.build-esm.json", - "build:legacy": "tsc --build tsconfig.build.json", - "build": "npm run build:cjs && npm run build:esm && npm run build:legacy", - "clean": "npm run clean-tsc && rm -rf node_modules package-lock.json acceptance && rm -rf node_modules package-lock.json", - "clean-tsc": "rm -rf dist", + "build": "tsc --project tsconfig.build.json", "test": "mocha", "fix": "biome check --fix --error-on-warnings", "lint": "biome check --error-on-warnings", - "prepublishOnly": "tsc --build tsconfig.build.json" + "prepublishOnly": "npm run build" }, "repository": { "type": "git", @@ -33,13 +28,13 @@ "devDependencies": { "@biomejs/biome": "^2.4.13", "@cucumber/biome-config": "github:cucumber/biome-config#v0.1.0", + "@tsconfig/recommended": "^1.0.13", "@types/mocha": "10.0.10", - "@types/node": "22.19.19", + "@types/node": "^22.19.19", "commander": "^14.0.0", - "core-js": "3.49.0", "mocha": "11.7.6", "ts-node": "10.9.2", - "typescript": "5.9.3" + "typescript": "6.0.3" }, "dependencies": { "@cucumber/messages": ">=31.0.0 <33" diff --git a/javascript/test-cli.mjs b/javascript/test-cli.mjs index e56226940..fd9f90e34 100644 --- a/javascript/test-cli.mjs +++ b/javascript/test-cli.mjs @@ -1,7 +1,7 @@ import { readFileSync } from 'node:fs' import { IdGenerator } from '@cucumber/messages' import { Command } from 'commander' -import { generateMessages, makeSourceEnvelope } from './dist/src/index.js' +import { generateMessages, makeSourceEnvelope } from './dist/index.js' const program = new Command() program.option('--no-source', 'Do not output Source messages') diff --git a/javascript/tsconfig.build-cjs.json b/javascript/tsconfig.build-cjs.json deleted file mode 100644 index efbed36c5..000000000 --- a/javascript/tsconfig.build-cjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.build.json", - "compilerOptions": { - "target": "ES5", - "module": "CommonJS" - } -} diff --git a/javascript/tsconfig.build-esm.json b/javascript/tsconfig.build-esm.json deleted file mode 100644 index 424c829ad..000000000 --- a/javascript/tsconfig.build-esm.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.build.json", - "compilerOptions": { - "lib": ["ES2019"], - "target": "ES6", - "module": "ES6" - } -} diff --git a/javascript/tsconfig.build.json b/javascript/tsconfig.build.json index 987d78f94..20eb686d6 100644 --- a/javascript/tsconfig.build.json +++ b/javascript/tsconfig.build.json @@ -1,13 +1,8 @@ { "extends": "./tsconfig.json", + "include": ["src"], "compilerOptions": { - "composite": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "rootDir": ".", - "noEmit": false - }, - "files": ["src/gherkin-languages.json"], - "include": ["src", "test"] + "rootDir": "src", + "outDir": "dist" + } } diff --git a/javascript/tsconfig.esm.json b/javascript/tsconfig.esm.json deleted file mode 100644 index b3812940c..000000000 --- a/javascript/tsconfig.esm.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "ts-node": { - "compilerOptions": { - "module": "esnext", - "lib": ["es6"], - "target": "ESNext", - "moduleResolution": "node", - "allowSyntheticDefaultImports": true - } - } -} diff --git a/javascript/tsconfig.json b/javascript/tsconfig.json index e7439e8d9..65b6cacd0 100644 --- a/javascript/tsconfig.json +++ b/javascript/tsconfig.json @@ -1,20 +1,17 @@ { + "extends": "@tsconfig/recommended/tsconfig.json", + "include": ["src", "test"], "compilerOptions": { - "declaration": true, - "target": "es2018", - "lib": ["es2019", "dom"], - "sourceMap": true, - "allowJs": false, - "jsx": "react", + "lib": ["es2024"], + "target": "es2024", + "module": "NodeNext", + "moduleResolution": "NodeNext", "resolveJsonModule": true, - "module": "commonjs", - "esModuleInterop": true, - "noImplicitAny": true, - "moduleResolution": "node", - "outDir": "dist", - "downlevelIteration": true, - "skipLibCheck": true, - "strictNullChecks": false, - "experimentalDecorators": true + "types": ["node", "mocha"], + "declaration": true, + "inlineSourceMap": true, + "inlineSources": true, + "strict": false, + "noImplicitAny": true } }