From 473e1eb935bb0574fad74cb940c962d329696e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20T=C3=B6rcsv=C3=A1ri?= Date: Tue, 25 Aug 2026 13:15:42 +0200 Subject: [PATCH] 3D models from the registry: --models-source flag, staging + prod editor builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 → 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 Claude-Session: https://claude.ai/code/session_01H1iwtBFvQ8CFg966bqSZh2 --- .github/workflows/deploy-staging.yml | 3 ++- .github/workflows/release.yml | 5 ++++- scripts/deploy/build-editor.mjs | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 23c6255..c9211fa 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5364e1f..8456e8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: > diff --git a/scripts/deploy/build-editor.mjs b/scripts/deploy/build-editor.mjs index 9e1db19..1d8a269 100644 --- a/scripts/deploy/build-editor.mjs +++ b/scripts/deploy/build-editor.mjs @@ -33,6 +33,10 @@ function parseArgs(argv) { yjsEndpoint: null, // kicad-packages3D snapshot (libs/kicad-models//); 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)"}`);