diff --git a/scripts/deploy-selfhost-prebuilt.sh b/scripts/deploy-selfhost-prebuilt.sh index 484c29aadb..0718ea169f 100755 --- a/scripts/deploy-selfhost-prebuilt.sh +++ b/scripts/deploy-selfhost-prebuilt.sh @@ -35,7 +35,7 @@ run_node_build() { -v "$PWD:/work" \ -w /work \ "$NODE_IMAGE" \ - sh -lc 'npm ci --ignore-scripts && node scripts/build-selfhost.mjs --all && node scripts/validate-selfhost-sourcemap.mjs' + sh -lc 'npm ci --ignore-scripts && npm --workspace @jsonbored/gittensory-engine run build && node scripts/build-selfhost.mjs --all && node scripts/validate-selfhost-sourcemap.mjs' } run_sentry_upload() { diff --git a/test/unit/docs-selfhost-update-rollback.test.ts b/test/unit/docs-selfhost-update-rollback.test.ts index 00a9fed397..b3fc8b155d 100644 --- a/test/unit/docs-selfhost-update-rollback.test.ts +++ b/test/unit/docs-selfhost-update-rollback.test.ts @@ -32,6 +32,17 @@ describe("self-host update + rollback docs (#1823)", () => { expect(prebuiltScript).toContain('up -d --no-deps "$SERVICE"'); }); + it("prebuilt deploy builds the gittensory-engine workspace before bundling (#4530)", () => { + // packages/gittensory-engine/dist/ is gitignored and built via `tsc`; `npm ci --ignore-scripts` + // never triggers that build on its own, so anything that imports the engine (e.g. + // packages/gittensory-miner) fails to resolve during the --all bundle unless this runs first. + const engineBuildIndex = prebuiltScript.indexOf("@jsonbored/gittensory-engine run build"); + const bundleIndex = prebuiltScript.indexOf("build-selfhost.mjs --all"); + expect(engineBuildIndex).toBeGreaterThan(-1); + expect(bundleIndex).toBeGreaterThan(-1); + expect(engineBuildIndex).toBeLessThan(bundleIndex); + }); + it("post-update script probes /ready without mutating operator-owned state", () => { expect(postUpdateScript).toContain("/ready"); expect(postUpdateScript).toContain("GITTENSORY_IMAGE");