fix(audience): add @imtbl/audience to publish workflow version-seeding filter#2843
Merged
ImmutableJeffrey merged 1 commit intomainfrom Apr 9, 2026
Merged
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
nattb8
approved these changes
Apr 9, 2026
JCSanPedro
approved these changes
Apr 9, 2026
ImmutableJeffrey
added a commit
that referenced
this pull request
Apr 10, 2026
The publish workflow's build step (`pnpm build`) runs nx with an explicit
project list — `@imtbl/sdk,@imtbl/checkout-widgets`. `@imtbl/audience` was
missing, so its `dist/` was never produced before `pnpm pack-npm-packages`
ran. Because `@imtbl/audience/package.json` declares `"files": ["dist"]`,
`npm pack` then shipped tarballs containing only `package.json` and
`LICENSE.md` — no compiled output.
Symptom on the registry today:
- `@imtbl/audience@0.0.1-alpha.0` and `@imtbl/audience@2.15.0-alpha.21`
both install successfully but contain no `dist/`. Anything trying to
`import { Audience } from '@imtbl/audience'` fails at module resolution
because `package.json#main` points at `dist/node/index.cjs` and the
file doesn't exist.
PR #2843 added `@imtbl/audience` to the version-seeding step, so it gets
version-bumped on every publish — but the build step was never updated
in lockstep. Add it here, and rename the workflow step labels so they
match what's actually being built/packed.
After this lands, the next publish should produce a real tarball. Verify
locally with:
pnpm build
cd packages/audience/sdk && pnpm pack --dry-run
The dry-run output should list files under `dist/node/`, `dist/browser/`,
and `dist/types/`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
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.
What's broken
The publish workflow keeps trying to ship
@imtbl/audienceas version0.0.1-alpha.0, but that slot on npm is already taken by an old broken copy. npm won't let us overwrite it, so the publish silently skips audience every time.Why
Before publishing, the workflow stamps a fresh version number onto each package. It only does this for packages in the
@imtbl/sdkand@imtbl/checkout-widgetsfamilies — audience isn't on the list, so it never gets a new number and keeps colliding with the bad slot.The fix
Add audience to the list. One line:
The
...at the end also pulls in@imtbl/audience-coreautomatically, so both get stamped together with the rest of the SDK family.Unblocks
imtbl-audience-0.0.0.tgz(immutable/play#5151) once a real version lands on npm.Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com