@sentry/wizard 6.2.0 → 6.3.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/e2e-tests/tests/angular-17.test.js +5 -0
  3. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
  4. package/dist/e2e-tests/tests/angular-19.test.js +5 -0
  5. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
  6. package/dist/e2e-tests/tests/expo.test.js +9 -2
  7. package/dist/e2e-tests/tests/expo.test.js.map +1 -1
  8. package/dist/e2e-tests/tests/flutter.test.js +18 -4
  9. package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/nextjs-14.test.js +4 -3
  11. package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/nextjs-15.test.js +17 -4
  13. package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/nuxt-3.test.js +9 -2
  15. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/nuxt-4.test.js +9 -2
  17. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  18. package/dist/e2e-tests/tests/react-native.test.js +8 -1
  19. package/dist/e2e-tests/tests/react-native.test.js.map +1 -1
  20. package/dist/e2e-tests/tests/remix.test.js +16 -2
  21. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  22. package/dist/e2e-tests/tests/sveltekit.test.js +16 -2
  23. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  24. package/dist/src/android/android-wizard.js +3 -0
  25. package/dist/src/android/android-wizard.js.map +1 -1
  26. package/dist/src/angular/angular-wizard.js +3 -0
  27. package/dist/src/angular/angular-wizard.js.map +1 -1
  28. package/dist/src/apple/apple-wizard.js +3 -0
  29. package/dist/src/apple/apple-wizard.js.map +1 -1
  30. package/dist/src/flutter/flutter-wizard.js +3 -0
  31. package/dist/src/flutter/flutter-wizard.js.map +1 -1
  32. package/dist/src/nextjs/nextjs-wizard.js +3 -0
  33. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  34. package/dist/src/nuxt/nuxt-wizard.js +3 -0
  35. package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
  36. package/dist/src/react-native/react-native-wizard.js +3 -0
  37. package/dist/src/react-native/react-native-wizard.js.map +1 -1
  38. package/dist/src/remix/remix-wizard.d.ts +4 -0
  39. package/dist/src/remix/remix-wizard.js +7 -0
  40. package/dist/src/remix/remix-wizard.js.map +1 -1
  41. package/dist/src/sveltekit/sveltekit-wizard.js +3 -0
  42. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  43. package/dist/src/utils/clack/mcp-config.d.ts +7 -0
  44. package/dist/src/utils/clack/mcp-config.js +427 -0
  45. package/dist/src/utils/clack/mcp-config.js.map +1 -0
  46. package/dist/src/version.d.ts +1 -1
  47. package/dist/src/version.js +1 -1
  48. package/dist/src/version.js.map +1 -1
  49. package/dist/test/angular/angular-wizard.test.js +3 -0
  50. package/dist/test/angular/angular-wizard.test.js.map +1 -1
  51. package/dist/test/apple/templates.test.js +3 -0
  52. package/dist/test/apple/templates.test.js.map +1 -1
  53. package/dist/test/flutter/templates.test.js +3 -0
  54. package/dist/test/flutter/templates.test.js.map +1 -1
  55. package/dist/test/nextjs/wizard-double-wrap-prevention.test.js +3 -0
  56. package/dist/test/nextjs/wizard-double-wrap-prevention.test.js.map +1 -1
  57. package/dist/test/nuxt/templates.test.js +3 -0
  58. package/dist/test/nuxt/templates.test.js.map +1 -1
  59. package/dist/test/react-native/metro.test.js +3 -0
  60. package/dist/test/react-native/metro.test.js.map +1 -1
  61. package/dist/test/remix/root.test.js +3 -0
  62. package/dist/test/remix/root.test.js.map +1 -1
  63. package/dist/test/sveltekit/templates.test.js +3 -0
  64. package/dist/test/sveltekit/templates.test.js.map +1 -1
  65. package/dist/test/utils/clack/mcp-config.test.d.ts +1 -0
  66. package/dist/test/utils/clack/mcp-config.test.js +520 -0
  67. package/dist/test/utils/clack/mcp-config.test.js.map +1 -0
  68. package/package.json +1 -1
