Skip to content

Commit

Permalink
feat(nextjs): Add instructions on how to set auth token in CI (#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Dec 5, 2023
1 parent 83ec967 commit 0ae9b7a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- feat(nextjs): Add instructions on how to set auth token in CI (#511)

## 3.18.1

- fix(nextjs): Fix app folder lookup (#510)
Expand Down
17 changes: 10 additions & 7 deletions src/nextjs/nextjs-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
import { traceStep, withTelemetry } from '../telemetry';
import { getPackageVersion, hasPackageInstalled } from '../utils/package-json';
import { getNextJsVersionBucket } from './utils';
import { configureCI } from '../sourcemaps/sourcemaps-wizard';

export function runNextjsWizard(options: WizardOptions) {
return withTelemetry(
Expand Down Expand Up @@ -279,19 +280,21 @@ export async function runNextjsWizardWithTelemetry(
path.join(process.cwd(), 'vercel.json'),
);

if (mightBeUsingVercel) {
clack.log.info(
"▲ It seems like you're using Vercel. We recommend using the Sentry Vercel integration to set up an auth token for Vercel deployments: https://vercel.com/integrations/sentry",
);
} else {
await traceStep('configure-ci', () => configureCI('nextjs', authToken));
}

clack.outro(
`${chalk.green('Everything is set up!')}
${chalk.cyan(
'You can validate your setup by starting your dev environment (`next dev`) and visiting "/sentry-example-page".',
)}
${
mightBeUsingVercel
? `
▲ It seems like you're using Vercel. We recommend using the Sentry Vercel integration: https://vercel.com/integrations/sentry
`
: ''
}
${chalk.dim(
'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues',
)}`,
Expand Down
4 changes: 2 additions & 2 deletions src/sourcemaps/sourcemaps-wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async function startToolSetupFlow(
}
}

async function configureCI(
export async function configureCI(
selectedTool: SupportedTools,
authToken: string,
): Promise<void> {
Expand All @@ -243,7 +243,7 @@ async function configureCI(
options: [
{
label: 'Yes',
hint: 'I use a tool like Github Actions, Gitlab, CircleCI, TravisCI, Jenkins, ...',
hint: 'I use a tool like Github Actions, Gitlab, CircleCI, TravisCI, Jenkins, Vercel, ...',
value: true,
},
{
Expand Down

0 comments on commit 0ae9b7a

Please sign in to comment.