@sentry/wizard 3.42.1 → 4.0.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/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
- package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
- package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
- package/.node-cache/node-v22.14.0-linux-x64 +0 -0
- package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
- package/CHANGELOG.md +26 -0
- package/COPYING +3575 -0
- package/bin.ts +85 -80
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/e2e-tests/package.json +1 -1
- package/e2e-tests/tests/flutter.test.ts +20 -20
- package/e2e-tests/tests/nextjs.test.ts +2 -2
- package/e2e-tests/tests/nuxt-3.test.ts +4 -4
- package/e2e-tests/tests/nuxt-4.test.ts +3 -3
- package/e2e-tests/tests/remix.test.ts +3 -3
- package/e2e-tests/tests/sveltekit.test.ts +3 -3
- package/e2e-tests/utils/index.ts +33 -15
- package/lib/Helper/BottomBar.ts +1 -1
- package/lib/Helper/Env.ts +1 -1
- package/lib/Helper/Package.ts +12 -10
- package/lib/Helper/SentryCli.ts +18 -27
- package/lib/Helper/Wizard.ts +1 -2
- package/lib/Setup.ts +4 -5
- package/lib/Steps/ChooseIntegration.ts +40 -8
- package/lib/Steps/Initial.ts +17 -26
- package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
- package/lib/Steps/Integrations/Cordova.ts +9 -15
- package/lib/Steps/Integrations/Electron.ts +23 -20
- package/lib/Steps/Integrations/MobileProject.ts +18 -15
- package/lib/Steps/OpenSentry.ts +12 -7
- package/lib/Steps/PromptForParameters.ts +12 -19
- package/lib/Steps/SentryProjectSelector.ts +30 -29
- package/lib/Steps/WaitForSentry.ts +29 -23
- package/package.json +12 -8
- package/src/apple/xcode-manager.ts +10 -10
- package/src/nextjs/templates.ts +2 -3
- package/src/nuxt/sdk-setup.ts +21 -18
- package/src/react-native/expo-metro.ts +2 -2
- package/src/react-native/react-native-wizard.ts +1 -2
- package/src/react-native/uninstall.ts +1 -2
- package/src/react-native/xcode.ts +1 -1
- package/src/run.ts +12 -5
- package/src/sourcemaps/tools/nextjs.ts +2 -2
- package/src/sourcemaps/tools/webpack.ts +3 -3
- package/src/telemetry.ts +27 -7
- package/src/utils/clack-utils.ts +50 -47
- package/test/apple/cocoapod.test.ts +4 -0
- package/test/apple/fastfile.test.ts +12 -7
- package/test/apple/xcode-manager.test.ts +13 -11
- package/test/utils/clack-utils.test.ts +40 -50
- package/types/read-env.d.ts +3 -0
- package/types/xcode.d.ts +1 -0
- package/dist/package.json +0 -128
|
@@ -1,40 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
describe('Flutter code templates',
|
|
5
|
-
describe('pubspec',
|
|
6
|
-
it('generates pubspec with project and org',
|
|
7
|
-
|
|
8
|
-
expect(template).toMatchInlineSnapshot(
|
|
3
|
+
const templates_1 = require("../../src/flutter/templates");
|
|
4
|
+
describe('Flutter code templates', () => {
|
|
5
|
+
describe('pubspec', () => {
|
|
6
|
+
it('generates pubspec with project and org', () => {
|
|
7
|
+
const template = (0, templates_1.pubspecOptions)('fixture-project', 'fixture-org');
|
|
8
|
+
expect(template).toMatchInlineSnapshot(`
|
|
9
|
+
"sentry:
|
|
10
|
+
upload_debug_symbols: true
|
|
11
|
+
upload_source_maps: true
|
|
12
|
+
project: fixture-project
|
|
13
|
+
org: fixture-org
|
|
14
|
+
"
|
|
15
|
+
`);
|
|
9
16
|
});
|
|
10
17
|
});
|
|
11
|
-
describe('sentry.properties',
|
|
12
|
-
it('generates sentry.properties with token',
|
|
13
|
-
|
|
14
|
-
expect(template).toMatchInlineSnapshot("
|
|
18
|
+
describe('sentry.properties', () => {
|
|
19
|
+
it('generates sentry.properties with token', () => {
|
|
20
|
+
const template = (0, templates_1.sentryProperties)('fixture-token');
|
|
21
|
+
expect(template).toMatchInlineSnapshot(`"auth_token=fixture-token"`);
|
|
15
22
|
});
|
|
16
23
|
});
|
|
17
|
-
describe('init',
|
|
18
|
-
it('generates Sentry config with all features enabled',
|
|
19
|
-
|
|
24
|
+
describe('init', () => {
|
|
25
|
+
it('generates Sentry config with all features enabled', () => {
|
|
26
|
+
const template = (0, templates_1.initSnippet)('my-dsn', {
|
|
20
27
|
tracing: true,
|
|
21
28
|
profiling: true,
|
|
22
29
|
}, 'const MyApp()');
|
|
23
|
-
expect(template).toMatchInlineSnapshot(
|
|
30
|
+
expect(template).toMatchInlineSnapshot(`
|
|
31
|
+
"await SentryFlutter.init(
|
|
32
|
+
(options) {
|
|
33
|
+
options.dsn = 'my-dsn';
|
|
34
|
+
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
|
|
35
|
+
// We recommend adjusting this value in production.
|
|
36
|
+
options.tracesSampleRate = 1.0;
|
|
37
|
+
// The sampling rate for profiling is relative to tracesSampleRate
|
|
38
|
+
// Setting to 1.0 will profile 100% of sampled transactions:
|
|
39
|
+
options.profilesSampleRate = 1.0;
|
|
40
|
+
},
|
|
41
|
+
appRunner: () => runApp(SentryWidget(child: const MyApp())),
|
|
42
|
+
);
|
|
43
|
+
// TODO: Remove this line after sending the first sample event to sentry.
|
|
44
|
+
await Sentry.captureException(Exception('This is a sample exception.'));"
|
|
45
|
+
`);
|
|
24
46
|
});
|
|
25
|
-
it('generates Sentry config with profiling disabled',
|
|
26
|
-
|
|
47
|
+
it('generates Sentry config with profiling disabled', () => {
|
|
48
|
+
const template = (0, templates_1.initSnippet)('my-dsn', {
|
|
27
49
|
tracing: true,
|
|
28
50
|
profiling: false,
|
|
29
51
|
}, 'const MyApp()');
|
|
30
|
-
expect(template).toMatchInlineSnapshot(
|
|
52
|
+
expect(template).toMatchInlineSnapshot(`
|
|
53
|
+
"await SentryFlutter.init(
|
|
54
|
+
(options) {
|
|
55
|
+
options.dsn = 'my-dsn';
|
|
56
|
+
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
|
|
57
|
+
// We recommend adjusting this value in production.
|
|
58
|
+
options.tracesSampleRate = 1.0;
|
|
59
|
+
},
|
|
60
|
+
appRunner: () => runApp(SentryWidget(child: const MyApp())),
|
|
61
|
+
);
|
|
62
|
+
// TODO: Remove this line after sending the first sample event to sentry.
|
|
63
|
+
await Sentry.captureException(Exception('This is a sample exception.'));"
|
|
64
|
+
`);
|
|
31
65
|
});
|
|
32
|
-
it('generates Sentry config with tracing disabled',
|
|
33
|
-
|
|
66
|
+
it('generates Sentry config with tracing disabled', () => {
|
|
67
|
+
const template = (0, templates_1.initSnippet)('my-dsn', {
|
|
34
68
|
tracing: false,
|
|
35
69
|
profiling: false,
|
|
36
70
|
}, 'const MyApp()');
|
|
37
|
-
expect(template).toMatchInlineSnapshot(
|
|
71
|
+
expect(template).toMatchInlineSnapshot(`
|
|
72
|
+
"await SentryFlutter.init(
|
|
73
|
+
(options) {
|
|
74
|
+
options.dsn = 'my-dsn';
|
|
75
|
+
},
|
|
76
|
+
appRunner: () => runApp(SentryWidget(child: const MyApp())),
|
|
77
|
+
);
|
|
78
|
+
// TODO: Remove this line after sending the first sample event to sentry.
|
|
79
|
+
await Sentry.captureException(Exception('This is a sample exception.'));"
|
|
80
|
+
`);
|
|
38
81
|
});
|
|
39
82
|
});
|
|
40
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/flutter/templates.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/flutter/templates.test.ts"],"names":[],"mappings":";;AAAA,2DAIqC;AAErC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACvB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,QAAQ,GAAG,IAAA,0BAAc,EAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;YAClE,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;OAOtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,QAAQ,GAAG,IAAA,4BAAgB,EAAC,eAAe,CAAC,CAAC;YACnD,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,4BAA4B,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI;aAChB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;;;;OAetC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;YACzD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;;;;OAYtC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,QAAQ,GAAG,IAAA,uBAAW,EAC1B,QAAQ,EACR;gBACE,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK;aACjB,EACD,eAAe,CAChB,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;;OAStC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n pubspecOptions,\n sentryProperties,\n initSnippet,\n} from '../../src/flutter/templates';\n\ndescribe('Flutter code templates', () => {\n describe('pubspec', () => {\n it('generates pubspec with project and org', () => {\n const template = pubspecOptions('fixture-project', 'fixture-org');\n expect(template).toMatchInlineSnapshot(`\n \"sentry:\n upload_debug_symbols: true\n upload_source_maps: true\n project: fixture-project\n org: fixture-org\n \"\n `);\n });\n });\n describe('sentry.properties', () => {\n it('generates sentry.properties with token', () => {\n const template = sentryProperties('fixture-token');\n expect(template).toMatchInlineSnapshot(`\"auth_token=fixture-token\"`);\n });\n });\n describe('init', () => {\n it('generates Sentry config with all features enabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: true,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n // The sampling rate for profiling is relative to tracesSampleRate\n // Setting to 1.0 will profile 100% of sampled transactions:\n options.profilesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with profiling disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: true,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0;\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n\n it('generates Sentry config with tracing disabled', () => {\n const template = initSnippet(\n 'my-dsn',\n {\n tracing: false,\n profiling: false,\n },\n 'const MyApp()',\n );\n expect(template).toMatchInlineSnapshot(`\n \"await SentryFlutter.init(\n (options) {\n options.dsn = 'my-dsn';\n },\n appRunner: () => runApp(SentryWidget(child: const MyApp())),\n );\n // TODO: Remove this line after sending the first sample event to sentry.\n await Sentry.captureException(Exception('This is a sample exception.'));\"\n `);\n });\n });\n});\n"]}
|
|
@@ -1,74 +1,229 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
describe('Next.js code templates',
|
|
5
|
-
describe('getSentryConfigContents',
|
|
6
|
-
describe('client-side',
|
|
7
|
-
it('generates client-side Sentry config with all features enabled',
|
|
8
|
-
|
|
3
|
+
const templates_1 = require("../../src/nextjs/templates");
|
|
4
|
+
describe('Next.js code templates', () => {
|
|
5
|
+
describe('getSentryConfigContents', () => {
|
|
6
|
+
describe('client-side', () => {
|
|
7
|
+
it('generates client-side Sentry config with all features enabled', () => {
|
|
8
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
|
|
9
9
|
performance: true,
|
|
10
10
|
replay: true,
|
|
11
11
|
});
|
|
12
|
-
expect(template).toMatchInlineSnapshot(
|
|
12
|
+
expect(template).toMatchInlineSnapshot(`
|
|
13
|
+
"// This file configures the initialization of Sentry on the client.
|
|
14
|
+
// The config you add here will be used whenever a users loads a page in their browser.
|
|
15
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
16
|
+
|
|
17
|
+
import * as Sentry from "@sentry/nextjs";
|
|
18
|
+
|
|
19
|
+
Sentry.init({
|
|
20
|
+
dsn: "my-dsn",
|
|
21
|
+
|
|
22
|
+
// Add optional integrations for additional features
|
|
23
|
+
integrations: [
|
|
24
|
+
Sentry.replayIntegration(),
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
28
|
+
tracesSampleRate: 1,
|
|
29
|
+
|
|
30
|
+
// Define how likely Replay events are sampled.
|
|
31
|
+
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
32
|
+
// in development and sample at a lower rate in production
|
|
33
|
+
replaysSessionSampleRate: 0.1,
|
|
34
|
+
|
|
35
|
+
// Define how likely Replay events are sampled when an error occurs.
|
|
36
|
+
replaysOnErrorSampleRate: 1.0,
|
|
37
|
+
|
|
38
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
39
|
+
debug: false,
|
|
40
|
+
});
|
|
41
|
+
"
|
|
42
|
+
`);
|
|
13
43
|
});
|
|
14
|
-
it('generates client-side Sentry config with performance monitoring disabled',
|
|
15
|
-
|
|
44
|
+
it('generates client-side Sentry config with performance monitoring disabled', () => {
|
|
45
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
|
|
16
46
|
performance: false,
|
|
17
47
|
replay: true,
|
|
18
48
|
});
|
|
19
|
-
expect(template).toMatchInlineSnapshot(
|
|
49
|
+
expect(template).toMatchInlineSnapshot(`
|
|
50
|
+
"// This file configures the initialization of Sentry on the client.
|
|
51
|
+
// The config you add here will be used whenever a users loads a page in their browser.
|
|
52
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
53
|
+
|
|
54
|
+
import * as Sentry from "@sentry/nextjs";
|
|
55
|
+
|
|
56
|
+
Sentry.init({
|
|
57
|
+
dsn: "my-dsn",
|
|
58
|
+
|
|
59
|
+
// Add optional integrations for additional features
|
|
60
|
+
integrations: [
|
|
61
|
+
Sentry.replayIntegration(),
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
// Define how likely Replay events are sampled.
|
|
65
|
+
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
66
|
+
// in development and sample at a lower rate in production
|
|
67
|
+
replaysSessionSampleRate: 0.1,
|
|
68
|
+
|
|
69
|
+
// Define how likely Replay events are sampled when an error occurs.
|
|
70
|
+
replaysOnErrorSampleRate: 1.0,
|
|
71
|
+
|
|
72
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
73
|
+
debug: false,
|
|
74
|
+
});
|
|
75
|
+
"
|
|
76
|
+
`);
|
|
20
77
|
});
|
|
21
|
-
it('generates client-side Sentry config with session replay disabled',
|
|
22
|
-
|
|
78
|
+
it('generates client-side Sentry config with session replay disabled', () => {
|
|
79
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'client', {
|
|
23
80
|
performance: true,
|
|
24
81
|
replay: false,
|
|
25
82
|
});
|
|
26
|
-
expect(template).toMatchInlineSnapshot(
|
|
83
|
+
expect(template).toMatchInlineSnapshot(`
|
|
84
|
+
"// This file configures the initialization of Sentry on the client.
|
|
85
|
+
// The config you add here will be used whenever a users loads a page in their browser.
|
|
86
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
87
|
+
|
|
88
|
+
import * as Sentry from "@sentry/nextjs";
|
|
89
|
+
|
|
90
|
+
Sentry.init({
|
|
91
|
+
dsn: "my-dsn",
|
|
92
|
+
|
|
93
|
+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
94
|
+
tracesSampleRate: 1,
|
|
95
|
+
|
|
96
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
97
|
+
debug: false,
|
|
98
|
+
});
|
|
99
|
+
"
|
|
100
|
+
`);
|
|
27
101
|
});
|
|
28
102
|
});
|
|
29
|
-
describe('server-side',
|
|
30
|
-
it('generates server-side Sentry config with all features enabled',
|
|
31
|
-
|
|
103
|
+
describe('server-side', () => {
|
|
104
|
+
it('generates server-side Sentry config with all features enabled', () => {
|
|
105
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
|
|
32
106
|
performance: true,
|
|
33
107
|
replay: true,
|
|
34
108
|
});
|
|
35
|
-
expect(template).toMatchInlineSnapshot(
|
|
109
|
+
expect(template).toMatchInlineSnapshot(`
|
|
110
|
+
"// This file configures the initialization of Sentry on the server.
|
|
111
|
+
// The config you add here will be used whenever the server handles a request.
|
|
112
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
113
|
+
|
|
114
|
+
import * as Sentry from "@sentry/nextjs";
|
|
115
|
+
|
|
116
|
+
Sentry.init({
|
|
117
|
+
dsn: "my-dsn",
|
|
118
|
+
|
|
119
|
+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
120
|
+
tracesSampleRate: 1,
|
|
121
|
+
|
|
122
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
123
|
+
debug: false,
|
|
124
|
+
});
|
|
125
|
+
"
|
|
126
|
+
`);
|
|
36
127
|
});
|
|
37
|
-
it('generates server-side Sentry config with performance monitoring disabled',
|
|
38
|
-
|
|
128
|
+
it('generates server-side Sentry config with performance monitoring disabled', () => {
|
|
129
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
|
|
39
130
|
performance: false,
|
|
40
131
|
replay: true,
|
|
41
132
|
});
|
|
42
|
-
expect(template).toMatchInlineSnapshot(
|
|
133
|
+
expect(template).toMatchInlineSnapshot(`
|
|
134
|
+
"// This file configures the initialization of Sentry on the server.
|
|
135
|
+
// The config you add here will be used whenever the server handles a request.
|
|
136
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
137
|
+
|
|
138
|
+
import * as Sentry from "@sentry/nextjs";
|
|
139
|
+
|
|
140
|
+
Sentry.init({
|
|
141
|
+
dsn: "my-dsn",
|
|
142
|
+
|
|
143
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
144
|
+
debug: false,
|
|
145
|
+
});
|
|
146
|
+
"
|
|
147
|
+
`);
|
|
43
148
|
});
|
|
44
|
-
it('generates server-side Sentry config with spotlight disabled',
|
|
45
|
-
|
|
149
|
+
it('generates server-side Sentry config with spotlight disabled', () => {
|
|
150
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'server', {
|
|
46
151
|
performance: true,
|
|
47
152
|
replay: true,
|
|
48
153
|
});
|
|
49
|
-
expect(template).toMatchInlineSnapshot(
|
|
154
|
+
expect(template).toMatchInlineSnapshot(`
|
|
155
|
+
"// This file configures the initialization of Sentry on the server.
|
|
156
|
+
// The config you add here will be used whenever the server handles a request.
|
|
157
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
158
|
+
|
|
159
|
+
import * as Sentry from "@sentry/nextjs";
|
|
160
|
+
|
|
161
|
+
Sentry.init({
|
|
162
|
+
dsn: "my-dsn",
|
|
163
|
+
|
|
164
|
+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
165
|
+
tracesSampleRate: 1,
|
|
166
|
+
|
|
167
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
168
|
+
debug: false,
|
|
169
|
+
});
|
|
170
|
+
"
|
|
171
|
+
`);
|
|
50
172
|
});
|
|
51
173
|
});
|
|
52
|
-
describe('edge',
|
|
53
|
-
it('generates edge Sentry config with all features enabled',
|
|
54
|
-
|
|
174
|
+
describe('edge', () => {
|
|
175
|
+
it('generates edge Sentry config with all features enabled', () => {
|
|
176
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
|
|
55
177
|
performance: true,
|
|
56
178
|
replay: true,
|
|
57
179
|
});
|
|
58
|
-
expect(template).toMatchInlineSnapshot(
|
|
180
|
+
expect(template).toMatchInlineSnapshot(`
|
|
181
|
+
"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
|
|
182
|
+
// The config you add here will be used whenever one of the edge features is loaded.
|
|
183
|
+
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
|
|
184
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
185
|
+
|
|
186
|
+
import * as Sentry from "@sentry/nextjs";
|
|
187
|
+
|
|
188
|
+
Sentry.init({
|
|
189
|
+
dsn: "my-dsn",
|
|
190
|
+
|
|
191
|
+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
192
|
+
tracesSampleRate: 1,
|
|
193
|
+
|
|
194
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
195
|
+
debug: false,
|
|
196
|
+
});
|
|
197
|
+
"
|
|
198
|
+
`);
|
|
59
199
|
});
|
|
60
|
-
it('generates edge Sentry config with performance monitoring disabled',
|
|
61
|
-
|
|
200
|
+
it('generates edge Sentry config with performance monitoring disabled', () => {
|
|
201
|
+
const template = (0, templates_1.getSentryConfigContents)('my-dsn', 'edge', {
|
|
62
202
|
performance: false,
|
|
63
203
|
replay: true,
|
|
64
204
|
});
|
|
65
|
-
expect(template).toMatchInlineSnapshot(
|
|
205
|
+
expect(template).toMatchInlineSnapshot(`
|
|
206
|
+
"// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
|
|
207
|
+
// The config you add here will be used whenever one of the edge features is loaded.
|
|
208
|
+
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
|
|
209
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
210
|
+
|
|
211
|
+
import * as Sentry from "@sentry/nextjs";
|
|
212
|
+
|
|
213
|
+
Sentry.init({
|
|
214
|
+
dsn: "my-dsn",
|
|
215
|
+
|
|
216
|
+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
217
|
+
debug: false,
|
|
218
|
+
});
|
|
219
|
+
"
|
|
220
|
+
`);
|
|
66
221
|
});
|
|
67
222
|
});
|
|
68
223
|
});
|
|
69
|
-
describe('getWithSentryConfigOptionsTemplate',
|
|
70
|
-
it('generates options for SaaS',
|
|
71
|
-
|
|
224
|
+
describe('getWithSentryConfigOptionsTemplate', () => {
|
|
225
|
+
it('generates options for SaaS', () => {
|
|
226
|
+
const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
|
|
72
227
|
orgSlug: 'my-org',
|
|
73
228
|
projectSlug: 'my-project',
|
|
74
229
|
selfHosted: false,
|
|
@@ -76,10 +231,42 @@ describe('Next.js code templates', function () {
|
|
|
76
231
|
tunnelRoute: true,
|
|
77
232
|
reactComponentAnnotation: false,
|
|
78
233
|
});
|
|
79
|
-
expect(template).toMatchInlineSnapshot(
|
|
234
|
+
expect(template).toMatchInlineSnapshot(`
|
|
235
|
+
"{
|
|
236
|
+
// For all available options, see:
|
|
237
|
+
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
238
|
+
|
|
239
|
+
org: "my-org",
|
|
240
|
+
project: "my-project",
|
|
241
|
+
|
|
242
|
+
// Only print logs for uploading source maps in CI
|
|
243
|
+
silent: !process.env.CI,
|
|
244
|
+
|
|
245
|
+
// For all available options, see:
|
|
246
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
247
|
+
|
|
248
|
+
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
249
|
+
widenClientFileUpload: true,
|
|
250
|
+
|
|
251
|
+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
|
252
|
+
// This can increase your server load as well as your hosting bill.
|
|
253
|
+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
|
254
|
+
// side errors will fail.
|
|
255
|
+
tunnelRoute: "/monitoring",
|
|
256
|
+
|
|
257
|
+
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
258
|
+
disableLogger: true,
|
|
259
|
+
|
|
260
|
+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
|
|
261
|
+
// See the following for more information:
|
|
262
|
+
// https://docs.sentry.io/product/crons/
|
|
263
|
+
// https://vercel.com/docs/cron-jobs
|
|
264
|
+
automaticVercelMonitors: true,
|
|
265
|
+
}"
|
|
266
|
+
`);
|
|
80
267
|
});
|
|
81
|
-
it('generates options for self-hosted',
|
|
82
|
-
|
|
268
|
+
it('generates options for self-hosted', () => {
|
|
269
|
+
const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
|
|
83
270
|
orgSlug: 'my-org',
|
|
84
271
|
projectSlug: 'my-project',
|
|
85
272
|
selfHosted: true,
|
|
@@ -87,10 +274,43 @@ describe('Next.js code templates', function () {
|
|
|
87
274
|
tunnelRoute: true,
|
|
88
275
|
reactComponentAnnotation: false,
|
|
89
276
|
});
|
|
90
|
-
expect(template).toMatchInlineSnapshot(
|
|
277
|
+
expect(template).toMatchInlineSnapshot(`
|
|
278
|
+
"{
|
|
279
|
+
// For all available options, see:
|
|
280
|
+
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
281
|
+
|
|
282
|
+
org: "my-org",
|
|
283
|
+
project: "my-project",
|
|
284
|
+
sentryUrl: "https://my-sentry.com",
|
|
285
|
+
|
|
286
|
+
// Only print logs for uploading source maps in CI
|
|
287
|
+
silent: !process.env.CI,
|
|
288
|
+
|
|
289
|
+
// For all available options, see:
|
|
290
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
291
|
+
|
|
292
|
+
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
293
|
+
widenClientFileUpload: true,
|
|
294
|
+
|
|
295
|
+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
|
296
|
+
// This can increase your server load as well as your hosting bill.
|
|
297
|
+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
|
298
|
+
// side errors will fail.
|
|
299
|
+
tunnelRoute: "/monitoring",
|
|
300
|
+
|
|
301
|
+
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
302
|
+
disableLogger: true,
|
|
303
|
+
|
|
304
|
+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
|
|
305
|
+
// See the following for more information:
|
|
306
|
+
// https://docs.sentry.io/product/crons/
|
|
307
|
+
// https://vercel.com/docs/cron-jobs
|
|
308
|
+
automaticVercelMonitors: true,
|
|
309
|
+
}"
|
|
310
|
+
`);
|
|
91
311
|
});
|
|
92
|
-
it('comments out tunnelRoute if `tunnelRoute` option is disabled',
|
|
93
|
-
|
|
312
|
+
it('comments out tunnelRoute if `tunnelRoute` option is disabled', () => {
|
|
313
|
+
const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
|
|
94
314
|
orgSlug: 'my-org',
|
|
95
315
|
projectSlug: 'my-project',
|
|
96
316
|
selfHosted: false,
|
|
@@ -98,10 +318,42 @@ describe('Next.js code templates', function () {
|
|
|
98
318
|
tunnelRoute: false,
|
|
99
319
|
reactComponentAnnotation: false,
|
|
100
320
|
});
|
|
101
|
-
expect(template).toMatchInlineSnapshot(
|
|
321
|
+
expect(template).toMatchInlineSnapshot(`
|
|
322
|
+
"{
|
|
323
|
+
// For all available options, see:
|
|
324
|
+
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
325
|
+
|
|
326
|
+
org: "my-org",
|
|
327
|
+
project: "my-project",
|
|
328
|
+
|
|
329
|
+
// Only print logs for uploading source maps in CI
|
|
330
|
+
silent: !process.env.CI,
|
|
331
|
+
|
|
332
|
+
// For all available options, see:
|
|
333
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
334
|
+
|
|
335
|
+
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
336
|
+
widenClientFileUpload: true,
|
|
337
|
+
|
|
338
|
+
// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
|
339
|
+
// This can increase your server load as well as your hosting bill.
|
|
340
|
+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
|
341
|
+
// side errors will fail.
|
|
342
|
+
// tunnelRoute: "/monitoring",
|
|
343
|
+
|
|
344
|
+
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
345
|
+
disableLogger: true,
|
|
346
|
+
|
|
347
|
+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
|
|
348
|
+
// See the following for more information:
|
|
349
|
+
// https://docs.sentry.io/product/crons/
|
|
350
|
+
// https://vercel.com/docs/cron-jobs
|
|
351
|
+
automaticVercelMonitors: true,
|
|
352
|
+
}"
|
|
353
|
+
`);
|
|
102
354
|
});
|
|
103
|
-
it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled',
|
|
104
|
-
|
|
355
|
+
it('adds `reactComponentAnnotations` option if `reactComponentAnnotations` is enabled', () => {
|
|
356
|
+
const template = (0, templates_1.getWithSentryConfigOptionsTemplate)({
|
|
105
357
|
orgSlug: 'my-org',
|
|
106
358
|
projectSlug: 'my-project',
|
|
107
359
|
selfHosted: false,
|
|
@@ -109,7 +361,44 @@ describe('Next.js code templates', function () {
|
|
|
109
361
|
tunnelRoute: true,
|
|
110
362
|
reactComponentAnnotation: true,
|
|
111
363
|
});
|
|
112
|
-
expect(template).toMatchInlineSnapshot(
|
|
364
|
+
expect(template).toMatchInlineSnapshot(`
|
|
365
|
+
"{
|
|
366
|
+
// For all available options, see:
|
|
367
|
+
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
368
|
+
|
|
369
|
+
org: "my-org",
|
|
370
|
+
project: "my-project",
|
|
371
|
+
|
|
372
|
+
// Only print logs for uploading source maps in CI
|
|
373
|
+
silent: !process.env.CI,
|
|
374
|
+
|
|
375
|
+
// For all available options, see:
|
|
376
|
+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
377
|
+
|
|
378
|
+
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
379
|
+
widenClientFileUpload: true,
|
|
380
|
+
|
|
381
|
+
// Automatically annotate React components to show their full name in breadcrumbs and session replay
|
|
382
|
+
reactComponentAnnotation: {
|
|
383
|
+
enabled: true,
|
|
384
|
+
},
|
|
385
|
+
|
|
386
|
+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
|
387
|
+
// This can increase your server load as well as your hosting bill.
|
|
388
|
+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
|
389
|
+
// side errors will fail.
|
|
390
|
+
tunnelRoute: "/monitoring",
|
|
391
|
+
|
|
392
|
+
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
393
|
+
disableLogger: true,
|
|
394
|
+
|
|
395
|
+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
|
|
396
|
+
// See the following for more information:
|
|
397
|
+
// https://docs.sentry.io/product/crons/
|
|
398
|
+
// https://vercel.com/docs/cron-jobs
|
|
399
|
+
automaticVercelMonitors: true,
|
|
400
|
+
}"
|
|
401
|
+
`);
|
|
113
402
|
});
|
|
114
403
|
});
|
|
115
404
|
});
|