Skip to content

fix(effect-sdk): publish against effect rc.118's stable import paths - #1175

Closed
JeremyFunk wants to merge 2 commits into
mainfrom
fix/effect-sdk-rc118
Closed

JeremyFunk wants to merge 2 commits into
mainfrom
fix/effect-sdk-rc118

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Effect 4.0.0-rc.118 removed every effect/unstable/* export (http, observability are now effect/http, effect/observability). The published SDK imports the old paths, so @maple-dev/effect-sdk/server fails with ERR_MODULE_NOT_FOUND on rc.118 even though the peer range accepts it.

The monorepo (and every in-repo SDK consumer) is still on rc.117, where only the unstable paths exist, so the source can't switch yet.

  • tsdown.config.ts: with MAPLE_EFFECT_STABLE_PATHS=1, a renderChunk plugin rewrites effect/unstable/* specifiers to effect/* in .mjs and .d.mts output
  • prepack builds with the rewrite; postpack rebuilds normally so the local dist/ keeps working for in-repo apps
  • peer effect → >=4.0.0-rc.118
  • README Cloudflare example uses effect/http
  • Config.String / Config.Redacted (the other half of the report) were already fixed on main in 0.9.0, which isn't on npm yet

Verified:

  • SDK source typechecks and its 139 tests pass against rc.118 (with paths rewritten)
  • bun pm pack tarball contains only effect/http / effect/observability, peer >=4.0.0-rc.118; local dist/ still has unstable paths afterwards
  • Packed dist imported under Node with rc.118: all four entries load, Maple.layer exports a span + log

Remove the plugin and scripts once the monorepo moves to rc.118.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Compatibility

    • The minimum supported Effect version is now 4.0.0-rc.118.
    • Packaged builds use stable Effect import paths when applicable.
  • Documentation

    • Updated the Cloudflare Workers example to use the stable effect/http import path.

…ty paths

rc.118 moved effect/unstable/{http,observability} to effect/{http,observability}
with no aliases, so importing the published SDK threw ERR_MODULE_NOT_FOUND.
The monorepo stays on rc.117, so the source keeps the unstable paths and
prepack rebuilds the tarball with them rewritten; postpack restores the
in-repo build. Peer range moves to >=4.0.0-rc.118.
@maple-review-bot

maple-review-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Maple review

🔴 Confidence 2/5 · risky as written
The published-artifact rewrite is only verified by hand, and the peer bump ships with a stale bun.lock that CI's frozen install has to regenerate.
quality 90/100 · 1 warning · tests partial · risk high

Publishes the Effect SDK against rc.118 by rewriting effect/unstable/{http,observability} to their stable paths in the packed build, and raises the effect peer floor to rc.118. The mechanism is contained, but the peer bump lands without the matching bun.lock update.

  • tsdown renderChunk plugin rewrites effect/unstable/* to effect/* under MAPLE_EFFECT_STABLE_PATHS=1
  • prepack packs the rewritten build; postpack restores the unstable-path local dist
  • effect peer floor raised to >=4.0.0-rc.118

Findings

🟠 Warning · F1 · Peer bump leaves bun.lock stale for the frozen CI install

correctness · packages/effect-sdk/package.json:77

bun.lock still records "effect": ">=4.0.0-rc.113" for packages/effect-sdk (bun.lock:779) while this line now asks for >=4.0.0-rc.118, and the workspace pins effect at 4.0.0-rc.117 (package.json:99). bun only tolerates a peer edit while the installed version still matches: in a scratch workspace with a package whose peer range stopped matching the present version, bun install re-ran dependency resolution (fetching that manifest) instead of reporting "no changes", so CI's bun install --frozen-lockfile (.github/actions/bun-install/action.yml:39) has to update the lockfile and refuses. Regenerate and commit bun.lock with the pinned bun.

Run `bun install` with the pinned bun and commit the resulting `bun.lock` alongside the peer bump.
🤖 Prompt to fix this finding with an AI agent
Findings from an automated review of commit 381e3470f87a50cae92cbff2075f505348d33d4b. Verify each one against the current code before changing anything, fix only those that still apply, and keep each fix to the lines it names.

---

F1 · Warning · correctness · packages/effect-sdk/package.json:77
Peer bump leaves `bun.lock` stale for the frozen CI install
`bun.lock` still records `"effect": ">=4.0.0-rc.113"` for `packages/effect-sdk` (bun.lock:779) while this line now asks for `>=4.0.0-rc.118`, and the workspace pins `effect` at `4.0.0-rc.117` (package.json:99). bun only tolerates a peer edit while the installed version still matches: in a scratch workspace with a package whose peer range stopped matching the present version, `bun install` re-ran dependency resolution (fetching that manifest) instead of reporting "no changes", so CI's `bun install --frozen-lockfile` (`.github/actions/bun-install/action.yml:39`) has to update the lockfile and refuses. Regenerate and commit `bun.lock` with the pinned bun.
Suggested fix: Run `bun install` with the pinned bun and commit the resulting `bun.lock` alongside the peer bump.
What was checked
  • Every effect/unstable/* import in the SDK is under http or observability (grep of packages/effect-sdk/src)
  • The regex matches single and double quotes, so bundled .mjs specifiers are covered
  • dts is emitted by tsgo in a separate pass; flushable-tracer/flushable-logger reference OtlpResource only in emitted types

381e347 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b3f2ba0b-dfe2-4d1d-902c-4b18c099463f

📥 Commits

Reviewing files that changed from the base of the PR and between 2e91012 and e794e79.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • packages/effect-sdk/README.md
  • packages/effect-sdk/package.json
  • packages/effect-sdk/tsdown.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The Effect SDK package adds conditional rewriting of unstable Effect import paths during its prepack build. It also runs a postpack build, raises the minimum Effect peer dependency version, and updates the Cloudflare Workers example import.

Changes

Effect SDK packaging

Layer / File(s) Summary
Stable import path packaging
packages/effect-sdk/tsdown.config.ts, packages/effect-sdk/package.json, packages/effect-sdk/README.md
The prepack build enables rewriting quoted effect/unstable/ paths to effect/. The package runs a postpack build, raises the minimum effect peer dependency to 4.0.0-rc.118, and updates the Cloudflare example to import HttpRouter from effect/http.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: makisuo

Merge Risk: ⚪ Minimal · up to e794e

The SDK now targets Effect rc.118 for published imports. No concrete packaging or workspace-install failure is established, so no specific merge blocker is supported.

Architecture Summary

Architecture risk: 🔵 Low · up to e794e

The change affects 1 system.

Changed systems: packages/effect-sdk

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/effect-sdk (library) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/effect-sdk/README.md: The Cloudflare Workers example now imports HttpRouter from effect/http instead of effect/unstable/http.
  • observed — Modified behavior in packages/effect-sdk/package.json: Adds a prepack build with MAPLE_EFFECT_STABLE_PATHS=1 and a postpack build without that environment variable.
  • observed — Modified behavior in packages/effect-sdk/package.json: Raises the minimum effect peer dependency from 4.0.0-rc.113 to 4.0.0-rc.118.
  • observed — Modified behavior in packages/effect-sdk/tsdown.config.ts: Comments document the old and new Effect paths and the intended prepack rewrite. The local stableEffectPaths flag is true only when MAPLE_EFFECT_STABLE_PATHS is "1".
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: publishing effect-sdk against Effect rc.118 stable import paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 inline note from Maple's review. The score and summary are in the review comment above.

Comment thread packages/effect-sdk/package.json
@maple-review-bot

maple-review-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 5/5 · safe to merge
bun.lock now mirrors packages/effect-sdk/package.json exactly, so the frozen-lockfile CI install is consistent again.
quality 100/100 · no findings · tests not needed · risk low

The head commit refreshes bun.lock for the effect-sdk peer bump so the frozen CI install matches the manifest. Consistent with packages/effect-sdk/package.json; safe to merge.

  • bun.lock records effect: >=4.0.0-rc.118 for packages/effect-sdk

Fixed since the last review

  • ✅ F1 · Peer bump leaves bun.lock stale for the frozen CI install
What was checked
  • bun.lock:762-781 matches package.json deps, devDeps and the new peer range
  • No other rc.113/rc.118 stale entry for effect-sdk elsewhere in bun.lock

e794e79 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

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