@sentry/solidstart 10.53.1 → 10.55.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 (51) hide show
  1. package/build/cjs/client/sdk.js +3 -20
  2. package/build/cjs/client/sdk.js.map +1 -1
  3. package/build/cjs/config/addInstrumentation.js +28 -91
  4. package/build/cjs/config/addInstrumentation.js.map +1 -1
  5. package/build/cjs/config/withSentry.js +28 -52
  6. package/build/cjs/config/withSentry.js.map +1 -1
  7. package/build/cjs/config/wrapServerEntryWithDynamicImport.js +52 -170
  8. package/build/cjs/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  9. package/build/cjs/server/middleware.js +11 -22
  10. package/build/cjs/server/middleware.js.map +1 -1
  11. package/build/cjs/server/sdk.js +2 -7
  12. package/build/cjs/server/sdk.js.map +1 -1
  13. package/build/cjs/server/solidrouter.js +1 -20
  14. package/build/cjs/server/solidrouter.js.map +1 -1
  15. package/build/cjs/server/utils.js +6 -24
  16. package/build/cjs/server/utils.js.map +1 -1
  17. package/build/cjs/server/withServerActionInstrumentation.js +14 -31
  18. package/build/cjs/server/withServerActionInstrumentation.js.map +1 -1
  19. package/build/cjs/vite/buildInstrumentationFile.js +12 -22
  20. package/build/cjs/vite/buildInstrumentationFile.js.map +1 -1
  21. package/build/cjs/vite/sentrySolidStartVite.js +3 -15
  22. package/build/cjs/vite/sentrySolidStartVite.js.map +1 -1
  23. package/build/cjs/vite/sourceMaps.js +37 -89
  24. package/build/cjs/vite/sourceMaps.js.map +1 -1
  25. package/build/esm/client/sdk.js +3 -20
  26. package/build/esm/client/sdk.js.map +1 -1
  27. package/build/esm/config/addInstrumentation.js +28 -91
  28. package/build/esm/config/addInstrumentation.js.map +1 -1
  29. package/build/esm/config/withSentry.js +28 -52
  30. package/build/esm/config/withSentry.js.map +1 -1
  31. package/build/esm/config/wrapServerEntryWithDynamicImport.js +52 -170
  32. package/build/esm/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  33. package/build/esm/package.json +1 -1
  34. package/build/esm/server/middleware.js +11 -22
  35. package/build/esm/server/middleware.js.map +1 -1
  36. package/build/esm/server/sdk.js +2 -7
  37. package/build/esm/server/sdk.js.map +1 -1
  38. package/build/esm/server/solidrouter.js +1 -20
  39. package/build/esm/server/solidrouter.js.map +1 -1
  40. package/build/esm/server/utils.js +6 -24
  41. package/build/esm/server/utils.js.map +1 -1
  42. package/build/esm/server/withServerActionInstrumentation.js +14 -31
  43. package/build/esm/server/withServerActionInstrumentation.js.map +1 -1
  44. package/build/esm/vite/buildInstrumentationFile.js +12 -22
  45. package/build/esm/vite/buildInstrumentationFile.js.map +1 -1
  46. package/build/esm/vite/sentrySolidStartVite.js +3 -15
  47. package/build/esm/vite/sentrySolidStartVite.js.map +1 -1
  48. package/build/esm/vite/sourceMaps.js +37 -89
  49. package/build/esm/vite/sourceMaps.js.map +1 -1
  50. package/build/types/config/withSentry.d.ts.map +1 -1
  51. package/package.json +4 -4
@@ -2,56 +2,39 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, handleCallbackErrors, SPAN_STATUS_ERR
2
2
  import { getActiveSpan, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, startSpan, captureException } from '@sentry/node';
3
3
  import { isRedirect } from './utils.js';
4
4
 
