test: prove TechLog UI migration parity
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
const RAW_PALETTE_VALUE_PATTERN =
|
||||
/(?<![a-z0-9/_-])(?:#[0-9a-f]{3,8}\b|oklch\(|rgba?\()/i;
|
||||
|
||||
export function containsRawPaletteValue(source: string): boolean {
|
||||
return RAW_PALETTE_VALUE_PATTERN.test(source);
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import {
|
||||
type ReleaseCandidateManifest,
|
||||
} from "./release-candidate.ts";
|
||||
import { verifyReleaseRuntimeCoherence } from "./release-runtime-coherence.ts";
|
||||
import { findViteDynamicRouteChunk } from "./vite-route-chunks.ts";
|
||||
import { digestReleaseInputFiles } from "./release-input-evidence.ts";
|
||||
import {
|
||||
compareStoredDependencyEvidence,
|
||||
@@ -1256,12 +1257,27 @@ async function verifyReleaseOutputs(
|
||||
ROUTE_RUNTIME_CONTRACT;
|
||||
for (const definition of Object.values(ROUTE_REGISTRY)) {
|
||||
const runtime = runtimeContracts[definition.routeId];
|
||||
const viteEntry = Object.values(viteManifest).find(
|
||||
(entry) =>
|
||||
isRecord(entry) &&
|
||||
entry.name === runtime?.moduleId &&
|
||||
entry.isDynamicEntry === true,
|
||||
);
|
||||
const viteEntry = runtime
|
||||
? findViteDynamicRouteChunk(
|
||||
Object.fromEntries(
|
||||
Object.entries(viteManifest).flatMap(([key, entry]) => {
|
||||
if (!isRecord(entry) || typeof entry.file !== "string") return [];
|
||||
return [[key, {
|
||||
file: entry.file,
|
||||
...(typeof entry.name === "string" ? { name: entry.name } : {}),
|
||||
...(typeof entry.isDynamicEntry === "boolean"
|
||||
? { isDynamicEntry: entry.isDynamicEntry }
|
||||
: {}),
|
||||
...(Array.isArray(entry.dynamicImports) &&
|
||||
entry.dynamicImports.every((item) => typeof item === "string")
|
||||
? { dynamicImports: entry.dynamicImports as string[] }
|
||||
: {}),
|
||||
}]];
|
||||
}),
|
||||
),
|
||||
runtime.moduleId,
|
||||
)
|
||||
: undefined;
|
||||
const file = isRecord(viteEntry) ? viteEntry.file : null;
|
||||
if (
|
||||
typeof file !== "string" ||
|
||||
|
||||
@@ -52,6 +52,7 @@ export const LOCAL_EVIDENCE_VERIFIER_SOURCE_PATHS = Object.freeze([
|
||||
"scripts/lib/secret-scan.ts",
|
||||
"scripts/lib/supply-chain.ts",
|
||||
"scripts/lib/validated-json-artifact.ts",
|
||||
"scripts/lib/vite-route-chunks.ts",
|
||||
"src/contracts/release-artifacts.ts",
|
||||
"src/features/installed-contract-contributions.ts",
|
||||
"src/features/installed-feature-contracts.ts",
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
export type ViteManifestRouteEntry = Readonly<{
|
||||
file: string;
|
||||
name?: string;
|
||||
isDynamicEntry?: boolean;
|
||||
dynamicImports?: readonly string[];
|
||||
}>;
|
||||
|
||||
export function findViteDynamicRouteChunk(
|
||||
manifest: Readonly<Record<string, ViteManifestRouteEntry>>,
|
||||
moduleId: string,
|
||||
): ViteManifestRouteEntry | undefined {
|
||||
const dynamicallyImportedKeys = new Set(
|
||||
Object.values(manifest).flatMap((entry) => entry.dynamicImports ?? []),
|
||||
);
|
||||
return Object.entries(manifest).find(
|
||||
([key, entry]) =>
|
||||
entry.name === moduleId &&
|
||||
(entry.isDynamicEntry === true || dynamicallyImportedKeys.has(key)),
|
||||
)?.[1];
|
||||
}
|
||||
Reference in New Issue
Block a user