From 6af9a368bdd6d72cf953eac8206b8939cc5bf7a4 Mon Sep 17 00:00:00 2001 From: lihbr Date: Fri, 23 Jan 2026 11:00:47 +0900 Subject: [PATCH 1/3] fix(adapter-nuxt): init slice library index files --- .../adapter-nuxt/src/hooks/project-init.ts | 27 +++++++++++++++++++ .../test/plugin-project-init.test.ts | 22 +++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/packages/adapter-nuxt/src/hooks/project-init.ts b/packages/adapter-nuxt/src/hooks/project-init.ts index 969c1d0728..016beb0456 100644 --- a/packages/adapter-nuxt/src/hooks/project-init.ts +++ b/packages/adapter-nuxt/src/hooks/project-init.ts @@ -16,6 +16,7 @@ import { builders, loadFile, writeFile } from "magicast"; import { buildSrcPath } from "../lib/buildSrcPath"; import { rejectIfNecessary } from "../lib/rejectIfNecessary"; import { checkIsTypeScriptProject } from "../lib/checkIsTypeScriptProject"; +import { upsertSliceLibraryIndexFile } from "../lib/upsertSliceLibraryIndexFile"; import type { PluginOptions } from "../types"; @@ -262,6 +263,28 @@ const modifySliceMachineConfig = async ({ }); }; +const upsertSliceLibraryIndexFiles = async ( + context: SliceMachineContext, +) => { + // We must use the `getProject()` helper to get the latest version of + // the project config. The config may have been modified in + // `modifySliceMachineConfig()` and will not be relfected in + // `context.project`. + // TODO: Automatically update the plugin runner's in-memory `project` + // object when `updateSliceMachineConfig()` is called. + const project = await context.helpers.getProject(); + + if (!project.config.libraries) { + return; + } + + await Promise.all( + project.config.libraries.map(async (libraryID) => { + await upsertSliceLibraryIndexFile({ libraryID, ...context }); + }), + ); +}; + export const projectInit: ProjectInitHook = async ( { installDependencies: _installDependencies }, context, @@ -275,4 +298,8 @@ export const projectInit: ProjectInitHook = async ( modifySliceMachineConfig(context), ]), ); + + // This must happen after `modifySliceMachineConfig()` since the + // location of the default Slice library may change. + await upsertSliceLibraryIndexFiles(context); }; diff --git a/packages/adapter-nuxt/test/plugin-project-init.test.ts b/packages/adapter-nuxt/test/plugin-project-init.test.ts index b1483bd290..921f737757 100644 --- a/packages/adapter-nuxt/test/plugin-project-init.test.ts +++ b/packages/adapter-nuxt/test/plugin-project-init.test.ts @@ -529,3 +529,25 @@ describe("modify slicemachine.config.json", () => { expect(contents.libraries).toStrictEqual(preHookConfig.libraries); }); }); + +test("creates all Slice library index files", async (ctx) => { + await fs.writeFile( + path.join(ctx.project.root, "slicemachine.config.json"), + JSON.stringify({ + ...ctx.project.config, + libraries: ["./foo", "./bar"], + }), + ); + + await ctx.pluginRunner.callHook("project:init", { + log: vi.fn(), + installDependencies: vi.fn(), + }); + + expect(await fs.readdir(path.join(ctx.project.root, "foo"))).includes( + "index.js", + ); + expect(await fs.readdir(path.join(ctx.project.root, "bar"))).includes( + "index.js", + ); +}); From a1aa1a68b72ac3a8b1c87577f5b6f5a566f6abe9 Mon Sep 17 00:00:00 2001 From: lihbr Date: Fri, 23 Jan 2026 11:04:59 +0900 Subject: [PATCH 2/3] fix(deps): h3 cve --- packages/manager/package.json | 2 +- yarn.lock | 63 ++++++++++++++++------------------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/packages/manager/package.json b/packages/manager/package.json index 18dfe16c1d..adb146f424 100644 --- a/packages/manager/package.json +++ b/packages/manager/package.json @@ -78,7 +78,7 @@ "file-type": "^18.2.1", "fp-ts": "^2.13.1", "get-port": "^6.1.2", - "h3": "^1.6.0", + "h3": "^1.15.5", "io-ts": "^2.2.20", "io-ts-reporters": "^2.0.1", "io-ts-types": "^0.5.19", diff --git a/yarn.lock b/yarn.lock index 4623528946..6cb4c7e34e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11027,7 +11027,7 @@ __metadata: file-type: ^18.2.1 fp-ts: ^2.13.1 get-port: ^6.1.2 - h3: ^1.6.0 + h3: ^1.15.5 hook-std: 3.0.0 io-ts: ^2.2.20 io-ts-reporters: ^2.0.1 @@ -17959,13 +17959,6 @@ __metadata: languageName: node linkType: hard -"cookie-es@npm:^1.0.0": - version: 1.0.0 - resolution: "cookie-es@npm:1.0.0" - checksum: e8721cf4d38f3e44049c9118874b323f4f674b1c5cef84a2b888f5bf86ad720ad17b51b43150cad7535a375c24e2921da603801ad28aa6125c3d36c031b41468 - languageName: node - linkType: hard - "cookie-es@npm:^1.2.2": version: 1.2.2 resolution: "cookie-es@npm:1.2.2" @@ -22879,18 +22872,20 @@ __metadata: languageName: node linkType: hard -"h3@npm:^1.6.0": - version: 1.6.6 - resolution: "h3@npm:1.6.6" +"h3@npm:^1.15.5": + version: 1.15.5 + resolution: "h3@npm:1.15.5" dependencies: - cookie-es: ^1.0.0 - defu: ^6.1.2 - destr: ^1.2.2 - iron-webcrypto: ^0.7.0 - radix3: ^1.0.1 - ufo: ^1.1.2 - uncrypto: ^0.1.2 - checksum: 58a24d0f5eeff0e36caf7299d0237c43e0e10b9fcc8f8858aec51bcac0a0ab6ed28ebff199119a62e5571c0c35e6788acb69fe63468ff04c3134598c7ee46f1a + cookie-es: ^1.2.2 + crossws: ^0.3.5 + defu: ^6.1.4 + destr: ^2.0.5 + iron-webcrypto: ^1.2.1 + node-mock-http: ^1.0.4 + radix3: ^1.1.2 + ufo: ^1.6.3 + uncrypto: ^0.1.3 + checksum: 455f58681de2b789b39af45067db8dde35234c18d86ec5068687300aae3c0225f85edcd110906493e087407e2caaa1f292352769c484284e72558d7677c29899 languageName: node linkType: hard @@ -23954,13 +23949,6 @@ __metadata: languageName: node linkType: hard -"iron-webcrypto@npm:^0.7.0": - version: 0.7.0 - resolution: "iron-webcrypto@npm:0.7.0" - checksum: e866c039bf06444dbb1986821df87706dc90ec1c04a03b27eb7f554f4c8dc43b6647f434645060a22c59990f9acac4b87a454adf47d89e5509e5bd627cd423be - languageName: node - linkType: hard - "iron-webcrypto@npm:^1.2.1": version: 1.2.1 resolution: "iron-webcrypto@npm:1.2.1" @@ -28619,6 +28607,13 @@ __metadata: languageName: node linkType: hard +"node-mock-http@npm:^1.0.4": + version: 1.0.4 + resolution: "node-mock-http@npm:1.0.4" + checksum: 965f7915d3bbe9cbf5555dca12800cb0ca78a0b8db9c8f33a0ea6d9447fd200a925232b5ddf0d60c7112785ea282eb9baa079bb53d485b2b554355e8559f98ed + languageName: node + linkType: hard + "node-object-hash@npm:^1.2.0": version: 1.4.2 resolution: "node-object-hash@npm:1.4.2" @@ -32641,13 +32636,6 @@ __metadata: languageName: node linkType: hard -"radix3@npm:^1.0.1": - version: 1.0.1 - resolution: "radix3@npm:1.0.1" - checksum: 042e11588464ca444a663f78c2aad11eb35533a26d08a56a53786fd60ddb20a058c720d8f66cad4f010859493753f29ac36aaa47d122b6459675c68a3f74928a - languageName: node - linkType: hard - "radix3@npm:^1.1.2": version: 1.1.2 resolution: "radix3@npm:1.1.2" @@ -37425,6 +37413,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.6.3": + version: 1.6.3 + resolution: "ufo@npm:1.6.3" + checksum: a23eff86bbbef0b9cc69c19c653c703b656c2328938576d3a60e05e246ef5a78d88b17c710afa146311c5b855950ccfee60ba8f6c8845e8d1ed6b5a9086ddad1 + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4, uglify-js@npm:^3.5.1": version: 3.17.4 resolution: "uglify-js@npm:3.17.4" @@ -37453,7 +37448,7 @@ __metadata: languageName: node linkType: hard -"uncrypto@npm:^0.1.2, uncrypto@npm:^0.1.3": +"uncrypto@npm:^0.1.3": version: 0.1.3 resolution: "uncrypto@npm:0.1.3" checksum: 07160e08806dd6cea16bb96c3fd54cd70fc801e02fc3c6f86980144d15c9ebbd1c55587f7280a207b3af6cd34901c0d0b77ada5a02c2f7081a033a05acf409e2 From cbf081c985a59d7bda3354aa79d56053b92064c2 Mon Sep 17 00:00:00 2001 From: lihbr Date: Fri, 23 Jan 2026 11:13:27 +0900 Subject: [PATCH 3/3] chore(deps): maintain lock file --- yarn.lock | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6cb4c7e34e..4a56112113 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18280,7 +18280,7 @@ __metadata: languageName: node linkType: hard -"crossws@npm:>=0.2.0 <0.4.0, crossws@npm:^0.3.4, crossws@npm:^0.3.5": +"crossws@npm:>=0.2.0 <0.4.0, crossws@npm:^0.3.5": version: 0.3.5 resolution: "crossws@npm:0.3.5" dependencies: @@ -22855,24 +22855,7 @@ __metadata: languageName: node linkType: hard -"h3@npm:^1.12.0, h3@npm:^1.15.1, h3@npm:^1.15.2, h3@npm:^1.15.3": - version: 1.15.3 - resolution: "h3@npm:1.15.3" - dependencies: - cookie-es: ^1.2.2 - crossws: ^0.3.4 - defu: ^6.1.4 - destr: ^2.0.5 - iron-webcrypto: ^1.2.1 - node-mock-http: ^1.0.0 - radix3: ^1.1.2 - ufo: ^1.6.1 - uncrypto: ^0.1.3 - checksum: 23bd309aed995e64f5cb69333d24e628b6516b7d86cae504be486437d229beaecd03a296c1294740d33d6e9fd1c2c1423268783eea6228f87b18f6c4cd6d933e - languageName: node - linkType: hard - -"h3@npm:^1.15.5": +"h3@npm:^1.12.0, h3@npm:^1.15.1, h3@npm:^1.15.2, h3@npm:^1.15.3, h3@npm:^1.15.5": version: 1.15.5 resolution: "h3@npm:1.15.5" dependencies: