From c1a1ef60da72f1d65eaeecec169235a36be5846f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Jul 2026 14:01:13 +0000 Subject: [PATCH] chore: upgrade to TypeScript 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrades TypeScript 5.9.3 -> ^6.0.3 with a real tsconfig migration, so the project type-checks and builds cleanly under TS 6 with NO `ignoreDeprecations`. Stacked on chore/npm-dependencies-bump (PR #43). TS 6 turns deprecated tsconfig options into hard errors (TS5101 / TS5107). The migration addresses them properly instead of silencing them: - tsconfig.base.json: - Remove `baseUrl` (TS5101). Path mappings resolve without baseUrl since TS 4.1; the `paths` values are made relative (`./packages/...`) so they resolve correctly (TS5090). No baseUrl-relative bare imports existed in the sources. - `moduleResolution`: `node` (node10, deprecated → TS5107) -> `bundler`, the org-preferred setting (matches leancodepl/js_corelibrary). The repo builds via webpack/swc/tsc; bundler resolution works with the existing `module: esnext` base and the per-project `module: commonjs` emit configs. - packages/invoice-template/tsconfig.json: drop `allowSyntheticDefaultImports: false` (deprecated in TS 6). With `esModuleInterop: true` the value is inferred to `true`, which is strictly more permissive, so no new type errors. - package.json: typescript 5.9.3 -> ^6.0.3; package-lock.json regenerated. Verified green on Node 24.18.x with CI's steps: npm ci, nx format:check, lint, build, test (all 4 projects), with no `ignoreDeprecations`. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_012ET2dL5CiUkuFR1ZGiUrUH --- package-lock.json | 22 ++++------------------ package.json | 2 +- packages/invoice-template/tsconfig.json | 1 - tsconfig.base.json | 11 +++++------ 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 85376d8..537ea4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -81,7 +81,7 @@ "jest-junit": "17.0.0", "nx": "23.1.0", "prettier": "^3.9.5", - "typescript": "5.9.3", + "typescript": "^6.0.3", "typescript-eslint": "8.64.0", "verdaccio": "6.7.4", "webpack": "5.108.4", @@ -5494,20 +5494,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@nx/eslint/node_modules/typescript": { - "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": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/@nx/jest": { "version": "23.1.0", "resolved": "https://registry.npmjs.org/@nx/jest/-/jest-23.1.0.tgz", @@ -30561,9 +30547,9 @@ "license": "MIT" }, "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 c75a062..9b0efb1 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "jest-junit": "17.0.0", "nx": "23.1.0", "prettier": "^3.9.5", - "typescript": "5.9.3", + "typescript": "^6.0.3", "typescript-eslint": "8.64.0", "verdaccio": "6.7.4", "webpack": "5.108.4", diff --git a/packages/invoice-template/tsconfig.json b/packages/invoice-template/tsconfig.json index 31dd3aa..60f5356 100644 --- a/packages/invoice-template/tsconfig.json +++ b/packages/invoice-template/tsconfig.json @@ -4,7 +4,6 @@ "jsx": "react-jsx", "allowJs": true, "esModuleInterop": true, - "allowSyntheticDefaultImports": false, "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, diff --git a/tsconfig.base.json b/tsconfig.base.json index da5646c..577a75d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -5,7 +5,7 @@ "rootDir": ".", "sourceMap": true, "declaration": false, - "moduleResolution": "node", + "moduleResolution": "bundler", "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, @@ -14,13 +14,12 @@ "lib": ["es2017", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, - "baseUrl": ".", "jsx": "react-jsx", "paths": { - "@leancodepl/api-proxy": ["packages/api-proxy/src/index.ts"], - "@leancodepl/invoice-template": ["packages/invoice-template/src/index.ts"], - "@leancodepl/pdf-generator-api-and-auth": ["packages/pdf-generator-api-and-auth/src/index.ts"], - "@leancodepl/pdf-renderer": ["packages/pdf-renderer/src/index.ts"] + "@leancodepl/api-proxy": ["./packages/api-proxy/src/index.ts"], + "@leancodepl/invoice-template": ["./packages/invoice-template/src/index.ts"], + "@leancodepl/pdf-generator-api-and-auth": ["./packages/pdf-generator-api-and-auth/src/index.ts"], + "@leancodepl/pdf-renderer": ["./packages/pdf-renderer/src/index.ts"] } }, "exclude": ["node_modules", "tmp"]