fix(audience): add @imtbl/audience to publish workflow version-seeding filter#2843
Open
ImmutableJeffrey wants to merge 1 commit intomainfrom
Open
fix(audience): add @imtbl/audience to publish workflow version-seeding filter#2843ImmutableJeffrey wants to merge 1 commit intomainfrom
ImmutableJeffrey wants to merge 1 commit intomainfrom
Conversation
|
View your CI Pipeline Execution ↗ for commit 7fbed63
☁️ Nx Cloud last updated this comment at |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
…g filter PR #2838 shipped the build fixes that make @imtbl/audience installable as a standalone npm package. However, the first publish run after merge (workflow run 24182647672) was unable to actually publish the fixed artifact because of a version collision: Skipped package "@imtbl/audience" because v0.0.1-alpha.0 already exists in https://registry.npmjs.org/ with tag "alpha" ## Root cause The "Initialize current versions" step in publish.yaml seeds package versions from @imtbl/metrics for packages inside the @imtbl/sdk... and @imtbl/checkout-widgets... dependency trees. Each SDK-family package has "version": "0.0.0" committed in source (as a template); the Initialize step is the source of truth at publish time. @imtbl/audience isn't in either of those dependency trees, so it never gets seeded. nx release reads the committed template value 0.0.0 from disk and computes 0.0.1-alpha.0 — which was burned on 2026-04-08 by an earlier publish attempt that pushed the pre-2838 broken build (no prepack stripping, @imtbl/audience-core still listed as a runtime dep pointing at a package that's never published since it's private). The registry refuses to overwrite, so every publish run skips audience indefinitely. Evidence the npm copy is still the broken pre-2838 artifact: $ npm view @imtbl/audience@0.0.1-alpha.0 dependencies --json {"@imtbl/audience-core": "0.0.1-alpha.0"} $ npm view @imtbl/audience@0.0.1-alpha.0 time.created 2026-04-08T04:43:20.487Z # one day before PR #2838 merged $ npm view @imtbl/audience-core versions E404 Not Found # private, never published $ cd /tmp/fresh && npm install @imtbl/audience@0.0.1-alpha.0 E404 on @imtbl/audience-core@0.0.1-alpha.0 PR #2838's body explicitly flagged this as unverified: > nx release should bump it to match the rest (since > projectsRelationship is fixed) — but this hasn't been independently > verified. Verified now: projectsRelationship: fixed does NOT make nx reconcile different starting disk versions. It just means all projects bump under the same release cycle with the same specifier. Without an explicit filter entry in the Initialize step, audience's disk 0.0.0 is read as-is and bumps to 0.0.1-alpha.0. ## Fix Add --filter @imtbl/audience... to the Initialize current versions step. This seeds @imtbl/audience AND @imtbl/audience-core (via the ... transitive-deps suffix) to the latest @imtbl/metrics version from npm on every publish run, matching the pattern used for every other SDK-family package. No source-version changes needed — audience follows the existing convention where source stays at 0.0.0 and the Initialize step is the canonical version writer. ## Expected behaviour on next publish 1. Initialize current versions: reads latest metrics version from npm (e.g. 2.15.0-alpha.20), writes it to all SDK-family package.json files including audience + audience-core. 2. Setup new package versions (nx release): bumps every seeded package from the metrics version to the next prerelease (e.g. 2.15.0-alpha.21) — audience/audience-core in lockstep with the rest of the SDK family. 3. Pack: prepack strips @imtbl/audience-core from audience's dependencies, postpack restores, producing imtbl-audience-<new>.tgz with no workspace references. 4. Release to NPM: publishes @imtbl/audience at the fresh version slot — no collision, because this slot has not been burned. 5. npm install @imtbl/audience@<new-version> in a fresh project resolves and installs cleanly. Refs: SDK-66, SDK-63
75a7c5a to
7fbed63
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #2838 shipped the build fixes that make
@imtbl/audienceinstallable as a standalone npm package. However, the first publish run after merge (workflow run 24182647672) was unable to actually publish the fixed artifact because of a version collision:Evidence the npm copy is still the pre-2838 broken artifact
@imtbl/audience-core— the prepack strip-deps script from PR build(audience): make @imtbl/audience publishable on npm #2838 never ran on this artifact.@imtbl/audience-coreis"private": true.Root cause
The
Initialize current versionsstep in.github/workflows/publish.yamlseeds package versions from@imtbl/metricsfor packages inside the@imtbl/sdk...and@imtbl/checkout-widgets...dependency trees. This is the canonical pattern — every SDK-familypackage.jsonhas"version": "0.0.0"committed in source as a template; the Initialize step is the source of truth at publish time (confirmed:sdk/package.json,packages/checkout/widgets-lib/package.json,packages/internal/metrics/package.json,packages/blockchain-data/sdk/package.jsonall have"version": "0.0.0"onmain).@imtbl/audienceisn't in either of the filtered dependency trees, so it never gets seeded.nx release version --specifier prereleasereads the committed template value0.0.0from disk and computes0.0.1-alpha.0— the slot that was burned on 2026-04-08 by an earlier publish attempt. The registry refuses to overwrite, and nx release skips. This would recur on every publish indefinitely until the gap is closed.PR #2838's body explicitly flagged this as unverified:
Verified now:
projectsRelationship: fixeddoes not reconcile different starting disk versions. It just means all projects bump under the same release cycle with the same specifier. Without an explicit filter entry in the Initialize step, audience's disk0.0.0is read as-is and bumps to0.0.1-alpha.0.The fix
One line, one file — add
--filter @imtbl/audience...to theInitialize current versionsstep:The
...transitive-deps suffix means this filter also includes@imtbl/audience-core(audience's workspace dep), so both packages get seeded to the metrics version on every publish run — in lockstep with the rest of the SDK family.Audience source versions intentionally stay at
0.0.0to match the established SDK-family convention. Nopackage.jsonversion bumps needed; the Initialize step is and remains the canonical version writer.Expected publish behaviour post-merge
Initialize current versions: reads latest@imtbl/metricsversion from npm array tail (currently e.g.2.15.0-alpha.20) → writes it to all SDK-familypackage.jsonfiles includingpackages/audience/sdk/package.jsonandpackages/audience/core/package.json.Setup new package versions(nx release version --specifier prerelease): bumps every seeded package from the metrics version to the next prerelease (e.g.2.15.0-alpha.21) — audience + audience-core in lockstep with@imtbl/sdk,@imtbl/checkout-widgets,@imtbl/blockchain-data, etc.Pack: prepack strips@imtbl/audience-corefrom audience's dependencies, postpack restores, producingimtbl-audience-<new-version>.tgzwith no workspace references.Release to NPM: publishes@imtbl/audienceat the new version slot — no collision, because this slot has not been burned.npm install @imtbl/audience@<new-version>in a fresh project resolves and installs cleanly, with both runtime JS and bundleddist/types/index.d.tsresolving correctly.Why not also bump the disk version
An earlier revision of this PR (force-pushed away) set
packages/audience/sdk/package.jsonandpackages/audience/core/package.jsonto"version": "2.15.0-alpha.19"as a belt-and-suspenders defense. That was wrong:sdk/package.json,packages/checkout/widgets-lib/package.json,packages/internal/metrics/package.json,packages/blockchain-data/sdk/package.json, etc.) have"version": "0.0.0"committed onmain. I had pattern-matched on the transient values I saw in the workflow log, which are the Initialize step's overrides — never committed back per the nx release config'sgit.commit: false.2.15.0-alpha.19was the snapshot value during the 2026-04-09 publish run; by the time this PR merges, metrics will be atalpha.20or beyond and the committed value becomes meaningless.Leaving audience at
0.0.0keeps the convention consistent: disk is a template, Initialize is the source of truth.Test plan
git show origin/main:<path>that all SDK-familypackage.jsonfiles onmainhave"version": "0.0.0".pnpm --filter @imtbl/audience...glob expands to include@imtbl/audience-corevia the transitive-deps suffix.publish.yamlviaworkflow_dispatchwithdry_run: true, release_type: prerelease; confirm the@imtbl/audienceversion in theSetup new package versionslog output matches the other SDK-family packages' new version (e.g. all at2.15.0-alpha.21), not the burned0.0.1-alpha.0slot.npm view @imtbl/audience@latest dependenciesreturns{}(no@imtbl/audience-core) andtime.createdis post-merge.cd /tmp/fresh && npm init -y && npm install @imtbl/audience@latest && node -e "console.log(require('@imtbl/audience'))"— no errors.Unblocks
imtbl-audience-0.0.0.tgzlocally because no installable npm version exists yet. Once this PR merges and a fresh version is published, Play can swappackage.jsonto a version range and deletevendor/.Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com