Repository navigation
feat(cli): add Nuxt and Angular to sentry wizard - #2525
Open
sentry-junior[bot] wants to merge 39 commits into
Open
sentry-junior[bot] wants to merge 39 commits into
sentry-junior[bot] wants to merge 39 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 Nuxt and Angular flows of sentry-wizard 9.1.0 into `sentry wizard -i nuxt` and `sentry wizard -i angular`, with their tests. Angular uploads source maps with `sentry` commands. sentry-wizard ran its source maps wizard here with the Angular tool preselected; the flow now calls that tool's setup (`sourcemaps/tools/sentry-cli.ts`) and the CI step directly, since the other source maps steps are already done by then. The tool installs `sentry@^4` instead of `@sentry/cli@^2` and its `sentry:sourcemaps` script runs `sentry sourcemap inject` and `sentry sourcemap upload --org … --project …` instead of `sentry-cli sourcemaps …`. v4 has no `--url`, so self-hosted users are told to set `SENTRY_URL`. The CI step asks to run that script in CI again, as it did upstream. Errors that sentry-wizard sent with a raw `captureException` go through `reportCliError`; a missing or unparsable `angular.json` is logged with `debug()` instead, since it is not a bug. 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
|
…nuxt-angular Picks up the removal of the sign-up and partner flags. The Nuxt and Angular flows no longer pass `promoCode` to `printWelcome()`, and Angular calls `setupCI(selectedTool, authToken)` without `comingFrom`. The wizard docs fragment keeps both the removed-flags note and the source maps note. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
The `sentry:sourcemaps` script that the Angular flow adds no longer passes the hidden `--org`/`--project` compat flags. It is now `sentry sourcemap inject <dir> && sentry sourcemap upload <dir>`. The wizard writes the org and project to the `[defaults]` section of the project's `.sentryclirc`, which v4 already reads for org/project resolution. The edit keeps every other key, comment and section, including the `[auth]` token that the wizard still writes next to it, as sentry-wizard did. The file stays in `.gitignore`. For CI, `setupCI` takes an optional upload target. Angular passes it, so the CI step lists `SENTRY_ORG`, `SENTRY_PROJECT` and, for self-hosted Sentry, `SENTRY_URL` next to `SENTRY_AUTH_TOKEN`. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…yclirc v4 refuses a non-SaaS `[defaults] url` from `.sentryclirc` unless the token's host or a stored login vouches for it, and the `[auth] token` in the same file doesn't count. Writing the URL there would make the generated `sentry:sourcemaps` script fail on self-hosted Sentry, so the wizard tells users to set `SENTRY_URL` instead. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 26, 2026
…sourcemaps-cloudflare Picks up the removed sign-up and partner flags. The source maps and Cloudflare wizards no longer pass `promoCode` to `printWelcome`, and `setupCI` loses the `comingFrom` argument. The `sourcemaps/ci.ts` conflict is resolved to the shared version from #2525. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 26, 2026
Generated `sentry` commands no longer pass the hidden `--org` and `--project` compat flags. The generic and Wrangler source maps flows merge `org` and `project` into the project's `.sentryclirc` `[defaults]`, next to the existing `[auth] token` and any other keys, and v4 reads them from there. Wrangler's `sentry:sourcemaps` script drops the `SENTRY_URL=` prefix and the flags from `sentry release create` and `sentry sourcemap upload`. The self-hosted URL is not written to the file. v4 only trusts a non-SaaS `[defaults] url` when the token's host or a stored login vouches for it, and a token from the same file does not, so the upload would be refused. Self-hosted users are told to set `SENTRY_URL` instead. `setupCI` gets the upload target, so the CI step lists `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_PROJECT` and, for self-hosted, `SENTRY_URL`. Wrangler counts as a `sentry`-command tool there (its token lives in `.sentryclirc`), but skips the "run the script in CI" prompt, since its `post<deploy>` script already runs it. `sentry@^4` is installed as a devDependency. `sourcemaps/ci.ts`, `sourcemaps/tools/sentry-cli.ts`, `angular.ts`, `types.ts` and `abort-if-sportlight-not-supported.ts` now match #2525, apart from exporting `addOrgAndProjectToSentryCliRc` for Wrangler, the devDependency install, and the Wrangler CI case. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
- 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>
- Angular: pass --force-install through to installPackage, like the Next.js and Nuxt flows. - Nuxt: name the generated SentryErrorButton component in the closing message. - Nuxt: still create the example API route when the example page already exists, and keep an existing API route. - Nuxt: drop ignoreResponseError from the example page so the expected 500 from the API route shows the success message. Adds regression tests for each. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…ed url On sentry.io, v4 `sentry sourcemap upload` resolves the org and project from the DSN, so the CI step now lists only SENTRY_AUTH_TOKEN. Self-hosted CI still needs SENTRY_ORG, SENTRY_PROJECT and SENTRY_URL. For self-hosted Sentry the wizard also writes `url` to the `.sentryclirc` [defaults] section, next to org/project and the [auth] token. v4 reads it once the CLI trusts an [auth] token from the same file for that URL; until that same-file trust fix lands, users set SENTRY_URL. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
- Nuxt: createExampleComponent reports a write failure and exits the wizard cleanly, like createExamplePage. - Nuxt: supportsExamplePage also accepts the kebab-case <nuxt-page> tag. - configureSentryCLI forwards forceInstall to the `sentry` CLI install, and the Angular wizard passes it through. - Angular: the generated example component no longer logs the connectivity result to the browser console. - Angular: the manual source map snippet sets sourceMap under configurations.production, matching the automatic angular.json edit. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 27, 2026
Takes `sourcemaps/tools/sentry-cli.ts`, `sourcemaps/tools/angular.ts` and their tests from #2525 (370f74d) unchanged, so both PRs carry the same copies. This brings in the Angular snippet that sets `sourceMap` in the production configuration and the `forceInstall` option for the `sentry` install. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Nuxt 4 defaults the src directory to app/, so the wizard wrote the example page and component there whenever there was no root pages/ directory. A project with a root app.vue and no app/ directory keeps a root srcDir, so app/pages/ would be unreachable and its root app.vue wasn't checked for <NuxtPage>. Use the root in that case. Nuxt 3 and Nuxt 4 projects with an app/ directory are unchanged.
…angular # Conflicts: # packages/cli/src/lib/wizard/run.ts # packages/cli/src/lib/wizard/utils/abort-if-sportlight-not-supported.ts
…cript `sentry sourcemap upload` already injects missing debug IDs into the files on disk before it uploads them, the same way `sentry sourcemap inject` does, so the script ran injection twice. Run only the upload.
The wizard installed `sentry@^4`, which matches no published version, so source map setup stopped after the SDK and config changes. Install the major of the running CLI instead (`sentry@0.x` today), with no shell metacharacters, since installPackage runs the package manager through a shell.
…angular # Conflicts: # packages/cli/src/lib/wizard/run.ts
…angular Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> # Conflicts: # packages/cli/src/lib/wizard/run.ts # packages/cli/src/lib/wizard/sourcemaps/ci.ts # packages/cli/src/lib/wizard/sourcemaps/tools/types.ts # packages/cli/test/lib/wizard/sourcemaps/ci.test.ts # packages/cli/test/lib/wizard/sourcemaps/tools/sentryclirc-file.test.ts
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b07fe83. Configure here.
…: true
magicast can't add a `client` key to a boolean, so a Nuxt config with
`sourcemap: true` made the wizard abort with the manual steps. Expand it
to `{ server: true, client: true }` first, which is what `true` means,
then merge `client: "hidden"`.
github-actions Bot
pushed a commit
to Fields-Education/sentry-mcp
that referenced
this pull request
Nov 28, 2026
…#2529) Part of getsentry#1965 (tracking: getsentry#2511). Stacked on getsentry#2520. Ports two sentry-wizard 9.1.0 (@069923d) flows into the `sentry wizard` picker: - **Source maps** (`src/sourcemaps/` → `src/lib/wizard/sourcemaps/`): every tool (webpack, Vite, Rollup, esbuild, tsc, Create React App, Angular, Wrangler, and the generic "I use another tool" flow), plus `utils/vendor/is-unicorn-supported.ts`, which now reads env vars through `getEnv`. - **Cloudflare** (`src/cloudflare/` → `src/lib/wizard/cloudflare/`). Both are registered in `WIZARD_RUNNERS` with the upstream entry points. The existing `sourcemaps/ci.ts` gains the upstream step that asks the user to run the `sentry:sourcemaps` script in CI. There is no second copy of that file. The webpack, Vite and tsc tools and the Cloudflare config/worker edits still use magicast/recast. getsentry#2510 removes them after v4. ### sentry-cli v2 → v4 Generated projects use the v4 `sentry` CLI from the `sentry` npm package. They install `sentry@<major>.x` as a devDependency instead of `@sentry/cli@^2`. The wizard itself never needs a `sentry-cli` binary: `src/utils/bash.ts` (the `get-cli` download and `sentry-cli --version` check) is not ported. | sentry-cli v2 | v4 | |---|---| | `sentry-cli sourcemaps inject` / `upload` | `sentry sourcemap inject` / `upload` | | `sentry-cli releases propose-version` / `new` | `sentry release propose-version` / `create` | | `--org <org> --project <project>` | `[defaults]` in `.sentryclirc`, or `SENTRY_ORG` / `SENTRY_PROJECT` | | `--url <url>` | `SENTRY_URL` | | Wrangler upload with `--strip-prefix 'dist/..'` | Wrangler upload with `--no-rewrite` | The generated commands don't use the hidden `--org` / `--project` compat flags: - **Local runs**: the generic and Wrangler flows merge `org`, `project` and, on self-hosted Sentry, `url` into the project's `.sentryclirc` `[defaults]`, next to the gitignored `[auth] token` the wizard already writes. Other sections, keys and comments are kept. v4 reads them from there. - **Self-hosted `url`**: this depends on a CLI fix that's in progress separately. Today v4 rejects a non-SaaS `[defaults] url` that sits in the same file as the token. The wizard also tells self-hosted users to set `SENTRY_URL` wherever the script runs. - **CI**: on sentry.io, the CI step lists only `SENTRY_AUTH_TOKEN`. On self-hosted Sentry, it also lists `SENTRY_ORG`, `SENTRY_PROJECT` and `SENTRY_URL`. Wrangler now counts as a `sentry`-command tool there, since its token is in `.sentryclirc`, not `.env.sentry-build-plugin`. It skips the "run the script in CI" prompt because its `post<deploy>` script already runs the upload. The `sentry-cli` tool id and file name stay, so telemetry tags still line up with sentry-wizard's. ### Overlap with the other wizard PRs File paths match upstream, so this and the parallel ports reconcile with a merge. - getsentry#2525 (Nuxt/Angular): `sourcemaps/ci.ts`, `sourcemaps/tools/sentry-cli.ts`, `tools/angular.ts`, `tools/types.ts`, `utils/abort-if-sportlight-not-supported.ts`, and the `sentry-cli`, `ci` and `sentryclirc-file` tests match its head. This PR supersedes these lines of it: - `tools/sentry-cli.ts`: `addOrgAndProjectToSentryCliRc` is exported, so Wrangler writes `[defaults]` the same way. - `tools/sentry-cli.ts`: the `sentry@<major>.x` install passes `devDependency: true`. It's a build-time tool. - `ci.ts`: `"wrangler"` joins `CLI_BASED_FLOW_TOOLS`, and the npm-script CI step is skipped for it. The reasons are in the CI bullet above. - `tools/types.ts`: adds the `SourceMapUploadToolConfigurationFunction` type that the bundler tools use. - getsentry#2526 (SvelteKit/Remix/React Router) adds the same `abort-if-sportlight-not-supported.ts`. This PR takes getsentry#2525's copy, whose JSDoc differs from getsentry#2526's by one line. ### Other differences from upstream - `tools/nextjs.ts` and `tools/remix.ts` are not ported. Nothing in 9.1.0 reaches them. - The redirect to a better-suited wizard (SvelteKit, React Native) calls the CLI's `runWizard` instead of spawning `@sentry/wizard`. - The Wrangler deploy-script parser no longer splits on shell operators inside quotes or `$(…)`. Without this, rerunning the wizard would split inside the version pipe it adds. - Wrangler's `sentry release create` no longer passes `--project`, so the project slug stays out of `package.json`. It depends on getsentry#2534, which makes `release create` default to the resolved project. - The formatter, linter and test tsconfig now skip `packages/cli/test/lib/wizard/**/fixtures/**`, so the Cloudflare fixtures keep their exact upstream bytes. ### Follow-ups - **Remix + Vite** (getsentry#2526): `remix/remix-wizard.ts` there writes `.env.sentry-build-plugin` and links to the manual steps, because `configureVitePlugin` wasn't ported yet. Once both land, swap that back to `configureVitePlugin` from `sourcemaps/tools/vite.ts`. Its path and signature match upstream, so the change is one line. - **Release version hint**: the Wrangler script keeps only the first line of `sentry release propose-version` (`| head -n 1`), because a hint line follows the version on stdout. Tracked in getsentry#2531. ### Open questions 1. **Wrangler prefix**: v4's `--strip-prefix` strips uploaded file paths, not the sources inside the maps. So v2's `--strip-prefix 'dist/..'` was dropped, and the upload relies on release and URL matching. Is that enough? The `sentry:sourcemaps` npm script is now just `sentry sourcemap upload <path>`, because the upload injects debug IDs itself. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A5cf1df7c30f084bc9d1e92f69ae9f377 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A5cf1df7c30f084bc9d1e92f69ae9f377) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A5cf1df7c30f084bc9d1e92f69ae9f377/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
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 #1965 and #2511. Stacked on #2520, which is stacked on #2519.
Ports the Nuxt and Angular wizards of sentry-wizard 9.1.0 (069923d) into
sentry wizardas thenuxtandangularintegrations, and registers both inWIZARD_RUNNERS. Their upstream tests come along.What's ported
src/nuxt/*→src/lib/wizard/nuxt/*andsrc/angular/**→src/lib/wizard/angular/**, with the same mechanical port rules as the Next.js flow.utils/abort-if-sportlight-not-supported.ts. Both flows stop in Spotlight mode, as they did upstream.main.ts) and recast (Angular app config). Unify thesentry initandsentry wizardsetup flows #2510 removes them onceinitandwizardare unified after v4.sentry-clibinary. The wizard doesn't check for one either. The project's ownsentry:sourcemapsscript calls v4sentryfrom thesentrypackage it installs.promoCodeorcomingFrom, and Angular's CI step has no Vercel branch.Source maps (Angular)
Upstream, Angular called
runSourcemapsWizard(options, 'angular'). With the Angular tool preselected, that function's other steps either don't apply here or are already done: the framework-wizard redirect, the SDK version check, project selection, Prettier and the outro. So the Angular flow now calls the tool setup (configureSentryCLI) andsetupCIdirectly.The tool moves from the legacy sentry-cli to v4:
sentrypackage (^4) instead of@sentry/cli@^2.sentry:sourcemapsnpm script issentry sourcemap inject <dir> && sentry sourcemap upload <dir>, in place ofsentry-cli sourcemaps …. It passes no org, project or URL flags.sentry sourcemap uploadreads the org and project from the project's.sentryclirc. The wizard writes them to its[defaults]section (org=,project=, plusurl=for self-hosted Sentry), which v4 already feeds into org/project/url resolution (src/lib/sentryclirc.ts). The edit (setSentryCliRcDefaults) only sets those keys. It keeps every other key, comment and section of an existing file, and updates the keys in every[defaults]section, since the last one wins when the file is read.[auth]section of that file, as upstream did, and v4 still reads it (applySentryCliRcEnvShimmaps it toSENTRY_AUTH_TOKEN). The file stays in.gitignore.sourcemaps/ci.tslists the environment variables to set. On sentry.io that's onlySENTRY_AUTH_TOKEN, because v4 resolves the org and project from the DSN. Self-hosted CI also getsSENTRY_ORG,SENTRY_PROJECTandSENTRY_URL.setupCI(selectedTool, authToken, uploadTarget?)takes the org, project and self-hosted URL as an optional third argument, and Angular passes them. Without it (Next.js), the step shows only the auth token, as before.urlwrite depends on the CLI's same-file trust fix, which is tracked separately. Today v4 refuses a non-SaaS[defaults] urlunless the token's host or a stored login vouches for it, and an[auth] tokenfrom the same file doesn't count (assertRcUrlTrusted). Until that fix lands, self-hosted users setSENTRY_URLwherever the script runs, and the wizard tells them to.sourcemaps/ci.tsagain asks the user to runsentry:sourcemapsin CI for tools that usesentrycommands, the same as upstream'sconfigureCI. That step was dropped whenci.tswas split out for Next.js.Overlap with the source maps PR
These files have the same paths as upstream's
src/sourcemaps/, so reconcile them with the parallel source maps port:sourcemaps/tools/sentry-cli.ts, with the v4 changes above. It also adds the exportedgetSentryCliNpmScriptandsetSentryCliRcDefaults.sourcemaps/tools/angular.ts.angularJsonTemplateis no longer exported.sourcemaps/tools/types.ts. OnlySourceMapUploadToolConfigurationOptionsis here. The unusedSourceMapUploadToolConfigurationFunctionis left out.sourcemaps/ci.ts, for the CI npm-script step and the optional upload target.utils/abort-if-sportlight-not-supported.ts. Other flow ports probably add this file too.sentry-cli.tsandci.tstest files, and the.sentryclircfile test.Once
runSourcemapsWizardlands, Angular could call it again.Behaves differently from sentry-wizard
captureExceptionnow go throughreportCliError: the failedangular.jsonwrite and the failed Nuxt example page.angular.jsonis logged withdebug()and not captured, since it isn't a bug.options. Upstream did that only to hand the project to the source maps wizard.--organd--projecttosentry-cli. Here they come from.sentryclirclocally. In CI they come from the DSN on sentry.io and fromSENTRY_ORG/SENTRY_PROJECTon self-hosted Sentry.Not covered
srcDir: "."and no rootpages/gets the example page underapp/pages/, as upstream does. Left for a follow-up.via @BYK.
--
View Session [Sentry]