@@ -0,0 +1,427 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.offerProjectScopedMcpConfig = void 0;
30
+ const fs = __importStar(require("fs"));
31
+ const path = __importStar(require("path"));
32
+ const childProcess = __importStar(require("child_process"));
33
+ const Sentry = __importStar(require("@sentry/node"));
34
+ const chalk_1 = __importDefault(require("chalk"));
35
+ // @ts-expect-error - clack is ESM and TS complains about that. It works though
36
+ const clack = __importStar(require("@clack/prompts"));
37
+ const index_1 = require("./index");
38
+ const SENTRY_MCP_BASE_URL = 'https://mcp.sentry.dev/mcp';
39
+ /**
40
+ * Constructs the MCP URL with optional org and project slugs
41
+ */
42
+ function getMcpUrl(orgSlug, projectSlug) {
43
+ if (orgSlug && projectSlug) {
44
+ return `${SENTRY_MCP_BASE_URL}/${orgSlug}/${projectSlug}`;
45
+ }
46
+ return SENTRY_MCP_BASE_URL;
47
+ }
48
+ function ensureDir(dirpath) {
49
+ fs.mkdirSync(dirpath, { recursive: true });
50
+ }
51
+ async function readJsonIfExists(filepath) {
52
+ try {
53
+ const txt = await fs.promises.readFile(filepath, 'utf8');
54
+ return JSON.parse(txt);
55
+ }
56
+ catch {
57
+ return null;
58
+ }
59
+ }
60
+ async function writeJson(filepath, obj) {
61
+ ensureDir(path.dirname(filepath));
62
+ await fs.promises.writeFile(filepath, JSON.stringify(obj, null, 2), 'utf8');
63
+ }
64
+ function getCursorMcpJsonSnippet(orgSlug, projectSlug) {
65
+ const obj = {
66
+ mcpServers: {
67
+ Sentry: {
68
+ url: getMcpUrl(orgSlug, projectSlug),
69
+ },
70
+ },
71
+ };
72
+ return JSON.stringify(obj, null, 2);
73
+ }
74
+ function getVsCodeMcpJsonSnippet(orgSlug, projectSlug) {
75
+ const obj = {
76
+ servers: {
77
+ Sentry: {
78
+ url: getMcpUrl(orgSlug, projectSlug),
79
+ type: 'http',
80
+ },
81
+ },
82
+ };
83
+ return JSON.stringify(obj, null, 2);
84
+ }
85
+ function getClaudeCodeMcpJsonSnippet(orgSlug, projectSlug) {
86
+ const obj = {
87
+ mcpServers: {
88
+ Sentry: {
89
+ url: getMcpUrl(orgSlug, projectSlug),
90
+ },
91
+ },
92
+ };
93
+ return JSON.stringify(obj, null, 2);
94
+ }
95
+ function getJetBrainsMcpJsonSnippet(orgSlug, projectSlug) {
96
+ const obj = {
97
+ mcpServers: {
98
+ Sentry: {
99
+ url: getMcpUrl(orgSlug, projectSlug),
100
+ },
101
+ },
102
+ };
103
+ return JSON.stringify(obj, null, 2);
104
+ }
105
+ function getGenericMcpJsonSnippet(orgSlug, projectSlug) {
106
+ const obj = {
107
+ mcpServers: {
108
+ Sentry: {
109
+ url: getMcpUrl(orgSlug, projectSlug),
110
+ },
111
+ },
112
+ };
113
+ return JSON.stringify(obj, null, 2);
114
+ }
115
+ async function addCursorMcpConfig(orgSlug, projectSlug) {
116
+ const file = path.join(process.cwd(), '.cursor', 'mcp.json');
117
+ const existing = await readJsonIfExists(file);
118
+ if (!existing) {
119
+ await writeJson(file, JSON.parse(getCursorMcpJsonSnippet(orgSlug, projectSlug)));
120
+ clack.log.success(chalk_1.default.cyan(path.join('.cursor', 'mcp.json')) + ' created.');
121
+ return;
122
+ }
123
+ try {
124
+ const updated = { ...existing };
125
+ updated.mcpServers = updated.mcpServers || {};
126
+ updated.mcpServers['Sentry'] = {
127
+ url: getMcpUrl(orgSlug, projectSlug),
128
+ };
129
+ await writeJson(file, updated);
130
+ clack.log.success('Updated .cursor/mcp.json');
131
+ }
132
+ catch {
133
+ throw new Error('Failed to update .cursor/mcp.json');
134
+ }
135
+ }
136
+ async function addVsCodeMcpConfig(orgSlug, projectSlug) {
137
+ const file = path.join(process.cwd(), '.vscode', 'mcp.json');
138
+ const existing = await readJsonIfExists(file);
139
+ if (!existing) {
140
+ await writeJson(file, JSON.parse(getVsCodeMcpJsonSnippet(orgSlug, projectSlug)));
141
+ clack.log.success(chalk_1.default.cyan(path.join('.vscode', 'mcp.json')) + ' created.');
142
+ return;
143
+ }
144
+ try {
145
+ const updated = { ...existing };
146
+ updated.servers = updated.servers || {};
147
+ updated.servers['Sentry'] = {
148
+ url: getMcpUrl(orgSlug, projectSlug),
149
+ type: 'http',
150
+ };
151
+ await writeJson(file, updated);
152
+ clack.log.success('Updated .vscode/mcp.json');
153
+ }
154
+ catch {
155
+ throw new Error('Failed to update .vscode/mcp.json');
156
+ }
157
+ }
158
+ async function addClaudeCodeMcpConfig(orgSlug, projectSlug) {
159
+ const file = path.join(process.cwd(), '.mcp.json');
160
+ const existing = await readJsonIfExists(file);
161
+ if (!existing) {
162
+ await writeJson(file, JSON.parse(getClaudeCodeMcpJsonSnippet(orgSlug, projectSlug)));
163
+ clack.log.success(chalk_1.default.cyan('.mcp.json') + ' created.');
164
+ return;
165
+ }
166
+ try {
167
+ const updated = { ...existing };
168
+ updated.mcpServers = updated.mcpServers || {};
169
+ updated.mcpServers['Sentry'] = {
170
+ url: getMcpUrl(orgSlug, projectSlug),
171
+ };
172
+ await writeJson(file, updated);
173
+ clack.log.success('Updated .mcp.json');
174
+ }
175
+ catch {
176
+ throw new Error('Failed to update .mcp.json');
177
+ }
178
+ }
179
+ /**
180
+ * Copies text to clipboard across different platforms
181
+ */
182
+ async function copyToClipboard(text) {
183
+ try {
184
+ const platform = process.platform;
185
+ let command;
186
+ if (platform === 'darwin') {
187
+ command = 'pbcopy';
188
+ }
189
+ else if (platform === 'win32') {
190
+ command = 'clip';
191
+ }
192
+ else {
193
+ // Linux
194
+ command = 'xclip -selection clipboard';
195
+ }
196
+ const proc = childProcess.spawn(command, [], { shell: true });
197
+ proc.stdin.write(text);
198
+ proc.stdin.end();
199
+ return new Promise((resolve) => {
200
+ proc.on('close', (code) => {
201
+ resolve(code === 0);
202
+ });
203
+ proc.on('error', () => {
204
+ resolve(false);
205
+ });
206
+ });
207
+ }
208
+ catch {
209
+ return false;
210
+ }
211
+ }
212
+ /**
213
+ * Shows MCP configuration for JetBrains IDEs with copy-to-clipboard option
214
+ */
215
+ async function showJetBrainsMcpConfig(orgSlug, projectSlug) {
216
+ const configSnippet = getJetBrainsMcpJsonSnippet(orgSlug, projectSlug);
217
+ clack.log.info(chalk_1.default.cyan('For JetBrains IDEs (WebStorm, IntelliJ IDEA, PyCharm, etc.):'));
218
+ clack.log.info(chalk_1.default.dim("Add the following configuration to your IDE's MCP settings.\n" +
219
+ 'See: https://www.jetbrains.com/help/webstorm/mcp-server.html'));
220
+ // Display the configuration
221
+ // eslint-disable-next-line no-console
222
+ console.log('\n' + chalk_1.default.green(configSnippet) + '\n');
223
+ // Ask if user wants to copy to clipboard
224
+ const shouldCopy = await (0, index_1.abortIfCancelled)(clack.select({
225
+ message: 'Copy configuration to clipboard?',
226
+ options: [
227
+ { label: 'Yes', value: true },
228
+ { label: 'No', value: false },
229
+ ],
230
+ initialValue: true,
231
+ }));
232
+ if (shouldCopy) {
233
+ const copied = await copyToClipboard(configSnippet);
234
+ if (copied) {
235
+ clack.log.success('Configuration copied to clipboard!');
236
+ Sentry.setTag('mcp-clipboard-copy', 'success');
237
+ }
238
+ else {
239
+ clack.log.warn('Failed to copy to clipboard. Please copy the configuration above manually.');
240
+ Sentry.setTag('mcp-clipboard-copy', 'failed');
241
+ }
242
+ }
243
+ else {
244
+ Sentry.setTag('mcp-clipboard-copy', 'declined');
245
+ }
246
+ clack.log.info(chalk_1.default.dim('Note: You may need to restart your IDE for MCP changes to take effect.'));
247
+ }
248
+ /**
249
+ * Shows generic MCP configuration for unsupported IDEs with copy-to-clipboard option
250
+ */
251
+ async function showGenericMcpConfig(orgSlug, projectSlug) {
252
+ const configSnippet = getGenericMcpJsonSnippet(orgSlug, projectSlug);
253
+ clack.log.info(chalk_1.default.cyan('Generic MCP configuration for your IDE:'));
254
+ clack.log.info(chalk_1.default.dim('If your IDE supports MCP servers, you can use the following configuration.\n' +
255
+ "Please consult your IDE's documentation for how to add MCP server configurations."));
256
+ // Display the configuration
257
+ // eslint-disable-next-line no-console
258
+ console.log('\n' + chalk_1.default.green(configSnippet) + '\n');
259
+ // Ask if user wants to copy to clipboard
260
+ const shouldCopy = await (0, index_1.abortIfCancelled)(clack.select({
261
+ message: 'Copy configuration to clipboard?',
262
+ options: [
263
+ { label: 'Yes', value: true },
264
+ { label: 'No', value: false },
265
+ ],
266
+ initialValue: true,
267
+ }));
268
+ if (shouldCopy) {
269
+ const copied = await copyToClipboard(configSnippet);
270
+ if (copied) {
271
+ clack.log.success('Configuration copied to clipboard!');
272
+ Sentry.setTag('mcp-clipboard-copy', 'success');
273
+ }
274
+ else {
275
+ clack.log.warn('Failed to copy to clipboard. Please copy the configuration above manually.');
276
+ Sentry.setTag('mcp-clipboard-copy', 'failed');
277
+ }
278
+ }
279
+ else {
280
+ Sentry.setTag('mcp-clipboard-copy', 'declined');
281
+ }
282
+ clack.log.info(chalk_1.default.dim('Note: The exact configuration format may vary depending on your IDE.\n' +
283
+ "If your IDE doesn't support MCP yet, please check back later or open an issue at:\n" +
284
+ 'https://github.com/getsentry/sentry-wizard/issues'));
285
+ }
286
+ /**
287
+ * Explains what MCP is and its benefits for Sentry users
288
+ */
289
+ async function explainMCP() {
290
+ clack.log.info(chalk_1.default.cyan('What is MCP (Model Context Protocol)?'));
291
+ clack.log.info(chalk_1.default.dim('MCP is a protocol that allows AI assistants in your IDE to interact with external tools and services.\n\n' +
292
+ 'The Sentry MCP server enables AI assistants to:\n' +
293
+ ' • Query and analyze your Sentry issues directly from your IDE\n' +
294
+ ' • Get context about errors and performance problems\n' +
295
+ ' • Help debug issues with production data insights\n' +
296
+ ' • Suggest fixes based on real error patterns\n\n' +
297
+ "This makes it easier to fix bugs by bringing Sentry's insights directly into your development workflow.\n\n" +
298
+ 'Learn more: ' +
299
+ chalk_1.default.cyan('https://docs.sentry.io/product/sentry-mcp/')));
300
+ // Ask again after explanation
301
+ const shouldAddAfterExplanation = await (0, index_1.abortIfCancelled)(clack.select({
302
+ message: 'Would you like to configure MCP for your IDE now?',
303
+ options: [
304
+ { label: 'Yes', value: true },
305
+ { label: 'No', value: false, hint: 'You can add it later anytime' },
306
+ ],
307
+ initialValue: true,
308
+ }));
309
+ return shouldAddAfterExplanation;
310
+ }
311
+ /**
312
+ * Offers to add a project-scoped MCP server configuration for the Sentry MCP.
313
+ * Supports Cursor, VS Code, and Claude Code.
314
+ * @param orgSlug - Optional organization slug to include in the MCP URL
315
+ * @param projectSlug - Optional project slug to include in the MCP URL
316
+ */
317
+ async function offerProjectScopedMcpConfig(orgSlug, projectSlug) {
318
+ const initialChoice = await (0, index_1.abortIfCancelled)(clack.select({
319
+ message: 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',
320
+ options: [
321
+ { label: 'Yes', value: 'yes' },
322
+ { label: 'No', value: 'no', hint: 'You can add it later anytime' },
323
+ {
324
+ label: 'What is MCP?',
325
+ value: 'explain',
326
+ hint: 'Learn about MCP benefits',
327
+ },
328
+ ],
329
+ initialValue: 'yes',
330
+ }));
331
+ let shouldAdd;
332
+ if (initialChoice === 'explain') {
333
+ Sentry.setTag('mcp-choice', 'explain');
334
+ shouldAdd = await explainMCP();
335
+ Sentry.setTag('mcp-configured-after-explain', shouldAdd);
336
+ }
337
+ else {
338
+ shouldAdd = initialChoice === 'yes';
339
+ Sentry.setTag('mcp-choice', initialChoice);
340
+ }
341
+ if (!shouldAdd) {
342
+ Sentry.setTag('mcp-configured', false);
343
+ return;
344
+ }
345
+ Sentry.setTag('mcp-configured', true);
346
+ const editor = await (0, index_1.abortIfCancelled)(clack.select({
347
+ message: 'Which editor do you want to configure?',
348
+ options: [
349
+ { value: 'cursor', label: 'Cursor (project .cursor/mcp.json)' },
350
+ { value: 'vscode', label: 'VS Code (project .vscode/mcp.json)' },
351
+ { value: 'claudeCode', label: 'Claude Code (project .mcp.json)' },
352
+ {
353
+ value: 'jetbrains',
354
+ label: 'JetBrains IDE (WebStorm, IntelliJ IDEA, PyCharm, etc.)',
355
+ hint: 'Manual configuration required',
356
+ },
357
+ {
358
+ value: 'other',
359
+ label: 'I use a different IDE',
360
+ hint: "We'll show you the configuration to copy",
361
+ },
362
+ ],
363
+ }));
364
+ // Track which editor was selected
365
+ Sentry.setTag('mcp-editor', editor);
366
+ try {
367
+ switch (editor) {
368
+ case 'cursor':
369
+ await addCursorMcpConfig(orgSlug, projectSlug);
370
+ clack.log.success('Added project-scoped Sentry MCP configuration.');
371
+ clack.log.info(chalk_1.default.dim('Note: You may need to reload your editor for MCP changes to take effect.'));
372
+ Sentry.setTag('mcp-config-success', true);
373
+ break;
374
+ case 'vscode':
375
+ await addVsCodeMcpConfig(orgSlug, projectSlug);
376
+ clack.log.success('Added project-scoped Sentry MCP configuration.');
377
+ clack.log.info(chalk_1.default.dim('Note: You may need to reload your editor for MCP changes to take effect.'));
378
+ Sentry.setTag('mcp-config-success', true);
379
+ break;
380
+ case 'claudeCode':
381
+ await addClaudeCodeMcpConfig(orgSlug, projectSlug);
382
+ clack.log.success('Added project-scoped Sentry MCP configuration.');
383
+ clack.log.info(chalk_1.default.dim('Note: You may need to reload your editor for MCP changes to take effect.'));
384
+ Sentry.setTag('mcp-config-success', true);
385
+ break;
386
+ case 'jetbrains':
387
+ await showJetBrainsMcpConfig(orgSlug, projectSlug);
388
+ Sentry.setTag('mcp-config-success', true);
389
+ Sentry.setTag('mcp-config-manual', true);
390
+ break;
391
+ case 'other':
392
+ await showGenericMcpConfig(orgSlug, projectSlug);
393
+ Sentry.setTag('mcp-config-success', true);
394
+ Sentry.setTag('mcp-config-manual', true);
395
+ break;
396
+ }
397
+ }
398
+ catch (e) {
399
+ Sentry.setTag('mcp-config-success', false);
400
+ Sentry.setTag('mcp-config-fallback', true);
401
+ clack.log.warn(chalk_1.default.yellow('Failed to write MCP config automatically. Please copy/paste the snippet below into your project config file.'));
402
+ // Fallback: show per-editor instructions
403
+ if (editor === 'cursor') {
404
+ await (0, index_1.showCopyPasteInstructions)({
405
+ filename: path.join('.cursor', 'mcp.json'),
406
+ codeSnippet: getCursorMcpJsonSnippet(orgSlug, projectSlug),
407
+ hint: 'create the file if it does not exist',
408
+ });
409
+ }
410
+ else if (editor === 'vscode') {
411
+ await (0, index_1.showCopyPasteInstructions)({
412
+ filename: path.join('.vscode', 'mcp.json'),
413
+ codeSnippet: getVsCodeMcpJsonSnippet(orgSlug, projectSlug),
414
+ hint: 'create the file if it does not exist',
415
+ });
416
+ }
417
+ else if (editor === 'claudeCode') {
418
+ await (0, index_1.showCopyPasteInstructions)({
419
+ filename: '.mcp.json',
420
+ codeSnippet: getClaudeCodeMcpJsonSnippet(orgSlug, projectSlug),
421
+ hint: 'create the file if it does not exist',
422
+ });
423
+ }
424
+ }
425
+ }
426
+ exports.offerProjectScopedMcpConfig = offerProjectScopedMcpConfig;
427
+ //# sourceMappingURL=mcp-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../../../src/utils/clack/mcp-config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,4DAA8C;AAC9C,qDAAuC;AACvC,kDAA0B;AAC1B,+EAA+E;AAC/E,sDAAwC;AACxC,mCAAsE;AAEtE,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AAezD;;GAEG;AACH,SAAS,SAAS,CAAC,OAAgB,EAAE,WAAoB;IACvD,IAAI,OAAO,IAAI,WAAW,EAAE;QAC1B,OAAO,GAAG,mBAAmB,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;KAC3D;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,SAAS,SAAS,CAAC,OAAe;IAChC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IAC9C,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;KACnC;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,GAAY;IACrD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,uBAAuB,CAC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uB,CAAC,OAAO,EAAE,WAAW,CAAC;gBAC1D,IAAI,EAAE,sCAAsC;aAC7C,CAAC,CAAC;SACJ;aAAM,IAAI,MAAM,KAAK,YAAY,EAAE;YAClC,MAAM,IAAA,iCAAyB,EAAC;gBAC9B,QAAQ,EAAE,WAAW;gBACrB,WAAW,EAAE,2BAA2B,CAAC,OAAO,EAAE,WAAW,CAAC;gBAC9D,IAAI,EAAE,sCAAsC;aAC7C,CAAC,CAAC;SACJ;KACF;AACH,CAAC;AAlJD,kEAkJC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\nimport * as childProcess from 'child_process';\nimport * as Sentry from '@sentry/node';\nimport chalk from 'chalk';\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { abortIfCancelled, showCopyPasteInstructions } from './index';\n\nconst SENTRY_MCP_BASE_URL = 'https://mcp.sentry.dev/mcp';\n\n// Type definitions for MCP configurations\ninterface CursorMcpConfig {\n mcpServers?: Record<string, { url: string }>;\n}\n\ninterface VsCodeMcpConfig {\n servers?: Record<string, { url: string; type: string }>;\n}\n\ninterface ClaudeCodeMcpConfig {\n mcpServers?: Record<string, { url: string }>;\n}\n\n/**\n * Constructs the MCP URL with optional org and project slugs\n */\nfunction getMcpUrl(orgSlug?: string, projectSlug?: string): string {\n if (orgSlug && projectSlug) {\n return `${SENTRY_MCP_BASE_URL}/${orgSlug}/${projectSlug}`;\n }\n return SENTRY_MCP_BASE_URL;\n}\n\nfunction ensureDir(dirpath: string): void {\n fs.mkdirSync(dirpath, { recursive: true });\n}\n\nasync function readJsonIfExists(filepath: string): Promise<unknown | null> {\n try {\n const txt = await fs.promises.readFile(filepath, 'utf8');\n return JSON.parse(txt) as unknown;\n } catch {\n return null;\n }\n}\n\nasync function writeJson(filepath: string, obj: unknown): Promise<void> {\n ensureDir(path.dirname(filepath));\n await fs.promises.writeFile(filepath, JSON.stringify(obj, null, 2), 'utf8');\n}\n\nfunction getCursorMcpJsonSnippet(\n orgSlug?: string,\n projectSlug?: string,\n): string {\n const obj = {\n mcpServers: {\n Sentry: {\n url: getMcpUrl(orgSlug, projectSlug),\n },\n },\n } as const;\n return JSON.stringify(obj, null, 2);\n}\n\nfunction getVsCodeMcpJsonSnippet(\n orgSlug?: string,\n projectSlug?: string,\n): string {\n const obj = {\n servers: {\n Sentry: {\n url: getMcpUrl(orgSlug, projectSlug),\n type: 'http',\n },\n },\n } as const;\n return JSON.stringify(obj, null, 2);\n}\n\nfunction getClaudeCodeMcpJsonSnippet(\n orgSlug?: string,\n projectSlug?: string,\n): string {\n const obj = {\n mcpServers: {\n Sentry: {\n url: getMcpUrl(orgSlug, projectSlug),\n },\n },\n } as const;\n return JSON.stringify(obj, null, 2);\n}\n\nfunction getJetBrainsMcpJsonSnippet(\n orgSlug?: string,\n projectSlug?: string,\n): string {\n const obj = {\n mcpServers: {\n Sentry: {\n url: getMcpUrl(orgSlug, projectSlug),\n },\n },\n } as const;\n return JSON.stringify(obj, null, 2);\n}\n\nfunction getGenericMcpJsonSnippet(\n orgSlug?: string,\n projectSlug?: string,\n): string {\n const obj = {\n mcpServers: {\n Sentry: {\n url: getMcpUrl(orgSlug, projectSlug),\n },\n },\n } as const;\n return JSON.stringify(obj, null, 2);\n}\n\nasync function addCursorMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n const file = path.join(process.cwd(), '.cursor', 'mcp.json');\n const existing = await readJsonIfExists(file);\n if (!existing) {\n await writeJson(\n file,\n JSON.parse(getCursorMcpJsonSnippet(orgSlug, projectSlug)),\n );\n clack.log.success(\n chalk.cyan(path.join('.cursor', 'mcp.json')) + ' created.',\n );\n return;\n }\n try {\n const updated = { ...existing } as CursorMcpConfig;\n updated.mcpServers = updated.mcpServers || {};\n updated.mcpServers['Sentry'] = {\n url: getMcpUrl(orgSlug, projectSlug),\n };\n await writeJson(file, updated);\n clack.log.success('Updated .cursor/mcp.json');\n } catch {\n throw new Error('Failed to update .cursor/mcp.json');\n }\n}\n\nasync function addVsCodeMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n const file = path.join(process.cwd(), '.vscode', 'mcp.json');\n const existing = await readJsonIfExists(file);\n if (!existing) {\n await writeJson(\n file,\n JSON.parse(getVsCodeMcpJsonSnippet(orgSlug, projectSlug)),\n );\n clack.log.success(\n chalk.cyan(path.join('.vscode', 'mcp.json')) + ' created.',\n );\n return;\n }\n try {\n const updated = { ...existing } as VsCodeMcpConfig;\n updated.servers = updated.servers || {};\n updated.servers['Sentry'] = {\n url: getMcpUrl(orgSlug, projectSlug),\n type: 'http',\n };\n await writeJson(file, updated);\n clack.log.success('Updated .vscode/mcp.json');\n } catch {\n throw new Error('Failed to update .vscode/mcp.json');\n }\n}\n\nasync function addClaudeCodeMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n const file = path.join(process.cwd(), '.mcp.json');\n const existing = await readJsonIfExists(file);\n if (!existing) {\n await writeJson(\n file,\n JSON.parse(getClaudeCodeMcpJsonSnippet(orgSlug, projectSlug)),\n );\n clack.log.success(chalk.cyan('.mcp.json') + ' created.');\n return;\n }\n try {\n const updated = { ...existing } as ClaudeCodeMcpConfig;\n updated.mcpServers = updated.mcpServers || {};\n updated.mcpServers['Sentry'] = {\n url: getMcpUrl(orgSlug, projectSlug),\n };\n await writeJson(file, updated);\n clack.log.success('Updated .mcp.json');\n } catch {\n throw new Error('Failed to update .mcp.json');\n }\n}\n\n/**\n * Copies text to clipboard across different platforms\n */\nasync function copyToClipboard(text: string): Promise<boolean> {\n try {\n const platform = process.platform;\n let command: string;\n\n if (platform === 'darwin') {\n command = 'pbcopy';\n } else if (platform === 'win32') {\n command = 'clip';\n } else {\n // Linux\n command = 'xclip -selection clipboard';\n }\n\n const proc = childProcess.spawn(command, [], { shell: true });\n proc.stdin.write(text);\n proc.stdin.end();\n\n return new Promise((resolve) => {\n proc.on('close', (code) => {\n resolve(code === 0);\n });\n proc.on('error', () => {\n resolve(false);\n });\n });\n } catch {\n return false;\n }\n}\n\n/**\n * Shows MCP configuration for JetBrains IDEs with copy-to-clipboard option\n */\nasync function showJetBrainsMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n const configSnippet = getJetBrainsMcpJsonSnippet(orgSlug, projectSlug);\n\n clack.log.info(\n chalk.cyan('For JetBrains IDEs (WebStorm, IntelliJ IDEA, PyCharm, etc.):'),\n );\n clack.log.info(\n chalk.dim(\n \"Add the following configuration to your IDE's MCP settings.\\n\" +\n 'See: https://www.jetbrains.com/help/webstorm/mcp-server.html',\n ),\n );\n\n // Display the configuration\n // eslint-disable-next-line no-console\n console.log('\\n' + chalk.green(configSnippet) + '\\n');\n\n // Ask if user wants to copy to clipboard\n const shouldCopy: boolean = await abortIfCancelled(\n clack.select({\n message: 'Copy configuration to clipboard?',\n options: [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n ],\n initialValue: true,\n }),\n );\n\n if (shouldCopy) {\n const copied = await copyToClipboard(configSnippet);\n\n if (copied) {\n clack.log.success('Configuration copied to clipboard!');\n Sentry.setTag('mcp-clipboard-copy', 'success');\n } else {\n clack.log.warn(\n 'Failed to copy to clipboard. Please copy the configuration above manually.',\n );\n Sentry.setTag('mcp-clipboard-copy', 'failed');\n }\n } else {\n Sentry.setTag('mcp-clipboard-copy', 'declined');\n }\n\n clack.log.info(\n chalk.dim(\n 'Note: You may need to restart your IDE for MCP changes to take effect.',\n ),\n );\n}\n\n/**\n * Shows generic MCP configuration for unsupported IDEs with copy-to-clipboard option\n */\nasync function showGenericMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n const configSnippet = getGenericMcpJsonSnippet(orgSlug, projectSlug);\n\n clack.log.info(chalk.cyan('Generic MCP configuration for your IDE:'));\n clack.log.info(\n chalk.dim(\n 'If your IDE supports MCP servers, you can use the following configuration.\\n' +\n \"Please consult your IDE's documentation for how to add MCP server configurations.\",\n ),\n );\n\n // Display the configuration\n // eslint-disable-next-line no-console\n console.log('\\n' + chalk.green(configSnippet) + '\\n');\n\n // Ask if user wants to copy to clipboard\n const shouldCopy: boolean = await abortIfCancelled(\n clack.select({\n message: 'Copy configuration to clipboard?',\n options: [\n { label: 'Yes', value: true },\n { label: 'No', value: false },\n ],\n initialValue: true,\n }),\n );\n\n if (shouldCopy) {\n const copied = await copyToClipboard(configSnippet);\n\n if (copied) {\n clack.log.success('Configuration copied to clipboard!');\n Sentry.setTag('mcp-clipboard-copy', 'success');\n } else {\n clack.log.warn(\n 'Failed to copy to clipboard. Please copy the configuration above manually.',\n );\n Sentry.setTag('mcp-clipboard-copy', 'failed');\n }\n } else {\n Sentry.setTag('mcp-clipboard-copy', 'declined');\n }\n\n clack.log.info(\n chalk.dim(\n 'Note: The exact configuration format may vary depending on your IDE.\\n' +\n \"If your IDE doesn't support MCP yet, please check back later or open an issue at:\\n\" +\n 'https://github.com/getsentry/sentry-wizard/issues',\n ),\n );\n}\n\n/**\n * Explains what MCP is and its benefits for Sentry users\n */\nasync function explainMCP(): Promise<boolean> {\n clack.log.info(chalk.cyan('What is MCP (Model Context Protocol)?'));\n\n clack.log.info(\n chalk.dim(\n 'MCP is a protocol that allows AI assistants in your IDE to interact with external tools and services.\\n\\n' +\n 'The Sentry MCP server enables AI assistants to:\\n' +\n ' • Query and analyze your Sentry issues directly from your IDE\\n' +\n ' • Get context about errors and performance problems\\n' +\n ' • Help debug issues with production data insights\\n' +\n ' • Suggest fixes based on real error patterns\\n\\n' +\n \"This makes it easier to fix bugs by bringing Sentry's insights directly into your development workflow.\\n\\n\" +\n 'Learn more: ' +\n chalk.cyan('https://docs.sentry.io/product/sentry-mcp/'),\n ),\n );\n\n // Ask again after explanation\n const shouldAddAfterExplanation: boolean = await abortIfCancelled(\n clack.select({\n message: 'Would you like to configure MCP for your IDE now?',\n options: [\n { label: 'Yes', value: true },\n { label: 'No', value: false, hint: 'You can add it later anytime' },\n ],\n initialValue: true,\n }),\n );\n\n return shouldAddAfterExplanation;\n}\n\n/**\n * Offers to add a project-scoped MCP server configuration for the Sentry MCP.\n * Supports Cursor, VS Code, and Claude Code.\n * @param orgSlug - Optional organization slug to include in the MCP URL\n * @param projectSlug - Optional project slug to include in the MCP URL\n */\nexport async function offerProjectScopedMcpConfig(\n orgSlug?: string,\n projectSlug?: string,\n): Promise<void> {\n type InitialChoice = 'yes' | 'no' | 'explain';\n\n const initialChoice: InitialChoice = await abortIfCancelled(\n clack.select<\n { value: InitialChoice; label: string; hint?: string }[],\n InitialChoice\n >({\n message:\n 'Optionally add a project-scoped MCP server configuration for the Sentry MCP?',\n options: [\n { label: 'Yes', value: 'yes' },\n { label: 'No', value: 'no', hint: 'You can add it later anytime' },\n {\n label: 'What is MCP?',\n value: 'explain',\n hint: 'Learn about MCP benefits',\n },\n ],\n initialValue: 'yes',\n }),\n );\n\n let shouldAdd: boolean;\n\n if (initialChoice === 'explain') {\n Sentry.setTag('mcp-choice', 'explain');\n shouldAdd = await explainMCP();\n Sentry.setTag('mcp-configured-after-explain', shouldAdd);\n } else {\n shouldAdd = initialChoice === 'yes';\n Sentry.setTag('mcp-choice', initialChoice);\n }\n\n if (!shouldAdd) {\n Sentry.setTag('mcp-configured', false);\n return;\n }\n\n Sentry.setTag('mcp-configured', true);\n\n type EditorChoice =\n | 'cursor'\n | 'vscode'\n | 'claudeCode'\n | 'jetbrains'\n | 'other';\n const editor: EditorChoice = await abortIfCancelled(\n clack.select({\n message: 'Which editor do you want to configure?',\n options: [\n { value: 'cursor', label: 'Cursor (project .cursor/mcp.json)' },\n { value: 'vscode', label: 'VS Code (project .vscode/mcp.json)' },\n { value: 'claudeCode', label: 'Claude Code (project .mcp.json)' },\n {\n value: 'jetbrains',\n label: 'JetBrains IDE (WebStorm, IntelliJ IDEA, PyCharm, etc.)',\n hint: 'Manual configuration required',\n },\n {\n value: 'other',\n label: 'I use a different IDE',\n hint: \"We'll show you the configuration to copy\",\n },\n ],\n }),\n );\n\n // Track which editor was selected\n Sentry.setTag('mcp-editor', editor);\n\n try {\n switch (editor) {\n case 'cursor':\n await addCursorMcpConfig(orgSlug, projectSlug);\n clack.log.success('Added project-scoped Sentry MCP configuration.');\n clack.log.info(\n chalk.dim(\n 'Note: You may need to reload your editor for MCP changes to take effect.',\n ),\n );\n Sentry.setTag('mcp-config-success', true);\n break;\n case 'vscode':\n await addVsCodeMcpConfig(orgSlug, projectSlug);\n clack.log.success('Added project-scoped Sentry MCP configuration.');\n clack.log.info(\n chalk.dim(\n 'Note: You may need to reload your editor for MCP changes to take effect.',\n ),\n );\n Sentry.setTag('mcp-config-success', true);\n break;\n case 'claudeCode':\n await addClaudeCodeMcpConfig(orgSlug, projectSlug);\n clack.log.success('Added project-scoped Sentry MCP configuration.');\n clack.log.info(\n chalk.dim(\n 'Note: You may need to reload your editor for MCP changes to take effect.',\n ),\n );\n Sentry.setTag('mcp-config-success', true);\n break;\n case 'jetbrains':\n await showJetBrainsMcpConfig(orgSlug, projectSlug);\n Sentry.setTag('mcp-config-success', true);\n Sentry.setTag('mcp-config-manual', true);\n break;\n case 'other':\n await showGenericMcpConfig(orgSlug, projectSlug);\n Sentry.setTag('mcp-config-success', true);\n Sentry.setTag('mcp-config-manual', true);\n break;\n }\n } catch (e) {\n Sentry.setTag('mcp-config-success', false);\n Sentry.setTag('mcp-config-fallback', true);\n clack.log.warn(\n chalk.yellow(\n 'Failed to write MCP config automatically. Please copy/paste the snippet below into your project config file.',\n ),\n );\n // Fallback: show per-editor instructions\n if (editor === 'cursor') {\n await showCopyPasteInstructions({\n filename: path.join('.cursor', 'mcp.json'),\n codeSnippet: getCursorMcpJsonSnippet(orgSlug, projectSlug),\n hint: 'create the file if it does not exist',\n });\n } else if (editor === 'vscode') {\n await showCopyPasteInstructions({\n filename: path.join('.vscode', 'mcp.json'),\n codeSnippet: getVsCodeMcpJsonSnippet(orgSlug, projectSlug),\n hint: 'create the file if it does not exist',\n });\n } else if (editor === 'claudeCode') {\n await showCopyPasteInstructions({\n filename: '.mcp.json',\n codeSnippet: getClaudeCodeMcpJsonSnippet(orgSlug, projectSlug),\n hint: 'create the file if it does not exist',\n });\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- export declare const WIZARD_VERSION = "6.2.0";
1
+ export declare const WIZARD_VERSION = "6.3.0";
@@ -3,5 +3,5 @@
3
3
  // This is file is updated at release time.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.WIZARD_VERSION = void 0;
