3D models from the registry: --models-source flag, staging + prod editor builds

The staging editor was built with neither --models-tag (no models on the
staging CDN) nor VITE_MODELS_SOURCE, so modelsSourceConfig() returned null,
no model3d handler was installed and every 3D ensure answered "(unserved)"
despite the chunked packages3D ingest being complete on the staging registry.

- build-editor.mjs: --models-source <cdn|registry> → VITE_MODELS_SOURCE
- deploy-staging.yml: editor builds with --models-source registry
- release.yml: prod editor builds with --models-source registry (libs/0016 §6
  step 4); MODELS_TAG now only feeds the demo build, which has no closed API.

Prod rollout order: split-lib-kinds + packages3D ingest on prod BEFORE the
next release tag — prod's registry currently has 0 model3d libs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H1iwtBFvQ8CFg966bqSZh2
This commit is contained in:
Gergő Törcsvári 2026-08-25 13:15:42 +02:00
commit 473e1eb935
No known key found for this signature in database
GPG key ID: 8E75F2CDE64E5322
3 changed files with 13 additions and 3 deletions

View file

@ -97,7 +97,8 @@ jobs:
run: |
node scripts/deploy/build-editor.mjs --tag "$STAGING_TAG" \
--cdn "$CDN_ORIGIN" --api-base "$API_ORIGIN" \
--app-base "$APP_ORIGIN" --errors-env staging
--app-base "$APP_ORIGIN" --errors-env staging \
--models-source registry
# Worker Static Assets uses not_found_handling=single-page-application.
# The generated _redirects file is for Pages and duplicates that fallback.
rm -f web/standalone/dist/_redirects

View file

@ -188,13 +188,16 @@ jobs:
# --plausible: the shared pa- script covering all pcbjam properties
# (one dashboard, segment by hostname).
# --models-source registry: 3D models come from the closed registry's
# kind='model3d' origin libs (chunked packages3D ingest, libs/0016), not
# the CDN snapshot — MODELS_TAG only feeds the demo build above.
- name: Build editor (remote mode)
run: >
node scripts/deploy/build-editor.mjs --tag "$RELEASE_TAG"
--cdn "$CDN" --api-base "$EDITOR_API_BASE" --app-base "$EDITOR_APP_BASE"
--plausible "https://plausible.io/js/pa-KjNS9YmidydULZTstsjRg.js"
${ERRORS_DSN:+--errors-dsn "$ERRORS_DSN" --errors-env production}
${MODELS_TAG:+--models-tag "$MODELS_TAG"}
--models-source registry
- name: Ensure Pages project exists
run: >

View file

@ -33,6 +33,10 @@ function parseArgs(argv) {
yjsEndpoint: null,
// kicad-packages3D snapshot (libs/kicad-models/<tag>/); omitted ⇒ 3D models off.
modelsTag: null,
// 3D model backing override: "registry" serves the closed registry's
// kind='model3d' origin libs (docs/features/libs/0016) instead of the CDN
// snapshot; omitted ⇒ "cdn" when --models-tag is set, else models off.
modelsSource: null,
plausible: null,
// Better Stack error-tracking DSN (Sentry wire format). Omitted ⇒ no error
// reporting from this build.
@ -51,6 +55,7 @@ function parseArgs(argv) {
case "--repo": a.repo = next(); break;
case "--yjs-endpoint": a.yjsEndpoint = next(); break;
case "--models-tag": a.modelsTag = next(); break;
case "--models-source": a.modelsSource = next(); break;
case "--plausible": a.plausible = next(); break;
case "--errors-dsn": a.errorsDsn = next(); break;
case "--errors-env": a.errorsEnv = next(); break;
@ -113,6 +118,7 @@ function main() {
VITE_MODELS_MANIFEST_URL: `${a.cdn}/libs/kicad-models/${a.modelsTag}/manifest.json`,
}
: {}),
...(a.modelsSource ? { VITE_MODELS_SOURCE: a.modelsSource } : {}),
// Build identity for the version badge (GPLv3 corresponding source).
VITE_APP_TAG: a.tag,
VITE_GIT_SHA: gitSha(repoRoot),
@ -134,7 +140,7 @@ function main() {
console.log(` VITE_API_BASE_URL=${env.VITE_API_BASE_URL}`);
console.log(` VITE_YJS_ENDPOINT=${env.VITE_YJS_ENDPOINT} (provider=${env.VITE_YJS_PROVIDER}, doc=${env.VITE_DOC_SOURCE})`);
console.log(` VITE_LIBS_SOURCE=${env.VITE_LIBS_SOURCE}`);
console.log(` VITE_MODELS_MANIFEST_URL=${env.VITE_MODELS_MANIFEST_URL ?? "(unset — 3D models off)"}`);
console.log(` VITE_MODELS_SOURCE=${env.VITE_MODELS_SOURCE ?? (env.VITE_MODELS_MANIFEST_URL ? "cdn" : "off")} VITE_MODELS_MANIFEST_URL=${env.VITE_MODELS_MANIFEST_URL ?? "(unset)"}`);
console.log(` VITE_APP_TAG=${env.VITE_APP_TAG} VITE_GIT_SHA=${env.VITE_GIT_SHA || "(none)"}`);
console.log(` VITE_PLAUSIBLE_SRC=${env.VITE_PLAUSIBLE_SRC || "(off)"}`);
console.log(` VITE_ERRORS_DSN=${env.VITE_ERRORS_DSN ? `(set, env=${env.VITE_ERRORS_ENV})` : "(off)"}`);