From db5728b75f26508d86fecdb47946d4345e2acb34 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 5 Nov 2026 02:04:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(dev):=20dev=20release=20manifest=EB=A5=BC?= =?UTF-8?q?=20src=20=EB=B0=96=EC=97=90=20=EC=93=B0=EA=B3=A0=20Vitest?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8A=94=20=EB=A7=8C=EB=93=A4=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 c15345c의 플러그인은 apply: "serve"라 Vitest가 Vite를 띄울 때도 돌아, test:unit마다 자식 프로세스로 manifest를 쓴다. 출력 위치 src/.generated/dev-release-manifest.json에는 자리표시자의 routeChunks(샘플 경로)가 들어 있다. test:sample-removal의 잔여 검사는 src/를 훑으므로 FE-GATE-020이 "fixture-id-residue: src/.generated/dev-release-manifest.json"으로 실패한다. 고른 방법 - 출력을 빌드의 contract set 생성물 옆 .generated/frontend-runtime/로 옮긴다 (무시 대상). - apply가 serve이면서 VITEST가 없을 때만 돈다. 테스트는 서버에서 manifest를 받지 않는다. 검증 - browser-files capability spec(dev server) chromium 3건 통과, 생성물이 새 위치에 생긴다. - test:unit 2,880건 통과, 실행 뒤 src/.generated에 manifest가 없다. Refs: docs/reviews/2026-11-03-maturity-review/README.md 14.6 X2 #3 --- scripts/lib/dev-release-manifest.ts | 12 +++++++++--- scripts/write-dev-release-manifest.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/lib/dev-release-manifest.ts b/scripts/lib/dev-release-manifest.ts index 4b718ab5..0395cd6a 100644 --- a/scripts/lib/dev-release-manifest.ts +++ b/scripts/lib/dev-release-manifest.ts @@ -4,8 +4,12 @@ import path from "node:path"; import type { Plugin } from "vite"; -/** Generated at dev server start; ignored with the rest of src/.generated/. */ -export const DEV_RELEASE_MANIFEST_PATH = "src/.generated/dev-release-manifest.json"; +/** + * Generated at dev server start, beside the build's generated contract set and + * ignored with it. Not under src/: the removal drills scan src/ for the + * sample's names, and this copies the placeholder's route chunks. + */ +export const DEV_RELEASE_MANIFEST_PATH = ".generated/frontend-runtime/dev-release-manifest.json"; /** * Serve only. The dev server answers the runtime's release-manifest request @@ -19,7 +23,9 @@ export const DEV_RELEASE_MANIFEST_PATH = "src/.generated/dev-release-manifest.js export function devReleaseManifestPlugin(repositoryRoot = process.cwd()): Plugin { return { name: "frontend-dev-release-manifest", - apply: "serve", + // Vitest also starts Vite in serve mode; tests never fetch the manifest + // from a server, so they skip the child process. + apply: (_config, env) => env.command === "serve" && !process.env["VITEST"], configureServer(server) { execFileSync( process.execPath, diff --git a/scripts/write-dev-release-manifest.ts b/scripts/write-dev-release-manifest.ts index bd194eb4..48a6c75a 100644 --- a/scripts/write-dev-release-manifest.ts +++ b/scripts/write-dev-release-manifest.ts @@ -10,7 +10,7 @@ import { DEV_RELEASE_MANIFEST_PATH } from "./lib/dev-release-manifest.ts"; * installed now. Boot checks that set against the installed declarations, so * a placeholder with a fixed set refused every app with one more feature * (CONTRACT_SET_PACKAGE_MISSING) until someone edited it by hand. The output - * is generated and ignored, as src/.generated/ is. + * is generated and ignored, as .generated/ is. */ export async function writeDevReleaseManifest( source = "public/release-manifest.json",