Skip to content

fix(audience): add @imtbl/audience to publish workflow version-seeding filter#2843

Merged
ImmutableJeffrey merged 1 commit intomainfrom
fix/audience-publish-version-alignment
Apr 9, 2026
Merged

fix(audience): add @imtbl/audience to publish workflow version-seeding filter#2843
ImmutableJeffrey merged 1 commit intomainfrom
fix/audience-publish-version-alignment

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Contributor

@ImmutableJeffrey ImmutableJeffrey commented Apr 9, 2026

What's broken

The publish workflow keeps trying to ship @imtbl/audience as version 0.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/sdk and @imtbl/checkout-widgets families — 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:

-        run: pnpm --filter @imtbl/sdk... --filter @imtbl/checkout-widgets... exec sh -c "..."
+        run: pnpm --filter @imtbl/sdk... --filter @imtbl/checkout-widgets... --filter @imtbl/audience... exec sh -c "..."

The ... at the end also pulls in @imtbl/audience-core automatically, so both get stamped together with the rest of the SDK family.

Unblocks

  • SDK-66 — publishing WebSDK on npm.
  • SDK-63 — Play can stop vendoring 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

@ImmutableJeffrey ImmutableJeffrey requested review from a team as code owners April 9, 2026 09:49
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 9, 2026

View your CI Pipeline Execution ↗ for commit 7fbed63

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 53s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-09 23:26:05 UTC

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

✅ Pixel Bundle Size — @imtbl/pixel

Metric Size Delta vs main
Gzipped 4897 bytes (4.78 KB) 0 bytes
Raw (minified) 13268 bytes 0 bytes

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
@ImmutableJeffrey ImmutableJeffrey force-pushed the fix/audience-publish-version-alignment branch from 75a7c5a to 7fbed63 Compare April 9, 2026 10:19
@ImmutableJeffrey ImmutableJeffrey changed the title fix(audience): align audience versions with SDK family, unblock publish fix(audience): add @imtbl/audience to publish workflow version-seeding filter Apr 9, 2026
@ImmutableJeffrey ImmutableJeffrey added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit e9b5538 Apr 9, 2026
11 of 12 checks passed
@ImmutableJeffrey ImmutableJeffrey deleted the fix/audience-publish-version-alignment branch April 9, 2026 23:47
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants