@sentry/wizard 6.10.0 → 6.11.0
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 +20 -0
- package/dist/ci-ensure-runtime-loaded.sh +82 -0
- package/dist/e2e-tests/tests/angular-17.test.js +72 -82
- package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
- package/dist/e2e-tests/tests/angular-19.test.js +71 -80
- package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
- package/dist/e2e-tests/tests/cloudflare-worker.test.d.ts +1 -0
- package/dist/e2e-tests/tests/cloudflare-worker.test.js +64 -0
- package/dist/e2e-tests/tests/cloudflare-worker.test.js.map +1 -0
- package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js +2 -5
- package/dist/e2e-tests/tests/cloudflare-wrangler-sourcemaps.test.js.map +1 -1
- package/dist/e2e-tests/tests/expo.test.js +36 -61
- package/dist/e2e-tests/tests/expo.test.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +63 -70
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/help-message.test.js +2 -2
- package/dist/e2e-tests/tests/help-message.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-14.test.js +48 -76
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +89 -99
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-16.test.js +48 -45
- package/dist/e2e-tests/tests/nextjs-16.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +45 -58
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +59 -73
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/pnpm-workspace.test.js +4 -7
- package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-native.test.js +44 -80
- package/dist/e2e-tests/tests/react-native.test.js.map +1 -1
- package/dist/e2e-tests/tests/react-router.test.js +163 -145
- package/dist/e2e-tests/tests/react-router.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +162 -132
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js +48 -36
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js +3 -6
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +15 -43
- package/dist/e2e-tests/utils/index.js +95 -185
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/get-e2e-test-matrix.mjs +11 -0
- package/dist/lib/Constants.d.ts +1 -0
- package/dist/lib/Constants.js +5 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/src/android/android-wizard.js +2 -4
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/angular/angular-wizard.js +4 -6
- package/dist/src/angular/angular-wizard.js.map +1 -1
- package/dist/src/angular/sdk-setup.js +1 -1
- package/dist/src/angular/sdk-setup.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +2 -4
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/cloudflare/cloudflare-wizard.d.ts +3 -0
- package/dist/src/cloudflare/cloudflare-wizard.js +99 -0
- package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -0
- package/dist/src/cloudflare/sdk-setup.d.ts +7 -0
- package/dist/src/cloudflare/sdk-setup.js +47 -0
- package/dist/src/cloudflare/sdk-setup.js.map +1 -0
- package/dist/src/cloudflare/templates.d.ts +4 -0
- package/dist/src/cloudflare/templates.js +44 -0
- package/dist/src/cloudflare/templates.js.map +1 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.js +27 -0
- package/dist/src/cloudflare/wrangler/create-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js +25 -0
- package/dist/src/cloudflare/wrangler/ensure-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.d.ts +4 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.js +23 -0
- package/dist/src/cloudflare/wrangler/find-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.d.ts +6 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js +52 -0
- package/dist/src/cloudflare/wrangler/get-entry-point-from-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.d.ts +17 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.js +173 -0
- package/dist/src/cloudflare/wrangler/update-wrangler-config.js.map +1 -0
- package/dist/src/cloudflare/wrap-worker.d.ts +32 -0
- package/dist/src/cloudflare/wrap-worker.js +109 -0
- package/dist/src/cloudflare/wrap-worker.js.map +1 -0
- package/dist/src/flutter/flutter-wizard.js +3 -6
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +0 -2
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +3 -5
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +2 -4
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-router/react-router-wizard.js +3 -5
- package/dist/src/react-router/react-router-wizard.js.map +1 -1
- package/dist/src/react-router/sdk-setup.d.ts +1 -1
- package/dist/src/react-router/sdk-setup.js +3 -4
- package/dist/src/react-router/sdk-setup.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +2 -4
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/run.d.ts +1 -1
- package/dist/src/run.js +5 -0
- package/dist/src/run.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +2 -4
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/utils/abort-if-sportlight-not-supported.d.ts +5 -0
- package/dist/src/utils/abort-if-sportlight-not-supported.js +40 -0
- package/dist/src/utils/abort-if-sportlight-not-supported.js.map +1 -0
- package/dist/src/utils/ast-utils.d.ts +1 -1
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/clack/index.d.ts +2 -2
- package/dist/src/utils/clack/index.js.map +1 -1
- package/dist/src/utils/clack/mcp-config.js +117 -59
- package/dist/src/utils/clack/mcp-config.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/angular/angular-wizard.test.js +2 -4
- package/dist/test/angular/angular-wizard.test.js.map +1 -1
- package/dist/test/cloudflare/create-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/create-wrangler-config.test.js +48 -0
- package/dist/test/cloudflare/create-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.js +61 -0
- package/dist/test/cloudflare/ensure-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/find-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/find-wrangler-config.test.js +77 -0
- package/dist/test/cloudflare/find-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js +81 -0
- package/dist/test/cloudflare/get-entry-point-from-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/sdk-setup.test.d.ts +1 -0
- package/dist/test/cloudflare/sdk-setup.test.js +152 -0
- package/dist/test/cloudflare/sdk-setup.test.js.map +1 -0
- package/dist/test/cloudflare/templates.test.d.ts +1 -0
- package/dist/test/cloudflare/templates.test.js +68 -0
- package/dist/test/cloudflare/templates.test.js.map +1 -0
- package/dist/test/cloudflare/update-wrangler-config.test.d.ts +1 -0
- package/dist/test/cloudflare/update-wrangler-config.test.js +216 -0
- package/dist/test/cloudflare/update-wrangler-config.test.js.map +1 -0
- package/dist/test/cloudflare/wrap-worker.test.d.ts +1 -0
- package/dist/test/cloudflare/wrap-worker.test.js +143 -0
- package/dist/test/cloudflare/wrap-worker.test.js.map +1 -0
- package/dist/test/react-router/sdk-setup.test.js +2 -2
- package/dist/test/react-router/sdk-setup.test.js.map +1 -1
- package/dist/test/utils/clack/mcp-config.test.js +176 -51
- package/dist/test/utils/clack/mcp-config.test.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flutter.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/flutter.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,gDAAkC;AAClC,mDAAkD;AAClD,oCAKkB;AAClB,oCAA+C;AAC/C,oCAKkB;AAClB,mCAAqE;AAErE,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;IACvB,MAAM,WAAW,GAAG,uBAAW,CAAC,OAAO,CAAC;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,uCAAuC,CACxC,CAAC;IAEF,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,MAAM,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;YAEpE,MAAM,qBAAqB,GAAG,MAAM,cAAc,CAAC,aAAa;YAC9D,+FAA+F;YAC/F,+CAA+C,CAChD,CAAC;YAEF,MAAM,uBAAuB,GAC3B,qBAAqB;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AC,YAAI,CAAC,IAAI,EAAE,YAAI,CAAC,KAAK,CAAC,EACvB,gDAAgD,CACjD,CAAC,CAAC;YAEL,cAAc,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAQ,EAAC,GAAG,EAAE;YACZ,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;YAC/B,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,wEAAwE,EAAE,GAAG,EAAE;YAClF,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CACjC,GAAG,UAAU,gBAAgB,EAC7B,OAAO,CACR,CAAC;YACF,IAAA,eAAM,EAAC,WAAW,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,GAAG,EAAE;YACtC,IAAA,yBAAiB,EACf,GAAG,UAAU,gBAAgB,EAC7B,4BAA4B,CAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n KEYS,\n // checkEnvBuildPlugin,\n cleanupGit,\n revertLocalChanges,\n} from '../utils';\nimport { startWizardInstance } from '../utils';\nimport {\n checkFileContents,\n checkIfFlutterBuilds,\n // checkFileExists,\n checkSentryProperties,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\ndescribe('Flutter', () => {\n const integration = Integration.flutter;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/flutter-test-app',\n );\n\n describe('with apple platforms', () => {\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n\n const tracingOptionPrompted = await wizardInstance.waitForOutput(\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n );\n\n const profilingOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Profiling\", sometimes doesn't work as `Profiling` can be printed in bold.\n 'to analyze CPU usage and optimize performance-critical code on iOS & macOS?',\n ));\n\n const replayOptionPrompted =\n profilingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Session Replay\", sometimes doesn't work as `Session Replay` can be printed in bold.\n 'to record user interactions and debug issues?',\n ));\n\n const logsOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Logs\", sometimes doesn't work as `Logs` can be printed in bold.\n 'to send your application logs to Sentry?',\n ));\n\n // Handle the MCP prompt (default is now Yes, so press DOWN to select No)\n const mcpPrompted =\n logsOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n {\n optional: true,\n },\n ));\n\n mcpPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Decline MCP config by selecting No\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Flutter SDK!',\n ));\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('pubspec.yaml is updated.', () => {\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_flutter:`); // dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_dart_plugin:`); // dev_dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry:`); // gradle plugin options\n });\n\n test('sentry.properties exists and has auth token', () => {\n checkSentryProperties(projectDir);\n });\n\n test('.gitignore has sentry.properties', () => {\n checkFileContents(`${projectDir}/.gitignore`, `sentry.properties`);\n });\n\n test('lib/main.dart calls sentry init', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `import 'package:sentry_flutter/sentry_flutter.dart';`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `await SentryFlutter.init(`,\n );\n });\n\n test('lib/main.dart enables tracing and profiling', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.tracesSampleRate = 1.0;`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.profilesSampleRate = 1.0;`,\n );\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n\n test('builds correctly', async () => {\n await checkIfFlutterBuilds(projectDir, '✓ Built build/web');\n });\n });\n\n describe('without apple platforms', () => {\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n\n if (fs.existsSync(`${projectDir}/ios`)) {\n fs.renameSync(`${projectDir}/ios`, `${projectDir}/_ios`);\n }\n if (fs.existsSync(`${projectDir}/macos`)) {\n fs.renameSync(`${projectDir}/macos`, `${projectDir}/_macos`);\n }\n\n const continueOnUncommitedFilesPromted =\n await wizardInstance.waitForOutput('Do you want to continue anyway?');\n\n const tracingOptionPrompted =\n continueOnUncommitedFilesPromted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Session Replay\", sometimes doesn't work as `Session Replay` can be printed in bold.\n 'to record user interactions and debug issues?',\n ));\n\n const logsOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Logs\", sometimes doesn't work as `Logs` can be printed in bold.\n 'to send your application logs to Sentry?',\n ));\n\n // Handle the MCP prompt (default is now Yes, so press DOWN to select No)\n const mcpPrompted =\n logsOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n {\n optional: true,\n },\n ));\n\n mcpPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Decline MCP config by selecting No\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Flutter SDK!',\n ));\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('lib/main.dart does not add profiling with missing ios and macos folder', () => {\n const fileContent = fs.readFileSync(\n `${projectDir}/lib/main.dart`,\n 'utf-8',\n );\n expect(fileContent).not.toContain(`options.profilesSampleRate = 1.0;`);\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"flutter.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/flutter.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,mDAAkD;AAClD,oCAAmE;AACnE,oCAIkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,IAAI,cAAsB,CAAC;QAC3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,kBAAkB,CAAC,CAAC;QAE1E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;YACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;gBAC7B,GAAG,EAAE,UAAU;gBACf,KAAK,EAAE,IAAI;aACZ,CAAC;iBACC,iBAAiB,EAAE;iBACnB,YAAY,CACX,4E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W,GAAG,EAAE,CAAC,YAAY,CACjC,GAAG,UAAU,gBAAgB,EAC7B,OAAO,CACR,CAAC;YACF,IAAA,eAAM,EAAC,WAAW,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,GAAG,EAAE;YACtC,IAAA,yBAAiB,EACf,GAAG,UAAU,gBAAgB,EAC7B,4BAA4B,CAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport { Integration } from '../../lib/Constants';\nimport { createIsolatedTestEnv, getWizardCommand } from '../utils';\nimport {\n checkFileContents,\n checkIfFlutterBuilds,\n checkSentryProperties,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('Flutter', () => {\n describe('with apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to analyze CPU usage and optimize performance-critical code on iOS & macOS?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('pubspec.yaml is updated.', () => {\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_flutter:`); // dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry_dart_plugin:`); // dev_dependencies\n checkFileContents(`${projectDir}/pubspec.yaml`, `sentry:`); // gradle plugin options\n });\n\n test('sentry.properties exists and has auth token', () => {\n checkSentryProperties(projectDir);\n });\n\n test('.gitignore has sentry.properties', () => {\n checkFileContents(`${projectDir}/.gitignore`, `sentry.properties`);\n });\n\n test('lib/main.dart calls sentry init', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `import 'package:sentry_flutter/sentry_flutter.dart';`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `await SentryFlutter.init(`,\n );\n });\n\n test('lib/main.dart enables tracing and profiling', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.tracesSampleRate = 1.0;`,\n );\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.profilesSampleRate = 1.0;`,\n );\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n\n test('builds correctly', async () => {\n await checkIfFlutterBuilds(projectDir, '✓ Built build/web');\n });\n });\n\n describe('without apple platforms', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv('flutter-test-app');\n\n beforeAll(async () => {\n // Remove apple platform directories to simulate non-apple setup\n if (fs.existsSync(`${projectDir}/ios`)) {\n fs.renameSync(`${projectDir}/ios`, `${projectDir}/_ios`);\n }\n if (fs.existsSync(`${projectDir}/macos`)) {\n fs.renameSync(`${projectDir}/macos`, `${projectDir}/_macos`);\n }\n\n wizardExitCode = await withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n .whenAsked('Do you want to continue anyway?')\n .respondWith(KEYS.ENTER)\n .expectOutput(\n 'The Sentry Flutter Wizard will help you set up Sentry for your application',\n )\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER)\n .whenAsked('to record user interactions and debug issues?')\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Successfully installed the Sentry Flutter SDK!')\n .run(getWizardCommand(Integration.flutter));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('lib/main.dart does not add profiling with missing ios and macos folder', () => {\n const fileContent = fs.readFileSync(\n `${projectDir}/lib/main.dart`,\n 'utf-8',\n );\n expect(fileContent).not.toContain(`options.profilesSampleRate = 1.0;`);\n });\n\n test('lib/main.dart enables logs', () => {\n checkFileContents(\n `${projectDir}/lib/main.dart`,\n `options.enableLogs = true;`,\n );\n });\n });\n});\n"]}
|
|
@@ -28,8 +28,8 @@ const vitest_1 = require("vitest");
|
|
|
28
28
|
-i, --integration Choose the integration to setup
|
|
29
29
|
env: SENTRY_WIZARD_INTEGRATION
|
|
30
30
|
[choices: "reactNative", "flutter", "ios", "android", "cordova", "angular",
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
"cloudflare", "electron", "nextjs", "nuxt", "remix", "reactRouter",
|
|
32
|
+
"sveltekit", "sourcemaps"]
|
|
33
33
|
-p, --platform Choose platform(s)
|
|
34
34
|
env: SENTRY_WIZARD_PLATFORM
|
|
35
35
|
[array] [choices: "ios", "android"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-message.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/help-message.test.ts"],"names":[],"mappings":";;AAAA,2DAA8C;AAC9C,yCAAiC;AACjC,mCAA8C;AAE9C,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,WAAE,EAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACpD,CAAC,CAAC,CAAC,UAAU,EAAE,iBAAiB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvB,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,IAAA,6BAAQ,EAAC,GAAG,OAAO,SAAS,EAAE;YAC3C,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0C/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { execSync } from 'node:child_process';\nimport { join } from 'node:path';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('--help command', () => {\n it('prints the up to date help command', () => {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n\n const binPath = join(__dirname, '..', '..', ...binName);\n\n const output = execSync(`${binPath} --help`, {\n stdio: 'pipe',\n });\n\n expect(output.toString()).toMatchInlineSnapshot(`\n \"Options:\n --help Show help [boolean]\n --debug Enable verbose logging\n env: SENTRY_WIZARD_DEBUG [boolean] [default: false]\n --uninstall Revert project setup process\n env: SENTRY_WIZARD_UNINSTALL\n [boolean] [default: false]\n --skip-connect Skips the connection to the server\n env: SENTRY_WIZARD_SKIP_CONNECT\n [boolean] [default: false]\n --quiet Do not fallback to prompting user asking questions\n env: SENTRY_WIZARD_QUIET [boolean] [default: false]\n -i, --integration Choose the integration to setup\n env: SENTRY_WIZARD_INTEGRATION\n [choices: \"reactNative\", \"flutter\", \"ios\", \"android\", \"cordova\", \"angular\",\n
|
|
1
|
+
{"version":3,"file":"help-message.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/help-message.test.ts"],"names":[],"mappings":";;AAAA,2DAA8C;AAC9C,yCAAiC;AACjC,mCAA8C;AAE9C,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,WAAE,EAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B;YACpD,CAAC,CAAC,CAAC,UAAU,EAAE,iBAAiB,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEvB,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAExD,MAAM,MAAM,GAAG,IAAA,6BAAQ,EAAC,GAAG,OAAO,SAAS,EAAE;YAC3C,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0C/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { execSync } from 'node:child_process';\nimport { join } from 'node:path';\nimport { describe, expect, it } from 'vitest';\n\ndescribe('--help command', () => {\n it('prints the up to date help command', () => {\n const binName = process.env.SENTRY_WIZARD_E2E_TEST_BIN\n ? ['dist-bin', `sentry-wizard-${process.platform}-${process.arch}`]\n : ['dist', 'bin.js'];\n\n const binPath = join(__dirname, '..', '..', ...binName);\n\n const output = execSync(`${binPath} --help`, {\n stdio: 'pipe',\n });\n\n expect(output.toString()).toMatchInlineSnapshot(`\n \"Options:\n --help Show help [boolean]\n --debug Enable verbose logging\n env: SENTRY_WIZARD_DEBUG [boolean] [default: false]\n --uninstall Revert project setup process\n env: SENTRY_WIZARD_UNINSTALL\n [boolean] [default: false]\n --skip-connect Skips the connection to the server\n env: SENTRY_WIZARD_SKIP_CONNECT\n [boolean] [default: false]\n --quiet Do not fallback to prompting user asking questions\n env: SENTRY_WIZARD_QUIET [boolean] [default: false]\n -i, --integration Choose the integration to setup\n env: SENTRY_WIZARD_INTEGRATION\n [choices: \"reactNative\", \"flutter\", \"ios\", \"android\", \"cordova\", \"angular\",\n \"cloudflare\", \"electron\", \"nextjs\", \"nuxt\", \"remix\", \"reactRouter\",\n \"sveltekit\", \"sourcemaps\"]\n -p, --platform Choose platform(s)\n env: SENTRY_WIZARD_PLATFORM\n [array] [choices: \"ios\", \"android\"]\n -u, --url The url to your Sentry installation\n env: SENTRY_WIZARD_URL\n --project The Sentry project slug to use\n [string] [default: Select project during setup]\n --org The Sentry org slug to use\n [string] [default: Select org during setup]\n --saas Skip the self-hosted or SaaS URL selection process\n [boolean] [default: Select self-hosted or SaaS during setup]\n -s, --signup Redirect to signup page if not logged in\n [boolean] [default: false]\n --disable-telemetry Don't send telemetry data to Sentry\n [boolean] [default: false]\n --force-install Force install the SDK NPM package\n [boolean] [default: false]\n --ignore-git-changes Ignore git changes in the project\n [boolean] [default: false]\n --spotlight Enable Spotlight for local development. This does\n not require a Sentry account or project.\n [boolean] [default: false]\n --version Show version number [boolean]\n \"\n `);\n });\n});\n"]}
|
|
@@ -1,99 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const path = __importStar(require("node:path"));
|
|
27
3
|
const Constants_1 = require("../../lib/Constants");
|
|
28
4
|
const utils_1 = require("../utils");
|
|
29
|
-
const utils_2 = require("../utils");
|
|
30
|
-
const utils_3 = require("../utils");
|
|
31
5
|
const vitest_1 = require("vitest");
|
|
6
|
+
//@ts-expect-error - clifty is ESM only
|
|
7
|
+
const clifty_1 = require("clifty");
|
|
32
8
|
(0, vitest_1.describe)('NextJS-14', () => {
|
|
33
9
|
const integration = Constants_1.Integration.nextjs;
|
|
34
|
-
|
|
10
|
+
let wizardExitCode;
|
|
11
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('nextjs-14-test-app');
|
|
35
12
|
(0, vitest_1.beforeAll)(async () => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'to track the performance of your application?')
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
'to
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Are you using a CI/CD tool'));
|
|
62
|
-
// Selecting `No` for CI/CD tool
|
|
63
|
-
ciCdPrompted &&
|
|
64
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?', { optional: true }));
|
|
65
|
-
// Decline optional MCP config (default is now Yes, so press DOWN to select No)
|
|
66
|
-
await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Next.js SDK!');
|
|
67
|
-
wizardInstance.kill();
|
|
13
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
14
|
+
cwd: projectDir,
|
|
15
|
+
})
|
|
16
|
+
.defineInteraction()
|
|
17
|
+
.whenAsked('Please select your package manager.')
|
|
18
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select yarn
|
|
19
|
+
.expectOutput('Installing @sentry/nextjs')
|
|
20
|
+
.whenAsked('Do you want to route Sentry requests in the browser through your Next.js server', {
|
|
21
|
+
timeout: 240000, // package installation can take a while in CI
|
|
22
|
+
})
|
|
23
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
24
|
+
.whenAsked('to track the performance of your application?')
|
|
25
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
26
|
+
.whenAsked('to get a video-like reproduction of errors during a user session?')
|
|
27
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
28
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
29
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
30
|
+
.whenAsked('Do you want to create an example page')
|
|
31
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
32
|
+
.whenAsked('Are you using a CI/CD tool')
|
|
33
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select No
|
|
34
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
35
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Decline MCP config
|
|
36
|
+
.expectOutput('Successfully installed the Sentry Next.js SDK!')
|
|
37
|
+
.run((0, utils_1.getWizardCommand)(integration));
|
|
68
38
|
});
|
|
69
39
|
(0, vitest_1.afterAll)(() => {
|
|
70
|
-
(
|
|
71
|
-
|
|
40
|
+
cleanup();
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
43
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
72
44
|
});
|
|
73
45
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
74
|
-
(0,
|
|
46
|
+
(0, utils_1.checkPackageJson)(projectDir, '@sentry/nextjs');
|
|
75
47
|
});
|
|
76
48
|
(0, vitest_1.test)('.env-sentry-build-plugin is created and contains the auth token', () => {
|
|
77
49
|
(0, utils_1.checkEnvBuildPlugin)(projectDir);
|
|
78
50
|
});
|
|
79
51
|
(0, vitest_1.test)('example page exists', () => {
|
|
80
|
-
(0,
|
|
81
|
-
(0,
|
|
82
|
-
(0,
|
|
52
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/app/layout.tsx`);
|
|
53
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/app/sentry-example-page/page.tsx`);
|
|
54
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/app/api/sentry-example-api/route.ts`);
|
|
83
55
|
});
|
|
84
56
|
(0, vitest_1.test)('config files created', () => {
|
|
85
|
-
(0,
|
|
86
|
-
(0,
|
|
57
|
+
(0, utils_1.checkFileExists)(`${projectDir}/sentry.server.config.ts`);
|
|
58
|
+
(0, utils_1.checkFileExists)(`${projectDir}/sentry.edge.config.ts`);
|
|
87
59
|
});
|
|
88
60
|
(0, vitest_1.test)('global error file exists', () => {
|
|
89
|
-
(0,
|
|
61
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/app/global-error.tsx`);
|
|
90
62
|
});
|
|
91
63
|
(0, vitest_1.test)('instrumentation files exists', () => {
|
|
92
|
-
(0,
|
|
93
|
-
(0,
|
|
64
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/instrumentation.ts`);
|
|
65
|
+
(0, utils_1.checkFileExists)(`${projectDir}/src/instrumentation-client.ts`);
|
|
94
66
|
});
|
|
95
67
|
(0, vitest_1.test)('instrumentation file contains Sentry initialization', () => {
|
|
96
|
-
(0,
|
|
68
|
+
(0, utils_1.checkFileContents)(`${projectDir}/src/instrumentation.ts`, [
|
|
97
69
|
'import * as Sentry from "@sentry/nextjs";',
|
|
98
70
|
`export async function register() {
|
|
99
71
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
@@ -109,22 +81,22 @@ export const onRequestError = Sentry.captureRequestError;`,
|
|
|
109
81
|
]);
|
|
110
82
|
});
|
|
111
83
|
(0, vitest_1.test)('next.config file contains Sentry wrapper', () => {
|
|
112
|
-
(0,
|
|
84
|
+
(0, utils_1.checkFileContents)(`${projectDir}/next.config.mjs`, [
|
|
113
85
|
"import { withSentryConfig } from '@sentry/nextjs'",
|
|
114
86
|
'export default withSentryConfig(nextConfig, {',
|
|
115
87
|
]);
|
|
116
88
|
});
|
|
117
89
|
(0, vitest_1.test)('runs on dev mode correctly', async () => {
|
|
118
|
-
await (0,
|
|
90
|
+
await (0, utils_1.checkIfRunsOnDevMode)(projectDir, 'Ready in');
|
|
119
91
|
});
|
|
120
92
|
(0, vitest_1.test)('builds correctly', async () => {
|
|
121
|
-
await (0,
|
|
93
|
+
await (0, utils_1.checkIfBuilds)(projectDir);
|
|
122
94
|
});
|
|
123
95
|
(0, vitest_1.test)('runs on prod mode correctly', async () => {
|
|
124
|
-
await (0,
|
|
96
|
+
await (0, utils_1.checkIfRunsOnProdMode)(projectDir, 'Ready in');
|
|
125
97
|
});
|
|
126
98
|
(0, vitest_1.test)('root layout contains generateMetadata function', () => {
|
|
127
|
-
(0,
|
|
99
|
+
(0, utils_1.checkFileContents)(`${projectDir}/src/app/layout.tsx`, [
|
|
128
100
|
"// This file was generated by the Sentry wizard because we couldn't find a root layout file.",
|
|
129
101
|
"import * as Sentry from '@sentry/nextjs';",
|
|
130
102
|
"import type { Metadata } from 'next';",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextjs-14.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-14.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,mDAAkD;AAClD,oCAKkB;AAClB,oCAA+C;AAC/C,oCAOkB;AAClB,mCAA6D;AAE7D,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,MAAM,WAAW,GAAG,uBAAW,CAAC,MAAM,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,yCAAyC,CAC1C,CAAC;IAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,MAAM,cAAc,GAAG,IAAA,2BAAmB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACpE,MAAM,sBAAsB,GAAG,MAAM,cAAc,CAAC,aAAa,CAC/D,qCAAqC,CACtC,CAAC;QAEF,MAAM,0BAA0B,GAC9B,sBAAsB;YACtB,CAAC,MAAM,cAAc,CAAC,yBAAyB;YAC7C,0CAA0C;YAC1C,CAAC,YAAI,CAAC,IAAI,EAAE,YAAI,CAAC,KAAK,CAAC,EACvB,iFAAiF,EACjF;gBACE,OAAO,EAAE,MAAO;aACjB,CAC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yBAAyB,EAAE;YACxD,2CAA2C;YAC3C;;;;;;;;;;0DAUoD;SACrD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,0CAA0C,EAAE,GAAG,EAAE;QACpD,IAAA,yBAAiB,EAAC,GAAG,UAAU,kBAAkB,EAAE;YACjD,mDAAmD;YACnD,+CAA+C;SAChD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,IAAA,yBAAiB,EAAC,GAAG,UAAU,qBAAqB,EAAE;YACpD,8FAA8F;YAC9F,2CAA2C;YAC3C,uCAAuC;YACvC,EAAE;YACF,gDAAgD;YAChD,YAAY;YACZ,cAAc;YACd,iCAAiC;YACjC,OAAO;YACP,KAAK;YACL,IAAI;YACJ,EAAE;YACF,sCAAsC;YACtC,aAAa;YACb,MAAM;YACN,6BAA6B;YAC7B,MAAM;YACN,YAAY;YACZ,sBAAsB;YACtB,+BAA+B;YAC/B,aAAa;YACb,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n KEYS,\n checkEnvBuildPlugin,\n cleanupGit,\n revertLocalChanges,\n} from '../utils';\nimport { startWizardInstance } from '../utils';\nimport {\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n} from '../utils';\nimport { afterAll, beforeAll, describe, test } from 'vitest';\n\ndescribe('NextJS-14', () => {\n const integration = Integration.nextjs;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nextjs-14-test-app',\n );\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const routeThroughNextJsPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.ENTER],\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000,\n },\n ));\n\n const tracingOptionPrompted =\n routeThroughNextJsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Tracing\", sometimes doesn't work as `Tracing` can be printed in bold.\n 'to track the performance of your application?',\n ));\n\n const replayOptionPrompted =\n tracingOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Sentry Session Replay\", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.\n 'to get a video-like reproduction of errors during a user session?',\n ));\n\n const logOptionPrompted =\n replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n // \"Do you want to enable Logs\", sometimes doesn't work as `Logs` can be printed in bold.\n 'to send your application logs to Sentry?',\n ));\n\n const examplePagePrompted =\n logOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n const ciCdPrompted =\n examplePagePrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Are you using a CI/CD tool',\n ));\n\n // Selecting `No` for CI/CD tool\n ciCdPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n { optional: true },\n ));\n\n // Decline optional MCP config (default is now Yes, so press DOWN to select No)\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.DOWN, KEYS.ENTER],\n 'Successfully installed the Sentry Next.js SDK!',\n );\n\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, integration);\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/src/app/layout.tsx`);\n checkFileExists(`${projectDir}/src/app/sentry-example-page/page.tsx`);\n checkFileExists(`${projectDir}/src/app/api/sentry-example-api/route.ts`);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/src/app/global-error.tsx`);\n });\n\n test('instrumentation files exists', () => {\n checkFileExists(`${projectDir}/src/instrumentation.ts`);\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/instrumentation.ts`, [\n 'import * as Sentry from \"@sentry/nextjs\";',\n `export async function register() {\n if (process.env.NEXT_RUNTIME === \"nodejs\") {\n await import(\"../sentry.server.config\");\n }\n\n if (process.env.NEXT_RUNTIME === \"edge\") {\n await import(\"../sentry.edge.config\");\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.mjs`, [\n \"import { withSentryConfig } from '@sentry/nextjs'\",\n 'export default withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Ready in');\n });\n\n test('root layout contains generateMetadata function', () => {\n checkFileContents(`${projectDir}/src/app/layout.tsx`, [\n \"// This file was generated by the Sentry wizard because we couldn't find a root layout file.\",\n \"import * as Sentry from '@sentry/nextjs';\",\n \"import type { Metadata } from 'next';\",\n '',\n 'export function generateMetadata(): Metadata {',\n ' return {',\n ' other: {',\n ' ...Sentry.getTraceData(),',\n ' }',\n ' }',\n '};',\n '',\n 'export default function RootLayout({',\n ' children,',\n '}: {',\n ' children: React.ReactNode',\n '}) {',\n ' return (',\n ' <html lang=\"en\">',\n ' <body>{children}</body>',\n ' </html>',\n ' )',\n '}',\n ]);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"nextjs-14.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nextjs-14.test.ts"],"names":[],"mappings":";;AAAA,mDAAkD;AAClD,oCAUkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,MAAM,WAAW,GAAG,uBAAW,CAAC,MAAM,CAAC;IACvC,IAAI,cAAsB,CAAC;IAE3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EAAC,oBAAoB,CAAC,CAAC;IAE5E,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,cAAc,GAAG,MAAM,IAAA,gBAAO,EAAC;YAC7B,GAAG,EAAE,UAAU;SAChB,CAAC;aACC,iBAAiB,EAAE;aACnB,SAAS,CAAC,qCAAqC,CAAC;aAChD,WAAW,CAAC,aAAI,CAAC,IAAI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AI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,IAAA,yBAAiB,EAAC,GAAG,UAAU,qBAAqB,EAAE;YACpD,8FAA8F;YAC9F,2CAA2C;YAC3C,uCAAuC;YACvC,EAAE;YACF,gDAAgD;YAChD,YAAY;YACZ,cAAc;YACd,iCAAiC;YACjC,OAAO;YACP,KAAK;YACL,IAAI;YACJ,EAAE;YACF,sCAAsC;YACtC,aAAa;YACb,MAAM;YACN,6BAA6B;YAC7B,MAAM;YACN,YAAY;YACZ,sBAAsB;YACtB,+BAA+B;YAC/B,aAAa;YACb,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n createIsolatedTestEnv,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, expect, test } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('NextJS-14', () => {\n const integration = Integration.nextjs;\n let wizardExitCode: number;\n\n const { projectDir, cleanup } = createIsolatedTestEnv('nextjs-14-test-app');\n\n beforeAll(async () => {\n wizardExitCode = await withEnv({\n cwd: projectDir,\n })\n .defineInteraction()\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select yarn\n .expectOutput('Installing @sentry/nextjs')\n .whenAsked(\n 'Do you want to route Sentry requests in the browser through your Next.js server',\n {\n timeout: 240_000, // package installation can take a while in CI\n },\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to track the performance of your application?')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'to get a video-like reproduction of errors during a user session?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('to send your application logs to Sentry?')\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER)\n .whenAsked('Are you using a CI/CD tool')\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Select No\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // Decline MCP config\n .expectOutput('Successfully installed the Sentry Next.js SDK!')\n .run(getWizardCommand(integration));\n });\n\n afterAll(() => {\n cleanup();\n });\n\n test('exits with exit code 0', () => {\n expect(wizardExitCode).toBe(0);\n });\n\n test('package.json is updated correctly', () => {\n checkPackageJson(projectDir, '@sentry/nextjs');\n });\n\n test('.env-sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/src/app/layout.tsx`);\n checkFileExists(`${projectDir}/src/app/sentry-example-page/page.tsx`);\n checkFileExists(`${projectDir}/src/app/api/sentry-example-api/route.ts`);\n });\n\n test('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.edge.config.ts`);\n });\n\n test('global error file exists', () => {\n checkFileExists(`${projectDir}/src/app/global-error.tsx`);\n });\n\n test('instrumentation files exists', () => {\n checkFileExists(`${projectDir}/src/instrumentation.ts`);\n checkFileExists(`${projectDir}/src/instrumentation-client.ts`);\n });\n\n test('instrumentation file contains Sentry initialization', () => {\n checkFileContents(`${projectDir}/src/instrumentation.ts`, [\n 'import * as Sentry from \"@sentry/nextjs\";',\n `export async function register() {\n if (process.env.NEXT_RUNTIME === \"nodejs\") {\n await import(\"../sentry.server.config\");\n }\n\n if (process.env.NEXT_RUNTIME === \"edge\") {\n await import(\"../sentry.edge.config\");\n }\n}\n\nexport const onRequestError = Sentry.captureRequestError;`,\n ]);\n });\n\n test('next.config file contains Sentry wrapper', () => {\n checkFileContents(`${projectDir}/next.config.mjs`, [\n \"import { withSentryConfig } from '@sentry/nextjs'\",\n 'export default withSentryConfig(nextConfig, {',\n ]);\n });\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'Ready in');\n });\n\n test('builds correctly', async () => {\n await checkIfBuilds(projectDir);\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Ready in');\n });\n\n test('root layout contains generateMetadata function', () => {\n checkFileContents(`${projectDir}/src/app/layout.tsx`, [\n \"// This file was generated by the Sentry wizard because we couldn't find a root layout file.\",\n \"import * as Sentry from '@sentry/nextjs';\",\n \"import type { Metadata } from 'next';\",\n '',\n 'export function generateMetadata(): Metadata {',\n ' return {',\n ' other: {',\n ' ...Sentry.getTraceData(),',\n ' }',\n ' }',\n '};',\n '',\n 'export default function RootLayout({',\n ' children,',\n '}: {',\n ' children: React.ReactNode',\n '}) {',\n ' return (',\n ' <html lang=\"en\">',\n ' <body>{children}</body>',\n ' </html>',\n ' )',\n '}',\n ]);\n });\n});\n"]}
|
|
@@ -23,81 +23,74 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const path = __importStar(require("node:path"));
|
|
27
26
|
const fs = __importStar(require("node:fs"));
|
|
28
27
|
const Constants_1 = require("../../lib/Constants");
|
|
29
28
|
const utils_1 = require("../utils");
|
|
30
29
|
const utils_2 = require("../utils");
|
|
31
|
-
const utils_3 = require("../utils");
|
|
32
30
|
const vitest_1 = require("vitest");
|
|
31
|
+
//@ts-expect-error - clifty is ESM only
|
|
32
|
+
const clifty_1 = require("clifty");
|
|
33
33
|
(0, vitest_1.describe)('NextJS-15', () => {
|
|
34
34
|
const integration = Constants_1.Integration.nextjs;
|
|
35
|
-
|
|
35
|
+
let wizardExitCode;
|
|
36
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('nextjs-15-test-app');
|
|
36
37
|
(0, vitest_1.beforeAll)(async () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// Selecting `No` for CI/CD tool
|
|
64
|
-
const mcpPrompted = ciCdPrompted &&
|
|
65
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?', { optional: true }));
|
|
66
|
-
// Accept MCP config (default is now Yes)
|
|
67
|
-
const editorPrompted = mcpPrompted &&
|
|
68
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Which editor do you want to configure?'));
|
|
69
|
-
// Select Cursor as the editor (first option)
|
|
70
|
-
editorPrompted &&
|
|
71
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Successfully installed the Sentry Next.js SDK!'));
|
|
72
|
-
wizardInstance.kill();
|
|
38
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
39
|
+
cwd: projectDir,
|
|
40
|
+
})
|
|
41
|
+
.defineInteraction()
|
|
42
|
+
.whenAsked('Please select your package manager.')
|
|
43
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select yarn
|
|
44
|
+
.whenAsked('Do you want to route Sentry requests in the browser through your Next.js server', {
|
|
45
|
+
timeout: 240000, // package installation can take a while in CI
|
|
46
|
+
})
|
|
47
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
48
|
+
.whenAsked('to track the performance of your application?')
|
|
49
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
50
|
+
.whenAsked('to get a video-like reproduction of errors during a user session?')
|
|
51
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
52
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
53
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
54
|
+
.whenAsked('Do you want to create an example page')
|
|
55
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
56
|
+
.whenAsked('Are you using a CI/CD tool')
|
|
57
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select No
|
|
58
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
59
|
+
.respondWith(clifty_1.KEYS.ENTER) // Accept MCP config
|
|
60
|
+
.whenAsked('Which editor(s) do you want to configure?')
|
|
61
|
+
.respondWith(clifty_1.KEYS.SPACE, clifty_1.KEYS.ENTER) // Select Cursor
|
|
62
|
+
.expectOutput('Successfully installed the Sentry Next.js SDK!')
|
|
63
|
+
.run((0, utils_2.getWizardCommand)(integration));
|
|
73
64
|
});
|
|
74
65
|
(0, vitest_1.afterAll)(() => {
|
|
75
|
-
(
|
|
76
|
-
|
|
66
|
+
cleanup();
|
|
67
|
+
});
|
|
68
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
69
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
77
70
|
});
|
|
78
71
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
79
|
-
(0,
|
|
72
|
+
(0, utils_2.checkPackageJson)(projectDir, '@sentry/nextjs');
|
|
80
73
|
});
|
|
81
74
|
(0, vitest_1.test)('.env-sentry-build-plugin is created and contains the auth token', () => {
|
|
82
75
|
(0, utils_1.checkEnvBuildPlugin)(projectDir);
|
|
83
76
|
});
|
|
84
77
|
(0, vitest_1.test)('example page exists', () => {
|
|
85
|
-
(0,
|
|
86
|
-
(0,
|
|
78
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/app/sentry-example-page/page.tsx`);
|
|
79
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/app/api/sentry-example-api/route.ts`);
|
|
87
80
|
});
|
|
88
81
|
(0, vitest_1.test)('config files created', () => {
|
|
89
|
-
(0,
|
|
90
|
-
(0,
|
|
82
|
+
(0, utils_2.checkFileExists)(`${projectDir}/sentry.server.config.ts`);
|
|
83
|
+
(0, utils_2.checkFileExists)(`${projectDir}/sentry.edge.config.ts`);
|
|
91
84
|
});
|
|
92
85
|
(0, vitest_1.test)('global error file exists', () => {
|
|
93
|
-
(0,
|
|
86
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/app/global-error.tsx`);
|
|
94
87
|
});
|
|
95
88
|
(0, vitest_1.test)('instrumentation files exists', () => {
|
|
96
|
-
(0,
|
|
97
|
-
(0,
|
|
89
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/instrumentation.ts`);
|
|
90
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/instrumentation-client.ts`);
|
|
98
91
|
});
|
|
99
92
|
(0, vitest_1.test)('instrumentation file contains Sentry initialization', () => {
|
|
100
|
-
(0,
|
|
93
|
+
(0, utils_2.checkFileContents)(`${projectDir}/src/instrumentation.ts`, [
|
|
101
94
|
'import * as Sentry from "@sentry/nextjs";',
|
|
102
95
|
`export async function register() {
|
|
103
96
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
@@ -113,70 +106,67 @@ export const onRequestError = Sentry.captureRequestError;`,
|
|
|
113
106
|
]);
|
|
114
107
|
});
|
|
115
108
|
(0, vitest_1.test)('next.config file contains Sentry wrapper', () => {
|
|
116
|
-
(0,
|
|
109
|
+
(0, utils_2.checkFileContents)(`${projectDir}/next.config.ts`, [
|
|
117
110
|
'import { withSentryConfig } from "@sentry/nextjs"',
|
|
118
111
|
'export default withSentryConfig(nextConfig, {',
|
|
119
112
|
]);
|
|
120
113
|
});
|
|
121
114
|
(0, vitest_1.test)('runs on dev mode correctly', async () => {
|
|
122
|
-
await (0,
|
|
115
|
+
await (0, utils_2.checkIfRunsOnDevMode)(projectDir, 'Ready in');
|
|
123
116
|
});
|
|
124
117
|
(0, vitest_1.test)('builds correctly', async () => {
|
|
125
|
-
await (0,
|
|
118
|
+
await (0, utils_2.checkIfBuilds)(projectDir);
|
|
126
119
|
});
|
|
127
120
|
(0, vitest_1.test)('runs on prod mode correctly', async () => {
|
|
128
|
-
await (0,
|
|
121
|
+
await (0, utils_2.checkIfRunsOnProdMode)(projectDir, 'Ready in');
|
|
129
122
|
});
|
|
130
123
|
(0, vitest_1.test)('MCP configuration file is created for Cursor', () => {
|
|
131
|
-
(0,
|
|
132
|
-
(0,
|
|
124
|
+
(0, utils_2.checkFileExists)(`${projectDir}/.cursor/mcp.json`);
|
|
125
|
+
(0, utils_2.checkFileContents)(`${projectDir}/.cursor/mcp.json`, [
|
|
133
126
|
'"mcpServers"',
|
|
134
127
|
'"Sentry"',
|
|
135
|
-
|
|
128
|
+
`"url": "https://mcp.sentry.dev/mcp/${utils_1.TEST_ARGS.ORG_SLUG}/${utils_1.TEST_ARGS.PROJECT_SLUG}"`,
|
|
136
129
|
]);
|
|
137
130
|
});
|
|
138
131
|
});
|
|
139
132
|
(0, vitest_1.describe)('NextJS-15 Spotlight', () => {
|
|
140
133
|
const integration = Constants_1.Integration.nextjs;
|
|
141
|
-
|
|
134
|
+
let wizardExitCode;
|
|
135
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('nextjs-15-test-app');
|
|
142
136
|
(0, vitest_1.beforeAll)(async () => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
(
|
|
167
|
-
// Skip example page creation
|
|
168
|
-
logOptionPrompted &&
|
|
169
|
-
(await wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Next.js SDK!', {
|
|
170
|
-
optional: true,
|
|
171
|
-
}));
|
|
172
|
-
wizardInstance.kill();
|
|
137
|
+
wizardExitCode = await (0, clifty_1.withEnv)({
|
|
138
|
+
cwd: projectDir,
|
|
139
|
+
})
|
|
140
|
+
.defineInteraction()
|
|
141
|
+
.expectOutput('Spotlight mode enabled!')
|
|
142
|
+
.whenAsked('Please select your package manager.')
|
|
143
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Select yarn
|
|
144
|
+
.expectOutput('Installing @sentry/nextjs')
|
|
145
|
+
.whenAsked('Do you want to route Sentry requests in the browser through your Next.js server', {
|
|
146
|
+
timeout: 240000, // package installation can take a while in CI
|
|
147
|
+
})
|
|
148
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
149
|
+
.whenAsked('to track the performance of your application?')
|
|
150
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
151
|
+
.whenAsked('to get a video-like reproduction of errors during a user session?')
|
|
152
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
153
|
+
.whenAsked('to send your application logs to Sentry?')
|
|
154
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
155
|
+
.whenAsked('Do you want to create an example page')
|
|
156
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Skip example page
|
|
157
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
158
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // Decline MCP config
|
|
159
|
+
.expectOutput('Successfully installed the Sentry Next.js SDK!')
|
|
160
|
+
.run(`${(0, utils_2.getWizardCommand)(integration)} --spotlight`);
|
|
173
161
|
});
|
|
174
162
|
(0, vitest_1.afterAll)(() => {
|
|
175
|
-
(
|
|
176
|
-
|
|
163
|
+
cleanup();
|
|
164
|
+
});
|
|
165
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
166
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
177
167
|
});
|
|
178
168
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
179
|
-
(0,
|
|
169
|
+
(0, utils_2.checkPackageJson)(projectDir, '@sentry/nextjs');
|
|
180
170
|
});
|
|
181
171
|
(0, vitest_1.test)('.env-sentry-build-plugin should NOT exist in spotlight mode', () => {
|
|
182
172
|
const envFilePath = `${projectDir}/.env.sentry-build-plugin`;
|
|
@@ -185,33 +175,33 @@ export const onRequestError = Sentry.captureRequestError;`,
|
|
|
185
175
|
(0, vitest_1.expect)(fs.existsSync(envFilePath)).toBe(false);
|
|
186
176
|
});
|
|
187
177
|
(0, vitest_1.test)('config files created', () => {
|
|
188
|
-
(0,
|
|
189
|
-
(0,
|
|
178
|
+
(0, utils_2.checkFileExists)(`${projectDir}/sentry.server.config.ts`);
|
|
179
|
+
(0, utils_2.checkFileExists)(`${projectDir}/sentry.edge.config.ts`);
|
|
190
180
|
});
|
|
191
181
|
(0, vitest_1.test)('server config file contains empty DSN and spotlight flag', () => {
|
|
192
|
-
(0,
|
|
182
|
+
(0, utils_2.checkFileContents)(`${projectDir}/sentry.server.config.ts`, [
|
|
193
183
|
'dsn: ""',
|
|
194
184
|
'spotlight: true',
|
|
195
185
|
]);
|
|
196
186
|
});
|
|
197
187
|
(0, vitest_1.test)('edge config file contains empty DSN and spotlight flag', () => {
|
|
198
|
-
(0,
|
|
188
|
+
(0, utils_2.checkFileContents)(`${projectDir}/sentry.edge.config.ts`, [
|
|
199
189
|
'dsn: ""',
|
|
200
190
|
'spotlight: true',
|
|
201
191
|
]);
|
|
202
192
|
});
|
|
203
193
|
(0, vitest_1.test)('instrumentation client file contains empty DSN and spotlight flag', () => {
|
|
204
|
-
(0,
|
|
205
|
-
(0,
|
|
194
|
+
(0, utils_2.checkFileExists)(`${projectDir}/src/instrumentation-client.ts`);
|
|
195
|
+
(0, utils_2.checkFileContents)(`${projectDir}/src/instrumentation-client.ts`, [
|
|
206
196
|
'dsn: ""',
|
|
207
197
|
'spotlight: true',
|
|
208
198
|
]);
|
|
209
199
|
});
|
|
210
200
|
(0, vitest_1.test)('builds correctly', async () => {
|
|
211
|
-
await (0,
|
|
201
|
+
await (0, utils_2.checkIfBuilds)(projectDir);
|
|
212
202
|
});
|
|
213
203
|
(0, vitest_1.test)('runs on dev mode correctly', async () => {
|
|
214
|
-
await (0,
|
|
204
|
+
await (0, utils_2.checkIfRunsOnDevMode)(projectDir, 'Ready in');
|
|
215
205
|
});
|
|
216
206
|
});
|
|
217
207
|
//# sourceMappingURL=nextjs-15.test.js.map
|