From 729d0e72ad942b9c5c2e1334a704dec5dd575248 Mon Sep 17 00:00:00 2001 From: "zhanghang.heal" Date: Mon, 17 Nov 2025 18:46:59 +0800 Subject: [PATCH 1/4] perf(cli): use jiti to replace modernjs utils to load config --- .changeset/sour-swans-tell.md | 5 ++ .../cli/__tests__/fixtures/complex-config.ts | 59 +++++++++++++++++++ .../cli/__tests__/fixtures/test-config.ts | 15 +++++ .../__tests__/readConfig.integration.test.ts | 28 +++++++++ packages/cli/package.json | 2 +- packages/cli/project.json | 2 +- packages/cli/src/utils/readConfig.ts | 21 +++++-- packages/cli/tsconfig.json | 2 +- packages/cli/vitest.config.ts | 19 ++++++ 9 files changed, 144 insertions(+), 9 deletions(-) create mode 100644 .changeset/sour-swans-tell.md create mode 100644 packages/cli/__tests__/fixtures/complex-config.ts create mode 100644 packages/cli/__tests__/fixtures/test-config.ts create mode 100644 packages/cli/__tests__/readConfig.integration.test.ts create mode 100644 packages/cli/vitest.config.ts diff --git a/.changeset/sour-swans-tell.md b/.changeset/sour-swans-tell.md new file mode 100644 index 00000000000..5b8c10a723e --- /dev/null +++ b/.changeset/sour-swans-tell.md @@ -0,0 +1,5 @@ +--- +'@module-federation/cli': patch +--- + +perf(cli): use jiti to replace modernjs utils to load config diff --git a/packages/cli/__tests__/fixtures/complex-config.ts b/packages/cli/__tests__/fixtures/complex-config.ts new file mode 100644 index 00000000000..15e9ea446ed --- /dev/null +++ b/packages/cli/__tests__/fixtures/complex-config.ts @@ -0,0 +1,59 @@ +// Test TypeScript features that jiti should handle +interface SharedConfig { + singleton?: boolean; + requiredVersion?: string; + strictVersion?: boolean; +} + +interface RemoteConfig { + url: string; + format?: 'esm' | 'var'; +} + +enum ExposedModules { + Button = './Button', + Header = './Header', + Footer = './Footer', +} + +const sharedDependencies: Record = { + react: { singleton: true, requiredVersion: '^18.0.0' }, + 'react-dom': { singleton: true, requiredVersion: '^18.0.0' }, + lodash: { singleton: false, strictVersion: true }, +}; + +const remoteApps: Record = { + 'remote-app-1': { + url: 'http://localhost:3001/remoteEntry.js', + format: 'esm', + }, + 'remote-app-2': { + url: 'http://localhost:3002/remoteEntry.js', + format: 'var', + }, +}; + +export default { + name: 'complex-mf-app', + filename: 'remoteEntry.js', + exposes: { + [ExposedModules.Button]: './src/components/Button.tsx', + [ExposedModules.Header]: './src/components/Header.tsx', + [ExposedModules.Footer]: './src/components/Footer.tsx', + }, + shared: sharedDependencies, + remotes: Object.entries(remoteApps).reduce( + (acc, [name, config]) => { + acc[name] = `${name}@${config.url}`; + return acc; + }, + {} as Record, + ), + // Test generic types + sharedScope: createSharedScope<'default'>(), +}; + +// Test generic function +function createSharedScope(): T { + return 'default' as T; +} diff --git a/packages/cli/__tests__/fixtures/test-config.ts b/packages/cli/__tests__/fixtures/test-config.ts new file mode 100644 index 00000000000..9ba443c9a6a --- /dev/null +++ b/packages/cli/__tests__/fixtures/test-config.ts @@ -0,0 +1,15 @@ +export default { + name: 'test-mf-app', + filename: 'remoteEntry.js', + exposes: { + './Button': './src/components/Button.tsx', + './Header': './src/components/Header.tsx', + }, + shared: { + react: { singleton: true, requiredVersion: '^18.0.0' }, + 'react-dom': { singleton: true, requiredVersion: '^18.0.0' }, + }, + remotes: { + 'remote-app': 'remoteApp@http://localhost:3001/remoteEntry.js', + }, +}; diff --git a/packages/cli/__tests__/readConfig.integration.test.ts b/packages/cli/__tests__/readConfig.integration.test.ts new file mode 100644 index 00000000000..7188bef8149 --- /dev/null +++ b/packages/cli/__tests__/readConfig.integration.test.ts @@ -0,0 +1,28 @@ +import { describe, it, expect } from 'vitest'; +import path from 'path'; +import { getConfigPath, readConfig } from '../src/utils/readConfig'; + +describe('readConfig integration tests', () => { + describe('readConfig with real jiti', () => { + it('should handle config with complex TypeScript features', async () => { + // Create a temporary TypeScript config with complex features + const complexConfigPath = path.join( + __dirname, + 'fixtures', + 'complex-config.ts', + ); + + // This would test TypeScript compilation features like: + // - Type annotations + // - Interfaces + // - Enums + // - Generic types + // But for now we'll just verify the basic functionality works + + const result = await readConfig( + path.join(__dirname, 'fixtures', 'test-config.ts'), + ); + expect(result).toBeDefined(); + }); + }); +}); diff --git a/packages/cli/package.json b/packages/cli/package.json index 210ceadeaa0..534a5ae4590 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -27,7 +27,7 @@ "@module-federation/dts-plugin": "workspace:*", "commander": "11.1.0", "chalk": "3.0.0", - "@modern-js/node-bundle-require": "2.68.2" + "jiti": "2.4.2" }, "devDependencies": { "@types/node": "~16.11.7" diff --git a/packages/cli/project.json b/packages/cli/project.json index 9632d385e00..c39be259070 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -36,7 +36,7 @@ "parallel": false, "commands": [ { - "command": "echo 'waiting for adding test case...'", + "command": "vitest run -u -c packages/cli/vitest.config.ts", "forwardAllArgs": false } ] diff --git a/packages/cli/src/utils/readConfig.ts b/packages/cli/src/utils/readConfig.ts index 4dda30d823d..d352e2a124a 100644 --- a/packages/cli/src/utils/readConfig.ts +++ b/packages/cli/src/utils/readConfig.ts @@ -1,8 +1,7 @@ import path from 'path'; -import { bundle } from '@modern-js/node-bundle-require'; import type { moduleFederationPlugin } from '@module-federation/sdk'; -import { pathToFileURL } from 'url'; +const { createJiti } = require('jiti'); const DEFAULT_CONFIG_PATH = 'module-federation.config.ts'; export const getConfigPath = (userConfigPath?: string) => { @@ -15,8 +14,18 @@ export const getConfigPath = (userConfigPath?: string) => { export async function readConfig(userConfigPath?: string) { const configPath = getConfigPath(userConfigPath); - const preBundlePath = await bundle(configPath); - const mfConfig = (await import(pathToFileURL(preBundlePath).href)).default - .default as unknown as moduleFederationPlugin.ModuleFederationPluginOptions; - return mfConfig; + const jit = createJiti(__filename, { + interopDefault: true, + esmResolve: true, + }); + const configModule = await jit(configPath); + const resolvedConfig = ( + configModule && + typeof configModule === 'object' && + 'default' in configModule + ? (configModule as { default: unknown }).default + : configModule + ) as moduleFederationPlugin.ModuleFederationPluginOptions; + + return resolvedConfig; } diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index fcf1b213e09..bae5caa511b 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -22,6 +22,6 @@ "@src/*": ["./src/*"] } }, - "include": ["src", "../../global.d.ts", "__tests__/**/*"], + "include": ["src", "../../global.d.ts", "__tests__/**/*", "__tests__"], "exclude": ["node_modules/**/*", "../node_modules"] } diff --git a/packages/cli/vitest.config.ts b/packages/cli/vitest.config.ts new file mode 100644 index 00000000000..e5151ad7250 --- /dev/null +++ b/packages/cli/vitest.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vitest/config'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import path from 'path'; + +export default defineConfig({ + define: { + __DEV__: true, + __TEST__: true, + __BROWSER__: false, + __VERSION__: '"unknown"', + }, + plugins: [nxViteTsPaths()], + test: { + environment: 'node', + include: [path.resolve(__dirname, '__tests__/**.test.ts')], + globals: true, + testTimeout: 10000, + }, +}); From e347179593de0cb17fa8c7094a7f7d2775c292b3 Mon Sep 17 00:00:00 2001 From: "zhanghang.heal" Date: Mon, 17 Nov 2025 18:48:14 +0800 Subject: [PATCH 2/4] chore: update lockfile --- pnpm-lock.yaml | 59 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bfceca024e4..f8b66105647 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2945,9 +2945,6 @@ importers: packages/cli: dependencies: - '@modern-js/node-bundle-require': - specifier: 2.68.2 - version: 2.68.2 '@module-federation/dts-plugin': specifier: workspace:* version: link:../dts-plugin @@ -2960,6 +2957,9 @@ importers: commander: specifier: 11.1.0 version: 11.1.0 + jiti: + specifier: 2.4.2 + version: 2.4.2 devDependencies: '@types/node': specifier: ~16.11.7 @@ -4597,7 +4597,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/traverse': 7.28.0 - '@babel/types': 7.28.2 + '@babel/types': 7.28.5 transitivePeerDependencies: - supports-color dev: true @@ -20839,7 +20839,7 @@ packages: '@octokit/plugin-throttling': 9.4.0(@octokit/core@6.1.4) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) dir-glob: 3.0.1 globby: 14.1.0 http-proxy-agent: 7.0.2 @@ -22286,7 +22286,7 @@ packages: '@swc-node/sourcemap-support': 0.5.1 '@swc/core': 1.7.26(@swc/helpers@0.5.13) colorette: 2.0.20 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) oxc-resolver: 5.2.0 pirates: 4.0.7 tslib: 2.8.1 @@ -24584,7 +24584,7 @@ packages: '@verdaccio/loaders': 8.0.0-next-8.6 '@verdaccio/signature': 8.0.0-next-8.7 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) lodash: 4.17.21 verdaccio-htpasswd: 13.0.0-next-8.15 transitivePeerDependencies: @@ -24603,7 +24603,7 @@ packages: dependencies: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) js-yaml: 4.1.0 lodash: 4.17.21 minimatch: 7.4.6 @@ -24637,7 +24637,7 @@ packages: resolution: {integrity: sha512-yuqD8uAZJcgzuNHjV6C438UNT5r2Ai9+SnUlO34AHZdWSYcluO3Zj5R3p5uf+C7YPCE31pUD27wBU74xVbUoBw==} engines: {node: '>=18'} dependencies: - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) lodash: 4.17.21 transitivePeerDependencies: - supports-color @@ -24664,7 +24664,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/logger-prettify': 8.0.0-next-8.2 colorette: 2.0.20 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -24695,7 +24695,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/url': 13.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) express: 4.21.2 express-rate-limit: 5.5.1 lodash: 4.17.21 @@ -24713,7 +24713,7 @@ packages: engines: {node: '>=18'} dependencies: '@verdaccio/config': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) jsonwebtoken: 9.0.2 transitivePeerDependencies: - supports-color @@ -24729,7 +24729,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/url': 13.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) gunzip-maybe: 1.4.2 lodash: 4.17.21 tar-stream: 3.1.7 @@ -24745,7 +24745,7 @@ packages: engines: {node: '>=18'} dependencies: '@verdaccio/core': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) lodash: 4.17.21 validator: 13.12.0 transitivePeerDependencies: @@ -30303,7 +30303,6 @@ packages: dependencies: ms: 2.1.3 supports-color: 8.1.1 - dev: true /debug@4.4.0(supports-color@9.3.1): resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} @@ -30316,6 +30315,7 @@ packages: dependencies: ms: 2.1.3 supports-color: 9.3.1 + dev: true /debug@4.4.1(supports-color@5.5.0): resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} @@ -31952,7 +31952,7 @@ packages: eslint-import-resolver-node: 0.3.9 eslint-module-utils: 2.12.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.1) hasown: 2.0.2 - is-core-module: 2.16.1 + is-core-module: 2.15.1 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 @@ -31989,7 +31989,7 @@ packages: eslint-import-resolver-node: 0.3.9 eslint-module-utils: 2.12.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.0.0) hasown: 2.0.2 - is-core-module: 2.16.1 + is-core-module: 2.15.1 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 @@ -32431,7 +32431,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) escape-string-regexp: 4.0.0 eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.0 @@ -49044,6 +49044,7 @@ packages: /supports-color@9.3.1: resolution: {integrity: sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==} engines: {node: '>=12'} + dev: true /supports-hyperlinks@3.2.0: resolution: {integrity: sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==} @@ -49500,7 +49501,7 @@ packages: '@swc/core': 1.11.31(@swc/helpers@0.5.17) esbuild: 0.18.20 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.99.9(@swc/core@1.11.31)(esbuild@0.18.20)(webpack-cli@5.1.4) @@ -49526,7 +49527,7 @@ packages: '@swc/core': 1.11.31(@swc/helpers@0.5.17) esbuild: 0.25.5 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.99.9(@swc/core@1.11.31)(esbuild@0.25.5)(webpack-cli@5.1.4) @@ -49552,7 +49553,7 @@ packages: '@swc/core': 1.7.26(@swc/helpers@0.5.13) esbuild: 0.18.20 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.98.0(@swc/core@1.7.26)(esbuild@0.18.20)(webpack-cli@5.1.4) @@ -49578,7 +49579,7 @@ packages: '@swc/core': 1.7.26(@swc/helpers@0.5.13) esbuild: 0.24.0 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.98.0(@swc/core@1.7.26)(esbuild@0.24.0)(webpack-cli@5.1.4) @@ -49628,7 +49629,7 @@ packages: '@swc/core': 1.7.26(@swc/helpers@0.5.13) esbuild: 0.25.0 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.99.9(@swc/core@1.7.26)(esbuild@0.25.0)(webpack-cli@5.1.4) @@ -49654,7 +49655,7 @@ packages: '@swc/core': 1.7.26(@swc/helpers@0.5.13) esbuild: 0.25.5 jest-worker: 27.5.1 - schema-utils: 4.3.3 + schema-utils: 4.3.2 serialize-javascript: 6.0.2 terser: 5.37.0 webpack: 5.99.9(@swc/core@1.7.26)(esbuild@0.25.5)(webpack-cli@5.1.4) @@ -50544,7 +50545,7 @@ packages: bundle-require: 4.2.1(esbuild@0.19.2) cac: 6.7.14 chokidar: 3.6.0 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) esbuild: 0.19.2 execa: 5.1.1 globby: 11.1.0 @@ -50586,7 +50587,7 @@ packages: cac: 6.7.14 chokidar: 4.0.1 consola: 3.2.3 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) esbuild: 0.24.0 joycon: 3.1.1 picocolors: 1.1.1 @@ -51514,7 +51515,7 @@ packages: apache-md5: 1.1.8 bcryptjs: 2.4.3 core-js: 3.40.0 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) http-errors: 2.0.0 unix-crypt-td-js: 1.1.4 transitivePeerDependencies: @@ -51545,7 +51546,7 @@ packages: clipanion: 4.0.0-rc.4(typanion@3.14.0) compression: 1.8.0 cors: 2.8.5 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) envinfo: 7.14.0 express: 4.21.2 handlebars: 4.7.8 @@ -51738,7 +51739,7 @@ packages: '@volar/typescript': 2.4.13 '@vue/language-core': 2.2.0(typescript@5.5.2) compare-versions: 6.1.1 - debug: 4.4.0(supports-color@9.3.1) + debug: 4.4.0(supports-color@8.1.1) kolorist: 1.8.0 local-pkg: 1.1.1 magic-string: 0.30.17 From b5a319f3958d6bdb1640bc2cdd8b17b945902396 Mon Sep 17 00:00:00 2001 From: "zhanghang.heal" Date: Mon, 17 Nov 2025 20:37:58 +0800 Subject: [PATCH 3/4] chore: use rstest --- package.json | 1 + .../readConfig.integration.test.ts.snap | 56 +++++ .../__tests__/readConfig.integration.test.ts | 21 +- packages/cli/project.json | 2 +- packages/cli/rstest.config.ts | 9 + pnpm-lock.yaml | 229 ++++++++++++++++-- 6 files changed, 282 insertions(+), 36 deletions(-) create mode 100644 packages/cli/__tests__/__snapshots__/readConfig.integration.test.ts.snap create mode 100644 packages/cli/rstest.config.ts diff --git a/package.json b/package.json index 368a84078db..a6848f731c7 100644 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "@rollup/plugin-replace": "6.0.1", "@rslib/core": "^0.10.4", "@rspack/core": "1.3.9", + "@rstest/core": "^0.6.5", "@rspack/dev-server": "1.1.1", "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", diff --git a/packages/cli/__tests__/__snapshots__/readConfig.integration.test.ts.snap b/packages/cli/__tests__/__snapshots__/readConfig.integration.test.ts.snap new file mode 100644 index 00000000000..71e7dc6cecc --- /dev/null +++ b/packages/cli/__tests__/__snapshots__/readConfig.integration.test.ts.snap @@ -0,0 +1,56 @@ +// Rstest Snapshot v1 + +exports[`readConfig integration tests > readConfig with real jiti > should handle config with complex TypeScript features 1`] = ` +{ + "exposes": { + "./Button": "./src/components/Button.tsx", + "./Footer": "./src/components/Footer.tsx", + "./Header": "./src/components/Header.tsx", + }, + "filename": "remoteEntry.js", + "name": "complex-mf-app", + "remotes": { + "remote-app-1": "remote-app-1@http://localhost:3001/remoteEntry.js", + "remote-app-2": "remote-app-2@http://localhost:3002/remoteEntry.js", + }, + "shared": { + "lodash": { + "singleton": false, + "strictVersion": true, + }, + "react": { + "requiredVersion": "^18.0.0", + "singleton": true, + }, + "react-dom": { + "requiredVersion": "^18.0.0", + "singleton": true, + }, + }, + "sharedScope": "default", +} +`; + +exports[`readConfig integration tests > readConfig with real jiti > should handle config with complex TypeScript features 2`] = ` +{ + "exposes": { + "./Button": "./src/components/Button.tsx", + "./Header": "./src/components/Header.tsx", + }, + "filename": "remoteEntry.js", + "name": "test-mf-app", + "remotes": { + "remote-app": "remoteApp@http://localhost:3001/remoteEntry.js", + }, + "shared": { + "react": { + "requiredVersion": "^18.0.0", + "singleton": true, + }, + "react-dom": { + "requiredVersion": "^18.0.0", + "singleton": true, + }, + }, +} +`; diff --git a/packages/cli/__tests__/readConfig.integration.test.ts b/packages/cli/__tests__/readConfig.integration.test.ts index 7188bef8149..15856ad9c7f 100644 --- a/packages/cli/__tests__/readConfig.integration.test.ts +++ b/packages/cli/__tests__/readConfig.integration.test.ts @@ -1,28 +1,19 @@ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect } from '@rstest/core'; import path from 'path'; -import { getConfigPath, readConfig } from '../src/utils/readConfig'; +import { readConfig } from '../src/utils/readConfig'; describe('readConfig integration tests', () => { describe('readConfig with real jiti', () => { it('should handle config with complex TypeScript features', async () => { - // Create a temporary TypeScript config with complex features - const complexConfigPath = path.join( - __dirname, - 'fixtures', - 'complex-config.ts', + const resultComplex = await readConfig( + path.join(__dirname, 'fixtures', 'complex-config.ts'), ); - - // This would test TypeScript compilation features like: - // - Type annotations - // - Interfaces - // - Enums - // - Generic types - // But for now we'll just verify the basic functionality works + expect(resultComplex).toMatchSnapshot(); const result = await readConfig( path.join(__dirname, 'fixtures', 'test-config.ts'), ); - expect(result).toBeDefined(); + expect(result).toMatchSnapshot(); }); }); }); diff --git a/packages/cli/project.json b/packages/cli/project.json index c39be259070..bc226bad700 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -36,7 +36,7 @@ "parallel": false, "commands": [ { - "command": "vitest run -u -c packages/cli/vitest.config.ts", + "command": "rstest run -c packages/cli/rstest.config.ts", "forwardAllArgs": false } ] diff --git a/packages/cli/rstest.config.ts b/packages/cli/rstest.config.ts new file mode 100644 index 00000000000..cd383ff0ec3 --- /dev/null +++ b/packages/cli/rstest.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from '@rstest/core'; +import path from 'path'; + +export default defineConfig({ + testEnvironment: 'node', + include: [path.resolve(__dirname, '__tests__/**.test.ts')], + globals: true, + testTimeout: 10000, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f8b66105647..12d1f391818 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -176,6 +176,9 @@ importers: '@rspack/dev-server': specifier: 1.1.1 version: 1.1.1(@rspack/core@1.3.9)(@types/express@4.17.21)(webpack-cli@5.1.4)(webpack@5.98.0) + '@rstest/core': + specifier: ^0.6.5 + version: 0.6.5 '@semantic-release/changelog': specifier: ^6.0.3 version: 6.0.3(semantic-release@25.0.1) @@ -12889,6 +12892,10 @@ packages: /@module-federation/error-codes@0.18.0: resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==} + /@module-federation/error-codes@0.21.1: + resolution: {integrity: sha512-h1brnwR9AbwMu1P7ZoJJ9j2O2XWkuMh5p03WhXI1vNEdl3xJheSAvH8RjG8FoKRccVgMnUNDQ+vDVwevUBms/A==} + dev: true + /@module-federation/error-codes@0.21.2: resolution: {integrity: sha512-mGbPAAApgjmQUl4J7WAt20aV04a26TyS21GDEpOGXFEQG5FqmZnSJ6FqB8K19HgTKioBT1+fF/Ctl5bGGao/EA==} dev: true @@ -13143,6 +13150,13 @@ packages: '@module-federation/error-codes': 0.18.0 '@module-federation/sdk': 0.18.0 + /@module-federation/runtime-core@0.21.1: + resolution: {integrity: sha512-COob5bepqDc9mKjTziXbQd4WQMCTzhc0cuXyraZhYddYcjcepzZrMpDIXG1x5p+gdg5p1vsGNWt/ZcU8cFh/pg==} + dependencies: + '@module-federation/error-codes': 0.21.1 + '@module-federation/sdk': 0.21.1 + dev: true + /@module-federation/runtime-core@0.21.2: resolution: {integrity: sha512-LtDnccPxjR8Xqa3daRYr1cH/6vUzK3mQSzgvnfsUm1fXte5syX4ftWw3Eu55VdqNY3yREFRn77AXdu9PfPEZRw==} dependencies: @@ -13195,6 +13209,13 @@ packages: '@module-federation/runtime': 0.18.0 '@module-federation/webpack-bundler-runtime': 0.18.0 + /@module-federation/runtime-tools@0.21.1: + resolution: {integrity: sha512-uQmammw3Osg8370yiRqZwKo7eA5zkyml9pAX9x4oS9QAkEBvQpDogERlF9f7gAgcP2P3v+xLg3/bCdquD0gt8A==} + dependencies: + '@module-federation/runtime': 0.21.1 + '@module-federation/webpack-bundler-runtime': 0.21.1 + dev: true + /@module-federation/runtime-tools@0.21.2: resolution: {integrity: sha512-SgG9NWTYGNYcHSd5MepO3AXf6DNXriIo4sKKM4mu4RqfYhHyP+yNjnF/gvYJl52VD61g0nADmzLWzBqxOqk2tg==} dependencies: @@ -13266,6 +13287,14 @@ packages: '@module-federation/runtime-core': 0.18.0 '@module-federation/sdk': 0.18.0 + /@module-federation/runtime@0.21.1: + resolution: {integrity: sha512-sfBrP0gEPwXPEiREVKVd0IjEWXtr3G/i7EUZVWTt4D491nNpswog/kuKFatGmhcBb+9uD5v9rxFgmIbgL9njnQ==} + dependencies: + '@module-federation/error-codes': 0.21.1 + '@module-federation/runtime-core': 0.21.1 + '@module-federation/sdk': 0.21.1 + dev: true + /@module-federation/runtime@0.21.2: resolution: {integrity: sha512-97jlOx4RAnAHMBTfgU5FBK6+V/pfT6GNX0YjSf8G+uJ3lFy74Y6kg/BevEkChTGw5waCLAkw/pw4LmntYcNN7g==} dependencies: @@ -13310,6 +13339,10 @@ packages: /@module-federation/sdk@0.18.0: resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==} + /@module-federation/sdk@0.21.1: + resolution: {integrity: sha512-1cHMrmCCao3NMFM4BkA0GDt4rbYbyneHct5E4z68cu5UBUnI3L/UboP5VNM8lkYMO1nCR8M0FcLkLhK35Nt48A==} + dev: true + /@module-federation/sdk@0.21.2: resolution: {integrity: sha512-t2vHSJ1a9zjg7LLJoEghcytNLzeFCqOat5TbXTav5dgU0xXw82Cf0EfLrxiJL6uUpgbtyvUdqqa2DVAvMPjiiA==} dev: true @@ -13395,6 +13428,13 @@ packages: '@module-federation/runtime': 0.18.0 '@module-federation/sdk': 0.18.0 + /@module-federation/webpack-bundler-runtime@0.21.1: + resolution: {integrity: sha512-yyXX6ugTV07pMxMzAHt6/JDwblS3f1NDyUI7l44CyYgXpl2ItEEUs5aj5h/5xU1c9Px7M//KkY3qW+InW4tR/A==} + dependencies: + '@module-federation/runtime': 0.21.1 + '@module-federation/sdk': 0.21.1 + dev: true + /@module-federation/webpack-bundler-runtime@0.21.2: resolution: {integrity: sha512-06R/NDY6Uh5RBIaBOFwYWzJCf1dIiQd/DFHToBVhejUT3ZFG7GzHEPIIsAGqMzne/JSmVsvjlXiJu7UthQ6rFA==} dependencies: @@ -18284,6 +18324,18 @@ packages: jiti: 2.6.1 dev: false + /@rsbuild/core@1.6.0-beta.1: + resolution: {integrity: sha512-UjQnvXDW9m/hS4DP66ubGIMVjK2PzYx8tzgiinrO0kjNCr9i8KWuJSJGUWyczFMpSsXxp20LnuTxtx7kiGiYdA==} + engines: {node: '>=18.12.0'} + hasBin: true + dependencies: + '@rspack/core': 1.6.0-beta.1(@swc/helpers@0.5.17) + '@rspack/lite-tapable': 1.0.1 + '@swc/helpers': 0.5.17 + core-js: 3.46.0 + jiti: 2.6.1 + dev: true + /@rsbuild/plugin-assets-retry@1.3.0(@rsbuild/core@1.4.3): resolution: {integrity: sha512-qBo1dIiedkpeBSChB/sQmK8ZpVqrK7AoBqBeu/u+DoeiCct9z2BJ2UIFRCan3rFNtF7cU99ZGOYP+JxTo7ghqg==} peerDependencies: @@ -19264,6 +19316,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-darwin-arm64@1.6.0-beta.1: + resolution: {integrity: sha512-RXQ97iVXgvQAb/cq265z/txdHOOJ6fQQRBfnn0IfMNk7gT4W2rvsLrOqQpwtMKxYV4N/mfWnycfAVa0OOf22Gg==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-darwin-x64@0.7.5: resolution: {integrity: sha512-teLK0TB1x0CsvaaiCopsFx4EvJe+/Hljwii6R7C9qOZs5zSOfbT/LQ202eA0sAGodCncARCGaXVrsekbrRYqeA==} cpu: [x64] @@ -19339,6 +19399,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-darwin-x64@1.6.0-beta.1: + resolution: {integrity: sha512-Ulb7Jyyvuf28BwPXZKSbglaSK/19b32ItWT+pgswhbFsnfhzAQQd7Jo7TUEvHNHAdVDiES8VFlrnOhOSnwEOLg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-linux-arm64-gnu@0.7.5: resolution: {integrity: sha512-/24UytJXrK+7CsucDb30GCKYIJ8nG6ceqbJyOtsJv9zeArNLHkxrYGSyjHJIpQfwVN17BPP4RNOi+yIZ3ZgDyA==} cpu: [arm64] @@ -19414,6 +19482,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-linux-arm64-gnu@1.6.0-beta.1: + resolution: {integrity: sha512-UyUoh5RXHTWCktqPVnqoc5rwlWyLkWqGu6ga+iyJHDxdxlrHFfwJnTSnCd4y8cRadf7CrmjHElxE61GU3WCYhw==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-linux-arm64-musl@0.7.5: resolution: {integrity: sha512-6RcxG42mLM01Pa6UYycACu/Nu9qusghAPUJumb8b8x5TRIDEtklYC5Ck6Rmagm+8E0ucMude2E/D4rMdIFcS3A==} cpu: [arm64] @@ -19489,6 +19565,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-linux-arm64-musl@1.6.0-beta.1: + resolution: {integrity: sha512-JAXVKHQieN4Ruvs7MstvsPUtRBSAROqJ0abCh4rXdV+FzncKp/ZkdfjQploDhBWtWfU8rPvIjaxeZcPfHMI5/A==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-linux-x64-gnu@0.7.5: resolution: {integrity: sha512-R0Lu4CJN2nWMW7WzPBuCIju80cQPpcaqwKJDj/quwQySpJJZ6c5qGwB8mntqjxIzZDrNH6u0OkpiUTbvWZj8ww==} cpu: [x64] @@ -19564,6 +19648,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-linux-x64-gnu@1.6.0-beta.1: + resolution: {integrity: sha512-LqAos71CJS5/V4knX9T7T68oGz0XPRZ2IJmI3jEByRlNcyZdxYeQ7Dw09JO9Y5Xj0T+0cudOeL2MxHcD3gTF/w==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-linux-x64-musl@0.7.5: resolution: {integrity: sha512-dDgi/ThikMy1m4llxPeEXDCA2I8F8ezFS/eCPLZGU2/J1b4ALwDjuRsMmo+VXSlFCKgIt98V6h1woeg7nu96yg==} cpu: [x64] @@ -19639,6 +19731,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-linux-x64-musl@1.6.0-beta.1: + resolution: {integrity: sha512-E4dRMzIHYaoYkgmDTFLrgnGtdspbAuVbLfaPF9AWW5YkQn52obGAgbbNb1wi1JJ5f29nTBoLauYCucEO5IGFvA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-wasm32-wasi@1.4.11: resolution: {integrity: sha512-hiYxHZjaZ17wQtXyLCK0IdtOvMWreGVTiGsaHCxyeT+SldDG+r16bXNjmlqfZsjlfl1mkAqKz1dg+mMX28OTqw==} cpu: [wasm32] @@ -19663,6 +19763,15 @@ packages: '@napi-rs/wasm-runtime': 1.0.7 optional: true + /@rspack/binding-wasm32-wasi@1.6.0-beta.1: + resolution: {integrity: sha512-PaKEjXOkYprSFlgdgVm/P3pv2E8nAQx9WSGgPmMVIAtxo3Cyz0wwFf0f1Bp9wCw0KkIWgi+9lz8oXNkgKZilug==} + cpu: [wasm32] + requiresBuild: true + dependencies: + '@napi-rs/wasm-runtime': 1.0.7 + dev: true + optional: true + /@rspack/binding-win32-arm64-msvc@0.7.5: resolution: {integrity: sha512-nEF4cUdLfgEK6FrgJSJhUlr2/7LY1tmqBNQCFsCjtDtUkQbJIEo1b8edT94G9tJcQoFE4cD+Re30yBYbQO2Thg==} cpu: [arm64] @@ -19738,6 +19847,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-win32-arm64-msvc@1.6.0-beta.1: + resolution: {integrity: sha512-HWz9Qxrjf3TKLCwiFPJaqw+STvEsBvFYZvBXZ8umIZXqtdfgQP5d91V8JRG4Gg1J6xnGC/KhZexxBuR/y64aBA==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-win32-ia32-msvc@0.7.5: resolution: {integrity: sha512-hEcHRwJIzpZsePr+5x6V/7TGhrPXhSZYG4sIhsrem1za9W+qqCYYLZ7KzzbRODU07QaAH2RxjcA1bf8F2QDYAQ==} cpu: [ia32] @@ -19813,6 +19930,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-win32-ia32-msvc@1.6.0-beta.1: + resolution: {integrity: sha512-alAZHRuyPzCH3rJpEC9EBE60EZPnQjzltZ6HN8lsCidACMFTzaLBvuzZyYQah+Zm58O22ok2Eon4BpP1Coizgg==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rspack/binding-win32-x64-msvc@0.7.5: resolution: {integrity: sha512-PpVpP6J5/2b4T10hzSUwjLvmdpAOj3ozARl1Nrf/lsbYwhiXivoB8Gvoy/xe/Xpgr732Dk9VCeeW8rreWOOUVQ==} cpu: [x64] @@ -19888,6 +20013,14 @@ packages: requiresBuild: true optional: true + /@rspack/binding-win32-x64-msvc@1.6.0-beta.1: + resolution: {integrity: sha512-/WBzhed0Cu0o9XQ9caGgWwzyNnnPKlENlExa2aGbRCbB14/+CwfhCyETyKlc/ID+dtlV/eHKTC9cckUNI8NpTQ==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rspack/binding@0.7.5: resolution: {integrity: sha512-XcdOvaCz1mWWwr5vmEY9zncdInrjINEh60EWkYdqtCA67v7X7rB1fe6n4BeAI1+YLS2Eacj+lytlr+n7I+DYVg==} optionalDependencies: @@ -20026,6 +20159,21 @@ packages: '@rspack/binding-win32-ia32-msvc': 1.5.8 '@rspack/binding-win32-x64-msvc': 1.5.8 + /@rspack/binding@1.6.0-beta.1: + resolution: {integrity: sha512-r3L60ekkDLM5qoRjCMrqsgwU9SQ5e8oA/Omltu/FEEUspIVHawPvAqNZvAXnGB+FoNxM8YgdRRh12PAwXJww0A==} + optionalDependencies: + '@rspack/binding-darwin-arm64': 1.6.0-beta.1 + '@rspack/binding-darwin-x64': 1.6.0-beta.1 + '@rspack/binding-linux-arm64-gnu': 1.6.0-beta.1 + '@rspack/binding-linux-arm64-musl': 1.6.0-beta.1 + '@rspack/binding-linux-x64-gnu': 1.6.0-beta.1 + '@rspack/binding-linux-x64-musl': 1.6.0-beta.1 + '@rspack/binding-wasm32-wasi': 1.6.0-beta.1 + '@rspack/binding-win32-arm64-msvc': 1.6.0-beta.1 + '@rspack/binding-win32-ia32-msvc': 1.6.0-beta.1 + '@rspack/binding-win32-x64-msvc': 1.6.0-beta.1 + dev: true + /@rspack/core@0.7.5(@swc/helpers@0.5.13): resolution: {integrity: sha512-zVTe4WCyc3qsLPattosiDYZFeOzaJ32/BYukPP2I1VJtCVFa+PxGVRPVZhSoN6fXw5oy48yHg9W9v1T8CaEFhw==} engines: {node: '>=16.0.0'} @@ -20178,6 +20326,21 @@ packages: '@rspack/lite-tapable': 1.0.1 '@swc/helpers': 0.5.17 + /@rspack/core@1.6.0-beta.1(@swc/helpers@0.5.17): + resolution: {integrity: sha512-2ff8XWonPPHyQ6mEWogMspg+Sul3lXZUfNQVrbYSjfNpi8CeDV0/ZtRbHHbAXiy6pz5fvBFL6X+i/ATckjTYBw==} + engines: {node: '>=18.12.0'} + peerDependencies: + '@swc/helpers': '>=0.5.1' + peerDependenciesMeta: + '@swc/helpers': + optional: true + dependencies: + '@module-federation/runtime-tools': 0.21.1 + '@rspack/binding': 1.6.0-beta.1 + '@rspack/lite-tapable': 1.0.1 + '@swc/helpers': 0.5.17 + dev: true + /@rspack/dev-server@1.1.1(@rspack/core@1.3.9)(@types/express@4.17.21)(webpack-cli@5.1.4)(webpack@5.98.0): resolution: {integrity: sha512-9r7vOml2SrFA8cvbcJdSan9wHEo1TPXezF22+s5jvdyAAywg8w7HqDol6TPVv64NUonP1DOdyLxZ+6UW6WZiwg==} engines: {node: '>= 18.12.0'} @@ -20594,6 +20757,24 @@ packages: - supports-color dev: false + /@rstest/core@0.6.5: + resolution: {integrity: sha512-nnJkWso5H4JetdHoK6gBPAcgN727xxrCrTC++5oo42lmmk1HRvHYOtOVi3uCdcNUaESrgjKYF4L5PDpowZUy/A==} + engines: {node: '>=18.12.0'} + hasBin: true + peerDependencies: + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@rsbuild/core': 1.6.0-beta.1 + '@types/chai': 5.2.3 + tinypool: 1.1.1 + dev: true + /@rtsao/scc@1.1.0: resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} dev: true @@ -20839,7 +21020,7 @@ packages: '@octokit/plugin-throttling': 9.4.0(@octokit/core@6.1.4) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) dir-glob: 3.0.1 globby: 14.1.0 http-proxy-agent: 7.0.2 @@ -22286,7 +22467,7 @@ packages: '@swc-node/sourcemap-support': 0.5.1 '@swc/core': 1.7.26(@swc/helpers@0.5.13) colorette: 2.0.20 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) oxc-resolver: 5.2.0 pirates: 4.0.7 tslib: 2.8.1 @@ -22873,6 +23054,13 @@ packages: '@types/node': 18.16.9 dev: true + /@types/chai@5.2.3: + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + dev: true + /@types/chrome@0.0.272: resolution: {integrity: sha512-9cxDmmgyhXV8gsZvlRjqaDizNjIjbV0spsR0fIEaQUoHtbl9D8VkTOLyONgiBKK+guR38x5eMO3E3avUYOXwcQ==} dependencies: @@ -23129,6 +23317,10 @@ packages: '@types/node': 18.16.9 dev: true + /@types/deep-eql@4.0.2: + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + dev: true + /@types/detect-port@1.3.5: resolution: {integrity: sha512-Rf3/lB9WkDfIL9eEKaSYKc+1L/rNVYBjThk22JTqQw0YozXarX8YljFAz+HCoC6h4B4KwCMsBPZHaFezwT4BNA==} dev: true @@ -24584,7 +24776,7 @@ packages: '@verdaccio/loaders': 8.0.0-next-8.6 '@verdaccio/signature': 8.0.0-next-8.7 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) lodash: 4.17.21 verdaccio-htpasswd: 13.0.0-next-8.15 transitivePeerDependencies: @@ -24603,7 +24795,7 @@ packages: dependencies: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) js-yaml: 4.1.0 lodash: 4.17.21 minimatch: 7.4.6 @@ -24637,7 +24829,7 @@ packages: resolution: {integrity: sha512-yuqD8uAZJcgzuNHjV6C438UNT5r2Ai9+SnUlO34AHZdWSYcluO3Zj5R3p5uf+C7YPCE31pUD27wBU74xVbUoBw==} engines: {node: '>=18'} dependencies: - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) lodash: 4.17.21 transitivePeerDependencies: - supports-color @@ -24664,7 +24856,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/logger-prettify': 8.0.0-next-8.2 colorette: 2.0.20 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) transitivePeerDependencies: - supports-color @@ -24695,7 +24887,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/url': 13.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) express: 4.21.2 express-rate-limit: 5.5.1 lodash: 4.17.21 @@ -24713,7 +24905,7 @@ packages: engines: {node: '>=18'} dependencies: '@verdaccio/config': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) jsonwebtoken: 9.0.2 transitivePeerDependencies: - supports-color @@ -24729,7 +24921,7 @@ packages: '@verdaccio/core': 8.0.0-next-8.15 '@verdaccio/url': 13.0.0-next-8.15 '@verdaccio/utils': 8.1.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) gunzip-maybe: 1.4.2 lodash: 4.17.21 tar-stream: 3.1.7 @@ -24745,7 +24937,7 @@ packages: engines: {node: '>=18'} dependencies: '@verdaccio/core': 8.0.0-next-8.15 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) lodash: 4.17.21 validator: 13.12.0 transitivePeerDependencies: @@ -29212,7 +29404,6 @@ packages: /core-js@3.46.0: resolution: {integrity: sha512-vDMm9B0xnqqZ8uSBpZ8sNtRtOdmfShrvT6h2TuQGLs0Is+cR0DYbj/KWP6ALVNbWPpqA/qPLoOuppJN07humpA==} requiresBuild: true - dev: false /core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} @@ -30303,6 +30494,7 @@ packages: dependencies: ms: 2.1.3 supports-color: 8.1.1 + dev: true /debug@4.4.0(supports-color@9.3.1): resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} @@ -30315,7 +30507,6 @@ packages: dependencies: ms: 2.1.3 supports-color: 9.3.1 - dev: true /debug@4.4.1(supports-color@5.5.0): resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} @@ -32431,7 +32622,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) escape-string-regexp: 4.0.0 eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.0 @@ -49044,7 +49235,6 @@ packages: /supports-color@9.3.1: resolution: {integrity: sha512-knBY82pjmnIzK3NifMo3RxEIRD9E0kIzV4BKcyTZ9+9kWgLMxd4PrsTSMoFQUabgRBbF8KOLRDCyKgNV+iK44Q==} engines: {node: '>=12'} - dev: true /supports-hyperlinks@3.2.0: resolution: {integrity: sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==} @@ -49820,7 +50010,6 @@ packages: /tinypool@1.1.1: resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} - dev: false /tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} @@ -50545,7 +50734,7 @@ packages: bundle-require: 4.2.1(esbuild@0.19.2) cac: 6.7.14 chokidar: 3.6.0 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) esbuild: 0.19.2 execa: 5.1.1 globby: 11.1.0 @@ -50587,7 +50776,7 @@ packages: cac: 6.7.14 chokidar: 4.0.1 consola: 3.2.3 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) esbuild: 0.24.0 joycon: 3.1.1 picocolors: 1.1.1 @@ -51515,7 +51704,7 @@ packages: apache-md5: 1.1.8 bcryptjs: 2.4.3 core-js: 3.40.0 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) http-errors: 2.0.0 unix-crypt-td-js: 1.1.4 transitivePeerDependencies: @@ -51546,7 +51735,7 @@ packages: clipanion: 4.0.0-rc.4(typanion@3.14.0) compression: 1.8.0 cors: 2.8.5 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) envinfo: 7.14.0 express: 4.21.2 handlebars: 4.7.8 @@ -51739,7 +51928,7 @@ packages: '@volar/typescript': 2.4.13 '@vue/language-core': 2.2.0(typescript@5.5.2) compare-versions: 6.1.1 - debug: 4.4.0(supports-color@8.1.1) + debug: 4.4.0(supports-color@9.3.1) kolorist: 1.8.0 local-pkg: 1.1.1 magic-string: 0.30.17 From fe7593967dd541b49c928a09a85c37d2a9367807 Mon Sep 17 00:00:00 2001 From: "zhanghang.heal" Date: Mon, 17 Nov 2025 20:39:43 +0800 Subject: [PATCH 4/4] chore: remove vitest --- packages/cli/vitest.config.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 packages/cli/vitest.config.ts diff --git a/packages/cli/vitest.config.ts b/packages/cli/vitest.config.ts deleted file mode 100644 index e5151ad7250..00000000000 --- a/packages/cli/vitest.config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from 'vitest/config'; -import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; -import path from 'path'; - -export default defineConfig({ - define: { - __DEV__: true, - __TEST__: true, - __BROWSER__: false, - __VERSION__: '"unknown"', - }, - plugins: [nxViteTsPaths()], - test: { - environment: 'node', - include: [path.resolve(__dirname, '__tests__/**.test.ts')], - globals: true, - testTimeout: 10000, - }, -});