@sentry/wizard 3.34.4 → 3.35.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 +13 -1
- package/dist/e2e-tests/tests/nuxt-3.test.d.ts +1 -0
- package/dist/e2e-tests/tests/nuxt-3.test.js +231 -0
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -0
- package/dist/e2e-tests/tests/nuxt-4.test.d.ts +1 -0
- package/dist/e2e-tests/tests/nuxt-4.test.js +232 -0
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -0
- package/dist/e2e-tests/tests/remix.test.js +92 -27
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +102 -42
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +18 -1
- package/dist/e2e-tests/utils/index.js +31 -2
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.d.ts +1 -0
- package/dist/lib/Constants.js +1 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/apple/templates.js +2 -2
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +1 -0
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.d.ts +3 -0
- package/dist/src/nuxt/nuxt-wizard.js +220 -0
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -0
- package/dist/src/nuxt/sdk-example.d.ts +8 -0
- package/dist/src/nuxt/sdk-example.js +179 -0
- package/dist/src/nuxt/sdk-example.js.map +1 -0
- package/dist/src/nuxt/sdk-setup.d.ts +8 -0
- package/dist/src/nuxt/sdk-setup.js +275 -0
- package/dist/src/nuxt/sdk-setup.js.map +1 -0
- package/dist/src/nuxt/templates.d.ts +22 -0
- package/dist/src/nuxt/templates.js +84 -0
- package/dist/src/nuxt/templates.js.map +1 -0
- package/dist/src/nuxt/utils.d.ts +1 -0
- package/dist/src/nuxt/utils.js +71 -0
- package/dist/src/nuxt/utils.js.map +1 -0
- package/dist/src/remix/remix-wizard.js +2 -1
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/run.d.ts +1 -1
- package/dist/src/run.js +30 -23
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +1 -1
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +2 -1
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +6 -2
- package/dist/src/utils/clack-utils.js +30 -10
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/test/nuxt/templates.test.d.ts +1 -0
- package/dist/test/nuxt/templates.test.js +70 -0
- package/dist/test/nuxt/templates.test.js.map +1 -0
- package/e2e-tests/README.md +59 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/README.md +75 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/nuxt.config.ts +5 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/package.json +18 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/public/favicon.ico +0 -0
- package/e2e-tests/test-applications/nuxt-3-test-app/public/robots.txt +1 -0
- package/e2e-tests/tests/nuxt-3.test.ts +169 -0
- package/e2e-tests/tests/nuxt-4.test.ts +168 -0
- package/e2e-tests/tests/remix.test.ts +163 -50
- package/e2e-tests/tests/sveltekit.test.ts +180 -79
- package/e2e-tests/utils/index.ts +31 -1
- package/lib/Constants.ts +1 -0
- package/package.json +1 -1
- package/src/apple/templates.ts +14 -2
- package/src/nextjs/nextjs-wizard.ts +1 -0
- package/src/nuxt/nuxt-wizard.ts +166 -0
- package/src/nuxt/sdk-example.ts +135 -0
- package/src/nuxt/sdk-setup.ts +209 -0
- package/src/nuxt/templates.ts +296 -0
- package/src/nuxt/utils.ts +32 -0
- package/src/remix/remix-wizard.ts +2 -1
- package/src/run.ts +7 -0
- package/src/sourcemaps/tools/rollup.ts +1 -1
- package/src/sveltekit/sveltekit-wizard.ts +2 -1
- package/src/utils/clack-utils.ts +32 -8
- package/test/nuxt/templates.test.ts +228 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.35.0
|
|
4
|
+
|
|
5
|
+
- feat: Pin JS SDK versions to v8 (#712)
|
|
6
|
+
- Remove enableTracing for Cocoa ([#715](https://github.com/getsentry/sentry-wizard/pull/715))
|
|
7
|
+
- feat(nuxt): Add nuxt wizard ([#719](https://github.com/getsentry/sentry-wizard/pull/719))
|
|
8
|
+
|
|
9
|
+
Set up the Sentry Nuxt SDK in your app with one command:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npx @sentry/wizard@latest -i nuxt
|
|
13
|
+
```
|
|
14
|
+
|
|
3
15
|
## 3.34.4
|
|
4
16
|
|
|
5
17
|
- chore(deps): Update various dependencies (#701, #700, #224)
|
|
@@ -16,7 +28,7 @@
|
|
|
16
28
|
## 3.34.1
|
|
17
29
|
|
|
18
30
|
- fix(sveltekit): Ensure Sentry example page renders correct Html ([#688](https://github.com/getsentry/sentry-wizard/pull/688))
|
|
19
|
-
- ref: Handle edge cases in formatting step more gracefully
|
|
31
|
+
- ref: Handle edge cases in formatting step more gracefully ([#687](https://github.com/getsentry/sentry-wizard/pull/686))
|
|
20
32
|
|
|
21
33
|
## 3.34.0
|
|
22
34
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,231 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
var path = __importStar(require("path"));
|
|
63
|
+
var utils_1 = require("../utils");
|
|
64
|
+
var Constants_1 = require("../../lib/Constants");
|
|
65
|
+
describe('Nuxt-3', function () {
|
|
66
|
+
var projectDir = path.resolve(__dirname, '../test-applications/nuxt-3-test-app');
|
|
67
|
+
beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0: return [4 /*yield*/, runWizardOnNuxtProject(projectDir)];
|
|
71
|
+
case 1:
|
|
72
|
+
_a.sent();
|
|
73
|
+
return [2 /*return*/];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); });
|
|
77
|
+
afterAll(function () {
|
|
78
|
+
(0, utils_1.revertLocalChanges)(projectDir);
|
|
79
|
+
(0, utils_1.cleanupGit)(projectDir);
|
|
80
|
+
});
|
|
81
|
+
testNuxtProjectSetup(projectDir);
|
|
82
|
+
testNuxtProjectConfigs(projectDir);
|
|
83
|
+
testNuxtProjectBuildsAndRuns(projectDir);
|
|
84
|
+
});
|
|
85
|
+
function runWizardOnNuxtProject(projectDir) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
+
var integration, wizardInstance, packageManagerPrompted, tracingOptionPrompted, _a, replayOptionPrompted, _b, _c;
|
|
88
|
+
return __generator(this, function (_d) {
|
|
89
|
+
switch (_d.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
integration = Constants_1.Integration.nuxt;
|
|
92
|
+
wizardInstance = (0, utils_1.startWizardInstance)(integration, projectDir);
|
|
93
|
+
return [4 /*yield*/, wizardInstance.waitForOutput('Please select your package manager.')];
|
|
94
|
+
case 1:
|
|
95
|
+
packageManagerPrompted = _d.sent();
|
|
96
|
+
_a = packageManagerPrompted;
|
|
97
|
+
if (!_a) return [3 /*break*/, 3];
|
|
98
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput(
|
|
99
|
+
// Selecting `yarn` as the package manager
|
|
100
|
+
[utils_1.KEYS.DOWN, utils_1.KEYS.ENTER],
|
|
101
|
+
// "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
|
|
102
|
+
'to track the performance of your application?', {
|
|
103
|
+
timeout: 240000,
|
|
104
|
+
})];
|
|
105
|
+
case 2:
|
|
106
|
+
_a = (_d.sent());
|
|
107
|
+
_d.label = 3;
|
|
108
|
+
case 3:
|
|
109
|
+
tracingOptionPrompted = _a;
|
|
110
|
+
_b = tracingOptionPrompted;
|
|
111
|
+
if (!_b) return [3 /*break*/, 5];
|
|
112
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER],
|
|
113
|
+
// "Do you want to enable Sentry Session Replay", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.
|
|
114
|
+
'to get a video-like reproduction of errors during a user session?')];
|
|
115
|
+
case 4:
|
|
116
|
+
_b = (_d.sent());
|
|
117
|
+
_d.label = 5;
|
|
118
|
+
case 5:
|
|
119
|
+
replayOptionPrompted = _b;
|
|
120
|
+
_c = replayOptionPrompted;
|
|
121
|
+
if (!_c) return [3 /*break*/, 7];
|
|
122
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER], 'Do you want to create an example page', {
|
|
123
|
+
optional: true,
|
|
124
|
+
})];
|
|
125
|
+
case 6:
|
|
126
|
+
_c = (_d.sent());
|
|
127
|
+
_d.label = 7;
|
|
128
|
+
case 7:
|
|
129
|
+
_c;
|
|
130
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_1.KEYS.ENTER, utils_1.KEYS.ENTER], 'Successfully installed the Sentry Nuxt SDK!')];
|
|
131
|
+
case 8:
|
|
132
|
+
_d.sent();
|
|
133
|
+
wizardInstance.kill();
|
|
134
|
+
return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function testNuxtProjectSetup(projectDir) {
|
|
140
|
+
var integration = Constants_1.Integration.nuxt;
|
|
141
|
+
test('package.json is updated correctly', function () {
|
|
142
|
+
(0, utils_1.checkPackageJson)(projectDir, integration);
|
|
143
|
+
});
|
|
144
|
+
test('.env-sentry-build-plugin is created and contains the auth token', function () {
|
|
145
|
+
(0, utils_1.checkEnvBuildPlugin)(projectDir);
|
|
146
|
+
});
|
|
147
|
+
test('config files created', function () {
|
|
148
|
+
(0, utils_1.checkFileExists)("".concat(projectDir, "/sentry.server.config.ts"));
|
|
149
|
+
(0, utils_1.checkFileExists)("".concat(projectDir, "/sentry.client.config.ts"));
|
|
150
|
+
});
|
|
151
|
+
test('example page exists', function () {
|
|
152
|
+
(0, utils_1.checkFileExists)("".concat(projectDir, "/pages/sentry-example-page.vue"));
|
|
153
|
+
(0, utils_1.checkFileExists)("".concat(projectDir, "/server/api/sentry-example-api.ts"));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function testNuxtProjectConfigs(projectDir) {
|
|
157
|
+
test('nuxt config contains sentry module', function () {
|
|
158
|
+
(0, utils_1.checkFileContents)(path.resolve(projectDir, 'nuxt.config.ts'), [
|
|
159
|
+
"modules: ['@sentry/nuxt/module'],",
|
|
160
|
+
'sentry: {',
|
|
161
|
+
' sourceMapsUploadOptions: {',
|
|
162
|
+
" org: '".concat(utils_1.TEST_ARGS.ORG_SLUG, "',"),
|
|
163
|
+
" project: '".concat(utils_1.TEST_ARGS.PROJECT_SLUG, "'"),
|
|
164
|
+
' }',
|
|
165
|
+
'},',
|
|
166
|
+
'sourcemap: {',
|
|
167
|
+
" client: 'hidden'",
|
|
168
|
+
'}',
|
|
169
|
+
]);
|
|
170
|
+
});
|
|
171
|
+
test('sentry.client.config.ts contents', function () {
|
|
172
|
+
(0, utils_1.checkFileContents)(path.resolve(projectDir, 'sentry.client.config.ts'), [
|
|
173
|
+
'import * as Sentry from "@sentry/nuxt";',
|
|
174
|
+
'Sentry.init({',
|
|
175
|
+
' // If set up, you can use your runtime config here',
|
|
176
|
+
' // dsn: useRuntimeConfig().public.sentry.dsn,',
|
|
177
|
+
" dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\","),
|
|
178
|
+
' // We recommend adjusting this value in production, or using tracesSampler',
|
|
179
|
+
' // for finer control',
|
|
180
|
+
' tracesSampleRate: 1.0,',
|
|
181
|
+
' // This sets the sample rate to be 10%. You may want this to be 100% while',
|
|
182
|
+
' // in development and sample at a lower rate in production',
|
|
183
|
+
' replaysSessionSampleRate: 0.1,',
|
|
184
|
+
' // If the entire session is not sampled, use the below sample rate to sample',
|
|
185
|
+
' // sessions when an error occurs.',
|
|
186
|
+
' replaysOnErrorSampleRate: 1.0,',
|
|
187
|
+
" // If you don't want to use Session Replay, just remove the line below:",
|
|
188
|
+
' integrations: [Sentry.replayIntegration()],',
|
|
189
|
+
" // Setting this option to true will print useful information to the console while you're setting up Sentry.",
|
|
190
|
+
' debug: false,',
|
|
191
|
+
'});',
|
|
192
|
+
]);
|
|
193
|
+
});
|
|
194
|
+
test('sentry.server.config.ts contents', function () {
|
|
195
|
+
(0, utils_1.checkFileContents)(path.resolve(projectDir, 'sentry.server.config.ts'), [
|
|
196
|
+
'import * as Sentry from "@sentry/nuxt";',
|
|
197
|
+
'Sentry.init({',
|
|
198
|
+
" dsn: \"".concat(utils_1.TEST_ARGS.PROJECT_DSN, "\","),
|
|
199
|
+
' // We recommend adjusting this value in production, or using tracesSampler',
|
|
200
|
+
' // for finer control',
|
|
201
|
+
' tracesSampleRate: 1.0,',
|
|
202
|
+
" // Setting this option to true will print useful information to the console while you're setting up Sentry.",
|
|
203
|
+
' debug: false,',
|
|
204
|
+
'});',
|
|
205
|
+
]);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function testNuxtProjectBuildsAndRuns(projectDir) {
|
|
209
|
+
var _this = this;
|
|
210
|
+
test('builds successfully', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
211
|
+
return __generator(this, function (_a) {
|
|
212
|
+
switch (_a.label) {
|
|
213
|
+
case 0: return [4 /*yield*/, (0, utils_1.checkIfBuilds)(projectDir, 'preview this build')];
|
|
214
|
+
case 1:
|
|
215
|
+
_a.sent();
|
|
216
|
+
return [2 /*return*/];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}); });
|
|
220
|
+
test('runs on prod mode correctly', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
221
|
+
return __generator(this, function (_a) {
|
|
222
|
+
switch (_a.label) {
|
|
223
|
+
case 0: return [4 /*yield*/, (0, utils_1.checkIfRunsOnProdMode)(projectDir, 'Listening on')];
|
|
224
|
+
case 1:
|
|
225
|
+
_a.sent();
|
|
226
|
+
return [2 /*return*/];
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}); });
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=nuxt-3.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt-3.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt-3.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,kCAYkB;AAClB,iDAAkD;AAElD,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,sCAAsC,CACvC,CAAC;IAEF,SAAS,CAAC;;;wBACR,qBAAM,sBAAsB,CAAC,UAAU,CAAC,EAAA;;oBAAxC,SAAwC,CAAC;;;;SAC1C,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;QAC/B,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAEjC,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAEnC,4BAA4B,CAAC,UAAU,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEH,SAAe,sBAAsB,CAAC,UAAkB;;;;;;oBAChD,WAAW,GAAG,uBAAW,CAAC,IAAI,CAAC;oBAE/B,c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rC,kCAAkC;YAClC,2EAA2E;YAC3E,+CAA+C;YAC/C,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kCAAkC,EAAE;QACvC,IAAA,yBAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,yBAAyB,CAAC,EAAE;YACrE,yCAAyC;YACzC,eAAe;YACf,mBAAW,iBAAS,CAAC,WAAW,QAAI;YACpC,8EAA8E;YAC9E,wBAAwB;YACxB,0BAA0B;YAC1B,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,4BAA4B,CAAC,UAAkB;IAAxD,iBAQC;IAPC,IAAI,CAAC,qBAAqB,EAAE;;;wBAC1B,qBAAM,IAAA,qBAAa,EAAC,UAAU,EAAE,oBAAoB,CAAC,EAAA;;oBAArD,SAAqD,CAAC;;;;SACvD,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;;;wBAClC,qBAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,EAAA;;oBAAvD,SAAuD,CAAC;;;;SACzD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import * as path from 'path';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n cleanupGit,\n KEYS,\n revertLocalChanges,\n startWizardInstance,\n TEST_ARGS,\n} from '../utils';\nimport { Integration } from '../../lib/Constants';\n\ndescribe('Nuxt-3', () => {\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nuxt-3-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnNuxtProject(projectDir);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n testNuxtProjectSetup(projectDir);\n\n testNuxtProjectConfigs(projectDir);\n\n testNuxtProjectBuildsAndRuns(projectDir);\n});\n\nasync function runWizardOnNuxtProject(projectDir: string): Promise<void> {\n const integration = Integration.nuxt;\n\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const tracingOptionPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, 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 timeout: 240_000,\n },\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 replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER, KEYS.ENTER],\n 'Successfully installed the Sentry Nuxt SDK!',\n );\n\n wizardInstance.kill();\n}\n\nfunction testNuxtProjectSetup(projectDir: string) {\n const integration = Integration.nuxt;\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('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n}\n\nfunction testNuxtProjectConfigs(projectDir: string) {\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ' sourceMapsUploadOptions: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n ' }',\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n}\n\nfunction testNuxtProjectBuildsAndRuns(projectDir: string) {\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir, 'preview this build');\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
var path = __importStar(require("path"));
|
|
63
|
+
var Constants_1 = require("../../lib/Constants");
|
|
64
|
+
var utils_1 = require("../utils");
|
|
65
|
+
var utils_2 = require("../utils");
|
|
66
|
+
describe('Nuxt-4', function () {
|
|
67
|
+
var projectDir = path.resolve(__dirname, '../test-applications/nuxt-4-test-app');
|
|
68
|
+
beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0: return [4 /*yield*/, runWizardOnNuxtProject(projectDir)];
|
|
72
|
+
case 1:
|
|
73
|
+
_a.sent();
|
|
74
|
+
return [2 /*return*/];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}); });
|
|
78
|
+
afterAll(function () {
|
|
79
|
+
(0, utils_1.revertLocalChanges)(projectDir);
|
|
80
|
+
(0, utils_1.cleanupGit)(projectDir);
|
|
81
|
+
});
|
|
82
|
+
testNuxtProjectSetup(projectDir);
|
|
83
|
+
testNuxtProjectConfigs(projectDir);
|
|
84
|
+
testNuxtProjectBuildsAndRuns(projectDir);
|
|
85
|
+
});
|
|
86
|
+
function runWizardOnNuxtProject(projectDir) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
+
var integration, wizardInstance, packageManagerPrompted, tracingOptionPrompted, _a, replayOptionPrompted, _b, _c;
|
|
89
|
+
return __generator(this, function (_d) {
|
|
90
|
+
switch (_d.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
integration = Constants_1.Integration.nuxt;
|
|
93
|
+
wizardInstance = (0, utils_2.startWizardInstance)(integration, projectDir);
|
|
94
|
+
return [4 /*yield*/, wizardInstance.waitForOutput('Please select your package manager.')];
|
|
95
|
+
case 1:
|
|
96
|
+
packageManagerPrompted = _d.sent();
|
|
97
|
+
_a = packageManagerPrompted;
|
|
98
|
+
if (!_a) return [3 /*break*/, 3];
|
|
99
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput(
|
|
100
|
+
// Selecting `yarn` as the package manager
|
|
101
|
+
[utils_2.KEYS.DOWN, utils_2.KEYS.ENTER],
|
|
102
|
+
// "Do you want to enable Tracing", sometimes doesn't work as `Tracing` can be printed in bold.
|
|
103
|
+
'to track the performance of your application?', {
|
|
104
|
+
timeout: 240000,
|
|
105
|
+
})];
|
|
106
|
+
case 2:
|
|
107
|
+
_a = (_d.sent());
|
|
108
|
+
_d.label = 3;
|
|
109
|
+
case 3:
|
|
110
|
+
tracingOptionPrompted = _a;
|
|
111
|
+
_b = tracingOptionPrompted;
|
|
112
|
+
if (!_b) return [3 /*break*/, 5];
|
|
113
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_2.KEYS.ENTER],
|
|
114
|
+
// "Do you want to enable Sentry Session Replay", sometimes doesn't work as `Sentry Session Replay` can be printed in bold.
|
|
115
|
+
'to get a video-like reproduction of errors during a user session?')];
|
|
116
|
+
case 4:
|
|
117
|
+
_b = (_d.sent());
|
|
118
|
+
_d.label = 5;
|
|
119
|
+
case 5:
|
|
120
|
+
replayOptionPrompted = _b;
|
|
121
|
+
_c = replayOptionPrompted;
|
|
122
|
+
if (!_c) return [3 /*break*/, 7];
|
|
123
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_2.KEYS.ENTER], 'Do you want to create an example page', {
|
|
124
|
+
optional: true,
|
|
125
|
+
})];
|
|
126
|
+
case 6:
|
|
127
|
+
_c = (_d.sent());
|
|
128
|
+
_d.label = 7;
|
|
129
|
+
case 7:
|
|
130
|
+
_c;
|
|
131
|
+
return [4 /*yield*/, wizardInstance.sendStdinAndWaitForOutput([utils_2.KEYS.ENTER, utils_2.KEYS.ENTER], 'Successfully installed the Sentry Nuxt SDK!')];
|
|
132
|
+
case 8:
|
|
133
|
+
_d.sent();
|
|
134
|
+
wizardInstance.kill();
|
|
135
|
+
return [2 /*return*/];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function testNuxtProjectSetup(projectDir) {
|
|
141
|
+
var integration = Constants_1.Integration.nuxt;
|
|
142
|
+
test('package.json is updated correctly', function () {
|
|
143
|
+
(0, utils_2.checkPackageJson)(projectDir, integration);
|
|
144
|
+
});
|
|
145
|
+
test('.env-sentry-build-plugin is created and contains the auth token', function () {
|
|
146
|
+
(0, utils_2.checkEnvBuildPlugin)(projectDir);
|
|
147
|
+
});
|
|
148
|
+
test('config files created', function () {
|
|
149
|
+
(0, utils_2.checkFileExists)("".concat(projectDir, "/sentry.server.config.ts"));
|
|
150
|
+
(0, utils_2.checkFileExists)("".concat(projectDir, "/sentry.client.config.ts"));
|
|
151
|
+
});
|
|
152
|
+
test('example page exists', function () {
|
|
153
|
+
(0, utils_2.checkFileExists)("".concat(projectDir, "/app/pages/sentry-example-page.vue"));
|
|
154
|
+
(0, utils_2.checkFileExists)("".concat(projectDir, "/server/api/sentry-example-api.ts"));
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function testNuxtProjectConfigs(projectDir) {
|
|
158
|
+
test('nuxt config contains sentry module', function () {
|
|
159
|
+
(0, utils_2.checkFileContents)(path.resolve(projectDir, 'nuxt.config.ts'), [
|
|
160
|
+
"modules: ['@sentry/nuxt/module'],",
|
|
161
|
+
'sentry: {',
|
|
162
|
+
' sourceMapsUploadOptions: {',
|
|
163
|
+
" org: '".concat(utils_2.TEST_ARGS.ORG_SLUG, "',"),
|
|
164
|
+
" project: '".concat(utils_2.TEST_ARGS.PROJECT_SLUG, "'"),
|
|
165
|
+
' }',
|
|
166
|
+
'},',
|
|
167
|
+
'sourcemap: {',
|
|
168
|
+
" client: 'hidden'",
|
|
169
|
+
'}',
|
|
170
|
+
]);
|
|
171
|
+
});
|
|
172
|
+
test('sentry.client.config.ts contents', function () {
|
|
173
|
+
(0, utils_2.checkFileContents)(path.resolve(projectDir, 'sentry.client.config.ts'), [
|
|
174
|
+
'import * as Sentry from "@sentry/nuxt";',
|
|
175
|
+
'Sentry.init({',
|
|
176
|
+
' // If set up, you can use your runtime config here',
|
|
177
|
+
' // dsn: useRuntimeConfig().public.sentry.dsn,',
|
|
178
|
+
" dsn: \"".concat(utils_2.TEST_ARGS.PROJECT_DSN, "\","),
|
|
179
|
+
' // We recommend adjusting this value in production, or using tracesSampler',
|
|
180
|
+
' // for finer control',
|
|
181
|
+
' tracesSampleRate: 1.0,',
|
|
182
|
+
' // This sets the sample rate to be 10%. You may want this to be 100% while',
|
|
183
|
+
' // in development and sample at a lower rate in production',
|
|
184
|
+
' replaysSessionSampleRate: 0.1,',
|
|
185
|
+
' // If the entire session is not sampled, use the below sample rate to sample',
|
|
186
|
+
' // sessions when an error occurs.',
|
|
187
|
+
' replaysOnErrorSampleRate: 1.0,',
|
|
188
|
+
" // If you don't want to use Session Replay, just remove the line below:",
|
|
189
|
+
' integrations: [Sentry.replayIntegration()],',
|
|
190
|
+
" // Setting this option to true will print useful information to the console while you're setting up Sentry.",
|
|
191
|
+
' debug: false,',
|
|
192
|
+
'});',
|
|
193
|
+
]);
|
|
194
|
+
});
|
|
195
|
+
test('sentry.server.config.ts contents', function () {
|
|
196
|
+
(0, utils_2.checkFileContents)(path.resolve(projectDir, 'sentry.server.config.ts'), [
|
|
197
|
+
'import * as Sentry from "@sentry/nuxt";',
|
|
198
|
+
'Sentry.init({',
|
|
199
|
+
" dsn: \"".concat(utils_2.TEST_ARGS.PROJECT_DSN, "\","),
|
|
200
|
+
' // We recommend adjusting this value in production, or using tracesSampler',
|
|
201
|
+
' // for finer control',
|
|
202
|
+
' tracesSampleRate: 1.0,',
|
|
203
|
+
" // Setting this option to true will print useful information to the console while you're setting up Sentry.",
|
|
204
|
+
' debug: false,',
|
|
205
|
+
'});',
|
|
206
|
+
]);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function testNuxtProjectBuildsAndRuns(projectDir) {
|
|
210
|
+
var _this = this;
|
|
211
|
+
test('builds successfully', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
212
|
+
return __generator(this, function (_a) {
|
|
213
|
+
switch (_a.label) {
|
|
214
|
+
case 0: return [4 /*yield*/, (0, utils_2.checkIfBuilds)(projectDir, 'preview this build')];
|
|
215
|
+
case 1:
|
|
216
|
+
_a.sent();
|
|
217
|
+
return [2 /*return*/];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}); });
|
|
221
|
+
test('runs on prod mode correctly', function () { return __awaiter(_this, void 0, void 0, function () {
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
switch (_a.label) {
|
|
224
|
+
case 0: return [4 /*yield*/, (0, utils_2.checkIfRunsOnProdMode)(projectDir, 'Listening on')];
|
|
225
|
+
case 1:
|
|
226
|
+
_a.sent();
|
|
227
|
+
return [2 /*return*/];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}); });
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=nuxt-4.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt-4.test.js","sourceRoot":"","sources":["../../../e2e-tests/tests/nuxt-4.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA6B;AAC7B,iDAAkD;AAClD,kCAA0D;AAC1D,kCAUkB;AAElB,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAC7B,SAAS,EACT,sCAAsC,CACvC,CAAC;IAEF,SAAS,CAAC;;;wBACR,qBAAM,sBAAsB,CAAC,UAAU,CAAC,EAAA;;oBAAxC,SAAwC,CAAC;;;;SAC1C,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,IAAA,0BAAkB,EAAC,UAAU,CAAC,C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AkC,EAAE;QACvC,IAAA,yBAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,yBAAyB,CAAC,EAAE;YACrE,yCAAyC;YACzC,eAAe;YACf,sDAAsD;YACtD,iDAAiD;YACjD,mBAAW,iBAAS,CAAC,WAAW,QAAI;YACpC,8EAA8E;YAC9E,wBAAwB;YACxB,0BAA0B;YAC1B,8EAA8E;YAC9E,8DAA8D;YAC9D,kCAAkC;YAClC,gFAAgF;YAChF,qCAAqC;YACrC,kCAAkC;YAClC,2EAA2E;YAC3E,+CAA+C;YAC/C,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,kCAAkC,EAAE;QACvC,IAAA,yBAAiB,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,yBAAyB,CAAC,EAAE;YACrE,yCAAyC;YACzC,eAAe;YACf,mBAAW,iBAAS,CAAC,WAAW,QAAI;YACpC,8EAA8E;YAC9E,wBAAwB;YACxB,0BAA0B;YAC1B,+GAA+G;YAC/G,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,4BAA4B,CAAC,UAAkB;IAAxD,iBAQC;IAPC,IAAI,CAAC,qBAAqB,EAAE;;;wBAC1B,qBAAM,IAAA,qBAAa,EAAC,UAAU,EAAE,oBAAoB,CAAC,EAAA;;oBAArD,SAAqD,CAAC;;;;SACvD,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE;;;wBAClC,qBAAM,IAAA,6BAAqB,EAAC,UAAU,EAAE,cAAc,CAAC,EAAA;;oBAAvD,SAAuD,CAAC;;;;SACzD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import * as path from 'path';\nimport { Integration } from '../../lib/Constants';\nimport { cleanupGit, revertLocalChanges } from '../utils';\nimport {\n checkEnvBuildPlugin,\n checkFileContents,\n checkFileExists,\n checkIfBuilds,\n checkIfRunsOnProdMode,\n checkPackageJson,\n KEYS,\n startWizardInstance,\n TEST_ARGS,\n} from '../utils';\n\ndescribe('Nuxt-4', () => {\n const projectDir = path.resolve(\n __dirname,\n '../test-applications/nuxt-4-test-app',\n );\n\n beforeAll(async () => {\n await runWizardOnNuxtProject(projectDir);\n });\n\n afterAll(() => {\n revertLocalChanges(projectDir);\n cleanupGit(projectDir);\n });\n\n testNuxtProjectSetup(projectDir);\n\n testNuxtProjectConfigs(projectDir);\n\n testNuxtProjectBuildsAndRuns(projectDir);\n});\n\nasync function runWizardOnNuxtProject(projectDir: string): Promise<void> {\n const integration = Integration.nuxt;\n\n const wizardInstance = startWizardInstance(integration, projectDir);\n const packageManagerPrompted = await wizardInstance.waitForOutput(\n 'Please select your package manager.',\n );\n\n const tracingOptionPrompted =\n packageManagerPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n // Selecting `yarn` as the package manager\n [KEYS.DOWN, 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 timeout: 240_000,\n },\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 replayOptionPrompted &&\n (await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER],\n 'Do you want to create an example page',\n {\n optional: true,\n },\n ));\n\n await wizardInstance.sendStdinAndWaitForOutput(\n [KEYS.ENTER, KEYS.ENTER],\n 'Successfully installed the Sentry Nuxt SDK!',\n );\n\n wizardInstance.kill();\n}\n\nfunction testNuxtProjectSetup(projectDir: string) {\n const integration = Integration.nuxt;\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('config files created', () => {\n checkFileExists(`${projectDir}/sentry.server.config.ts`);\n checkFileExists(`${projectDir}/sentry.client.config.ts`);\n });\n\n test('example page exists', () => {\n checkFileExists(`${projectDir}/app/pages/sentry-example-page.vue`);\n checkFileExists(`${projectDir}/server/api/sentry-example-api.ts`);\n });\n}\n\nfunction testNuxtProjectConfigs(projectDir: string) {\n test('nuxt config contains sentry module', () => {\n checkFileContents(path.resolve(projectDir, 'nuxt.config.ts'), [\n \"modules: ['@sentry/nuxt/module'],\",\n 'sentry: {',\n ' sourceMapsUploadOptions: {',\n ` org: '${TEST_ARGS.ORG_SLUG}',`,\n ` project: '${TEST_ARGS.PROJECT_SLUG}'`,\n ' }',\n '},',\n 'sourcemap: {',\n \" client: 'hidden'\",\n '}',\n ]);\n });\n\n test('sentry.client.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.client.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ' // If set up, you can use your runtime config here',\n ' // dsn: useRuntimeConfig().public.sentry.dsn,',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n ' // This sets the sample rate to be 10%. You may want this to be 100% while',\n ' // in development and sample at a lower rate in production',\n ' replaysSessionSampleRate: 0.1,',\n ' // If the entire session is not sampled, use the below sample rate to sample',\n ' // sessions when an error occurs.',\n ' replaysOnErrorSampleRate: 1.0,',\n \" // If you don't want to use Session Replay, just remove the line below:\",\n ' integrations: [Sentry.replayIntegration()],',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n\n test('sentry.server.config.ts contents', () => {\n checkFileContents(path.resolve(projectDir, 'sentry.server.config.ts'), [\n 'import * as Sentry from \"@sentry/nuxt\";',\n 'Sentry.init({',\n ` dsn: \"${TEST_ARGS.PROJECT_DSN}\",`,\n ' // We recommend adjusting this value in production, or using tracesSampler',\n ' // for finer control',\n ' tracesSampleRate: 1.0,',\n \" // Setting this option to true will print useful information to the console while you're setting up Sentry.\",\n ' debug: false,',\n '});',\n ]);\n });\n}\n\nfunction testNuxtProjectBuildsAndRuns(projectDir: string) {\n test('builds successfully', async () => {\n await checkIfBuilds(projectDir, 'preview this build');\n });\n\n test('runs on prod mode correctly', async () => {\n await checkIfRunsOnProdMode(projectDir, 'Listening on');\n });\n}\n"]}
|