From 60ac419783b36642bb9c64327066baa9ab67767f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 07:03:53 +0000 Subject: [PATCH 1/7] Bump typescript from 5.9.3 to 6.0.2 Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.3...v6.0.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 6.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index f89366f9..27e66bda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "eslint": "^10.2.0", "mkdirp": "^3.0.1", "tape": "^5.9.0", - "typescript": "^5.0.0" + "typescript": "^6.0.3" } }, "node_modules/@eslint-community/eslint-utils": { @@ -2849,9 +2849,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/package.json b/package.json index a5c919c7..f54d45cb 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "^10.2.0", "mkdirp": "^3.0.1", "tape": "^5.9.0", - "typescript": "^5.0.0" + "typescript": "^6.0.3" }, "scripts": { "lint": "eslint *.js test/*.js scripts/*.js", From e6759d2af1d0693b3ff13b8f6a5cc33a100a92df Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 09:08:05 +0200 Subject: [PATCH 2/7] Fix TypeScript 6.0 compatibility issues --- package.json | 4 ++-- tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f54d45cb..bf2de90f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "pretest": "npm run lint", "test": "tape test/*_test.js", "transifex": "node scripts/transifex.js", - "type-check": "tsc --noEmit example.ts", - "validate-types": "tsc --noEmit index.d.ts" + "type-check": "tsc --noEmit", + "validate-types": "tsc --noEmit" } } diff --git a/tsconfig.json b/tsconfig.json index b6344a72..8e732dc2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "strictFunctionTypes": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, "esModuleInterop": true, "skipLibCheck": true, From 5b20756c58554240bc92ef5c033e384f726520c0 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 09:19:43 +0200 Subject: [PATCH 3/7] Fix TypeScript 6.0 compatibility issues --- example.ts | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example.ts b/example.ts index fb702884..5a3e146e 100644 --- a/example.ts +++ b/example.ts @@ -1,6 +1,6 @@ // Example usage of osrm-text-instructions with TypeScript -import osrmTextInstructions = require('./index'); +import osrmTextInstructions from './index.js'; // Initialize the compiler for OSRM v5 const compiler = osrmTextInstructions('v5'); diff --git a/package.json b/package.json index bf2de90f..a0b9f2c2 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "pretest": "npm run lint", "test": "tape test/*_test.js", "transifex": "node scripts/transifex.js", - "type-check": "tsc --noEmit", - "validate-types": "tsc --noEmit" + "type-check": "tsc --noEmit --ignoreConfig example.ts", + "validate-types": "tsc --noEmit --ignoreConfig index.d.ts" } } From 130771b5bc9f4e3d2da39bb243b6dbb301e7fd28 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 09:36:35 +0200 Subject: [PATCH 4/7] Fix npm run lint to pass --- eslint.config.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 10a00f53..3e38f822 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,7 +2,7 @@ const js = require('@eslint/js'); module.exports = [ { - ignores: ['node_modules/**', 'eslint.config.js'], + ignores: ['node_modules/**'] }, { files: ['**/*.js'], @@ -19,8 +19,8 @@ module.exports = [ global: 'readonly', module: 'writable', require: 'readonly', - fetch: 'readonly', - }, + fetch: 'readonly' + } }, rules: { ...js.configs.recommended.rules, @@ -32,12 +32,17 @@ module.exports = [ 'arrow-spacing': 'error', 'block-scoped-var': 'error', 'block-spacing': ['error', 'always'], - 'brace-style': ['error', '1tbs', {allowSingleLine: true}], + 'brace-style': ['error', '1tbs', { + allowSingleLine: true + }], 'callback-return': 'error', camelcase: 'error', 'class-methods-use-this': 'error', 'comma-dangle': 'error', - 'comma-spacing': ['error', {after: true, before: false}], + 'comma-spacing': ['error', { + after: true, + before: false + }], 'comma-style': 'error', complexity: 'off', 'computed-property-spacing': ['error', 'never'], @@ -60,7 +65,10 @@ module.exports = [ 'init-declarations': 'off', 'jsx-quotes': 'error', 'key-spacing': 'error', - 'keyword-spacing': ['error', {after: true, before: true}], + 'keyword-spacing': ['error', { + after: true, + before: true + }], 'linebreak-style': ['error', 'unix'], 'lines-around-comment': 'error', 'max-depth': 'error', From c7d67109f7445985dc43f45efe66cf810c51b8c9 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 09:48:27 +0200 Subject: [PATCH 5/7] Migrate ESLint config to flat config format for v10 --- .gitignore | 2 ++ eslint.config.js | 2 +- package.json | 6 +++--- tsconfig.json | 30 ------------------------------ 4 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 5bf1e51f..c2f34d09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules transifex.auth +dist +example.js diff --git a/eslint.config.js b/eslint.config.js index 3e38f822..4a230f87 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,7 +2,7 @@ const js = require('@eslint/js'); module.exports = [ { - ignores: ['node_modules/**'] + ignores: ['node_modules/**', 'dist/**', 'example.js'] }, { files: ['**/*.js'], diff --git a/package.json b/package.json index a0b9f2c2..2e3d0d6a 100644 --- a/package.json +++ b/package.json @@ -24,11 +24,11 @@ "typescript": "^6.0.3" }, "scripts": { - "lint": "eslint *.js test/*.js scripts/*.js", + "lint": "eslint eslint.config.js index.js languages.js test/*.js scripts/*.js", "pretest": "npm run lint", "test": "tape test/*_test.js", "transifex": "node scripts/transifex.js", - "type-check": "tsc --noEmit --ignoreConfig example.ts", - "validate-types": "tsc --noEmit --ignoreConfig index.d.ts" + "type-check": "tsc --noEmit --project tsconfig.example.json", + "validate-types": "tsc --noEmit --project tsconfig.types.json" } } diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 8e732dc2..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "lib": ["es2017"], - "types": ["node"], - "declaration": true, - "outDir": "./dist", - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true - }, - "include": [ - "*.ts", - "*.d.ts" - ], - "exclude": [ - "node_modules", - "dist", - "test" - ] -} \ No newline at end of file From 1ae4ab0de3d09a28c80d6a3cdbe9c68e1e878944 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 09:50:26 +0200 Subject: [PATCH 6/7] Add missing json files --- tsconfig.base.json | 21 +++++++++++++++++++++ tsconfig.example.json | 6 ++++++ tsconfig.types.json | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 tsconfig.base.json create mode 100644 tsconfig.example.json create mode 100644 tsconfig.types.json diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..78187c16 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "es2017", + "module": "commonjs", + "lib": ["es2017"], + "types": ["node"], + "declaration": true, + "outDir": "./dist", + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/tsconfig.example.json b/tsconfig.example.json new file mode 100644 index 00000000..263913df --- /dev/null +++ b/tsconfig.example.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "example.ts" + ] +} diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 00000000..591a02c3 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.base.json", + "files": [ + "index.d.ts" + ] +} From 0f6602c76010e86d55101ae270e2e35e6819086b Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 17 Apr 2026 10:04:00 +0200 Subject: [PATCH 7/7] Fix CI job --- .github/workflows/ci.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab7e849c..afa6d23f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,6 @@ jobs: rm example.js - name: Verify TypeScript can consume the package run: | - echo "import osrmTextInstructions = require('./index'); const compiler = osrmTextInstructions('v5'); console.log('TypeScript import works!');" > test-import.ts + echo "import osrmTextInstructions from './index'; const compiler = osrmTextInstructions('v5'); console.log('TypeScript import works!');" > test-import.ts npx tsc --noEmit test-import.ts - rm test-import.ts \ No newline at end of file + rm test-import.ts diff --git a/README.md b/README.md index 13a94cca..c9a81364 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ response.legs.forEach(function(leg) { ### TypeScript Usage ```typescript -import osrmTextInstructions = require('osrm-text-instructions'); +import osrmTextInstructions from 'osrm-text-instructions'; const compiler = osrmTextInstructions('v5');