@sentry/wizard 5.4.0 → 6.1.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 (79) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/e2e-tests/tests/angular-17.test.js +6 -0
  3. package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
  4. package/dist/e2e-tests/tests/angular-19.test.js +7 -1
  5. package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
  6. package/dist/e2e-tests/tests/nextjs-14.test.js +5 -1
  7. package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
  8. package/dist/e2e-tests/tests/nextjs-15.test.js +5 -1
  9. package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
  10. package/dist/e2e-tests/tests/nuxt-3.test.js +9 -1
  11. package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
  12. package/dist/e2e-tests/tests/nuxt-4.test.js +9 -1
  13. package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
  14. package/dist/e2e-tests/tests/remix.test.js +8 -2
  15. package/dist/e2e-tests/tests/remix.test.js.map +1 -1
  16. package/dist/e2e-tests/tests/sveltekit.test.js +15 -3
  17. package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
  18. package/dist/src/angular/angular-wizard.js +5 -0
  19. package/dist/src/angular/angular-wizard.js.map +1 -1
  20. package/dist/src/angular/codemods/main.d.ts +4 -1
  21. package/dist/src/angular/codemods/main.js +3 -0
  22. package/dist/src/angular/codemods/main.js.map +1 -1
  23. package/dist/src/angular/sdk-setup.d.ts +1 -0
  24. package/dist/src/angular/sdk-setup.js.map +1 -1
  25. package/dist/src/apple/xcode-manager.d.ts +5 -0
  26. package/dist/src/apple/xcode-manager.js +44 -40
  27. package/dist/src/apple/xcode-manager.js.map +1 -1
  28. package/dist/src/nextjs/nextjs-wizard.js +5 -0
  29. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  30. package/dist/src/nextjs/templates.d.ts +3 -0
  31. package/dist/src/nextjs/templates.js +15 -2
  32. package/dist/src/nextjs/templates.js.map +1 -1
  33. package/dist/src/nuxt/sdk-setup.js +5 -0
  34. package/dist/src/nuxt/sdk-setup.js.map +1 -1
  35. package/dist/src/nuxt/templates.d.ts +1 -0
  36. package/dist/src/nuxt/templates.js +3 -2
  37. package/dist/src/nuxt/templates.js.map +1 -1
  38. package/dist/src/remix/codemods/handle-error.js +3 -6
  39. package/dist/src/remix/codemods/handle-error.js.map +1 -1
  40. package/dist/src/remix/codemods/{root-common.d.ts → root.d.ts} +1 -0
  41. package/dist/src/remix/codemods/{root-v2.js → root.js} +47 -12
  42. package/dist/src/remix/codemods/root.js.map +1 -0
  43. package/dist/src/remix/remix-wizard.js +12 -5
  44. package/dist/src/remix/remix-wizard.js.map +1 -1
  45. package/dist/src/remix/sdk-setup.d.ts +8 -11
  46. package/dist/src/remix/sdk-setup.js +13 -18
  47. package/dist/src/remix/sdk-setup.js.map +1 -1
  48. package/dist/src/remix/templates.d.ts +2 -2
  49. package/dist/src/remix/templates.js +3 -3
  50. package/dist/src/remix/templates.js.map +1 -1
  51. package/dist/src/sveltekit/sdk-setup.js +11 -0
  52. package/dist/src/sveltekit/sdk-setup.js.map +1 -1
  53. package/dist/src/sveltekit/templates.d.ts +2 -0
  54. package/dist/src/sveltekit/templates.js +10 -0
  55. package/dist/src/sveltekit/templates.js.map +1 -1
  56. package/dist/src/version.d.ts +1 -1
  57. package/dist/src/version.js +1 -1
  58. package/dist/src/version.js.map +1 -1
  59. package/dist/test/nextjs/templates.test.js +119 -0
  60. package/dist/test/nextjs/templates.test.js.map +1 -1
  61. package/dist/test/nuxt/templates.test.js +119 -0
  62. package/dist/test/nuxt/templates.test.js.map +1 -1
  63. package/dist/test/remix/client-entry.test.js +56 -0
  64. package/dist/test/remix/client-entry.test.js.map +1 -1
  65. package/dist/test/remix/root.test.d.ts +1 -0
  66. package/dist/test/remix/root.test.js +31 -0
  67. package/dist/test/remix/root.test.js.map +1 -0
  68. package/dist/test/remix/server-instrumentation.test.js +37 -1
  69. package/dist/test/remix/server-instrumentation.test.js.map +1 -1
  70. package/dist/test/sveltekit/templates.test.js +67 -0
  71. package/dist/test/sveltekit/templates.test.js.map +1 -1
  72. package/package.json +1 -1
  73. package/dist/src/remix/codemods/root-common.js +0 -70
  74. package/dist/src/remix/codemods/root-common.js.map +0 -1
  75. package/dist/src/remix/codemods/root-v1.d.ts +0 -1
  76. package/dist/src/remix/codemods/root-v1.js +0 -52
  77. package/dist/src/remix/codemods/root-v1.js.map +0 -1
  78. package/dist/src/remix/codemods/root-v2.d.ts +0 -1
  79. package/dist/src/remix/codemods/root-v2.js.map +0 -1
