@sentry/wizard 6.8.0 → 6.9.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 +18 -0
- package/dist/e2e-tests/tests/nuxt-3.test.js +2 -4
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +2 -4
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/pnpm-workspace.test.js +2 -4
- package/dist/e2e-tests/tests/pnpm-workspace.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js +68 -84
- package/dist/e2e-tests/tests/sveltekit-hooks.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js +5 -4
- package/dist/e2e-tests/tests/sveltekit-tracing.test.js.map +1 -1
- package/dist/src/apple/fastlane.js +3 -1
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +1 -1
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.js +3 -5
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +6 -3
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.d.ts +1 -0
- package/dist/src/sveltekit/sdk-example.js +3 -1
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup/vite.js +5 -9
- package/dist/src/sveltekit/sdk-setup/vite.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +4 -2
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.d.ts +1 -0
- package/dist/src/sveltekit/templates.js +2 -4
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.d.ts +1 -1
- package/dist/src/sveltekit/utils.js +45 -32
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +8 -8
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +1 -1
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +35 -6
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +478 -0
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/sveltekit/utils.test.d.ts +1 -0
- package/dist/test/sveltekit/utils.test.js +68 -0
- package/dist/test/sveltekit/utils.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sveltekit/templates.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAIC;IAED,OAAO;;;;UAIC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;QACnB,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,MAAM;QACrB,CAAC,CAAC;;;;;;;;;uCASiC;QACnC,CAAC,CAAC,EACN;;;;;;;;;CASC,CAAC;AACF,CAAC;AAlDD,wDAkDC;AAED,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAIC,EACD,iBAA0B;IAE1B,MAAM,UAAU,GAAG,iBAAiB;QAClC,CAAC,CAAC;;;UAGI,GAAG;EAEX,gBAAgB,CAAC,WAAW;YAC1B,CAAC,CAAC;;CAEL;YACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;YACnB,CAAC,CAAC;;CAEL;YACG,CAAC,CAAC,EACN;;;;;;;;IAQI;QACA,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;EAEP,UAAU;;;;;;;CAOX,CAAC;AACF,CAAC;AAhDD,wDAgDC;AAED,SAAgB,gCAAgC,CAC9C,GAAW,EACX,gBAGC;IAED,OAAO;;;UAGC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;QACnB,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;;;IAGI,CAAC;AACL,CAAC;AA5BD,4EA4BC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CAAC,OAK1C;IACC,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU;QACvC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,iBAAiB,OAAO,CAAC,OAAO,oBAAoB,OAAO,CAAC,SAAS,EAAE;QACvF,CAAC,CAAC,WAAW,OAAO,CAAC,OAAO,8BAA8B,OAAO,CAAC,SAAS,EAAE,CAAC;IAEhF,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iGAiDwF,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkK9G,CAAC;AACF,CAAC;AA9ND,gEA8NC;AAED,SAAgB,wBAAwB;IACtC,OAAO;;;;;;CAMR,CAAC;AACF,CAAC;AARD,4DAQC","sourcesContent":["export function getClientHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n) {\n return `import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n${\n selectedFeatures.replay\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\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\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],`\n : ''\n}\n\n // Enable sending user PII (Personally Identifiable Information)\n // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii\n sendDefaultPii: true,\n});\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getServerHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n includeSentryInit: boolean,\n) {\n const sentryInit = includeSentryInit\n ? `import * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n\n // Enable sending user PII (Personally Identifiable Information)\n // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii\n sendDefaultPii: true,\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});`\n : ``;\n\n return `import { sequence } from \"@sveltejs/kit/hooks\";\nimport { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\n${sentryInit}\n\n// If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\nexport const handle = sequence(sentryHandle());\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getInstrumentationServerTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n logs: boolean;\n },\n) {\n return `import * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});`;\n}\n\n/**\n * +page.svelte with Sentry example\n */\nexport function getSentryExampleSveltePage(options: {\n selfHosted: boolean;\n url: string;\n orgSlug: string;\n projectId: string;\n}) {\n const issuesPageLink = options.selfHosted\n ? `${options.url}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `<!--\nThis is just a very simple page with a button to throw an example error.\nFeel free to delete this file and the entire sentry route.\n-->\n\n<script>\n import * as Sentry from '@sentry/sveltekit';\n import { onMount } from 'svelte';\n \n // Svelte Runes (requires Svelte 5)\n // let hasSentError = $state(false);\n let hasSentError = false;\n let isConnected = true;\n\n onMount(async () => {\n const result = await Sentry.diagnoseSdkConnectivity();\n isConnected = result !== 'sentry-unreachable';\n });\n\n function getSentryData() {\n Sentry.startSpan(\n {\n name: 'Example Frontend Span',\n op: 'test'\n },\n async () => {\n const res = await fetch('/sentry-example-page');\n if (!res.ok) {\n hasSentError = true;\n throw new Error('Sentry Example Frontend Error');\n }\n }\n );\n }\n</script>\n\n<title>sentry-example-page</title>\n\n<div>\n <main>\n <div class=\"flex-spacer\"></div>\n <svg height=\"40\" width=\"40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21.85 2.995a3.698 3.698 0 0 1 1.353 1.354l16.303 28.278a3.703 3.703 0 0 1-1.354 5.053 3.694 3.694 0 0 1-1.848.496h-3.828a31.149 31.149 0 0 0 0-3.09h3.815a.61.61 0 0 0 .537-.917L20.523 5.893a.61.61 0 0 0-1.057 0l-3.739 6.494a28.948 28.948 0 0 1 9.63 10.453 28.988 28.988 0 0 1 3.499 13.78v1.542h-9.852v-1.544a19.106 19.106 0 0 0-2.182-8.85 19.08 19.08 0 0 0-6.032-6.829l-1.85 3.208a15.377 15.377 0 0 1 6.382 12.484v1.542H3.696A3.694 3.694 0 0 1 0 34.473c0-.648.17-1.286.494-1.849l2.33-4.074a8.562 8.562 0 0 1 2.689 1.536L3.158 34.17a.611.611 0 0 0 .538.917h8.448a12.481 12.481 0 0 0-6.037-9.09l-1.344-.772 4.908-8.545 1.344.77a22.16 22.16 0 0 1 7.705 7.444 22.193 22.193 0 0 1 3.316 10.193h3.699a25.892 25.892 0 0 0-3.811-12.033 25.856 25.856 0 0 0-9.046-8.796l-1.344-.772 5.269-9.136a3.698 3.698 0 0 1 3.2-1.849c.648 0 1.285.17 1.847.495Z\" fill=\"currentcolor\"/>\n </svg>\n <h1>\n sentry-example-page\n </h1>\n\n <p class=\"description\">\n Click the button below, and view the sample error on the Sentry <a target=\"_blank\" href=\"${issuesPageLink}\">Issues Page</a>. \n For more details about setting up Sentry, <a target=\"_blank\" href=\"https://docs.sentry.io/platforms/javascript/guides/sveltekit/\">read our docs</a>.\n </p>\n\n <button\n type=\"button\"\n onclick={getSentryData}\n disabled={!isConnected}\n >\n <span>\n Throw Sample Error\n </span>\n </button>\n\n {#if hasSentError}\n <p class=\"success\">\n Sample error was sent to Sentry.\n </p>\n {:else if !isConnected}\n <div class=\"connectivity-error\">\n <p>It looks like network requests to Sentry are being blocked, which will prevent errors from being captured. Try disabling your ad-blocker to complete the test.</p>\n </div>\n {:else}\n <div class=\"success_placeholder\"></div>\n {/if}\n <div class=\"flex-spacer\"></div>\n </main>\n</div>\n\n<style>\n :global(body) {\n margin: 0;\n\n @media (prefers-color-scheme: dark) {\n color: #ededed;\n background-color: #0a0a0a;\n }\n }\n\n main {\n display: flex;\n min-height: 100vh;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n gap: 16px;\n margin: 0;\n padding: 16px;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif;\n }\n\n h1 {\n padding: 0px 4px;\n border-radius: 4px;\n background-color: rgba(24, 20, 35, 0.03);\n font-family: monospace;\n font-size: 20px;\n line-height: 1.2;\n }\n\n p {\n margin: 0;\n font-size: 20px;\n }\n\n a {\n color: #6341F0;\n text-decoration: underline;\n cursor: pointer;\n\n @media (prefers-color-scheme: dark) {\n color: #B3A1FF;\n }\n }\n\n button {\n border-radius: 8px;\n color: white;\n cursor: pointer;\n background-color: #553DB8;\n border: none;\n padding: 0;\n margin-top: 4px;\n\n & > span {\n display: inline-block;\n padding: 12px 16px;\n border-radius: inherit;\n font-size: 20px;\n font-weight: bold;\n line-height: 1;\n background-color: #7553FF;\n border: 1px solid #553DB8;\n transform: translateY(-4px);\n }\n\n &:hover > span {\n transform: translateY(-8px);\n }\n\n &:active > span {\n transform: translateY(0);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n\n & > span {\n transform: translateY(0);\n border: none;\n }\n }\n }\n\n .description {\n text-align: center;\n color: #6E6C75;\n max-width: 500px;\n line-height: 1.5;\n font-size: 20px;\n\n @media (prefers-color-scheme: dark) {\n color: #A49FB5;\n }\n }\n\n .flex-spacer {\n flex: 1;\n }\n\n .success {\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 20px;\n line-height: 1;\n background-color: #00F261;\n border: 1px solid #00BF4D;\n color: #181423;\n }\n\n .success_placeholder {\n height: 46px;\n }\n\n .connectivity-error {\n padding: 12px 16px;\n background-color: #E50045;\n border-radius: 8px;\n width: 500px;\n color: #FFFFFF;\n border: 1px solid #A80033;\n text-align: center;\n margin: 0;\n }\n \n .connectivity-error a {\n color: #FFFFFF;\n text-decoration: underline;\n }\n</style>\n`;\n}\n\nexport function getSentryExampleApiRoute() {\n return `// This is just a very simple API route that throws an example error.\n// Feel free to delete this file and the entire sentry route.\n\nexport const GET = async () => {\n throw new Error(\"Sentry Example API Route Error\");\n};\n`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/sveltekit/templates.ts"],"names":[],"mappings":";;;AAAA,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAIC;IAED,OAAO;;;;UAIC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;QACnB,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,MAAM;QACrB,CAAC,CAAC;;;;;;;;;uCASiC;QACnC,CAAC,CAAC,EACN;;;;;;;;;CASC,CAAC;AACF,CAAC;AAlDD,wDAkDC;AAED,SAAgB,sBAAsB,CACpC,GAAW,EACX,gBAIC,EACD,iBAA0B;IAE1B,MAAM,UAAU,GAAG,iBAAiB;QAClC,CAAC,CAAC;;;UAGI,GAAG;EAEX,gBAAgB,CAAC,WAAW;YAC1B,CAAC,CAAC;;CAEL;YACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;YACnB,CAAC,CAAC;;CAEL;YACG,CAAC,CAAC,EACN;;;;;;;;IAQI;QACA,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;;EAEP,UAAU;;;;;;;CAOX,CAAC;AACF,CAAC;AAhDD,wDAgDC;AAED,SAAgB,gCAAgC,CAC9C,GAAW,EACX,gBAGC;IAED,OAAO;;;UAGC,GAAG;EAEX,gBAAgB,CAAC,WAAW;QAC1B,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;EAEE,gBAAgB,CAAC,IAAI;QACnB,CAAC,CAAC;;CAEL;QACG,CAAC,CAAC,EACN;;;IAGI,CAAC;AACL,CAAC;AA5BD,4EA4BC;AAED;;GAEG;AACH,SAAgB,0BAA0B,CAAC,OAM1C;IACC,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU;QACvC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,iBAAiB,OAAO,CAAC,OAAO,oBAAoB,OAAO,CAAC,SAAS,EAAE;QACvF,CAAC,CAAC,WAAW,OAAO,CAAC,OAAO,8BAA8B,OAAO,CAAC,SAAS,EAAE,CAAC;IAEhF,OAAO;;;;;;;;;uBASc,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iGAsCwB,cAAc;;;;;;UAMrG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4J1C,CAAC;AACF,CAAC;AA7ND,gEA6NC;AAED,SAAgB,wBAAwB;IACtC,OAAO;;;;;;CAMR,CAAC;AACF,CAAC;AARD,4DAQC","sourcesContent":["export function getClientHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n) {\n return `import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\nimport * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n${\n selectedFeatures.replay\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\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\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],`\n : ''\n}\n\n // Enable sending user PII (Personally Identifiable Information)\n // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii\n sendDefaultPii: true,\n});\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getServerHooksTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n replay: boolean;\n logs: boolean;\n },\n includeSentryInit: boolean,\n) {\n const sentryInit = includeSentryInit\n ? `import * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n\n // Enable sending user PII (Personally Identifiable Information)\n // https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/options/#sendDefaultPii\n sendDefaultPii: true,\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});`\n : ``;\n\n return `import { sequence } from \"@sveltejs/kit/hooks\";\nimport { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\n${sentryInit}\n\n// If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\nexport const handle = sequence(sentryHandle());\n\n// If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\nexport const handleError = handleErrorWithSentry();\n`;\n}\n\nexport function getInstrumentationServerTemplate(\n dsn: string,\n selectedFeatures: {\n performance: boolean;\n logs: boolean;\n },\n) {\n return `import * as Sentry from '@sentry/sveltekit';\n\nSentry.init({\n dsn: '${dsn}',\n${\n selectedFeatures.performance\n ? `\n tracesSampleRate: 1.0,\n`\n : ''\n}\n${\n selectedFeatures.logs\n ? ` // Enable logs to be sent to Sentry\n enableLogs: true,\n`\n : ''\n}\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n});`;\n}\n\n/**\n * +page.svelte with Sentry example\n */\nexport function getSentryExampleSveltePage(options: {\n selfHosted: boolean;\n url: string;\n orgSlug: string;\n projectId: string;\n isUsingSvelte5: boolean;\n}) {\n const issuesPageLink = options.selfHosted\n ? `${options.url}organizations/${options.orgSlug}/issues/?project=${options.projectId}`\n : `https://${options.orgSlug}.sentry.io/issues/?project=${options.projectId}`;\n\n return `<!--\nThis is just a very simple page with a button to throw an example error.\nFeel free to delete this file and the entire sentry route.\n-->\n\n<script>\n import * as Sentry from '@sentry/sveltekit';\n import { onMount } from 'svelte';\n \n let hasSentError = ${options.isUsingSvelte5 ? '$state(false)' : 'false'};\n let isConnected = true;\n\n onMount(async () => {\n const result = await Sentry.diagnoseSdkConnectivity();\n isConnected = result !== 'sentry-unreachable';\n });\n\n function getSentryData() {\n Sentry.startSpan(\n {\n name: 'Example Frontend Span',\n op: 'test'\n },\n async () => {\n const res = await fetch('/sentry-example-page');\n if (!res.ok) {\n hasSentError = true;\n throw new Error('Sentry Example Frontend Error');\n }\n }\n );\n }\n</script>\n\n<title>sentry-example-page</title>\n\n<div>\n <main>\n <div class=\"flex-spacer\"></div>\n <svg height=\"40\" width=\"40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M21.85 2.995a3.698 3.698 0 0 1 1.353 1.354l16.303 28.278a3.703 3.703 0 0 1-1.354 5.053 3.694 3.694 0 0 1-1.848.496h-3.828a31.149 31.149 0 0 0 0-3.09h3.815a.61.61 0 0 0 .537-.917L20.523 5.893a.61.61 0 0 0-1.057 0l-3.739 6.494a28.948 28.948 0 0 1 9.63 10.453 28.988 28.988 0 0 1 3.499 13.78v1.542h-9.852v-1.544a19.106 19.106 0 0 0-2.182-8.85 19.08 19.08 0 0 0-6.032-6.829l-1.85 3.208a15.377 15.377 0 0 1 6.382 12.484v1.542H3.696A3.694 3.694 0 0 1 0 34.473c0-.648.17-1.286.494-1.849l2.33-4.074a8.562 8.562 0 0 1 2.689 1.536L3.158 34.17a.611.611 0 0 0 .538.917h8.448a12.481 12.481 0 0 0-6.037-9.09l-1.344-.772 4.908-8.545 1.344.77a22.16 22.16 0 0 1 7.705 7.444 22.193 22.193 0 0 1 3.316 10.193h3.699a25.892 25.892 0 0 0-3.811-12.033 25.856 25.856 0 0 0-9.046-8.796l-1.344-.772 5.269-9.136a3.698 3.698 0 0 1 3.2-1.849c.648 0 1.285.17 1.847.495Z\" fill=\"currentcolor\"/>\n </svg>\n <h1>\n sentry-example-page\n </h1>\n\n <p class=\"description\">\n Click the button below, and view the sample error on the Sentry <a target=\"_blank\" href=\"${issuesPageLink}\">Issues Page</a>. \n For more details about setting up Sentry, <a target=\"_blank\" href=\"https://docs.sentry.io/platforms/javascript/guides/sveltekit/\">read our docs</a>.\n </p>\n\n <button\n type=\"button\"\n on${options.isUsingSvelte5 ? '' : ':'}click={getSentryData}\n disabled={!isConnected}\n >\n <span>\n Throw Sample Error\n </span>\n </button>\n\n {#if hasSentError}\n <p class=\"success\">\n Sample error was sent to Sentry.\n </p>\n {:else if !isConnected}\n <div class=\"connectivity-error\">\n <p>It looks like network requests to Sentry are being blocked, which will prevent errors from being captured. Try disabling your ad-blocker to complete the test.</p>\n </div>\n {:else}\n <div class=\"success_placeholder\"></div>\n {/if}\n <div class=\"flex-spacer\"></div>\n </main>\n</div>\n\n<style>\n :global(body) {\n margin: 0;\n\n @media (prefers-color-scheme: dark) {\n color: #ededed;\n background-color: #0a0a0a;\n }\n }\n\n main {\n display: flex;\n min-height: 100vh;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n gap: 16px;\n margin: 0;\n padding: 16px;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", sans-serif;\n }\n\n h1 {\n padding: 0px 4px;\n border-radius: 4px;\n background-color: rgba(24, 20, 35, 0.03);\n font-family: monospace;\n font-size: 20px;\n line-height: 1.2;\n }\n\n p {\n margin: 0;\n font-size: 20px;\n }\n\n a {\n color: #6341F0;\n text-decoration: underline;\n cursor: pointer;\n\n @media (prefers-color-scheme: dark) {\n color: #B3A1FF;\n }\n }\n\n button {\n border-radius: 8px;\n color: white;\n cursor: pointer;\n background-color: #553DB8;\n border: none;\n padding: 0;\n margin-top: 4px;\n\n & > span {\n display: inline-block;\n padding: 12px 16px;\n border-radius: inherit;\n font-size: 20px;\n font-weight: bold;\n line-height: 1;\n background-color: #7553FF;\n border: 1px solid #553DB8;\n transform: translateY(-4px);\n }\n\n &:hover > span {\n transform: translateY(-8px);\n }\n\n &:active > span {\n transform: translateY(0);\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n\n & > span {\n transform: translateY(0);\n border: none;\n }\n }\n }\n\n .description {\n text-align: center;\n color: #6E6C75;\n max-width: 500px;\n line-height: 1.5;\n font-size: 20px;\n\n @media (prefers-color-scheme: dark) {\n color: #A49FB5;\n }\n }\n\n .flex-spacer {\n flex: 1;\n }\n\n .success {\n padding: 12px 16px;\n border-radius: 8px;\n font-size: 20px;\n line-height: 1;\n background-color: #00F261;\n border: 1px solid #00BF4D;\n color: #181423;\n }\n\n .success_placeholder {\n height: 46px;\n }\n\n .connectivity-error {\n padding: 12px 16px;\n background-color: #E50045;\n border-radius: 8px;\n width: 500px;\n color: #FFFFFF;\n border: 1px solid #A80033;\n text-align: center;\n margin: 0;\n }\n \n .connectivity-error a {\n color: #FFFFFF;\n text-decoration: underline;\n }\n</style>\n`;\n}\n\nexport function getSentryExampleApiRoute() {\n return `// This is just a very simple API route that throws an example error.\n// Feel free to delete this file and the entire sentry route.\n\nexport const GET = async () => {\n throw new Error(\"Sentry Example API Route Error\");\n};\n`;\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type KitVersionBucket = 'none' | 'invalid' | '0.x' | '>=1.0.0 <1.24.0' | '>=1.24.0 <2.31.0' | '>=2.31.0';
|
|
2
2
|
export declare function getKitVersionBucket(version: string | undefined): KitVersionBucket;
|
|
3
|
-
export declare function getSvelteVersionBucket(version: string | undefined): 'none' | 'invalid' | '<3.0.0' | '3.x' | '4.x' | '>
|
|
3
|
+
export declare function getSvelteVersionBucket(version: string | undefined): 'none' | 'invalid' | '<3.0.0' | '3.x' | '4.x' | '5.x' | '>5.x';
|
|
@@ -6,26 +6,31 @@ function getKitVersionBucket(version) {
|
|
|
6
6
|
if (!version) {
|
|
7
7
|
return 'none';
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
try {
|
|
10
|
+
const minVer = (0, semver_1.minVersion)(version);
|
|
11
|
+
if (!minVer) {
|
|
12
|
+
return 'invalid';
|
|
13
|
+
}
|
|
14
|
+
if ((0, semver_1.lt)(minVer, '1.0.0')) {
|
|
15
|
+
return '0.x';
|
|
16
|
+
}
|
|
17
|
+
else if ((0, semver_1.lt)(minVer, '1.24.0')) {
|
|
18
|
+
return '>=1.0.0 <1.24.0';
|
|
19
|
+
}
|
|
20
|
+
else if ((0, semver_1.lt)(minVer, '2.31.0')) {
|
|
21
|
+
// This is the version when the client-side invalidation fix was released
|
|
22
|
+
// https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.24.0
|
|
23
|
+
// https://github.com/sveltejs/kit/pull/10576
|
|
24
|
+
return '>=1.24.0 <2.31.0';
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// This is the version where sveltekit-native tracing and instrumentation was
|
|
28
|
+
// introduced as an experimental feature.
|
|
29
|
+
return '>=2.31.0';
|
|
30
|
+
}
|
|
18
31
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.24.0
|
|
22
|
-
// https://github.com/sveltejs/kit/pull/10576
|
|
23
|
-
return '>=1.24.0 <2.31.0';
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// This is the version where sveltekit-native tracing and instrumentation was
|
|
27
|
-
// introduced as an experimental feature.
|
|
28
|
-
return '>=2.31.0';
|
|
32
|
+
catch {
|
|
33
|
+
return 'invalid';
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
exports.getKitVersionBucket = getKitVersionBucket;
|
|
@@ -33,21 +38,29 @@ function getSvelteVersionBucket(version) {
|
|
|
33
38
|
if (!version) {
|
|
34
39
|
return 'none';
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
try {
|
|
42
|
+
const minVer = (0, semver_1.minVersion)(version);
|
|
43
|
+
if (!minVer) {
|
|
44
|
+
return 'invalid';
|
|
45
|
+
}
|
|
46
|
+
if ((0, semver_1.lt)(minVer, '3.0.0')) {
|
|
47
|
+
return '<3.0.0';
|
|
48
|
+
}
|
|
49
|
+
if ((0, semver_1.lt)(minVer, '4.0.0')) {
|
|
50
|
+
return '3.x';
|
|
51
|
+
}
|
|
52
|
+
if ((0, semver_1.lt)(minVer, '5.0.0')) {
|
|
53
|
+
return '4.x';
|
|
54
|
+
}
|
|
55
|
+
if ((0, semver_1.lt)(minVer, '6.0.0')) {
|
|
56
|
+
return '5.x';
|
|
57
|
+
}
|
|
58
|
+
// bucket for any future versions of svelte not covered by the other buckets
|
|
59
|
+
return '>5.x';
|
|
42
60
|
}
|
|
43
|
-
|
|
44
|
-
return '
|
|
45
|
-
}
|
|
46
|
-
if ((0, semver_1.lt)(minVer, '5.0.0')) {
|
|
47
|
-
return '4.x';
|
|
61
|
+
catch {
|
|
62
|
+
return 'invalid';
|
|
48
63
|
}
|
|
49
|
-
// Svelte 5 isn't released yet but it's being worked on
|
|
50
|
-
return '>4.x';
|
|
51
64
|
}
|
|
52
65
|
exports.getSvelteVersionBucket = getSvelteVersionBucket;
|
|
53
66
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sveltekit/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAUxC,SAAgB,mBAAmB,CACjC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/sveltekit/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAUxC,SAAgB,mBAAmB,CACjC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,IAAI;QACF,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;aAAM,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;YAC/B,OAAO,iBAAiB,CAAC;SAC1B;aAAM,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;YAC/B,yEAAyE;YACzE,0EAA0E;YAC1E,6CAA6C;YAC7C,OAAO,kBAAkB,CAAC;SAC3B;aAAM;YACL,6EAA6E;YAC7E,yCAAyC;YACzC,OAAO,UAAU,CAAC;SACnB;KACF;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AA9BD,kDA8BC;AAED,SAAgB,sBAAsB,CACpC,OAA2B;IAE3B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAED,IAAI;QACF,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YACvB,OAAO,QAAQ,CAAC;SACjB;QACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,IAAI,IAAA,WAAE,EAAC,MAAM,EAAE,OAAO,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QACD,4EAA4E;QAC5E,OAAO,MAAM,CAAC;KACf;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AA9BD,wDA8BC","sourcesContent":["import { lt, minVersion } from 'semver';\n\nexport type KitVersionBucket =\n | 'none'\n | 'invalid'\n | '0.x'\n | '>=1.0.0 <1.24.0'\n | '>=1.24.0 <2.31.0'\n | '>=2.31.0';\n\nexport function getKitVersionBucket(\n version: string | undefined,\n): KitVersionBucket {\n if (!version) {\n return 'none';\n }\n\n try {\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '1.0.0')) {\n return '0.x';\n } else if (lt(minVer, '1.24.0')) {\n return '>=1.0.0 <1.24.0';\n } else if (lt(minVer, '2.31.0')) {\n // This is the version when the client-side invalidation fix was released\n // https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%401.24.0\n // https://github.com/sveltejs/kit/pull/10576\n return '>=1.24.0 <2.31.0';\n } else {\n // This is the version where sveltekit-native tracing and instrumentation was\n // introduced as an experimental feature.\n return '>=2.31.0';\n }\n } catch {\n return 'invalid';\n }\n}\n\nexport function getSvelteVersionBucket(\n version: string | undefined,\n): 'none' | 'invalid' | '<3.0.0' | '3.x' | '4.x' | '5.x' | '>5.x' {\n if (!version) {\n return 'none';\n }\n\n try {\n const minVer = minVersion(version);\n if (!minVer) {\n return 'invalid';\n }\n\n if (lt(minVer, '3.0.0')) {\n return '<3.0.0';\n }\n if (lt(minVer, '4.0.0')) {\n return '3.x';\n }\n if (lt(minVer, '5.0.0')) {\n return '4.x';\n }\n if (lt(minVer, '6.0.0')) {\n return '5.x';\n }\n // bucket for any future versions of svelte not covered by the other buckets\n return '>5.x';\n } catch {\n return 'invalid';\n }\n}\n"]}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WIZARD_VERSION = "6.
|
|
1
|
+
export declare const WIZARD_VERSION = "6.9.0";
|
package/dist/src/version.js
CHANGED
package/dist/src/version.js.map
CHANGED
|
@@ -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.
|
|
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.9.0';\n"]}
|
|
@@ -248,7 +248,7 @@ end
|
|
|
248
248
|
});
|
|
249
249
|
});
|
|
250
250
|
(0, vitest_1.describe)('#addSentryToLane', () => {
|
|
251
|
-
(0, vitest_1.describe)('
|
|
251
|
+
(0, vitest_1.describe)('sentry_debug_files_upload is not present', () => {
|
|
252
252
|
(0, vitest_1.it)('should return original content', () => {
|
|
253
253
|
// -- Arrange --
|
|
254
254
|
const content = `
|
|
@@ -267,7 +267,7 @@ platform :ios do
|
|
|
267
267
|
lane :test do
|
|
268
268
|
puts 'Hello, world!'
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
sentry_debug_files_upload(
|
|
271
271
|
org_slug: 'test-org',
|
|
272
272
|
project_slug: 'test-project',
|
|
273
273
|
include_sources: true
|
|
@@ -277,7 +277,7 @@ end
|
|
|
277
277
|
`);
|
|
278
278
|
});
|
|
279
279
|
});
|
|
280
|
-
(0, vitest_1.describe)('
|
|
280
|
+
(0, vitest_1.describe)('sentry_debug_files_upload is present', () => {
|
|
281
281
|
(0, vitest_1.it)('should return updated content', () => {
|
|
282
282
|
// -- Arrange --
|
|
283
283
|
const content = `
|
|
@@ -285,11 +285,11 @@ platform :ios do
|
|
|
285
285
|
lane :test do
|
|
286
286
|
puts 'Hello, world!'
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
sentry_debug_files_upload(org_slug: 'test-org', project_slug: 'test-project')
|
|
289
289
|
end
|
|
290
290
|
end
|
|
291
291
|
`;
|
|
292
|
-
const lane = { index: 34, length:
|
|
292
|
+
const lane = { index: 34, length: 108, name: 'test' };
|
|
293
293
|
// -- Act --
|
|
294
294
|
const result = fastlane_1.exportForTesting.addSentryToLane(content, lane, 'test-org', 'test-project');
|
|
295
295
|
// -- Assert --
|
|
@@ -298,7 +298,7 @@ platform :ios do
|
|
|
298
298
|
lane :test do
|
|
299
299
|
puts 'Hello, world!'
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
sentry_debug_files_upload(
|
|
302
302
|
org_slug: 'test-org',
|
|
303
303
|
project_slug: 'test-project',
|
|
304
304
|
include_sources: true
|
|
@@ -385,7 +385,7 @@ platform :ios do
|
|
|
385
385
|
lane :test do
|
|
386
386
|
puts 'Hello, world!'
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
sentry_debug_files_upload(
|
|
389
389
|
org_slug: 'test-org',
|
|
390
390
|
project_slug: 'test-project',
|
|
391
391
|
include_sources: true
|
|
@@ -444,7 +444,7 @@ end
|
|
|
444
444
|
lane :beta do
|
|
445
445
|
puts 'Beta lane'
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
sentry_debug_files_upload(
|
|
448
448
|
org_slug: 'test-org',
|
|
449
449
|
project_slug: 'test-project',
|
|
450
450
|
include_sources: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastfile.test.js","sourceRoot":"","sources":["../../../test/apple/fastfile.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAClC,uDAIkC;AAClC,+EAA+E;AAC/E,sDAAwC;AACxC,mCAA8D;AAE9D,WAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,IAAI;IAChB,GAAG,CAAC,MAAM,WAAE,CAAC,YAAY,CAAe,gBAAgB,CAAC,CAAC;CAC3D,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,UAAU,EAAE,GAAG,EAAE;IACxB,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,WAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE;YAClD,WAAW;QACb,CAAC,CAAC,CAAC;QACH,WAAE,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;QACzB,IAAA,iBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;YAC3B,IAAA,WAAE,EAAC,oBAAoB,EAAE,GAAG,EAAE;gBAC5B,gBAAgB;gBAChB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,iBAAiB,EAAE,CAAC;gBACzD,MAAM,QAAQ,GAAG,cAAc,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;gBAE9D,YAAY;gBACZ,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,WAAW,CAAC,CAAC;gBAEr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:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport {\n addSentryToFastlane,\n exportForTesting,\n fastFile,\n} from '../../src/apple/fastlane';\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { beforeEach, describe, expect, it, vi } from 'vitest';\n\nvi.mock('@clack/prompts', async () => ({\n __esModule: true,\n ...(await vi.importActual<typeof clack>('@clack/prompts')),\n}));\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n vi.spyOn(clack.log, 'warn').mockImplementation(() => {\n /* empty */\n });\n vi.spyOn(clack, 'select').mockResolvedValue(undefined);\n });\n\n describe('#fastFile', () => {\n describe('file exists', () => {\n it('should return path', () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfile = createFastfile(fastlaneDir, 'lane :test do');\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBe(fastfile);\n });\n });\n\n describe('file does not exist', () => {\n it('should return null', () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n // do not create Fastfile\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n\n describe('#findIOSPlatform', () => {\n describe('platform block detection', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number };\n }[] = [\n {\n name: 'no platform',\n content: `lane :test do\nend`,\n expected: { index: 0, length: 17 },\n },\n {\n name: 'platform is ios',\n content: `platform: ios\nlane :test do\nend`,\n expected: { index: 0, length: 31 },\n },\n {\n name: 'platform is ios and other platform',\n content: `platform: ios\nend\nplatform: android\n lane :test do\n end`,\n expected: { index: 0, length: 57 },\n },\n {\n name: 'platform is ios and other platform',\n content: `\n\\t\\tplatform: ios\n\\t\\tend\n\\t\\tplatform: android\n\\t\\t\\tlane :test do\n\\t\\t\\tend`,\n expected: { index: 0, length: 66 },\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return null', () => {\n // -- Act --\n const result = exportForTesting.findIOSPlatform(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('platform block not found', () => {\n it('should return full content', () => {\n // -- Arrange --\n const content = `\n lane :test do\n puts 'Hello, world!'\n end`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 0, length: 65 });\n });\n });\n\n describe('invalid platform block', () => {\n it('should return null', () => {\n // -- Arrange --\n // platform block is not opened with `do`\n const content = `\nplatform :ios\\n\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('platform block is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('multiple platforms detected', () => {\n it('should return block with ios platform', () => {\n // -- Arrange --\n const content = `\nfastlane_version '2.53.1'\n\nbefore_all do\n ensure_git_branch\n ensure_git_status_clean\n git_pull\nend\n\nplatform :ios do\n # iOS Lanes\nend\n\nplatform :android do\n # Android Lanes\nend\n`;\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 121, length: 15 });\n });\n });\n });\n\n describe('#findLanes', () => {\n describe('lanes detection', () => {\n describe('valid cases', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number; name: string }[] | null;\n }[] = [\n {\n name: 'single lane',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n`,\n expected: [{ index: 17, length: 25, name: 'test' }],\n },\n {\n name: 'multiple lanes',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n lane :test2 do\n puts 'Hello, world!'\n end`,\n expected: [\n { index: 17, length: 25, name: 'test' },\n { index: 65, length: 25, name: 'test2' },\n ],\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return lanes', () => {\n // -- Act --\n const result = exportForTesting.findLanes(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('invalid cases', () => {\n describe('lane is not indented', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `lane :test do\\nend`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('lane is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = ` lane :test do\\n`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n });\n });\n\n describe('#addSentryToLane', () => {\n describe('sentry_cli is not present', () => {\n it('should return original content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n const lane = { index: 34, length: 25, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(`\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`);\n });\n });\n\n describe('sentry_cli is present', () => {\n it('should return updated content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(org_slug: 'test-org', project_slug: 'test-project')\n end\nend\n`;\n const lane = { index: 34, length: 92, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n });\n\n describe('#addSentryToFastlane', () => {\n const org = 'test-org';\n const project = 'test-project';\n\n describe('Fastfile not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n const fastfilePath = path.join(projectPath, 'Fastfile');\n // do not create Fastfile\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.existsSync(fastfilePath)).toBe(false);\n });\n });\n\n describe('platform not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n const originalContent = fs.readFileSync(fastfilePath, 'utf8');\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('no lanes', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n });\n\n it('should warn user', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(clack.log.warn).toHaveBeenCalledWith(\n 'No suitable lanes in your Fastfile.',\n );\n });\n });\n\n describe('single lane', () => {\n it('should return true', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n\n describe('multiple lanes', () => {\n let fastfilePath: string;\n let projectPath: string;\n let originalContent: string;\n\n beforeEach(() => {\n const createdFastlaneDir = createFastlaneDir();\n projectPath = createdFastlaneDir.projectPath;\n fastfilePath = createFastfile(\n createdFastlaneDir.fastlaneDir,\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n end\nend\n`,\n );\n });\n\n describe('no lane selected', () => {\n it('should not modify Fastfile', async () => {\n // -- Arrange --\n originalContent = fs.readFileSync(fastfilePath, 'utf8');\n vi.spyOn(clack, 'select').mockResolvedValue(undefined);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('lane selected', () => {\n it('should modify only selected lane', async () => {\n // -- Arrange --\n vi.spyOn(clack, 'select').mockResolvedValue({\n value: 'beta',\n index: 1,\n });\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n\n sentry_cli(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n expect(clack.select).toHaveBeenCalledWith({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n maxItems: expect.any(Number),\n message: 'Select lane to add Sentry to:',\n options: [\n { value: { value: 'test', index: 0 }, label: 'test' },\n { value: { value: 'beta', index: 1 }, label: 'beta' },\n ],\n });\n });\n });\n });\n });\n});\n\nfunction createFastlaneDir() {\n const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'test-project'));\n const fastlaneDir = path.join(projectPath, 'fastlane');\n fs.mkdirSync(fastlaneDir, {\n recursive: true,\n });\n return { fastlaneDir, projectPath };\n}\n\nfunction createFastfile(fastlaneDir: string, content: string) {\n const fastfile = path.join(fastlaneDir, 'Fastfile');\n fs.writeFileSync(fastfile, content);\n return fastfile;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"fastfile.test.js","sourceRoot":"","sources":["../../../test/apple/fastfile.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAClC,uDAIkC;AAClC,+EAA+E;AAC/E,sDAAwC;AACxC,mCAA8D;AAE9D,WAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE,IAAI;IAChB,GAAG,CAAC,MAAM,WAAE,CAAC,YAAY,CAAe,gBAAgB,CAAC,CAAC;CAC3D,CAAC,CAAC,CAAC;AAEJ,IAAA,iBAAQ,EAAC,UAAU,EAAE,GAAG,EAAE;IACxB,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,WAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE;YAClD,WAAW;QACb,CAAC,CAAC,CAAC;QACH,WAAE,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,IAAA,iBAAQ,EAAC,WAAW,EAAE,GAAG,EAAE;QACzB,IAAA,iBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;YAC3B,IAAA,WAAE,EAAC,oBAAoB,EAAE,GAAG,EAAE;gBAC5B,gBAAgB;gBAChB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,iBAAi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CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import * as fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport {\n addSentryToFastlane,\n exportForTesting,\n fastFile,\n} from '../../src/apple/fastlane';\n// @ts-expect-error - clack is ESM and TS complains about that. It works though\nimport * as clack from '@clack/prompts';\nimport { beforeEach, describe, expect, it, vi } from 'vitest';\n\nvi.mock('@clack/prompts', async () => ({\n __esModule: true,\n ...(await vi.importActual<typeof clack>('@clack/prompts')),\n}));\n\ndescribe('fastlane', () => {\n beforeEach(() => {\n vi.spyOn(clack.log, 'warn').mockImplementation(() => {\n /* empty */\n });\n vi.spyOn(clack, 'select').mockResolvedValue(undefined);\n });\n\n describe('#fastFile', () => {\n describe('file exists', () => {\n it('should return path', () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfile = createFastfile(fastlaneDir, 'lane :test do');\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBe(fastfile);\n });\n });\n\n describe('file does not exist', () => {\n it('should return null', () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n // do not create Fastfile\n\n // -- Act --\n const result = fastFile(projectPath);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n\n describe('#findIOSPlatform', () => {\n describe('platform block detection', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number };\n }[] = [\n {\n name: 'no platform',\n content: `lane :test do\nend`,\n expected: { index: 0, length: 17 },\n },\n {\n name: 'platform is ios',\n content: `platform: ios\nlane :test do\nend`,\n expected: { index: 0, length: 31 },\n },\n {\n name: 'platform is ios and other platform',\n content: `platform: ios\nend\nplatform: android\n lane :test do\n end`,\n expected: { index: 0, length: 57 },\n },\n {\n name: 'platform is ios and other platform',\n content: `\n\\t\\tplatform: ios\n\\t\\tend\n\\t\\tplatform: android\n\\t\\t\\tlane :test do\n\\t\\t\\tend`,\n expected: { index: 0, length: 66 },\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return null', () => {\n // -- Act --\n const result = exportForTesting.findIOSPlatform(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('platform block not found', () => {\n it('should return full content', () => {\n // -- Arrange --\n const content = `\n lane :test do\n puts 'Hello, world!'\n end`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 0, length: 65 });\n });\n });\n\n describe('invalid platform block', () => {\n it('should return null', () => {\n // -- Arrange --\n // platform block is not opened with `do`\n const content = `\nplatform :ios\\n\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('platform block is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n`;\n\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('multiple platforms detected', () => {\n it('should return block with ios platform', () => {\n // -- Arrange --\n const content = `\nfastlane_version '2.53.1'\n\nbefore_all do\n ensure_git_branch\n ensure_git_status_clean\n git_pull\nend\n\nplatform :ios do\n # iOS Lanes\nend\n\nplatform :android do\n # Android Lanes\nend\n`;\n // -- Act --\n const result = exportForTesting.findIOSPlatform(content);\n\n // -- Assert --\n expect(result).toEqual({ index: 121, length: 15 });\n });\n });\n });\n\n describe('#findLanes', () => {\n describe('lanes detection', () => {\n describe('valid cases', () => {\n const variations: {\n name: string;\n content: string;\n expected: { index: number; length: number; name: string }[] | null;\n }[] = [\n {\n name: 'single lane',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n`,\n expected: [{ index: 17, length: 25, name: 'test' }],\n },\n {\n name: 'multiple lanes',\n content: `\n lane :test do\n puts 'Hello, world!'\n end\n lane :test2 do\n puts 'Hello, world!'\n end`,\n expected: [\n { index: 17, length: 25, name: 'test' },\n { index: 65, length: 25, name: 'test2' },\n ],\n },\n ];\n\n for (const variation of variations) {\n describe(`${variation.name}`, () => {\n it('should return lanes', () => {\n // -- Act --\n const result = exportForTesting.findLanes(variation.content);\n\n // -- Assert --\n expect(result).toEqual(variation.expected);\n });\n });\n }\n });\n\n describe('invalid cases', () => {\n describe('lane is not indented', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = `lane :test do\\nend`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n\n describe('lane is not closed', () => {\n it('should return null', () => {\n // -- Arrange --\n const content = ` lane :test do\\n`;\n\n // -- Act --\n const result = exportForTesting.findLanes(content);\n\n // -- Assert --\n expect(result).toBeNull();\n });\n });\n });\n });\n });\n\n describe('#addSentryToLane', () => {\n describe('sentry_debug_files_upload is not present', () => {\n it('should return original content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`;\n const lane = { index: 34, length: 25, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(`\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`);\n });\n });\n\n describe('sentry_debug_files_upload is present', () => {\n it('should return updated content', () => {\n // -- Arrange --\n const content = `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_debug_files_upload(org_slug: 'test-org', project_slug: 'test-project')\n end\nend\n`;\n const lane = { index: 34, length: 108, name: 'test' };\n\n // -- Act --\n const result = exportForTesting.addSentryToLane(\n content,\n lane,\n 'test-org',\n 'test-project',\n );\n\n // -- Assert --\n expect(result).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n });\n\n describe('#addSentryToFastlane', () => {\n const org = 'test-org';\n const project = 'test-project';\n\n describe('Fastfile not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { projectPath } = createFastlaneDir();\n const fastfilePath = path.join(projectPath, 'Fastfile');\n // do not create Fastfile\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.existsSync(fastfilePath)).toBe(false);\n });\n });\n\n describe('platform not found', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n const originalContent = fs.readFileSync(fastfilePath, 'utf8');\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('no lanes', () => {\n it('should return false', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n });\n\n it('should warn user', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n createFastfile(fastlaneDir, `platform :ios`);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(clack.log.warn).toHaveBeenCalledWith(\n 'No suitable lanes in your Fastfile.',\n );\n });\n });\n\n describe('single lane', () => {\n it('should return true', async () => {\n // -- Arrange --\n const { fastlaneDir, projectPath } = createFastlaneDir();\n const fastfilePath = createFastfile(\n fastlaneDir,\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n end\nend\n`,\n );\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `\nplatform :ios do\n lane :test do\n puts 'Hello, world!'\n\n sentry_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n });\n });\n\n describe('multiple lanes', () => {\n let fastfilePath: string;\n let projectPath: string;\n let originalContent: string;\n\n beforeEach(() => {\n const createdFastlaneDir = createFastlaneDir();\n projectPath = createdFastlaneDir.projectPath;\n fastfilePath = createFastfile(\n createdFastlaneDir.fastlaneDir,\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n end\nend\n`,\n );\n });\n\n describe('no lane selected', () => {\n it('should not modify Fastfile', async () => {\n // -- Arrange --\n originalContent = fs.readFileSync(fastfilePath, 'utf8');\n vi.spyOn(clack, 'select').mockResolvedValue(undefined);\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(false);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(originalContent);\n });\n });\n\n describe('lane selected', () => {\n it('should modify only selected lane', async () => {\n // -- Arrange --\n vi.spyOn(clack, 'select').mockResolvedValue({\n value: 'beta',\n index: 1,\n });\n\n // -- Act --\n const result = await addSentryToFastlane(projectPath, org, project);\n\n // -- Assert --\n expect(result).toBe(true);\n expect(fs.readFileSync(fastfilePath, 'utf8')).toBe(\n `platform :ios do\n lane :test do\n puts 'Hello, world!'\n end\n\n lane :beta do\n puts 'Beta lane'\n\n sentry_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )\n end\nend\n`,\n );\n expect(clack.select).toHaveBeenCalledWith({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n maxItems: expect.any(Number),\n message: 'Select lane to add Sentry to:',\n options: [\n { value: { value: 'test', index: 0 }, label: 'test' },\n { value: { value: 'beta', index: 1 }, label: 'beta' },\n ],\n });\n });\n });\n });\n });\n});\n\nfunction createFastlaneDir() {\n const projectPath = fs.mkdtempSync(path.join(os.tmpdir(), 'test-project'));\n const fastlaneDir = path.join(projectPath, 'fastlane');\n fs.mkdirSync(fastlaneDir, {\n recursive: true,\n });\n return { fastlaneDir, projectPath };\n}\n\nfunction createFastfile(fastlaneDir: string, content: string) {\n const fastfile = path.join(fastlaneDir, 'Fastfile');\n fs.writeFileSync(fastfile, content);\n return fastfile;\n}\n"]}
|
|
@@ -228,7 +228,7 @@ fi
|
|
|
228
228
|
// -- Arrange --
|
|
229
229
|
const snippet = (0, templates_1.getFastlaneSnippet)('test-org', 'test-project');
|
|
230
230
|
// -- Assert --
|
|
231
|
-
(0, vitest_1.expect)(snippet).toBe(`
|
|
231
|
+
(0, vitest_1.expect)(snippet).toBe(` sentry_debug_files_upload(
|
|
232
232
|
org_slug: 'test-org',
|
|
233
233
|
project_slug: 'test-project',
|
|
234
234
|
include_sources: true
|
|
@@ -1 +1 @@
|
|
|
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;QACpC,MAAM,UAAU,GAIV;YACJ;gBACE,YAAY,EAAE,IAAI;gBAClB,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AG,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\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\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\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\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;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,cA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';\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\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\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\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\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_debug_files_upload(\n org_slug: 'test-org',\n project_slug: 'test-project',\n include_sources: true\n )`,\n );\n });\n });\n});\n"]}
|
|
@@ -338,9 +338,12 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
|
|
|
338
338
|
(0, vitest_1.expect)(template).toMatchInlineSnapshot(`
|
|
339
339
|
" modules: ["@sentry/nuxt/module"],
|
|
340
340
|
sentry: {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
org: "my-org",
|
|
342
|
+
project: "my-project",
|
|
343
|
+
sourcemaps: {
|
|
344
|
+
// This will delete all .map files in the build output after uploading them to Sentry. Modify as needed.
|
|
345
|
+
// For more information, see: https://docs.sentry.io/platforms/javascript/guides/nuxt/sourcemaps/
|
|
346
|
+
filesToDeleteAfterUpload: ['.*/**/*.map']
|
|
344
347
|
},
|
|
345
348
|
},
|
|
346
349
|
sourcemap: { client: "hidden" },"
|
|
@@ -356,9 +359,35 @@ vitest_1.vi.mock('../../src/utils/clack/mcp-config', () => ({
|
|
|
356
359
|
(0, vitest_1.expect)(template).toMatchInlineSnapshot(`
|
|
357
360
|
" modules: ["@sentry/nuxt/module"],
|
|
358
361
|
sentry: {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
org: "my-org",
|
|
363
|
+
project: "my-project",
|
|
364
|
+
sourcemaps: {
|
|
365
|
+
// This will delete all .map files in the build output after uploading them to Sentry. Modify as needed.
|
|
366
|
+
// For more information, see: https://docs.sentry.io/platforms/javascript/guides/nuxt/sourcemaps/
|
|
367
|
+
filesToDeleteAfterUpload: ['.*/**/*.map']
|
|
368
|
+
},
|
|
369
|
+
autoInjectServerSentry: "top-level-import",
|
|
370
|
+
},
|
|
371
|
+
sourcemap: { client: "hidden" },"
|
|
372
|
+
`);
|
|
373
|
+
});
|
|
374
|
+
(0, vitest_1.it)('generates configuration options for the nuxt config with top level import and self-hosted url', () => {
|
|
375
|
+
const template = (0, templates_1.getNuxtModuleFallbackTemplate)({
|
|
376
|
+
org: 'my-org',
|
|
377
|
+
project: 'my-project',
|
|
378
|
+
url: 'https://sentry.io',
|
|
379
|
+
selfHosted: true,
|
|
380
|
+
}, true);
|
|
381
|
+
(0, vitest_1.expect)(template).toMatchInlineSnapshot(`
|
|
382
|
+
" modules: ["@sentry/nuxt/module"],
|
|
383
|
+
sentry: {
|
|
384
|
+
org: "my-org",
|
|
385
|
+
project: "my-project",
|
|
386
|
+
url: "https://sentry.io",
|
|
387
|
+
sourcemaps: {
|
|
388
|
+
// This will delete all .map files in the build output after uploading them to Sentry. Modify as needed.
|
|
389
|
+
// For more information, see: https://docs.sentry.io/platforms/javascript/guides/nuxt/sourcemaps/
|
|
390
|
+
filesToDeleteAfterUpload: ['.*/**/*.map']
|
|
362
391
|
},
|
|
363
392
|
autoInjectServerSentry: "top-level-import",
|
|
364
393
|
},
|