From 5f8c6fd87b2ef2e81916ed87651c047e93aa7062 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 17:19:54 +0900 Subject: [PATCH 1/8] fix(ssr): hoist export to handle cyclic import better --- .../node/ssr/__tests__/ssrTransform.spec.ts | 88 +++++++++---------- .../__tests__/fixtures/cyclic2/README.md | 9 ++ .../__tests__/fixtures/cyclic2/package.json | 3 + .../__tests__/fixtures/cyclic2/test1/dep1.js | 1 + .../__tests__/fixtures/cyclic2/test1/dep2.js | 2 + .../__tests__/fixtures/cyclic2/test1/entry.js | 1 + .../__tests__/fixtures/cyclic2/test1/index.js | 5 ++ .../__tests__/fixtures/cyclic2/test2/dep1.js | 1 + .../__tests__/fixtures/cyclic2/test2/dep2.js | 2 + .../__tests__/fixtures/cyclic2/test2/entry.js | 1 + .../__tests__/fixtures/cyclic2/test2/index.js | 2 + .../__tests__/fixtures/cyclic2/test3/dep1.js | 1 + .../__tests__/fixtures/cyclic2/test3/dep2.js | 2 + .../__tests__/fixtures/cyclic2/test3/entry.js | 1 + .../__tests__/fixtures/cyclic2/test3/index.js | 4 + .../__tests__/fixtures/cyclic2/test4/dep1.js | 1 + .../__tests__/fixtures/cyclic2/test4/dep2.js | 2 + .../__tests__/fixtures/cyclic2/test4/entry.js | 1 + .../__tests__/fixtures/cyclic2/test4/index.js | 2 + .../__tests__/fixtures/cyclic2/test5/dep1.js | 1 + .../__tests__/fixtures/cyclic2/test5/dep2.js | 2 + .../__tests__/fixtures/cyclic2/test5/entry.js | 1 + .../__tests__/fixtures/cyclic2/test5/index.js | 5 ++ .../runtime/__tests__/server-runtime.spec.ts | 24 +++++ packages/vite/src/node/ssr/ssrTransform.ts | 8 +- pnpm-lock.yaml | 2 + 26 files changed, 124 insertions(+), 48 deletions(-) create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/README.md create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/package.json create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep1.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep2.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/index.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep1.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep2.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/index.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep1.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep2.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/index.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep1.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep2.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/index.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep1.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep2.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js create mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/index.js diff --git a/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts b/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts index e8570c6d4afedf..e73e47200ee78f 100644 --- a/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts +++ b/packages/vite/src/node/ssr/__tests__/ssrTransform.spec.ts @@ -56,25 +56,25 @@ test('namespace import', async () => { test('export function declaration', async () => { expect(await ssrTransformSimpleCode(`export function foo() {}`)) .toMatchInlineSnapshot(` - "function foo() {} - Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return foo }});" + "Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return foo }}); + function foo() {}" `) }) test('export class declaration', async () => { expect(await ssrTransformSimpleCode(`export class foo {}`)) .toMatchInlineSnapshot(` - "class foo {} - Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return foo }});" + "Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return foo }}); + class foo {}" `) }) test('export var declaration', async () => { expect(await ssrTransformSimpleCode(`export const a = 1, b = 2`)) .toMatchInlineSnapshot(` - "const a = 1, b = 2 - Object.defineProperty(__vite_ssr_exports__, "a", { enumerable: true, configurable: true, get(){ return a }}); - Object.defineProperty(__vite_ssr_exports__, "b", { enumerable: true, configurable: true, get(){ return b }});" + "Object.defineProperty(__vite_ssr_exports__, "a", { enumerable: true, configurable: true, get(){ return a }}); + Object.defineProperty(__vite_ssr_exports__, "b", { enumerable: true, configurable: true, get(){ return b }}); + const a = 1, b = 2" `) }) @@ -82,9 +82,9 @@ test('export named', async () => { expect( await ssrTransformSimpleCode(`const a = 1, b = 2; export { a, b as c }`), ).toMatchInlineSnapshot(` - "const a = 1, b = 2; - Object.defineProperty(__vite_ssr_exports__, "a", { enumerable: true, configurable: true, get(){ return a }}); - Object.defineProperty(__vite_ssr_exports__, "c", { enumerable: true, configurable: true, get(){ return b }});" + "Object.defineProperty(__vite_ssr_exports__, "a", { enumerable: true, configurable: true, get(){ return a }}); + Object.defineProperty(__vite_ssr_exports__, "c", { enumerable: true, configurable: true, get(){ return b }}); + const a = 1, b = 2; " `) }) @@ -92,10 +92,10 @@ test('export named from', async () => { expect( await ssrTransformSimpleCode(`export { ref, computed as c } from 'vue'`), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["ref","computed"]}); - - Object.defineProperty(__vite_ssr_exports__, "ref", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.ref }}); - Object.defineProperty(__vite_ssr_exports__, "c", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.computed }});" + "Object.defineProperty(__vite_ssr_exports__, "ref", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.ref }}); + Object.defineProperty(__vite_ssr_exports__, "c", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.computed }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["ref","computed"]}); + " `) }) @@ -105,9 +105,9 @@ test('named exports of imported binding', async () => { `import {createApp} from 'vue';export {createApp}`, ), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["createApp"]}); - - Object.defineProperty(__vite_ssr_exports__, "createApp", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.createApp }});" + "Object.defineProperty(__vite_ssr_exports__, "createApp", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__.createApp }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["createApp"]}); + " `) }) @@ -129,9 +129,9 @@ test('export * from', async () => { test('export * as from', async () => { expect(await ssrTransformSimpleCode(`export * as foo from 'vue'`)) .toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("vue"); - - Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__ }});" + "Object.defineProperty(__vite_ssr_exports__, "foo", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__ }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("vue"); + " `) }) @@ -139,9 +139,9 @@ test('export * as from arbitrary module namespace identifier', async () => { expect( await ssrTransformSimpleCode(`export * as "arbitrary string" from 'vue'`), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("vue"); - - Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__ }});" + "Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__ }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("vue"); + " `) }) @@ -151,8 +151,8 @@ test('export as arbitrary module namespace identifier', async () => { `const something = "Something";export { something as "arbitrary string" };`, ), ).toMatchInlineSnapshot(` - "const something = "Something"; - Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return something }});" + "Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return something }}); + const something = "Something";" `) }) @@ -162,9 +162,9 @@ test('export as from arbitrary module namespace identifier', async () => { `export { "arbitrary string2" as "arbitrary string" } from 'vue';`, ), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["arbitrary string2"]}); - - Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__["arbitrary string2"] }});" + "Object.defineProperty(__vite_ssr_exports__, "arbitrary string", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_0__["arbitrary string2"] }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("vue", {"importedNames":["arbitrary string2"]}); + " `) }) @@ -209,8 +209,8 @@ test('dynamic import', async () => { `export const i = () => import('./foo')`, ) expect(result?.code).toMatchInlineSnapshot(` - "const i = () => __vite_ssr_dynamic_import__('./foo') - Object.defineProperty(__vite_ssr_exports__, "i", { enumerable: true, configurable: true, get(){ return i }});" + "Object.defineProperty(__vite_ssr_exports__, "i", { enumerable: true, configurable: true, get(){ return i }}); + const i = () => __vite_ssr_dynamic_import__('./foo')" `) expect(result?.deps).toEqual([]) expect(result?.dynamicDeps).toEqual(['./foo']) @@ -382,11 +382,11 @@ test('should declare variable for imported super class', async () => { `export class B extends Foo {}`, ), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("./dependency", {"importedNames":["Foo"]}); + "Object.defineProperty(__vite_ssr_exports__, "B", { enumerable: true, configurable: true, get(){ return B }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("./dependency", {"importedNames":["Foo"]}); const Foo = __vite_ssr_import_0__.Foo; class A extends Foo {}; class B extends Foo {} - Object.defineProperty(__vite_ssr_exports__, "B", { enumerable: true, configurable: true, get(){ return B }}); Object.defineProperty(__vite_ssr_exports__, "default", { enumerable: true, configurable: true, value: A });" `) }) @@ -422,9 +422,9 @@ test('should handle default export variants', async () => { `export default class A {}\n` + `export class B extends A {}`, ), ).toMatchInlineSnapshot(` - "class A {}; + "Object.defineProperty(__vite_ssr_exports__, "B", { enumerable: true, configurable: true, get(){ return B }}); + class A {}; class B extends A {} - Object.defineProperty(__vite_ssr_exports__, "B", { enumerable: true, configurable: true, get(){ return B }}); Object.defineProperty(__vite_ssr_exports__, "default", { enumerable: true, configurable: true, value: A });" `) }) @@ -875,12 +875,12 @@ export function fn1() { `, ), ).toMatchInlineSnapshot(` - " + "Object.defineProperty(__vite_ssr_exports__, "fn1", { enumerable: true, configurable: true, get(){ return fn1 }}); + Object.defineProperty(__vite_ssr_exports__, "fn2", { enumerable: true, configurable: true, get(){ return fn2 }}); + function fn1() { + };function fn2() { } - Object.defineProperty(__vite_ssr_exports__, "fn1", { enumerable: true, configurable: true, get(){ return fn1 }});;function fn2() { - } - Object.defineProperty(__vite_ssr_exports__, "fn2", { enumerable: true, configurable: true, get(){ return fn2 }}); " `) }) @@ -981,7 +981,8 @@ export class Test { };`.trim() expect(await ssrTransformSimpleCode(code)).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("foobar", {"importedNames":["foo","bar"]}); + "Object.defineProperty(__vite_ssr_exports__, "Test", { enumerable: true, configurable: true, get(){ return Test }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("foobar", {"importedNames":["foo","bar"]}); if (false) { const foo = 'foo'; @@ -1006,8 +1007,7 @@ export class Test { console.log((0,__vite_ssr_import_0__.bar)) } } - } - Object.defineProperty(__vite_ssr_exports__, "Test", { enumerable: true, configurable: true, get(){ return Test }});;;" + };;" `) }) @@ -1180,13 +1180,13 @@ export * as bar from './bar' console.log(bar) `), ).toMatchInlineSnapshot(` - "const __vite_ssr_import_0__ = await __vite_ssr_import__("./foo", {"importedNames":["foo"]}); + "Object.defineProperty(__vite_ssr_exports__, "bar", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_1__ }}); + const __vite_ssr_import_0__ = await __vite_ssr_import__("./foo", {"importedNames":["foo"]}); __vite_ssr_exports__.default = (0,__vite_ssr_import_0__.foo)(); const __vite_ssr_import_1__ = await __vite_ssr_import__("./bar"); - - Object.defineProperty(__vite_ssr_exports__, "bar", { enumerable: true, configurable: true, get(){ return __vite_ssr_import_1__ }});; + ; console.log(bar) " `) diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/README.md b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/README.md new file mode 100644 index 00000000000000..42cebdf4ea801d --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/README.md @@ -0,0 +1,9 @@ +Cyclic import example based on https://github.com/vitejs/vite/issues/14048#issuecomment-2354774156 + +```mermaid +flowchart TD + B(dep1.js) -->|dep1| A(index.js) + A -->|dep1| C(dep2.js) + C -->|dep2| A + A -->|dep1, dep2| entry.js +``` diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/package.json b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/package.json new file mode 100644 index 00000000000000..3dbc1ca591c055 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep1.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep1.js new file mode 100644 index 00000000000000..052c10ef6e602c --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep1.js @@ -0,0 +1 @@ +export const dep1 = { ok: true }; diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep2.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep2.js new file mode 100644 index 00000000000000..be498e991723fb --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/dep2.js @@ -0,0 +1,2 @@ +import { dep1 } from "./index.js" +export const dep2 = { ok: dep1.ok } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js new file mode 100644 index 00000000000000..28f08f86fec791 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js @@ -0,0 +1 @@ +export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/index.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/index.js new file mode 100644 index 00000000000000..49fa0342503c71 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/index.js @@ -0,0 +1,5 @@ +import { dep1 } from './dep1.js' +export { dep1 } + +import { dep2 } from './dep2.js' +export { dep2 } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep1.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep1.js new file mode 100644 index 00000000000000..052c10ef6e602c --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep1.js @@ -0,0 +1 @@ +export const dep1 = { ok: true }; diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep2.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep2.js new file mode 100644 index 00000000000000..be498e991723fb --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/dep2.js @@ -0,0 +1,2 @@ +import { dep1 } from "./index.js" +export const dep2 = { ok: dep1.ok } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js new file mode 100644 index 00000000000000..28f08f86fec791 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js @@ -0,0 +1 @@ +export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/index.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/index.js new file mode 100644 index 00000000000000..49f8047b941b02 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/index.js @@ -0,0 +1,2 @@ +export { dep1 } from './dep1.js' +export { dep2 } from "./dep2.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep1.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep1.js new file mode 100644 index 00000000000000..052c10ef6e602c --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep1.js @@ -0,0 +1 @@ +export const dep1 = { ok: true }; diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep2.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep2.js new file mode 100644 index 00000000000000..be498e991723fb --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/dep2.js @@ -0,0 +1,2 @@ +import { dep1 } from "./index.js" +export const dep2 = { ok: dep1.ok } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js new file mode 100644 index 00000000000000..28f08f86fec791 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js @@ -0,0 +1 @@ +export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/index.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/index.js new file mode 100644 index 00000000000000..e032a766eab42d --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/index.js @@ -0,0 +1,4 @@ +import { dep1 } from './dep1.js' +import { dep2 } from './dep2.js' +export { dep1 } +export { dep2 } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep1.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep1.js new file mode 100644 index 00000000000000..052c10ef6e602c --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep1.js @@ -0,0 +1 @@ +export const dep1 = { ok: true }; diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep2.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep2.js new file mode 100644 index 00000000000000..be498e991723fb --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/dep2.js @@ -0,0 +1,2 @@ +import { dep1 } from "./index.js" +export const dep2 = { ok: dep1.ok } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js new file mode 100644 index 00000000000000..28f08f86fec791 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js @@ -0,0 +1 @@ +export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/index.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/index.js new file mode 100644 index 00000000000000..bcbfe36b7660f7 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/index.js @@ -0,0 +1,2 @@ +export * from './dep1.js' +export * from './dep2.js' diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep1.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep1.js new file mode 100644 index 00000000000000..052c10ef6e602c --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep1.js @@ -0,0 +1 @@ +export const dep1 = { ok: true }; diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep2.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep2.js new file mode 100644 index 00000000000000..be498e991723fb --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/dep2.js @@ -0,0 +1,2 @@ +import { dep1 } from "./index.js" +export const dep2 = { ok: dep1.ok } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js new file mode 100644 index 00000000000000..28f08f86fec791 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js @@ -0,0 +1 @@ +export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/index.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/index.js new file mode 100644 index 00000000000000..f748a394a7eb77 --- /dev/null +++ b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/index.js @@ -0,0 +1,5 @@ +import { dep2 } from './dep2.js' +export { dep2 } + +import { dep1 } from './dep1.js' +export { dep1 } diff --git a/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts b/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts index 4c47558c210517..ed9d88eba7b1f1 100644 --- a/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts +++ b/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts @@ -232,6 +232,30 @@ describe('module runner initialization', async () => { const mod = await runner.import('/fixtures/no-this/importer.js') expect(mod.result).toBe(undefined) }) + + it.for([ + ['/fixtures/cyclic2/test1/index.js', true], + ['/fixtures/cyclic2/test2/index.js', true], + ['/fixtures/cyclic2/test3/index.js', true], + ['/fixtures/cyclic2/test4/index.js', true], + ['/fixtures/cyclic2/test5/index.js', false], + ] as const)(`cyclic %s`, async ([entry, ok], { runner }) => { + if (ok) { + const mod = await runner.import(entry) + expect({ ...mod }).toEqual({ + dep1: { + ok: true, + }, + dep2: { + ok: true, + }, + }) + } else { + await expect(() => runner.import(entry)).rejects.toMatchObject({ + name: 'ReferenceError', + }) + } + }) }) describe('optimize-deps', async () => { diff --git a/packages/vite/src/node/ssr/ssrTransform.ts b/packages/vite/src/node/ssr/ssrTransform.ts index c4552f73229663..9d5a1a64482107 100644 --- a/packages/vite/src/node/ssr/ssrTransform.ts +++ b/packages/vite/src/node/ssr/ssrTransform.ts @@ -157,11 +157,11 @@ async function ssrTransformScript( return importId } - function defineExport(position: number, name: string, local = name) { + function defineExport(_position: number, name: string, local = name) { s.appendLeft( - position, - `\nObject.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, ` + - `{ enumerable: true, configurable: true, get(){ return ${local} }});`, + fileStartIndex, + `Object.defineProperty(${ssrModuleExportsKey}, ${JSON.stringify(name)}, ` + + `{ enumerable: true, configurable: true, get(){ return ${local} }});\n`, ) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90a196a6eecbcb..c722ba18e08fdf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -464,6 +464,8 @@ importers: packages/vite/src/node/ssr/runtime/__tests__/fixtures/cjs-external: {} + packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2: {} + packages/vite/src/node/ssr/runtime/__tests__/fixtures/esm-external: {} playground: From b53797699d3528b4969114be08d87ebcc4ab7a1e Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 17:44:40 +0900 Subject: [PATCH 2/8] chore: remove override temporarily --- package.json | 2 +- pnpm-lock.yaml | 345 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 326 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 5c6b56f534b09f..54788f8b9128b5 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ }, "packageManager": "pnpm@9.15.0", "pnpm": { - "overrides": { + "x-overrides": { "vite": "workspace:*" }, "patchedDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c722ba18e08fdf..9405671aa1cd8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,9 +4,6 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false -overrides: - vite: workspace:* - packageExtensionsChecksum: 632c5477927702fb9badd3e595784820 patchedDependencies: @@ -134,7 +131,7 @@ importers: version: link:packages/vite vitest: specifier: ^2.1.8 - version: 2.1.8(@types/node@22.10.2) + version: 2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) docs: devDependencies: @@ -149,7 +146,7 @@ importers: version: 4.2.2 vitepress: specifier: ^1.5.0 - version: 1.5.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(axios@1.7.9)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) + version: 1.5.0(@algolia/client-search@5.13.0)(@types/node@22.10.2)(@types/react@18.3.17)(axios@1.7.9)(less@4.2.1)(lightningcss@1.28.2)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)(typescript@5.6.3) vitepress-plugin-group-icons: specifier: ^1.3.1 version: 1.3.1 @@ -2304,6 +2301,12 @@ packages: search-insights: optional: true + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.23.1': resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} engines: {node: '>=18'} @@ -2316,6 +2319,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.23.1': resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} engines: {node: '>=18'} @@ -2328,6 +2337,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.23.1': resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} engines: {node: '>=18'} @@ -2340,6 +2355,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.23.1': resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} engines: {node: '>=18'} @@ -2352,6 +2373,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.23.1': resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} engines: {node: '>=18'} @@ -2364,6 +2391,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.23.1': resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} engines: {node: '>=18'} @@ -2376,6 +2409,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.23.1': resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} engines: {node: '>=18'} @@ -2388,6 +2427,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.23.1': resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} engines: {node: '>=18'} @@ -2400,6 +2445,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.23.1': resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} engines: {node: '>=18'} @@ -2412,6 +2463,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.23.1': resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} engines: {node: '>=18'} @@ -2424,6 +2481,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.23.1': resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} engines: {node: '>=18'} @@ -2436,6 +2499,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.23.1': resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} engines: {node: '>=18'} @@ -2448,6 +2517,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.23.1': resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} engines: {node: '>=18'} @@ -2460,6 +2535,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.23.1': resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} engines: {node: '>=18'} @@ -2472,6 +2553,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.23.1': resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} engines: {node: '>=18'} @@ -2484,6 +2571,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.23.1': resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} engines: {node: '>=18'} @@ -2496,6 +2589,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.23.1': resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} engines: {node: '>=18'} @@ -2508,6 +2607,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.23.1': resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} engines: {node: '>=18'} @@ -2532,6 +2637,12 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.23.1': resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} engines: {node: '>=18'} @@ -2544,6 +2655,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.23.1': resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} engines: {node: '>=18'} @@ -2556,6 +2673,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.23.1': resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} engines: {node: '>=18'} @@ -2568,6 +2691,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.23.1': resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} engines: {node: '>=18'} @@ -2580,6 +2709,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.23.1': resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} engines: {node: '>=18'} @@ -3231,7 +3366,7 @@ packages: resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: workspace:* + vite: ^5.0.0 vue: ^3.2.25 '@vitejs/release-scripts@1.3.2': @@ -3500,7 +3635,7 @@ packages: resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==} peerDependencies: msw: ^2.4.9 - vite: workspace:* + vite: ^5.0.0 peerDependenciesMeta: msw: optional: true @@ -4422,6 +4557,11 @@ packages: resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} engines: {node: '>=0.12'} + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + esbuild@0.23.1: resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} engines: {node: '>=18'} @@ -7025,6 +7165,37 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite@5.4.11: + resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + vitepress-plugin-group-icons@1.3.1: resolution: {integrity: sha512-KHw3vaSqobjePKGWVRchd3PIG9wKrfA9U43yFLp2hTxXxUOIJdTb+e/qj0dEQYGYbwdXFBeErPVYHYNVBDSqow==} @@ -8043,108 +8214,162 @@ snapshots: transitivePeerDependencies: - '@algolia/client-search' + '@esbuild/aix-ppc64@0.21.5': + optional: true + '@esbuild/aix-ppc64@0.23.1': optional: true '@esbuild/aix-ppc64@0.24.0': optional: true + '@esbuild/android-arm64@0.21.5': + optional: true + '@esbuild/android-arm64@0.23.1': optional: true '@esbuild/android-arm64@0.24.0': optional: true + '@esbuild/android-arm@0.21.5': + optional: true + '@esbuild/android-arm@0.23.1': optional: true '@esbuild/android-arm@0.24.0': optional: true + '@esbuild/android-x64@0.21.5': + optional: true + '@esbuild/android-x64@0.23.1': optional: true '@esbuild/android-x64@0.24.0': optional: true + '@esbuild/darwin-arm64@0.21.5': + optional: true + '@esbuild/darwin-arm64@0.23.1': optional: true '@esbuild/darwin-arm64@0.24.0': optional: true + '@esbuild/darwin-x64@0.21.5': + optional: true + '@esbuild/darwin-x64@0.23.1': optional: true '@esbuild/darwin-x64@0.24.0': optional: true + '@esbuild/freebsd-arm64@0.21.5': + optional: true + '@esbuild/freebsd-arm64@0.23.1': optional: true '@esbuild/freebsd-arm64@0.24.0': optional: true + '@esbuild/freebsd-x64@0.21.5': + optional: true + '@esbuild/freebsd-x64@0.23.1': optional: true '@esbuild/freebsd-x64@0.24.0': optional: true + '@esbuild/linux-arm64@0.21.5': + optional: true + '@esbuild/linux-arm64@0.23.1': optional: true '@esbuild/linux-arm64@0.24.0': optional: true + '@esbuild/linux-arm@0.21.5': + optional: true + '@esbuild/linux-arm@0.23.1': optional: true '@esbuild/linux-arm@0.24.0': optional: true + '@esbuild/linux-ia32@0.21.5': + optional: true + '@esbuild/linux-ia32@0.23.1': optional: true '@esbuild/linux-ia32@0.24.0': optional: true + '@esbuild/linux-loong64@0.21.5': + optional: true + '@esbuild/linux-loong64@0.23.1': optional: true '@esbuild/linux-loong64@0.24.0': optional: true + '@esbuild/linux-mips64el@0.21.5': + optional: true + '@esbuild/linux-mips64el@0.23.1': optional: true '@esbuild/linux-mips64el@0.24.0': optional: true + '@esbuild/linux-ppc64@0.21.5': + optional: true + '@esbuild/linux-ppc64@0.23.1': optional: true '@esbuild/linux-ppc64@0.24.0': optional: true + '@esbuild/linux-riscv64@0.21.5': + optional: true + '@esbuild/linux-riscv64@0.23.1': optional: true '@esbuild/linux-riscv64@0.24.0': optional: true + '@esbuild/linux-s390x@0.21.5': + optional: true + '@esbuild/linux-s390x@0.23.1': optional: true '@esbuild/linux-s390x@0.24.0': optional: true + '@esbuild/linux-x64@0.21.5': + optional: true + '@esbuild/linux-x64@0.23.1': optional: true '@esbuild/linux-x64@0.24.0': optional: true + '@esbuild/netbsd-x64@0.21.5': + optional: true + '@esbuild/netbsd-x64@0.23.1': optional: true @@ -8157,30 +8382,45 @@ snapshots: '@esbuild/openbsd-arm64@0.24.0': optional: true + '@esbuild/openbsd-x64@0.21.5': + optional: true + '@esbuild/openbsd-x64@0.23.1': optional: true '@esbuild/openbsd-x64@0.24.0': optional: true + '@esbuild/sunos-x64@0.21.5': + optional: true + '@esbuild/sunos-x64@0.23.1': optional: true '@esbuild/sunos-x64@0.24.0': optional: true + '@esbuild/win32-arm64@0.21.5': + optional: true + '@esbuild/win32-arm64@0.23.1': optional: true '@esbuild/win32-arm64@0.24.0': optional: true + '@esbuild/win32-ia32@0.21.5': + optional: true + '@esbuild/win32-ia32@0.23.1': optional: true '@esbuild/win32-ia32@0.24.0': optional: true + '@esbuild/win32-x64@0.21.5': + optional: true + '@esbuild/win32-x64@0.23.1': optional: true @@ -8863,9 +9103,9 @@ snapshots: '@vitejs/longfilename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@file:playground/optimize-deps/longfilename': {} - '@vitejs/plugin-vue@5.1.4(vite@packages+vite)(vue@3.5.13(typescript@5.6.3))': + '@vitejs/plugin-vue@5.1.4(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))(vue@3.5.13(typescript@5.6.3))': dependencies: - vite: link:packages/vite + vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) vue: 3.5.13(typescript@5.6.3) '@vitejs/release-scripts@1.3.2': @@ -9084,13 +9324,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.8(vite@packages+vite)': + '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))': dependencies: '@vitest/spy': 2.1.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: link:packages/vite + vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) '@vitest/pretty-format@2.1.8': dependencies: @@ -10057,6 +10297,32 @@ snapshots: d: 1.0.2 ext: 1.7.0 + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + esbuild@0.23.1: optionalDependencies: '@esbuild/aix-ppc64': 0.23.1 @@ -12918,15 +13184,39 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.8: + vite-node@2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: link:packages/vite + vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser + + vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.4.49 + rollup: 4.28.1 + optionalDependencies: + '@types/node': 22.10.2 + fsevents: 2.3.3 + less: 4.2.1 + lightningcss: 1.28.2 + sass: 1.83.0 + sass-embedded: 1.83.0(source-map-js@1.2.1) + stylus: 0.64.0 + sugarss: 5.0.0(postcss@8.4.49) + terser: 5.37.0 vitepress-plugin-group-icons@1.3.1: dependencies: @@ -12936,7 +13226,7 @@ snapshots: transitivePeerDependencies: - supports-color - vitepress@1.5.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(axios@1.7.9)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): + vitepress@1.5.0(@algolia/client-search@5.13.0)(@types/node@22.10.2)(@types/react@18.3.17)(axios@1.7.9)(less@4.2.1)(lightningcss@1.28.2)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)(typescript@5.6.3): dependencies: '@docsearch/css': 3.7.0 '@docsearch/js': 3.7.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -12945,7 +13235,7 @@ snapshots: '@shikijs/transformers': 1.22.2 '@shikijs/types': 1.24.2 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.1.4(vite@packages+vite)(vue@3.5.13(typescript@5.6.3)) + '@vitejs/plugin-vue': 5.1.4(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))(vue@3.5.13(typescript@5.6.3)) '@vue/devtools-api': 7.6.3 '@vue/shared': 3.5.13 '@vueuse/core': 11.2.0(vue@3.5.13(typescript@5.6.3)) @@ -12954,12 +13244,13 @@ snapshots: mark.js: 8.11.1 minisearch: 7.1.0 shiki: 1.24.2 - vite: link:packages/vite + vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) vue: 3.5.13(typescript@5.6.3) optionalDependencies: postcss: 8.4.49 transitivePeerDependencies: - '@algolia/client-search' + - '@types/node' - '@types/react' - '@vue/composition-api' - async-validator @@ -12969,19 +13260,26 @@ snapshots: - fuse.js - idb-keyval - jwt-decode + - less + - lightningcss - nprogress - qrcode - react - react-dom + - sass + - sass-embedded - search-insights - sortablejs + - stylus + - sugarss + - terser - typescript - universal-cookie - vitest@2.1.8(@types/node@22.10.2): + vitest@2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): dependencies: '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@packages+vite) + '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.8 '@vitest/snapshot': 2.1.8 @@ -12997,14 +13295,21 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: link:packages/vite - vite-node: 2.1.8 + vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite-node: 2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.2 transitivePeerDependencies: + - less + - lightningcss - msw + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser void-elements@3.1.0: {} From 3cc86da670e0c357c6cf21c1dcb445a61e5a62e5 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 18:08:45 +0900 Subject: [PATCH 3/8] wip: forget this one too for now --- playground/hmr-ssr/__tests__/hmr-ssr.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts index d41ca3c196555b..cc56724dc1a957 100644 --- a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts +++ b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts @@ -844,7 +844,7 @@ if (!isBuild) { await untilUpdated(() => hmr('.optional-chaining')?.toString(), '2') }) - test('hmr works for self-accepted module within circular imported files', async () => { + test.skip('hmr works for self-accepted module within circular imported files', async () => { await setupModuleRunner('/self-accept-within-circular/index') const el = () => hmr('.self-accept-within-circular') expect(el()).toBe('c') From ed79e4d8740c952d818f672cfacb033e9df6228f Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 18:39:29 +0900 Subject: [PATCH 4/8] wip: workaround cyclic import --- package.json | 2 +- pnpm-lock.yaml | 345 +++-------------------------------------------- vitest.config.ts | 6 +- 3 files changed, 26 insertions(+), 327 deletions(-) diff --git a/package.json b/package.json index 54788f8b9128b5..5c6b56f534b09f 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ }, "packageManager": "pnpm@9.15.0", "pnpm": { - "x-overrides": { + "overrides": { "vite": "workspace:*" }, "patchedDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9405671aa1cd8a..c722ba18e08fdf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,9 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false +overrides: + vite: workspace:* + packageExtensionsChecksum: 632c5477927702fb9badd3e595784820 patchedDependencies: @@ -131,7 +134,7 @@ importers: version: link:packages/vite vitest: specifier: ^2.1.8 - version: 2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + version: 2.1.8(@types/node@22.10.2) docs: devDependencies: @@ -146,7 +149,7 @@ importers: version: 4.2.2 vitepress: specifier: ^1.5.0 - version: 1.5.0(@algolia/client-search@5.13.0)(@types/node@22.10.2)(@types/react@18.3.17)(axios@1.7.9)(less@4.2.1)(lightningcss@1.28.2)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)(typescript@5.6.3) + version: 1.5.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(axios@1.7.9)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) vitepress-plugin-group-icons: specifier: ^1.3.1 version: 1.3.1 @@ -2301,12 +2304,6 @@ packages: search-insights: optional: true - '@esbuild/aix-ppc64@0.21.5': - resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - '@esbuild/aix-ppc64@0.23.1': resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} engines: {node: '>=18'} @@ -2319,12 +2316,6 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.21.5': - resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm64@0.23.1': resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} engines: {node: '>=18'} @@ -2337,12 +2328,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm@0.21.5': - resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - '@esbuild/android-arm@0.23.1': resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} engines: {node: '>=18'} @@ -2355,12 +2340,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-x64@0.21.5': - resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - '@esbuild/android-x64@0.23.1': resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} engines: {node: '>=18'} @@ -2373,12 +2352,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.21.5': - resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-arm64@0.23.1': resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} engines: {node: '>=18'} @@ -2391,12 +2364,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.21.5': - resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - '@esbuild/darwin-x64@0.23.1': resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} engines: {node: '>=18'} @@ -2409,12 +2376,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.21.5': - resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-arm64@0.23.1': resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} engines: {node: '>=18'} @@ -2427,12 +2388,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.21.5': - resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - '@esbuild/freebsd-x64@0.23.1': resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} engines: {node: '>=18'} @@ -2445,12 +2400,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.21.5': - resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm64@0.23.1': resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} engines: {node: '>=18'} @@ -2463,12 +2412,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - '@esbuild/linux-arm@0.23.1': resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} engines: {node: '>=18'} @@ -2481,12 +2424,6 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.21.5': - resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - '@esbuild/linux-ia32@0.23.1': resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} engines: {node: '>=18'} @@ -2499,12 +2436,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.21.5': - resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-loong64@0.23.1': resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} engines: {node: '>=18'} @@ -2517,12 +2448,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.21.5': - resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-mips64el@0.23.1': resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} engines: {node: '>=18'} @@ -2535,12 +2460,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.21.5': - resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-ppc64@0.23.1': resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} engines: {node: '>=18'} @@ -2553,12 +2472,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.21.5': - resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-riscv64@0.23.1': resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} engines: {node: '>=18'} @@ -2571,12 +2484,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.21.5': - resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-s390x@0.23.1': resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} engines: {node: '>=18'} @@ -2589,12 +2496,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.21.5': - resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - '@esbuild/linux-x64@0.23.1': resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} engines: {node: '>=18'} @@ -2607,12 +2508,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.21.5': - resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - '@esbuild/netbsd-x64@0.23.1': resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} engines: {node: '>=18'} @@ -2637,12 +2532,6 @@ packages: cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.21.5': - resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - '@esbuild/openbsd-x64@0.23.1': resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} engines: {node: '>=18'} @@ -2655,12 +2544,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.21.5': - resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - '@esbuild/sunos-x64@0.23.1': resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} engines: {node: '>=18'} @@ -2673,12 +2556,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.21.5': - resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-arm64@0.23.1': resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} engines: {node: '>=18'} @@ -2691,12 +2568,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.21.5': - resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-ia32@0.23.1': resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} engines: {node: '>=18'} @@ -2709,12 +2580,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.21.5': - resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - '@esbuild/win32-x64@0.23.1': resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} engines: {node: '>=18'} @@ -3366,7 +3231,7 @@ packages: resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: - vite: ^5.0.0 + vite: workspace:* vue: ^3.2.25 '@vitejs/release-scripts@1.3.2': @@ -3635,7 +3500,7 @@ packages: resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==} peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 + vite: workspace:* peerDependenciesMeta: msw: optional: true @@ -4557,11 +4422,6 @@ packages: resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} engines: {node: '>=0.12'} - esbuild@0.21.5: - resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} - engines: {node: '>=12'} - hasBin: true - esbuild@0.23.1: resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} engines: {node: '>=18'} @@ -7165,37 +7025,6 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.4.11: - resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - vitepress-plugin-group-icons@1.3.1: resolution: {integrity: sha512-KHw3vaSqobjePKGWVRchd3PIG9wKrfA9U43yFLp2hTxXxUOIJdTb+e/qj0dEQYGYbwdXFBeErPVYHYNVBDSqow==} @@ -8214,162 +8043,108 @@ snapshots: transitivePeerDependencies: - '@algolia/client-search' - '@esbuild/aix-ppc64@0.21.5': - optional: true - '@esbuild/aix-ppc64@0.23.1': optional: true '@esbuild/aix-ppc64@0.24.0': optional: true - '@esbuild/android-arm64@0.21.5': - optional: true - '@esbuild/android-arm64@0.23.1': optional: true '@esbuild/android-arm64@0.24.0': optional: true - '@esbuild/android-arm@0.21.5': - optional: true - '@esbuild/android-arm@0.23.1': optional: true '@esbuild/android-arm@0.24.0': optional: true - '@esbuild/android-x64@0.21.5': - optional: true - '@esbuild/android-x64@0.23.1': optional: true '@esbuild/android-x64@0.24.0': optional: true - '@esbuild/darwin-arm64@0.21.5': - optional: true - '@esbuild/darwin-arm64@0.23.1': optional: true '@esbuild/darwin-arm64@0.24.0': optional: true - '@esbuild/darwin-x64@0.21.5': - optional: true - '@esbuild/darwin-x64@0.23.1': optional: true '@esbuild/darwin-x64@0.24.0': optional: true - '@esbuild/freebsd-arm64@0.21.5': - optional: true - '@esbuild/freebsd-arm64@0.23.1': optional: true '@esbuild/freebsd-arm64@0.24.0': optional: true - '@esbuild/freebsd-x64@0.21.5': - optional: true - '@esbuild/freebsd-x64@0.23.1': optional: true '@esbuild/freebsd-x64@0.24.0': optional: true - '@esbuild/linux-arm64@0.21.5': - optional: true - '@esbuild/linux-arm64@0.23.1': optional: true '@esbuild/linux-arm64@0.24.0': optional: true - '@esbuild/linux-arm@0.21.5': - optional: true - '@esbuild/linux-arm@0.23.1': optional: true '@esbuild/linux-arm@0.24.0': optional: true - '@esbuild/linux-ia32@0.21.5': - optional: true - '@esbuild/linux-ia32@0.23.1': optional: true '@esbuild/linux-ia32@0.24.0': optional: true - '@esbuild/linux-loong64@0.21.5': - optional: true - '@esbuild/linux-loong64@0.23.1': optional: true '@esbuild/linux-loong64@0.24.0': optional: true - '@esbuild/linux-mips64el@0.21.5': - optional: true - '@esbuild/linux-mips64el@0.23.1': optional: true '@esbuild/linux-mips64el@0.24.0': optional: true - '@esbuild/linux-ppc64@0.21.5': - optional: true - '@esbuild/linux-ppc64@0.23.1': optional: true '@esbuild/linux-ppc64@0.24.0': optional: true - '@esbuild/linux-riscv64@0.21.5': - optional: true - '@esbuild/linux-riscv64@0.23.1': optional: true '@esbuild/linux-riscv64@0.24.0': optional: true - '@esbuild/linux-s390x@0.21.5': - optional: true - '@esbuild/linux-s390x@0.23.1': optional: true '@esbuild/linux-s390x@0.24.0': optional: true - '@esbuild/linux-x64@0.21.5': - optional: true - '@esbuild/linux-x64@0.23.1': optional: true '@esbuild/linux-x64@0.24.0': optional: true - '@esbuild/netbsd-x64@0.21.5': - optional: true - '@esbuild/netbsd-x64@0.23.1': optional: true @@ -8382,45 +8157,30 @@ snapshots: '@esbuild/openbsd-arm64@0.24.0': optional: true - '@esbuild/openbsd-x64@0.21.5': - optional: true - '@esbuild/openbsd-x64@0.23.1': optional: true '@esbuild/openbsd-x64@0.24.0': optional: true - '@esbuild/sunos-x64@0.21.5': - optional: true - '@esbuild/sunos-x64@0.23.1': optional: true '@esbuild/sunos-x64@0.24.0': optional: true - '@esbuild/win32-arm64@0.21.5': - optional: true - '@esbuild/win32-arm64@0.23.1': optional: true '@esbuild/win32-arm64@0.24.0': optional: true - '@esbuild/win32-ia32@0.21.5': - optional: true - '@esbuild/win32-ia32@0.23.1': optional: true '@esbuild/win32-ia32@0.24.0': optional: true - '@esbuild/win32-x64@0.21.5': - optional: true - '@esbuild/win32-x64@0.23.1': optional: true @@ -9103,9 +8863,9 @@ snapshots: '@vitejs/longfilename-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@file:playground/optimize-deps/longfilename': {} - '@vitejs/plugin-vue@5.1.4(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))(vue@3.5.13(typescript@5.6.3))': + '@vitejs/plugin-vue@5.1.4(vite@packages+vite)(vue@3.5.13(typescript@5.6.3))': dependencies: - vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite: link:packages/vite vue: 3.5.13(typescript@5.6.3) '@vitejs/release-scripts@1.3.2': @@ -9324,13 +9084,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))': + '@vitest/mocker@2.1.8(vite@packages+vite)': dependencies: '@vitest/spy': 2.1.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite: link:packages/vite '@vitest/pretty-format@2.1.8': dependencies: @@ -10297,32 +10057,6 @@ snapshots: d: 1.0.2 ext: 1.7.0 - esbuild@0.21.5: - optionalDependencies: - '@esbuild/aix-ppc64': 0.21.5 - '@esbuild/android-arm': 0.21.5 - '@esbuild/android-arm64': 0.21.5 - '@esbuild/android-x64': 0.21.5 - '@esbuild/darwin-arm64': 0.21.5 - '@esbuild/darwin-x64': 0.21.5 - '@esbuild/freebsd-arm64': 0.21.5 - '@esbuild/freebsd-x64': 0.21.5 - '@esbuild/linux-arm': 0.21.5 - '@esbuild/linux-arm64': 0.21.5 - '@esbuild/linux-ia32': 0.21.5 - '@esbuild/linux-loong64': 0.21.5 - '@esbuild/linux-mips64el': 0.21.5 - '@esbuild/linux-ppc64': 0.21.5 - '@esbuild/linux-riscv64': 0.21.5 - '@esbuild/linux-s390x': 0.21.5 - '@esbuild/linux-x64': 0.21.5 - '@esbuild/netbsd-x64': 0.21.5 - '@esbuild/openbsd-x64': 0.21.5 - '@esbuild/sunos-x64': 0.21.5 - '@esbuild/win32-arm64': 0.21.5 - '@esbuild/win32-ia32': 0.21.5 - '@esbuild/win32-x64': 0.21.5 - esbuild@0.23.1: optionalDependencies: '@esbuild/aix-ppc64': 0.23.1 @@ -13184,39 +12918,15 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): + vite-node@2.1.8: dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite: link:packages/vite transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - sass-embedded - - stylus - - sugarss - supports-color - - terser - - vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.49 - rollup: 4.28.1 - optionalDependencies: - '@types/node': 22.10.2 - fsevents: 2.3.3 - less: 4.2.1 - lightningcss: 1.28.2 - sass: 1.83.0 - sass-embedded: 1.83.0(source-map-js@1.2.1) - stylus: 0.64.0 - sugarss: 5.0.0(postcss@8.4.49) - terser: 5.37.0 vitepress-plugin-group-icons@1.3.1: dependencies: @@ -13226,7 +12936,7 @@ snapshots: transitivePeerDependencies: - supports-color - vitepress@1.5.0(@algolia/client-search@5.13.0)(@types/node@22.10.2)(@types/react@18.3.17)(axios@1.7.9)(less@4.2.1)(lightningcss@1.28.2)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)(typescript@5.6.3): + vitepress@1.5.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(axios@1.7.9)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3): dependencies: '@docsearch/css': 3.7.0 '@docsearch/js': 3.7.0(@algolia/client-search@5.13.0)(@types/react@18.3.17)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -13235,7 +12945,7 @@ snapshots: '@shikijs/transformers': 1.22.2 '@shikijs/types': 1.24.2 '@types/markdown-it': 14.1.2 - '@vitejs/plugin-vue': 5.1.4(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0))(vue@3.5.13(typescript@5.6.3)) + '@vitejs/plugin-vue': 5.1.4(vite@packages+vite)(vue@3.5.13(typescript@5.6.3)) '@vue/devtools-api': 7.6.3 '@vue/shared': 3.5.13 '@vueuse/core': 11.2.0(vue@3.5.13(typescript@5.6.3)) @@ -13244,13 +12954,12 @@ snapshots: mark.js: 8.11.1 minisearch: 7.1.0 shiki: 1.24.2 - vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite: link:packages/vite vue: 3.5.13(typescript@5.6.3) optionalDependencies: postcss: 8.4.49 transitivePeerDependencies: - '@algolia/client-search' - - '@types/node' - '@types/react' - '@vue/composition-api' - async-validator @@ -13260,26 +12969,19 @@ snapshots: - fuse.js - idb-keyval - jwt-decode - - less - - lightningcss - nprogress - qrcode - react - react-dom - - sass - - sass-embedded - search-insights - sortablejs - - stylus - - sugarss - - terser - typescript - universal-cookie - vitest@2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0): + vitest@2.1.8(@types/node@22.10.2): dependencies: '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0)) + '@vitest/mocker': 2.1.8(vite@packages+vite) '@vitest/pretty-format': 2.1.8 '@vitest/runner': 2.1.8 '@vitest/snapshot': 2.1.8 @@ -13295,21 +12997,14 @@ snapshots: tinyexec: 0.3.1 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.11(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) - vite-node: 2.1.8(@types/node@22.10.2)(less@4.2.1)(lightningcss@1.28.2)(sass-embedded@1.83.0(source-map-js@1.2.1))(sass@1.83.0)(stylus@0.64.0)(sugarss@5.0.0(postcss@8.4.49))(terser@5.37.0) + vite: link:packages/vite + vite-node: 2.1.8 why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.2 transitivePeerDependencies: - - less - - lightningcss - msw - - sass - - sass-embedded - - stylus - - sugarss - supports-color - - terser void-elements@3.1.0: {} diff --git a/vitest.config.ts b/vitest.config.ts index 7ee61c4585006d..7e3590a45411f8 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -14,7 +14,11 @@ export default defineConfig({ './playground-temp/**/*.*', ], testTimeout: 20000, - isolate: false, + // isolate: false, + // TODO: + // importing non entry file can be broken due to cyclic import e.g. + // pnpm exec tsx packages/vite/src/node/server/index.ts + setupFiles: ['./packages/vite/src/node/index.ts'], }, esbuild: { target: 'node18', From 95f47eb71bb8f712a35cc3ed5abc933e01f8b22d Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Tue, 17 Dec 2024 18:42:57 +0900 Subject: [PATCH 5/8] chore: unused --- .../node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js | 1 - .../node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js | 1 - .../node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js | 1 - .../node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js | 1 - .../node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js | 1 - 5 files changed, 5 deletions(-) delete mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js delete mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js delete mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js delete mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js delete mode 100644 packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js deleted file mode 100644 index 28f08f86fec791..00000000000000 --- a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test1/entry.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js deleted file mode 100644 index 28f08f86fec791..00000000000000 --- a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test2/entry.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js deleted file mode 100644 index 28f08f86fec791..00000000000000 --- a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test3/entry.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js deleted file mode 100644 index 28f08f86fec791..00000000000000 --- a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test4/entry.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./index.js" diff --git a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js b/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js deleted file mode 100644 index 28f08f86fec791..00000000000000 --- a/packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/entry.js +++ /dev/null @@ -1 +0,0 @@ -export * from "./index.js" From 2245aaa4d742bca18b8dcd31f8f980470ce0a299 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Wed, 18 Dec 2024 11:12:58 +0900 Subject: [PATCH 6/8] test: fix hmr-ssr --- playground/hmr-ssr/__tests__/hmr-ssr.spec.ts | 17 ++++++++++------- .../hmr-ssr/self-accept-within-circular/c.js | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts index cc56724dc1a957..3ce96393af5736 100644 --- a/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts +++ b/playground/hmr-ssr/__tests__/hmr-ssr.spec.ts @@ -844,20 +844,23 @@ if (!isBuild) { await untilUpdated(() => hmr('.optional-chaining')?.toString(), '2') }) - test.skip('hmr works for self-accepted module within circular imported files', async () => { + test('hmr works for self-accepted module within circular imported files', async () => { await setupModuleRunner('/self-accept-within-circular/index') const el = () => hmr('.self-accept-within-circular') expect(el()).toBe('c') editFile('self-accept-within-circular/c.js', (code) => code.replace(`export const c = 'c'`, `export const c = 'cc'`), ) + // it throws a same error as browser case, + // but it doesn't auto reload and it calls `hot.accept` called with `undefined` + await untilUpdated(() => el(), '') + + // test reloading manually for now + // TODO: why clearCache not working? + // runner.clearCache(); + // runner.import('/self-accept-within-circular/index') + await setupModuleRunner('/self-accept-within-circular/index') await untilUpdated(() => el(), 'cc') - await vi.waitFor(() => { - expect(serverLogs.length).greaterThanOrEqual(1) - // Should still keep hmr update, but it'll error on the browser-side and will refresh itself. - // Match on full log not possible because of color markers - expect(serverLogs.at(-1)!).toContain('hmr update') - }) }) test('hmr should not reload if no accepted within circular imported files', async (ctx) => { diff --git a/playground/hmr-ssr/self-accept-within-circular/c.js b/playground/hmr-ssr/self-accept-within-circular/c.js index 47b6d494969917..7fe30c447965a2 100644 --- a/playground/hmr-ssr/self-accept-within-circular/c.js +++ b/playground/hmr-ssr/self-accept-within-circular/c.js @@ -8,5 +8,5 @@ function render(content) { render(c) import.meta.hot?.accept((nextExports) => { - render(nextExports.c) + render(nextExports?.c) }) From c2f7d75a5865bf1c8ab32e976e2a049237ec9e37 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Wed, 18 Dec 2024 11:49:28 +0900 Subject: [PATCH 7/8] test: fix importing broken entries --- packages/vite/src/node/__tests__/build.spec.ts | 2 +- packages/vite/src/node/__tests__/environment.spec.ts | 2 +- .../src/node/__tests__/plugins/assetImportMetaUrl.spec.ts | 2 +- packages/vite/src/node/__tests__/plugins/define.spec.ts | 2 +- .../node/__tests__/plugins/dynamicImportVar/parse.spec.ts | 2 +- packages/vite/src/node/__tests__/plugins/import.spec.ts | 1 + .../modulePreloadPolyfill/modulePreloadPolyfill.spec.ts | 2 +- packages/vite/src/node/__tests__/resolve.spec.ts | 2 +- packages/vite/src/node/__tests__/scan.spec.ts | 1 + packages/vite/src/node/server/__tests__/moduleGraph.spec.ts | 1 + packages/vite/src/node/server/__tests__/watcher.spec.ts | 2 +- packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts | 2 +- packages/vite/src/node/ssr/__tests__/ssrStacktrace.spec.ts | 2 +- packages/vite/src/node/ssr/runtime/__tests__/utils.ts | 2 +- vitest.config.ts | 6 +----- 15 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/vite/src/node/__tests__/build.spec.ts b/packages/vite/src/node/__tests__/build.spec.ts index cd6bd6e42c4a5d..19bef57f8d374f 100644 --- a/packages/vite/src/node/__tests__/build.spec.ts +++ b/packages/vite/src/node/__tests__/build.spec.ts @@ -4,8 +4,8 @@ import colors from 'picocolors' import { describe, expect, test, vi } from 'vitest' import type { OutputChunk, OutputOptions, RollupOutput } from 'rollup' import type { LibraryFormats, LibraryOptions } from '../build' +import { build } from '..' import { - build, createBuilder, resolveBuildOutputs, resolveLibFilename, diff --git a/packages/vite/src/node/__tests__/environment.spec.ts b/packages/vite/src/node/__tests__/environment.spec.ts index 75b12136c5cd2d..735db48493786d 100644 --- a/packages/vite/src/node/__tests__/environment.spec.ts +++ b/packages/vite/src/node/__tests__/environment.spec.ts @@ -1,7 +1,7 @@ import path from 'node:path' import { describe, expect, onTestFinished, test } from 'vitest' import type { RollupOutput } from 'rollup' -import { createServer } from '../server' +import { createServer } from '..' import type { InlineConfig } from '../config' import { createBuilder } from '../build' import { createServerModuleRunner } from '../ssr/runtime/serverModuleRunner' diff --git a/packages/vite/src/node/__tests__/plugins/assetImportMetaUrl.spec.ts b/packages/vite/src/node/__tests__/plugins/assetImportMetaUrl.spec.ts index 37dc870372da0f..19a82c34e3b786 100644 --- a/packages/vite/src/node/__tests__/plugins/assetImportMetaUrl.spec.ts +++ b/packages/vite/src/node/__tests__/plugins/assetImportMetaUrl.spec.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' import { parseAst } from 'rollup/parseAst' +import { resolveConfig } from '../..' import { assetImportMetaUrlPlugin } from '../../plugins/assetImportMetaUrl' -import { resolveConfig } from '../../config' import { PartialEnvironment } from '../../baseEnvironment' async function createAssetImportMetaurlPluginTransform() { diff --git a/packages/vite/src/node/__tests__/plugins/define.spec.ts b/packages/vite/src/node/__tests__/plugins/define.spec.ts index 166cabac83376f..40b449331d0b76 100644 --- a/packages/vite/src/node/__tests__/plugins/define.spec.ts +++ b/packages/vite/src/node/__tests__/plugins/define.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' +import { resolveConfig } from '../..' import { definePlugin } from '../../plugins/define' -import { resolveConfig } from '../../config' import { PartialEnvironment } from '../../baseEnvironment' async function createDefinePluginTransform( diff --git a/packages/vite/src/node/__tests__/plugins/dynamicImportVar/parse.spec.ts b/packages/vite/src/node/__tests__/plugins/dynamicImportVar/parse.spec.ts index 8a67660258386a..a405765e9dbdc0 100644 --- a/packages/vite/src/node/__tests__/plugins/dynamicImportVar/parse.spec.ts +++ b/packages/vite/src/node/__tests__/plugins/dynamicImportVar/parse.spec.ts @@ -1,8 +1,8 @@ import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' +import { normalizePath } from '../../..' import { transformDynamicImport } from '../../../plugins/dynamicImportVars' -import { normalizePath } from '../../../utils' import { isWindows } from '../../../../shared/utils' const __dirname = resolve(fileURLToPath(import.meta.url), '..') diff --git a/packages/vite/src/node/__tests__/plugins/import.spec.ts b/packages/vite/src/node/__tests__/plugins/import.spec.ts index 89fbd80d8ecdc1..6977ece16d9205 100644 --- a/packages/vite/src/node/__tests__/plugins/import.spec.ts +++ b/packages/vite/src/node/__tests__/plugins/import.spec.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from 'vitest' +import '../..' import { transformCjsImport } from '../../plugins/importAnalysis' describe('transformCjsImport', () => { diff --git a/packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts b/packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts index 3b24fbd5203baa..067892fe109f00 100644 --- a/packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts +++ b/packages/vite/src/node/__tests__/plugins/modulePreloadPolyfill/modulePreloadPolyfill.spec.ts @@ -1,6 +1,6 @@ import { describe, it } from 'vitest' import type { ModuleFormat, RollupOutput } from 'rollup' -import { build } from '../../../build' +import { build } from '../../..' import { modulePreloadPolyfillId } from '../../../plugins/modulePreloadPolyfill' const buildProject = ({ format = 'es' as ModuleFormat } = {}) => diff --git a/packages/vite/src/node/__tests__/resolve.spec.ts b/packages/vite/src/node/__tests__/resolve.spec.ts index 111cdb99a6b1a0..fda33ef96806c9 100644 --- a/packages/vite/src/node/__tests__/resolve.spec.ts +++ b/packages/vite/src/node/__tests__/resolve.spec.ts @@ -1,6 +1,6 @@ import { join } from 'node:path' import { describe, expect, onTestFinished, test } from 'vitest' -import { createServer } from '../server' +import { createServer } from '..' import { createServerModuleRunner } from '../ssr/runtime/serverModuleRunner' import type { InlineConfig } from '../config' import { build } from '../build' diff --git a/packages/vite/src/node/__tests__/scan.spec.ts b/packages/vite/src/node/__tests__/scan.spec.ts index 6fa9f76d1ceac4..8f9134c15ccfe5 100644 --- a/packages/vite/src/node/__tests__/scan.spec.ts +++ b/packages/vite/src/node/__tests__/scan.spec.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from 'vitest' +import '..' import { commentRE, importsRE, scriptRE } from '../optimizer/scan' import { multilineCommentsRE, singlelineCommentsRE } from '../utils' diff --git a/packages/vite/src/node/server/__tests__/moduleGraph.spec.ts b/packages/vite/src/node/server/__tests__/moduleGraph.spec.ts index 6efcb02c4f8eac..5ae3d221d7951c 100644 --- a/packages/vite/src/node/server/__tests__/moduleGraph.spec.ts +++ b/packages/vite/src/node/server/__tests__/moduleGraph.spec.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from 'vitest' +import '../..' import { EnvironmentModuleGraph } from '../moduleGraph' import type { ModuleNode } from '../mixedModuleGraph' import { ModuleGraph } from '../mixedModuleGraph' diff --git a/packages/vite/src/node/server/__tests__/watcher.spec.ts b/packages/vite/src/node/server/__tests__/watcher.spec.ts index 2d6998bea630f4..a97e48ccb09930 100644 --- a/packages/vite/src/node/server/__tests__/watcher.spec.ts +++ b/packages/vite/src/node/server/__tests__/watcher.spec.ts @@ -1,7 +1,7 @@ import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { afterEach, describe, expect, it, vi } from 'vitest' -import { type ViteDevServer, createServer } from '../index' +import { type ViteDevServer, createServer } from '../..' const stubGetWatchedCode = /\(\)\s*\{\s*return this;\s*\}/ diff --git a/packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts b/packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts index a4439aa726e5d7..5f37807803efbf 100644 --- a/packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts +++ b/packages/vite/src/node/ssr/__tests__/ssrLoadModule.spec.ts @@ -3,7 +3,7 @@ import path from 'node:path' import fs from 'node:fs' import { stripVTControlCharacters } from 'node:util' import { expect, test } from 'vitest' -import { createServer } from '../../server' +import { createServer } from '../..' import { normalizePath } from '../../utils' const root = fileURLToPath(new URL('./', import.meta.url)) diff --git a/packages/vite/src/node/ssr/__tests__/ssrStacktrace.spec.ts b/packages/vite/src/node/ssr/__tests__/ssrStacktrace.spec.ts index a334c5078abd79..35bf20ad16b242 100644 --- a/packages/vite/src/node/ssr/__tests__/ssrStacktrace.spec.ts +++ b/packages/vite/src/node/ssr/__tests__/ssrStacktrace.spec.ts @@ -1,6 +1,6 @@ import { fileURLToPath } from 'node:url' import { test } from 'vitest' -import { createServer } from '../../server' +import { createServer } from '../..' const root = fileURLToPath(new URL('./', import.meta.url)) diff --git a/packages/vite/src/node/ssr/runtime/__tests__/utils.ts b/packages/vite/src/node/ssr/runtime/__tests__/utils.ts index 7ab3a40fbfef8e..7424c3c7616276 100644 --- a/packages/vite/src/node/ssr/runtime/__tests__/utils.ts +++ b/packages/vite/src/node/ssr/runtime/__tests__/utils.ts @@ -7,7 +7,7 @@ import type { ModuleRunner } from 'vite/module-runner' import type { ServerModuleRunnerOptions } from '../serverModuleRunner' import type { ViteDevServer } from '../../../server' import type { InlineConfig } from '../../../config' -import { createServer } from '../../../server' +import { createServer } from '../../..' import { createServerModuleRunner } from '../serverModuleRunner' import type { DevEnvironment } from '../../../server/environment' diff --git a/vitest.config.ts b/vitest.config.ts index 7e3590a45411f8..7ee61c4585006d 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -14,11 +14,7 @@ export default defineConfig({ './playground-temp/**/*.*', ], testTimeout: 20000, - // isolate: false, - // TODO: - // importing non entry file can be broken due to cyclic import e.g. - // pnpm exec tsx packages/vite/src/node/server/index.ts - setupFiles: ['./packages/vite/src/node/index.ts'], + isolate: false, }, esbuild: { target: 'node18', From 96f123a9ee816ff9a182ab70da1f24520913ccfb Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Wed, 18 Dec 2024 12:13:35 +0900 Subject: [PATCH 8/8] test: tweak --- .../runtime/__tests__/server-runtime.spec.ts | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts b/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts index ed9d88eba7b1f1..074ed12c63cb37 100644 --- a/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts +++ b/packages/vite/src/node/ssr/runtime/__tests__/server-runtime.spec.ts @@ -234,27 +234,32 @@ describe('module runner initialization', async () => { }) it.for([ - ['/fixtures/cyclic2/test1/index.js', true], - ['/fixtures/cyclic2/test2/index.js', true], - ['/fixtures/cyclic2/test3/index.js', true], - ['/fixtures/cyclic2/test4/index.js', true], - ['/fixtures/cyclic2/test5/index.js', false], - ] as const)(`cyclic %s`, async ([entry, ok], { runner }) => { - if (ok) { - const mod = await runner.import(entry) - expect({ ...mod }).toEqual({ - dep1: { - ok: true, - }, - dep2: { - ok: true, - }, - }) - } else { - await expect(() => runner.import(entry)).rejects.toMatchObject({ - name: 'ReferenceError', - }) - } + '/fixtures/cyclic2/test1/index.js', + '/fixtures/cyclic2/test2/index.js', + '/fixtures/cyclic2/test3/index.js', + '/fixtures/cyclic2/test4/index.js', + ] as const)(`cyclic %s`, async (entry, { runner }) => { + const mod = await runner.import(entry) + expect({ ...mod }).toEqual({ + dep1: { + ok: true, + }, + dep2: { + ok: true, + }, + }) + }) + + it(`cyclic invalid`, async ({ runner }) => { + // Node also fails but with a different message + // $ node packages/vite/src/node/ssr/runtime/__tests__/fixtures/cyclic2/test5/index.js + // ReferenceError: Cannot access 'dep1' before initialization + await expect(() => + runner.import('/fixtures/cyclic2/test5/index.js'), + ).rejects.toMatchObject({ + name: 'ReferenceError', + message: `Cannot access '__vite_ssr_import_1__' before initialization`, + }) }) })