5
- /**
6
- * Wraps a server action (functions that use the 'use server' directive)
7
- * function body with Sentry Error and Performance instrumentation.
8
- */
9
- async function withServerActionInstrumentation(
10
- serverActionName,
11
- callback,
12
- ) {
5
+ async function withServerActionInstrumentation(serverActionName, callback) {
13
6
  const activeSpan = getActiveSpan();
14
-
15
7
  if (activeSpan) {
16
8
  const spanData = spanToJSON(activeSpan).data;
17
-
18
- // In solid start, server function calls are made to `/_server` which doesn't tell us
19
- // a lot. We rewrite the span's route to be that of the sever action name but only
20
- // if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use
21
- // server actions (which are more meaningful, e.g. a request to `GET /users/5` is more
22
- // meaningful than overwriting it with `GET doSomeFunctionCall`).
23
- if (spanData && !spanData['http.route'] && spanData['http.target'] === '/_server') {
24
- activeSpan.setAttribute('http.route', serverActionName);
25
- activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'component');
9
+ if (spanData && !spanData["http.route"] && spanData["http.target"] === "/_server") {
10
+ activeSpan.setAttribute("http.route", serverActionName);
11
+ activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "component");
26
12
  }
27
13
  }
28
-
29
14
  try {
30
15
  return await startSpan(
31
16
  {
32
- op: 'function.server_action',
17
+ op: "function.server_action",
33
18
  name: serverActionName,
34
19
  attributes: {
35
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.solidstart',
36
- [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',
37
- },
20
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.solidstart",
21
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "component"
22
+ }
38
23
  },
39
- async span => {
40
- // oxlint-disable-next-line typescript/await-thenable -- callback may be async at runtime
41
- const result = await handleCallbackErrors(callback, error => {
24
+ async (span) => {
25
+ const result = await handleCallbackErrors(callback, (error) => {
42
26
  if (!isRedirect(error)) {
43
- span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
27
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
44
28
  captureException(error, {
45
29
  mechanism: {
46
30
  handled: false,
47
- type: 'auto.function.solidstart',
48
- },
31
+ type: "auto.function.solidstart"
32
+ }
49
33
  });
50
34
  }
51
35
  });
52
-
53
36
  return result;
54
- },
37
+ }
55
38
  );
56
39
  } finally {
57
40
  await flushIfServerless();
@@ -1 +1 @@
1
- {"version":3,"file":"withServerActionInstrumentation.js","sources":["../../../src/server/withServerActionInstrumentation.ts"],"sourcesContent":["import {\n flushIfServerless,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n} from '@sentry/core';\nimport { captureException, getActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, spanToJSON, startSpan } from '@sentry/node';\nimport { isRedirect } from './utils';\n\n/**\n * Wraps a server action (functions that use the 'use server' directive)\n * function body with Sentry Error and Performance instrumentation.\n */\nexport async function withServerActionInstrumentation<A extends (...args: unknown[]) => unknown>(\n serverActionName: string,\n callback: A,\n): Promise<ReturnType<A>> {\n const activeSpan = getActiveSpan();\n\n if (activeSpan) {\n const spanData = spanToJSON(activeSpan).data;\n\n // In solid start, server function calls are made to `/_server` which doesn't tell us\n // a lot. We rewrite the span's route to be that of the sever action name but only\n // if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use\n // server actions (which are more meaningful, e.g. a request to `GET /users/5` is more\n // meaningful than overwriting it with `GET doSomeFunctionCall`).\n if (spanData && !spanData['http.route'] && spanData['http.target'] === '/_server') {\n activeSpan.setAttribute('http.route', serverActionName);\n activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'component');\n }\n }\n\n try {\n return await startSpan(\n {\n op: 'function.server_action',\n name: serverActionName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.solidstart',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n },\n },\n async span => {\n // oxlint-disable-next-line typescript/await-thenable -- callback may be async at runtime\n const result = await handleCallbackErrors(callback, error => {\n if (!isRedirect(error)) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.solidstart',\n },\n });\n }\n });\n\n return result;\n },\n );\n } finally {\n await flushIfServerless();\n }\n}\n"],"names":[],"mappings":";;;;AASA;AACA;AACA;AACA;AACO,eAAe,+BAA+B;AACrD,EAAE,gBAAgB;AAClB,EAAE,QAAQ;AACV,EAA0B;AAC1B,EAAE,MAAM,UAAA,GAAa,aAA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"version":3,"file":"withServerActionInstrumentation.js","sources":["../../../src/server/withServerActionInstrumentation.ts"],"sourcesContent":["import {\n flushIfServerless,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n} from '@sentry/core';\nimport { captureException, getActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, spanToJSON, startSpan } from '@sentry/node';\nimport { isRedirect } from './utils';\n\n/**\n * Wraps a server action (functions that use the 'use server' directive)\n * function body with Sentry Error and Performance instrumentation.\n */\nexport async function withServerActionInstrumentation<A extends (...args: unknown[]) => unknown>(\n serverActionName: string,\n callback: A,\n): Promise<ReturnType<A>> {\n const activeSpan = getActiveSpan();\n\n if (activeSpan) {\n const spanData = spanToJSON(activeSpan).data;\n\n // In solid start, server function calls are made to `/_server` which doesn't tell us\n // a lot. We rewrite the span's route to be that of the sever action name but only\n // if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use\n // server actions (which are more meaningful, e.g. a request to `GET /users/5` is more\n // meaningful than overwriting it with `GET doSomeFunctionCall`).\n if (spanData && !spanData['http.route'] && spanData['http.target'] === '/_server') {\n activeSpan.setAttribute('http.route', serverActionName);\n activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'component');\n }\n }\n\n try {\n return await startSpan(\n {\n op: 'function.server_action',\n name: serverActionName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.solidstart',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n },\n },\n async span => {\n // oxlint-disable-next-line typescript/await-thenable -- callback may be async at runtime\n const result = await handleCallbackErrors(callback, error => {\n if (!isRedirect(error)) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.solidstart',\n },\n });\n }\n });\n\n return result;\n },\n );\n } finally {\n await flushIfServerless();\n }\n}\n"],"names":[],"mappings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@sentry/core';
2
2
  import * as fs from 'fs';
3
3
  import * as path from 'path';
4
4
 
5
- /**
6
- * A Sentry plugin for SolidStart to build the server
7
- * `instrument.server.ts` file.
8
- */
9
5
  function makeBuildInstrumentationFilePlugin(options = {}) {
10
6
  return {
11
- name: 'sentry-solidstart-build-instrumentation-file',
12
- apply: 'build',
13
- enforce: 'post',
7
+ name: "sentry-solidstart-build-instrumentation-file",
8
+ apply: "build",
9
+ enforce: "post",
14
10
  async config(config, { command }) {
15
- const instrumentationFilePath = options.instrumentation || './src/instrument.server.ts';
16
- const router = (config ).router;
11
+ const instrumentationFilePath = options.instrumentation || "./src/instrument.server.ts";
12
+ const router = config.router;
17
13
  const build = config.build || {};
18
14
  const rollupOptions = build.rollupOptions || {};
19
- const input = [...((rollupOptions.input || []) )];
20
-
21
- // plugin runs for client, server and sever-fns, we only want to run it for the server once.
22
- if (command !== 'build' || router.target !== 'server' || router.name === 'server-fns') {
15
+ const input = [...rollupOptions.input || []];
16
+ if (command !== "build" || router.target !== "server" || router.name === "server-fns") {
23
17
  return config;
24
18
  }
25
-
26
19
  try {
27
20
  await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);
28
21
  } catch (error) {
29
22
  consoleSandbox(() => {
30
- // eslint-disable-next-line no-console
31
23
  console.warn(
32
24
  `[Sentry SolidStart Plugin] Could not access \`${instrumentationFilePath}\`, please make sure it exists.`,
33
- error,
25
+ error
34
26
  );
35
27
  });
36
28
  return config;
37
29
  }
38
-
39
30
  input.push(path.resolve(router.root, instrumentationFilePath));
40
-
41
31
  return {
42
32
  ...config,
43
33
  build: {
44
34
  ...build,
45
35
  rollupOptions: {
46
36
  ...rollupOptions,
47
- input,
48
- },
49
- },
37
+ input
38
+ }
39
+ }
50
40
  };
51
- },
41
+ }
52
42
  };
53
43
  }
54
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"buildInstrumentationFile.js","sources":["../../../src/vite/buildInstrumentationFile.ts"],"sourcesContent":["import { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for SolidStart to build the server\n * `instrument.server.ts` file.\n */\nexport function makeBuildInstrumentationFilePlugin(options: SentrySolidStartPluginOptions = {}): Plugin {\n return {\n name: 'sentry-solidstart-build-instrumentation-file',\n apply: 'build',\n enforce: 'post',\n async config(config: UserConfig, { command }) {\n const instrumentationFilePath = options.instrumentation || './src/instrument.server.ts';\n const router = (config as UserConfig & { router: { target: string; name: string; root: string } }).router;\n const build = config.build || {};\n const rollupOptions = build.rollupOptions || {};\n const input = [...((rollupOptions.input || []) as string[])];\n\n // plugin runs for client, server and sever-fns, we only want to run it for the server once.\n if (command !== 'build' || router.target !== 'server' || router.name === 'server-fns') {\n return config;\n }\n\n try {\n await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);\n } catch (error) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry SolidStart Plugin] Could not access \\`${instrumentationFilePath}\\`, please make sure it exists.`,\n error,\n );\n });\n return config;\n }\n\n input.push(path.resolve(router.root, instrumentationFilePath));\n\n return {\n ...config,\n build: {\n ...build,\n rollupOptions: {\n ...rollupOptions,\n input,\n },\n },\n };\n },\n };\n}\n"],"names":[],"mappings":";;;;AAMA;AACA;AACA;AACA;AACO,SAAS,kCAAkC,CAAC,OAAO,GAAkC,EAAE,EAAU;AACxG,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,8CAA8C;AACxD,IAAI,KAAK,EAAE,OAAO;AAClB,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,MAAM,MAAM,CAAC,MAAM,EAAc,EAAE,OAAA,EAAS,EAAE;AAClD,MAAM,MAAM,uBAAA,GAA0B,OAAO,CAAC,eAAA,IAAmB,4BAA4B;AAC7F,MAAM,MAAM,MAAA,GAAS,CAAC,MAAA,GAAmF,MAAM;AAC/G,MAAM,MAAM,QAAQ,MAAM,CAAC,KAAA,IAAS,EAAE;AACtC,MAAM,MAAM,gBAAgB,KAAK,CAAC,aAAA,IAAiB,EAAE;AACrD,MAAM,MAAM,KAAA,GAAQ,CAAC,KAAK,aAAa,CAAC,SAAS,EAAE,GAAc,CAAC;;AAElE;AACA,MAAM,IAAI,OAAA,KAAY,OAAA,IAAW,MAAM,CAAC,MAAA,KAAW,YAAY,MAAM,CAAC,IAAA,KAAS,YAAY,EAAE;AAC7F,QAAQ,OAAO,MAAM;AACrB,MAAM;;AAEN,MAAM,IAAI;AACV,QAAQ,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,uBAAuB,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;AAC5E,MAAM,CAAA,CAAE,OAAO,KAAK,EAAE;AACtB,QAAQ,cAAc,CAAC,MAAM;AAC7B;AACA,UAAU,OAAO,CAAC,IAAI;AACtB,YAAY,CAAC,8CAA8C,EAAE,uBAAuB,CAAC,+BAA+B,CAAC;AACrH,YAAY,KAAK;AACjB,WAAW;AACX,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,MAAM;AACrB,MAAM;;AAEN,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC;;AAEpE,MAAM,OAAO;AACb,QAAQ,GAAG,MAAM;AACjB,QAAQ,KAAK,EAAE;AACf,UAAU,GAAG,KAAK;AAClB,UAAU,aAAa,EAAE;AACzB,YAAY,GAAG,aAAa;AAC5B,YAAY,KAAK;AACjB,WAAW;AACX,SAAS;AACT,OAAO;AACP,IAAI,CAAC;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"buildInstrumentationFile.js","sources":["../../../src/vite/buildInstrumentationFile.ts"],"sourcesContent":["import { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for SolidStart to build the server\n * `instrument.server.ts` file.\n */\nexport function makeBuildInstrumentationFilePlugin(options: SentrySolidStartPluginOptions = {}): Plugin {\n return {\n name: 'sentry-solidstart-build-instrumentation-file',\n apply: 'build',\n enforce: 'post',\n async config(config: UserConfig, { command }) {\n const instrumentationFilePath = options.instrumentation || './src/instrument.server.ts';\n const router = (config as UserConfig & { router: { target: string; name: string; root: string } }).router;\n const build = config.build || {};\n const rollupOptions = build.rollupOptions || {};\n const input = [...((rollupOptions.input || []) as string[])];\n\n // plugin runs for client, server and sever-fns, we only want to run it for the server once.\n if (command !== 'build' || router.target !== 'server' || router.name === 'server-fns') {\n return config;\n }\n\n try {\n await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);\n } catch (error) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry SolidStart Plugin] Could not access \\`${instrumentationFilePath}\\`, please make sure it exists.`,\n error,\n );\n });\n return config;\n }\n\n input.push(path.resolve(router.root, instrumentationFilePath));\n\n return {\n ...config,\n build: {\n ...build,\n rollupOptions: {\n ...rollupOptions,\n input,\n },\n },\n };\n },\n };\n}\n"],"names":[],"mappings":";;;;AAUO,SAAS,kCAAA,CAAmC,OAAA,GAAyC,EAAC,EAAW;AACtG,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,8CAAA;AAAA,IACN,KAAA,EAAO,OAAA;AAAA,IACP,OAAA,EAAS,MAAA;AAAA,IACT,MAAM,MAAA,CAAO,MAAA,EAAoB,EAAE,SAAQ,EAAG;AAC5C,MAAA,MAAM,uBAAA,GAA0B,QAAQ,eAAA,IAAmB,4BAAA;AAC3D,MAAA,MAAM,SAAU,MAAA,CAAmF,MAAA;AACnG,MAAA,MAAM,KAAA,GAAQ,MAAA,CAAO,KAAA,IAAS,EAAC;AAC/B,MAAA,MAAM,aAAA,GAAgB,KAAA,CAAM,aAAA,IAAiB,EAAC;AAC9C,MAAA,MAAM,QAAQ,CAAC,GAAK,aAAA,CAAc,KAAA,IAAS,EAAgB,CAAA;AAG3D,MAAA,IAAI,YAAY,OAAA,IAAW,MAAA,CAAO,WAAW,QAAA,IAAY,MAAA,CAAO,SAAS,YAAA,EAAc;AACrF,QAAA,OAAO,MAAA;AAAA,MACT;AAEA,MAAA,IAAI;AACF,QAAA,MAAM,GAAG,QAAA,CAAS,MAAA,CAAO,uBAAA,EAAyB,EAAA,CAAG,UAAU,IAAI,CAAA;AAAA,MACrE,SAAS,KAAA,EAAO;AACd,QAAA,cAAA,CAAe,MAAM;AAEnB,UAAA,OAAA,CAAQ,IAAA;AAAA,YACN,iDAAiD,uBAAuB,CAAA,+BAAA,CAAA;AAAA,YACxE;AAAA,WACF;AAAA,QACF,CAAC,CAAA;AACD,QAAA,OAAO,MAAA;AAAA,MACT;AAEA,MAAA,KAAA,CAAM,KAAK,IAAA,CAAK,OAAA,CAAQ,MAAA,CAAO,IAAA,EAAM,uBAAuB,CAAC,CAAA;AAE7D,MAAA,OAAO;AAAA,QACL,GAAG,MAAA;AAAA,QACH,KAAA,EAAO;AAAA,UACL,GAAG,KAAA;AAAA,UACH,aAAA,EAAe;AAAA,YACb,GAAG,aAAA;AAAA,YACH;AAAA;AACF;AACF,OACF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
@@ -1,38 +1,26 @@
1
1
  import { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile.js';
2
2
  import { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps.js';
3
3
 
4
- /**
5
- * Various Sentry vite plugins to be used for SolidStart.
6
- */
7
4
  const sentrySolidStartVite = (options = {}, viteConfig) => {
8
5
  const sentryPlugins = [];
9
-
10
- if (options.autoInjectServerSentry !== 'experimental_dynamic-import') {
6
+ if (options.autoInjectServerSentry !== "experimental_dynamic-import") {
11
7
  sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));
12
8
  }
13
-
14
- if (process.env.NODE_ENV !== 'development') {
9
+ if (process.env.NODE_ENV !== "development") {
15
10
  if (options.sourceMapsUploadOptions?.enabled ?? true) {
16
11
  const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);
17
12
  const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);
18
-
19
13
  sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);
20
14
  }
21
15
  }
22
-
23
16
  return sentryPlugins;
24
17
  };
25
-
26
- /**
27
- * Helper to add the Sentry SolidStart vite plugin to a vite config.
28
- */
29
18
  const addSentryPluginToVite = (config = {}, options) => {
30
19
  const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];
31
20
  plugins.unshift(sentrySolidStartVite(options, config));
32
-
33
21
  return {
34
22
  ...config,
35
- plugins,
23
+ plugins
36
24
  };
37
25
  };
38
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStartVite.js","sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite';\nimport { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * Various Sentry vite plugins to be used for SolidStart.\n */\nexport const sentrySolidStartVite = (options: SentrySolidStartPluginOptions = {}, viteConfig: UserConfig): Plugin[] => {\n const sentryPlugins: Plugin[] = [];\n\n if (options.autoInjectServerSentry !== 'experimental_dynamic-import') {\n sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));\n }\n\n if (process.env.NODE_ENV !== 'development') {\n if (options.sourceMapsUploadOptions?.enabled ?? true) {\n const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);\n const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);\n\n sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);\n }\n }\n\n return sentryPlugins;\n};\n\n/**\n * Helper to add the Sentry SolidStart vite plugin to a vite config.\n */\nexport const addSentryPluginToVite = (config: UserConfig = {}, options: SentrySolidStartPluginOptions): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACO,MAAM,oBAAA,GAAuB,CAAC,OAAO,GAAkC,EAAE,EAAE,UAAU,KAA2B;AACvH,EAAE,MAAM,aAAa,GAAa,EAAE;;AAEpC,EAAE,IAAI,OAAO,CAAC,sBAAA,KAA2B,6BAA6B,EAAE;AACxE,IAAI,aAAa,CAAC,IAAI,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;AACnE,EAAE;;AAEF,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAA,KAAa,aAAa,EAAE;AAC9C,IAAI,IAAI,OAAO,CAAC,uBAAuB,EAAE,OAAA,IAAW,IAAI,EAAE;AAC1D,MAAM,MAAM,mBAAmB,uBAAuB,CAAC,OAAO,EAAE,UAAU,CAAC;AAC3E,MAAM,MAAM,sBAAA,GAAyB,8BAA8B,CAAC,OAAO,CAAC;;AAE5E,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,EAAE,GAAG,sBAAsB,CAAC;AACxE,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,aAAa;AACtB;;AAEA;AACA;AACA;AACO,MAAM,qBAAA,GAAwB,CAAC,MAAM,GAAe,EAAE,EAAE,OAAO,KAAgD;AACtH,EAAE,MAAM,UAAU,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAA,GAAI,EAAE;AAC1E,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;;AAExD,EAAE,OAAO;AACT,IAAI,GAAG,MAAM;AACb,IAAI,OAAO;AACX,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"sentrySolidStartVite.js","sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import type { Plugin, UserConfig } from 'vite';\nimport { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * Various Sentry vite plugins to be used for SolidStart.\n */\nexport const sentrySolidStartVite = (options: SentrySolidStartPluginOptions = {}, viteConfig: UserConfig): Plugin[] => {\n const sentryPlugins: Plugin[] = [];\n\n if (options.autoInjectServerSentry !== 'experimental_dynamic-import') {\n sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));\n }\n\n if (process.env.NODE_ENV !== 'development') {\n if (options.sourceMapsUploadOptions?.enabled ?? true) {\n const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);\n const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);\n\n sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);\n }\n }\n\n return sentryPlugins;\n};\n\n/**\n * Helper to add the Sentry SolidStart vite plugin to a vite config.\n */\nexport const addSentryPluginToVite = (config: UserConfig = {}, options: SentrySolidStartPluginOptions): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"names":[],"mappings":";;;AAQO,MAAM,oBAAA,GAAuB,CAAC,OAAA,GAAyC,IAAI,UAAA,KAAqC;AACrH,EAAA,MAAM,gBAA0B,EAAC;AAEjC,EAAA,IAAI,OAAA,CAAQ,2BAA2B,6BAAA,EAA+B;AACpE,IAAA,aAAA,CAAc,IAAA,CAAK,kCAAA,CAAmC,OAAO,CAAC,CAAA;AAAA,EAChE;AAEA,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,aAAA,EAAe;AAC1C,IAAA,IAAI,OAAA,CAAQ,uBAAA,EAAyB,OAAA,IAAW,IAAA,EAAM;AACpD,MAAA,MAAM,gBAAA,GAAmB,uBAAA,CAAwB,OAAA,EAAS,UAAU,CAAA;AACpE,MAAA,MAAM,sBAAA,GAAyB,+BAA+B,OAAO,CAAA;AAErE,MAAA,aAAA,CAAc,IAAA,CAAK,GAAG,gBAAA,EAAkB,GAAG,sBAAsB,CAAA;AAAA,IACnE;AAAA,EACF;AAEA,EAAA,OAAO,aAAA;AACT;AAKO,MAAM,qBAAA,GAAwB,CAAC,MAAA,GAAqB,IAAI,OAAA,KAAuD;AACpH,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,OAAO,CAAA,GAAI,CAAC,GAAG,MAAA,CAAO,OAAO,CAAA,GAAI,EAAC;AACvE,EAAA,OAAA,CAAQ,OAAA,CAAQ,oBAAA,CAAqB,OAAA,EAAS,MAAM,CAAC,CAAA;AAErD,EAAA,OAAO;AAAA,IACL,GAAG,MAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
@@ -1,32 +1,18 @@
1
1
  import { sentryVitePlugin } from '@sentry/vite-plugin';
2
2
 
3
- /**
4
- * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.
5
- */
6
3
  function makeAddSentryVitePlugin(options, viteConfig) {
7
4
  const { authToken, debug, org, project, sourceMapsUploadOptions } = options;
8
-
9
- let updatedFilesToDeleteAfterUpload = undefined;
10
-
11
- if (
12
- typeof sourceMapsUploadOptions?.filesToDeleteAfterUpload === 'undefined' &&
13
- typeof sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload ===
14
- 'undefined' &&
15
- // Only if source maps were previously not set, we update the "filesToDeleteAfterUpload" (as we override the setting with "hidden")
16
- typeof viteConfig.build?.sourcemap === 'undefined'
17
- ) {
18
- // For .output, .vercel, .netlify etc.
19
- updatedFilesToDeleteAfterUpload = ['.*/**/*.map'];
20
-
21
- debug &&
22
- // eslint-disable-next-line no-console
23
- console.log(
24
- `[Sentry] Automatically setting \`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(
25
- updatedFilesToDeleteAfterUpload,
26
- )}\` to delete generated source maps after they were uploaded to Sentry.`,
27
- );
5
+ let updatedFilesToDeleteAfterUpload = void 0;
6
+ if (typeof sourceMapsUploadOptions?.filesToDeleteAfterUpload === "undefined" && typeof sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload === "undefined" && // Only if source maps were previously not set, we update the "filesToDeleteAfterUpload" (as we override the setting with "hidden")
7
+ typeof viteConfig.build?.sourcemap === "undefined") {
8
+ updatedFilesToDeleteAfterUpload = [".*/**/*.map"];
9
+ debug && // eslint-disable-next-line no-console
10
+ console.log(
11
+ `[Sentry] Automatically setting \`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(
12
+ updatedFilesToDeleteAfterUpload
13
+ )}\` to delete generated source maps after they were uploaded to Sentry.`
14
+ );
28
15
  }
29
-
30
16
  return [
31
17
  ...sentryVitePlugin({
32
18
  authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
@@ -35,103 +21,65 @@ function makeAddSentryVitePlugin(options, viteConfig) {
35
21
  org: org ?? process.env.SENTRY_ORG,
36
22
  project: project ?? process.env.SENTRY_PROJECT,
37
23
  sourcemaps: {
38
- filesToDeleteAfterUpload:
39
- (sourceMapsUploadOptions?.filesToDeleteAfterUpload ||
40
- sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload) ??
41
- updatedFilesToDeleteAfterUpload,
42
- ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps,
24
+ filesToDeleteAfterUpload: (sourceMapsUploadOptions?.filesToDeleteAfterUpload || sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload) ?? updatedFilesToDeleteAfterUpload,
25
+ ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps
43
26
  },
44
27
  telemetry: sourceMapsUploadOptions?.telemetry ?? true,
45
28
  _metaOptions: {
46
29
  telemetry: {
47
- metaFramework: 'solidstart',
48
- },
30
+ metaFramework: "solidstart"
31
+ }
49
32
  },
50
- ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions,
51
- }),
33
+ ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions
34
+ })
52
35
  ];
53
36
  }
54
-
55
- /**
56
- * A Sentry plugin for SolidStart to enable "hidden" source maps if they are unset.
57
- */
58
37
  function makeEnableSourceMapsVitePlugin(options) {
59
38
  return [
60
39
  {
61
- name: 'sentry-solidstart-update-source-map-setting',
62
- apply: 'build',
63
- enforce: 'post',
40
+ name: "sentry-solidstart-update-source-map-setting",
41
+ apply: "build",
42
+ enforce: "post",
64
43
  config(viteConfig) {
65
44
  return {
66
45
  ...viteConfig,
67
46
  build: {
68
47
  ...viteConfig.build,
69
- sourcemap: getUpdatedSourceMapSettings(viteConfig, options),
70
- },
48
+ sourcemap: getUpdatedSourceMapSettings(viteConfig, options)
49
+ }
71
50
  };
72
- },
73
- },
51
+ }
52
+ }
74
53
  ];
75
54
  }
76
-
77
- /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
78
- *
79
- * 1. User explicitly disabled source maps
80
- * - keep this setting (emit a warning that errors won't be unminified in Sentry)
81
- * - We won't upload anything
82
- *
83
- * 2. Users enabled source map generation (true, 'hidden', 'inline').
84
- * - keep this setting (don't do anything - like deletion - besides uploading)
85
- *
86
- * 3. Users didn't set source maps generation
87
- * - we enable 'hidden' source maps generation
88
- * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
89
- *
90
- * --> only exported for testing
91
- */
92
- function getUpdatedSourceMapSettings(
93
- viteConfig,
94
- sentryPluginOptions,
95
- ) {
55
+ function getUpdatedSourceMapSettings(viteConfig, sentryPluginOptions) {
96
56
  viteConfig.build = viteConfig.build || {};
97
-
98
57
  const viteSourceMap = viteConfig?.build?.sourcemap;
99
58
  let updatedSourceMapSetting = viteSourceMap;
100
-
101
- const settingKey = 'vite.build.sourcemap';
59
+ const settingKey = "vite.build.sourcemap";
102
60
  const debug = sentryPluginOptions?.debug;
103
-
104
61
  if (viteSourceMap === false) {
105
62
  updatedSourceMapSetting = viteSourceMap;
106
-
107
63
  if (debug) {
108
- // Longer debug message with more details
109
- // eslint-disable-next-line no-console
110
64
  console.warn(
111
- `[Sentry] Source map generation is currently disabled in your SolidStart configuration (\`${settingKey}: false \`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \`${settingKey}\` (e.g. by setting them to \`hidden\`).`,
65
+ `[Sentry] Source map generation is currently disabled in your SolidStart configuration (\`${settingKey}: false \`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \`${settingKey}\` (e.g. by setting them to \`hidden\`).`
112
66
  );
113
67
  } else {
114
- // eslint-disable-next-line no-console
115
- console.warn('[Sentry] Source map generation is disabled in your SolidStart configuration.');
68
+ console.warn("[Sentry] Source map generation is disabled in your SolidStart configuration.");
116
69
  }
117
- } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {
70
+ } else if (viteSourceMap && ["hidden", "inline", true].includes(viteSourceMap)) {
118
71
  updatedSourceMapSetting = viteSourceMap;
119
-
120
- debug &&
121
- // eslint-disable-next-line no-console
122
- console.log(
123
- `[Sentry] We discovered \`${settingKey}\` is set to \`${viteSourceMap.toString()}\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,
124
- );
72
+ debug && // eslint-disable-next-line no-console
73
+ console.log(
74
+ `[Sentry] We discovered \`${settingKey}\` is set to \`${viteSourceMap.toString()}\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`
75
+ );
125
76
  } else {
126
- updatedSourceMapSetting = 'hidden';
127
-
128
- debug &&
129
- // eslint-disable-next-line no-console
130
- console.log(
131
- `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`,
132
- );
77
+ updatedSourceMapSetting = "hidden";
78
+ debug && // eslint-disable-next-line no-console
79
+ console.log(
80
+ `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`
81
+ );
133
82
  }
134
-
135
83
  return updatedSourceMapSetting;
136
84
  }
137
85
 
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: SentrySolidStartPluginOptions, viteConfig: UserConfig): Plugin[] {\n const { authToken, debug, org, project, sourceMapsUploadOptions } = options;\n\n let updatedFilesToDeleteAfterUpload: string[] | undefined = undefined;\n\n if (\n typeof sourceMapsUploadOptions?.filesToDeleteAfterUpload === 'undefined' &&\n typeof sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload ===\n 'undefined' &&\n // Only if source maps were previously not set, we update the \"filesToDeleteAfterUpload\" (as we override the setting with \"hidden\")\n typeof viteConfig.build?.sourcemap === 'undefined'\n ) {\n // For .output, .vercel, .netlify etc.\n updatedFilesToDeleteAfterUpload = ['.*/**/*.map'];\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Automatically setting \\`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(\n updatedFilesToDeleteAfterUpload,\n )}\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return [\n ...sentryVitePlugin({\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations: options.bundleSizeOptimizations,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n sourcemaps: {\n filesToDeleteAfterUpload:\n (sourceMapsUploadOptions?.filesToDeleteAfterUpload ||\n sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload) ??\n updatedFilesToDeleteAfterUpload,\n ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps,\n },\n telemetry: sourceMapsUploadOptions?.telemetry ?? true,\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions,\n }),\n ];\n}\n\n/**\n * A Sentry plugin for SolidStart to enable \"hidden\" source maps if they are unset.\n */\nexport function makeEnableSourceMapsVitePlugin(options: SentrySolidStartPluginOptions): Plugin[] {\n return [\n {\n name: 'sentry-solidstart-update-source-map-setting',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n return {\n ...viteConfig,\n build: {\n ...viteConfig.build,\n sourcemap: getUpdatedSourceMapSettings(viteConfig, options),\n },\n };\n },\n },\n ];\n}\n\n/** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)\n *\n * 1. User explicitly disabled source maps\n * - keep this setting (emit a warning that errors won't be unminified in Sentry)\n * - We won't upload anything\n *\n * 2. Users enabled source map generation (true, 'hidden', 'inline').\n * - keep this setting (don't do anything - like deletion - besides uploading)\n *\n * 3. Users didn't set source maps generation\n * - we enable 'hidden' source maps generation\n * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n *\n * --> only exported for testing\n */\nexport function getUpdatedSourceMapSettings(\n viteConfig: UserConfig,\n sentryPluginOptions?: SentrySolidStartPluginOptions,\n): boolean | 'inline' | 'hidden' {\n viteConfig.build = viteConfig.build || {};\n\n const viteSourceMap = viteConfig?.build?.sourcemap;\n let updatedSourceMapSetting = viteSourceMap;\n\n const settingKey = 'vite.build.sourcemap';\n const debug = sentryPluginOptions?.debug;\n\n if (viteSourceMap === false) {\n updatedSourceMapSetting = viteSourceMap;\n\n if (debug) {\n // Longer debug message with more details\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your SolidStart configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Source map generation is disabled in your SolidStart configuration.');\n }\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n updatedSourceMapSetting = viteSourceMap;\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${viteSourceMap.toString()}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n } else {\n updatedSourceMapSetting = 'hidden';\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Enabled source map generation in the build options with \\`${settingKey}: 'hidden'\\`. The source maps will be deleted after they were uploaded to Sentry.`,\n );\n }\n\n return updatedSourceMapSetting;\n}\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAiC,UAAU,EAAwB;AAClH,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,uBAAA,EAAwB,GAAI,OAAO;;AAE7E,EAAE,IAAI,+BAA+B,GAAyB,SAAS;;AAEvE,EAAE;AACF,IAAI,OAAO,uBAAuB,EAAE,wBAAA,KAA6B,WAAA;AACjE,IAAI,OAAO,uBAAuB,EAAE,gCAAgC,EAAE,UAAU,EAAE,wBAAA;AAClF,MAAM,WAAA;AACN;AACA,IAAI,OAAO,UAAU,CAAC,KAAK,EAAE,cAAc;AAC3C,IAA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AyB,EAAE,UAAU,CAAC,eAAe,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,4GAA4G,CAAC;AACtM,OAAO;AACP,EAAE,OAAO;AACT,IAAI,uBAAA,GAA0B,QAAQ;;AAEtC,IAAI,KAAA;AACJ;AACA,MAAM,OAAO,CAAC,GAAG;AACjB,QAAQ,CAAC,mEAAmE,EAAE,UAAU,CAAC,kFAAkF,CAAC;AAC5K,OAAO;AACP,EAAE;;AAEF,EAAE,OAAO,uBAAuB;AAChC;;;;"}
1
+ {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: SentrySolidStartPluginOptions, viteConfig: UserConfig): Plugin[] {\n const { authToken, debug, org, project, sourceMapsUploadOptions } = options;\n\n let updatedFilesToDeleteAfterUpload: string[] | undefined = undefined;\n\n if (\n typeof sourceMapsUploadOptions?.filesToDeleteAfterUpload === 'undefined' &&\n typeof sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload ===\n 'undefined' &&\n // Only if source maps were previously not set, we update the \"filesToDeleteAfterUpload\" (as we override the setting with \"hidden\")\n typeof viteConfig.build?.sourcemap === 'undefined'\n ) {\n // For .output, .vercel, .netlify etc.\n updatedFilesToDeleteAfterUpload = ['.*/**/*.map'];\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Automatically setting \\`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(\n updatedFilesToDeleteAfterUpload,\n )}\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return [\n ...sentryVitePlugin({\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations: options.bundleSizeOptimizations,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n sourcemaps: {\n filesToDeleteAfterUpload:\n (sourceMapsUploadOptions?.filesToDeleteAfterUpload ||\n sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps?.filesToDeleteAfterUpload) ??\n updatedFilesToDeleteAfterUpload,\n ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions?.sourcemaps,\n },\n telemetry: sourceMapsUploadOptions?.telemetry ?? true,\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n ...sourceMapsUploadOptions?.unstable_sentryVitePluginOptions,\n }),\n ];\n}\n\n/**\n * A Sentry plugin for SolidStart to enable \"hidden\" source maps if they are unset.\n */\nexport function makeEnableSourceMapsVitePlugin(options: SentrySolidStartPluginOptions): Plugin[] {\n return [\n {\n name: 'sentry-solidstart-update-source-map-setting',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n return {\n ...viteConfig,\n build: {\n ...viteConfig.build,\n sourcemap: getUpdatedSourceMapSettings(viteConfig, options),\n },\n };\n },\n },\n ];\n}\n\n/** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)\n *\n * 1. User explicitly disabled source maps\n * - keep this setting (emit a warning that errors won't be unminified in Sentry)\n * - We won't upload anything\n *\n * 2. Users enabled source map generation (true, 'hidden', 'inline').\n * - keep this setting (don't do anything - like deletion - besides uploading)\n *\n * 3. Users didn't set source maps generation\n * - we enable 'hidden' source maps generation\n * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n *\n * --> only exported for testing\n */\nexport function getUpdatedSourceMapSettings(\n viteConfig: UserConfig,\n sentryPluginOptions?: SentrySolidStartPluginOptions,\n): boolean | 'inline' | 'hidden' {\n viteConfig.build = viteConfig.build || {};\n\n const viteSourceMap = viteConfig?.build?.sourcemap;\n let updatedSourceMapSetting = viteSourceMap;\n\n const settingKey = 'vite.build.sourcemap';\n const debug = sentryPluginOptions?.debug;\n\n if (viteSourceMap === false) {\n updatedSourceMapSetting = viteSourceMap;\n\n if (debug) {\n // Longer debug message with more details\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your SolidStart configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Source map generation is disabled in your SolidStart configuration.');\n }\n } else if (viteSourceMap && ['hidden', 'inline', true].includes(viteSourceMap)) {\n updatedSourceMapSetting = viteSourceMap;\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${viteSourceMap.toString()}\\`. Sentry will keep this source map setting. This will un-minify the code snippet on the Sentry Issue page.`,\n );\n } else {\n updatedSourceMapSetting = 'hidden';\n\n debug &&\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Enabled source map generation in the build options with \\`${settingKey}: 'hidden'\\`. The source maps will be deleted after they were uploaded to Sentry.`,\n );\n }\n\n return updatedSourceMapSetting;\n}\n"],"names":[],"mappings":";;AAOO,SAAS,uBAAA,CAAwB,SAAwC,UAAA,EAAkC;AAChH,EAAA,MAAM,EAAE,SAAA,EAAW,KAAA,EAAO,GAAA,EAAK,OAAA,EAAS,yBAAwB,GAAI,OAAA;AAEpE,EAAA,IAAI,+BAAA,GAAwD,MAAA;AAE5D,EAAA,IACE,OAAO,yBAAyB,wBAAA,KAA6B,WAAA,IAC7D,OAAO,uBAAA,EAAyB,gCAAA,EAAkC,YAAY,wBAAA,KAC5E,WAAA;AAAA,EAEF,OAAO,UAAA,CAAW,KAAA,EAAO,SAAA,KAAc,WAAA,EACvC;AAEA,IAAA,+BAAA,GAAkC,CAAC,aAAa,CAAA;AAEhD,IAAA,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;AAMnE,OAAO,KAAK,EAAgB,sBAAsB,EAAgC,MAAM,SAAS,CAAC;AAUlG;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,gBAAgB,EAAE,sBAAsB,YAAK,EAC7C,6BAA6B,EAAE,6BAA6B,GAC3D,sBAAsB,CA6CxB"}
1
+ {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../../src/config/withSentry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAMnE,OAAO,KAAK,EAAgB,sBAAsB,EAAgC,MAAM,SAAS,CAAC;AAUlG;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,gBAAgB,EAAE,sBAAsB,YAAK,EAC7C,6BAA6B,EAAE,6BAA6B,GAC3D,sBAAsB,CA+CxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/solidstart",
3
- "version": "10.53.1",
3
+ "version": "10.55.0",
4
4
  "description": "Official Sentry SDK for Solid Start",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/solidstart",
@@ -66,9 +66,9 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "@sentry/core": "10.53.1",
70
- "@sentry/node": "10.53.1",
71
- "@sentry/solid": "10.53.1",
69
+ "@sentry/core": "10.55.0",
70
+ "@sentry/node": "10.55.0",
71
+ "@sentry/solid": "10.55.0",
72
72
  "@sentry/vite-plugin": "^5.3.0"
73
73
  },
74
74
  "devDependencies": {