@sentry/wizard 3.23.1 → 3.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/lib/Steps/Integrations/Electron.js +4 -2
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.d.ts +1 -0
- package/dist/lib/Steps/PromptForParameters.js +8 -2
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +21 -13
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/lib/Steps/Integrations/Electron.ts +18 -3
- package/lib/Steps/PromptForParameters.ts +12 -1
- package/package.json +1 -1
- package/src/nextjs/nextjs-wizard.ts +29 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.23.2
|
|
4
|
+
|
|
5
|
+
- feat(nextjs): Detect typescript usage and emit files accordingly (#580)
|
|
6
|
+
- fix(step-wizards): Show correct URL when prompting DSN (#577)
|
|
7
|
+
- feat(electron): Update code examples for v5 (#591)
|
|
8
|
+
|
|
3
9
|
## 3.23.1
|
|
4
10
|
|
|
5
11
|
- fix(nextjs): Replace `url` with `sentryUrl` in `withSentryConfig` options (#579)
|
|
@@ -84,7 +84,8 @@ var SentryCli_1 = require("../../Helper/SentryCli");
|
|
|
84
84
|
var BaseIntegration_1 = require("./BaseIntegration");
|
|
85
85
|
var MIN_ELECTRON_VERSION_STRING = '2.0.0';
|
|
86
86
|
var MIN_ELECTRON_VERSION = parseInt(MIN_ELECTRON_VERSION_STRING.replace(/\D+/g, ''), 10);
|
|
87
|
-
var
|
|
87
|
+
var CODE_EXAMPLE_MAIN = "// ESM\nimport * as Sentry from '@sentry/electron/main';\n// CommonJs\nconst Sentry = require('@sentry/electron/main');\n\nSentry.init({\n dsn: '___DSN___',\n});";
|
|
88
|
+
var CODE_EXAMPLE_RENDERER = "// ESM\nimport * as Sentry from '@sentry/electron/renderer';\n// CommonJs\nconst Sentry = require('@sentry/electron/renderer');\n\nSentry.init({});";
|
|
88
89
|
var appPackage = {};
|
|
89
90
|
function printExample(example, title) {
|
|
90
91
|
if (title === void 0) { title = ''; }
|
|
@@ -120,7 +121,8 @@ var Electron = /** @class */ (function (_super) {
|
|
|
120
121
|
fs.writeFileSync('./sentry.properties', this._sentryCli.dumpProperties(sentryCliProps));
|
|
121
122
|
(0, Logging_1.green)('Successfully created sentry.properties');
|
|
122
123
|
(0, Logging_1.nl)();
|
|
123
|
-
printExample(
|
|
124
|
+
printExample(CODE_EXAMPLE_MAIN.replace('___DSN___', dsn), 'Add these lines in to your main process code to setup Sentry:');
|
|
125
|
+
printExample(CODE_EXAMPLE_RENDERER, 'Add these lines in to your renderer processes code to setup Sentry:');
|
|
124
126
|
(0, Logging_1.l)('For more information, see https://docs.sentry.io/clients/electron/');
|
|
125
127
|
(0, Logging_1.nl)();
|
|
126
128
|
return [2 /*return*/, {}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Electron.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Electron.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AAEzB,qCAAkC;AAClC,wCAA4B;AAC5B,yCAA6B;AAG7B,gDAA8D;AAC9D,oDAAmD;AACnD,qDAAoD;AAEpD,IAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,IAAM,oBAAoB,GAAG,QAAQ,CACnC,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAC/C,EAAE,CACH,CAAC;AAEF,IAAM,
|
|
1
|
+
{"version":3,"file":"Electron.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Electron.ts"],"names":[],"m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Aa,GAAG,oBAAoB,EACpC;YACA,IAAA,aAAG,EACD,2CAA+B,WAAW,0BAAgB,2BAA2B,YAAS,CAC/F,CAAC;YACF,OAAO,KAAK,CAAC;SACd;aAAM;YACL,oEAAoE;YACpE,UAAU;gBACR,CAAC,CAAC,IAAA,eAAK,EAAC,iBAAK,WAAW,gBAAM,UAAU,kBAAe,CAAC;gBACxD,CAAC,CAAC,IAAA,eAAK,EAAC,iBAAK,WAAW,kBAAe,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AA7GD,CAA8B,iCAAe,GA6G5C;AA7GY,4BAAQ","sourcesContent":["import * as fs from 'fs';\nimport type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport type { Args } from '../../Constants';\nimport { dim, green, l, nl, red } from '../../Helper/Logging';\nimport { SentryCli } from '../../Helper/SentryCli';\nimport { BaseIntegration } from './BaseIntegration';\n\nconst MIN_ELECTRON_VERSION_STRING = '2.0.0';\nconst MIN_ELECTRON_VERSION = parseInt(\n MIN_ELECTRON_VERSION_STRING.replace(/\\D+/g, ''),\n 10,\n);\n\nconst CODE_EXAMPLE_MAIN = `// ESM\nimport * as Sentry from '@sentry/electron/main';\n// CommonJs\nconst Sentry = require('@sentry/electron/main');\n\nSentry.init({\n dsn: '___DSN___',\n});`;\n\nconst CODE_EXAMPLE_RENDERER = `// ESM\nimport * as Sentry from '@sentry/electron/renderer';\n// CommonJs\nconst Sentry = require('@sentry/electron/renderer');\n\nSentry.init({});`;\n\nlet appPackage: any = {};\n\nfunction printExample(example: string, title = ''): void {\n if (title) {\n l(title);\n }\n\n nl();\n dim(example.replace(/^/gm, ' '));\n nl();\n}\n\ntry {\n appPackage = require(path.join(process.cwd(), 'package.json'));\n} catch {\n // We don't need to have this\n}\n\nexport class Electron extends BaseIntegration {\n protected _sentryCli: SentryCli;\n\n public constructor(protected _argv: Args) {\n super(_argv);\n this._sentryCli = new SentryCli(this._argv);\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n public async emit(answers: Answers): Promise<Answers> {\n const dsn = _.get(answers, ['config', 'dsn', 'public'], null);\n nl();\n\n const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);\n fs.writeFileSync(\n './sentry.properties',\n this._sentryCli.dumpProperties(sentryCliProps),\n );\n green('Successfully created sentry.properties');\n nl();\n\n printExample(\n CODE_EXAMPLE_MAIN.replace('___DSN___', dsn),\n 'Add these lines in to your main process code to setup Sentry:',\n );\n\n printExample(\n CODE_EXAMPLE_RENDERER,\n 'Add these lines in to your renderer processes code to setup Sentry:',\n );\n\n l('For more information, see https://docs.sentry.io/clients/electron/');\n nl();\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n\n let success = true;\n nl();\n\n success =\n this._checkDep('electron', MIN_ELECTRON_VERSION_STRING) && success;\n success = this._checkDep('@sentry/electron') && success;\n\n let continued: Answers = { continue: true };\n if (!success && !this._argv.quiet) {\n continued = await prompt({\n message:\n 'There were errors during your project checkup, do you still want to continue?',\n name: 'continue',\n default: false,\n type: 'confirm',\n });\n }\n\n nl();\n\n if (!_.get(continued, 'continue', false)) {\n throw new Error('Please install the required dependencies to continue.');\n }\n\n this._shouldConfigure = Promise.resolve({ electron: true });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n\n private _checkDep(packageName: string, minVersion?: string): boolean {\n const depVersion = parseInt(\n _.get(appPackage, ['dependencies', packageName], '0').replace(/\\D+/g, ''),\n 10,\n );\n const devDepVersion = parseInt(\n _.get(appPackage, ['devDependencies', packageName], '0').replace(\n /\\D+/g,\n '',\n ),\n 10,\n );\n\n if (\n !_.get(appPackage, `dependencies.${packageName}`, false) &&\n !_.get(appPackage, `devDependencies.${packageName}`, false)\n ) {\n red(`✗ ${packageName} isn't in your dependencies`);\n red(' please install it with yarn/npm');\n return false;\n } else if (\n minVersion &&\n depVersion < MIN_ELECTRON_VERSION &&\n devDepVersion < MIN_ELECTRON_VERSION\n ) {\n red(\n `✗ Your installed version of ${packageName} is to old, >${MIN_ELECTRON_VERSION_STRING} needed`,\n );\n return false;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n minVersion\n ? green(`✓ ${packageName} > ${minVersion} is installed`)\n : green(`✓ ${packageName} is installed`);\n return true;\n }\n }\n}\n"]}
|
|
@@ -87,7 +87,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
87
87
|
}
|
|
88
88
|
PromptForParameters.prototype.emit = function (answers) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
var url, organization, project, dsn, auth;
|
|
90
|
+
var url, organization, project, dsnKeyUrl, dsn, auth;
|
|
91
91
|
var _this = this;
|
|
92
92
|
return __generator(this, function (_a) {
|
|
93
93
|
switch (_a.label) {
|
|
@@ -134,6 +134,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
134
134
|
case 3:
|
|
135
135
|
project = _a.sent();
|
|
136
136
|
url = this._getFullUrl(answers, organization.slug, project.slug);
|
|
137
|
+
dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);
|
|
137
138
|
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
138
139
|
{
|
|
139
140
|
message: 'DSN:',
|
|
@@ -143,7 +144,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
143
144
|
validate: this._validateDSN,
|
|
144
145
|
when: this._shouldAsk(answers, 'config.dsn.public', function () {
|
|
145
146
|
(0, Logging_1.dim)('Please copy/paste your DSN');
|
|
146
|
-
(0, Logging_1.dim)("It can be found here: ".concat(
|
|
147
|
+
(0, Logging_1.dim)("It can be found here: ".concat(dsnKeyUrl));
|
|
147
148
|
}),
|
|
148
149
|
},
|
|
149
150
|
])];
|
|
@@ -183,6 +184,11 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
183
184
|
var projSlug = _.get(answers, 'config.project.slug', projectSlug || 'project_slug');
|
|
184
185
|
return "".concat(baseUrl).concat(orgSlug, "/").concat(projSlug);
|
|
185
186
|
};
|
|
187
|
+
PromptForParameters.prototype._getDSNKeyUrl = function (answers, projectSlug) {
|
|
188
|
+
var baseUrl = this._argv.url;
|
|
189
|
+
var projSlug = _.get(answers, 'config.project.slug', projectSlug || 'project_slug');
|
|
190
|
+
return "".concat(baseUrl, "settings/projects/").concat(projSlug, "/keys");
|
|
191
|
+
};
|
|
186
192
|
PromptForParameters.prototype._shouldAsk = function (answers, configKey, preHook) {
|
|
187
193
|
var shouldAsk = _.get(answers, configKey, null) === null;
|
|
188
194
|
if (shouldAsk && preHook) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,wCAA4B;AAE5B,6CAAwC;AACxC,2CAAyD;AACzD,uCAAsC;AAEtC;IAAyC,uCAAQ;IAAjD;;IAuJA,CAAC;IAtJc,kCAAI,GAAjB,UAAkB,OAAgB;;;;;;;wBAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;wBACd,qBAAM,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAA;;wBAA9D,IAAI,CAAC,CAAC,SAAwD,CAAC,EAAE;4BAC/D,sBAAO,EAAE,EAAC;yBACX;wBACD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;4BACpB,sBAAO,EAAE,EAAC;yBACX;wBAEG,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;wBACV,qBAAM,IAAA,iBAAM,EA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CAAE,CAAC;SACpD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACH,0BAAC;AAAD,CAAC,AAvJD,CAAyC,mBAAQ,GAuJhD;AAvJY,kDAAmB;AAgKhC;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAChC,OAAO,KAAK,CAAC;KACd;IAED,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,IAAI;QACF,IAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjE,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAsB,CAAC;QACpE,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YAC5D,OAAO,KAAK,CAAC;SACd;KACF;IAAC,WAAM;QACN,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { dim } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nexport class PromptForParameters extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n this.debug(answers);\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n return {};\n }\n if (this._argv.quiet) {\n return {};\n }\n\n let url = this._getFullUrl(answers);\n const organization: any = await prompt([\n {\n message: 'Organization Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.organization.slug', () => {\n dim('Please copy/paste your organization slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug);\n const project: any = await prompt([\n {\n message: 'Project Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.project.slug', () => {\n dim('Please copy/paste your project slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug, project.slug);\n const dsn = await prompt([\n {\n message: 'DSN:',\n name: 'public',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateDSN,\n when: this._shouldAsk(answers, 'config.dsn.public', () => {\n dim('Please copy/paste your DSN');\n dim(`It can be found here: ${url}`);\n }),\n },\n ]);\n\n const auth = await prompt([\n {\n message: 'Auth Token:',\n name: 'token',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateAuthToken,\n when: this._shouldAsk(answers, 'config.auth.token', () => {\n dim('Please copy/paste your auth token');\n dim(`It can be found here: ${this._argv.url}api/`);\n dim(\n 'In case there is none yet, create one with [project:releases] permission',\n );\n }),\n },\n ]);\n\n return {\n config: _.merge(_.get(answers, 'config'), {\n auth,\n dsn,\n project,\n organization,\n }),\n };\n }\n\n private _getFullUrl(\n answers: Answers,\n organizationSlug?: string,\n projectSlug?: string,\n ): string {\n const baseUrl = this._argv.url;\n const orgSlug = _.get(\n answers,\n 'config.organization.slug',\n organizationSlug || 'organization_slug',\n );\n const projSlug = _.get(\n answers,\n 'config.project.slug',\n projectSlug || 'project_slug',\n );\n return `${baseUrl}${orgSlug}/${projSlug}`;\n }\n\n private _shouldAsk(\n answers: Answers,\n configKey: string,\n preHook?: () => void,\n ): boolean {\n const shouldAsk = _.get(answers, configKey, null) === null;\n if (shouldAsk && preHook) {\n preHook();\n }\n return shouldAsk;\n }\n\n private _validateAuthToken(input: string): boolean | string {\n const isOrgToken = input.startsWith('sntrys_');\n\n if (isOrgToken) {\n if (!isValidOrgToken(input)) {\n return 'Make sure you correctly copied your auth token. It should start with \"sntrys_\"';\n }\n return true;\n }\n\n if (!input.match(/(sntrys_)?[0-9a-f]{64}/g)) {\n return 'Make sure you copied the correct auth token, it should be 64 hex chars';\n }\n return true;\n }\n\n private _validateSlug(input: string): boolean | string {\n if (input.match(/[A-Z]/g)) {\n return 'Please copy the slug from the url, it should be all lowercase';\n }\n if (input.length === 0) {\n return \"Can't be empty\";\n }\n return true;\n }\n\n private _validateDSN(input: string): boolean | string {\n const match = input.match(\n /^(?:(\\w+):)?\\/\\/(?:(\\w+)(:\\w+)?@)?([\\w.-]+)(?::(\\d+))?(\\/.*)$/,\n );\n if (!match) {\n return 'Invalid DSN format';\n }\n if (match[1] !== 'http' && match[1] !== 'https') {\n return `Unsupported protocol for DSN: ${match[1]}`;\n }\n return true;\n }\n}\n\ntype MaybeOrgAuthToken = {\n iat?: number;\n url?: string;\n org?: string;\n region_url?: string;\n};\n\n/**\n * Trying to parse and decode an org auth token. Based on:\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#parsing-tokens\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#token-facts\n */\nfunction isValidOrgToken(input: string): boolean {\n if (!input.startsWith('sntrys_')) {\n return false;\n }\n\n const tokenParts = input.split('_');\n if (tokenParts.length < 3) {\n return false;\n }\n\n try {\n const payload = tokenParts[1];\n const decodedPayload = Buffer.from(payload, 'base64').toString();\n const jsonPayload = JSON.parse(decodedPayload) as MaybeOrgAuthToken;\n if (!jsonPayload.iat || !jsonPayload.url || !jsonPayload.org) {\n return false;\n }\n } catch {\n return false;\n }\n\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":";;;;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OAAO,KAAK,CAAC;KACd;IAED,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,IAAI;QACF,IAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjE,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAsB,CAAC;QACpE,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YAC5D,OAAO,KAAK,CAAC;SACd;KACF;IAAC,WAAM;QACN,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { dim } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nexport class PromptForParameters extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n this.debug(answers);\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n return {};\n }\n if (this._argv.quiet) {\n return {};\n }\n\n let url = this._getFullUrl(answers);\n const organization: any = await prompt([\n {\n message: 'Organization Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.organization.slug', () => {\n dim('Please copy/paste your organization slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug);\n const project: any = await prompt([\n {\n message: 'Project Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.project.slug', () => {\n dim('Please copy/paste your project slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug, project.slug);\n const dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);\n const dsn = await prompt([\n {\n message: 'DSN:',\n name: 'public',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateDSN,\n when: this._shouldAsk(answers, 'config.dsn.public', () => {\n dim('Please copy/paste your DSN');\n dim(`It can be found here: ${dsnKeyUrl}`);\n }),\n },\n ]);\n\n const auth = await prompt([\n {\n message: 'Auth Token:',\n name: 'token',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateAuthToken,\n when: this._shouldAsk(answers, 'config.auth.token', () => {\n dim('Please copy/paste your auth token');\n dim(`It can be found here: ${this._argv.url}api/`);\n dim(\n 'In case there is none yet, create one with [project:releases] permission',\n );\n }),\n },\n ]);\n\n return {\n config: _.merge(_.get(answers, 'config'), {\n auth,\n dsn,\n project,\n organization,\n }),\n };\n }\n\n private _getFullUrl(\n answers: Answers,\n organizationSlug?: string,\n projectSlug?: string,\n ): string {\n const baseUrl = this._argv.url;\n const orgSlug = _.get(\n answers,\n 'config.organization.slug',\n organizationSlug || 'organization_slug',\n );\n const projSlug = _.get(\n answers,\n 'config.project.slug',\n projectSlug || 'project_slug',\n );\n return `${baseUrl}${orgSlug}/${projSlug}`;\n }\n\n private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {\n const baseUrl = this._argv.url;\n const projSlug = _.get(\n answers,\n 'config.project.slug',\n projectSlug || 'project_slug',\n );\n return `${baseUrl}settings/projects/${projSlug}/keys`;\n }\n\n private _shouldAsk(\n answers: Answers,\n configKey: string,\n preHook?: () => void,\n ): boolean {\n const shouldAsk = _.get(answers, configKey, null) === null;\n if (shouldAsk && preHook) {\n preHook();\n }\n return shouldAsk;\n }\n\n private _validateAuthToken(input: string): boolean | string {\n const isOrgToken = input.startsWith('sntrys_');\n\n if (isOrgToken) {\n if (!isValidOrgToken(input)) {\n return 'Make sure you correctly copied your auth token. It should start with \"sntrys_\"';\n }\n return true;\n }\n\n if (!input.match(/(sntrys_)?[0-9a-f]{64}/g)) {\n return 'Make sure you copied the correct auth token, it should be 64 hex chars';\n }\n return true;\n }\n\n private _validateSlug(input: string): boolean | string {\n if (input.match(/[A-Z]/g)) {\n return 'Please copy the slug from the url, it should be all lowercase';\n }\n if (input.length === 0) {\n return \"Can't be empty\";\n }\n return true;\n }\n\n private _validateDSN(input: string): boolean | string {\n const match = input.match(\n /^(?:(\\w+):)?\\/\\/(?:(\\w+)(:\\w+)?@)?([\\w.-]+)(?::(\\d+))?(\\/.*)$/,\n );\n if (!match) {\n return 'Invalid DSN format';\n }\n if (match[1] !== 'http' && match[1] !== 'https') {\n return `Unsupported protocol for DSN: ${match[1]}`;\n }\n return true;\n }\n}\n\ntype MaybeOrgAuthToken = {\n iat?: number;\n url?: string;\n org?: string;\n region_url?: string;\n};\n\n/**\n * Trying to parse and decode an org auth token. Based on:\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#parsing-tokens\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#token-facts\n */\nfunction isValidOrgToken(input: string): boolean {\n if (!input.startsWith('sntrys_')) {\n return false;\n }\n\n const tokenParts = input.split('_');\n if (tokenParts.length < 3) {\n return false;\n }\n\n try {\n const payload = tokenParts[1];\n const decodedPayload = Buffer.from(payload, 'base64').toString();\n const jsonPayload = JSON.parse(decodedPayload) as MaybeOrgAuthToken;\n if (!jsonPayload.iat || !jsonPayload.url || !jsonPayload.org) {\n return false;\n }\n } catch {\n return false;\n }\n\n return true;\n}\n"]}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.2",
|
|
4
4
|
"homepage": "https://github.com/getsentry/sentry-wizard",
|
|
5
5
|
"repository": "https://github.com/getsentry/sentry-wizard",
|
|
6
6
|
"description": "Sentry wizard helping you to configure your project",
|
|
@@ -97,7 +97,7 @@ exports.runNextjsWizard = runNextjsWizard;
|
|
|
97
97
|
function runNextjsWizardWithTelemetry(options) {
|
|
98
98
|
var _a;
|
|
99
99
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
var packageJson, nextVersion, _b, selectedProject, authToken, selfHosted, sentryUrl, sdkAlreadyInstalled, shouldCreateExamplePage, mightBeUsingVercel;
|
|
100
|
+
var typeScriptDetected, packageJson, nextVersion, _b, selectedProject, authToken, selfHosted, sentryUrl, sdkAlreadyInstalled, shouldCreateExamplePage, mightBeUsingVercel;
|
|
101
101
|
var _this = this;
|
|
102
102
|
return __generator(this, function (_c) {
|
|
103
103
|
switch (_c.label) {
|
|
@@ -107,6 +107,7 @@ function runNextjsWizardWithTelemetry(options) {
|
|
|
107
107
|
promoCode: options.promoCode,
|
|
108
108
|
telemetryEnabled: options.telemetryEnabled,
|
|
109
109
|
});
|
|
110
|
+
typeScriptDetected = (0, clack_utils_1.isUsingTypeScript)();
|
|
110
111
|
return [4 /*yield*/, (0, clack_utils_1.confirmContinueIfNoOrDirtyGitRepo)()];
|
|
111
112
|
case 1:
|
|
112
113
|
_c.sent();
|
|
@@ -224,7 +225,7 @@ function runNextjsWizardWithTelemetry(options) {
|
|
|
224
225
|
case 7:
|
|
225
226
|
_c.sent();
|
|
226
227
|
return [4 /*yield*/, (0, telemetry_1.traceStep)('create-global-error-page', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
227
|
-
var maybeAppDirPath, maybeSrcAppDirPath, appDirLocation, globalErrorPageFile, shouldContinue;
|
|
228
|
+
var maybeAppDirPath, maybeSrcAppDirPath, appDirLocation, globalErrorPageFile, newGlobalErrorFileName, shouldContinue;
|
|
228
229
|
return __generator(this, function (_a) {
|
|
229
230
|
switch (_a.label) {
|
|
230
231
|
case 0:
|
|
@@ -250,10 +251,11 @@ function runNextjsWizardWithTelemetry(options) {
|
|
|
250
251
|
? 'global-error.js'
|
|
251
252
|
: undefined;
|
|
252
253
|
if (!!globalErrorPageFile) return [3 /*break*/, 2];
|
|
253
|
-
|
|
254
|
+
newGlobalErrorFileName = "global-error.".concat(typeScriptDetected ? 'tsx' : 'jsx');
|
|
255
|
+
return [4 /*yield*/, fs.promises.writeFile(path.join.apply(path, __spreadArray(__spreadArray([process.cwd()], appDirLocation, false), [newGlobalErrorFileName], false)), (0, templates_1.getSentryDefaultGlobalErrorPage)(), { encoding: 'utf8', flag: 'w' })];
|
|
254
256
|
case 1:
|
|
255
257
|
_a.sent();
|
|
256
|
-
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appDirLocation, false), [
|
|
258
|
+
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appDirLocation, false), [newGlobalErrorFileName], false))), "."));
|
|
257
259
|
return [3 /*break*/, 5];
|
|
258
260
|
case 2:
|
|
259
261
|
prompts_1.default.log.info("It seems like you already have a custom error page for your app directory.\n\nPlease add the following code to your custom error page\nat ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appDirLocation, false), [globalErrorPageFile], false))), ":\n"));
|
|
@@ -388,7 +390,7 @@ function createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, sdkCon
|
|
|
388
390
|
_i++;
|
|
389
391
|
return [3 /*break*/, 1];
|
|
390
392
|
case 4: return [4 /*yield*/, (0, telemetry_1.traceStep)('setup-instrumentation-hook', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
391
|
-
var srcInstrumentationTsExists, srcInstrumentationJsExists, instrumentationTsExists, instrumentationJsExists, instrumentationHookLocation, srcFolderExists, instrumentationHookPath, successfullyCreated;
|
|
393
|
+
var srcInstrumentationTsExists, srcInstrumentationJsExists, instrumentationTsExists, instrumentationJsExists, instrumentationHookLocation, newInstrumentationFileName, srcFolderExists, instrumentationHookPath, successfullyCreated;
|
|
392
394
|
return __generator(this, function (_a) {
|
|
393
395
|
switch (_a.label) {
|
|
394
396
|
case 0:
|
|
@@ -406,15 +408,16 @@ function createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, sdkCon
|
|
|
406
408
|
instrumentationHookLocation = 'does-not-exist';
|
|
407
409
|
}
|
|
408
410
|
if (!(instrumentationHookLocation === 'does-not-exist')) return [3 /*break*/, 4];
|
|
411
|
+
newInstrumentationFileName = "instrumentation.".concat(typeScriptDetected ? 'ts' : 'js');
|
|
409
412
|
srcFolderExists = fs.existsSync(path.join(process.cwd(), 'src'));
|
|
410
413
|
instrumentationHookPath = srcFolderExists
|
|
411
|
-
? path.join(process.cwd(), 'src',
|
|
412
|
-
: path.join(process.cwd(),
|
|
414
|
+
? path.join(process.cwd(), 'src', newInstrumentationFileName)
|
|
415
|
+
: path.join(process.cwd(), newInstrumentationFileName);
|
|
413
416
|
return [4 /*yield*/, (0, clack_utils_1.createNewConfigFile)(instrumentationHookPath, (0, templates_1.getInstrumentationHookContent)(srcFolderExists ? 'src' : 'root'))];
|
|
414
417
|
case 1:
|
|
415
418
|
successfullyCreated = _a.sent();
|
|
416
419
|
if (!!successfullyCreated) return [3 /*break*/, 3];
|
|
417
|
-
return [4 /*yield*/, (0, clack_utils_1.showCopyPasteInstructions)(
|
|
420
|
+
return [4 /*yield*/, (0, clack_utils_1.showCopyPasteInstructions)(newInstrumentationFileName, (0, templates_1.getInstrumentationHookCopyPasteSnippet)(srcFolderExists ? 'src' : 'root'))];
|
|
418
421
|
case 2:
|
|
419
422
|
_a.sent();
|
|
420
423
|
_a.label = 3;
|
|
@@ -553,7 +556,7 @@ function createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, sdkCon
|
|
|
553
556
|
}
|
|
554
557
|
function createExamplePage(selfHosted, selectedProject, sentryUrl) {
|
|
555
558
|
return __awaiter(this, void 0, void 0, function () {
|
|
556
|
-
var srcDir, maybePagesDirPath, maybeSrcPagesDirPath, maybeAppDirPath, maybeSrcAppDirPath, pagesLocation, appLocation, examplePageContents, examplePageContents;
|
|
559
|
+
var srcDir, maybePagesDirPath, maybeSrcPagesDirPath, maybeAppDirPath, maybeSrcAppDirPath, typeScriptDetected, pagesLocation, appLocation, examplePageContents, newPageFileName, newRouteFileName, examplePageContents;
|
|
557
560
|
return __generator(this, function (_a) {
|
|
558
561
|
switch (_a.label) {
|
|
559
562
|
case 0:
|
|
@@ -562,6 +565,7 @@ function createExamplePage(selfHosted, selectedProject, sentryUrl) {
|
|
|
562
565
|
maybeSrcPagesDirPath = path.join(srcDir, 'pages');
|
|
563
566
|
maybeAppDirPath = path.join(process.cwd(), 'app');
|
|
564
567
|
maybeSrcAppDirPath = path.join(srcDir, 'app');
|
|
568
|
+
typeScriptDetected = (0, clack_utils_1.isUsingTypeScript)();
|
|
565
569
|
pagesLocation = fs.existsSync(maybePagesDirPath) &&
|
|
566
570
|
fs.lstatSync(maybePagesDirPath).isDirectory()
|
|
567
571
|
? ['pages']
|
|
@@ -597,20 +601,24 @@ function createExamplePage(selfHosted, selectedProject, sentryUrl) {
|
|
|
597
601
|
fs.mkdirSync(path.join.apply(path, __spreadArray(__spreadArray([process.cwd()], appLocation, false), ['sentry-example-page'], false)), {
|
|
598
602
|
recursive: true,
|
|
599
603
|
});
|
|
604
|
+
newPageFileName = "page.".concat(typeScriptDetected ? 'tsx' : 'jsx');
|
|
600
605
|
return [4 /*yield*/, fs.promises.writeFile(path.join.apply(path, __spreadArray(__spreadArray([process.cwd()], appLocation, false), ['sentry-example-page',
|
|
601
|
-
|
|
606
|
+
newPageFileName], false)), examplePageContents, { encoding: 'utf8', flag: 'w' })];
|
|
602
607
|
case 1:
|
|
603
608
|
_a.sent();
|
|
604
|
-
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appLocation, false), ['sentry-example-page',
|
|
609
|
+
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appLocation, false), ['sentry-example-page', newPageFileName], false))), "."));
|
|
605
610
|
fs.mkdirSync(path.join.apply(path, __spreadArray(__spreadArray([process.cwd()], appLocation, false), ['api', 'sentry-example-api'], false)), {
|
|
606
611
|
recursive: true,
|
|
607
612
|
});
|
|
613
|
+
newRouteFileName = "route.".concat(typeScriptDetected ? 'ts' : 'js');
|
|
608
614
|
return [4 /*yield*/, fs.promises.writeFile(path.join.apply(path, __spreadArray(__spreadArray([process.cwd()], appLocation, false), ['api',
|
|
609
615
|
'sentry-example-api',
|
|
610
|
-
|
|
616
|
+
newRouteFileName], false)), (0, templates_1.getSentryExampleAppDirApiRoute)(), { encoding: 'utf8', flag: 'w' })];
|
|
611
617
|
case 2:
|
|
612
618
|
_a.sent();
|
|
613
|
-
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appLocation, false), ['api',
|
|
619
|
+
prompts_1.default.log.success("Created ".concat(chalk_1.default.cyan(path.join.apply(path, __spreadArray(__spreadArray([], appLocation, false), ['api',
|
|
620
|
+
'sentry-example-api',
|
|
621
|
+
newRouteFileName], false))), "."));
|
|
614
622
|
return [3 /*break*/, 6];
|
|
615
623
|
case 3:
|
|
616
624
|
if (!pagesLocation) return [3 /*break*/, 6];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-wizard.js","sourceRoot":"","sources":["../../../src/nextjs/nextjs-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,yEAAyE;AACzE,2DAAmC;AACnC,gDAA0B;AAC1B,qCAAyB;AACzB,4EAA4E;AAC5E,qCAA+D;AAC/D,yCAA6B;AAE7B,mDAAuC;AAEvC,oDA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,aAAa,WAAE,KAAK,EAAE,uBAAuB,WAC3D,MAAG,CACL,CAAC;;;;;;CAEL;AAED;;;;GAIG;AACH,SAAe,uBAAuB;;;;;wBAC7B,qBAAM,IAAA,qBAAS,EAAC,wBAAwB,EAAE;;;;wCAClB,qBAAM,IAAA,8BAAgB,EACjD,iBAAK,CAAC,MAAM,CAAC;wCACX,OAAO,EACL,sGAAsG;wCACxG,OAAO,EAAE;4CACP;gDACE,KAAK,EAAE,KAAK;gDACZ,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE,gDAAgD;6CACvD;4CACD;gDACE,KAAK,EAAE,IAAI;gDACX,KAAK,EAAE,KAAK;gDACZ,IAAI,EAAE,uFAAuF;6CAC9F;yCACF;wCACD,YAAY,EAAE,KAAK;qCACpB,CAAC,CACH,EAAA;;oCAlBK,oBAAoB,GAAG,SAkB5B;oCAED,IAAI,CAAC,oBAAoB,EAAE;wCACzB,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,0EAA0E,CAC3E,CAAC;qCACH;oCAED,sBAAO,oBAAoB,EAAC;;;yBAC7B,CAAC,EAAA;wBA5BF,sBAAO,SA4BL,EAAC;;;;CACJ","sourcesContent":["/* eslint-disable max-lines */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as fs from 'fs';\n// @ts-ignore - magicast is ESM and TS complains about that. It works though\nimport { builders, generateCode, parseModule } from 'magicast';\nimport * as path from 'path';\n\nimport * as Sentry from '@sentry/node';\n\nimport {\n abort,\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n askShouldCreateExamplePage,\n confirmContinueIfNoOrDirtyGitRepo,\n createNewConfigFile,\n ensurePackageIsInstalled,\n getOrAskForProjectData,\n getPackageDotJson,\n installPackage,\n isUsingTypeScript,\n printWelcome,\n showCopyPasteInstructions,\n} from '../utils/clack-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getSentryConfigContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExampleApiRoute,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n} from './templates';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { getNextJsVersionBucket } from './utils';\nimport { configureCI } from '../sourcemaps/sourcemaps-wizard';\n\nexport function runNextjsWizard(options: WizardOptions) {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'nextjs',\n },\n () => runNextjsWizardWithTelemetry(options),\n );\n}\n\nexport async function runNextjsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Next.js Wizard',\n promoCode: options.promoCode,\n telemetryEnabled: options.telemetryEnabled,\n });\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, 'next', 'Next.js');\n\n const nextVersion = getPackageVersion('next', packageJson);\n Sentry.setTag('nextjs-version', getNextJsVersionBucket(nextVersion));\n\n const { selectedProject, authToken, selfHosted, sentryUrl } =\n await getOrAskForProjectData(options, 'javascript-nextjs');\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/nextjs',\n packageJson,\n );\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n await installPackage({\n packageName: '@sentry/nextjs@^8',\n alreadyInstalled: !!packageJson?.dependencies?.['@sentry/nextjs'],\n });\n\n await traceStep('configure-sdk', async () => {\n const tunnelRoute = await askShouldSetTunnelRoute();\n\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\n });\n });\n\n await traceStep('create-underscoreerror-page', async () => {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n\n const pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n if (!pagesLocation) {\n return;\n }\n\n const underscoreErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...pagesLocation, '_error.tsx'),\n )\n ? '_error.tsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.ts'))\n ? '_error.ts'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.jsx'))\n ? '_error.jsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.js'))\n ? '_error.js'\n : undefined;\n\n if (!underscoreErrorPageFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, '_error.jsx'),\n getSentryDefaultUnderscoreErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(path.join(...pagesLocation, '_error.jsx'))}.`,\n );\n } else if (\n fs\n .readFileSync(\n path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile),\n 'utf8',\n )\n .includes('getInitialProps')\n ) {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease put the following function call in the ${chalk.bold(\n 'getInitialProps',\n )}\\nmethod of your custom error page at ${chalk.bold(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(getSimpleUnderscoreErrorCopyPasteSnippet());\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you modify your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n } else {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getFullUnderscoreErrorCopyPasteSnippet(\n underscoreErrorPageFile === '_error.ts' ||\n underscoreErrorPageFile === '_error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did add the code to your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n await traceStep('create-global-error-page', async () => {\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(process.cwd(), 'src', 'app');\n\n const appDirLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!appDirLocation) {\n return;\n }\n\n const globalErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.tsx'),\n )\n ? 'global-error.tsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.ts'),\n )\n ? 'global-error.ts'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.jsx'),\n )\n ? 'global-error.jsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.js'),\n )\n ? 'global-error.js'\n : undefined;\n\n if (!globalErrorPageFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), ...appDirLocation, 'global-error.jsx'),\n getSentryDefaultGlobalErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appDirLocation, 'global-error.jsx'),\n )}.`,\n );\n } else {\n clack.log.info(\n `It seems like you already have a custom error page for your app directory.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )}:\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getGlobalErrorCopyPasteSnippet(\n globalErrorPageFile === 'global-error.ts' ||\n globalErrorPageFile === 'global-error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did add the code to your ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n const shouldCreateExamplePage = await askShouldCreateExamplePage();\n if (shouldCreateExamplePage) {\n await traceStep('create-example-page', async () =>\n createExamplePage(selfHosted, selectedProject, sentryUrl),\n );\n }\n\n await addDotEnvSentryBuildPluginFile(authToken);\n\n const mightBeUsingVercel = fs.existsSync(\n path.join(process.cwd(), 'vercel.json'),\n );\n\n if (mightBeUsingVercel) {\n clack.log.info(\n \"▲ 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\",\n );\n } else {\n await traceStep('configure-ci', () => configureCI('nextjs', authToken));\n }\n\n clack.outro(`\n${chalk.green('Successfully installed the Sentry Next.js SDK!')} ${\n shouldCreateExamplePage\n ? `\\n\\nYou can validate your setup by restarting your dev environment (${chalk.cyan(\n `next dev`,\n )}) and visiting ${chalk.cyan('\"/sentry-example-page\"')}`\n : ''\n }\n\n${chalk.dim(\n 'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues',\n)}`);\n}\n\ntype SDKConfigOptions = {\n tunnelRoute: boolean;\n};\n\nasync function createOrMergeNextJsFiles(\n selectedProject: SentryProjectData,\n selfHosted: boolean,\n sentryUrl: string,\n sdkConfigOptions: SDKConfigOptions,\n) {\n const typeScriptDetected = isUsingTypeScript();\n\n const configVariants = ['server', 'client', 'edge'] as const;\n\n for (const configVariant of configVariants) {\n await traceStep(`create-sentry-${configVariant}-config`, async () => {\n const jsConfig = `sentry.${configVariant}.config.js`;\n const tsConfig = `sentry.${configVariant}.config.ts`;\n\n const jsConfigExists = fs.existsSync(path.join(process.cwd(), jsConfig));\n const tsConfigExists = fs.existsSync(path.join(process.cwd(), tsConfig));\n\n let shouldWriteFile = true;\n\n if (jsConfigExists || tsConfigExists) {\n const existingConfigs = [];\n\n if (jsConfigExists) {\n existingConfigs.push(jsConfig);\n }\n\n if (tsConfigExists) {\n existingConfigs.push(tsConfig);\n }\n\n const overwriteExistingConfigs = await abortIfCancelled(\n clack.confirm({\n message: `Found existing Sentry ${configVariant} config (${existingConfigs.join(\n ', ',\n )}). Overwrite ${existingConfigs.length > 1 ? 'them' : 'it'}?`,\n }),\n );\n Sentry.setTag(\n `overwrite-${configVariant}-config`,\n overwriteExistingConfigs,\n );\n\n shouldWriteFile = overwriteExistingConfigs;\n\n if (overwriteExistingConfigs) {\n if (jsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), jsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(jsConfig)}.`);\n }\n if (tsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), tsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(tsConfig)}.`);\n }\n }\n }\n\n if (shouldWriteFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), typeScriptDetected ? tsConfig : jsConfig),\n getSentryConfigContents(\n selectedProject.keys[0].dsn.public,\n configVariant,\n ),\n { encoding: 'utf8', flag: 'w' },\n );\n clack.log.success(\n `Created fresh ${chalk.cyan(\n typeScriptDetected ? tsConfig : jsConfig,\n )}.`,\n );\n Sentry.setTag(`created-${configVariant}-config`, true);\n }\n });\n }\n\n await traceStep('setup-instrumentation-hook', async () => {\n const srcInstrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.ts'),\n );\n const srcInstrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.js'),\n );\n const instrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.ts'),\n );\n const instrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.js'),\n );\n\n let instrumentationHookLocation: 'src' | 'root' | 'does-not-exist';\n if (srcInstrumentationTsExists || srcInstrumentationJsExists) {\n instrumentationHookLocation = 'src';\n } else if (instrumentationTsExists || instrumentationJsExists) {\n instrumentationHookLocation = 'root';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n\n if (instrumentationHookLocation === 'does-not-exist') {\n const srcFolderExists = fs.existsSync(path.join(process.cwd(), 'src'));\n\n const instrumentationHookPath = srcFolderExists\n ? path.join(process.cwd(), 'src', 'instrumentation.ts')\n : path.join(process.cwd(), 'instrumentation.ts');\n\n const successfullyCreated = await createNewConfigFile(\n instrumentationHookPath,\n getInstrumentationHookContent(srcFolderExists ? 'src' : 'root'),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions(\n 'instrumentation.ts',\n getInstrumentationHookCopyPasteSnippet(\n srcFolderExists ? 'src' : 'root',\n ),\n );\n }\n } else {\n await showCopyPasteInstructions(\n srcInstrumentationTsExists\n ? 'instrumentation.ts'\n : srcInstrumentationJsExists\n ? 'instrumentation.js'\n : instrumentationTsExists\n ? 'instrumentation.ts'\n : 'instrumentation.js',\n getInstrumentationHookCopyPasteSnippet(instrumentationHookLocation),\n );\n }\n });\n\n await traceStep('setup-next-config', async () => {\n const withSentryConfigOptionsTemplate = getWithSentryConfigOptionsTemplate({\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n sentryUrl,\n tunnelRoute: sdkConfigOptions.tunnelRoute,\n });\n\n const nextConfigJs = 'next.config.js';\n const nextConfigMjs = 'next.config.mjs';\n\n const nextConfigJsExists = fs.existsSync(\n path.join(process.cwd(), nextConfigJs),\n );\n const nextConfigMjsExists = fs.existsSync(\n path.join(process.cwd(), nextConfigMjs),\n );\n\n if (!nextConfigJsExists && !nextConfigMjsExists) {\n Sentry.setTag('next-config-strategy', 'create');\n\n await fs.promises.writeFile(\n path.join(process.cwd(), nextConfigJs),\n getNextjsConfigCjsTemplate(withSentryConfigOptionsTemplate),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan('next.config.js')} with Sentry configuration.`,\n );\n }\n\n if (nextConfigJsExists) {\n Sentry.setTag('next-config-strategy', 'modify');\n\n const nextConfigJsContent = fs.readFileSync(\n path.join(process.cwd(), nextConfigJs),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigJsContent.includes('@sentry/nextjs') &&\n nextConfigJsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n nextConfigJs,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n if (shouldInject) {\n await fs.promises.appendFile(\n path.join(process.cwd(), nextConfigJs),\n getNextjsConfigCjsAppendix(withSentryConfigOptionsTemplate),\n 'utf8',\n );\n\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n nextConfigJs,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n }\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n\n if (nextConfigMjsExists) {\n const nextConfigMjsContent = fs.readFileSync(\n path.join(process.cwd(), nextConfigMjs),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigMjsContent.includes('@sentry/nextjs') &&\n nextConfigMjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n nextConfigMjs,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n try {\n if (shouldInject) {\n const mod = parseModule(nextConfigMjsContent);\n mod.imports.$add({\n from: '@sentry/nextjs',\n imported: 'withSentryConfig',\n local: 'withSentryConfig',\n });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n const expressionToWrap = generateCode(mod.exports.default.$ast).code;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n mod.exports.default = builders.raw(`withSentryConfig(\n ${expressionToWrap},\n ${withSentryConfigOptionsTemplate}\n)`);\n const newCode = mod.generate().code;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), nextConfigMjs),\n newCode,\n {\n encoding: 'utf8',\n flag: 'w',\n },\n );\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n nextConfigMjs,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n } catch {\n Sentry.setTag('next-config-mod-result', 'fail');\n clack.log.warn(\n chalk.yellow(\n `Something went wrong writing to ${chalk.cyan(nextConfigMjs)}`,\n ),\n );\n clack.log.info(\n `Please put the following code snippet into ${chalk.cyan(\n nextConfigMjs,\n )}: ${chalk.dim('You probably have to clean it up a bit.')}\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getNextjsConfigEsmCopyPasteSnippet(withSentryConfigOptionsTemplate),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Are you done putting the snippet above into ${chalk.cyan(\n nextConfigMjs,\n )}?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n }\n });\n}\n\nasync function createExamplePage(\n selfHosted: boolean,\n selectedProject: SentryProjectData,\n sentryUrl: string,\n): Promise<void> {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(srcDir, 'app');\n\n let pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n const appLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!pagesLocation && !appLocation) {\n pagesLocation =\n fs.existsSync(srcDir) && fs.lstatSync(srcDir).isDirectory()\n ? ['src', 'pages']\n : ['pages'];\n fs.mkdirSync(path.join(process.cwd(), ...pagesLocation), {\n recursive: true,\n });\n }\n\n Sentry.setTag('nextjs-app-dir', !!appLocation);\n\n if (appLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: true,\n });\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appLocation, 'sentry-example-page'),\n {\n recursive: true,\n },\n );\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appLocation,\n 'sentry-example-page',\n 'page.jsx',\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appLocation, 'sentry-example-page', 'page.jsx'),\n )}.`,\n );\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appLocation, 'api', 'sentry-example-api'),\n {\n recursive: true,\n },\n );\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appLocation,\n 'api',\n 'sentry-example-api',\n 'route.js',\n ),\n getSentryExampleAppDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appLocation, 'api', 'sentry-example-api', 'route.js'),\n )}.`,\n );\n } else if (pagesLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: false,\n });\n\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, 'sentry-example-page.jsx'),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesLocation, 'sentry-example-page.js'),\n )}.`,\n );\n\n fs.mkdirSync(path.join(process.cwd(), ...pagesLocation, 'api'), {\n recursive: true,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesLocation,\n 'api',\n 'sentry-example-api.js',\n ),\n getSentryExampleApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesLocation, 'api', 'sentry-example-api.js'),\n )}.`,\n );\n }\n}\n\n/**\n * Ask users if they want to set the tunnelRoute option.\n * We can't set this by default because it potentially increases hosting bills.\n * It's valuable enough to for users to justify asking the additional question.\n */\nasync function askShouldSetTunnelRoute() {\n return await traceStep('ask-tunnelRoute-option', async () => {\n const shouldSetTunnelRoute = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to route Sentry requests in the browser through your NextJS server to avoid ad blockers?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Can increase your server load and hosting bill',\n },\n {\n label: 'No',\n value: false,\n hint: 'Browser errors and events might be blocked by ad blockers before being sent to Sentry',\n },\n ],\n initialValue: false,\n }),\n );\n\n if (!shouldSetTunnelRoute) {\n clack.log.info(\n \"Sounds good! We'll leave the option commented for later, just in case :)\",\n );\n }\n\n return shouldSetTunnelRoute;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nextj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F;yCACF;wCACD,YAAY,EAAE,KAAK;qCACpB,CAAC,CACH,EAAA;;oCAlBK,oBAAoB,GAAG,SAkB5B;oCAED,IAAI,CAAC,oBAAoB,EAAE;wCACzB,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,0EAA0E,CAC3E,CAAC;qCACH;oCAED,sBAAO,oBAAoB,EAAC;;;yBAC7B,CAAC,EAAA;wBA5BF,sBAAO,SA4BL,EAAC;;;;CACJ","sourcesContent":["/* eslint-disable max-lines */\n// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as fs from 'fs';\n// @ts-ignore - magicast is ESM and TS complains about that. It works though\nimport { builders, generateCode, parseModule } from 'magicast';\nimport * as path from 'path';\n\nimport * as Sentry from '@sentry/node';\n\nimport {\n abort,\n abortIfCancelled,\n addDotEnvSentryBuildPluginFile,\n askShouldCreateExamplePage,\n confirmContinueIfNoOrDirtyGitRepo,\n createNewConfigFile,\n ensurePackageIsInstalled,\n getOrAskForProjectData,\n getPackageDotJson,\n installPackage,\n isUsingTypeScript,\n printWelcome,\n showCopyPasteInstructions,\n} from '../utils/clack-utils';\nimport { SentryProjectData, WizardOptions } from '../utils/types';\nimport {\n getFullUnderscoreErrorCopyPasteSnippet,\n getGlobalErrorCopyPasteSnippet,\n getInstrumentationHookContent,\n getInstrumentationHookCopyPasteSnippet,\n getNextjsConfigCjsAppendix,\n getNextjsConfigCjsTemplate,\n getNextjsConfigEsmCopyPasteSnippet,\n getSentryConfigContents,\n getSentryDefaultGlobalErrorPage,\n getSentryDefaultUnderscoreErrorPage,\n getSentryExampleApiRoute,\n getSentryExampleAppDirApiRoute,\n getSentryExamplePageContents,\n getSimpleUnderscoreErrorCopyPasteSnippet,\n getWithSentryConfigOptionsTemplate,\n} from './templates';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { getPackageVersion, hasPackageInstalled } from '../utils/package-json';\nimport { getNextJsVersionBucket } from './utils';\nimport { configureCI } from '../sourcemaps/sourcemaps-wizard';\n\nexport function runNextjsWizard(options: WizardOptions) {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'nextjs',\n },\n () => runNextjsWizardWithTelemetry(options),\n );\n}\n\nexport async function runNextjsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Next.js Wizard',\n promoCode: options.promoCode,\n telemetryEnabled: options.telemetryEnabled,\n });\n\n const typeScriptDetected = isUsingTypeScript();\n\n await confirmContinueIfNoOrDirtyGitRepo();\n\n const packageJson = await getPackageDotJson();\n\n await ensurePackageIsInstalled(packageJson, 'next', 'Next.js');\n\n const nextVersion = getPackageVersion('next', packageJson);\n Sentry.setTag('nextjs-version', getNextJsVersionBucket(nextVersion));\n\n const { selectedProject, authToken, selfHosted, sentryUrl } =\n await getOrAskForProjectData(options, 'javascript-nextjs');\n\n const sdkAlreadyInstalled = hasPackageInstalled(\n '@sentry/nextjs',\n packageJson,\n );\n Sentry.setTag('sdk-already-installed', sdkAlreadyInstalled);\n\n await installPackage({\n packageName: '@sentry/nextjs@^8',\n alreadyInstalled: !!packageJson?.dependencies?.['@sentry/nextjs'],\n });\n\n await traceStep('configure-sdk', async () => {\n const tunnelRoute = await askShouldSetTunnelRoute();\n\n await createOrMergeNextJsFiles(selectedProject, selfHosted, sentryUrl, {\n tunnelRoute,\n });\n });\n\n await traceStep('create-underscoreerror-page', async () => {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n\n const pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n if (!pagesLocation) {\n return;\n }\n\n const underscoreErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...pagesLocation, '_error.tsx'),\n )\n ? '_error.tsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.ts'))\n ? '_error.ts'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.jsx'))\n ? '_error.jsx'\n : fs.existsSync(path.join(process.cwd(), ...pagesLocation, '_error.js'))\n ? '_error.js'\n : undefined;\n\n if (!underscoreErrorPageFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, '_error.jsx'),\n getSentryDefaultUnderscoreErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(path.join(...pagesLocation, '_error.jsx'))}.`,\n );\n } else if (\n fs\n .readFileSync(\n path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile),\n 'utf8',\n )\n .includes('getInitialProps')\n ) {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease put the following function call in the ${chalk.bold(\n 'getInitialProps',\n )}\\nmethod of your custom error page at ${chalk.bold(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(getSimpleUnderscoreErrorCopyPasteSnippet());\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did you modify your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n } else {\n clack.log.info(\n `It seems like you already have a custom error page.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )}:`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getFullUnderscoreErrorCopyPasteSnippet(\n underscoreErrorPageFile === '_error.ts' ||\n underscoreErrorPageFile === '_error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did add the code to your ${chalk.cyan(\n path.join(...pagesLocation, underscoreErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n await traceStep('create-global-error-page', async () => {\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(process.cwd(), 'src', 'app');\n\n const appDirLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!appDirLocation) {\n return;\n }\n\n const globalErrorPageFile = fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.tsx'),\n )\n ? 'global-error.tsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.ts'),\n )\n ? 'global-error.ts'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.jsx'),\n )\n ? 'global-error.jsx'\n : fs.existsSync(\n path.join(process.cwd(), ...appDirLocation, 'global-error.js'),\n )\n ? 'global-error.js'\n : undefined;\n\n if (!globalErrorPageFile) {\n const newGlobalErrorFileName = `global-error.${\n typeScriptDetected ? 'tsx' : 'jsx'\n }`;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), ...appDirLocation, newGlobalErrorFileName),\n getSentryDefaultGlobalErrorPage(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appDirLocation, newGlobalErrorFileName),\n )}.`,\n );\n } else {\n clack.log.info(\n `It seems like you already have a custom error page for your app directory.\\n\\nPlease add the following code to your custom error page\\nat ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )}:\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getGlobalErrorCopyPasteSnippet(\n globalErrorPageFile === 'global-error.ts' ||\n globalErrorPageFile === 'global-error.tsx',\n ),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Did add the code to your ${chalk.cyan(\n path.join(...appDirLocation, globalErrorPageFile),\n )} file as described above?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n });\n\n const shouldCreateExamplePage = await askShouldCreateExamplePage();\n if (shouldCreateExamplePage) {\n await traceStep('create-example-page', async () =>\n createExamplePage(selfHosted, selectedProject, sentryUrl),\n );\n }\n\n await addDotEnvSentryBuildPluginFile(authToken);\n\n const mightBeUsingVercel = fs.existsSync(\n path.join(process.cwd(), 'vercel.json'),\n );\n\n if (mightBeUsingVercel) {\n clack.log.info(\n \"▲ 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\",\n );\n } else {\n await traceStep('configure-ci', () => configureCI('nextjs', authToken));\n }\n\n clack.outro(`\n${chalk.green('Successfully installed the Sentry Next.js SDK!')} ${\n shouldCreateExamplePage\n ? `\\n\\nYou can validate your setup by restarting your dev environment (${chalk.cyan(\n `next dev`,\n )}) and visiting ${chalk.cyan('\"/sentry-example-page\"')}`\n : ''\n }\n\n${chalk.dim(\n 'If you encounter any issues, let us know here: https://github.com/getsentry/sentry-javascript/issues',\n)}`);\n}\n\ntype SDKConfigOptions = {\n tunnelRoute: boolean;\n};\n\nasync function createOrMergeNextJsFiles(\n selectedProject: SentryProjectData,\n selfHosted: boolean,\n sentryUrl: string,\n sdkConfigOptions: SDKConfigOptions,\n) {\n const typeScriptDetected = isUsingTypeScript();\n\n const configVariants = ['server', 'client', 'edge'] as const;\n\n for (const configVariant of configVariants) {\n await traceStep(`create-sentry-${configVariant}-config`, async () => {\n const jsConfig = `sentry.${configVariant}.config.js`;\n const tsConfig = `sentry.${configVariant}.config.ts`;\n\n const jsConfigExists = fs.existsSync(path.join(process.cwd(), jsConfig));\n const tsConfigExists = fs.existsSync(path.join(process.cwd(), tsConfig));\n\n let shouldWriteFile = true;\n\n if (jsConfigExists || tsConfigExists) {\n const existingConfigs = [];\n\n if (jsConfigExists) {\n existingConfigs.push(jsConfig);\n }\n\n if (tsConfigExists) {\n existingConfigs.push(tsConfig);\n }\n\n const overwriteExistingConfigs = await abortIfCancelled(\n clack.confirm({\n message: `Found existing Sentry ${configVariant} config (${existingConfigs.join(\n ', ',\n )}). Overwrite ${existingConfigs.length > 1 ? 'them' : 'it'}?`,\n }),\n );\n Sentry.setTag(\n `overwrite-${configVariant}-config`,\n overwriteExistingConfigs,\n );\n\n shouldWriteFile = overwriteExistingConfigs;\n\n if (overwriteExistingConfigs) {\n if (jsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), jsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(jsConfig)}.`);\n }\n if (tsConfigExists) {\n fs.unlinkSync(path.join(process.cwd(), tsConfig));\n clack.log.warn(`Removed existing ${chalk.cyan(tsConfig)}.`);\n }\n }\n }\n\n if (shouldWriteFile) {\n await fs.promises.writeFile(\n path.join(process.cwd(), typeScriptDetected ? tsConfig : jsConfig),\n getSentryConfigContents(\n selectedProject.keys[0].dsn.public,\n configVariant,\n ),\n { encoding: 'utf8', flag: 'w' },\n );\n clack.log.success(\n `Created fresh ${chalk.cyan(\n typeScriptDetected ? tsConfig : jsConfig,\n )}.`,\n );\n Sentry.setTag(`created-${configVariant}-config`, true);\n }\n });\n }\n\n await traceStep('setup-instrumentation-hook', async () => {\n const srcInstrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.ts'),\n );\n const srcInstrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'src', 'instrumentation.js'),\n );\n const instrumentationTsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.ts'),\n );\n const instrumentationJsExists = fs.existsSync(\n path.join(process.cwd(), 'instrumentation.js'),\n );\n\n let instrumentationHookLocation: 'src' | 'root' | 'does-not-exist';\n if (srcInstrumentationTsExists || srcInstrumentationJsExists) {\n instrumentationHookLocation = 'src';\n } else if (instrumentationTsExists || instrumentationJsExists) {\n instrumentationHookLocation = 'root';\n } else {\n instrumentationHookLocation = 'does-not-exist';\n }\n\n if (instrumentationHookLocation === 'does-not-exist') {\n const newInstrumentationFileName = `instrumentation.${\n typeScriptDetected ? 'ts' : 'js'\n }`;\n const srcFolderExists = fs.existsSync(path.join(process.cwd(), 'src'));\n\n const instrumentationHookPath = srcFolderExists\n ? path.join(process.cwd(), 'src', newInstrumentationFileName)\n : path.join(process.cwd(), newInstrumentationFileName);\n\n const successfullyCreated = await createNewConfigFile(\n instrumentationHookPath,\n getInstrumentationHookContent(srcFolderExists ? 'src' : 'root'),\n );\n\n if (!successfullyCreated) {\n await showCopyPasteInstructions(\n newInstrumentationFileName,\n getInstrumentationHookCopyPasteSnippet(\n srcFolderExists ? 'src' : 'root',\n ),\n );\n }\n } else {\n await showCopyPasteInstructions(\n srcInstrumentationTsExists\n ? 'instrumentation.ts'\n : srcInstrumentationJsExists\n ? 'instrumentation.js'\n : instrumentationTsExists\n ? 'instrumentation.ts'\n : 'instrumentation.js',\n getInstrumentationHookCopyPasteSnippet(instrumentationHookLocation),\n );\n }\n });\n\n await traceStep('setup-next-config', async () => {\n const withSentryConfigOptionsTemplate = getWithSentryConfigOptionsTemplate({\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n selfHosted,\n sentryUrl,\n tunnelRoute: sdkConfigOptions.tunnelRoute,\n });\n\n const nextConfigJs = 'next.config.js';\n const nextConfigMjs = 'next.config.mjs';\n\n const nextConfigJsExists = fs.existsSync(\n path.join(process.cwd(), nextConfigJs),\n );\n const nextConfigMjsExists = fs.existsSync(\n path.join(process.cwd(), nextConfigMjs),\n );\n\n if (!nextConfigJsExists && !nextConfigMjsExists) {\n Sentry.setTag('next-config-strategy', 'create');\n\n await fs.promises.writeFile(\n path.join(process.cwd(), nextConfigJs),\n getNextjsConfigCjsTemplate(withSentryConfigOptionsTemplate),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan('next.config.js')} with Sentry configuration.`,\n );\n }\n\n if (nextConfigJsExists) {\n Sentry.setTag('next-config-strategy', 'modify');\n\n const nextConfigJsContent = fs.readFileSync(\n path.join(process.cwd(), nextConfigJs),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigJsContent.includes('@sentry/nextjs') &&\n nextConfigJsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n nextConfigJs,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n if (shouldInject) {\n await fs.promises.appendFile(\n path.join(process.cwd(), nextConfigJs),\n getNextjsConfigCjsAppendix(withSentryConfigOptionsTemplate),\n 'utf8',\n );\n\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n nextConfigJs,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n }\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n\n if (nextConfigMjsExists) {\n const nextConfigMjsContent = fs.readFileSync(\n path.join(process.cwd(), nextConfigMjs),\n 'utf8',\n );\n\n const probablyIncludesSdk =\n nextConfigMjsContent.includes('@sentry/nextjs') &&\n nextConfigMjsContent.includes('withSentryConfig');\n\n let shouldInject = true;\n\n if (probablyIncludesSdk) {\n const injectAnyhow = await abortIfCancelled(\n clack.confirm({\n message: `${chalk.cyan(\n nextConfigMjs,\n )} already contains Sentry SDK configuration. Should the wizard modify it anyways?`,\n }),\n );\n\n shouldInject = injectAnyhow;\n }\n\n try {\n if (shouldInject) {\n const mod = parseModule(nextConfigMjsContent);\n mod.imports.$add({\n from: '@sentry/nextjs',\n imported: 'withSentryConfig',\n local: 'withSentryConfig',\n });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n const expressionToWrap = generateCode(mod.exports.default.$ast).code;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n mod.exports.default = builders.raw(`withSentryConfig(\n ${expressionToWrap},\n ${withSentryConfigOptionsTemplate}\n)`);\n const newCode = mod.generate().code;\n\n await fs.promises.writeFile(\n path.join(process.cwd(), nextConfigMjs),\n newCode,\n {\n encoding: 'utf8',\n flag: 'w',\n },\n );\n clack.log.success(\n `Added Sentry configuration to ${chalk.cyan(\n nextConfigMjs,\n )}. ${chalk.dim('(you probably want to clean this up a bit!)')}`,\n );\n\n Sentry.setTag('next-config-mod-result', 'success');\n }\n } catch {\n Sentry.setTag('next-config-mod-result', 'fail');\n clack.log.warn(\n chalk.yellow(\n `Something went wrong writing to ${chalk.cyan(nextConfigMjs)}`,\n ),\n );\n clack.log.info(\n `Please put the following code snippet into ${chalk.cyan(\n nextConfigMjs,\n )}: ${chalk.dim('You probably have to clean it up a bit.')}\\n`,\n );\n\n // eslint-disable-next-line no-console\n console.log(\n getNextjsConfigEsmCopyPasteSnippet(withSentryConfigOptionsTemplate),\n );\n\n const shouldContinue = await abortIfCancelled(\n clack.confirm({\n message: `Are you done putting the snippet above into ${chalk.cyan(\n nextConfigMjs,\n )}?`,\n active: 'Yes',\n inactive: 'No, get me out of here',\n }),\n );\n\n if (!shouldContinue) {\n await abort();\n }\n }\n }\n });\n}\n\nasync function createExamplePage(\n selfHosted: boolean,\n selectedProject: SentryProjectData,\n sentryUrl: string,\n): Promise<void> {\n const srcDir = path.join(process.cwd(), 'src');\n const maybePagesDirPath = path.join(process.cwd(), 'pages');\n const maybeSrcPagesDirPath = path.join(srcDir, 'pages');\n const maybeAppDirPath = path.join(process.cwd(), 'app');\n const maybeSrcAppDirPath = path.join(srcDir, 'app');\n\n const typeScriptDetected = isUsingTypeScript();\n\n let pagesLocation =\n fs.existsSync(maybePagesDirPath) &&\n fs.lstatSync(maybePagesDirPath).isDirectory()\n ? ['pages']\n : fs.existsSync(maybeSrcPagesDirPath) &&\n fs.lstatSync(maybeSrcPagesDirPath).isDirectory()\n ? ['src', 'pages']\n : undefined;\n\n const appLocation =\n fs.existsSync(maybeAppDirPath) &&\n fs.lstatSync(maybeAppDirPath).isDirectory()\n ? ['app']\n : fs.existsSync(maybeSrcAppDirPath) &&\n fs.lstatSync(maybeSrcAppDirPath).isDirectory()\n ? ['src', 'app']\n : undefined;\n\n if (!pagesLocation && !appLocation) {\n pagesLocation =\n fs.existsSync(srcDir) && fs.lstatSync(srcDir).isDirectory()\n ? ['src', 'pages']\n : ['pages'];\n fs.mkdirSync(path.join(process.cwd(), ...pagesLocation), {\n recursive: true,\n });\n }\n\n Sentry.setTag('nextjs-app-dir', !!appLocation);\n\n if (appLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: true,\n });\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appLocation, 'sentry-example-page'),\n {\n recursive: true,\n },\n );\n\n const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appLocation,\n 'sentry-example-page',\n newPageFileName,\n ),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...appLocation, 'sentry-example-page', newPageFileName),\n )}.`,\n );\n\n fs.mkdirSync(\n path.join(process.cwd(), ...appLocation, 'api', 'sentry-example-api'),\n {\n recursive: true,\n },\n );\n\n const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...appLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n getSentryExampleAppDirApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(\n ...appLocation,\n 'api',\n 'sentry-example-api',\n newRouteFileName,\n ),\n )}.`,\n );\n } else if (pagesLocation) {\n const examplePageContents = getSentryExamplePageContents({\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectId: selectedProject.id,\n sentryUrl,\n useClient: false,\n });\n\n await fs.promises.writeFile(\n path.join(process.cwd(), ...pagesLocation, 'sentry-example-page.jsx'),\n examplePageContents,\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesLocation, 'sentry-example-page.js'),\n )}.`,\n );\n\n fs.mkdirSync(path.join(process.cwd(), ...pagesLocation, 'api'), {\n recursive: true,\n });\n\n await fs.promises.writeFile(\n path.join(\n process.cwd(),\n ...pagesLocation,\n 'api',\n 'sentry-example-api.js',\n ),\n getSentryExampleApiRoute(),\n { encoding: 'utf8', flag: 'w' },\n );\n\n clack.log.success(\n `Created ${chalk.cyan(\n path.join(...pagesLocation, 'api', 'sentry-example-api.js'),\n )}.`,\n );\n }\n}\n\n/**\n * Ask users if they want to set the tunnelRoute option.\n * We can't set this by default because it potentially increases hosting bills.\n * It's valuable enough to for users to justify asking the additional question.\n */\nasync function askShouldSetTunnelRoute() {\n return await traceStep('ask-tunnelRoute-option', async () => {\n const shouldSetTunnelRoute = await abortIfCancelled(\n clack.select({\n message:\n 'Do you want to route Sentry requests in the browser through your NextJS server to avoid ad blockers?',\n options: [\n {\n label: 'Yes',\n value: true,\n hint: 'Can increase your server load and hosting bill',\n },\n {\n label: 'No',\n value: false,\n hint: 'Browser errors and events might be blocked by ad blockers before being sent to Sentry',\n },\n ],\n initialValue: false,\n }),\n );\n\n if (!shouldSetTunnelRoute) {\n clack.log.info(\n \"Sounds good! We'll leave the option commented for later, just in case :)\",\n );\n }\n\n return shouldSetTunnelRoute;\n });\n}\n"]}
|
|
@@ -15,12 +15,22 @@ const MIN_ELECTRON_VERSION = parseInt(
|
|
|
15
15
|
10,
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const CODE_EXAMPLE_MAIN = `// ESM
|
|
19
|
+
import * as Sentry from '@sentry/electron/main';
|
|
20
|
+
// CommonJs
|
|
21
|
+
const Sentry = require('@sentry/electron/main');
|
|
19
22
|
|
|
20
23
|
Sentry.init({
|
|
21
24
|
dsn: '___DSN___',
|
|
22
25
|
});`;
|
|
23
26
|
|
|
27
|
+
const CODE_EXAMPLE_RENDERER = `// ESM
|
|
28
|
+
import * as Sentry from '@sentry/electron/renderer';
|
|
29
|
+
// CommonJs
|
|
30
|
+
const Sentry = require('@sentry/electron/renderer');
|
|
31
|
+
|
|
32
|
+
Sentry.init({});`;
|
|
33
|
+
|
|
24
34
|
let appPackage: any = {};
|
|
25
35
|
|
|
26
36
|
function printExample(example: string, title = ''): void {
|
|
@@ -61,8 +71,13 @@ export class Electron extends BaseIntegration {
|
|
|
61
71
|
nl();
|
|
62
72
|
|
|
63
73
|
printExample(
|
|
64
|
-
|
|
65
|
-
'
|
|
74
|
+
CODE_EXAMPLE_MAIN.replace('___DSN___', dsn),
|
|
75
|
+
'Add these lines in to your main process code to setup Sentry:',
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
printExample(
|
|
79
|
+
CODE_EXAMPLE_RENDERER,
|
|
80
|
+
'Add these lines in to your renderer processes code to setup Sentry:',
|
|
66
81
|
);
|
|
67
82
|
|
|
68
83
|
l('For more information, see https://docs.sentry.io/clients/electron/');
|
|
@@ -47,6 +47,7 @@ export class PromptForParameters extends BaseStep {
|
|
|
47
47
|
]);
|
|
48
48
|
|
|
49
49
|
url = this._getFullUrl(answers, organization.slug, project.slug);
|
|
50
|
+
const dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);
|
|
50
51
|
const dsn = await prompt([
|
|
51
52
|
{
|
|
52
53
|
message: 'DSN:',
|
|
@@ -56,7 +57,7 @@ export class PromptForParameters extends BaseStep {
|
|
|
56
57
|
validate: this._validateDSN,
|
|
57
58
|
when: this._shouldAsk(answers, 'config.dsn.public', () => {
|
|
58
59
|
dim('Please copy/paste your DSN');
|
|
59
|
-
dim(`It can be found here: ${
|
|
60
|
+
dim(`It can be found here: ${dsnKeyUrl}`);
|
|
60
61
|
}),
|
|
61
62
|
},
|
|
62
63
|
]);
|
|
@@ -107,6 +108,16 @@ export class PromptForParameters extends BaseStep {
|
|
|
107
108
|
return `${baseUrl}${orgSlug}/${projSlug}`;
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {
|
|
112
|
+
const baseUrl = this._argv.url;
|
|
113
|
+
const projSlug = _.get(
|
|
114
|
+
answers,
|
|
115
|
+
'config.project.slug',
|
|
116
|
+
projectSlug || 'project_slug',
|
|
117
|
+
);
|
|
118
|
+
return `${baseUrl}settings/projects/${projSlug}/keys`;
|
|
119
|
+
}
|
|
120
|
+
|
|
110
121
|
private _shouldAsk(
|
|
111
122
|
answers: Answers,
|
|
112
123
|
configKey: string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.2",
|
|
4
4
|
"homepage": "https://github.com/getsentry/sentry-wizard",
|
|
5
5
|
"repository": "https://github.com/getsentry/sentry-wizard",
|
|
6
6
|
"description": "Sentry wizard helping you to configure your project",
|
|
@@ -66,6 +66,8 @@ export async function runNextjsWizardWithTelemetry(
|
|
|
66
66
|
telemetryEnabled: options.telemetryEnabled,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
const typeScriptDetected = isUsingTypeScript();
|
|
70
|
+
|
|
69
71
|
await confirmContinueIfNoOrDirtyGitRepo();
|
|
70
72
|
|
|
71
73
|
const packageJson = await getPackageDotJson();
|
|
@@ -236,15 +238,19 @@ export async function runNextjsWizardWithTelemetry(
|
|
|
236
238
|
: undefined;
|
|
237
239
|
|
|
238
240
|
if (!globalErrorPageFile) {
|
|
241
|
+
const newGlobalErrorFileName = `global-error.${
|
|
242
|
+
typeScriptDetected ? 'tsx' : 'jsx'
|
|
243
|
+
}`;
|
|
244
|
+
|
|
239
245
|
await fs.promises.writeFile(
|
|
240
|
-
path.join(process.cwd(), ...appDirLocation,
|
|
246
|
+
path.join(process.cwd(), ...appDirLocation, newGlobalErrorFileName),
|
|
241
247
|
getSentryDefaultGlobalErrorPage(),
|
|
242
248
|
{ encoding: 'utf8', flag: 'w' },
|
|
243
249
|
);
|
|
244
250
|
|
|
245
251
|
clack.log.success(
|
|
246
252
|
`Created ${chalk.cyan(
|
|
247
|
-
path.join(...appDirLocation,
|
|
253
|
+
path.join(...appDirLocation, newGlobalErrorFileName),
|
|
248
254
|
)}.`,
|
|
249
255
|
);
|
|
250
256
|
} else {
|
|
@@ -417,11 +423,14 @@ async function createOrMergeNextJsFiles(
|
|
|
417
423
|
}
|
|
418
424
|
|
|
419
425
|
if (instrumentationHookLocation === 'does-not-exist') {
|
|
426
|
+
const newInstrumentationFileName = `instrumentation.${
|
|
427
|
+
typeScriptDetected ? 'ts' : 'js'
|
|
428
|
+
}`;
|
|
420
429
|
const srcFolderExists = fs.existsSync(path.join(process.cwd(), 'src'));
|
|
421
430
|
|
|
422
431
|
const instrumentationHookPath = srcFolderExists
|
|
423
|
-
? path.join(process.cwd(), 'src',
|
|
424
|
-
: path.join(process.cwd(),
|
|
432
|
+
? path.join(process.cwd(), 'src', newInstrumentationFileName)
|
|
433
|
+
: path.join(process.cwd(), newInstrumentationFileName);
|
|
425
434
|
|
|
426
435
|
const successfullyCreated = await createNewConfigFile(
|
|
427
436
|
instrumentationHookPath,
|
|
@@ -430,7 +439,7 @@ async function createOrMergeNextJsFiles(
|
|
|
430
439
|
|
|
431
440
|
if (!successfullyCreated) {
|
|
432
441
|
await showCopyPasteInstructions(
|
|
433
|
-
|
|
442
|
+
newInstrumentationFileName,
|
|
434
443
|
getInstrumentationHookCopyPasteSnippet(
|
|
435
444
|
srcFolderExists ? 'src' : 'root',
|
|
436
445
|
),
|
|
@@ -630,6 +639,8 @@ async function createExamplePage(
|
|
|
630
639
|
const maybeAppDirPath = path.join(process.cwd(), 'app');
|
|
631
640
|
const maybeSrcAppDirPath = path.join(srcDir, 'app');
|
|
632
641
|
|
|
642
|
+
const typeScriptDetected = isUsingTypeScript();
|
|
643
|
+
|
|
633
644
|
let pagesLocation =
|
|
634
645
|
fs.existsSync(maybePagesDirPath) &&
|
|
635
646
|
fs.lstatSync(maybePagesDirPath).isDirectory()
|
|
@@ -676,12 +687,14 @@ async function createExamplePage(
|
|
|
676
687
|
},
|
|
677
688
|
);
|
|
678
689
|
|
|
690
|
+
const newPageFileName = `page.${typeScriptDetected ? 'tsx' : 'jsx'}`;
|
|
691
|
+
|
|
679
692
|
await fs.promises.writeFile(
|
|
680
693
|
path.join(
|
|
681
694
|
process.cwd(),
|
|
682
695
|
...appLocation,
|
|
683
696
|
'sentry-example-page',
|
|
684
|
-
|
|
697
|
+
newPageFileName,
|
|
685
698
|
),
|
|
686
699
|
examplePageContents,
|
|
687
700
|
{ encoding: 'utf8', flag: 'w' },
|
|
@@ -689,7 +702,7 @@ async function createExamplePage(
|
|
|
689
702
|
|
|
690
703
|
clack.log.success(
|
|
691
704
|
`Created ${chalk.cyan(
|
|
692
|
-
path.join(...appLocation, 'sentry-example-page',
|
|
705
|
+
path.join(...appLocation, 'sentry-example-page', newPageFileName),
|
|
693
706
|
)}.`,
|
|
694
707
|
);
|
|
695
708
|
|
|
@@ -700,13 +713,15 @@ async function createExamplePage(
|
|
|
700
713
|
},
|
|
701
714
|
);
|
|
702
715
|
|
|
716
|
+
const newRouteFileName = `route.${typeScriptDetected ? 'ts' : 'js'}`;
|
|
717
|
+
|
|
703
718
|
await fs.promises.writeFile(
|
|
704
719
|
path.join(
|
|
705
720
|
process.cwd(),
|
|
706
721
|
...appLocation,
|
|
707
722
|
'api',
|
|
708
723
|
'sentry-example-api',
|
|
709
|
-
|
|
724
|
+
newRouteFileName,
|
|
710
725
|
),
|
|
711
726
|
getSentryExampleAppDirApiRoute(),
|
|
712
727
|
{ encoding: 'utf8', flag: 'w' },
|
|
@@ -714,7 +729,12 @@ async function createExamplePage(
|
|
|
714
729
|
|
|
715
730
|
clack.log.success(
|
|
716
731
|
`Created ${chalk.cyan(
|
|
717
|
-
path.join(
|
|
732
|
+
path.join(
|
|
733
|
+
...appLocation,
|
|
734
|
+
'api',
|
|
735
|
+
'sentry-example-api',
|
|
736
|
+
newRouteFileName,
|
|
737
|
+
),
|
|
718
738
|
)}.`,
|
|
719
739
|
);
|
|
720
740
|
} else if (pagesLocation) {
|