From 12551505e1cd73457622fed3aa6a72c9cc42c800 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 28 Oct 2026 05:59:50 +0000 Subject: [PATCH] ci(release),ui: the publish-check texts say what the release does today release.yml's comment over the publish step now names what scripts/release-publish.sh runs before `changeset publish`: the dist-tooling scan with --no-build, which refuses the publish. The ui `changeset:publish` alias, which nothing invokes, is removed, and its wiring test now pins the gate's order on the live path, scripts/release-publish.sh. Claude-Session: https://claude.ai/code/session_01QSeKYmhU5KEj1nukYhp1Tg Co-authored-by: Claude --- .github/workflows/release.yml | 13 +++++++--- ui/package.json | 1 - .../check-published-dist-tooling.test.ts | 24 +++++++++++++------ 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 041b52c77f7..b197935d7d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1946,9 +1946,16 @@ jobs: # ────────────────────────────────────────────────────────────────────── # The publish itself. `pnpm run release` = build (both scopes; the turbo # cache makes it the build above) + console:build (the Console dist into - # packages/console) + scripts/release-publish.sh, which is `changeset - # publish` followed by ONE atomic `git push origin --tags` (#2191: the action's concurrent per-tag - # pushes raced GitHub's ref backend and lost ~half the tags). + # packages/console) + scripts/release-publish.sh, which runs, in order: + # 1. `node ui/scripts/check-published-dist-tooling.mjs --no-build`, which + # refuses the publish when a published @object-ui package carries + # tooling material (a test, a mock, a `*.tsbuildinfo`) or has no build + # output. `--no-build` because the build above is what gets packed, + # so the scan reads exactly those artifacts; + # 2. `changeset publish`, with npm's own per-package answers recorded for + # scripts/release-verify-npm.mjs, which this step runs next; + # 3. ONE atomic `git push origin --tags` (#2191: the action's concurrent + # per-tag pushes raced GitHub's ref backend and lost ~half the tags). # # changesets/action is NOT used here, and that is deliberate: handed a # workspace with pending changesets it would take the VERSION path and mint diff --git a/ui/package.json b/ui/package.json index 539b12d8589..b87551edd5b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -113,7 +113,6 @@ "changeset:check": "node scripts/check-changeset-fixed.mjs && node scripts/check-changeset-no-major.mjs", "changeset": "changeset", "changeset:version": "changeset version", - "changeset:publish": "node scripts/check-published-dist-tooling.mjs && changeset publish", "test:e2e": "playwright test", "test:e2e:ui": "playwright test --ui", "test:e2e:live": "playwright test --config=playwright.live.config.ts", diff --git a/ui/scripts/__tests__/check-published-dist-tooling.test.ts b/ui/scripts/__tests__/check-published-dist-tooling.test.ts index 9ff64a99afb..37ba1f1d113 100644 --- a/ui/scripts/__tests__/check-published-dist-tooling.test.ts +++ b/ui/scripts/__tests__/check-published-dist-tooling.test.ts @@ -503,13 +503,23 @@ describe('wiring', () => { it('runs on the publish path, before anything is published', () => { // The ruling (objectui#4846 comment 5307574139) put the gate where the harm - // materialises. `changeset:publish` is the command `changesets/action` runs - // to push tarballs to npm, so a red gate stops the publish itself rather - // than reporting after the fact. - expect(manifest.scripts['changeset:publish']).toContain(GATE); - expect(manifest.scripts['changeset:publish'].indexOf(GATE)).toBeLessThan( - manifest.scripts['changeset:publish'].indexOf('changeset publish'), - ); + // materialises. The release publishes through the workspace root's + // `release` script (release.yml's publish step runs `pnpm run release`), + // whose last command is `scripts/release-publish.sh`; that script runs the + // gate with `--no-build` and refuses to go on when it is red, before + // `changeset publish` packs a single tarball. So a red gate stops the + // publish itself rather than reporting after the fact. Comment lines are + // dropped first: the script's header names `changeset publish` in prose. + // `repoRoot` in this file is the objectui root, `ui/` under the monorepo. + const workspace = workspaceRoot(repoRoot); + const scripts = rootManifest(repoRoot).scripts as Record; + expect(scripts.release.endsWith(' && bash scripts/release-publish.sh')).toBe(true); + const publish = withoutComments(fs.readFileSync(path.join(workspace, 'scripts/release-publish.sh'), 'utf8')); + const gate = `node ${path.relative(workspace, path.join(repoRoot, GATE))} --no-build`; + expect(publish).toMatch(new RegExp(`^if ! ${gate.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}; then$`, 'm')); + const publishAt = publish.search(/^changeset publish\b/m); + expect(publishAt).toBeGreaterThan(-1); + expect(publish.indexOf(gate)).toBeLessThan(publishAt); }); // The full-battery half (objectstack#26717). objectui scheduled the scan