@sentry/wizard 3.7.0 → 3.7.1
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 +4 -0
- package/dist/lib/Helper/Wizard.js +0 -2
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +3 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/lib/Helper/Wizard.ts +0 -3
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/src/sourcemaps/sourcemaps-wizard.ts +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -88,8 +88,6 @@ function sanitizeAndValidateArgs(argv) {
|
|
|
88
88
|
}
|
|
89
89
|
// @ts-ignore skip-connect does not exist on args
|
|
90
90
|
argv.promoCode = argv['promo-code'];
|
|
91
|
-
// @ts-ignore skip-connect does not exist on args
|
|
92
|
-
argv.disableTelemetry = argv['disable-telemetry'] != undefined;
|
|
93
91
|
}
|
|
94
92
|
function getCurrentIntegration(answers) {
|
|
95
93
|
return _.get(answers, 'integration');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../lib/Helper/Wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAK5B,yCAAwC;AACxC,qCAAgD;AAEhD,SAAS,uBAAuB,CAAC,IAAU;IACzC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAA,aAAG,EAAC,kCAAkC,CAAC,CAAC;KACzC;IACD,iDAAiD;IACjD,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE;QACxB,iDAAiD;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc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AAA,aAAG,EAAC,4CAA4C,CAAC,CAAC;qBACnD;oBACM,qBAAM,KAAK;6BACf,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,IAAI,CAAC,IAAI,CAAC,EAAd,CAAc,CAAC;6BAC7B,MAAM,CAAC,UAAO,MAAM,EAAE,IAAI;;;;4CACN,qBAAM,MAAM,EAAA;;wCAAzB,UAAU,GAAG,SAAY;wCACf,qBAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAAA;;wCAArC,OAAO,GAAG,SAA2B;wCAC3C,4CAAY,UAAU,GAAK,OAAO,GAAG;;;6BACtC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAA;wBANzB,sBAAO,SAMkB,EAAC;;;oBAE1B,qBAAS,CAAC,IAAI,EAAE,CAAC;oBACjB,IAAA,YAAE,GAAE,CAAC;oBACL,IAAA,aAAG,EAAC,4BAA4B,CAAC,CAAC;oBAClC,IAAA,aAAG,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;oBAChC,IAAA,YAAE,GAAE,CAAC;oBACL,IAAA,aAAG,EAAC,2CAA2C,CAAC,CAAC;oBACjD,IAAA,aAAG,EAAC,mCAAmC,CAAC,CAAC;oBACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;CAEnB;AA7BD,kCA6BC","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport type { Args } from '../Constants';\nimport type { IStep } from '../Steps/BaseStep';\nimport type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';\nimport { BottomBar } from './BottomBar';\nimport { debug, dim, nl, red } from './Logging';\n\nfunction sanitizeAndValidateArgs(argv: Args): void {\n if (argv.quiet === undefined) {\n argv.quiet = true;\n dim('will activate quiet mode for you');\n }\n // @ts-ignore skip-connect does not exist on args\n if (argv['skip-connect']) {\n // @ts-ignore skip-connect does not exist on args\n argv.skipConnect = argv['skip-connect'];\n // @ts-ignore skip-connect does not exist on args\n delete argv['skip-connect'];\n }\n // @ts-ignore skip-connect does not exist on args\n argv.promoCode = argv['promo-code'];\n}\n\nexport function getCurrentIntegration(answers: Answers): BaseIntegration {\n return _.get(answers, 'integration') as BaseIntegration;\n}\n\nexport async function startWizard<M extends IStep>(\n argv: Args,\n ...steps: Array<{ new (debug: Args): M }>\n): Promise<Answers> {\n try {\n sanitizeAndValidateArgs(argv);\n if (argv.debug) {\n debug(argv);\n }\n if (argv.quiet) {\n dim(\"Quiet mode On, DAMA, don't ask me anything\");\n }\n return await steps\n .map((step) => new step(argv))\n .reduce(async (answer, step) => {\n const prevAnswer = await answer;\n const answers = await step.emit(prevAnswer);\n return { ...prevAnswer, ...answers };\n }, Promise.resolve({}));\n } catch (e) {\n BottomBar.hide();\n nl();\n red('Sentry Wizard failed with:');\n red(argv.debug ? e : e.message);\n nl();\n red('Protip: Add --debug to see whats going on');\n red('OR use --help to see your options');\n process.exit(1);\n }\n}\n"]}
|
package/dist/package.json
CHANGED
|
@@ -101,7 +101,9 @@ function runSourcemapsWizardWithTelemetry(options) {
|
|
|
101
101
|
case 0:
|
|
102
102
|
(0, clack_utils_1.printWelcome)({
|
|
103
103
|
wizardName: 'Sentry Source Maps Upload Configuration Wizard',
|
|
104
|
-
message:
|
|
104
|
+
message: "This wizard will help you upload source maps to Sentry as part of your build.\nThank you for using Sentry :)".concat(options.telemetryEnabled
|
|
105
|
+
? "\n\n(This setup wizard sends telemetry data and crash reports to Sentry.\nYou can turn this off by running the wizard with the '--disable-telemetry' flag.)"
|
|
106
|
+
: ''),
|
|
105
107
|
promoCode: options.promoCode,
|
|
106
108
|
});
|
|
107
109
|
return [4 /*yield*/, (0, telemetry_1.traceStep)('check-framework-wizard', other_wizards_1.checkIfMoreSuitableWizardExistsAndAskForRedirect)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemaps-wizard.js","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K,GAAG,IAAA,yCAAkB,GAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAEhD,iBAAK,CAAC,KAAK,CAAC,UAAG,eAAK,CAAC,KAAK,CAAC,mCAAmC,CAAC,oBAE5D,eAAK,CAAC,IAAI,CAAC,4GAEkB,eAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,sBACvD,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,+BAAqB,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAG,CAAC,qBACpE,eAAK,CAAC,IAAI,CACV,UAAG,KAAK,4DAAyD,CAClE,yEAEC,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,wCAAqC,CAAC,qBACzD,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,cAAI,cAAc,CAAE,CAAC,yFAExC,eAAK,CAAC,IAAI,CACV,UAAG,KAAK,4DAAyD,CAClE,UACH,CAAC,kBACA,eAAK,CAAC,GAAG,CACT,6RAIoD,CACrD,OACH,CAAC,CAAC;AACH,CAAC","sourcesContent":["// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as Sentry from '@sentry/node';\n\nimport {\n abortIfCancelled,\n askForProjectSelection,\n askForSelfHosted,\n askForWizardLogin,\n confirmContinueEvenThoughNoGitRepo,\n detectPackageManager,\n SENTRY_DOT_ENV_FILE,\n printWelcome,\n SENTRY_CLI_RC_FILE,\n} from '../utils/clack-utils';\nimport { isUnicodeSupported } from '../utils/vendor/is-unicorn-supported';\nimport { SourceMapUploadToolConfigurationOptions } from './tools/types';\nimport { configureVitePlugin } from './tools/vite';\nimport { setupNpmScriptInCI, configureSentryCLI } from './tools/sentry-cli';\nimport { configureWebPackPlugin } from './tools/webpack';\nimport { configureTscSourcemapGenerationFlow } from './tools/tsc';\nimport { configureRollupPlugin } from './tools/rollup';\nimport { configureEsbuildPlugin } from './tools/esbuild';\nimport { WizardOptions } from '../utils/types';\nimport { configureCRASourcemapGenerationFlow } from './tools/create-react-app';\nimport { ensureMinimumSdkVersionIsInstalled } from './utils/sdk-version';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { URL } from 'url';\nimport { checkIfMoreSuitableWizardExistsAndAskForRedirect } from './utils/other-wizards';\nimport { configureAngularSourcemapGenerationFlow } from './tools/angular';\nimport { detectUsedTool, SupportedTools } from './utils/detect-tool';\n\nexport async function runSourcemapsWizard(\n options: WizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'sourcemaps',\n },\n () => runSourcemapsWizardWithTelemetry(options),\n );\n}\n\nasync function runSourcemapsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Source Maps Upload Configuration Wizard',\n message:\n 'This wizard will help you upload source maps to Sentry as part of your build.\\nThank you for using Sentry :)\\n\\n(This setup wizard sends telemetry data and crash reports to Sentry.\\nYou can turn this off by running the wizard with the `--disable-telemetry` flag.)',\n promoCode: options.promoCode,\n });\n\n const moreSuitableWizard = await traceStep(\n 'check-framework-wizard',\n checkIfMoreSuitableWizardExistsAndAskForRedirect,\n );\n if (moreSuitableWizard) {\n await traceStep('run-framework-wizard', () => moreSuitableWizard(options));\n return;\n }\n\n await traceStep('detect-git', confirmContinueEvenThoughNoGitRepo);\n\n await traceStep('check-sdk-version', ensureMinimumSdkVersionIsInstalled);\n\n const { url: sentryUrl, selfHosted } = await traceStep(\n 'ask-self-hosted',\n () => askForSelfHosted(options.url),\n );\n\n const { projects, apiKeys } = await traceStep('login', () =>\n askForWizardLogin({\n promoCode: options.promoCode,\n url: sentryUrl,\n }),\n );\n\n const selectedProject = await traceStep('select-project', () =>\n askForProjectSelection(projects),\n );\n\n const selectedTool = await traceStep('select-tool', askForUsedBundlerTool);\n\n Sentry.setTag('selected-tool', selectedTool);\n\n await traceStep('tool-setup', () =>\n startToolSetupFlow(selectedTool, {\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n url: sentryUrl,\n authToken: apiKeys.token,\n }),\n );\n\n await traceStep('ci-setup', () => configureCI(selectedTool, apiKeys.token));\n\n traceStep('outro', () =>\n printOutro(\n sentryUrl,\n selectedProject.organization.slug,\n selectedProject.id,\n ),\n );\n}\n\nasync function askForUsedBundlerTool(): Promise<SupportedTools> {\n const selectedTool: SupportedTools | symbol = await abortIfCancelled(\n clack.select({\n message: 'Which framework, bundler or build tool are you using?',\n options: [\n {\n label: 'Angular',\n value: 'angular',\n hint: 'Select this option if you are using Angular.',\n },\n {\n label: 'Create React App',\n value: 'create-react-app',\n hint: 'Select this option if you set up your app with Create React App.',\n },\n {\n label: 'Webpack',\n value: 'webpack',\n hint: 'Select this if you are using Webpack and you have access to your Webpack config.',\n },\n {\n label: 'Vite',\n value: 'vite',\n hint: 'Select this if you are using Vite and you have access to your Vite config.',\n },\n {\n label: 'esbuild',\n value: 'esbuild',\n hint: 'Select this if you are using esbuild and you have access to your esbuild config.',\n },\n {\n label: 'Rollup',\n value: 'rollup',\n hint: 'Select this if you are using Rollup and you have access to your Rollup config.',\n },\n {\n label: 'tsc',\n value: 'tsc',\n hint: 'Configure source maps when using tsc as build tool',\n },\n {\n label: 'None of the above',\n value: 'sentry-cli',\n hint: 'This will configure source maps upload for you using sentry-cli',\n },\n ],\n initialValue: await detectUsedTool(),\n }),\n );\n\n return selectedTool;\n}\n\nasync function startToolSetupFlow(\n selctedTool: SupportedTools,\n options: SourceMapUploadToolConfigurationOptions,\n): Promise<void> {\n switch (selctedTool) {\n case 'webpack':\n await configureWebPackPlugin(options);\n break;\n case 'vite':\n await configureVitePlugin(options);\n break;\n case 'esbuild':\n await configureEsbuildPlugin(options);\n break;\n case 'rollup':\n await configureRollupPlugin(options);\n break;\n case 'tsc':\n await configureSentryCLI(options, configureTscSourcemapGenerationFlow);\n break;\n case 'create-react-app':\n await configureSentryCLI(options, configureCRASourcemapGenerationFlow);\n break;\n case 'angular':\n await configureSentryCLI(\n options,\n configureAngularSourcemapGenerationFlow,\n );\n break;\n default:\n await configureSentryCLI(options);\n break;\n }\n}\n\nasync function configureCI(\n selectedTool: SupportedTools,\n authToken: string,\n): Promise<void> {\n const isUsingCI = await abortIfCancelled(\n clack.select({\n message: `Are you using a CI/CD tool to build and deploy your application?`,\n options: [\n {\n label: 'Yes',\n hint: 'I use a tool like Github Actions, Gitlab, CircleCI, TravisCI, Jenkins, ...',\n value: true,\n },\n {\n label: 'No',\n hint: 'I build and deploy my application manually',\n value: false,\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('using-ci', isUsingCI);\n\n const isCliBasedFlowTool = [\n 'sentry-cli',\n 'tsc',\n 'angular',\n 'create-react-app',\n ].includes(selectedTool);\n\n const authTokenFile = isCliBasedFlowTool\n ? SENTRY_CLI_RC_FILE\n : SENTRY_DOT_ENV_FILE;\n\n if (!isUsingCI) {\n clack.log.info(\n `No Problem! Just make sure that the Sentry auth token from ${chalk.cyan(\n authTokenFile,\n )} is available whenever you build and deploy your app.`,\n );\n return;\n }\n\n if (isCliBasedFlowTool) {\n await traceStep('ci-npm-script-setup', setupNpmScriptInCI);\n }\n\n await traceStep('ci-auth-token-setup', () => setupAuthTokenInCI(authToken));\n}\n\nasync function setupAuthTokenInCI(authToken: string) {\n clack.log.step(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(\n chalk.greenBright(`\nSENTRY_AUTH_TOKEN=${authToken}\n`),\n );\n\n clack.log.warn(\n chalk.yellow('DO NOT commit this auth token to your repository!'),\n );\n\n const addedEnvVarToCI = await abortIfCancelled(\n clack.select({\n message: 'Did you configure CI as shown above?',\n options: [\n { label: 'Yes, continue!', value: true },\n {\n label: \"I'll do it later...\",\n value: false,\n hint: chalk.yellow(\n 'You need to set the auth token to upload source maps in CI',\n ),\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('added-env-var-to-ci', addedEnvVarToCI);\n\n if (!addedEnvVarToCI) {\n clack.log.info(\"Don't forget! :)\");\n }\n}\n\nfunction printOutro(url: string, orgSlug: string, projectId: string) {\n const pacMan = detectPackageManager() || 'npm';\n const buildCommand = `'${pacMan}${pacMan === 'npm' ? ' run' : ''} build'`;\n\n const urlObject = new URL(url);\n urlObject.host = `${orgSlug}.${urlObject.host}`;\n urlObject.pathname = '/issues/';\n urlObject.searchParams.set('project', projectId);\n\n const issueStreamUrl = urlObject.toString();\n\n const arrow = isUnicodeSupported() ? '→' : '->';\n\n clack.outro(`${chalk.green(\"That's it - everything is set up!\")}\n\n ${chalk.cyan(`Test and validate your setup locally with the following Steps:\n\n 1. Build your application in ${chalk.bold('production mode')}.\n ${chalk.gray(`${arrow} For example, run ${chalk.bold(buildCommand)}.`)}\n ${chalk.gray(\n `${arrow} You should see source map upload logs in your console.`,\n )}\n 2. Run your application and throw a test error.\n ${chalk.gray(`${arrow} The error should appear in Sentry:`)}\n ${chalk.gray(`${arrow} ${issueStreamUrl}`)}\n 3. Open the error in Sentry and verify that it's source-mapped.\n ${chalk.gray(\n `${arrow} The stack trace should show your original source code.`,\n )}\n `)}\n ${chalk.dim(\n `If you encounter any issues, please refer to the Troubleshooting Guide:\n https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js\n\n If the guide doesn't help or you encounter a bug, please let us know:\n https://github.com/getsentry/sentry-javascript/issues`,\n )}\n`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sourcemaps-wizard.js","sourceRoot":"","sources":["../../../src/sourcemaps/sourcemaps-wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAyE;AACzE,2DAAmC;AACnC,gDAA0B;AAC1B,mDAAuC;AAEvC,oDAU8B;AAC9B,6EAA0E;AAE1E,qCAAmD;AACnD,iDAA4E;AAC5E,2CAAyD;AACzD,mC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AAC,IAAI,CAAC,iBAAiB,CAAC,sBACvD,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,+BAAqB,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAG,CAAC,qBACpE,eAAK,CAAC,IAAI,CACV,UAAG,KAAK,4DAAyD,CAClE,yEAEC,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,wCAAqC,CAAC,qBACzD,eAAK,CAAC,IAAI,CAAC,UAAG,KAAK,cAAI,cAAc,CAAE,CAAC,yFAExC,eAAK,CAAC,IAAI,CACV,UAAG,KAAK,4DAAyD,CAClE,UACH,CAAC,kBACA,eAAK,CAAC,GAAG,CACT,6RAIoD,CACrD,OACH,CAAC,CAAC;AACH,CAAC","sourcesContent":["// @ts-ignore - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\nimport * as Sentry from '@sentry/node';\n\nimport {\n abortIfCancelled,\n askForProjectSelection,\n askForSelfHosted,\n askForWizardLogin,\n confirmContinueEvenThoughNoGitRepo,\n detectPackageManager,\n SENTRY_DOT_ENV_FILE,\n printWelcome,\n SENTRY_CLI_RC_FILE,\n} from '../utils/clack-utils';\nimport { isUnicodeSupported } from '../utils/vendor/is-unicorn-supported';\nimport { SourceMapUploadToolConfigurationOptions } from './tools/types';\nimport { configureVitePlugin } from './tools/vite';\nimport { setupNpmScriptInCI, configureSentryCLI } from './tools/sentry-cli';\nimport { configureWebPackPlugin } from './tools/webpack';\nimport { configureTscSourcemapGenerationFlow } from './tools/tsc';\nimport { configureRollupPlugin } from './tools/rollup';\nimport { configureEsbuildPlugin } from './tools/esbuild';\nimport { WizardOptions } from '../utils/types';\nimport { configureCRASourcemapGenerationFlow } from './tools/create-react-app';\nimport { ensureMinimumSdkVersionIsInstalled } from './utils/sdk-version';\nimport { traceStep, withTelemetry } from '../telemetry';\nimport { URL } from 'url';\nimport { checkIfMoreSuitableWizardExistsAndAskForRedirect } from './utils/other-wizards';\nimport { configureAngularSourcemapGenerationFlow } from './tools/angular';\nimport { detectUsedTool, SupportedTools } from './utils/detect-tool';\n\nexport async function runSourcemapsWizard(\n options: WizardOptions,\n): Promise<void> {\n return withTelemetry(\n {\n enabled: options.telemetryEnabled,\n integration: 'sourcemaps',\n },\n () => runSourcemapsWizardWithTelemetry(options),\n );\n}\n\nasync function runSourcemapsWizardWithTelemetry(\n options: WizardOptions,\n): Promise<void> {\n printWelcome({\n wizardName: 'Sentry Source Maps Upload Configuration Wizard',\n message: `This wizard will help you upload source maps to Sentry as part of your build.\nThank you for using Sentry :)${\n options.telemetryEnabled\n ? `\n\n(This setup wizard sends telemetry data and crash reports to Sentry.\nYou can turn this off by running the wizard with the '--disable-telemetry' flag.)`\n : ''\n }`,\n promoCode: options.promoCode,\n });\n\n const moreSuitableWizard = await traceStep(\n 'check-framework-wizard',\n checkIfMoreSuitableWizardExistsAndAskForRedirect,\n );\n if (moreSuitableWizard) {\n await traceStep('run-framework-wizard', () => moreSuitableWizard(options));\n return;\n }\n\n await traceStep('detect-git', confirmContinueEvenThoughNoGitRepo);\n\n await traceStep('check-sdk-version', ensureMinimumSdkVersionIsInstalled);\n\n const { url: sentryUrl, selfHosted } = await traceStep(\n 'ask-self-hosted',\n () => askForSelfHosted(options.url),\n );\n\n const { projects, apiKeys } = await traceStep('login', () =>\n askForWizardLogin({\n promoCode: options.promoCode,\n url: sentryUrl,\n }),\n );\n\n const selectedProject = await traceStep('select-project', () =>\n askForProjectSelection(projects),\n );\n\n const selectedTool = await traceStep('select-tool', askForUsedBundlerTool);\n\n Sentry.setTag('selected-tool', selectedTool);\n\n await traceStep('tool-setup', () =>\n startToolSetupFlow(selectedTool, {\n selfHosted,\n orgSlug: selectedProject.organization.slug,\n projectSlug: selectedProject.slug,\n url: sentryUrl,\n authToken: apiKeys.token,\n }),\n );\n\n await traceStep('ci-setup', () => configureCI(selectedTool, apiKeys.token));\n\n traceStep('outro', () =>\n printOutro(\n sentryUrl,\n selectedProject.organization.slug,\n selectedProject.id,\n ),\n );\n}\n\nasync function askForUsedBundlerTool(): Promise<SupportedTools> {\n const selectedTool: SupportedTools | symbol = await abortIfCancelled(\n clack.select({\n message: 'Which framework, bundler or build tool are you using?',\n options: [\n {\n label: 'Angular',\n value: 'angular',\n hint: 'Select this option if you are using Angular.',\n },\n {\n label: 'Create React App',\n value: 'create-react-app',\n hint: 'Select this option if you set up your app with Create React App.',\n },\n {\n label: 'Webpack',\n value: 'webpack',\n hint: 'Select this if you are using Webpack and you have access to your Webpack config.',\n },\n {\n label: 'Vite',\n value: 'vite',\n hint: 'Select this if you are using Vite and you have access to your Vite config.',\n },\n {\n label: 'esbuild',\n value: 'esbuild',\n hint: 'Select this if you are using esbuild and you have access to your esbuild config.',\n },\n {\n label: 'Rollup',\n value: 'rollup',\n hint: 'Select this if you are using Rollup and you have access to your Rollup config.',\n },\n {\n label: 'tsc',\n value: 'tsc',\n hint: 'Configure source maps when using tsc as build tool',\n },\n {\n label: 'None of the above',\n value: 'sentry-cli',\n hint: 'This will configure source maps upload for you using sentry-cli',\n },\n ],\n initialValue: await detectUsedTool(),\n }),\n );\n\n return selectedTool;\n}\n\nasync function startToolSetupFlow(\n selctedTool: SupportedTools,\n options: SourceMapUploadToolConfigurationOptions,\n): Promise<void> {\n switch (selctedTool) {\n case 'webpack':\n await configureWebPackPlugin(options);\n break;\n case 'vite':\n await configureVitePlugin(options);\n break;\n case 'esbuild':\n await configureEsbuildPlugin(options);\n break;\n case 'rollup':\n await configureRollupPlugin(options);\n break;\n case 'tsc':\n await configureSentryCLI(options, configureTscSourcemapGenerationFlow);\n break;\n case 'create-react-app':\n await configureSentryCLI(options, configureCRASourcemapGenerationFlow);\n break;\n case 'angular':\n await configureSentryCLI(\n options,\n configureAngularSourcemapGenerationFlow,\n );\n break;\n default:\n await configureSentryCLI(options);\n break;\n }\n}\n\nasync function configureCI(\n selectedTool: SupportedTools,\n authToken: string,\n): Promise<void> {\n const isUsingCI = await abortIfCancelled(\n clack.select({\n message: `Are you using a CI/CD tool to build and deploy your application?`,\n options: [\n {\n label: 'Yes',\n hint: 'I use a tool like Github Actions, Gitlab, CircleCI, TravisCI, Jenkins, ...',\n value: true,\n },\n {\n label: 'No',\n hint: 'I build and deploy my application manually',\n value: false,\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('using-ci', isUsingCI);\n\n const isCliBasedFlowTool = [\n 'sentry-cli',\n 'tsc',\n 'angular',\n 'create-react-app',\n ].includes(selectedTool);\n\n const authTokenFile = isCliBasedFlowTool\n ? SENTRY_CLI_RC_FILE\n : SENTRY_DOT_ENV_FILE;\n\n if (!isUsingCI) {\n clack.log.info(\n `No Problem! Just make sure that the Sentry auth token from ${chalk.cyan(\n authTokenFile,\n )} is available whenever you build and deploy your app.`,\n );\n return;\n }\n\n if (isCliBasedFlowTool) {\n await traceStep('ci-npm-script-setup', setupNpmScriptInCI);\n }\n\n await traceStep('ci-auth-token-setup', () => setupAuthTokenInCI(authToken));\n}\n\nasync function setupAuthTokenInCI(authToken: string) {\n clack.log.step(\n 'Add the Sentry authentication token as an environment variable to your CI setup:',\n );\n\n // Intentially logging directly to console here so that the code can be copied/pasted directly\n // eslint-disable-next-line no-console\n console.log(\n chalk.greenBright(`\nSENTRY_AUTH_TOKEN=${authToken}\n`),\n );\n\n clack.log.warn(\n chalk.yellow('DO NOT commit this auth token to your repository!'),\n );\n\n const addedEnvVarToCI = await abortIfCancelled(\n clack.select({\n message: 'Did you configure CI as shown above?',\n options: [\n { label: 'Yes, continue!', value: true },\n {\n label: \"I'll do it later...\",\n value: false,\n hint: chalk.yellow(\n 'You need to set the auth token to upload source maps in CI',\n ),\n },\n ],\n initialValue: true,\n }),\n );\n\n Sentry.setTag('added-env-var-to-ci', addedEnvVarToCI);\n\n if (!addedEnvVarToCI) {\n clack.log.info(\"Don't forget! :)\");\n }\n}\n\nfunction printOutro(url: string, orgSlug: string, projectId: string) {\n const pacMan = detectPackageManager() || 'npm';\n const buildCommand = `'${pacMan}${pacMan === 'npm' ? ' run' : ''} build'`;\n\n const urlObject = new URL(url);\n urlObject.host = `${orgSlug}.${urlObject.host}`;\n urlObject.pathname = '/issues/';\n urlObject.searchParams.set('project', projectId);\n\n const issueStreamUrl = urlObject.toString();\n\n const arrow = isUnicodeSupported() ? '→' : '->';\n\n clack.outro(`${chalk.green(\"That's it - everything is set up!\")}\n\n ${chalk.cyan(`Test and validate your setup locally with the following Steps:\n\n 1. Build your application in ${chalk.bold('production mode')}.\n ${chalk.gray(`${arrow} For example, run ${chalk.bold(buildCommand)}.`)}\n ${chalk.gray(\n `${arrow} You should see source map upload logs in your console.`,\n )}\n 2. Run your application and throw a test error.\n ${chalk.gray(`${arrow} The error should appear in Sentry:`)}\n ${chalk.gray(`${arrow} ${issueStreamUrl}`)}\n 3. Open the error in Sentry and verify that it's source-mapped.\n ${chalk.gray(\n `${arrow} The stack trace should show your original source code.`,\n )}\n `)}\n ${chalk.dim(\n `If you encounter any issues, please refer to the Troubleshooting Guide:\n https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js\n\n If the guide doesn't help or you encounter a bug, please let us know:\n https://github.com/getsentry/sentry-javascript/issues`,\n )}\n`);\n}\n"]}
|
package/lib/Helper/Wizard.ts
CHANGED
|
@@ -21,9 +21,6 @@ function sanitizeAndValidateArgs(argv: Args): void {
|
|
|
21
21
|
}
|
|
22
22
|
// @ts-ignore skip-connect does not exist on args
|
|
23
23
|
argv.promoCode = argv['promo-code'];
|
|
24
|
-
|
|
25
|
-
// @ts-ignore skip-connect does not exist on args
|
|
26
|
-
argv.disableTelemetry = argv['disable-telemetry'] != undefined;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
export function getCurrentIntegration(answers: Answers): BaseIntegration {
|
package/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/wizard",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sentry/wizard",
|
|
9
|
-
"version": "3.7.
|
|
9
|
+
"version": "3.7.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@clack/core": "0.3.2",
|
package/package.json
CHANGED
|
@@ -48,8 +48,15 @@ async function runSourcemapsWizardWithTelemetry(
|
|
|
48
48
|
): Promise<void> {
|
|
49
49
|
printWelcome({
|
|
50
50
|
wizardName: 'Sentry Source Maps Upload Configuration Wizard',
|
|
51
|
-
message:
|
|
52
|
-
|
|
51
|
+
message: `This wizard will help you upload source maps to Sentry as part of your build.
|
|
52
|
+
Thank you for using Sentry :)${
|
|
53
|
+
options.telemetryEnabled
|
|
54
|
+
? `
|
|
55
|
+
|
|
56
|
+
(This setup wizard sends telemetry data and crash reports to Sentry.
|
|
57
|
+
You can turn this off by running the wizard with the '--disable-telemetry' flag.)`
|
|
58
|
+
: ''
|
|
59
|
+
}`,
|
|
53
60
|
promoCode: options.promoCode,
|
|
54
61
|
});
|
|
55
62
|
|