Add full source parity validation workflow
This commit is contained in:
@@ -28,6 +28,19 @@ const importTranspiled = ts.transpileModule(fs.readFileSync(importSourcePath, "u
|
||||
});
|
||||
assert.deepEqual(importTranspiled.diagnostics, []);
|
||||
fs.writeFileSync(path.join(temporary, "external-vfont-import.mjs"), importTranspiled.outputText.replace('"../../../protocol/external-vfont"', '"./external-vfont.mjs"'));
|
||||
const commandSourcePath = path.join(repoRoot, "web/protocol/nonmesh-geometry-commands.ts");
|
||||
const commandTranspiled = ts.transpileModule(fs.readFileSync(commandSourcePath, "utf8"), {
|
||||
compilerOptions: { module: ts.ModuleKind.ES2022, target: ts.ScriptTarget.ES2022 },
|
||||
fileName: commandSourcePath,
|
||||
reportDiagnostics: true,
|
||||
});
|
||||
assert.deepEqual(commandTranspiled.diagnostics, []);
|
||||
fs.writeFileSync(path.join(temporary, "nonmesh-geometry-commands.mjs"), commandTranspiled.outputText);
|
||||
fs.writeFileSync(
|
||||
path.join(temporary, "external-vfont-import.mjs"),
|
||||
fs.readFileSync(path.join(temporary, "external-vfont-import.mjs"), "utf8")
|
||||
.replace('"../../../protocol/nonmesh-geometry-commands"', '"./nonmesh-geometry-commands.mjs"'),
|
||||
);
|
||||
const importer = await import(pathToFileURL(path.join(temporary, "external-vfont-import.mjs")));
|
||||
const pfb = fs.readFileSync(path.join(repoRoot, "blender-5.2.0/release/datafiles/bfont.pfb"));
|
||||
const data = pfb.buffer.slice(pfb.byteOffset, pfb.byteOffset + pfb.byteLength);
|
||||
|
||||
@@ -21,23 +21,24 @@ const registry = JSON.parse(fs.readFileSync(path.join(root, "web/app/src/capabil
|
||||
|
||||
test("M12-05C keeps only matrix-declared executable routes in UI", () => {
|
||||
const parsed = gate.parseIOFormatUIRegistry(registry);
|
||||
assert.deepEqual(parsed.importRoutes, []);
|
||||
assert.deepEqual(parsed.exportRoutes.map((route) => route.format), ["GLB"]);
|
||||
assert.deepEqual(parsed.importRoutes.map((route) => route.format), ["GLTF", "GLB", "OBJ", "STL", "PLY"]);
|
||||
assert.deepEqual(parsed.exportRoutes.map((route) => route.format), ["GLTF", "GLB", "OBJ", "STL", "PLY"]);
|
||||
const commands = [
|
||||
{ id: "file.export-glb", ioFormat: { format: "GLB", operation: "EXPORT", execution: "LOCAL" } },
|
||||
{ id: "file.import-obj", ioFormat: { format: "OBJ", operation: "IMPORT", execution: "LOCAL" } },
|
||||
{ id: "file.export-usd", ioFormat: { format: "USD", operation: "EXPORT", execution: "SERVER" } },
|
||||
{ id: "edit.undo" },
|
||||
];
|
||||
assert.deepEqual(gate.filterIOFormatOperatorCommands(commands, parsed).map((command) => command.id), ["file.export-glb", "edit.undo"]);
|
||||
assert.deepEqual(gate.filterIOFormatOperatorCommands(commands, parsed).map((command) => command.id), ["file.export-glb", "file.import-obj", "edit.undo"]);
|
||||
});
|
||||
|
||||
test("M12-05C file selection is project-only while import routes are blocked", () => {
|
||||
test("M12-05C file selection includes only declared local import routes", () => {
|
||||
const parsed = gate.parseIOFormatUIRegistry(registry);
|
||||
assert.equal(gate.ioFormatUIAccept(parsed), ".blend,application/octet-stream");
|
||||
assert.equal(gate.ioFormatUIAccept(parsed), ".blend,application/octet-stream,.gltf,.glb,.obj,.stl,.ply");
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("scene.blend", parsed), { status: "READY", kind: "BLEND" });
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("mesh.obj", parsed), { status: "BLOCKED", code: "IO_FORMAT_UNSUPPORTED", extension: ".obj" });
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("scene.glb", parsed), { status: "BLOCKED", code: "IO_FORMAT_UNSUPPORTED", extension: ".glb" });
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("mesh.obj", parsed), { status: "READY", kind: "SCENE", route: parsed.importRoutes[2] });
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("scene.glb", parsed), { status: "READY", kind: "SCENE", route: parsed.importRoutes[1] });
|
||||
assert.deepEqual(gate.gateIOFormatFileSelection("scene.usd", parsed), { status: "BLOCKED", code: "IO_FORMAT_UNSUPPORTED", extension: ".usd" });
|
||||
});
|
||||
|
||||
test("M12-05C rejects malformed route metadata", () => {
|
||||
|
||||
@@ -10,7 +10,7 @@ const packageJson = JSON.parse(
|
||||
|
||||
test("browser runtime dependencies stay local", () => {
|
||||
const runtimePackages = Object.keys(packageJson.dependencies ?? {});
|
||||
assert.deepEqual(runtimePackages, ["react", "react-dom"]);
|
||||
assert.deepEqual(runtimePackages, ["@ffmpeg/core", "@ffmpeg/ffmpeg", "@ffmpeg/util", "react", "react-dom"]);
|
||||
assert.equal(packageJson.dependencies?.three, undefined);
|
||||
assert.equal(packageJson.dependencies?.["@sqlite.org/sqlite-wasm"], undefined);
|
||||
for (const name of runtimePackages) {
|
||||
@@ -34,6 +34,8 @@ test("required renderer and engine assets are vendored", () => {
|
||||
"app/public/vendor/blender/single/web_engine.wasm",
|
||||
"app/public/vendor/blender/pthread/web_engine.js",
|
||||
"app/public/vendor/blender/pthread/web_engine.wasm",
|
||||
"app/public/vendor/ffmpeg/ffmpeg-core.js",
|
||||
"app/public/vendor/ffmpeg/ffmpeg-core.wasm",
|
||||
];
|
||||
for (const relativePath of requiredFiles) {
|
||||
const filePath = path.join(webRoot, relativePath);
|
||||
|
||||
Reference in New Issue
Block a user