Repository navigation
feat(cli): add SvelteKit, Remix and React Router to sentry wizard - #2526
Open
sentry-junior[bot] wants to merge 25 commits into
Open
sentry-junior[bot] wants to merge 25 commits into
sentry-junior[bot] wants to merge 25 commits into
Conversation
Start moving getsentry/sentry-wizard into the CLI as `sentry wizard`. This adds the command with the `@sentry/wizard` integrations and flags (`-i`, `--url`, `--org`, `--project`, `--saas`, `--spotlight`, and the rest), the shared wizard helpers, and the Next.js flow. The other integrations report that they are not available in this version yet. The wizard logs in with the CLI's own login: a stored `sentry auth login` session, an agent handoff, or the device flow, instead of the `account/settings/wizard/<hash>` browser flow. It then picks or creates the project, reads its DSN, and creates an org auth token for source map uploads. Telemetry goes through the CLI's client. `sentry init` stays the agent setup guide; its help now points to `sentry wizard` for the interactive setup. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Port `ast-utils` and `url` from getsentry/sentry-wizard into `src/lib/wizard/utils/`. The SvelteKit, Remix, React Router, Angular, Nuxt, source maps, Cloudflare, React Native and Android wizards all use them, so they land once here and the platform PRs that follow build on them in parallel. `ast-utils` edits recast ASTs, so recast and ast-types become direct dev dependencies; both already came in through magicast. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
`sentry wizard` logs in with the CLI's login, which has no sign-up or partner step, so `--signup`, `--promo-code` and `--coming-from` no longer do anything. Passing one now fails with a message that points to https://sentry.io/signup/ instead of being accepted silently. `promoCode` and `comingFrom` leave `WizardOptions`, the welcome banner and `setupCI`, which loses its Vercel partner branch. The help text and the docs say which `@sentry/wizard` flags were removed. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…st-helpers Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Port the SvelteKit, Remix and React Router flows of getsentry/sentry-wizard 9.1.0 into `src/lib/wizard/` with their tests, and register them as the `sveltekit`, `remix` and `reactRouter` runners of `sentry wizard`. The flows take the same options `@sentry/wizard` passed them, and like upstream they stop with a notice under `--spotlight` (`utils/abort-if-sportlight-not-supported.ts` comes over for that). Changes from upstream: - Remix with a Vite config used the source maps wizard's Vite setup, which isn't in the CLI yet. It now writes `.env.sentry-build-plugin` and points to the manual source map steps instead. - The AST code is typed with ast-types instead of `@babel/types`, which the CLI doesn't depend on; node printing that magicast's `generateCode` did on bare nodes goes through `recast.print`, which is what `generateCode` calls for them. - Failures that went to `Sentry.captureException` go through `reportCliError`. - The SvelteKit fallback for `instrumentation.server` named the file `.ts` even in JavaScript projects; it now uses the project's ending. The upstream test fixtures are kept byte for byte, so formatting, lint and type checks skip `test/lib/wizard/**/fixtures/`. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
…rs' into feat/cli-wizard-sveltekit-remix-react-router Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…ith v4 CI failed on the SvelteKit, Remix and React Router flows: - They still passed `promoCode` to `printWelcome()`, which the scaffold removed with the sign-up and partner flags. - The sentry-wizard codemod fixtures under `test/lib/wizard/**/fixtures/` are excluded from the test tsconfig, so the tsconfig policy now lists them as unchecked on purpose, like the cli3to4 codemod fixtures. The Remix build script used `npx @sentry/remix --upload-sourcemaps`, which runs the legacy sentry-cli. The wizard must not depend on sentry-cli, so the script now runs `sentry sourcemap upload` on the same build path and URL prefix, and the wizard installs `sentry` as a dev dependency so the script works in CI. The org, project and self-hosted URL move from script flags into `.sentryclirc`, which v4 reads; the wizard tells the user to set the matching env vars in CI.
- Skip the `.sentryclirc` URL check, like `sentry init`: the wizard picks its instance (`--url`, `--saas` or a prompt) before it logs in. - Use the stored login's instance for `sentryUrl` when none was chosen, and log in again when the stored login is for another instance. - Link self-hosted users to `/settings/<org>/auth-tokens/`. - Leave an unparseable MCP config alone (show the copy-paste fallback), and let a cancel inside the MCP setup stop the wizard. - Resolve `catalog:` and `catalog:default` against both pnpm default catalog forms. - Find an existing `SENTRY_AUTH_TOKEN` after the comment header of `.env.sentry-build-plugin`, so re-runs don't add a second one. - Run Windows formatters with Node in the standalone binary, where `process.execPath` is `sentry`. - Ask before updating an `@sentry/nextjs` listed in devDependencies, and treat an unknown SDK version as the `^11` the wizard installs. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…st-helpers Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Revert the Remix build script change from 07f26e0. For Remix without Vite the wizard again sets the build script to `npx @sentry/remix --upload-sourcemaps --org … --project …` and writes only the auth token to `.sentryclirc`, as sentry-wizard does. It no longer installs `sentry` as a dev dependency or prints the CI env var note. The promoCode removal from the welcome screen stays. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Address review feedback on the shared wizard helpers: - Enable unicorn/no-array-for-each repo-wide and convert every .forEach call site to for...of, including getLastRequireIndex. - Add buildProjectIssuesUrl to lib/sentry-urls.ts, built on getOrgBaseUrl like buildEventSearchUrl, and delete the wizard-specific wizard/utils/url.ts. - Move findFile into lib/dsn/fs-utils.ts and build it on isRegularFile, so a directory or FIFO with a matching name is skipped. It is async now. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
`sentry wizard [<org>/<project>] [<integration>]` replaces the `@sentry/wizard` flags, with the target first like other commands. - The integration is a positional, one at a time. A bare integration id is never read as a target, and a single bare word is always read as an integration, so a project or org spelled like one is written `my-org/nextjs`, `nextjs/` or `/nextjs`. - The target parses with the CLI's org/project grammar and resolves after login with `resolveOrgOptionalTarget`, like other commands. Without one the org and project pickers run, with no detection. - `-f/--force` is the only flag. It sets both `forceInstall` and `ignoreGitChanges`. - The instance comes from `SENTRY_URL` or the stored login, so the SaaS/self-hosted prompt, `--url`, `--saas` and `skipRcUrlCheck` go. - Spotlight mode follows `SENTRY_SPOTLIGHT`, telemetry follows `isTelemetryEnabled()`, and debug output goes through the CLI logger (`--verbose`, `--log-level`). - Every other `@sentry/wizard` flag and `SENTRY_WIZARD_*` variable is gone, hidden ones included, with `disableTelemetryForRun` and `rejectRemovedFlags`. A test pins the wizard's own flags to `force`, and `check:env-coverage` (part of `ci:policy`) fails when any file under `src/` names `SENTRY_WIZARD_`. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Re-export buildProjectIssuesUrl from lib/sentry-web-urls.ts through withSentryBaseUrl(getApiBaseUrl()), like the other user-facing link builders, so self-hosted and regional logins get links on the host they are authenticated against. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…eat/cli-wizard-shared-ast-helpers Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…e new wizard base Merge feat/cli-wizard-shared-ast-helpers (f0a48de) and fix what it breaks: - `findFile` moved from `wizard/utils/ast-utils.ts` to the async `lib/dsn/fs-utils.ts`; the Remix and SvelteKit flows now await it. - `sentry wizard` takes `[<org>/<project>] [<integration>]` positionals, so the dispatch tests for the three flows pass them that way and check the `target` the flows get. - The base enables `unicorn/no-array-for-each`, so the ported `forEach` loops are `for…of` loops. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…izards
- React Router config: logs and the copy-paste fallback name the config file
the wizard actually edits (.js or .ts).
- React Router config: a method-style `buildEnd() {}` counts as an existing
hook instead of being overwritten.
- React Router example routes: the manual fallback names routes.js and
.jsx/.js modules in JavaScript apps.
- SvelteKit: declining tracing never turns off tracing.server that the
config file already enables.
Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…fallback filename - Pass telemetryEnabled to printWelcome so the disclosure shows, as in the other wizards. - Match quoted "ssr" keys so an existing "ssr": false is flipped, not shadowed. - Name the existing vite.config file in the copy-paste fallback.
…ekit-remix-react-router # Conflicts: # packages/cli/src/lib/wizard/run.ts # packages/cli/src/lib/wizard/utils/abort-if-sportlight-not-supported.ts # packages/cli/test/tsconfig.json
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e1fd683. Configure here.
BYK
approved these changes
Nov 27, 2026
BYK
enabled stacked auto-merge
November 27, 2026 22:59
…ekit-remix-react-router # Conflicts: # .oxfmtrc.json # .oxlintrc.json # packages/cli/src/lib/wizard/run.ts # packages/cli/test/commands/wizard.test.ts # packages/cli/test/tsconfig.json
This branch was successfully deployed
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.

