From e908561d7ef3d851b84970c10f5038964130a458 Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 15:43:12 +0800 Subject: [PATCH 1/6] refactor(dts)!: remove native-preview support --- package.json | 1 - packages/core/package.json | 2 +- packages/plugin-dts/README.md | 16 +-- packages/plugin-dts/package.json | 6 +- packages/plugin-dts/src/backend.ts | 10 +- packages/plugin-dts/src/dts.ts | 12 +- packages/plugin-dts/src/tsgo.ts | 48 ++------ packages/plugin-dts/tests/backend.test.ts | 23 ++-- pnpm-lock.yaml | 128 ++++------------------ website/docs/en/config/lib/dts.mdx | 24 +--- website/docs/en/guide/advanced/dts.mdx | 24 +--- website/docs/zh/config/lib/dts.mdx | 22 +--- website/docs/zh/guide/advanced/dts.mdx | 22 +--- 13 files changed, 59 insertions(+), 279 deletions(-) diff --git a/package.json b/package.json index 2f515d4ed..725221591 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@rstest/core": "^0.10.6", "@types/fs-extra": "^11.0.4", "@types/node": "^24.13.2", - "@typescript/native-preview": "7.0.0-dev.20260704.1", "cspell-ban-words": "^0.0.4", "fs-extra": "^11.3.6", "heading-case": "^1.1.3", diff --git a/packages/core/package.json b/packages/core/package.json index 6a9939e19..a43eef65b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -66,7 +66,7 @@ }, "peerDependencies": { "@microsoft/api-extractor": "^7", - "typescript": "^5 || ^6 || ^7.0.1-0" + "typescript": "^5 || ^6 || ^7" }, "peerDependenciesMeta": { "@microsoft/api-extractor": { diff --git a/packages/plugin-dts/README.md b/packages/plugin-dts/README.md index 5d32948a2..b3b988da0 100644 --- a/packages/plugin-dts/README.md +++ b/packages/plugin-dts/README.md @@ -301,23 +301,9 @@ Whether to generate declaration files with [TypeScript Go](https://github.com/mi After installing TypeScript 7 or higher, Rslib will automatically enable this option. ```bash -npm add typescript@rc -D +npm add typescript@latest -D ``` -You can also install [@typescript/native-preview](https://www.npmjs.com/package/@typescript/native-preview) and manually enable this option. - -```bash -npm add @typescript/native-preview -D -``` - -```js -pluginDts({ - tsgo: true, -}); -``` - -> The `@typescript/native-preview` usage is deprecated and kept only for compatibility. Prefer installing `typescript@rc` to use tsgo. - To ensure consistency during local development, you need to install the corresponding [VS Code Preview Extension](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview) and add the following setting to VS Code: ```json diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index 6efa0974f..764681fc1 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -50,16 +50,12 @@ "peerDependencies": { "@microsoft/api-extractor": "^7", "@rsbuild/core": "^2.0.0", - "@typescript/native-preview": "^7.0.0-0", - "typescript": "^5 || ^6 || ^7.0.1-0" + "typescript": "^5 || ^6 || ^7" }, "peerDependenciesMeta": { "@microsoft/api-extractor": { "optional": true }, - "@typescript/native-preview": { - "optional": true - }, "typescript": { "optional": true } diff --git a/packages/plugin-dts/src/backend.ts b/packages/plugin-dts/src/backend.ts index 061ea3783..71c85e5ee 100644 --- a/packages/plugin-dts/src/backend.ts +++ b/packages/plugin-dts/src/backend.ts @@ -2,11 +2,7 @@ import fs from 'node:fs'; import type { PluginDtsOptions } from './index'; import { createRequireFromPackageJson } from './utils'; -export type DtsGenerationBackend = - | 'api-old' - | 'tsc-executable' - | 'tsgo-executable' - | 'isolated'; +export type DtsGenerationBackend = 'api-old' | 'ts7-executable' | 'isolated'; type ParsedTypescriptVersion = { major: number; @@ -96,11 +92,11 @@ export function resolveDtsGenerationBackend( ); } - return 'tsc-executable'; + return 'ts7-executable'; } if (options.tsgo === true) { - return 'tsgo-executable'; + throw new Error('`dts.tsgo` requires `typescript` >= 7.0.0.'); } return 'api-old'; diff --git a/packages/plugin-dts/src/dts.ts b/packages/plugin-dts/src/dts.ts index 9c0264ddd..cf40aa34a 100644 --- a/packages/plugin-dts/src/dts.ts +++ b/packages/plugin-dts/src/dts.ts @@ -24,15 +24,9 @@ const isObject = (obj: unknown): obj is Record => export const DEFAULT_EXCLUDED_PACKAGES: string[] = ['@types/react']; -type ExecutableDtsGenerationBackend = Extract< - DtsGenOptions['dtsBackend'], - 'tsc-executable' | 'tsgo-executable' ->; - const isExecutableBackend = ( dtsBackend: DtsGenOptions['dtsBackend'], -): dtsBackend is ExecutableDtsGenerationBackend => - dtsBackend === 'tsc-executable' || dtsBackend === 'tsgo-executable'; +): boolean => dtsBackend === 'ts7-executable'; type CalculateBundledPackagesOptions = { cwd: string; @@ -144,8 +138,7 @@ export type PreparedDtsContext = { export type EmitDtsOptions< Tsconfig extends - | CompilerApiTsconfigResultForApi - | GetTsconfigTsconfigResultForExecutable, + CompilerApiTsconfigResultForApi | GetTsconfigTsconfigResultForExecutable, > = { name: string; cwd: string; @@ -362,7 +355,6 @@ export async function generateDts(data: DtsGenOptions): Promise { mod.emitDtsTsgo( { ...emitOptions, - dtsBackend, tsConfigResult: tsConfigResult as GetTsconfigTsconfigResultForExecutable, }, diff --git a/packages/plugin-dts/src/tsgo.ts b/packages/plugin-dts/src/tsgo.ts index a6bdf2bb1..6339527d9 100644 --- a/packages/plugin-dts/src/tsgo.ts +++ b/packages/plugin-dts/src/tsgo.ts @@ -2,7 +2,6 @@ import { logger } from '@rsbuild/core'; import { spawn } from 'node:child_process'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; -import type { DtsGenerationBackend } from './backend'; import type { EmitDtsOptions } from './dts'; import { color, @@ -15,17 +14,9 @@ import { const logPrefixTsgo = color.dim('[tsgo]'); const TYPESCRIPT_PACKAGE_NAME = 'typescript'; -const NATIVE_PREVIEW_PACKAGE_NAME = '@typescript/native-preview'; - -type ExecutableDtsGenerationBackend = Extract< - DtsGenerationBackend, - 'tsc-executable' | 'tsgo-executable' ->; type EmitDtsExecutableOptions = - EmitDtsOptions & { - dtsBackend: ExecutableDtsGenerationBackend; - }; + EmitDtsOptions; type DtsExecutableCommand = { command: string; @@ -33,27 +24,16 @@ type DtsExecutableCommand = { displayCommand: string; }; -const getDtsExecutablePath = async ( - cwd: string, - packageName: - | typeof TYPESCRIPT_PACKAGE_NAME - | typeof NATIVE_PREVIEW_PACKAGE_NAME, -): Promise => { +const getDtsExecutablePath = async (cwd: string): Promise => { let packageJsonPath: string; try { packageJsonPath = createRequireFromPackageJson(cwd).resolve( - `${packageName}/package.json`, + `${TYPESCRIPT_PACKAGE_NAME}/package.json`, ); } catch { - if (packageName === NATIVE_PREVIEW_PACKAGE_NAME) { - throw new Error( - 'Failed to resolve @typescript/native-preview. Install "typescript@rc" or "@typescript/native-preview" to use TypeScript Go.', - ); - } - throw new Error( - 'Failed to resolve typescript. Install "typescript@rc" to use TypeScript Go.', + 'Failed to resolve the native TypeScript executable. `dts.tsgo` requires `typescript` >= 7.0.0.', ); } @@ -73,21 +53,20 @@ const getDtsExecutablePath = async ( return import(fileUrl).then((mod) => { const getExePath = mod.default; + if (typeof getExePath !== 'function') { + throw new Error( + `Cannot resolve the native TypeScript executable from "${TYPESCRIPT_PACKAGE_NAME}".`, + ); + } return getExePath(); }); }; const resolveDtsExecutableCommand = async ( - dtsBackend: ExecutableDtsGenerationBackend, args: string[], cwd: string, ): Promise => { - const dtsExecutableFile = await getDtsExecutablePath( - cwd, - dtsBackend === 'tsc-executable' - ? TYPESCRIPT_PACKAGE_NAME - : NATIVE_PREVIEW_PACKAGE_NAME, - ); + const dtsExecutableFile = await getDtsExecutablePath(cwd); return { command: dtsExecutableFile, @@ -191,15 +170,10 @@ export async function emitDtsTsgo( paths, redirect, cwd, - dtsBackend, } = options; const args = generateTsgoArgs(configPath, declarationDir, build, isWatch); - const dtsExecutableCommand = await resolveDtsExecutableCommand( - dtsBackend, - args, - cwd, - ); + const dtsExecutableCommand = await resolveDtsExecutableCommand(args, cwd); logger.debug( logPrefixTsgo, diff --git a/packages/plugin-dts/tests/backend.test.ts b/packages/plugin-dts/tests/backend.test.ts index 40f7cf6f6..a64436431 100644 --- a/packages/plugin-dts/tests/backend.test.ts +++ b/packages/plugin-dts/tests/backend.test.ts @@ -8,21 +8,26 @@ import { } from '../src/backend'; describe('resolveDtsGenerationBackend', () => { + const tsgoRequirementMessage = '`dts.tsgo` requires `typescript` >= 7.0.0.'; + test('should use the old compiler api backend for TypeScript 5 and 6', () => { expect(resolveDtsGenerationBackend({}, '5.9.3')).toBe('api-old'); expect(resolveDtsGenerationBackend({}, '6.0.1')).toBe('api-old'); }); - test('should use the TypeScript executable backend for TypeScript 7.0', () => { - expect(resolveDtsGenerationBackend({}, '7.0.1-rc')).toBe('tsc-executable'); + test('should use the TypeScript 7 executable backend for TypeScript 7.0', () => { + expect(resolveDtsGenerationBackend({}, '7.0.1-rc')).toBe('ts7-executable'); expect(resolveDtsGenerationBackend({ tsgo: true }, '7.0.1-rc')).toBe( - 'tsc-executable', + 'ts7-executable', ); }); - test('should use the native-preview executable backend when tsgo is enabled without TypeScript 7.0', () => { - expect(resolveDtsGenerationBackend({ tsgo: true }, '6.0.1')).toBe( - 'tsgo-executable', + test('should reject enabling tsgo without TypeScript 7.0 installed', () => { + expect(() => resolveDtsGenerationBackend({ tsgo: true }, '6.0.1')).toThrow( + tsgoRequirementMessage, + ); + expect(() => resolveDtsGenerationBackend({ tsgo: true })).toThrow( + tsgoRequirementMessage, ); }); @@ -34,8 +39,8 @@ describe('resolveDtsGenerationBackend', () => { ); }); - test('should use the TypeScript executable backend for TypeScript 7.1 or higher', () => { - expect(resolveDtsGenerationBackend({}, '7.1.0')).toBe('tsc-executable'); + test('should use the TypeScript 7 executable backend for TypeScript 7.1 or higher', () => { + expect(resolveDtsGenerationBackend({}, '7.1.0')).toBe('ts7-executable'); }); test('should read the TypeScript version from cwd', async () => { @@ -61,7 +66,7 @@ describe('resolveDtsGenerationBackend', () => { expect(typescriptVersion).toBe('7.0.1-rc'); expect(resolveDtsGenerationBackend({}, typescriptVersion)).toBe( - 'tsc-executable', + 'ts7-executable', ); } finally { await fs.rm(tempDir, { recursive: true, force: true }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fa9d8afa..6e204528f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,9 +24,6 @@ importers: '@types/node': specifier: ^24.13.2 version: 24.13.2 - '@typescript/native-preview': - specifier: 7.0.0-dev.20260704.1 - version: 7.0.0-dev.20260704.1 cspell-ban-words: specifier: ^0.0.4 version: 0.0.4 @@ -146,7 +143,7 @@ importers: version: 3.3.4(@rsbuild/core@2.1.5)(@rslib/core@packages+core)(storybook-builder-rsbuild@3.3.4)(typescript@6.0.3) storybook-react-rsbuild: specifier: ^3.3.4 - version: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@types/react-dom@19.2.3)(@types/react@19.2.17)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(rollup@4.60.4)(storybook@10.4.6)(typescript@6.0.3) + version: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@types/react-dom@19.2.3)(@types/react@19.2.17)(react-dom@19.2.7)(react@19.2.7)(rollup@4.60.4)(storybook@10.4.6)(typescript@6.0.3) typescript: specifier: ^6.0.3 version: 6.0.3 @@ -315,7 +312,7 @@ importers: version: 3.3.4(@rsbuild/core@2.1.5)(@rslib/core@packages+core)(storybook-builder-rsbuild@3.3.4)(typescript@6.0.3) storybook-vue3-rsbuild: specifier: ^3.3.4 - version: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3)(vue@3.5.39) + version: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3)(vue@3.5.39) typescript: specifier: ^6.0.3 version: 6.0.3 @@ -373,7 +370,7 @@ importers: version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' rslog: specifier: ^2.1.3 version: 2.1.3 @@ -410,7 +407,7 @@ importers: version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' tsx: specifier: ^4.23.0 version: 4.23.0 @@ -447,7 +444,7 @@ importers: version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' tinyglobby: specifier: ^0.2.17 version: 0.2.17 @@ -3721,53 +3718,6 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-WHNMx8HTka+2w9ZifYbfkHHyQBzO+MCbOLQzNJE3K7A7mYJ1aq6ZEvBhRcNqixjKAIIO4U34KQvaQ6PXlwezkQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [darwin] - - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-IZJib4da/+3gRVSQFoQU1uFzsiSXnI02xBZljipDoPwahRcOdjH9gJ7DMBFbZ53pUtN5lvqbpES4oXiJZTneDA==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [darwin] - - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-rjyHYAmDQ68NZIpU5i46D50hgQ63UJGGN/LJv3DAPWC8KraNonS5j4fN2bH/V+acQV9l/sS3+US1daV8VkQaFQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [linux] - - '@typescript/native-preview-linux-arm@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-Dkz8oqvg4nEIu2Acz/d+iBDhIIOqjaAJ6mo6a2diRrDI+K5NAHljTzvkclCxgz6WIa5JnUY3kWzy8jE5AtaCQg==} - engines: {node: '>=16.20.0'} - cpu: [arm] - os: [linux] - - '@typescript/native-preview-linux-x64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-y2L2eNwCgrTgXKMol9n/bSPeyNHwJbrUDAv6/J7/087yhPNCt61l3KbpiGAYs0KYcCt3V2lNSDtS3geHQfSWJQ==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [linux] - - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-PzBVRs8UNSAqtoCp9BtT1jsG4SSOfuDT1yo8Z3gGevmNtKEFZjb92BTSnBZaMPPQkM22fq83zgrAEVOEENIicw==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [win32] - - '@typescript/native-preview-win32-x64@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-wb/C+fqWpXAoJZd8KQZdpjOq67v/cmLsApjL9oHjC1X6zqz7AzyOQ486uxWT6LvYzKkar4A+iq8h5h+PNgN38w==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [win32] - - '@typescript/native-preview@7.0.0-dev.20260704.1': - resolution: {integrity: sha512-B8CxdI0CumQVV9/9COcanWCWJmu8Jm1kMuYvse3iGm5ay9QrKTD+qyb11x8SPKUMtiUqnhNxt0n4ESNt+LQMuQ==} - engines: {node: '>=16.20.0'} - hasBin: true - '@typescript/typescript-aix-ppc64@7.0.1-rc': resolution: {integrity: sha512-oqq2ZfEJ7BQuufcC3QBQndZLPNyamYNHLao8lKRBeeSkZKypBqxPSgkzrcFZtbYcIaBvpiyUnQP9MT7DEYHWbw==} engines: {node: '>=16.20.0'} @@ -7831,7 +7781,7 @@ snapshots: '@babel/helper-validator-option': 8.0.0 browserslist: 4.28.4 lru-cache: 11.5.1 - semver: 7.7.4 + semver: 7.8.5 '@babel/helper-create-class-features-plugin@7.29.7(@babel/core@7.29.7)': dependencies: @@ -9199,15 +9149,14 @@ snapshots: optionalDependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@rsbuild/plugin-type-check@1.4.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3)': + '@rsbuild/plugin-type-check@1.4.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@6.0.3)': dependencies: deepmerge: 4.3.1 json5: 2.2.3 reduce-configs: 1.1.2 - ts-checker-rspack-plugin: 1.4.0(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3) + ts-checker-rspack-plugin: 1.4.0(@rspack/core@2.1.3)(typescript@6.0.3) optionalDependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@typescript/native-preview': 7.0.0-dev.20260704.1 transitivePeerDependencies: - '@rspack/core' - typescript @@ -9230,10 +9179,10 @@ snapshots: optionalDependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3)': + '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)': dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3) + rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) typescript: 6.0.3 @@ -9530,7 +9479,7 @@ snapshots: '@rstest/adapter-rslib@0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(typescript@6.0.3)': dependencies: - '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3) + '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3) '@rstest/core': 0.10.6(@module-federation/runtime-tools@2.6.0) optionalDependencies: typescript: 6.0.3 @@ -10131,37 +10080,6 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-linux-arm@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-linux-x64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview-win32-x64@7.0.0-dev.20260704.1': - optional: true - - '@typescript/native-preview@7.0.0-dev.20260704.1': - optionalDependencies: - '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260704.1 - '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260704.1 - '@typescript/native-preview-linux-arm': 7.0.0-dev.20260704.1 - '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260704.1 - '@typescript/native-preview-linux-x64': 7.0.0-dev.20260704.1 - '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260704.1 - '@typescript/native-preview-win32-x64': 7.0.0-dev.20260704.1 - '@typescript/typescript-aix-ppc64@7.0.1-rc': optional: true @@ -13574,13 +13492,12 @@ snapshots: transitivePeerDependencies: - supports-color - rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3): + rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3): dependencies: '@ast-grep/napi': 0.37.0 '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) - '@typescript/native-preview': 7.0.0-dev.20260704.1 typescript: 6.0.3 rsbuild-plugin-google-analytics@1.0.6(@rsbuild/core@2.1.5): @@ -13956,7 +13873,7 @@ snapshots: detect-newline: 4.0.1 git-hooks-list: 4.2.1 is-plain-obj: 4.1.0 - semver: 7.7.4 + semver: 7.8.5 sort-object-keys: 2.1.0 tinyglobby: 0.2.17 @@ -13985,14 +13902,14 @@ snapshots: dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) '@rslib/core': link:packages/core - storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) + storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) optionalDependencies: typescript: 6.0.3 - storybook-builder-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3): + storybook-builder-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3): dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@rsbuild/plugin-type-check': 1.4.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3) + '@rsbuild/plugin-type-check': 1.4.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@6.0.3) '@vitest/mocker': 3.2.4 browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 @@ -14021,7 +13938,7 @@ snapshots: - msw - vite - storybook-react-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@types/react-dom@19.2.3)(@types/react@19.2.17)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(rollup@4.60.4)(storybook@10.4.6)(typescript@6.0.3): + storybook-react-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@types/react-dom@19.2.3)(@types/react@19.2.17)(react-dom@19.2.7)(react@19.2.7)(rollup@4.60.4)(storybook@10.4.6)(typescript@6.0.3): dependencies: '@rollup/pluginutils': 5.3.0(rollup@4.60.4) '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) @@ -14035,7 +13952,7 @@ snapshots: react-dom: 19.2.7(react@19.2.7) resolve: 1.22.12 storybook: 10.4.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/react@19.2.17)(prettier@3.9.4)(react-dom@19.2.7)(react@19.2.7) - storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) + storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) tsconfig-paths: 4.2.0 optionalDependencies: typescript: 6.0.3 @@ -14050,12 +13967,12 @@ snapshots: - vite - webpack - storybook-vue3-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3)(vue@3.5.39): + storybook-vue3-rsbuild@3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3)(vue@3.5.39): dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) '@storybook/vue3': 10.4.6(storybook@10.4.6)(vue@3.5.39) storybook: 10.4.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)(@types/react@19.2.17)(prettier@3.9.4)(react-dom@19.2.7)(react@19.2.7) - storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) + storybook-builder-rsbuild: 3.3.4(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(react-dom@19.2.7)(react@19.2.7)(storybook@10.4.6)(typescript@6.0.3) vue: 3.5.39(typescript@6.0.3) vue-docgen-api: 4.79.2(vue@3.5.39) vue-docgen-loader: 2.0.1(vue-docgen-api@4.79.2) @@ -14085,7 +14002,7 @@ snapshots: oxc-parser: 0.127.0 oxc-resolver: 11.19.1(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) recast: 0.23.11 - semver: 7.7.4 + semver: 7.8.5 use-sync-external-store: 1.6.0(react@19.2.7) ws: 8.21.0 optionalDependencies: @@ -14296,7 +14213,7 @@ snapshots: trough@2.2.0: {} - ts-checker-rspack-plugin@1.4.0(@rspack/core@2.1.3)(@typescript/native-preview@7.0.0-dev.20260704.1)(typescript@6.0.3): + ts-checker-rspack-plugin@1.4.0(@rspack/core@2.1.3)(typescript@6.0.3): dependencies: '@rspack/lite-tapable': 1.1.2 chokidar: 3.6.0 @@ -14305,7 +14222,6 @@ snapshots: typescript: 6.0.3 optionalDependencies: '@rspack/core': 2.1.3(@module-federation/runtime-tools@2.6.0)(@swc/helpers@0.5.23) - '@typescript/native-preview': 7.0.0-dev.20260704.1 ts-dedent@2.3.0: {} diff --git a/website/docs/en/config/lib/dts.mdx b/website/docs/en/config/lib/dts.mdx index 181774fa9..5a04cf5d8 100644 --- a/website/docs/en/config/lib/dts.mdx +++ b/website/docs/en/config/lib/dts.mdx @@ -279,29 +279,7 @@ Whether to generate declaration files with [TypeScript Go](https://github.com/mi After installing TypeScript 7 or higher, Rslib will automatically enable this option. - - -You can also install [@typescript/native-preview](https://www.npmjs.com/package/@typescript/native-preview) and manually enable this option. - - - -```ts title="rslib.config.ts" -export default { - lib: [ - { - dts: { - tsgo: true, // [!code highlight] - }, - }, - ], -}; -``` - -:::note - -The `@typescript/native-preview` usage is deprecated and kept only for compatibility. Prefer installing `typescript@rc` to use tsgo. - -::: + To ensure consistency during local development, you need to install the corresponding [VS Code Preview Extension](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview) and add the following setting to VS Code: diff --git a/website/docs/en/guide/advanced/dts.mdx b/website/docs/en/guide/advanced/dts.mdx index 8811f0b0e..7f1daa1a5 100644 --- a/website/docs/en/guide/advanced/dts.mdx +++ b/website/docs/en/guide/advanced/dts.mdx @@ -89,29 +89,7 @@ Using [TypeScript Go](https://github.com/microsoft/typescript-go) to generate de After installing TypeScript 7 or higher, Rslib will automatically enable [dts.tsgo](/config/lib/dts#dtstsgo). - - -You can also install `@typescript/native-preview` and enable `dts.tsgo` in the Rslib config file. - - - -```ts title="rslib.config.ts" -export default { - lib: [ - { - dts: { - tsgo: true, // [!code highlight] - }, - }, - ], -}; -``` - -:::note - -The `@typescript/native-preview` usage is deprecated and kept only for compatibility. Prefer installing `typescript@rc` to use tsgo. - -::: + To ensure consistency during local development, you need to install the corresponding [VS Code Preview Extension](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview) and add the following setting to VS Code: diff --git a/website/docs/zh/config/lib/dts.mdx b/website/docs/zh/config/lib/dts.mdx index b99fa0098..9861a3167 100644 --- a/website/docs/zh/config/lib/dts.mdx +++ b/website/docs/zh/config/lib/dts.mdx @@ -279,27 +279,7 @@ export default { 安装 TypeScript 7 或更高版本后,Rslib 会自动开启该选项。 - - -你也可以安装 [@typescript/native-preview](https://www.npmjs.com/package/@typescript/native-preview),并手动开启该选项。 - - - -```ts title="rslib.config.ts" -export default { - lib: [ - { - dts: { - tsgo: true, // [!code highlight] - }, - }, - ], -}; -``` - -:::note -`@typescript/native-preview` 的用法已废弃,仅作为兼容方式保留,推荐安装 `typescript@rc` 使用 tsgo。 -::: + 为了保证本地开发的一致性,你需要安装对应的 [VS Code 预览版扩展](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview),并在 VS Code 设置中添加如下配置: diff --git a/website/docs/zh/guide/advanced/dts.mdx b/website/docs/zh/guide/advanced/dts.mdx index 9d85352b1..892d55883 100644 --- a/website/docs/zh/guide/advanced/dts.mdx +++ b/website/docs/zh/guide/advanced/dts.mdx @@ -89,27 +89,7 @@ export default { 安装 TypeScript 7 或更高版本后,Rslib 会自动开启 [dts.tsgo](/config/lib/dts#dtstsgo)。 - - -你也可以安装 `@typescript/native-preview`,并在 Rslib 配置文件中开启 `dts.tsgo`。 - - - -```ts title="rslib.config.ts" -export default { - lib: [ - { - dts: { - tsgo: true, // [!code highlight] - }, - }, - ], -}; -``` - -:::note -`@typescript/native-preview` 的用法已废弃,仅作为兼容方式保留,推荐安装 `typescript@rc` 使用 tsgo。 -::: + 为了保证本地开发的一致性,你需要安装对应的 [VS Code 预览版扩展](https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.native-preview),并在 VS Code 设置中添加如下配置: From a4fe1fa60335499c698e36ccc7468d66a637c5bd Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 17:18:27 +0800 Subject: [PATCH 2/6] refactor(dts)!: remove native-preview support --- package.json | 3 +- packages/core/package.json | 3 +- packages/create-rslib/package.json | 2 +- packages/plugin-dts/package.json | 4 +- packages/plugin-dts/src/tsc.ts | 2 +- packages/plugin-dts/src/tsgo.ts | 41 +- packages/plugin-dts/src/utils.ts | 15 +- packages/plugin-dts/tests/backend.test.ts | 12 +- packages/plugin-dts/tests/utils.test.ts | 2 +- pnpm-lock.yaml | 497 +++++++++++++----- pnpm-workspace.yaml | 2 + .../dts-tsgo/bundle-false/index.test.ts | 27 - .../bundle-false/ts7-basic/rslib.config.ts | 25 - .../{bundle-false/ts7-basic => }/package.json | 4 +- tests/integration/dts/package.json | 9 + .../redirect/dts-tsgo/package.json | 14 + .../rslib.config.mts} | 18 +- tests/integration/redirect/dts/package.json | 2 +- tests/integration/redirect/dtsTsgo.test.ts | 3 +- tests/package.json | 2 +- 20 files changed, 434 insertions(+), 253 deletions(-) delete mode 100644 tests/integration/dts-tsgo/bundle-false/ts7-basic/rslib.config.ts rename tests/integration/dts-tsgo/{bundle-false/ts7-basic => }/package.json (53%) create mode 100644 tests/integration/dts/package.json create mode 100644 tests/integration/redirect/dts-tsgo/package.json rename tests/integration/redirect/{dts/rslib.tsgo.config.mts => dts-tsgo/rslib.config.mts} (76%) diff --git a/package.json b/package.json index 725221591..cbbfb6ca3 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,11 @@ "fs-extra": "^11.3.6", "heading-case": "^1.1.3", "nano-staged": "^1.0.2", + "prebundle": "1.6.5", "prettier": "^3.9.4", "prettier-plugin-packagejson": "^3.0.2", "simple-git-hooks": "^2.13.1", - "typescript": "^6.0.3" + "typescript": "npm:@typescript/typescript6@^6.0.2" }, "packageManager": "pnpm@11.10.0", "engines": { diff --git a/packages/core/package.json b/packages/core/package.json index a43eef65b..d2f124c33 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -56,13 +56,12 @@ "get-tsconfig": "5.0.0-beta.5", "memfs": "^4.57.8", "path-serializer": "0.6.0", - "prebundle": "1.6.5", "rsbuild-plugin-publint": "^1.0.0", "rslib": "npm:@rslib/core@0.23.2", "rslog": "^2.1.3", "semver": "^7.8.5", "tinyglobby": "^0.2.17", - "typescript": "^6.0.3" + "typescript": "^7.0.2" }, "peerDependencies": { "@microsoft/api-extractor": "^7", diff --git a/packages/create-rslib/package.json b/packages/create-rslib/package.json index c6d6e123e..3ac01ec98 100644 --- a/packages/create-rslib/package.json +++ b/packages/create-rslib/package.json @@ -39,7 +39,7 @@ "rsbuild-plugin-publint": "^1.0.0", "rslib": "npm:@rslib/core@0.23.2", "tsx": "^4.23.0", - "typescript": "^6.0.3" + "typescript": "^7.0.2" }, "engines": { "node": "^20.19.0 || >=22.12.0" diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index 764681fc1..21a7b531a 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -40,12 +40,12 @@ "@rslib/tsconfig": "workspace:*", "get-tsconfig": "5.0.0-beta.5", "magic-string": "^0.30.21", - "prebundle": "1.6.5", "rsbuild-plugin-publint": "^1.0.0", "rslib": "npm:@rslib/core@0.23.2", "tinyglobby": "^0.2.17", "tsconfig-paths": "^4.2.0", - "typescript": "^6.0.3" + "typescript": "^7.0.2", + "typescript-api": "npm:@typescript/typescript6@^6.0.2" }, "peerDependencies": { "@microsoft/api-extractor": "^7", diff --git a/packages/plugin-dts/src/tsc.ts b/packages/plugin-dts/src/tsc.ts index 82914cd3d..2453ae2cd 100644 --- a/packages/plugin-dts/src/tsc.ts +++ b/packages/plugin-dts/src/tsc.ts @@ -7,7 +7,7 @@ import type { Program, System, WatchStatusReporter, -} from 'typescript'; +} from 'typescript-api'; import type { EmitDtsOptions } from './dts'; import { color, diff --git a/packages/plugin-dts/src/tsgo.ts b/packages/plugin-dts/src/tsgo.ts index 6339527d9..2c348b9d9 100644 --- a/packages/plugin-dts/src/tsgo.ts +++ b/packages/plugin-dts/src/tsgo.ts @@ -25,41 +25,28 @@ type DtsExecutableCommand = { }; const getDtsExecutablePath = async (cwd: string): Promise => { - let packageJsonPath: string; - try { - packageJsonPath = createRequireFromPackageJson(cwd).resolve( + const packageJsonPath = createRequireFromPackageJson(cwd).resolve( `${TYPESCRIPT_PACKAGE_NAME}/package.json`, ); + + const libPath = path.resolve( + path.dirname(packageJsonPath), + './lib/getExePath.js', + ); + + // handle Windows paths + // On Windows, absolute paths must be valid file:// URLs + const fileUrl = + process.platform === 'win32' ? pathToFileURL(libPath).href : libPath; + + const mod = await import(fileUrl); + return mod.default(); } catch { throw new Error( 'Failed to resolve the native TypeScript executable. `dts.tsgo` requires `typescript` >= 7.0.0.', ); } - - const libPath = path.resolve( - path.dirname(packageJsonPath), - './lib/getExePath.js', - ); - - // handle Windows paths - // On Windows, absolute paths must be valid file:// URLs - let fileUrl: string; - if (process.platform === 'win32') { - fileUrl = pathToFileURL(libPath).href; - } else { - fileUrl = libPath; - } - - return import(fileUrl).then((mod) => { - const getExePath = mod.default; - if (typeof getExePath !== 'function') { - throw new Error( - `Cannot resolve the native TypeScript executable from "${TYPESCRIPT_PACKAGE_NAME}".`, - ); - } - return getExePath(); - }); }; const resolveDtsExecutableCommand = async ( diff --git a/packages/plugin-dts/src/utils.ts b/packages/plugin-dts/src/utils.ts index 2f7f788d8..897aaebb8 100644 --- a/packages/plugin-dts/src/utils.ts +++ b/packages/plugin-dts/src/utils.ts @@ -19,13 +19,13 @@ import path, { import { styleText } from 'node:util'; import { convertPathToPattern, glob } from 'tinyglobby'; import { createMatchPath, loadConfig, type MatchPath } from 'tsconfig-paths'; -import type { CompilerOptions, ParsedCommandLine } from 'typescript'; +import type { CompilerOptions, ParsedCommandLine } from 'typescript-api'; import type { DtsEntry, DtsRedirect } from './index'; const require = createRequire(import.meta.url); let astGrepNapi: typeof import('@ast-grep/napi') | undefined; -const typescriptCache = new Map(); +const typescriptCache = new Map(); export const createRequireFromPackageJson = (cwd: string): NodeJS.Require => createRequire(join(cwd, 'package.json')); @@ -39,7 +39,9 @@ const loadAstGrepNapi = (): typeof import('@ast-grep/napi') => { return astGrepNapi; }; -export const loadTypescript = (cwd?: string): typeof import('typescript') => { +export const loadTypescript = ( + cwd?: string, +): typeof import('typescript-api') => { const currentRequire = cwd ? createRequireFromPackageJson(cwd) : require; const typescriptPath = currentRequire.resolve('typescript'); const cachedTypescript = typescriptCache.get(typescriptPath); @@ -56,7 +58,7 @@ export const loadTypescript = (cwd?: string): typeof import('typescript') => { // eslint-disable-next-line @typescript-eslint/no-var-requires const typescript = currentRequire( 'typescript', - ) as typeof import('typescript'); + ) as typeof import('typescript-api'); typescriptCache.set(typescriptPath, typescript); return typescript; @@ -114,7 +116,7 @@ const resolveTsconfigPath = ( export function loadTsconfig( tsconfigPath: string, - ts: typeof import('typescript') = loadTypescript(), + ts: typeof import('typescript-api') = loadTypescript(), ): CompilerApiTsconfigResultForApi { const configFile = ts.readConfigFile( tsconfigPath, @@ -133,8 +135,7 @@ export function loadTsconfigResultForExecutable( cwd: string, configName: string, ): - | { path: string; config: GetTsconfigTsconfigResultForExecutable } - | undefined { + { path: string; config: GetTsconfigTsconfigResultForExecutable } | undefined { if (isAbsolute(configName) && !fs.existsSync(configName)) { return undefined; } diff --git a/packages/plugin-dts/tests/backend.test.ts b/packages/plugin-dts/tests/backend.test.ts index a64436431..1f71a9550 100644 --- a/packages/plugin-dts/tests/backend.test.ts +++ b/packages/plugin-dts/tests/backend.test.ts @@ -16,8 +16,8 @@ describe('resolveDtsGenerationBackend', () => { }); test('should use the TypeScript 7 executable backend for TypeScript 7.0', () => { - expect(resolveDtsGenerationBackend({}, '7.0.1-rc')).toBe('ts7-executable'); - expect(resolveDtsGenerationBackend({ tsgo: true }, '7.0.1-rc')).toBe( + expect(resolveDtsGenerationBackend({}, '7.0.2')).toBe('ts7-executable'); + expect(resolveDtsGenerationBackend({ tsgo: true }, '7.0.2')).toBe( 'ts7-executable', ); }); @@ -32,9 +32,7 @@ describe('resolveDtsGenerationBackend', () => { }); test('should reject disabling tsgo with TypeScript 7.0', () => { - expect(() => - resolveDtsGenerationBackend({ tsgo: false }, '7.0.1-rc'), - ).toThrow( + expect(() => resolveDtsGenerationBackend({ tsgo: false }, '7.0.2')).toThrow( 'Can not set "dts.tsgo: false" when using TypeScript 7 or higher.', ); }); @@ -59,12 +57,12 @@ describe('resolveDtsGenerationBackend', () => { ); await fs.writeFile( path.join(typescriptPkgDir, 'package.json'), - JSON.stringify({ name: 'typescript', version: '7.0.1-rc' }), + JSON.stringify({ name: 'typescript', version: '7.0.2' }), ); const typescriptVersion = readTypescriptVersion(packageDir); - expect(typescriptVersion).toBe('7.0.1-rc'); + expect(typescriptVersion).toBe('7.0.2'); expect(resolveDtsGenerationBackend({}, typescriptVersion)).toBe( 'ts7-executable', ); diff --git a/packages/plugin-dts/tests/utils.test.ts b/packages/plugin-dts/tests/utils.test.ts index 76b0f20e9..a156acad3 100644 --- a/packages/plugin-dts/tests/utils.test.ts +++ b/packages/plugin-dts/tests/utils.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from '@rstest/core'; import fs from 'node:fs/promises'; import path from 'node:path'; -import type { CompilerOptions } from 'typescript'; +import type { CompilerOptions } from 'typescript-api'; import { cleanTsBuildInfoFile, loadTsconfigResultForExecutable, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e204528f..d0fdfb0d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,7 +14,7 @@ importers: version: 0.6.4(jiti@2.7.0) '@rstest/adapter-rslib': specifier: ^0.10.6 - version: 0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(typescript@6.0.3) + version: 0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(@typescript/typescript6@6.0.2) '@rstest/core': specifier: ^0.10.6 version: 0.10.6(@module-federation/runtime-tools@2.6.0) @@ -36,6 +36,9 @@ importers: nano-staged: specifier: ^1.0.2 version: 1.0.2 + prebundle: + specifier: 1.6.5 + version: 1.6.5(@typescript/typescript6@6.0.2) prettier: specifier: ^3.9.4 version: 3.9.4 @@ -46,8 +49,8 @@ importers: specifier: ^2.13.1 version: 2.13.1 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' examples/express-plugin: devDependencies: @@ -334,7 +337,7 @@ importers: devDependencies: '@module-federation/rsbuild-plugin': specifier: ^2.6.0 - version: 2.6.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6) + version: 2.6.0(@rsbuild/core@2.1.5)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) '@rslib/tsconfig': specifier: workspace:* version: link:../../scripts/tsconfig @@ -362,15 +365,12 @@ importers: path-serializer: specifier: 0.6.0 version: 0.6.0 - prebundle: - specifier: 1.6.5 - version: 1.6.5(typescript@6.0.3) rsbuild-plugin-publint: specifier: ^1.0.0 version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@7.0.2)' rslog: specifier: ^2.1.3 version: 2.1.3 @@ -381,8 +381,8 @@ importers: specifier: ^0.2.17 version: 0.2.17 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.2 + version: 7.0.2 packages/create-rslib: dependencies: @@ -407,13 +407,13 @@ importers: version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@7.0.2)' tsx: specifier: ^4.23.0 version: 4.23.0 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.2 + version: 7.0.2 packages/plugin-dts: dependencies: @@ -436,15 +436,12 @@ importers: magic-string: specifier: ^0.30.21 version: 0.30.21 - prebundle: - specifier: 1.6.5 - version: 1.6.5(typescript@6.0.3) rsbuild-plugin-publint: specifier: ^1.0.0 version: 1.0.0(@rsbuild/core@2.1.5) rslib: specifier: npm:@rslib/core@0.23.2 - version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)' + version: '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@7.0.2)' tinyglobby: specifier: ^0.2.17 version: 0.2.17 @@ -452,8 +449,11 @@ importers: specifier: ^4.2.0 version: 4.2.0 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.2 + version: 7.0.2 + typescript-api: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' scripts/tsconfig: {} @@ -471,7 +471,7 @@ importers: version: 4.0.1 '@module-federation/rsbuild-plugin': specifier: ^2.6.0 - version: 2.6.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6) + version: 2.6.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) '@playwright/test': specifier: 1.61.1 version: 1.61.1 @@ -530,8 +530,8 @@ importers: specifier: ^0.2.17 version: 0.2.17 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.2 + version: 7.0.2 tests/e2e/react-component: dependencies: @@ -561,7 +561,7 @@ importers: version: link:../../../examples/vue-component-bundleless vue: specifier: ^3.5.39 - version: 3.5.39(typescript@6.0.3) + version: 3.5.39(typescript@7.0.2) tests/integration/alias: {} @@ -594,7 +594,7 @@ importers: version: 2.1.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3) '@rsbuild/plugin-svgr': specifier: ^2.0.5 - version: 2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@6.0.3) + version: 2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@7.0.2) tests/integration/async-chunks/default: {} @@ -691,7 +691,7 @@ importers: version: 2.1.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3) '@rsbuild/plugin-svgr': specifier: ^2.0.5 - version: 2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@6.0.3) + version: 2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@7.0.2) tests/integration/cli/build: {} @@ -733,6 +733,18 @@ importers: tests/integration/directive/shebang: {} + tests/integration/dts: + devDependencies: + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + + tests/integration/dts-tsgo: + devDependencies: + typescript: + specifier: ^7.0.2 + version: 7.0.2 + tests/integration/dts-tsgo/build/__references__: {} tests/integration/dts-tsgo/build/abort-on-error: {} @@ -765,12 +777,6 @@ importers: tests/integration/dts-tsgo/bundle-false/dist-path: {} - tests/integration/dts-tsgo/bundle-false/ts7-basic: - devDependencies: - typescript: - specifier: 7.0.1-rc - version: 7.0.1-rc - tests/integration/dts-tsgo/bundle-false/tsconfig-path: {} tests/integration/dts-tsgo/bundle/abort-on-error: {} @@ -1076,8 +1082,23 @@ importers: specifier: ^5.2.1 version: 5.2.1 typescript: - specifier: ^6.0.3 - version: 6.0.3 + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + + tests/integration/redirect/dts-tsgo: + devDependencies: + '@rslib/core': + specifier: workspace:* + version: link:../../../../packages/core + '@types/express': + specifier: ^5.0.6 + version: 5.0.6 + express: + specifier: ^5.2.1 + version: 5.2.1 + typescript: + specifier: ^7.0.2 + version: 7.0.2 tests/integration/redirect/js: devDependencies: @@ -1257,7 +1278,7 @@ importers: version: 2.0.1(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(vue@3.5.39) vue: specifier: ^3.5.39 - version: 3.5.39(typescript@6.0.3) + version: 3.5.39(typescript@7.0.2) tests/integration/worker: {} @@ -3718,126 +3739,130 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@typescript/typescript-aix-ppc64@7.0.1-rc': - resolution: {integrity: sha512-oqq2ZfEJ7BQuufcC3QBQndZLPNyamYNHLao8lKRBeeSkZKypBqxPSgkzrcFZtbYcIaBvpiyUnQP9MT7DEYHWbw==} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} engines: {node: '>=16.20.0'} cpu: [ppc64] os: [aix] - '@typescript/typescript-darwin-arm64@7.0.1-rc': - resolution: {integrity: sha512-Slc0yTftT2F/uGDmtPst8ijydneL6uZaLEyr2UjahxZpbhTjHFBJ5agXtVz/TL4A+ldxzjzj+E8QtLZlh/5mXw==} + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [darwin] - '@typescript/typescript-darwin-x64@7.0.1-rc': - resolution: {integrity: sha512-h68iFW/LbA1/BsGgSRGFw981/3s1f/rY27YrmeZNuN+ly7dI+fiDduwT9ZT9866x2onoKNRq7PTyxSKyKDzfAQ==} + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} engines: {node: '>=16.20.0'} cpu: [x64] os: [darwin] - '@typescript/typescript-freebsd-arm64@7.0.1-rc': - resolution: {integrity: sha512-DE+ppd8Ix2c6OMuRkKY4PJ4hngMGJ9M95OQUP17p9xL/1IKXof7npIeuusMN/bgL5o5JzMfSGh+N+5scTYRg0Q==} + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [freebsd] - '@typescript/typescript-freebsd-x64@7.0.1-rc': - resolution: {integrity: sha512-ST1ozHMw0u+CLOnWkcTyWDMV4Qn9osZ6fd1V1lnKDM1t0hZIp81mdGpdHxyHJjd7jdGrb6Gb/QXcZ1uqZ0t5zw==} + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} engines: {node: '>=16.20.0'} cpu: [x64] os: [freebsd] - '@typescript/typescript-linux-arm64@7.0.1-rc': - resolution: {integrity: sha512-N46pRihK3t5zD5MUtTQcdmQUqr1WI4U2nxno1gLwOtRSsB4krFkRjPHcQNG7h2DtRkX64rQiReX6WKwg2wprMA==} + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [linux] - '@typescript/typescript-linux-arm@7.0.1-rc': - resolution: {integrity: sha512-gHmHwT5Naq5CKM8g9bbaGeEpnwQEvWCLn3fwP4K2m61VQdDKkPk0Dhab/OoZ4LV2SrMddmclYXTzpyg23YGt5g==} + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} engines: {node: '>=16.20.0'} cpu: [arm] os: [linux] - '@typescript/typescript-linux-loong64@7.0.1-rc': - resolution: {integrity: sha512-G17Sao312rgiPBTh2F4nOpLpa3CcnBSaNhqNghZk2LNhnsp1RaMO5HMq2me21gqu9xLpc6CIgHtOzU6JBgNlfg==} + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} engines: {node: '>=16.20.0'} cpu: [loong64] os: [linux] - '@typescript/typescript-linux-mips64el@7.0.1-rc': - resolution: {integrity: sha512-0FQspOb5UsQ4tQKvWgUO3pS9OIWkP7/8dPRWq+CRazJUeQZ4LBjtYK52jg5iIOrvItrVl2CwvRtrU3/9OihwJg==} + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} engines: {node: '>=16.20.0'} cpu: [mips64el] os: [linux] - '@typescript/typescript-linux-ppc64@7.0.1-rc': - resolution: {integrity: sha512-SUmwfVBEv6A2Ld0eWfcvW0FqrgemfQL8jFGOmV1qYxsDqumjE5DekHXqbstgmbE4SHr4rrjHjvmuGCY+kTH/vw==} + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} engines: {node: '>=16.20.0'} cpu: [ppc64] os: [linux] - '@typescript/typescript-linux-riscv64@7.0.1-rc': - resolution: {integrity: sha512-rxeqnNnGiYzv/LlPHi/3+4p0ooR1cNJLjRIHXKovtiVmxXGJq6gtw8VSpbHuWPekyFMXgIAoLCZN0SQ51rAALQ==} + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} engines: {node: '>=16.20.0'} cpu: [riscv64] os: [linux] - '@typescript/typescript-linux-s390x@7.0.1-rc': - resolution: {integrity: sha512-RYWCHCiPypxajdRHM2CNK/eM22e4Ex5TTjV2pXf7PTtBowGr0xX8i8kIMknyZS0LX2QfleYHouaoMVsFDSle3g==} + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} engines: {node: '>=16.20.0'} cpu: [s390x] os: [linux] - '@typescript/typescript-linux-x64@7.0.1-rc': - resolution: {integrity: sha512-PfLJSu0JzroDkqw2m4nqflPEcn8yev0m/vHFQlY9EzHorzjR6QG0wL8AJHvnD1e6h1s76AZngJ5u+z1K/D/HKw==} + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} engines: {node: '>=16.20.0'} cpu: [x64] os: [linux] - '@typescript/typescript-netbsd-arm64@7.0.1-rc': - resolution: {integrity: sha512-FfbPxH3dTfp8yVIaNM7bdWTixXuyxpzoemluqcqMROSIz+ImpCG3Q9HO9Ptzp9/giv+P9YYEnCMSXh61migj2w==} + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [netbsd] - '@typescript/typescript-netbsd-x64@7.0.1-rc': - resolution: {integrity: sha512-FzdTfSzhRYb6hlav6K3cI5RVgcvCTvNAu/vc+t7B6AmZkThQ+t/1ntnvT5fnHmY1Az2RIBw7/b+qtCEG61HJTQ==} + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} engines: {node: '>=16.20.0'} cpu: [x64] os: [netbsd] - '@typescript/typescript-openbsd-arm64@7.0.1-rc': - resolution: {integrity: sha512-PQGhlxfNig+0YQ9Wwzd0USPBkt6w/ZqkBQWsU7G/0JkTzunJel+jSWwhKw4947pak/m7hGSeYiI04xReDLGZww==} + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [openbsd] - '@typescript/typescript-openbsd-x64@7.0.1-rc': - resolution: {integrity: sha512-WJ7NYgO2mHmLUkI/tZ+hl8lFd26QPJqO8ONOHNuYbdsybLvSB6B6sep222JIVrOfPRDGvFinbGGB+l3m1FWRWA==} + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} engines: {node: '>=16.20.0'} cpu: [x64] os: [openbsd] - '@typescript/typescript-sunos-x64@7.0.1-rc': - resolution: {integrity: sha512-UYjDeUxd765V9qcwlUPk4pEXyL0i3G76CJm9baK4i99u1pGO1psf3nXDw4MMmElVOPvGbZag99ZR/O59E2OX6w==} + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} engines: {node: '>=16.20.0'} cpu: [x64] os: [sunos] - '@typescript/typescript-win32-arm64@7.0.1-rc': - resolution: {integrity: sha512-KzXzFSXZOm7zvEt2Aw0MsB2LbTL88znAiVqTDNAOHdlEb7brgmUQh/X2wM/8Be+N0fjEqWKl65cBKNwpWEbJiw==} + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [win32] - '@typescript/typescript-win32-x64@7.0.1-rc': - resolution: {integrity: sha512-98R3+OqDr/r0/PLWEoXu88AE0lGVLNd335Ew8ONgzK1JWkNs4ou/5BGt3Or1ij4iXjH+c7PRL+jFjCbtWze+EA==} + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} engines: {node: '>=16.20.0'} cpu: [x64] os: [win32] + '@typescript/typescript6@6.0.2': + resolution: {integrity: sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==} + hasBin: true + '@typescript/vfs@1.6.4': resolution: {integrity: sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==} peerDependencies: @@ -7358,8 +7383,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@7.0.1-rc: - resolution: {integrity: sha512-drEP77wK7CCDlPfXZH4e008UUQOsw1DFmHmZOZjuNA+yoDLLnSNMZRXi90NbV/1LVo7SbNLq1bs3jjvk49TEqQ==} + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} engines: {node: '>=16.20.0'} hasBin: true @@ -8461,6 +8486,19 @@ snapshots: - utf-8-validate - vue-tsc + '@module-federation/cli@2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/dts-plugin': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + commander: 11.1.0 + jiti: 2.4.2 + transitivePeerDependencies: + - bufferutil + - node-fetch + - typescript + - utf-8-validate + - vue-tsc + '@module-federation/dts-plugin@2.6.0(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6)': dependencies: '@module-federation/error-codes': 2.6.0 @@ -8481,6 +8519,26 @@ snapshots: - node-fetch - utf-8-validate + '@module-federation/dts-plugin@2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/error-codes': 2.6.0 + '@module-federation/managers': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + '@module-federation/third-party-dts-extractor': 2.6.0 + adm-zip: 0.5.10 + ansi-colors: 4.1.3 + isomorphic-ws: 5.0.0(ws@8.21.0) + node-schedule: 2.1.1 + typescript: 7.0.2 + undici: 7.28.0 + ws: 8.21.0 + optionalDependencies: + vue-tsc: 3.3.6(typescript@7.0.2) + transitivePeerDependencies: + - bufferutil + - node-fetch + - utf-8-validate + '@module-federation/enhanced@2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6)': dependencies: '@module-federation/bridge-react-webpack-plugin': 2.6.0(node-fetch@2.7.0) @@ -8506,6 +8564,31 @@ snapshots: - node-fetch - utf-8-validate + '@module-federation/enhanced@2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/bridge-react-webpack-plugin': 2.6.0(node-fetch@2.7.0) + '@module-federation/cli': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/dts-plugin': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/error-codes': 2.6.0 + '@module-federation/inject-external-runtime-core-plugin': 2.6.0(@module-federation/runtime-tools@2.6.0) + '@module-federation/managers': 2.6.0(node-fetch@2.7.0) + '@module-federation/manifest': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/rspack': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/runtime-tools': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + '@module-federation/webpack-bundler-runtime': 2.6.0(node-fetch@2.7.0) + schema-utils: 4.3.0 + tapable: 2.3.0 + upath: 2.0.1 + optionalDependencies: + typescript: 7.0.2 + vue-tsc: 3.3.6(typescript@7.0.2) + transitivePeerDependencies: + - '@rspack/core' + - bufferutil + - node-fetch + - utf-8-validate + '@module-federation/error-codes@2.6.0': {} '@module-federation/inject-external-runtime-core-plugin@2.6.0(@module-federation/runtime-tools@2.6.0)': @@ -8532,6 +8615,19 @@ snapshots: - utf-8-validate - vue-tsc + '@module-federation/manifest@2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/dts-plugin': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/managers': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + find-pkg: 2.0.0 + transitivePeerDependencies: + - bufferutil + - node-fetch + - typescript + - utf-8-validate + - vue-tsc + '@module-federation/node@2.7.45(@rspack/core@2.1.3)(typescript@6.0.3)(vue-tsc@3.3.6)': dependencies: '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6) @@ -8547,6 +8643,36 @@ snapshots: - utf-8-validate - vue-tsc + '@module-federation/node@2.7.45(@rspack/core@2.1.3)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/runtime': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + encoding: 0.1.13 + node-fetch: 2.7.0(encoding@0.1.13) + tapable: 2.3.0 + transitivePeerDependencies: + - '@rspack/core' + - bufferutil + - typescript + - utf-8-validate + - vue-tsc + + '@module-federation/node@2.7.45(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/runtime': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + encoding: 0.1.13 + node-fetch: 2.7.0(encoding@0.1.13) + tapable: 2.3.0 + transitivePeerDependencies: + - '@rspack/core' + - bufferutil + - typescript + - utf-8-validate + - vue-tsc + '@module-federation/rsbuild-plugin@2.6.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6)': dependencies: '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6) @@ -8563,6 +8689,38 @@ snapshots: - vue-tsc - webpack + '@module-federation/rsbuild-plugin@2.6.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/node': 2.7.45(@rspack/core@2.1.3)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + optionalDependencies: + '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) + transitivePeerDependencies: + - '@rspack/core' + - bufferutil + - node-fetch + - typescript + - utf-8-validate + - vue-tsc + - webpack + + '@module-federation/rsbuild-plugin@2.6.0(@rsbuild/core@2.1.5)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/enhanced': 2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/node': 2.7.45(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + optionalDependencies: + '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) + transitivePeerDependencies: + - '@rspack/core' + - bufferutil + - node-fetch + - typescript + - utf-8-validate + - vue-tsc + - webpack + '@module-federation/rspack@2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@6.0.3)(vue-tsc@3.3.6)': dependencies: '@module-federation/bridge-react-webpack-plugin': 2.6.0(node-fetch@2.7.0) @@ -8581,6 +8739,24 @@ snapshots: - node-fetch - utf-8-validate + '@module-federation/rspack@2.6.0(@rspack/core@2.1.3)(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6)': + dependencies: + '@module-federation/bridge-react-webpack-plugin': 2.6.0(node-fetch@2.7.0) + '@module-federation/dts-plugin': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/inject-external-runtime-core-plugin': 2.6.0(@module-federation/runtime-tools@2.6.0) + '@module-federation/managers': 2.6.0(node-fetch@2.7.0) + '@module-federation/manifest': 2.6.0(node-fetch@2.7.0)(typescript@7.0.2)(vue-tsc@3.3.6) + '@module-federation/runtime-tools': 2.6.0(node-fetch@2.7.0) + '@module-federation/sdk': 2.6.0(node-fetch@2.7.0) + '@rspack/core': 2.1.3(@module-federation/runtime-tools@2.6.0)(@swc/helpers@0.5.23) + optionalDependencies: + typescript: 7.0.2 + vue-tsc: 3.3.6(typescript@7.0.2) + transitivePeerDependencies: + - bufferutil + - node-fetch + - utf-8-validate + '@module-federation/runtime-core@2.6.0(node-fetch@2.7.0)': dependencies: '@module-federation/error-codes': 2.6.0 @@ -9119,12 +9295,12 @@ snapshots: - supports-color - webpack - '@rsbuild/plugin-svgr@2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@6.0.3)': + '@rsbuild/plugin-svgr@2.0.5(@rsbuild/core@2.1.5)(@rspack/core@2.1.3)(typescript@7.0.2)': dependencies: '@rsbuild/plugin-react': 2.1.0(@rsbuild/core@2.1.5)(@rspack/core@2.1.3) - '@svgr/core': 8.1.0(typescript@6.0.3) + '@svgr/core': 8.1.0(typescript@7.0.2) '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0) - '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0)(typescript@6.0.3) + '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0)(typescript@7.0.2) deepmerge: 4.3.1 loader-utils: 3.3.1 optionalDependencies: @@ -9179,13 +9355,25 @@ snapshots: optionalDependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)': + '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/typescript6@6.0.2)': dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3) + rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/typescript6@6.0.2) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) - typescript: 6.0.3 + typescript: '@typescript/typescript6@6.0.2' + transitivePeerDependencies: + - '@module-federation/runtime-tools' + - '@typescript/native-preview' + - core-js + + '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@7.0.2)': + dependencies: + '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) + rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@7.0.2) + optionalDependencies: + '@microsoft/api-extractor': 7.58.9(@types/node@25.2.0) + typescript: 7.0.2 transitivePeerDependencies: - '@module-federation/runtime-tools' - '@typescript/native-preview' @@ -9477,12 +9665,12 @@ snapshots: optionalDependencies: '@rspress/core': 2.0.16(@module-federation/runtime-tools@2.6.0)(@rspack/core@2.1.3)(@types/mdast@4.0.4)(@types/react@19.2.17)(micromark-util-types@2.0.2)(micromark@4.0.2) - '@rstest/adapter-rslib@0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(typescript@6.0.3)': + '@rstest/adapter-rslib@0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(@typescript/typescript6@6.0.2)': dependencies: - '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3) + '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/typescript6@6.0.2) '@rstest/core': 0.10.6(@module-federation/runtime-tools@2.6.0) optionalDependencies: - typescript: 6.0.3 + typescript: '@typescript/typescript6@6.0.2' '@rstest/core@0.10.6(@module-federation/runtime-tools@2.6.0)': dependencies: @@ -9783,12 +9971,12 @@ snapshots: '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.29.7) '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.29.7) - '@svgr/core@8.1.0(typescript@6.0.3)': + '@svgr/core@8.1.0(typescript@7.0.2)': dependencies: '@babel/core': 7.29.7 '@svgr/babel-preset': 8.1.0(@babel/core@7.29.7) camelcase: 6.3.0 - cosmiconfig: 8.3.6(typescript@6.0.3) + cosmiconfig: 8.3.6(typescript@7.0.2) snake-case: 3.0.4 transitivePeerDependencies: - supports-color @@ -9803,16 +9991,16 @@ snapshots: dependencies: '@babel/core': 7.29.7 '@svgr/babel-preset': 8.1.0(@babel/core@7.29.7) - '@svgr/core': 8.1.0(typescript@6.0.3) + '@svgr/core': 8.1.0(typescript@7.0.2) '@svgr/hast-util-to-babel-ast': 8.0.0 svg-parser: 2.0.4 transitivePeerDependencies: - supports-color - '@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0)(typescript@6.0.3)': + '@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0)(typescript@7.0.2)': dependencies: - '@svgr/core': 8.1.0(typescript@6.0.3) - cosmiconfig: 8.3.6(typescript@6.0.3) + '@svgr/core': 8.1.0(typescript@7.0.2) + cosmiconfig: 8.3.6(typescript@7.0.2) deepmerge: 4.3.1 svgo: 3.3.3 transitivePeerDependencies: @@ -10080,66 +10268,70 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript/typescript-aix-ppc64@7.0.1-rc': + '@typescript/typescript-aix-ppc64@7.0.2': optional: true - '@typescript/typescript-darwin-arm64@7.0.1-rc': + '@typescript/typescript-darwin-arm64@7.0.2': optional: true - '@typescript/typescript-darwin-x64@7.0.1-rc': + '@typescript/typescript-darwin-x64@7.0.2': optional: true - '@typescript/typescript-freebsd-arm64@7.0.1-rc': + '@typescript/typescript-freebsd-arm64@7.0.2': optional: true - '@typescript/typescript-freebsd-x64@7.0.1-rc': + '@typescript/typescript-freebsd-x64@7.0.2': optional: true - '@typescript/typescript-linux-arm64@7.0.1-rc': + '@typescript/typescript-linux-arm64@7.0.2': optional: true - '@typescript/typescript-linux-arm@7.0.1-rc': + '@typescript/typescript-linux-arm@7.0.2': optional: true - '@typescript/typescript-linux-loong64@7.0.1-rc': + '@typescript/typescript-linux-loong64@7.0.2': optional: true - '@typescript/typescript-linux-mips64el@7.0.1-rc': + '@typescript/typescript-linux-mips64el@7.0.2': optional: true - '@typescript/typescript-linux-ppc64@7.0.1-rc': + '@typescript/typescript-linux-ppc64@7.0.2': optional: true - '@typescript/typescript-linux-riscv64@7.0.1-rc': + '@typescript/typescript-linux-riscv64@7.0.2': optional: true - '@typescript/typescript-linux-s390x@7.0.1-rc': + '@typescript/typescript-linux-s390x@7.0.2': optional: true - '@typescript/typescript-linux-x64@7.0.1-rc': + '@typescript/typescript-linux-x64@7.0.2': optional: true - '@typescript/typescript-netbsd-arm64@7.0.1-rc': + '@typescript/typescript-netbsd-arm64@7.0.2': optional: true - '@typescript/typescript-netbsd-x64@7.0.1-rc': + '@typescript/typescript-netbsd-x64@7.0.2': optional: true - '@typescript/typescript-openbsd-arm64@7.0.1-rc': + '@typescript/typescript-openbsd-arm64@7.0.2': optional: true - '@typescript/typescript-openbsd-x64@7.0.1-rc': + '@typescript/typescript-openbsd-x64@7.0.2': optional: true - '@typescript/typescript-sunos-x64@7.0.1-rc': + '@typescript/typescript-sunos-x64@7.0.2': optional: true - '@typescript/typescript-win32-arm64@7.0.1-rc': + '@typescript/typescript-win32-arm64@7.0.2': optional: true - '@typescript/typescript-win32-x64@7.0.1-rc': + '@typescript/typescript-win32-x64@7.0.2': optional: true + '@typescript/typescript6@6.0.2': + dependencies: + '@typescript/old': typescript@6.0.3 + '@typescript/vfs@1.6.4(typescript@6.0.3)': dependencies: debug: 4.4.3 @@ -10756,14 +10948,14 @@ snapshots: corser@2.0.1: {} - cosmiconfig@8.3.6(typescript@6.0.3): + cosmiconfig@8.3.6(typescript@7.0.2): dependencies: import-fresh: 3.3.1 js-yaml: 4.1.1 parse-json: 5.2.0 path-type: 4.0.0 optionalDependencies: - typescript: 6.0.3 + typescript: 7.0.2 create-ecdh@4.0.4: dependencies: @@ -12933,13 +13125,13 @@ snapshots: preact@10.29.4: {} - prebundle@1.6.5(typescript@6.0.3): + prebundle@1.6.5(@typescript/typescript6@6.0.2): dependencies: '@vercel/ncc': 0.38.4 cac: 7.0.0 prettier: 3.9.4 rollup: 4.60.4 - rollup-plugin-dts: 6.4.1(rollup@4.60.4)(typescript@6.0.3) + rollup-plugin-dts: 6.4.1(@typescript/typescript6@6.0.2)(rollup@4.60.4) terser: 5.48.0 transitivePeerDependencies: - typescript @@ -13440,14 +13632,14 @@ snapshots: hash-base: 3.1.0 inherits: 2.0.4 - rollup-plugin-dts@6.4.1(rollup@4.60.4)(typescript@6.0.3): + rollup-plugin-dts@6.4.1(@typescript/typescript6@6.0.2)(rollup@4.60.4): dependencies: '@jridgewell/remapping': 2.3.5 '@jridgewell/sourcemap-codec': 1.5.5 convert-source-map: 2.0.0 magic-string: 0.30.21 rollup: 4.60.4 - typescript: 6.0.3 + typescript: '@typescript/typescript6@6.0.2' optionalDependencies: '@babel/code-frame': 7.29.7 @@ -13492,13 +13684,21 @@ snapshots: transitivePeerDependencies: - supports-color - rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3): + rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/typescript6@6.0.2): dependencies: '@ast-grep/napi': 0.37.0 '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) - typescript: 6.0.3 + typescript: '@typescript/typescript6@6.0.2' + + rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@7.0.2): + dependencies: + '@ast-grep/napi': 0.37.0 + '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) + optionalDependencies: + '@microsoft/api-extractor': 7.58.9(@types/node@25.2.0) + typescript: 7.0.2 rsbuild-plugin-google-analytics@1.0.6(@rsbuild/core@2.1.5): optionalDependencies: @@ -14278,28 +14478,28 @@ snapshots: typescript@6.0.3: {} - typescript@7.0.1-rc: + typescript@7.0.2: optionalDependencies: - '@typescript/typescript-aix-ppc64': 7.0.1-rc - '@typescript/typescript-darwin-arm64': 7.0.1-rc - '@typescript/typescript-darwin-x64': 7.0.1-rc - '@typescript/typescript-freebsd-arm64': 7.0.1-rc - '@typescript/typescript-freebsd-x64': 7.0.1-rc - '@typescript/typescript-linux-arm': 7.0.1-rc - '@typescript/typescript-linux-arm64': 7.0.1-rc - '@typescript/typescript-linux-loong64': 7.0.1-rc - '@typescript/typescript-linux-mips64el': 7.0.1-rc - '@typescript/typescript-linux-ppc64': 7.0.1-rc - '@typescript/typescript-linux-riscv64': 7.0.1-rc - '@typescript/typescript-linux-s390x': 7.0.1-rc - '@typescript/typescript-linux-x64': 7.0.1-rc - '@typescript/typescript-netbsd-arm64': 7.0.1-rc - '@typescript/typescript-netbsd-x64': 7.0.1-rc - '@typescript/typescript-openbsd-arm64': 7.0.1-rc - '@typescript/typescript-openbsd-x64': 7.0.1-rc - '@typescript/typescript-sunos-x64': 7.0.1-rc - '@typescript/typescript-win32-arm64': 7.0.1-rc - '@typescript/typescript-win32-x64': 7.0.1-rc + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 undici-types@7.16.0: {} @@ -14499,6 +14699,13 @@ snapshots: '@vue/language-core': 3.3.6 typescript: 6.0.3 + vue-tsc@3.3.6(typescript@7.0.2): + dependencies: + '@volar/typescript': 2.4.28 + '@vue/language-core': 3.3.6 + typescript: 7.0.2 + optional: true + vue@3.5.39(typescript@6.0.3): dependencies: '@vue/compiler-dom': 3.5.39 @@ -14509,6 +14716,16 @@ snapshots: optionalDependencies: typescript: 6.0.3 + vue@3.5.39(typescript@7.0.2): + dependencies: + '@vue/compiler-dom': 3.5.39 + '@vue/compiler-sfc': 3.5.39 + '@vue/runtime-dom': 3.5.39 + '@vue/server-renderer': 3.5.39(vue@3.5.39) + '@vue/shared': 3.5.39 + optionalDependencies: + typescript: 7.0.2 + web-namespaces@2.0.1: {} webidl-conversions@3.0.1: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e66f5a48a..101a917b5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -31,6 +31,8 @@ minimumReleaseAgeExclude: - '@rstack-dev/doc-ui' - 'rsbuild-plugin-*' - '@swc/*' + - typescript + - '@typescript/*' - heading-case # Prevent un-reviewed build scripts diff --git a/tests/integration/dts-tsgo/bundle-false/index.test.ts b/tests/integration/dts-tsgo/bundle-false/index.test.ts index 2a3e100a7..55b74cb6f 100644 --- a/tests/integration/dts-tsgo/bundle-false/index.test.ts +++ b/tests/integration/dts-tsgo/bundle-false/index.test.ts @@ -39,33 +39,6 @@ describe('dts with tsgo when bundle: false', () => { expect(contents.esm).toMatchSnapshot(); }); - test('ts7 basic', async () => { - const fixturePath = join(__dirname, 'ts7-basic'); - - const { files } = await buildAndGetResults({ - fixturePath, - type: 'dts', - }); - - expect(files.esm).toMatchInlineSnapshot(` - [ - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/esm/index.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/esm/sum.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/esm/utils/numbers.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/esm/utils/strings.d.ts", - ] - `); - - expect(files.cjs).toMatchInlineSnapshot(` - [ - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/cjs/index.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/cjs/sum.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/cjs/utils/numbers.d.ts", - "/tests/integration/dts-tsgo/bundle-false/ts7-basic/dist/cjs/utils/strings.d.ts", - ] - `); - }); - test('distPath', async () => { const fixturePath = join(__dirname, 'dist-path'); const { files } = await buildAndGetResults({ fixturePath, type: 'dts' }); diff --git a/tests/integration/dts-tsgo/bundle-false/ts7-basic/rslib.config.ts b/tests/integration/dts-tsgo/bundle-false/ts7-basic/rslib.config.ts deleted file mode 100644 index 37137f947..000000000 --- a/tests/integration/dts-tsgo/bundle-false/ts7-basic/rslib.config.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { defineConfig } from '@rslib/core'; -import { generateBundleCjsConfig, generateBundleEsmConfig } from 'test-helper'; - -export default defineConfig({ - lib: [ - generateBundleEsmConfig({ - bundle: false, - dts: { - bundle: false, - }, - }), - generateBundleCjsConfig({ - bundle: false, - dts: { - bundle: false, - }, - }), - ], - source: { - entry: { - index: ['../__fixtures__/src/**'], - }, - tsconfigPath: '../__fixtures__/tsconfig.json', - }, -}); diff --git a/tests/integration/dts-tsgo/bundle-false/ts7-basic/package.json b/tests/integration/dts-tsgo/package.json similarity index 53% rename from tests/integration/dts-tsgo/bundle-false/ts7-basic/package.json rename to tests/integration/dts-tsgo/package.json index a2c60177f..44bd9c775 100644 --- a/tests/integration/dts-tsgo/bundle-false/ts7-basic/package.json +++ b/tests/integration/dts-tsgo/package.json @@ -1,9 +1,9 @@ { - "name": "dts-tsgo-bundle-false-ts7-basic-test", + "name": "dts-tsgo-integration-test", "version": "1.0.0", "private": true, "type": "module", "devDependencies": { - "typescript": "7.0.1-rc" + "typescript": "^7.0.2" } } diff --git a/tests/integration/dts/package.json b/tests/integration/dts/package.json new file mode 100644 index 000000000..4294f215c --- /dev/null +++ b/tests/integration/dts/package.json @@ -0,0 +1,9 @@ +{ + "name": "dts-integration-test", + "version": "1.0.0", + "private": true, + "type": "module", + "devDependencies": { + "typescript": "npm:@typescript/typescript6@^6.0.2" + } +} diff --git a/tests/integration/redirect/dts-tsgo/package.json b/tests/integration/redirect/dts-tsgo/package.json new file mode 100644 index 000000000..2deb6ca3a --- /dev/null +++ b/tests/integration/redirect/dts-tsgo/package.json @@ -0,0 +1,14 @@ +{ + "name": "redirect-dts-tsgo-test", + "version": "1.0.0", + "private": true, + "devDependencies": { + "@rslib/core": "workspace:*", + "@types/express": "^5.0.6", + "express": "^5.2.1", + "typescript": "^7.0.2" + }, + "peerDependencies": { + "express": "^4" + } +} diff --git a/tests/integration/redirect/dts/rslib.tsgo.config.mts b/tests/integration/redirect/dts-tsgo/rslib.config.mts similarity index 76% rename from tests/integration/redirect/dts/rslib.tsgo.config.mts rename to tests/integration/redirect/dts-tsgo/rslib.config.mts index 0eefa469c..bd5587f09 100644 --- a/tests/integration/redirect/dts/rslib.tsgo.config.mts +++ b/tests/integration/redirect/dts-tsgo/rslib.config.mts @@ -9,7 +9,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/default/esm', + distPath: '../dts/dist-tsgo/default/esm', }, }), // 1 - path: false extension: false @@ -18,7 +18,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/path-false/esm', + distPath: '../dts/dist-tsgo/path-false/esm', }, redirect: { dts: { @@ -32,7 +32,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/extension-true/esm', + distPath: '../dts/dist-tsgo/extension-true/esm', }, redirect: { dts: { @@ -46,7 +46,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/path-false-extension-true/esm', + distPath: '../dts/dist-tsgo/path-false-extension-true/esm', }, redirect: { dts: { @@ -62,7 +62,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/auto-extension-true/esm', + distPath: '../dts/dist-tsgo/auto-extension-true/esm', }, redirect: { dts: { @@ -77,7 +77,7 @@ export default defineConfig({ tsgo: true, }, output: { - distPath: './dist-tsgo/auto-extension-true/cjs', + distPath: '../dts/dist-tsgo/auto-extension-true/cjs', }, redirect: { dts: { @@ -86,4 +86,10 @@ export default defineConfig({ }, }), ], + source: { + entry: { + index: '../dts/src/index.ts', + }, + tsconfigPath: '../dts/tsconfig.json', + }, }); diff --git a/tests/integration/redirect/dts/package.json b/tests/integration/redirect/dts/package.json index e8211dee1..cb40834b4 100644 --- a/tests/integration/redirect/dts/package.json +++ b/tests/integration/redirect/dts/package.json @@ -6,7 +6,7 @@ "@rslib/core": "workspace:*", "@types/express": "^5.0.6", "express": "^5.2.1", - "typescript": "^6.0.3" + "typescript": "npm:@typescript/typescript6@^6.0.2" }, "peerDependencies": { "express": "^4" diff --git a/tests/integration/redirect/dtsTsgo.test.ts b/tests/integration/redirect/dtsTsgo.test.ts index bcd4b464d..3d4448415 100644 --- a/tests/integration/redirect/dtsTsgo.test.ts +++ b/tests/integration/redirect/dtsTsgo.test.ts @@ -6,11 +6,10 @@ describe('dts redirect with tsgo', () => { let contents: Awaited>['contents']; beforeAll(async () => { - const fixturePath = path.resolve(__dirname, './dts'); + const fixturePath = path.resolve(__dirname, './dts-tsgo'); contents = ( await buildAndGetResults({ fixturePath, - configPath: './rslib.tsgo.config.mts', type: 'dts', }) ).contents; diff --git a/tests/package.json b/tests/package.json index 02a301823..ece740682 100644 --- a/tests/package.json +++ b/tests/package.json @@ -33,6 +33,6 @@ "path-serializer": "0.6.0", "test-helper": "workspace:*", "tinyglobby": "^0.2.17", - "typescript": "^6.0.3" + "typescript": "^7.0.2" } } From b2483a05ea32bfce28afd2b90a2f2cb2ec464f69 Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 17:51:37 +0800 Subject: [PATCH 3/6] docs: refine dts tsgo wording --- packages/plugin-dts/README.md | 6 +++--- website/docs/en/config/lib/dts.mdx | 6 +++--- website/docs/en/guide/advanced/dts.mdx | 4 ++-- website/docs/zh/config/lib/dts.mdx | 6 +++--- website/docs/zh/guide/advanced/dts.mdx | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/plugin-dts/README.md b/packages/plugin-dts/README.md index b3b988da0..e0e8ee2da 100644 --- a/packages/plugin-dts/README.md +++ b/packages/plugin-dts/README.md @@ -294,11 +294,11 @@ import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts' ### tsgo - **Type:** `boolean` -- **Default:** `true` when the installed `typescript` package is version 7 or higher, otherwise `false` +- **Default:** `true` when TypeScript 7+ is detected, otherwise `false` -Whether to generate declaration files with [TypeScript Go](https://github.com/microsoft/typescript-go). +Whether to generate declaration files using [native TypeScript](https://github.com/microsoft/typescript-go). -After installing TypeScript 7 or higher, Rslib will automatically enable this option. +When unset, Rslib enables this option automatically when TypeScript 7+ is detected. ```bash npm add typescript@latest -D diff --git a/website/docs/en/config/lib/dts.mdx b/website/docs/en/config/lib/dts.mdx index 5a04cf5d8..a6181f52c 100644 --- a/website/docs/en/config/lib/dts.mdx +++ b/website/docs/en/config/lib/dts.mdx @@ -273,11 +273,11 @@ At this time, when [redirect.dts.path](/config/lib/redirect#redirectdtspath) is ### dts.tsgo - **Type:** `boolean` -- **Default:** `true` when the installed `typescript` package is version 7 or higher, otherwise `false` +- **Default:** `true` when TypeScript 7+ is detected, otherwise `false` -Whether to generate declaration files with [TypeScript Go](https://github.com/microsoft/typescript-go). +Whether to generate declaration files using [native TypeScript](https://github.com/microsoft/typescript-go). -After installing TypeScript 7 or higher, Rslib will automatically enable this option. +When unset, Rslib enables this option automatically when TypeScript 7+ is detected. diff --git a/website/docs/en/guide/advanced/dts.mdx b/website/docs/en/guide/advanced/dts.mdx index 7f1daa1a5..d424cc376 100644 --- a/website/docs/en/guide/advanced/dts.mdx +++ b/website/docs/en/guide/advanced/dts.mdx @@ -85,9 +85,9 @@ export default { #### tsgo -Using [TypeScript Go](https://github.com/microsoft/typescript-go) to generate declaration files can preserve type checking while significantly improving the speed of declaration generation. +Using [native TypeScript](https://github.com/microsoft/typescript-go) to generate declaration files keeps type checking enabled while significantly speeding up declaration generation. -After installing TypeScript 7 or higher, Rslib will automatically enable [dts.tsgo](/config/lib/dts#dtstsgo). +When [dts.tsgo](/config/lib/dts#dtstsgo) is unset, Rslib enables it automatically when TypeScript 7+ is detected. diff --git a/website/docs/zh/config/lib/dts.mdx b/website/docs/zh/config/lib/dts.mdx index 9861a3167..70377db20 100644 --- a/website/docs/zh/config/lib/dts.mdx +++ b/website/docs/zh/config/lib/dts.mdx @@ -273,11 +273,11 @@ export default { ### dts.tsgo - **类型:** `boolean` -- **默认值:** 当安装的 `typescript` 包版本为 7 或更高时为 `true`,否则为 `false` +- **默认值:** 检测到 TypeScript 7+ 时为 `true`,否则为 `false` -是否使用 [TypeScript Go](https://github.com/microsoft/typescript-go) 生成类型声明文件。 +是否通过 [native TypeScript](https://github.com/microsoft/typescript-go) 生成类型声明文件。 -安装 TypeScript 7 或更高版本后,Rslib 会自动开启该选项。 +如果没有显式设置该选项,Rslib 会在检测到 TypeScript 7+ 时自动开启。 diff --git a/website/docs/zh/guide/advanced/dts.mdx b/website/docs/zh/guide/advanced/dts.mdx index 892d55883..71cfa82ad 100644 --- a/website/docs/zh/guide/advanced/dts.mdx +++ b/website/docs/zh/guide/advanced/dts.mdx @@ -85,9 +85,9 @@ export default { #### tsgo -使用 [TypeScript Go](https://github.com/microsoft/typescript-go) 生成类型声明文件,可以在保留类型检查的同时,显著加快类型生成的速度。 +使用 [native TypeScript](https://github.com/microsoft/typescript-go) 生成类型声明文件,可以在保留类型检查的同时显著提升生成速度。 -安装 TypeScript 7 或更高版本后,Rslib 会自动开启 [dts.tsgo](/config/lib/dts#dtstsgo)。 +如果没有显式设置 [dts.tsgo](/config/lib/dts#dtstsgo),Rslib 会在检测到 TypeScript 7+ 时自动开启该选项。 From 70e0bf5826c72367c7c9f2f63abab0ac8f456f85 Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 18:51:13 +0800 Subject: [PATCH 4/6] refactor(dts): separate public and internal types --- packages/plugin-dts/src/apiExtractor.ts | 2 +- packages/plugin-dts/src/backend.ts | 5 +- packages/plugin-dts/src/dts.ts | 10 ++- packages/plugin-dts/src/index.ts | 81 +++-------------------- packages/plugin-dts/src/isolated.ts | 2 +- packages/plugin-dts/src/tsc.ts | 2 +- packages/plugin-dts/src/tsgo.ts | 2 +- packages/plugin-dts/src/types/internal.ts | 38 +++++++++++ packages/plugin-dts/src/types/options.ts | 30 +++++++++ packages/plugin-dts/src/utils.ts | 15 ++--- 10 files changed, 97 insertions(+), 90 deletions(-) create mode 100644 packages/plugin-dts/src/types/internal.ts create mode 100644 packages/plugin-dts/src/types/options.ts diff --git a/packages/plugin-dts/src/apiExtractor.ts b/packages/plugin-dts/src/apiExtractor.ts index d7b440b3a..c96c84613 100644 --- a/packages/plugin-dts/src/apiExtractor.ts +++ b/packages/plugin-dts/src/apiExtractor.ts @@ -2,7 +2,7 @@ import fs from 'node:fs'; import { join, relative } from 'node:path'; import type * as ApiExtractor from '@microsoft/api-extractor'; import { logger } from '@rsbuild/core'; -import type { DtsEntry } from './index'; +import type { DtsEntry } from './types/internal'; import { addBannerAndFooter, color, getTimeCost } from './utils'; const logPrefixApiExtractor = color.dim('[api-extractor]'); diff --git a/packages/plugin-dts/src/backend.ts b/packages/plugin-dts/src/backend.ts index 71c85e5ee..a795d09c3 100644 --- a/packages/plugin-dts/src/backend.ts +++ b/packages/plugin-dts/src/backend.ts @@ -1,9 +1,8 @@ import fs from 'node:fs'; -import type { PluginDtsOptions } from './index'; +import type { DtsGenerationBackend } from './types/internal'; +import type { PluginDtsOptions } from './types/options'; import { createRequireFromPackageJson } from './utils'; -export type DtsGenerationBackend = 'api-old' | 'ts7-executable' | 'isolated'; - type ParsedTypescriptVersion = { major: number; minor: number; diff --git a/packages/plugin-dts/src/dts.ts b/packages/plugin-dts/src/dts.ts index cf40aa34a..4ebbcc6f6 100644 --- a/packages/plugin-dts/src/dts.ts +++ b/packages/plugin-dts/src/dts.ts @@ -9,14 +9,18 @@ import { relative, resolve, } from 'node:path'; -import type { DtsEntry, DtsGenOptions, DtsRedirect } from './index'; +import type { DtsRedirect } from './types/options'; +import type { + CompilerApiTsconfigResultForApi, + DtsEntry, + DtsGenOptions, + GetTsconfigTsconfigResultForExecutable, +} from './types/internal'; import { calcLongestCommonPath, color, ensureTempDeclarationDir, mergeAliasWithTsConfigPaths, - type CompilerApiTsconfigResultForApi, - type GetTsconfigTsconfigResultForExecutable, } from './utils'; const isObject = (obj: unknown): obj is Record => diff --git a/packages/plugin-dts/src/index.ts b/packages/plugin-dts/src/index.ts index b5f313b1b..2e02fee9f 100644 --- a/packages/plugin-dts/src/index.ts +++ b/packages/plugin-dts/src/index.ts @@ -1,30 +1,21 @@ -import { - logger, - type LogLevel, - type RsbuildConfig, - type RsbuildPlugin, -} from '@rsbuild/core'; +import { logger, type LogLevel, type RsbuildPlugin } from '@rsbuild/core'; import { type ChildProcess, fork } from 'node:child_process'; import { extname, join } from 'node:path'; -import { - type DtsGenerationBackend, - readTypescriptVersion, - resolveDtsGenerationBackend, -} from './backend'; +import { readTypescriptVersion, resolveDtsGenerationBackend } from './backend'; import { createIsolatedDtsContext, type IsolatedDtsContext, processIsolatedDts, } from './isolated'; +import type { DtsGenOptions, DtsTsconfigResult } from './types/internal'; +import type { PluginDtsOptions } from './types/options'; import { cleanDtsFiles, cleanTsBuildInfoFile, clearTempDeclarationDir, color, - type CompilerApiTsconfigResultForApi, getDtsEmitPath, - type GetTsconfigTsconfigResultForExecutable, loadTsconfig, loadTsconfigResultForExecutable, loadTypescript, @@ -32,62 +23,11 @@ import { warnIfOutside, } from './utils'; -export type DtsRedirect = { - path?: boolean; - extension?: boolean; -}; - -export type ApiExtractorOptions = { - bundledPackages?: string[]; -}; - -export type PluginDtsOptions = { - bundle?: boolean | ApiExtractorOptions; - distPath?: string; - build?: boolean; - abortOnError?: boolean; - dtsExtension?: string; - alias?: Record; - isolated?: boolean; - autoExternal?: - | boolean - | { - dependencies?: boolean; - optionalDependencies?: boolean; - peerDependencies?: boolean; - devDependencies?: boolean; - }; - banner?: string; - footer?: string; - redirect?: DtsRedirect; - tsgo?: boolean; -}; - -export type DtsEntry = { - name: string; - path: string; -}; - -export type DtsGenOptions = Omit< +export type { + ApiExtractorOptions, + DtsRedirect, PluginDtsOptions, - 'bundle' | 'isolated' | 'tsgo' -> & { - bundle: boolean; - name: string; - cwd: string; - isWatch: boolean; - dtsEntry: DtsEntry[]; - dtsEmitPath: string; - build?: boolean; - tsconfigPath: string; - tsConfigResult: - | CompilerApiTsconfigResultForApi - | GetTsconfigTsconfigResultForExecutable; - userExternals?: NonNullable['externals']; - apiExtractorOptions?: ApiExtractorOptions; - loggerLevel: LogLevel; - dtsBackend: DtsGenerationBackend; -}; +} from './types/options'; interface TaskResult { status: 'success' | 'error'; @@ -172,10 +112,7 @@ export const pluginDts: (options?: PluginDtsOptions) => RsbuildPlugin = ( const configuredTsconfigPath = config.source.tsconfigPath ?? 'tsconfig.json'; let tsconfigPath: string | undefined; - let tsConfigResult: - | CompilerApiTsconfigResultForApi - | GetTsconfigTsconfigResultForExecutable - | undefined; + let tsConfigResult: DtsTsconfigResult | undefined; if (tsApi) { tsconfigPath = tsApi.findConfigFile( diff --git a/packages/plugin-dts/src/isolated.ts b/packages/plugin-dts/src/isolated.ts index 111b352d4..60c432f04 100644 --- a/packages/plugin-dts/src/isolated.ts +++ b/packages/plugin-dts/src/isolated.ts @@ -6,7 +6,7 @@ import { type PreparedDtsContext, prepareDtsContext, } from './dts'; -import type { DtsGenOptions } from './index'; +import type { DtsGenOptions } from './types/internal'; import { color, processDtsFiles, rewriteDtsExtensions } from './utils'; export type IsolatedDtsContext = Omit & diff --git a/packages/plugin-dts/src/tsc.ts b/packages/plugin-dts/src/tsc.ts index 2453ae2cd..7d29da40d 100644 --- a/packages/plugin-dts/src/tsc.ts +++ b/packages/plugin-dts/src/tsc.ts @@ -16,8 +16,8 @@ import { processDtsFiles, renameDtsFile, updateDeclarationMapContent, - type CompilerApiTsconfigResultForApi, } from './utils'; +import type { CompilerApiTsconfigResultForApi } from './types/internal'; const logPrefixTsc = color.dim('[tsc]'); /* diff --git a/packages/plugin-dts/src/tsgo.ts b/packages/plugin-dts/src/tsgo.ts index 2c348b9d9..5326d238e 100644 --- a/packages/plugin-dts/src/tsgo.ts +++ b/packages/plugin-dts/src/tsgo.ts @@ -9,8 +9,8 @@ import { getTimeCost, processDtsFiles, rewriteDtsExtensions, - type GetTsconfigTsconfigResultForExecutable, } from './utils'; +import type { GetTsconfigTsconfigResultForExecutable } from './types/internal'; const logPrefixTsgo = color.dim('[tsgo]'); const TYPESCRIPT_PACKAGE_NAME = 'typescript'; diff --git a/packages/plugin-dts/src/types/internal.ts b/packages/plugin-dts/src/types/internal.ts new file mode 100644 index 000000000..f59bc7b0a --- /dev/null +++ b/packages/plugin-dts/src/types/internal.ts @@ -0,0 +1,38 @@ +import type { LogLevel, RsbuildConfig } from '@rsbuild/core'; +import type { ParsedCommandLine } from 'typescript-api'; +import type { ApiExtractorOptions, PluginDtsOptions } from './options'; + +export type DtsGenerationBackend = 'api-old' | 'ts7-executable' | 'isolated'; + +export type DtsEntry = { + name: string; + path: string; +}; + +export type CompilerApiTsconfigResultForApi = ParsedCommandLine; +export type GetTsconfigTsconfigResultForExecutable = Pick< + CompilerApiTsconfigResultForApi, + 'options' +>; + +export type DtsTsconfigResult = + CompilerApiTsconfigResultForApi | GetTsconfigTsconfigResultForExecutable; + +export type DtsGenOptions = Omit< + PluginDtsOptions, + 'bundle' | 'isolated' | 'tsgo' +> & { + bundle: boolean; + name: string; + cwd: string; + isWatch: boolean; + dtsEntry: DtsEntry[]; + dtsEmitPath: string; + build?: boolean; + tsconfigPath: string; + tsConfigResult: DtsTsconfigResult; + userExternals?: NonNullable['externals']; + apiExtractorOptions?: ApiExtractorOptions; + loggerLevel: LogLevel; + dtsBackend: DtsGenerationBackend; +}; diff --git a/packages/plugin-dts/src/types/options.ts b/packages/plugin-dts/src/types/options.ts new file mode 100644 index 000000000..1ed89d485 --- /dev/null +++ b/packages/plugin-dts/src/types/options.ts @@ -0,0 +1,30 @@ +export type DtsRedirect = { + path?: boolean; + extension?: boolean; +}; + +export type ApiExtractorOptions = { + bundledPackages?: string[]; +}; + +export type PluginDtsOptions = { + bundle?: boolean | ApiExtractorOptions; + distPath?: string; + build?: boolean; + abortOnError?: boolean; + dtsExtension?: string; + alias?: Record; + isolated?: boolean; + autoExternal?: + | boolean + | { + dependencies?: boolean; + optionalDependencies?: boolean; + peerDependencies?: boolean; + devDependencies?: boolean; + }; + banner?: string; + footer?: string; + redirect?: DtsRedirect; + tsgo?: boolean; +}; diff --git a/packages/plugin-dts/src/utils.ts b/packages/plugin-dts/src/utils.ts index 897aaebb8..aa370b566 100644 --- a/packages/plugin-dts/src/utils.ts +++ b/packages/plugin-dts/src/utils.ts @@ -19,8 +19,13 @@ import path, { import { styleText } from 'node:util'; import { convertPathToPattern, glob } from 'tinyglobby'; import { createMatchPath, loadConfig, type MatchPath } from 'tsconfig-paths'; -import type { CompilerOptions, ParsedCommandLine } from 'typescript-api'; -import type { DtsEntry, DtsRedirect } from './index'; +import type { CompilerOptions } from 'typescript-api'; +import type { DtsRedirect } from './types/options'; +import type { + CompilerApiTsconfigResultForApi, + DtsEntry, + GetTsconfigTsconfigResultForExecutable, +} from './types/internal'; const require = createRequire(import.meta.url); @@ -102,12 +107,6 @@ export const JS_EXTENSIONS_PATTERN: RegExp = new RegExp( `\\.(${JS_EXTENSIONS.join('|')})$`, ); -export type CompilerApiTsconfigResultForApi = ParsedCommandLine; -export type GetTsconfigTsconfigResultForExecutable = Pick< - CompilerApiTsconfigResultForApi, - 'options' ->; - const resolveTsconfigPath = ( tsconfigDir: string, value: string | undefined, From c1e4f47b708a84da4fda9a2b5f6543f64112b315 Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 19:05:20 +0800 Subject: [PATCH 5/6] refactor(dts): rename TypeScript 6 API alias --- packages/plugin-dts/package.json | 2 +- packages/plugin-dts/src/backend.ts | 12 +++--------- packages/plugin-dts/src/tsc.ts | 2 +- packages/plugin-dts/src/types/internal.ts | 2 +- packages/plugin-dts/src/utils.ts | 10 +++++----- packages/plugin-dts/tests/backend.test.ts | 2 +- packages/plugin-dts/tests/utils.test.ts | 2 +- pnpm-lock.yaml | 2 +- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index 21a7b531a..ce8bccf78 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -45,7 +45,7 @@ "tinyglobby": "^0.2.17", "tsconfig-paths": "^4.2.0", "typescript": "^7.0.2", - "typescript-api": "npm:@typescript/typescript6@^6.0.2" + "typescript6-api": "npm:@typescript/typescript6@^6.0.2" }, "peerDependencies": { "@microsoft/api-extractor": "^7", diff --git a/packages/plugin-dts/src/backend.ts b/packages/plugin-dts/src/backend.ts index a795d09c3..c18c56686 100644 --- a/packages/plugin-dts/src/backend.ts +++ b/packages/plugin-dts/src/backend.ts @@ -47,10 +47,7 @@ const isTypeScriptVersionAtLeast7 = (version: string | undefined): boolean => { }; export function validateExplicitIsolatedDtsOptions( - options: Pick< - PluginDtsOptions, - 'isolated' | 'tsgo' | 'build' | 'abortOnError' - >, + options: PluginDtsOptions, ): void { if (options.isolated !== true) { return; @@ -72,10 +69,7 @@ export function validateExplicitIsolatedDtsOptions( } export function resolveDtsGenerationBackend( - options: Pick< - PluginDtsOptions, - 'isolated' | 'tsgo' | 'build' | 'abortOnError' - >, + options: PluginDtsOptions, typescriptVersion?: string, ): DtsGenerationBackend { validateExplicitIsolatedDtsOptions(options); @@ -87,7 +81,7 @@ export function resolveDtsGenerationBackend( if (isTypeScriptVersionAtLeast7(typescriptVersion)) { if (options.tsgo === false) { throw new Error( - 'Can not set "dts.tsgo: false" when using TypeScript 7 or higher.', + 'Can not set "dts.tsgo: false" when using `typescript` >= 7.0.0.', ); } diff --git a/packages/plugin-dts/src/tsc.ts b/packages/plugin-dts/src/tsc.ts index 7d29da40d..eb5d7d7a3 100644 --- a/packages/plugin-dts/src/tsc.ts +++ b/packages/plugin-dts/src/tsc.ts @@ -7,7 +7,7 @@ import type { Program, System, WatchStatusReporter, -} from 'typescript-api'; +} from 'typescript6-api'; import type { EmitDtsOptions } from './dts'; import { color, diff --git a/packages/plugin-dts/src/types/internal.ts b/packages/plugin-dts/src/types/internal.ts index f59bc7b0a..03aa68caf 100644 --- a/packages/plugin-dts/src/types/internal.ts +++ b/packages/plugin-dts/src/types/internal.ts @@ -1,5 +1,5 @@ import type { LogLevel, RsbuildConfig } from '@rsbuild/core'; -import type { ParsedCommandLine } from 'typescript-api'; +import type { ParsedCommandLine } from 'typescript6-api'; import type { ApiExtractorOptions, PluginDtsOptions } from './options'; export type DtsGenerationBackend = 'api-old' | 'ts7-executable' | 'isolated'; diff --git a/packages/plugin-dts/src/utils.ts b/packages/plugin-dts/src/utils.ts index aa370b566..573369a96 100644 --- a/packages/plugin-dts/src/utils.ts +++ b/packages/plugin-dts/src/utils.ts @@ -19,7 +19,7 @@ import path, { import { styleText } from 'node:util'; import { convertPathToPattern, glob } from 'tinyglobby'; import { createMatchPath, loadConfig, type MatchPath } from 'tsconfig-paths'; -import type { CompilerOptions } from 'typescript-api'; +import type { CompilerOptions } from 'typescript6-api'; import type { DtsRedirect } from './types/options'; import type { CompilerApiTsconfigResultForApi, @@ -30,7 +30,7 @@ import type { const require = createRequire(import.meta.url); let astGrepNapi: typeof import('@ast-grep/napi') | undefined; -const typescriptCache = new Map(); +const typescriptCache = new Map(); export const createRequireFromPackageJson = (cwd: string): NodeJS.Require => createRequire(join(cwd, 'package.json')); @@ -46,7 +46,7 @@ const loadAstGrepNapi = (): typeof import('@ast-grep/napi') => { export const loadTypescript = ( cwd?: string, -): typeof import('typescript-api') => { +): typeof import('typescript6-api') => { const currentRequire = cwd ? createRequireFromPackageJson(cwd) : require; const typescriptPath = currentRequire.resolve('typescript'); const cachedTypescript = typescriptCache.get(typescriptPath); @@ -63,7 +63,7 @@ export const loadTypescript = ( // eslint-disable-next-line @typescript-eslint/no-var-requires const typescript = currentRequire( 'typescript', - ) as typeof import('typescript-api'); + ) as typeof import('typescript6-api'); typescriptCache.set(typescriptPath, typescript); return typescript; @@ -115,7 +115,7 @@ const resolveTsconfigPath = ( export function loadTsconfig( tsconfigPath: string, - ts: typeof import('typescript-api') = loadTypescript(), + ts: typeof import('typescript6-api') = loadTypescript(), ): CompilerApiTsconfigResultForApi { const configFile = ts.readConfigFile( tsconfigPath, diff --git a/packages/plugin-dts/tests/backend.test.ts b/packages/plugin-dts/tests/backend.test.ts index 1f71a9550..f1ffacaf8 100644 --- a/packages/plugin-dts/tests/backend.test.ts +++ b/packages/plugin-dts/tests/backend.test.ts @@ -33,7 +33,7 @@ describe('resolveDtsGenerationBackend', () => { test('should reject disabling tsgo with TypeScript 7.0', () => { expect(() => resolveDtsGenerationBackend({ tsgo: false }, '7.0.2')).toThrow( - 'Can not set "dts.tsgo: false" when using TypeScript 7 or higher.', + 'Can not set "dts.tsgo: false" when using `typescript` >= 7.0.0.', ); }); diff --git a/packages/plugin-dts/tests/utils.test.ts b/packages/plugin-dts/tests/utils.test.ts index a156acad3..018eea514 100644 --- a/packages/plugin-dts/tests/utils.test.ts +++ b/packages/plugin-dts/tests/utils.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from '@rstest/core'; import fs from 'node:fs/promises'; import path from 'node:path'; -import type { CompilerOptions } from 'typescript-api'; +import type { CompilerOptions } from 'typescript6-api'; import { cleanTsBuildInfoFile, loadTsconfigResultForExecutable, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0fdfb0d4..bac0f9940 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -451,7 +451,7 @@ importers: typescript: specifier: ^7.0.2 version: 7.0.2 - typescript-api: + typescript6-api: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' From 955c4ae28ca98e33aead6749258160ac84b432c8 Mon Sep 17 00:00:00 2001 From: Timeless0911 Date: Thu, 9 Jul 2026 19:17:29 +0800 Subject: [PATCH 6/6] refactor(dts): use official TypeScript 6 package --- package.json | 2 +- packages/plugin-dts/package.json | 2 +- pnpm-lock.yaml | 52 +++++++++------------ tests/integration/dts/package.json | 2 +- tests/integration/redirect/dts/package.json | 2 +- 5 files changed, 26 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index cbbfb6ca3..43c5bd970 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "prettier": "^3.9.4", "prettier-plugin-packagejson": "^3.0.2", "simple-git-hooks": "^2.13.1", - "typescript": "npm:@typescript/typescript6@^6.0.2" + "typescript": "^6.0.3" }, "packageManager": "pnpm@11.10.0", "engines": { diff --git a/packages/plugin-dts/package.json b/packages/plugin-dts/package.json index ce8bccf78..8a7d55167 100644 --- a/packages/plugin-dts/package.json +++ b/packages/plugin-dts/package.json @@ -45,7 +45,7 @@ "tinyglobby": "^0.2.17", "tsconfig-paths": "^4.2.0", "typescript": "^7.0.2", - "typescript6-api": "npm:@typescript/typescript6@^6.0.2" + "typescript6-api": "npm:typescript@^6.0.3" }, "peerDependencies": { "@microsoft/api-extractor": "^7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bac0f9940..0405a4ad2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,7 +14,7 @@ importers: version: 0.6.4(jiti@2.7.0) '@rstest/adapter-rslib': specifier: ^0.10.6 - version: 0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(@typescript/typescript6@6.0.2) + version: 0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(typescript@6.0.3) '@rstest/core': specifier: ^0.10.6 version: 0.10.6(@module-federation/runtime-tools@2.6.0) @@ -38,7 +38,7 @@ importers: version: 1.0.2 prebundle: specifier: 1.6.5 - version: 1.6.5(@typescript/typescript6@6.0.2) + version: 1.6.5(typescript@6.0.3) prettier: specifier: ^3.9.4 version: 3.9.4 @@ -49,8 +49,8 @@ importers: specifier: ^2.13.1 version: 2.13.1 typescript: - specifier: npm:@typescript/typescript6@^6.0.2 - version: '@typescript/typescript6@6.0.2' + specifier: ^6.0.3 + version: 6.0.3 examples/express-plugin: devDependencies: @@ -452,8 +452,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 typescript6-api: - specifier: npm:@typescript/typescript6@^6.0.2 - version: '@typescript/typescript6@6.0.2' + specifier: npm:typescript@^6.0.3 + version: typescript@6.0.3 scripts/tsconfig: {} @@ -736,8 +736,8 @@ importers: tests/integration/dts: devDependencies: typescript: - specifier: npm:@typescript/typescript6@^6.0.2 - version: '@typescript/typescript6@6.0.2' + specifier: ^6.0.3 + version: 6.0.3 tests/integration/dts-tsgo: devDependencies: @@ -1082,8 +1082,8 @@ importers: specifier: ^5.2.1 version: 5.2.1 typescript: - specifier: npm:@typescript/typescript6@^6.0.2 - version: '@typescript/typescript6@6.0.2' + specifier: ^6.0.3 + version: 6.0.3 tests/integration/redirect/dts-tsgo: devDependencies: @@ -3859,10 +3859,6 @@ packages: cpu: [x64] os: [win32] - '@typescript/typescript6@6.0.2': - resolution: {integrity: sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==} - hasBin: true - '@typescript/vfs@1.6.4': resolution: {integrity: sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==} peerDependencies: @@ -9355,13 +9351,13 @@ snapshots: optionalDependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/typescript6@6.0.2)': + '@rslib/core@0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3)': dependencies: '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) - rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/typescript6@6.0.2) + rsbuild-plugin-dts: 0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) - typescript: '@typescript/typescript6@6.0.2' + typescript: 6.0.3 transitivePeerDependencies: - '@module-federation/runtime-tools' - '@typescript/native-preview' @@ -9665,12 +9661,12 @@ snapshots: optionalDependencies: '@rspress/core': 2.0.16(@module-federation/runtime-tools@2.6.0)(@rspack/core@2.1.3)(@types/mdast@4.0.4)(@types/react@19.2.17)(micromark-util-types@2.0.2)(micromark@4.0.2) - '@rstest/adapter-rslib@0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(@typescript/typescript6@6.0.2)': + '@rstest/adapter-rslib@0.10.6(@rslib/core@0.23.2)(@rstest/core@0.10.6)(typescript@6.0.3)': dependencies: - '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(@typescript/typescript6@6.0.2) + '@rslib/core': 0.23.2(@microsoft/api-extractor@7.58.9)(@module-federation/runtime-tools@2.6.0)(typescript@6.0.3) '@rstest/core': 0.10.6(@module-federation/runtime-tools@2.6.0) optionalDependencies: - typescript: '@typescript/typescript6@6.0.2' + typescript: 6.0.3 '@rstest/core@0.10.6(@module-federation/runtime-tools@2.6.0)': dependencies: @@ -10328,10 +10324,6 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true - '@typescript/typescript6@6.0.2': - dependencies: - '@typescript/old': typescript@6.0.3 - '@typescript/vfs@1.6.4(typescript@6.0.3)': dependencies: debug: 4.4.3 @@ -13125,13 +13117,13 @@ snapshots: preact@10.29.4: {} - prebundle@1.6.5(@typescript/typescript6@6.0.2): + prebundle@1.6.5(typescript@6.0.3): dependencies: '@vercel/ncc': 0.38.4 cac: 7.0.0 prettier: 3.9.4 rollup: 4.60.4 - rollup-plugin-dts: 6.4.1(@typescript/typescript6@6.0.2)(rollup@4.60.4) + rollup-plugin-dts: 6.4.1(rollup@4.60.4)(typescript@6.0.3) terser: 5.48.0 transitivePeerDependencies: - typescript @@ -13632,14 +13624,14 @@ snapshots: hash-base: 3.1.0 inherits: 2.0.4 - rollup-plugin-dts@6.4.1(@typescript/typescript6@6.0.2)(rollup@4.60.4): + rollup-plugin-dts@6.4.1(rollup@4.60.4)(typescript@6.0.3): dependencies: '@jridgewell/remapping': 2.3.5 '@jridgewell/sourcemap-codec': 1.5.5 convert-source-map: 2.0.0 magic-string: 0.30.21 rollup: 4.60.4 - typescript: '@typescript/typescript6@6.0.2' + typescript: 6.0.3 optionalDependencies: '@babel/code-frame': 7.29.7 @@ -13684,13 +13676,13 @@ snapshots: transitivePeerDependencies: - supports-color - rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(@typescript/typescript6@6.0.2): + rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@6.0.3): dependencies: '@ast-grep/napi': 0.37.0 '@rsbuild/core': 2.1.5(@module-federation/runtime-tools@2.6.0) optionalDependencies: '@microsoft/api-extractor': 7.58.9(@types/node@24.13.2) - typescript: '@typescript/typescript6@6.0.2' + typescript: 6.0.3 rsbuild-plugin-dts@0.23.2(@microsoft/api-extractor@7.58.9)(@rsbuild/core@2.1.5)(typescript@7.0.2): dependencies: diff --git a/tests/integration/dts/package.json b/tests/integration/dts/package.json index 4294f215c..8e5de68db 100644 --- a/tests/integration/dts/package.json +++ b/tests/integration/dts/package.json @@ -4,6 +4,6 @@ "private": true, "type": "module", "devDependencies": { - "typescript": "npm:@typescript/typescript6@^6.0.2" + "typescript": "^6.0.3" } } diff --git a/tests/integration/redirect/dts/package.json b/tests/integration/redirect/dts/package.json index cb40834b4..e8211dee1 100644 --- a/tests/integration/redirect/dts/package.json +++ b/tests/integration/redirect/dts/package.json @@ -6,7 +6,7 @@ "@rslib/core": "workspace:*", "@types/express": "^5.0.6", "express": "^5.2.1", - "typescript": "npm:@typescript/typescript6@^6.0.2" + "typescript": "^6.0.3" }, "peerDependencies": { "express": "^4"