6
- exports.WIZARD_VERSION = '6.2.0';
6
+ exports.WIZARD_VERSION = '6.3.0';
7
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,2CAA2C;;;AAE9B,QAAA,cAAc,GAAG,OAAO,CAAC","sourcesContent":["// DO NOT modify this file manually!\n// This is file is updated at release time.\n\nexport const WIZARD_VERSION = '6.2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,2CAA2C;;;AAE9B,QAAA,cAAc,GAAG,OAAO,CAAC","sourcesContent":["// DO NOT modify this file manually!\n// This is file is updated at release time.\n\nexport const WIZARD_VERSION = '6.3.0';\n"]}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const vitest_1 = require("vitest");
4
4
  const angular_wizard_1 = require("../../src/angular/angular-wizard");
5
+ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
6
+ offerProjectScopedMcpConfig: vitest_1.vi.fn().mockResolvedValue(undefined),
7
+ }));
5
8
  (0, vitest_1.describe)('buildOutroMessage', () => {
6
9
  (0, vitest_1.it)('returns the correct outro message if example component was created', () => {
7
10
  (0, vitest_1.expect)((0, angular_wizard_1.buildOutroMessage)(true)).toMatchInlineSnapshot(`
@@ -1 +1 @@
1
- {"version":3,"file":"angular-wizard.test.js","sourceRoot":"","sources":["../../../test/angular/angular-wizard.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAE9C,qEAAqE;AAErE,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAA,WAAE,EAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,IAAA,eAAM,EAAC,IAAA,kCAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;KAQrD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,IAAA,WAAE,EAAC,6EAA6E,EAAE,GAAG,EAAE;QACrF,IAAA,eAAM,EAAC,IAAA,kCAAiB,EAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;KAMtD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from 'vitest';\n\nimport { buildOutroMessage } from '../../src/angular/angular-wizard';\n\ndescribe('buildOutroMessage', () => {\n it('returns the correct outro message if example component was created', () => {\n expect(buildOutroMessage(true)).toMatchInlineSnapshot(`\n \"\n Successfully installed the Sentry Angular SDK!\n\n You can validate your setup by starting your dev environment (ng serve) and throwing an error in the example component.\n\n Check out the SDK documentation for further configuration:\n https://docs.sentry.io/platforms/javascript/guides/angular/\"\n `);\n });\n it('returns the correct outro message if example component creation was skipped', () => {\n expect(buildOutroMessage(false)).toMatchInlineSnapshot(`\n \"\n Successfully installed the Sentry Angular SDK!\n\n Check out the SDK documentation for further configuration:\n https://docs.sentry.io/platforms/javascript/guides/angular/\"\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"angular-wizard.test.js","sourceRoot":"","sources":["../../../test/angular/angular-wizard.test.ts"],"names":[],"mappings":";;AAAA,mCAAkD;AAElD,qEAAqE;AAErE,WAAE,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,2BAA2B,EAAE,WAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;CAClE,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAA,WAAE,EAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,IAAA,eAAM,EAAC,IAAA,kCAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;;;KAQrD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,IAAA,WAAE,EAAC,6EAA6E,EAAE,GAAG,EAAE;QACrF,IAAA,eAAM,EAAC,IAAA,kCAAiB,EAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB,CAAC;;;;;;KAMtD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it, vi } from 'vitest';\n\nimport { buildOutroMessage } from '../../src/angular/angular-wizard';\n\nvi.mock('../../src/utils/clack/mcp-config', () => ({\n offerProjectScopedMcpConfig: vi.fn().mockResolvedValue(undefined),\n}));\n\ndescribe('buildOutroMessage', () => {\n it('returns the correct outro message if example component was created', () => {\n expect(buildOutroMessage(true)).toMatchInlineSnapshot(`\n \"\n Successfully installed the Sentry Angular SDK!\n\n You can validate your setup by starting your dev environment (ng serve) and throwing an error in the example component.\n\n Check out the SDK documentation for further configuration:\n https://docs.sentry.io/platforms/javascript/guides/angular/\"\n `);\n });\n it('returns the correct outro message if example component creation was skipped', () => {\n expect(buildOutroMessage(false)).toMatchInlineSnapshot(`\n \"\n Successfully installed the Sentry Angular SDK!\n\n Check out the SDK documentation for further configuration:\n https://docs.sentry.io/platforms/javascript/guides/angular/\"\n `);\n });\n});\n"]}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const vitest_1 = require("vitest");
4
4
  const templates_1 = require("../../src/apple/templates");
5
+ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
6
+ offerProjectScopedMcpConfig: vitest_1.vi.fn().mockResolvedValue(undefined),
7
+ }));
5
8
  (0, vitest_1.describe)('templates', () => {
6
9
  (0, vitest_1.describe)('getRunScriptTemplate', () => {
7
10
  const variations = [
@@ -1 +1 @@
1
- {"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,yDAMmC;AAEnC,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;QACpC,MAAM,UAAU,GAIV;YACJ;gBACE,YAAY,EAAE,IAAI;gBAClB,mBAAmB,EAAE,IAAI;gBACzB,cAAc,EAAE;;;;;;;;;;;;;;;CAevB;aACM;YACD;gBACE,YAAY,EAAE,IAAI;gBAClB,mBAAmB,EAAE,KAAK;gBAC1B,cAAc,EAAE;;;;;;;;;;;CAWvB;aACM;YACD;gBACE,YAAY,EAAE,KAAK;gBACnB,mBAAmB,EAAE,IAAI;gBACzB,cAAc,EAAE;;;;;;;;;;;;;;;CAevB;aACM;YACD;gBACE,YAAY,EAAE,KAAK;gBACnB,mBAAmB,EAAE,KAAK;gBAC1B,cAAc,EAAE;;;;;;;;;;;CAWvB;aACM;SACF,CAAC;QAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,IAAA,iBAAQ,EAAC,iBAAiB,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,6BAA6B,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE;gBACvI,IAAA,WAAE,EAAC,kCAAkC,EAAE,GAAG,EAAE;oBAC1C,WAAW;oBACX,MAAM,MAAM,GAAG,IAAA,gCAAoB,EACjC,UAAU,EACV,cAAc,EACd,SAAS,CAAC,YAAY,EACtB,SAAS,CAAC,mBAAmB,CAC9B,CAAC;oBAEF,eAAe;oBACf,IAAA,eAAM,EAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;gBACh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AAC;QACJ,CAAC,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,0BAAc,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAEjD,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BP,CACM,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,IAAA,WAAE,EAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAE/D,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;MAIF,CACC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from 'vitest';\nimport {\n getFastlaneSnippet,\n getObjcSnippet,\n getRunScriptTemplate,\n getSwiftSnippet,\n scriptInputPath,\n} from '../../src/apple/templates';\n\ndescribe('templates', () => {\n describe('getRunScriptTemplate', () => {\n const variations: {\n uploadSource: boolean;\n includeHomebrewPath: boolean;\n expectedScript: string;\n }[] = [\n {\n uploadSource: true,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n ];\n\n for (const variation of variations) {\n describe(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {\n it('should return the correct script', () => {\n // -- ct --\n const script = getRunScriptTemplate(\n 'test-org',\n 'test-project',\n variation.uploadSource,\n variation.includeHomebrewPath,\n );\n\n // -- Assert --\n expect(script).toBe(variation.expectedScript);\n });\n });\n }\n });\n\n describe('scriptInputPath', () => {\n it('should return the correct path', () => {\n expect(scriptInputPath).toBe(\n '\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"',\n );\n });\n });\n\n describe('getSwiftSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n options.debug = true // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = {\n $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.\n $0.lifecycle = .trace\n }\n\n // Uncomment the following lines to add more data to your events\n // options.attachScreenshot = true // This adds a screenshot to the error events\n // options.attachViewHierarchy = true // This adds the view hierarchy to the error events\n }\n // Remove the next line after confirming that your Sentry integration is working.\n SentrySDK.capture(message: \"This app uses Sentry! :)\")\n`,\n );\n });\n\n it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n options.debug = true // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = {\n $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.\n $0.lifecycle = .trace\n }\n\n // Uncomment the following lines to add more data to your events\n // options.attachScreenshot = true // This adds a screenshot to the error events\n // options.attachViewHierarchy = true // This adds the view hierarchy to the error events\n \n // Enable experimental logging features\n options.experimental.enableLogs = true\n }\n // Remove the next line after confirming that your Sentry integration is working.\n SentrySDK.capture(message: \"This app uses Sentry! :)\")\n`,\n );\n });\n });\n\n describe('getObjcSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n options.debug = YES; // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = @1.0;\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = ^(SentryProfileOptions *profiling) {\n profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.\n profiling.lifecycle = SentryProfilingLifecycleTrace;\n };\n\n //Uncomment the following lines to add more data to your events\n //options.attachScreenshot = YES; //This will add a screenshot to the error events\n //options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events\n }];\n //Remove the next line after confirming that your Sentry integration is working.\n [SentrySDK captureMessage:@\"This app uses Sentry!\"];\n`,\n );\n });\n\n it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n options.debug = YES; // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = @1.0;\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = ^(SentryProfileOptions *profiling) {\n profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.\n profiling.lifecycle = SentryProfilingLifecycleTrace;\n };\n\n //Uncomment the following lines to add more data to your events\n //options.attachScreenshot = YES; //This will add a screenshot to the error events\n //options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events\n \n // Enable experimental logging features\n options.experimental.enableLogs = YES;\n }];\n //Remove the next line after confirming that your Sentry integration is working.\n [SentrySDK captureMessage:@\"This app uses Sentry!\"];\n`,\n );\n });\n });\n\n describe('getFastlaneSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getFastlaneSnippet('test-org', 'test-project');\n\n // -- Assert --\n expect(snippet).toBe(\n ` sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )`,\n );\n });\n });\n});\n"]}
1
+ {"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/apple/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAAkD;AAClD,yDAMmC;AAEnC,WAAE,CAAC,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE,CAAC,CAAC;IACjD,2BAA2B,EAAE,WAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC;CAClE,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;IACzB,IAAA,iBAAQ,EAAC,sBAAsB,EAAE,GAAG,EAAE;Q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ACL,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,IAAA,WAAE,EAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,gBAAgB;YAChB,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YAE/D,eAAe;YACf,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CAClB;;;;MAIF,CACC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it, vi } from 'vitest';\nimport {\n getFastlaneSnippet,\n getObjcSnippet,\n getRunScriptTemplate,\n getSwiftSnippet,\n scriptInputPath,\n} from '../../src/apple/templates';\n\nvi.mock('../../src/utils/clack/mcp-config', () => ({\n offerProjectScopedMcpConfig: vi.fn().mockResolvedValue(undefined),\n}));\n\ndescribe('templates', () => {\n describe('getRunScriptTemplate', () => {\n const variations: {\n uploadSource: boolean;\n includeHomebrewPath: boolean;\n expectedScript: string;\n }[] = [\n {\n uploadSource: true,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: true,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload --include-sources \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: true,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n {\n uploadSource: false,\n includeHomebrewPath: false,\n expectedScript: `# This script is responsible for uploading debug symbols and source context for Sentry.\nif which sentry-cli >/dev/null; then\n export SENTRY_ORG=test-org\n export SENTRY_PROJECT=test-project\n ERROR=$(sentry-cli debug-files upload \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\n if [ ! $? -eq 0 ]; then\n echo \"warning: sentry-cli - $ERROR\"\n fi\nelse\n echo \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n`,\n },\n ];\n\n for (const variation of variations) {\n describe(`uploadSource: ${variation.uploadSource.toString()} and includeHomebrewPath: ${variation.includeHomebrewPath.toString()}`, () => {\n it('should return the correct script', () => {\n // -- ct --\n const script = getRunScriptTemplate(\n 'test-org',\n 'test-project',\n variation.uploadSource,\n variation.includeHomebrewPath,\n );\n\n // -- Assert --\n expect(script).toBe(variation.expectedScript);\n });\n });\n }\n });\n\n describe('scriptInputPath', () => {\n it('should return the correct path', () => {\n expect(scriptInputPath).toBe(\n '\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}\"',\n );\n });\n });\n\n describe('getSwiftSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n options.debug = true // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = {\n $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.\n $0.lifecycle = .trace\n }\n\n // Uncomment the following lines to add more data to your events\n // options.attachScreenshot = true // This adds a screenshot to the error events\n // options.attachViewHierarchy = true // This adds the view hierarchy to the error events\n }\n // Remove the next line after confirming that your Sentry integration is working.\n SentrySDK.capture(message: \"This app uses Sentry! :)\")\n`,\n );\n });\n\n it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getSwiftSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` SentrySDK.start { options in\n options.dsn = \"test-dsn\"\n options.debug = true // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = true\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = 1.0\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = {\n $0.sessionSampleRate = 1.0 // We recommend adjusting this value in production.\n $0.lifecycle = .trace\n }\n\n // Uncomment the following lines to add more data to your events\n // options.attachScreenshot = true // This adds a screenshot to the error events\n // options.attachViewHierarchy = true // This adds the view hierarchy to the error events\n \n // Enable experimental logging features\n options.experimental.enableLogs = true\n }\n // Remove the next line after confirming that your Sentry integration is working.\n SentrySDK.capture(message: \"This app uses Sentry! :)\")\n`,\n );\n });\n });\n\n describe('getObjcSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', false);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n options.debug = YES; // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = @1.0;\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = ^(SentryProfileOptions *profiling) {\n profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.\n profiling.lifecycle = SentryProfilingLifecycleTrace;\n };\n\n //Uncomment the following lines to add more data to your events\n //options.attachScreenshot = YES; //This will add a screenshot to the error events\n //options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events\n }];\n //Remove the next line after confirming that your Sentry integration is working.\n [SentrySDK captureMessage:@\"This app uses Sentry!\"];\n`,\n );\n });\n\n it('should return the correct snippet with logs enabled', () => {\n // -- Arrange --\n const snippet = getObjcSnippet('test-dsn', true);\n\n // -- Assert --\n expect(snippet).toBe(\n ` [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {\n options.dsn = @\"test-dsn\";\n options.debug = YES; // Enabled debug when first installing is always helpful\n\n // Adds IP for users.\n // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/\n options.sendDefaultPii = YES;\n\n // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.\n // We recommend adjusting this value in production.\n options.tracesSampleRate = @1.0;\n\n // Configure profiling. Visit https://docs.sentry.io/platforms/apple/profiling/ to learn more.\n options.configureProfiling = ^(SentryProfileOptions *profiling) {\n profiling.sessionSampleRate = 1.0; // We recommend adjusting this value in production.\n profiling.lifecycle = SentryProfilingLifecycleTrace;\n };\n\n //Uncomment the following lines to add more data to your events\n //options.attachScreenshot = YES; //This will add a screenshot to the error events\n //options.attachViewHierarchy = YES; //This will add the view hierarchy to the error events\n \n // Enable experimental logging features\n options.experimental.enableLogs = YES;\n }];\n //Remove the next line after confirming that your Sentry integration is working.\n [SentrySDK captureMessage:@\"This app uses Sentry!\"];\n`,\n );\n });\n });\n\n describe('getFastlaneSnippet', () => {\n it('should return the correct snippet', () => {\n // -- Arrange --\n const snippet = getFastlaneSnippet('test-org', 'test-project');\n\n // -- Assert --\n expect(snippet).toBe(\n ` sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )`,\n );\n });\n });\n});\n"]}
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const vitest_1 = require("vitest");
4
4
  const templates_1 = require("../../src/flutter/templates");
5
+ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
6
+ offerProjectScopedMcpConfig: vitest_1.vi.fn().mockResolvedValue(undefined),
7
+ }));
5
8
  (0, vitest_1.describe)('Flutter code templates', () => {
6
9
  (0, vitest_1.describe)('pubspec', () => {
7
10
  (0, vitest_1.it)('generates pubspec with project and org', () => {