Part of #2511 (under #1965). Stacked on #2520 (shared AST helpers), which sits on #2519 (
sentry wizardscaffold and Next.js). magicast and recast stay until #2510 moves the config edits to a shared flow.What
Ports the SvelteKit, Remix and React Router flows of getsentry/sentry-wizard 9.1.0 (
src/sveltekit/,src/remix/,src/react-router/) intopackages/cli/src/lib/wizard/, with their upstream tests inpackages/cli/test/lib/wizard/.sveltekit,remixandreactRouterare registered inWIZARD_RUNNERS, callingrunSvelteKitWizard,runRemixWizardandrunReactRouterWizardwith the sameWizardOptionsthat upstreamsrc/run.tspasses, sosentry wizard -i <id>and the picker now offer them.The one shared helper these flows needed that the CLI didn't have yet,
utils/abort-if-sportlight-not-supported.ts, comes over with its upstream path and signature. As upstream, all three flows stop with a notice under--spotlight.Changes from upstream
configureVitePlugin(src/sourcemaps/tools/vite.ts), which belongs to the source maps port. For now this branch writes.env.sentry-build-pluginand prints a link to the manual Remix source map steps. When the source maps port lands, swap that call back in; it's one call inremix/remix-wizard.ts.remix build --sourcemap && npx @sentry/remix --upload-sourcemaps --org … --project …(shopify hydrogen buildand--buildPath ./distfor Hydrogen, plus--urlfor self-hosted), and.sentryclircgets the auth token. That is the Remix SDK's own upload script, which uses@sentry/cliinternally, so it stays as is. Self-hosted is detected with theselfHostedflag fromgetOrAskForProjectDatainstead of comparingsentryUrltoDEFAULT_URL.ast-typesnamedTypesinstead of@babel/types, which the CLI doesn't depend on. Where upstream called magicast'sgenerateCodeon a bare node, this branch callsrecast.print, which is whatgenerateCoderuns for a node that has no$code. A few defensive checks that the stricter types make redundant were removed. The React RouterhandleErrorcodemod now narrows the variable declaration properly instead of usingas any. When thehandleErrorvalue isn't a function with a block body, the codemod logs a debug message and skips the edit; upstream threw there.Sentry.captureException(...)calls go throughreportCliError. The SvelteKit Vite fallback snippet prints withclack.rawOutputinstead ofconsole.log.instrumentation.serverfallback always named the file.ts, because(fileEnding ?? isUsingTypeScript())is always truthy. It now uses the project's ending..tsxfiles undertest/lib/wizard/{remix,react-router}/**/fixtures/) are kept byte for byte, because the tests compare against their exact quoting. Oxfmt, Oxlint and the testtsconfig.jsonskippackages/cli/test/lib/wizard/**/fixtures/**, andscripts/tsconfig-policy.test.mjslists them as unchecked on purpose, like the cli3to4 codemod fixtures.max-paramsdisable comment, so that the upstream tests still call them unchanged.Not ported / follow-ups
test/commands/wizard.test.tsusedremixas its example of an integration that isn't available yet. It now usesflutter, so a sibling PR that ports Flutter will need to pick another one.via @BYK.
--
View Session [Sentry]