From 763c6d5f194dec762bde4dc03081391c3201655c Mon Sep 17 00:00:00 2001 From: ahnpnl Date: Fri, 28 Mar 2025 08:53:19 +0100 Subject: [PATCH] build: bump `typescript` to latest --- e2e/enum/__tests__/enum.spec.ts | 3 - e2e/enum/src/foo-constant.cjs | 7 - e2e/enum/src/foo-constant.d.ts | 3 - e2e/enum/src/foo-constant.mjs | 5 - e2e/package-lock.json | 186 ++++-------------- .../__tests__/transform-js.spec.ts | 14 +- e2e/transform-js/jest-compiler-cjs.config.ts | 4 +- .../jest-transpiler-cjs.config.ts | 4 +- e2e/transform-js/src/stateful.cjs | 7 - .../src/{stateful.mjs => stateful.js} | 0 examples/js-with-babel/package.json | 2 +- examples/js-with-ts/package.json | 2 +- examples/monorepo-app/package.json | 2 +- examples/package-lock.json | 132 +++++++++++-- examples/react-app/package.json | 2 +- examples/ts-only/package.json | 2 +- jest-e2e.config.cjs => jest-e2e-cjs.config.ts | 13 +- jest-e2e.config.mjs => jest-e2e-esm.config.ts | 5 +- package-lock.json | 15 +- package.json | 6 +- .../typescript/transpile-module.spec.ts | 56 +++--- website/package-lock.json | 15 +- website/package.json | 2 +- 23 files changed, 236 insertions(+), 251 deletions(-) delete mode 100644 e2e/enum/src/foo-constant.cjs delete mode 100644 e2e/enum/src/foo-constant.d.ts delete mode 100644 e2e/enum/src/foo-constant.mjs delete mode 100644 e2e/transform-js/src/stateful.cjs rename e2e/transform-js/src/{stateful.mjs => stateful.js} (100%) rename jest-e2e.config.cjs => jest-e2e-cjs.config.ts (63%) rename jest-e2e.config.mjs => jest-e2e-esm.config.ts (85%) diff --git a/e2e/enum/__tests__/enum.spec.ts b/e2e/enum/__tests__/enum.spec.ts index 0858482c1b..0402750548 100644 --- a/e2e/enum/__tests__/enum.spec.ts +++ b/e2e/enum/__tests__/enum.spec.ts @@ -1,12 +1,9 @@ import { BarEnum } from '../src/bar-constant' -import { FooEnum } from '../src/foo-constant' const getOne = (): string => BarEnum.one -const getTwo = (): string => FooEnum.two describe('enum', () => { it('should pass', () => { expect(getOne()).toBe('ONE') - expect(getTwo()).toBe('TWO') }) }) diff --git a/e2e/enum/src/foo-constant.cjs b/e2e/enum/src/foo-constant.cjs deleted file mode 100644 index 828d271e39..0000000000 --- a/e2e/enum/src/foo-constant.cjs +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable */ -'use strict' -var FooEnum -;(function (FooEnum) { - FooEnum[(FooEnum['two'] = 'TWO')] = 'two' - -})((FooEnum = exports.FooEnum || (exports.FooEnum = {}))) diff --git a/e2e/enum/src/foo-constant.d.ts b/e2e/enum/src/foo-constant.d.ts deleted file mode 100644 index 90bb6c734a..0000000000 --- a/e2e/enum/src/foo-constant.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare enum FooEnum { - two = 'TWO', -} diff --git a/e2e/enum/src/foo-constant.mjs b/e2e/enum/src/foo-constant.mjs deleted file mode 100644 index 6ce5a0ba18..0000000000 --- a/e2e/enum/src/foo-constant.mjs +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable */ -export var FooEnum; -(function (FooEnum) { - FooEnum["two"] = "TWO"; -})(FooEnum || (FooEnum = {})); diff --git a/e2e/package-lock.json b/e2e/package-lock.json index ecf30c82a1..670bc623a3 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -34,13 +34,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -187,9 +188,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, "license": "MIT", "peer": true, @@ -198,9 +199,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, "license": "MIT", "engines": { @@ -219,123 +220,29 @@ } }, "node_modules/@babel/helpers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", - "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", + "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", - "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/types": "^7.25.2" + "@babel/types": "^7.27.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -550,10 +457,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", - "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", + "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", "dev": true, + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -562,16 +470,16 @@ } }, "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" @@ -598,16 +506,15 @@ } }, "node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -2543,9 +2450,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "peer": true, @@ -5266,9 +5173,9 @@ "peer": true }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { @@ -6238,17 +6145,6 @@ "license": "BSD-3-Clause", "peer": true }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", diff --git a/e2e/transform-js/__tests__/transform-js.spec.ts b/e2e/transform-js/__tests__/transform-js.spec.ts index efc48dc1c6..2853269642 100644 --- a/e2e/transform-js/__tests__/transform-js.spec.ts +++ b/e2e/transform-js/__tests__/transform-js.spec.ts @@ -1,13 +1,7 @@ -describe('transform js', () => { - it('should process mjs file', async () => { - const { default: importedStateful } = await import('../src/stateful.mjs') - - expect(importedStateful()).toBe(1) - }) +import inc from '../src/stateful' - it('should process cjs file', async () => { - const { default: importedStateful } = await import('../src/stateful.cjs') - - expect(importedStateful()).toBe(1) +describe('transform js', () => { + it('should process js file', () => { + expect(inc()).toBe(1) }) }) diff --git a/e2e/transform-js/jest-compiler-cjs.config.ts b/e2e/transform-js/jest-compiler-cjs.config.ts index f0bb1a97e0..b8dec27690 100644 --- a/e2e/transform-js/jest-compiler-cjs.config.ts +++ b/e2e/transform-js/jest-compiler-cjs.config.ts @@ -1,9 +1,9 @@ -import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest' +import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest' export default { displayName: 'transform-js-compiler-cjs', transform: { - [ESM_TS_JS_TRANSFORM_PATTERN]: [ + [TS_JS_TRANSFORM_PATTERN]: [ 'ts-jest', { tsconfig: '/tsconfig-cjs.spec.json', diff --git a/e2e/transform-js/jest-transpiler-cjs.config.ts b/e2e/transform-js/jest-transpiler-cjs.config.ts index abfe545d14..47ef8c3919 100644 --- a/e2e/transform-js/jest-transpiler-cjs.config.ts +++ b/e2e/transform-js/jest-transpiler-cjs.config.ts @@ -1,9 +1,9 @@ -import { type JestConfigWithTsJest, ESM_TS_JS_TRANSFORM_PATTERN } from 'ts-jest' +import { type JestConfigWithTsJest, TS_JS_TRANSFORM_PATTERN } from 'ts-jest' export default { displayName: 'transform-js-transpiler-cjs', transform: { - [ESM_TS_JS_TRANSFORM_PATTERN]: [ + [TS_JS_TRANSFORM_PATTERN]: [ 'ts-jest', { tsconfig: '/tsconfig-cjs-transpiler.spec.json', diff --git a/e2e/transform-js/src/stateful.cjs b/e2e/transform-js/src/stateful.cjs deleted file mode 100644 index 0036764c51..0000000000 --- a/e2e/transform-js/src/stateful.cjs +++ /dev/null @@ -1,7 +0,0 @@ -let num = 0 - -module.exports = function inc() { - num++ - - return num -} diff --git a/e2e/transform-js/src/stateful.mjs b/e2e/transform-js/src/stateful.js similarity index 100% rename from e2e/transform-js/src/stateful.mjs rename to e2e/transform-js/src/stateful.js diff --git a/examples/js-with-babel/package.json b/examples/js-with-babel/package.json index ce00149770..55badfd1a5 100644 --- a/examples/js-with-babel/package.json +++ b/examples/js-with-babel/package.json @@ -16,6 +16,6 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" } } diff --git a/examples/js-with-ts/package.json b/examples/js-with-ts/package.json index a3e1803e19..1e64af80f6 100644 --- a/examples/js-with-ts/package.json +++ b/examples/js-with-ts/package.json @@ -15,6 +15,6 @@ "lodash-es": "^4.17.21", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" } } diff --git a/examples/monorepo-app/package.json b/examples/monorepo-app/package.json index 75240db5a4..d68f8a1ff2 100644 --- a/examples/monorepo-app/package.json +++ b/examples/monorepo-app/package.json @@ -18,6 +18,6 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" } } diff --git a/examples/package-lock.json b/examples/package-lock.json index 0fab4b7be7..c4d330ed83 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -29,7 +29,21 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + } + }, + "js-with-babel/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "js-with-ts": { @@ -41,7 +55,21 @@ "jest": "^29.7.0", "lodash-es": "^4.17.21", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + } + }, + "js-with-ts/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "monorepo-app": { @@ -56,7 +84,21 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + } + }, + "monorepo-app/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "node_modules/@adobe/css-tools": { @@ -8739,6 +8781,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9228,7 +9271,7 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "^5.5.4", + "typescript": "~5.8.3", "vite": "^6.2.5" } }, @@ -9245,6 +9288,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "react-app/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "ts-only": { "version": "0.0.0", "devDependencies": { @@ -9252,7 +9309,21 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + } + }, + "ts-only/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "type-module": { @@ -13797,7 +13868,15 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + }, + "dependencies": { + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true + } } }, "js-with-ts": { @@ -13809,7 +13888,15 @@ "jest": "^29.7.0", "lodash-es": "^4.17.21", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + }, + "dependencies": { + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true + } } }, "js-yaml": { @@ -14130,7 +14217,15 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + }, + "dependencies": { + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true + } } }, "ms": { @@ -14648,7 +14743,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "ts-jest": "^29.3.1", - "typescript": "^5.5.4", + "typescript": "~5.8.3", "vite": "^6.2.5" }, "dependencies": { @@ -14657,6 +14752,12 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true + }, + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true } } }, @@ -15258,7 +15359,15 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" + }, + "dependencies": { + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true + } } }, "tslib": { @@ -15345,7 +15454,8 @@ "version": "5.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dev": true + "dev": true, + "peer": true }, "unbox-primitive": { "version": "1.0.2", diff --git a/examples/react-app/package.json b/examples/react-app/package.json index e60e3565a5..76ef30ad1c 100644 --- a/examples/react-app/package.json +++ b/examples/react-app/package.json @@ -29,7 +29,7 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "^5.5.4", + "typescript": "~5.8.3", "vite": "^6.2.5" } } diff --git a/examples/ts-only/package.json b/examples/ts-only/package.json index e8f009afe8..02ad248835 100644 --- a/examples/ts-only/package.json +++ b/examples/ts-only/package.json @@ -13,6 +13,6 @@ "cross-env": "^7.0.3", "jest": "^29.7.0", "ts-jest": "^29.3.1", - "typescript": "~5.5.4" + "typescript": "~5.8.3" } } diff --git a/jest-e2e.config.cjs b/jest-e2e-cjs.config.ts similarity index 63% rename from jest-e2e.config.cjs rename to jest-e2e-cjs.config.ts index 44153cc339..dcc61ea91c 100644 --- a/jest-e2e.config.cjs +++ b/jest-e2e-cjs.config.ts @@ -1,8 +1,10 @@ -const path = require('path') +import path from 'node:path' -const { sync: spawnSync } = require('execa') +import { sync as spawnSync } from 'execa' +import type { Config } from 'jest' -const { createBundle } = require('./scripts/lib/bundle') +// @ts-expect-error no type definition +import { createBundle } from './scripts/lib/bundle' console.log('Install dependencies for all e2e test suites') @@ -17,7 +19,6 @@ spawnSync('npm', ['install', '--no-package-lock', '--no-shrinkwrap', '--no-save' cwd: e2eFolderPath, }) -/** @type {import('jest').Config} */ -module.exports = { +export default { projects: ['e2e/**/jest-transpiler-cjs.config.ts', 'e2e/**/jest-compiler-cjs.config.ts'], -} +} satisfies Config diff --git a/jest-e2e.config.mjs b/jest-e2e-esm.config.ts similarity index 85% rename from jest-e2e.config.mjs rename to jest-e2e-esm.config.ts index 10835afcf1..a9611360e7 100644 --- a/jest-e2e.config.mjs +++ b/jest-e2e-esm.config.ts @@ -1,7 +1,9 @@ import path from 'node:path' import { sync as spawnSync } from 'execa' +import type { Config } from 'jest' +// @ts-expect-error no type definition import { createBundle } from './scripts/lib/bundle.js' console.log('Install dependencies for all e2e test suites') @@ -17,7 +19,6 @@ spawnSync('npm', ['install', '--no-package-lock', '--no-shrinkwrap', '--no-save' cwd: e2eFolderPath, }) -/** @type {import('jest').Config} */ export default { projects: ['e2e/**/jest-transpiler-esm.config.ts', 'e2e/**/jest-compiler-esm.config.ts'], -} +} satisfies Config diff --git a/package-lock.json b/package-lock.json index 907fc98d7c..bbfac3e8d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,7 @@ "memfs": "^4.17.0", "prettier": "^2.8.8", "rimraf": "^5.0.10", - "typescript": "~5.5.4", + "typescript": "~5.8.3", "typescript-eslint": "^8.29.0" }, "engines": { @@ -9311,10 +9311,11 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -16163,9 +16164,9 @@ } }, "typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true }, "typescript-eslint": { diff --git a/package.json b/package.json index 8186b13e75..9560b6cd2f 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "build": "tsc -p tsconfig.build.json", "postbuild": "node scripts/post-build.js", "test": "jest -c=jest.config.ts", - "test-e2e-cjs": "jest -c=jest-e2e.config.cjs --no-cache", - "test-e2e-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-e2e.config.mjs --no-cache", + "test-e2e-cjs": "jest -c=jest-e2e-cjs.config.ts --no-cache", + "test-e2e-esm": "node --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js -c=jest-e2e-esm.config.ts --no-cache", "test-examples": "node scripts/test-examples.js", "lint": "eslint .", "lint-fix": "eslint --fix .", @@ -132,7 +132,7 @@ "memfs": "^4.17.0", "prettier": "^2.8.8", "rimraf": "^5.0.10", - "typescript": "~5.5.4", + "typescript": "~5.8.3", "typescript-eslint": "^8.29.0" }, "engines": { diff --git a/src/transpilers/typescript/transpile-module.spec.ts b/src/transpilers/typescript/transpile-module.spec.ts index 2ef4d9e1a4..5c106a5e42 100644 --- a/src/transpilers/typescript/transpile-module.spec.ts +++ b/src/transpilers/typescript/transpile-module.spec.ts @@ -138,7 +138,7 @@ describe('transpileModules', () => { { module: ts.ModuleKind.CommonJS, expectedResult: dedent` - const foo_1 = require("foo"); + import { foo } from 'foo'; `, }, { @@ -159,17 +159,20 @@ describe('transpileModules', () => { import { foo } from 'foo'; `, }, - ])('should emit code with ".mts" extension respecting module option', ({ module, expectedResult }) => { - const result = tsTranspileModule(vol.readFileSync(mtsFilePath, 'utf-8').toString(), { - fileName: mtsFilePath, - compilerOptions: { - module, - target: ts.ScriptTarget.ESNext, - }, - }) - - expect(omitLeadingWhitespace(result.outputText)).toContain(expectedResult) - }) + ])( + 'should always emit ESM code with ".mts" extension regardless module option value', + ({ module, expectedResult }) => { + const result = tsTranspileModule(vol.readFileSync(mtsFilePath, 'utf-8').toString(), { + fileName: mtsFilePath, + compilerOptions: { + module, + target: ts.ScriptTarget.ESNext, + }, + }) + + expect(omitLeadingWhitespace(result.outputText)).toContain(expectedResult) + }, + ) it.each([ { @@ -187,26 +190,29 @@ describe('transpileModules', () => { { module: ts.ModuleKind.ES2020, expectedResult: dedent` - import { foo } from 'foo'; + const foo_1 = require("foo"); `, }, { module: undefined, expectedResult: dedent` - import { foo } from 'foo'; + const foo_1 = require("foo"); `, }, - ])('should emit code with ".cts" extension respecting module option', ({ module, expectedResult }) => { - const result = tsTranspileModule(vol.readFileSync(ctsFilePath, 'utf-8').toString(), { - fileName: ctsFilePath, - compilerOptions: { - module, - target: ts.ScriptTarget.ESNext, - }, - }) - - expect(omitLeadingWhitespace(result.outputText)).toContain(expectedResult) - }) + ])( + 'should always emit CJS code with ".cts" extension regardless module option value', + ({ module, expectedResult }) => { + const result = tsTranspileModule(vol.readFileSync(ctsFilePath, 'utf-8').toString(), { + fileName: ctsFilePath, + compilerOptions: { + module, + target: ts.ScriptTarget.ESNext, + }, + }) + + expect(omitLeadingWhitespace(result.outputText)).toContain(expectedResult) + }, + ) }) describe('with classic CommonJS module and ES module kind', () => { diff --git a/website/package-lock.json b/website/package-lock.json index f51744b8aa..b772fdb8c2 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -26,7 +26,7 @@ "@docusaurus/tsconfig": "^3.7.0", "@docusaurus/types": "^3.7.0", "@types/react": "^18.3.3", - "typescript": "~5.5.4" + "typescript": "~5.8.3" } }, "node_modules/@akebifiky/remark-simple-plantuml": { @@ -18175,9 +18175,10 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -31310,9 +31311,9 @@ } }, "typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==" + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==" }, "unbox-primitive": { "version": "1.0.2", diff --git a/website/package.json b/website/package.json index 3afda61e8e..b5da0140b1 100644 --- a/website/package.json +++ b/website/package.json @@ -31,7 +31,7 @@ "@docusaurus/tsconfig": "^3.7.0", "@docusaurus/types": "^3.7.0", "@types/react": "^18.3.3", - "typescript": "~5.5.4" + "typescript": "~5.8.3" }, "browserslist": { "production": [