feat(bundler-plugins)!: Migrate from @sentry/cli to the sentry CLI SDK - #23398
Draft
JPeer264 wants to merge 1 commit into
Draft
feat(bundler-plugins)!: Migrate from @sentry/cli to the sentry CLI SDK#23398JPeer264 wants to merge 1 commit into
JPeer264 wants to merge 1 commit into
Conversation
Contributor
size-limit report 📦
|
JPeer264
force-pushed
the
jp/cli-v3-migration
branch
from
August 13, 2026 14:31
6091f43 to
6a8fbbe
Compare
Replace the @sentry/cli v2 binary wrapper with the programmatic SDK (createSentrySDK) exposed by the new sentry CLI package. A SentryCliAdapter in src/core/cli.ts maps the plugin's structured option shapes onto the SDK's typed methods, keeping all translation in one place: - release create/finalize/set-commits/deploy and sourcemap upload now go through the SDK instead of spawning the CLI binary; one SDK client is created per (options, project) pair since project selection is bound at client creation time - the integration-test fixtures replace the @sentry__cli.patch with a local sentry-stub fixture recording CLI invocations to sentry-cli-mock.json, so upload assertions no longer depend on the binary's internals - remix's release/sourcemap scripts and react-router's buildEnd hook are migrated to the same SDK - add a react-router-7-sourcemaps e2e test app covering the new upload path against a mock Sentry server Requires sentry >= 0.41.0: earlier 0.x builds had a link-fatal named import of Node 22.15+ zstd builtins in the ESM entry, which crashed the whole module on Node 18/20. Co-Authored-By: Claude <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/cli-v3-migration
branch
from
August 14, 2026 10:18
6a8fbbe to
ed29e44
Compare
Member
Author
|
This PR is currently blocked by getsentry/cli#1421 |
betegon
pushed a commit
to getsentry/cli
that referenced
this pull request
Aug 14, 2026
I opened a PR that is using the new CLI instead of the old `@sentry/cli@2`: getsentry/sentry-javascript#23398 Some E2E tests failed with `TypeError: Bun.serve is not a function`, because we actually check internally if `Bun` would be an option. With that polyfill in this CLI this behavior is now forced, without Bun actually being there. Idk why this actually exists, but exporting `Bun` instead fixes it. --- AI description: The Node polyfills were installed with `globalThis.Bun = BunPolyfill`, which broke consumers of the npm package in both directions. Under Bun the global is readonly, so merely importing the package threw "Attempted to assign to readonly property" and took the whole process down. Under Node it left an object named `Bun` on the global, so unrelated libraries that feature-detect `typeof Bun !== "undefined"` took their Bun code path and called methods the polyfill does not implement, failing with errors like "Bun.serve is not a function". Both are reachable by anyone who merely depends on this package, since importing it is enough. The polyfills are already delivered through esbuild's `inject`, which substitutes unbound identifiers with exported bindings, so exporting `Bun` gives the bundle the same value lexically without touching the global. The real Bun is preferred when present, so running under Bun keeps the genuine implementation rather than shadowing it. Verified by importing the built bundle in Node: `globalThis.Bun` stays undefined, where it previously became an object whose `serve` and `version` were missing. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
closes #18518
closes JS-1312
This PR is removing
@sentry/cliin favor ofsentry.Following was done:
SentryCliAdapterto make the usage a little bit more comfortable (especially around uploading sourcemaps for more projects).run()for therelease.deploycommand (this should be fixed with fix(sdk): pass each positional argument as its own argv token cli#1415)sentryCliBinaryExists, because there is no binary anymoreClanker description:
Replace the @sentry/cli v2 binary wrapper with the programmatic SDK (createSentrySDK) exposed by the new sentry CLI package. A SentryCliAdapter in src/core/cli.ts maps the plugin's structured option shapes onto the SDK's typed methods, keeping all translation in one place:
Requires sentry >= 0.41.0: earlier 0.x builds had a link-fatal named import of Node 22.15+ zstd builtins in the ESM entry, which crashed the whole module on Node 18/20.