@@ -1,52 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.instrumentRootRouteV1 = void 0;
31
- const path = __importStar(require("path"));
32
- // @ts-expect-error - clack is ESM and TS complains about that. It works though
33
- const prompts_1 = __importDefault(require("@clack/prompts"));
34
- const chalk_1 = __importDefault(require("chalk"));
35
- // @ts-expect-error - magicast is ESM and TS complains about that. It works though
36
- const magicast_1 = require("magicast");
37
- const root_common_1 = require("./root-common");
38
- async function instrumentRootRouteV1(rootFileName) {
39
- try {
40
- const rootRouteAst = await (0, magicast_1.loadFile)(path.join(process.cwd(), 'app', rootFileName));
41
- (0, root_common_1.wrapAppWithSentry)(rootRouteAst, rootFileName);
42
- await (0, magicast_1.writeFile)(rootRouteAst.$ast, path.join(process.cwd(), 'app', rootFileName));
43
- }
44
- catch (e) {
45
- // eslint-disable-next-line no-console
46
- console.error(e);
47
- prompts_1.default.log.warn(chalk_1.default.yellow(`Something went wrong writing to ${chalk_1.default.bold(rootFileName)}`));
48
- prompts_1.default.log.info(`Please put the following code snippet into ${chalk_1.default.bold(rootFileName)}: ${chalk_1.default.dim('You probably have to clean it up a bit.')}\n`);
49
- }
50
- }
51
- exports.instrumentRootRouteV1 = instrumentRootRouteV1;
52
- //# sourceMappingURL=root-v1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"root-v1.js","sourceRoot":"","sources":["../../../../src/remix/codemods/root-v1.ts"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,2CAA6B;AAE7B,+EAA+E;AAC/E,6DAAmC;AACnC,kDAA0B;AAE1B,kFAAkF;AAClF,uCAA+C;AAC/C,+CAAkD;AAE3C,KAAK,UAAU,qBAAqB,CACzC,YAAoB;IAEpB,IAAI;QACF,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAQ,EACjC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,CAC9C,CAAC;QAEF,IAAA,+BAAiB,EAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAE9C,MAAM,IAAA,oBAAS,EACb,YAAY,CAAC,IAAI,EACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,CAC9C,CAAC;KACH;IAAC,OAAO,CAAU,EAAE;QACnB,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,eAAK,CAAC,MAAM,CACV,mCAAmC,eAAK,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAC9D,CACF,CAAC;QACF,iBAAK,CAAC,GAAG,CAAC,IAAI,CACZ,8CAA8C,eAAK,CAAC,IAAI,CACtD,YAAY,CACb,KAAK,eAAK,CAAC,GAAG,CAAC,yCAAyC,CAAC,IAAI,CAC/D,CAAC;KACH;AACH,CAAC;AA5BD,sDA4BC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n\nimport * as path from 'path';\n\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport clack from '@clack/prompts';\nimport chalk from 'chalk';\n\n// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { loadFile, writeFile } from 'magicast';\nimport { wrapAppWithSentry } from './root-common';\n\nexport async function instrumentRootRouteV1(\n rootFileName: string,\n): Promise<void> {\n try {\n const rootRouteAst = await loadFile(\n path.join(process.cwd(), 'app', rootFileName),\n );\n\n wrapAppWithSentry(rootRouteAst, rootFileName);\n\n await writeFile(\n rootRouteAst.$ast,\n path.join(process.cwd(), 'app', rootFileName),\n );\n } catch (e: unknown) {\n // eslint-disable-next-line no-console\n console.error(e);\n clack.log.warn(\n chalk.yellow(\n `Something went wrong writing to ${chalk.bold(rootFileName)}`,\n ),\n );\n clack.log.info(\n `Please put the following code snippet into ${chalk.bold(\n rootFileName,\n )}: ${chalk.dim('You probably have to clean it up a bit.')}\\n`,\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export declare function instrumentRootRouteV2(rootFileName: string): Promise<void>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"root-v2.js","sourceRoot":"","sources":["../../../../src/remix/codemods/root-v2.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,sDAAsD;AACtD,0DAA0D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1D,+CAAiC;AACjC,2CAA6B;AAI7B,kFAAkF;AAClF,uCAA+C;AAE/C,4CAA0D;AAC1D,oCAA4C;AAC5C,+CAAkD;AAE3C,KAAK,UAAU,qBAAqB,CACzC,YAAoB;IAEpB,MAAM,YAAY,GAAG,MAAM,IAAA,mBAAQ,EACjC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,CAC9C,CAAC;IAEF,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,IAAe,CAAC;IAExD,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CACzC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,wBAAwB,CACrB,CAAC;IAE9B,IAAI,kBAAkB,GAAG,KAAK,CAAC;IAE/B,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACnC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAE5C,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,IAAI,WAAW,CAAC,IAAI,KAAK,qBAAqB,EAAE;YAC9C,IAAI,WAAW,CAAC,EAAE,EAAE,IAAI,KAAK,eAAe,EAAE;gBAC5C,kBAAkB,GAAG,IAAI,CAAC;aAC3B;SACF;aAAM,IAAI,WAAW,CAAC,IAAI,KAAK,qBAAqB,EAAE;YACrD,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC;YAE9C,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;gBACnC,+DAA+D;gBAC/D,IAAI,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uD;oBACvD,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAClC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACxC,CAAC,EACD,gBAAgB,CACjB,CAAC;iBACH;gBACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;SACF,CAAC,CAAC;KACJ;IAED,MAAM,IAAA,oBAAS,EACb,YAAY,CAAC,IAAI,EACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,CAAC,CAC9C,CAAC;AACJ,CAAC;AAvID,sDAuIC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n\nimport * as recast from 'recast';\nimport * as path from 'path';\n\nimport type { ExportNamedDeclaration, Program } from '@babel/types';\n\n// @ts-expect-error - magicast is ESM and TS complains about that. It works though\nimport { loadFile, writeFile } from 'magicast';\n\nimport { ERROR_BOUNDARY_TEMPLATE_V2 } from '../templates';\nimport { hasSentryContent } from '../utils';\nimport { wrapAppWithSentry } from './root-common';\n\nexport async function instrumentRootRouteV2(\n rootFileName: string,\n): Promise<void> {\n const rootRouteAst = await loadFile(\n path.join(process.cwd(), 'app', rootFileName),\n );\n\n const exportsAst = rootRouteAst.exports.$ast as Program;\n\n const namedExports = exportsAst.body.filter(\n (node) => node.type === 'ExportNamedDeclaration',\n ) as ExportNamedDeclaration[];\n\n let foundErrorBoundary = false;\n\n namedExports.forEach((namedExport) => {\n const declaration = namedExport.declaration;\n\n if (!declaration) {\n return;\n }\n\n if (declaration.type === 'FunctionDeclaration') {\n if (declaration.id?.name === 'ErrorBoundary') {\n foundErrorBoundary = true;\n }\n } else if (declaration.type === 'VariableDeclaration') {\n const declarations = declaration.declarations;\n\n declarations.forEach((declaration) => {\n // @ts-expect-error - id should always have a name in this case\n if (declaration.id?.name === 'ErrorBoundary') {\n foundErrorBoundary = true;\n }\n });\n }\n });\n\n if (!foundErrorBoundary) {\n rootRouteAst.imports.$add({\n from: '@sentry/remix',\n imported: 'captureRemixErrorBoundaryError',\n local: 'captureRemixErrorBoundaryError',\n });\n\n rootRouteAst.imports.$add({\n from: '@remix-run/react',\n imported: 'useRouteError',\n local: 'useRouteError',\n });\n\n recast.visit(rootRouteAst.$ast, {\n visitExportDefaultDeclaration(path) {\n const implementation = recast.parse(ERROR_BOUNDARY_TEMPLATE_V2).program\n .body[0];\n\n path.insertBefore(\n recast.types.builders.exportDeclaration(false, implementation),\n );\n\n this.traverse(path);\n },\n });\n // If there is already a ErrorBoundary export, and it doesn't have Sentry content\n } else if (!hasSentryContent(rootFileName, rootRouteAst.$code)) {\n rootRouteAst.imports.$add({\n from: '@sentry/remix',\n imported: 'captureRemixErrorBoundaryError',\n local: 'captureRemixErrorBoundaryError',\n });\n\n wrapAppWithSentry(rootRouteAst, rootFileName);\n\n recast.visit(rootRouteAst.$ast, {\n visitExportNamedDeclaration(path) {\n // Find ErrorBoundary export\n if (path.value.declaration?.id?.name === 'ErrorBoundary') {\n const errorBoundaryExport = path.value.declaration;\n\n let errorIdentifier;\n\n // check if useRouteError is called\n recast.visit(errorBoundaryExport, {\n visitVariableDeclaration(path) {\n const variableDeclaration = path.value.declarations[0];\n const initializer = variableDeclaration.init;\n\n if (\n initializer.type === 'CallExpression' &&\n initializer.callee.name === 'useRouteError'\n ) {\n errorIdentifier = variableDeclaration.id.name;\n }\n\n this.traverse(path);\n },\n });\n\n // We don't have an errorIdentifier, which means useRouteError is not called / imported\n // We need to add it and capture the error\n if (!errorIdentifier) {\n rootRouteAst.imports.$add({\n from: '@remix-run/react',\n imported: 'useRouteError',\n local: 'useRouteError',\n });\n\n const useRouteErrorCall = recast.parse(\n `const error = useRouteError();`,\n ).program.body[0];\n\n // Insert at the top of ErrorBoundary body\n errorBoundaryExport.body.body.splice(0, 0, useRouteErrorCall);\n }\n\n const captureErrorCall = recast.parse(\n `captureRemixErrorBoundaryError(error);`,\n ).program.body[0];\n\n // Insert just before the the fallback page is returned\n errorBoundaryExport.body.body.splice(\n errorBoundaryExport.body.body.length - 1,\n 0,\n captureErrorCall,\n );\n }\n this.traverse(path);\n },\n });\n }\n\n await writeFile(\n rootRouteAst.$ast,\n path.join(process.cwd(), 'app', rootFileName),\n );\n}\n"]}