Skip to content

fix: pin @effex/core exactly in @effex/platform to avoid split copies#44

Merged
jonlaing merged 1 commit into
mainfrom
fix/platform-pin-core
Jul 24, 2026
Merged

fix: pin @effex/core exactly in @effex/platform to avoid split copies#44
jonlaing merged 1 commit into
mainfrom
fix/platform-pin-core

Conversation

@jonlaing

Copy link
Copy Markdown
Owner

Problem

Confirmed by inspecting a downstream user's lockfile — two `@effex/core` copies coexist in `node_modules`:

```
@effex/core: 1.1.1 (via @effex/dom, @effex/router)
@effex/core: 1.1.0 (via @effex/platform)
```

Same class of bug as the `effect` dedup issue we fixed earlier. Two Effect Context tags with the same name declared in two different `@effex/core` modules don't unify — Signal/Readable/ControlCtx flowing through platform-provided layers doesn't reach dom/router-consuming components. Silent breakage of cross-package interactions.

Root cause

`packages/platform/package.json` had:

```json
"@effex/core": "workspace:^"
```

That publishes as `^X.Y.Z` — a semver range. `@effex/dom`, `@effex/router`, and `@effex/form` all use `"workspace:*"`, which publishes as the exact current version. So the published dep graph looks like:

```
@effex/dom@1.3.0 → @effex/core@1.1.1 (exact)
@effex/router@1.2.5 → @effex/core@1.1.1 (exact)
@effex/platform@1.2.1 → @effex/core@^1.1.0 (range)
```

pnpm can't always hoist to a single version — it may resolve platform's range to a different core than the exact-pinned packages, keeping both in the tree.

Fix

Switched platform's `@effex/core` to `"workspace:*"`. It now publishes as the exact current core version, matching dom/router/form. pnpm gets exact-vs-exact constraints, which can only hoist to one core.

What this does NOT change

Platform's peer deps on `@effex/dom` and `@effex/router` stay on `workspace:^`. Those are peer deps — the user installs them themselves — and semver ranges are appropriate for user-controlled deps. Same for `vite-plugin`'s peer dep on `@effex/platform`.

Downstream consequence

Every future `@effex/core` bump now forces a `@effex/platform` patch bump too. That was already the effective behaviour for dom/router/form — this just brings platform into line.

Test plan

  • `npx tsc --noEmit` clean
  • Full suite: 728 pass / 2 skipped (unchanged)
  • `pnpm install` succeeded with the new spec
  • Once merged + released, verify a downstream project has only one `@effex/core` in `node_modules`

🤖 Generated with Claude Code

Platform's dep on @effex/core was 'workspace:^', which publishes as '^X.Y.Z' — a range. Every other internal package uses 'workspace:*', which publishes as the exact current version. When both are installed, pnpm can end up with two different @effex/core copies in node_modules — and two copies means Effect Context tags declared in one don't unify with the other, silently breaking cross-package interactions.

Switched to 'workspace:*'. Published @effex/platform now pins @effex/core to a single exact version, matching how dom/router/form work. Every core bump will now force a platform patch bump too, which was already the effective behaviour for the other internal packages.

Peer deps on @effex/dom and @effex/router stay on workspace:^ — those are peers the user installs, and semver ranges are appropriate there.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying effex with  Cloudflare Pages  Cloudflare Pages

Latest commit: bed39a9
Status: ✅  Deploy successful!
Preview URL: https://35755845.effex.pages.dev
Branch Preview URL: https://fix-platform-pin-core.effex.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying effex-api with  Cloudflare Pages  Cloudflare Pages

Latest commit: bed39a9
Status: ✅  Deploy successful!
Preview URL: https://90a80ffc.effex-api.pages.dev
Branch Preview URL: https://fix-platform-pin-core.effex-api.pages.dev

View logs

@jonlaing
jonlaing merged commit 59f9fdf into main Jul 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant