Skip to content

Commit 7fbed63

Browse files
fix(audience): add @imtbl/audience to publish workflow version-seeding 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
1 parent 0d02b4e commit 7fbed63

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
git config user.email "platform-sa@users.noreply.github.com"
100100
101101
- name: Initialize current versions
102-
run: pnpm --filter @imtbl/sdk... --filter @imtbl/checkout-widgets... exec sh -c "jq --arg version \"$(npm view @imtbl/metrics versions --json | jq -r '.[-1]')\" '.version = \$version' package.json > package.tmp.json && mv package.tmp.json package.json"
102+
run: pnpm --filter @imtbl/sdk... --filter @imtbl/checkout-widgets... --filter @imtbl/audience... exec sh -c "jq --arg version \"$(npm view @imtbl/metrics versions --json | jq -r '.[-1]')\" '.version = \$version' package.json > package.tmp.json && mv package.tmp.json package.json"
103103

104104
- name: Setup new package versions
105105
run: pnpm nx release version --specifier ${{ env.RELEASE_TYPE }} $( ${{ env.DRY_RUN }} && echo "--dry-run" || echo "")

0 commit comments

Comments
 (0)