@sentry/wizard 6.10.0 → 6.12.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 +69 -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 +69 -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 +6 -8
- 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-instrumentation-api.test.d.ts +1 -0
- package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js +96 -0
- package/dist/e2e-tests/tests/react-router-instrumentation-api.test.js.map +1 -0
- package/dist/e2e-tests/tests/react-router.test.js +165 -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 +5 -7
- 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/apple/code-tools.js +17 -3
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/configure-package-manager.js +18 -5
- package/dist/src/apple/configure-package-manager.js.map +1 -1
- package/dist/src/cloudflare/cloudflare-wizard.d.ts +3 -0
- package/dist/src/cloudflare/cloudflare-wizard.js +104 -0
- package/dist/src/cloudflare/cloudflare-wizard.js.map +1 -0
- package/dist/src/cloudflare/sdk-setup.d.ts +8 -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 +5 -0
- package/dist/src/cloudflare/templates.js +50 -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 +33 -0
- package/dist/src/cloudflare/wrap-worker.js +116 -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/expo.d.ts +6 -0
- package/dist/src/react-native/expo.js +27 -1
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.d.ts +5 -0
- package/dist/src/react-native/git.js +32 -1
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/javascript.js +3 -1
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +14 -10
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-router/codemods/client.entry.d.ts +1 -1
- package/dist/src/react-router/codemods/client.entry.js +69 -12
- package/dist/src/react-router/codemods/client.entry.js.map +1 -1
- package/dist/src/react-router/codemods/react-router-config.js +1 -1
- package/dist/src/react-router/codemods/react-router-config.js.map +1 -1
- package/dist/src/react-router/codemods/root.js +1 -2
- package/dist/src/react-router/codemods/root.js.map +1 -1
- package/dist/src/react-router/codemods/server-entry.d.ts +1 -1
- package/dist/src/react-router/codemods/server-entry.js +39 -4
- package/dist/src/react-router/codemods/server-entry.js.map +1 -1
- package/dist/src/react-router/codemods/vite.js +46 -1
- package/dist/src/react-router/codemods/vite.js.map +1 -1
- package/dist/src/react-router/react-router-wizard.js +55 -10
- package/dist/src/react-router/react-router-wizard.js.map +1 -1
- package/dist/src/react-router/sdk-setup.d.ts +5 -3
- package/dist/src/react-router/sdk-setup.js +35 -9
- package/dist/src/react-router/sdk-setup.js.map +1 -1
- package/dist/src/react-router/templates.d.ts +2 -2
- package/dist/src/react-router/templates.js +72 -2
- package/dist/src/react-router/templates.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/sourcemaps/tools/vite.js +1 -1
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup/vite.js +1 -1
- package/dist/src/sveltekit/sdk-setup/vite.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 +11 -1
- package/dist/src/utils/ast-utils.js +19 -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/apple/code-tools.test.js +78 -0
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/configure-package-manager.test.d.ts +1 -0
- package/dist/test/apple/configure-package-manager.test.js +161 -0
- package/dist/test/apple/configure-package-manager.test.js.map +1 -0
- 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 +170 -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 +122 -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 +206 -0
- package/dist/test/cloudflare/wrap-worker.test.js.map +1 -0
- package/dist/test/react-native/expo.test.js +140 -0
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/git.test.d.ts +1 -0
- package/dist/test/react-native/git.test.js +160 -0
- package/dist/test/react-native/git.test.js.map +1 -0
- package/dist/test/react-router/codemods/client-entry.test.js +29 -0
- package/dist/test/react-router/codemods/client-entry.test.js.map +1 -1
- package/dist/test/react-router/codemods/root.test.js +4 -0
- package/dist/test/react-router/codemods/root.test.js.map +1 -1
- package/dist/test/react-router/codemods/server-entry.test.js +70 -0
- package/dist/test/react-router/codemods/server-entry.test.js.map +1 -1
- package/dist/test/react-router/codemods/vite.test.js +89 -0
- package/dist/test/react-router/codemods/vite.test.js.map +1 -1
- package/dist/test/react-router/sdk-setup.test.js +64 -8
- package/dist/test/react-router/sdk-setup.test.js.map +1 -1
- package/dist/test/react-router/templates.test.js +50 -0
- package/dist/test/react-router/templates.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +12 -8
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +22 -0
- package/dist/test/utils/ast-utils.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 +6 -5
|
@@ -1,86 +1,56 @@
|
|
|
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
5
|
const vitest_1 = require("vitest");
|
|
6
|
+
//@ts-expect-error - clifty is ESM only
|
|
7
|
+
const clifty_1 = require("clifty");
|
|
30
8
|
(0, vitest_1.describe)('ReactNative', () => {
|
|
31
9
|
const integration = Constants_1.Integration.reactNative;
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
let wizardExitCode;
|
|
11
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('react-native-test-app');
|
|
34
12
|
(0, vitest_1.beforeAll)(async () => {
|
|
35
|
-
const
|
|
36
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}));
|
|
71
|
-
const testEventPrompted = mcpPrompted &&
|
|
72
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
73
|
-
// Decline MCP config by selecting No
|
|
74
|
-
[utils_1.KEYS.DOWN, utils_1.KEYS.ENTER], 'Have you successfully sent a test event?'));
|
|
75
|
-
testEventPrompted &&
|
|
76
|
-
(await wizardInstance.sendStdinAndWaitForOutput(
|
|
77
|
-
// Respond that test event was sent
|
|
78
|
-
[utils_1.KEYS.ENTER], 'Everything is set up!'));
|
|
79
|
-
wizardInstance.kill();
|
|
13
|
+
const wizardInteraction = (0, clifty_1.withEnv)({
|
|
14
|
+
cwd: projectDir,
|
|
15
|
+
debug: true,
|
|
16
|
+
})
|
|
17
|
+
.defineInteraction()
|
|
18
|
+
.whenAsked('Please select your package manager.')
|
|
19
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
20
|
+
.expectOutput('Installing @sentry/react-native')
|
|
21
|
+
.expectOutput('Installed @sentry/react-native', {
|
|
22
|
+
timeout: 240000,
|
|
23
|
+
})
|
|
24
|
+
.whenAsked('Do you want to enable Session Replay')
|
|
25
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
26
|
+
.whenAsked('Do you want to enable the Feedback Widget to collect feedback from your users?')
|
|
27
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
28
|
+
.whenAsked('Do you want to enable Logs')
|
|
29
|
+
.respondWith(clifty_1.KEYS.ENTER);
|
|
30
|
+
// Only prompt to run `pod install` if running on macOS.
|
|
31
|
+
if (process.platform === 'darwin') {
|
|
32
|
+
wizardInteraction
|
|
33
|
+
.whenAsked('Do you want to run `pod install` now?')
|
|
34
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
35
|
+
.expectOutput('Pods installed.', { timeout: 240000 });
|
|
36
|
+
}
|
|
37
|
+
wizardExitCode = await wizardInteraction
|
|
38
|
+
.expectOutput('Added Sentry.init to App.tsx')
|
|
39
|
+
.whenAsked('Looks like you have Prettier in your project. Do you want to run it on your files?')
|
|
40
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
41
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
42
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
43
|
+
.expectOutput('To make sure everything is set up correctly, put the following code snippet into your application.')
|
|
44
|
+
.whenAsked('Have you successfully sent a test event?')
|
|
45
|
+
.respondWith(clifty_1.KEYS.ENTER)
|
|
46
|
+
.expectOutput('Everything is set up!')
|
|
47
|
+
.run((0, utils_1.getWizardCommand)(integration));
|
|
80
48
|
});
|
|
81
49
|
(0, vitest_1.afterAll)(() => {
|
|
82
|
-
(
|
|
83
|
-
|
|
50
|
+
cleanup();
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
53
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
84
54
|
});
|
|
85
55
|
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
86
56
|
(0, utils_1.checkFileContents)(`${projectDir}/package.json`, `@sentry/react-native`);
|
|
@@ -115,9 +85,6 @@ Sentry.init({
|
|
|
115
85
|
(0, utils_1.checkFileContents)(`${projectDir}/App.tsx`, `export default Sentry.wrap(App);`);
|
|
116
86
|
});
|
|
117
87
|
(0, vitest_1.test)('ios/sentry.properties is added', () => {
|
|
118
|
-
if (!podInstallPrompted) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
88
|
(0, utils_1.checkFileContents)(`${projectDir}/ios/sentry.properties`, `auth.token=${utils_1.TEST_ARGS.AUTH_TOKEN}
|
|
122
89
|
|
|
123
90
|
defaults.org=${utils_1.TEST_ARGS.ORG_SLUG}
|
|
@@ -136,10 +103,7 @@ defaults.url=https://sentry.io/`);
|
|
|
136
103
|
(0, vitest_1.test)('build.gradle is updated correctly', () => {
|
|
137
104
|
(0, utils_1.checkFileContents)(`${projectDir}/android/app/build.gradle`, `apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle")`);
|
|
138
105
|
});
|
|
139
|
-
|
|
140
|
-
if (!podInstallPrompted) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
106
|
+
vitest_1.test.skipIf(process.platform !== 'darwin')('xcode project is updated correctly', () => {
|
|
143
107
|
(0, utils_1.checkFileContents)(`${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`, `@sentry/react-native/scripts/sentry-xcode.sh`);
|
|
144
108
|
(0, utils_1.checkFileContents)(`${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`, `../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh`);
|
|
145
109
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-native.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/react-native.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,mDAAkD;AAClD,oCAQkB;AAClB,mCAAqE;AAErE,IAAA,iBAAQ,EAAC,aAAa,EAAE,GAAG,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A,iCAAyB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACvE,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAyB,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACnE,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import * as path from 'node:path';\nimport { Integration } from '../../lib/Constants';\nimport {\n KEYS,\n TEST_ARGS,\n cleanupGit,\n checkFileContents,\n checkIfReactNativeBundles,\n revertLocalChanges,\n startWizardInstance,\n} from '../utils';\nimport { afterAll, beforeAll, describe, test, expect } from 'vitest';\n\ndescribe('ReactNative', () => {\n const integration = Integration.reactNative;\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/react-native-test-app',\n );\n\n let podInstallPrompted = false;\n\n beforeAll(async () => {\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n const sessionReplayPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, KEYS.DOWN, KEYS.ENTER],\n 'Do you want to enable Session Replay to help debug issues? (See https://docs.sentry.io/platforms/react-native/session-replay/)',\n ),\n {\n timeout: 240_000,\n });\n\n const feedbackWidgetPrompted =\n sessionReplayPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Enable session replay\n [KEYS.ENTER],\n 'Do you want to enable the Feedback Widget to collect feedback from your users? (See https://docs.sentry.io/platforms/react-native/user-feedback/)',\n ));\n\n const logsPrompted =\n feedbackWidgetPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Enable feedback widget\n [KEYS.ENTER],\n 'Do you want to enable Logs? (See https://docs.sentry.io/platforms/react-native/logs/)',\n ));\n\n podInstallPrompted =\n logsPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Enable logs\n [KEYS.ENTER],\n 'Do you want to run `pod install` now?',\n {\n optional: true,\n timeout: 5000,\n },\n ));\n\n const prettierPrompted =\n podInstallPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Skip pod install\n [KEYS.DOWN, KEYS.ENTER],\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n ));\n\n // Handle the MCP prompt (default is now Yes, so press DOWN to select No)\n const mcpPrompted =\n prettierPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Skip prettier\n [KEYS.DOWN, KEYS.ENTER],\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n {\n optional: true,\n },\n ));\n\n const testEventPrompted =\n mcpPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Decline MCP config by selecting No\n [KEYS.DOWN, KEYS.ENTER],\n 'Have you successfully sent a test event?',\n ));\n\n testEventPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Respond that test event was sent\n [KEYS.ENTER],\n 'Everything is set up!',\n ));\n wizardInstance.kill();\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n test('package.json is updated correctly', () => {\n checkFileContents(`${projectDir}/package.json`, `@sentry/react-native`);\n });\n\n test('metro.config.js is updated correctly', () => {\n checkFileContents(\n `${projectDir}/metro.config.js`,\n `const {\n withSentryConfig\n} = require(\"@sentry/react-native/metro\");`,\n );\n checkFileContents(\n `${projectDir}/metro.config.js`,\n `module.exports = withSentryConfig(mergeConfig(getDefaultConfig(__dirname), config));`,\n );\n });\n\n test('App.tsx is updated correctly', () => {\n checkFileContents(\n `${projectDir}/App.tsx`,\n `import * as Sentry from '@sentry/react-native';\n\nSentry.init({\n dsn: 'https://public@dsn.ingest.sentry.io/1337',\n\n // Adds more context data to events (IP address, cookies, user, etc.)\n // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/\n sendDefaultPii: true,\n\n // Enable Logs\n enableLogs: true,\n\n // Configure Session Replay\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1,\n integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: __DEV__,\n});`,\n );\n checkFileContents(\n `${projectDir}/App.tsx`,\n `export default Sentry.wrap(App);`,\n );\n });\n\n test('ios/sentry.properties is added', () => {\n if (!podInstallPrompted) {\n return;\n }\n checkFileContents(\n `${projectDir}/ios/sentry.properties`,\n `auth.token=${TEST_ARGS.AUTH_TOKEN}\n\ndefaults.org=${TEST_ARGS.ORG_SLUG}\ndefaults.project=${TEST_ARGS.PROJECT_SLUG}\n\ndefaults.url=https://sentry.io/`,\n );\n });\n\n test('android/sentry.properties is added', () => {\n checkFileContents(\n `${projectDir}/android/sentry.properties`,\n `auth.token=${TEST_ARGS.AUTH_TOKEN}\n\ndefaults.org=${TEST_ARGS.ORG_SLUG}\ndefaults.project=${TEST_ARGS.PROJECT_SLUG}\n\ndefaults.url=https://sentry.io/`,\n );\n });\n\n test('build.gradle is updated correctly', () => {\n checkFileContents(\n `${projectDir}/android/app/build.gradle`,\n `apply from: new File([\"node\", \"--print\", \"require.resolve('@sentry/react-native/package.json')\"].execute().text.trim(), \"../sentry.gradle\")`,\n );\n });\n\n test('xcode project is updated correctly', () => {\n if (!podInstallPrompted) {\n return;\n }\n checkFileContents(\n `${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`,\n `@sentry/react-native/scripts/sentry-xcode.sh`,\n );\n checkFileContents(\n `${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`,\n `../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh`,\n );\n });\n\n test('android project is bundled correctly', async () => {\n const bundled = await checkIfReactNativeBundles(projectDir, 'android');\n expect(bundled).toBe(true);\n });\n\n test('ios project is bundled correctly', async () => {\n const bundled = await checkIfReactNativeBundles(projectDir, 'ios');\n expect(bundled).toBe(true);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"react-native.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/react-native.test.ts"],"names":[],"mappings":";;AAAA,mDAAkD;AAClD,oCAMkB;AAClB,mCAAqE;AAErE,uCAAuC;AACvC,mCAAuC;AAEvC,IAAA,iBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,WAAW,GAAG,uBAAW,CAAC,WAAW,CAAC;IAC5C,IAAI,cAAsB,CAAC;IAC3B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAqB,EACnD,uBAAuB,CACxB,CAAC;IAEF,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE;QACnB,MAAM,iBAAiB,GAAG,IAAA,gBAAO,EAAC;YAChC,GAAG,EAAE,UAAU;YACf,KAAK,EAAE,IAAI;SACZ,CAAC;aACC,iBAAiB,EAAE;aAEnB,SAAS,CAAC,qCAAqC,CAAC;aAChD,WAAW,CAAC,aAAI,CAAC,IAAI,EAAE,aAAI,CAAC,KAAK,CAAC;aAClC,YAAY,CAAC,iCAAiC,CAAC;aAC/C,YAAY,CAAC,gCAAgC,EAAE;YAC9C,OAAO,EAAE,MAAO;SACjB,CAAC;aACD,SAAS,CAAC,sCAAsC,CAAC;aACjD,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,SAAS,CACR,gFAAgF,CACjF;aACA,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC;aACvB,SAAS,CAAC,4BAA4B,CAAC;aACvC,WAAW,CAAC,aAAI,CAAC,KAAK,CAAC,CAAC;QAE3B,wDAAwD;QACxD,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;YACjC,iBAAiB;iBACd,SAAS,CAAC,u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AAC;QACvE,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,IAAA,aAAI,EAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAyB,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACnE,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Integration } from '../../lib/Constants';\nimport {\n TEST_ARGS,\n checkFileContents,\n checkIfReactNativeBundles,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\nimport { afterAll, beforeAll, describe, test, expect } from 'vitest';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\ndescribe('ReactNative', () => {\n const integration = Integration.reactNative;\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'react-native-test-app',\n );\n\n beforeAll(async () => {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n debug: true,\n })\n .defineInteraction()\n\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Installing @sentry/react-native')\n .expectOutput('Installed @sentry/react-native', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER)\n .whenAsked(\n 'Do you want to enable the Feedback Widget to collect feedback from your users?',\n )\n .respondWith(KEYS.ENTER)\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER);\n\n // Only prompt to run `pod install` if running on macOS.\n if (process.platform === 'darwin') {\n wizardInteraction\n .whenAsked('Do you want to run `pod install` now?')\n .respondWith(KEYS.ENTER)\n .expectOutput('Pods installed.', { timeout: 240_000 });\n }\n\n wizardExitCode = await wizardInteraction\n .expectOutput('Added Sentry.init to App.tsx')\n .whenAsked(\n 'Looks like you have Prettier in your project. Do you want to run it on your files?',\n )\n .respondWith(KEYS.DOWN, 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(\n 'To make sure everything is set up correctly, put the following code snippet into your application.',\n )\n .whenAsked('Have you successfully sent a test event?')\n .respondWith(KEYS.ENTER)\n .expectOutput('Everything is set up!')\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 checkFileContents(`${projectDir}/package.json`, `@sentry/react-native`);\n });\n\n test('metro.config.js is updated correctly', () => {\n checkFileContents(\n `${projectDir}/metro.config.js`,\n `const {\n withSentryConfig\n} = require(\"@sentry/react-native/metro\");`,\n );\n checkFileContents(\n `${projectDir}/metro.config.js`,\n `module.exports = withSentryConfig(mergeConfig(getDefaultConfig(__dirname), config));`,\n );\n });\n\n test('App.tsx is updated correctly', () => {\n checkFileContents(\n `${projectDir}/App.tsx`,\n `import * as Sentry from '@sentry/react-native';\n\nSentry.init({\n dsn: 'https://public@dsn.ingest.sentry.io/1337',\n\n // Adds more context data to events (IP address, cookies, user, etc.)\n // For more information, visit: https://docs.sentry.io/platforms/react-native/data-management/data-collected/\n sendDefaultPii: true,\n\n // Enable Logs\n enableLogs: true,\n\n // Configure Session Replay\n replaysSessionSampleRate: 0.1,\n replaysOnErrorSampleRate: 1,\n integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: __DEV__,\n});`,\n );\n checkFileContents(\n `${projectDir}/App.tsx`,\n `export default Sentry.wrap(App);`,\n );\n });\n\n test('ios/sentry.properties is added', () => {\n checkFileContents(\n `${projectDir}/ios/sentry.properties`,\n `auth.token=${TEST_ARGS.AUTH_TOKEN}\n\ndefaults.org=${TEST_ARGS.ORG_SLUG}\ndefaults.project=${TEST_ARGS.PROJECT_SLUG}\n\ndefaults.url=https://sentry.io/`,\n );\n });\n\n test('android/sentry.properties is added', () => {\n checkFileContents(\n `${projectDir}/android/sentry.properties`,\n `auth.token=${TEST_ARGS.AUTH_TOKEN}\n\ndefaults.org=${TEST_ARGS.ORG_SLUG}\ndefaults.project=${TEST_ARGS.PROJECT_SLUG}\n\ndefaults.url=https://sentry.io/`,\n );\n });\n\n test('build.gradle is updated correctly', () => {\n checkFileContents(\n `${projectDir}/android/app/build.gradle`,\n `apply from: new File([\"node\", \"--print\", \"require.resolve('@sentry/react-native/package.json')\"].execute().text.trim(), \"../sentry.gradle\")`,\n );\n });\n\n test.skipIf(process.platform !== 'darwin')(\n 'xcode project is updated correctly',\n () => {\n checkFileContents(\n `${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`,\n `@sentry/react-native/scripts/sentry-xcode.sh`,\n );\n checkFileContents(\n `${projectDir}/ios/reactnative078.xcodeproj/project.pbxproj`,\n `../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh`,\n );\n },\n );\n\n test('android project is bundled correctly', async () => {\n const bundled = await checkIfReactNativeBundles(projectDir, 'android');\n expect(bundled).toBe(true);\n });\n\n test('ios project is bundled correctly', async () => {\n const bundled = await checkIfReactNativeBundles(projectDir, 'ios');\n expect(bundled).toBe(true);\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const Constants_1 = require("../../lib/Constants");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
//@ts-expect-error - clifty is ESM only
|
|
7
|
+
const clifty_1 = require("clifty");
|
|
8
|
+
// Expects React Router >= 7.9.5
|
|
9
|
+
async function runWizardWithInstrumentationAPI(projectDir) {
|
|
10
|
+
const wizardInteraction = (0, clifty_1.withEnv)({
|
|
11
|
+
cwd: projectDir,
|
|
12
|
+
}).defineInteraction();
|
|
13
|
+
wizardInteraction
|
|
14
|
+
.whenAsked('Please select your package manager.')
|
|
15
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER)
|
|
16
|
+
.expectOutput('Installing @sentry/react-router')
|
|
17
|
+
.expectOutput('Installed @sentry/react-router', {
|
|
18
|
+
timeout: 240000,
|
|
19
|
+
})
|
|
20
|
+
.whenAsked('Do you want to enable Tracing')
|
|
21
|
+
.respondWith(clifty_1.KEYS.ENTER) // Yes
|
|
22
|
+
.whenAsked('Do you want to enable Session Replay')
|
|
23
|
+
.respondWith(clifty_1.KEYS.ENTER) // Yes
|
|
24
|
+
.whenAsked('Do you want to enable Logs')
|
|
25
|
+
.respondWith(clifty_1.KEYS.ENTER) // Yes
|
|
26
|
+
.whenAsked('Do you want to enable Profiling')
|
|
27
|
+
.respondWith(clifty_1.KEYS.ENTER) // Yes
|
|
28
|
+
.whenAsked('Do you want to use the Instrumentation API')
|
|
29
|
+
.respondWith(clifty_1.KEYS.ENTER) // Yes
|
|
30
|
+
.expectOutput('Installing @sentry/profiling-node')
|
|
31
|
+
.expectOutput('Installed @sentry/profiling-node', {
|
|
32
|
+
timeout: 240000,
|
|
33
|
+
})
|
|
34
|
+
.whenAsked('Do you want to create an example page')
|
|
35
|
+
.respondWith(clifty_1.KEYS.ENTER); // Yes
|
|
36
|
+
return wizardInteraction
|
|
37
|
+
.whenAsked('Optionally add a project-scoped MCP server configuration for the Sentry MCP?')
|
|
38
|
+
.respondWith(clifty_1.KEYS.DOWN, clifty_1.KEYS.ENTER) // No
|
|
39
|
+
.expectOutput('Successfully installed the Sentry React Router SDK!')
|
|
40
|
+
.run((0, utils_1.getWizardCommand)(Constants_1.Integration.reactRouter));
|
|
41
|
+
}
|
|
42
|
+
(0, vitest_1.describe)('React Router Instrumentation API', () => {
|
|
43
|
+
(0, vitest_1.describe)('with Instrumentation API enabled', () => {
|
|
44
|
+
let wizardExitCode;
|
|
45
|
+
const { projectDir, cleanup } = (0, utils_1.createIsolatedTestEnv)('react-router-test-app');
|
|
46
|
+
(0, vitest_1.beforeAll)(async () => {
|
|
47
|
+
wizardExitCode = await runWizardWithInstrumentationAPI(projectDir);
|
|
48
|
+
});
|
|
49
|
+
(0, vitest_1.afterAll)(() => {
|
|
50
|
+
cleanup();
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.test)('exits with exit code 0', () => {
|
|
53
|
+
(0, vitest_1.expect)(wizardExitCode).toBe(0);
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.test)('package.json is updated correctly', () => {
|
|
56
|
+
(0, utils_1.checkPackageJson)(projectDir, '@sentry/react-router');
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.test)('.env.sentry-build-plugin is created and contains the auth token', () => {
|
|
59
|
+
(0, utils_1.checkEnvBuildPlugin)(projectDir);
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.test)('entry.client file contains Instrumentation API setup', () => {
|
|
62
|
+
(0, utils_1.checkFileContents)(`${projectDir}/app/entry.client.tsx`, [
|
|
63
|
+
'import * as Sentry from',
|
|
64
|
+
'@sentry/react-router',
|
|
65
|
+
'const tracing = Sentry.reactRouterTracingIntegration({ useInstrumentationAPI: true });',
|
|
66
|
+
'integrations: [tracing',
|
|
67
|
+
'unstable_instrumentations={[tracing.clientInstrumentation]}',
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.test)('entry.server file contains Sentry server hooks', () => {
|
|
71
|
+
(0, utils_1.checkFileContents)(`${projectDir}/app/entry.server.tsx`, [
|
|
72
|
+
'import * as Sentry from',
|
|
73
|
+
'@sentry/react-router',
|
|
74
|
+
'Sentry.wrapSentryHandleRequest(',
|
|
75
|
+
'export const handleError = Sentry.createSentryHandleError(',
|
|
76
|
+
'export const unstable_instrumentations = [Sentry.createSentryServerInstrumentation()]',
|
|
77
|
+
]);
|
|
78
|
+
});
|
|
79
|
+
(0, vitest_1.test)('instrument.server file exists', () => {
|
|
80
|
+
(0, utils_1.checkFileExists)(`${projectDir}/instrument.server.mjs`);
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.test)('example page exists', () => {
|
|
83
|
+
(0, utils_1.checkFileExists)(`${projectDir}/app/routes/sentry-example-page.tsx`);
|
|
84
|
+
});
|
|
85
|
+
(0, vitest_1.test)('builds successfully', async () => {
|
|
86
|
+
await (0, utils_1.checkIfBuilds)(projectDir);
|
|
87
|
+
}, 60000);
|
|
88
|
+
(0, vitest_1.test)('runs on dev mode correctly', async () => {
|
|
89
|
+
await (0, utils_1.checkIfRunsOnDevMode)(projectDir, 'to expose');
|
|
90
|
+
}, 30000);
|
|
91
|
+
(0, vitest_1.test)('runs on prod mode correctly', async () => {
|
|
92
|
+
await (0, utils_1.checkIfRunsOnProdMode)(projectDir, 'react-router-serve');
|
|
93
|
+
}, 30000);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=react-router-instrumentation-api.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-router-instrumentation-api.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/react-router-instrumentation-api.test.ts"],"names":[],"mappings":";;AAAA,mCAAqE;AACrE,mDAAkD;AAClD,oCAUkB;AAElB,uCAAuC;AACvC,mCAAuC;AAEvC,gCAAgC;AAChC,KAAK,UAAU,+BAA+B,CAC5C,UAAkB;IAElB,MAAM,iBAAiB,GAAG,IAAA,gBAAO,EAAC;QAChC,GAAG,EAAE,UAAU;KAChB,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAEvB,iBAAiB;SACd,SAAS,CAAC,qCAAqC,CAAC;SAChD,WAAW,CAAC,aAAI,CAAC,IAAI,EAAE,aAAI,CAAC,KAAK,CAAC;SAClC,YAAY,CAAC,iCAAiC,CAAC;SAC/C,YAAY,CAAC,gC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AC,CAAC,CAAC;QAEH,IAAA,aAAI,EAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;YACrC,MAAM,IAAA,qBAAa,EAAC,UAAU,CAAC,CAAC;QAClC,CAAC,EAAE,KAAM,CAAC,CAAC;QAEX,IAAA,aAAI,EAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;YAC5C,MAAM,IAAA,4BAAoB,EAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACtD,CAAC,EAAE,KAAM,CAAC,CAAC;QAEX,IAAA,aAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;YAC7C,MAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;QAChE,CAAC,EAAE,KAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { afterAll, beforeAll, describe, test, expect } from 'vitest';\nimport { Integration } from '../../lib/Constants';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnDevMode,\n checkIfRunsOnProdMode,\n checkPackageJson,\n createIsolatedTestEnv,\n getWizardCommand,\n} from '../utils';\n\n//@ts-expect-error - clifty is ESM only\nimport { KEYS, withEnv } from 'clifty';\n\n// Expects React Router >= 7.9.5\nasync function runWizardWithInstrumentationAPI(\n projectDir: string,\n): Promise<number> {\n const wizardInteraction = withEnv({\n cwd: projectDir,\n }).defineInteraction();\n\n wizardInteraction\n .whenAsked('Please select your package manager.')\n .respondWith(KEYS.DOWN, KEYS.ENTER)\n .expectOutput('Installing @sentry/react-router')\n .expectOutput('Installed @sentry/react-router', {\n timeout: 240_000,\n })\n\n .whenAsked('Do you want to enable Tracing')\n .respondWith(KEYS.ENTER) // Yes\n .whenAsked('Do you want to enable Session Replay')\n .respondWith(KEYS.ENTER) // Yes\n .whenAsked('Do you want to enable Logs')\n .respondWith(KEYS.ENTER) // Yes\n .whenAsked('Do you want to enable Profiling')\n .respondWith(KEYS.ENTER) // Yes\n .whenAsked('Do you want to use the Instrumentation API')\n .respondWith(KEYS.ENTER) // Yes\n .expectOutput('Installing @sentry/profiling-node')\n .expectOutput('Installed @sentry/profiling-node', {\n timeout: 240_000,\n })\n .whenAsked('Do you want to create an example page')\n .respondWith(KEYS.ENTER); // Yes\n\n return wizardInteraction\n .whenAsked(\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n )\n .respondWith(KEYS.DOWN, KEYS.ENTER) // No\n .expectOutput('Successfully installed the Sentry React Router SDK!')\n .run(getWizardCommand(Integration.reactRouter));\n}\n\ndescribe('React Router Instrumentation API', () => {\n describe('with Instrumentation API enabled', () => {\n let wizardExitCode: number;\n const { projectDir, cleanup } = createIsolatedTestEnv(\n 'react-router-test-app',\n );\n\n beforeAll(async () => {\n wizardExitCode = await runWizardWithInstrumentationAPI(projectDir);\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/react-router');\n });\n\n test('.env.sentry-build-plugin is created and contains the auth token', () => {\n checkEnvBuildPlugin(projectDir);\n });\n\n test('entry.client file contains Instrumentation API setup', () => {\n checkFileContents(`${projectDir}/app/entry.client.tsx`, [\n 'import * as Sentry from',\n '@sentry/react-router',\n 'const tracing = Sentry.reactRouterTracingIntegration({ useInstrumentationAPI: true });',\n 'integrations: [tracing',\n 'unstable_instrumentations={[tracing.clientInstrumentation]}',\n ]);\n });\n\n test('entry.server file contains Sentry server hooks', () => {\n checkFileContents(`${projectDir}/app/entry.server.tsx`, [\n 'import * as Sentry from',\n '@sentry/react-router',\n 'Sentry.wrapSentryHandleRequest(',\n 'export const handleError = Sentry.createSentryHandleError(',\n 'export const unstable_instrumentations = [Sentry.createSentryServerInstrumentation()]',\n ]);\n });\n\n test('instrument.server file exists', () => {\n checkFileExists(`${projectDir}/instrument.server.mjs`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/routes/sentry-example-page.tsx`);\n });\n\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir);\n }, 60_000);\n\n test('runs on dev mode correctly', async () => {\n await checkIfRunsOnDevMode(projectDir, 'to expose');\n }, 30_000);\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'react-router-serve');\n }, 30_000);\n });\n});\n"]}
|