9092a3c8eb
Migrate the browser viewer from package schema 2.0 (objects array + nested scene/scene.zip) to the canonical v3 layout (themed subpackages, flat scene projection, content-addressed blob store); v2 packages are rejected as unsupported. - product-package.ts: v3 manifest gate plus structural validation mirroring ProductPackage._validate_manifest (exact manifest key set, path/hash-sorted unique records, root resolution, archive blob member declarations, projection asset source resolution), exact member-set closure with per-record sha256/byte_length verification, content_hash and scene revision recomputation, and a definitions-vs-product_assets identity multiset check. Scene geometry/entity/source assets are materialized from blobs/<sha256> members through the projection sources; product and feature-graph ZIP payloads are integrity-checked as members but never re-packed, since the viewer never consumes them. - main.ts: thread the loaded package schema into the footer label and drop a dead constant; scene/entity sidecar 2.0 checks are unchanged. - loader.test.ts: first viewer test suite (node:test via tsx, fixture regenerated through prepare:example) covering the happy path and the tamper matrix: mutated blob member, smuggled extra member, wrong content_hash, and v2 manifest rejection.
33 lines
872 B
JSON
33 lines
872 B
JSON
{
|
|
"name": "simplecad-scene-viewer",
|
|
"version": "1.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc --noEmit && vite build",
|
|
"preview": "vite preview",
|
|
"prepare:example": "uv run python ../examples/10_part_assembly.py",
|
|
"test": "npm run prepare:example && tsx --test src/loader.test.ts"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/commands": "^6.9.0",
|
|
"@codemirror/lang-python": "^6.2.1",
|
|
"@codemirror/language": "^6.11.3",
|
|
"@codemirror/state": "^6.5.2",
|
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
"@codemirror/view": "^6.38.2",
|
|
"codemirror": "^6.0.2",
|
|
"fflate": "0.8.2",
|
|
"lucide": "^0.547.0",
|
|
"three": "0.178.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^24.10.1",
|
|
"@types/three": "0.178.1",
|
|
"tsx": "^4.20.3",
|
|
"typescript": "5.7.2",
|
|
"vite": "7.3.6"
|
|
}
|
|
}
|