@sentry/solidstart 11.12.0 → 11.14.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 (104) hide show
  1. package/build/cjs/_virtual/_rolldown/runtime.js +34 -0
  2. package/build/cjs/client/index.js +11 -18
  3. package/build/cjs/client/sdk.js +19 -20
  4. package/build/cjs/client/sdk.js.map +1 -1
  5. package/build/cjs/client/solidrouter.js +8 -16
  6. package/build/cjs/common/tunnel.js +11 -8
  7. package/build/cjs/common/tunnel.js.map +1 -1
  8. package/build/cjs/config/addInstrumentation.js +110 -111
  9. package/build/cjs/config/addInstrumentation.js.map +1 -1
  10. package/build/cjs/config/index.js +2 -0
  11. package/build/cjs/config/withSentry.js +86 -87
  12. package/build/cjs/config/withSentry.js.map +1 -1
  13. package/build/cjs/config/wrapServerEntryWithDynamicImport.js +139 -135
  14. package/build/cjs/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  15. package/build/cjs/index.client.js +12 -18
  16. package/build/cjs/index.server.js +162 -159
  17. package/build/cjs/index.server.js.map +1 -1
  18. package/build/cjs/nitro/tunnelPlugin.js +12 -10
  19. package/build/cjs/nitro/tunnelPlugin.js.map +1 -1
  20. package/build/cjs/server/index.js +151 -158
  21. package/build/cjs/server/middleware.js +26 -37
  22. package/build/cjs/server/middleware.js.map +1 -1
  23. package/build/cjs/server/sdk.js +13 -14
  24. package/build/cjs/server/sdk.js.map +1 -1
  25. package/build/cjs/server/solidrouter.js +26 -18
  26. package/build/cjs/server/solidrouter.js.map +1 -1
  27. package/build/cjs/server/utils.js +32 -27
  28. package/build/cjs/server/utils.js.map +1 -1
  29. package/build/cjs/server/withServerActionInstrumentation.js +46 -49
  30. package/build/cjs/server/withServerActionInstrumentation.js.map +1 -1
  31. package/build/cjs/solidrouter.client.js +9 -16
  32. package/build/cjs/solidrouter.js +12 -18
  33. package/build/cjs/solidrouter.server.js +3 -8
  34. package/build/cjs/vite/buildInstrumentationFile.js +46 -46
  35. package/build/cjs/vite/buildInstrumentationFile.js.map +1 -1
  36. package/build/cjs/vite/index.js +5 -10
  37. package/build/cjs/vite/sentrySolidStart.js +86 -39
  38. package/build/cjs/vite/sentrySolidStart.js.map +1 -1
  39. package/build/cjs/vite/sentrySolidStartVite.js +32 -35
  40. package/build/cjs/vite/sentrySolidStartVite.js.map +1 -1
  41. package/build/cjs/vite/sourceMaps.js +117 -152
  42. package/build/cjs/vite/sourceMaps.js.map +1 -1
  43. package/build/esm/client/index.js +2 -3
  44. package/build/esm/client/sdk.js +19 -18
  45. package/build/esm/client/sdk.js.map +1 -1
  46. package/build/esm/client/solidrouter.js +1 -2
  47. package/build/esm/common/tunnel.js +11 -6
  48. package/build/esm/common/tunnel.js.map +1 -1
  49. package/build/esm/config/addInstrumentation.js +107 -109
  50. package/build/esm/config/addInstrumentation.js.map +1 -1
  51. package/build/esm/config/index.js +1 -0
  52. package/build/esm/config/withSentry.js +86 -84
  53. package/build/esm/config/withSentry.js.map +1 -1
  54. package/build/esm/config/wrapServerEntryWithDynamicImport.js +139 -133
  55. package/build/esm/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  56. package/build/esm/index.client.js +3 -3
  57. package/build/esm/index.server.js +14 -10
  58. package/build/esm/index.server.js.map +1 -1
  59. package/build/esm/nitro/tunnelPlugin.js +12 -10
  60. package/build/esm/nitro/tunnelPlugin.js.map +1 -1
  61. package/build/esm/package.json +1 -1
  62. package/build/esm/server/index.js +7 -7
  63. package/build/esm/server/middleware.js +26 -35
  64. package/build/esm/server/middleware.js.map +1 -1
  65. package/build/esm/server/sdk.js +13 -12
  66. package/build/esm/server/sdk.js.map +1 -1
  67. package/build/esm/server/solidrouter.js +25 -16
  68. package/build/esm/server/solidrouter.js.map +1 -1
  69. package/build/esm/server/utils.js +32 -25
  70. package/build/esm/server/utils.js.map +1 -1
  71. package/build/esm/server/withServerActionInstrumentation.js +46 -47
  72. package/build/esm/server/withServerActionInstrumentation.js.map +1 -1
  73. package/build/esm/solidrouter.client.js +2 -2
  74. package/build/esm/solidrouter.js +3 -3
  75. package/build/esm/solidrouter.server.js +1 -2
  76. package/build/esm/vite/buildInstrumentationFile.js +43 -44
  77. package/build/esm/vite/buildInstrumentationFile.js.map +1 -1
  78. package/build/esm/vite/index.js +3 -3
  79. package/build/esm/vite/sentrySolidStart.js +86 -37
  80. package/build/esm/vite/sentrySolidStart.js.map +1 -1
  81. package/build/esm/vite/sentrySolidStartVite.js +32 -33
  82. package/build/esm/vite/sentrySolidStartVite.js.map +1 -1
  83. package/build/esm/vite/sourceMaps.js +117 -150
  84. package/build/esm/vite/sourceMaps.js.map +1 -1
  85. package/build/types/config/utils.d.ts.map +1 -1
  86. package/build/types/config/withSentry.d.ts.map +1 -1
  87. package/build/types/vite/sentrySolidStart.d.ts.map +1 -1
  88. package/package.json +20 -20
  89. package/build/cjs/client/index.js.map +0 -1
  90. package/build/cjs/client/solidrouter.js.map +0 -1
  91. package/build/cjs/index.client.js.map +0 -1
  92. package/build/cjs/server/index.js.map +0 -1
  93. package/build/cjs/solidrouter.client.js.map +0 -1
  94. package/build/cjs/solidrouter.js.map +0 -1
  95. package/build/cjs/solidrouter.server.js.map +0 -1
  96. package/build/cjs/vite/index.js.map +0 -1
  97. package/build/esm/client/index.js.map +0 -1
  98. package/build/esm/client/solidrouter.js.map +0 -1
  99. package/build/esm/index.client.js.map +0 -1
  100. package/build/esm/server/index.js.map +0 -1
  101. package/build/esm/solidrouter.client.js.map +0 -1
  102. package/build/esm/solidrouter.js.map +0 -1
  103. package/build/esm/solidrouter.server.js.map +0 -1
  104. package/build/esm/vite/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStart.js","sources":["../../../src/vite/sentrySolidStart.ts"],"sourcesContent":["import {\n type BuildTimeOptionsBase,\n _INTERNAL_normalizeTunnelBasePath as normalizeTunnelBasePath,\n warnOnRemovedBuildOptions,\n} from '@sentry/core';\nimport { setupSentryNitroModule } from '@sentry/nitro';\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeAddSentryVitePluginSolidStart2, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Build-time options for the Sentry SolidStart SDK on SolidStart 2.\n */\nexport type SentrySolidStartOptions = BuildTimeOptionsBase;\n\n/**\n * Vite plugins for the Sentry SolidStart SDK. Requires SolidStart 2.\n *\n * On SolidStart 1, use `withSentry` in `app.config.ts` instead.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { sentrySolidStart } from '@sentry/solidstart/vite';\n * import { solidStart } from '@solidjs/start/config';\n * import { nitro } from 'nitro/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [\n * solidStart(),\n * sentrySolidStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * nitro(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentrySolidStart(options: SentrySolidStartOptions = {}): Plugin[] {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const plugins: Plugin[] = [makeSentryNitroPlugin(options)];\n\n // Only the Nitro plugin is dev-safe; its module handles `dev` itself.\n if (process.env.NODE_ENV === 'development') {\n return plugins;\n }\n\n // Injects `diagnostics_channel` publishers into instrumented deps at build time, which is what\n // lets `Sentry.init()` run from a bundled Nitro plugin rather than an `--import` preload.\n plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));\n\n if (options.sourcemaps?.disable !== true) {\n plugins.push(...makeAddSentryVitePluginSolidStart2(options), ...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n\n// Nitro's `NitroConfig` only matches `@sentry/nitro`'s when both resolve the same `nitro` install,\n// which is not guaranteed, so the key stays opaque rather than coupling the two copies.\ntype ViteConfigWithNitro = UserConfig & {\n nitro?: Record<string, unknown>;\n server?: UserConfig['server'] & { baseURL?: string };\n};\n\n/**\n * Delivers everything only Nitro can reach — server source maps, runtime hooks, the\n * `sourcemapMinify` opt-out — through Vite's `nitro` key, and the app's base path to the browser SDK.\n *\n * `setupSentryNitroModule` is handed only the keys it reads, never the user's whole config, so what\n * comes back is purely Sentry's additions. Vite concatenates arrays when merging a `config` return\n * value, so echoing the user's own `modules`/`plugins` back would duplicate every entry.\n *\n * `enforce: 'pre'` is load-bearing: Nitro creates its instance inside its own `config` hook, so a\n * normal-priority hook sorting after it would be read too late and silently ignored.\n */\nfunction makeSentryNitroPlugin(options: SentrySolidStartOptions): Plugin {\n return {\n name: 'sentry-solidstart-nitro',\n enforce: 'pre',\n config(userConfig: ViteConfigWithNitro) {\n const userNitro = userConfig.nitro;\n // SolidStart serves the app under Vite's `base` (or `server.baseURL`), not Nitro's `baseURL`, so the browser\n // and the server both serve the managed tunnel under it.\n const tunnelBasePath = normalizeTunnelBasePath(userConfig.server?.baseURL || userConfig.base);\n\n return {\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n nitro: {\n ...(setupSentryNitroModule(\n // `sourcemap` decides whether Sentry enables its own; `tracingChannel` is left as the user set it.\n { sourcemap: userNitro?.sourcemap, tracingChannel: userNitro?.tracingChannel } as Parameters<\n typeof setupSentryNitroModule\n >[0],\n options,\n ) as Record<string, unknown>),\n // `@sentry/nitro` serves the tunnel under this instead of Nitro's `baseURL`.\n ...(tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }),\n },\n } as Omit<UserConfig, 'plugins'>;\n },\n };\n}\n"],"names":["normalizeTunnelBasePath"],"mappings":";;;;;AA2CO,SAAS,gBAAA,CAAiB,OAAA,GAAmC,EAAC,EAAa;AAChF,EAAA,yBAAA,CAA0B,OAAA,EAAS,CAAC,kCAAkC,CAAC,CAAA;AAEvE,EAAA,MAAM,OAAA,GAAoB,CAAC,qBAAA,CAAsB,OAAO,CAAC,CAAA;AAGzD,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,aAAA,EAAe;AAC1C,IAAA,OAAO,OAAA;AAAA,EACT;AAIA,EAAA,OAAA,CAAQ,KAAK,uBAAA,CAAwB,EAAE,0BAA0B,OAAA,CAAQ,wBAAA,EAA0B,CAAC,CAAA;AAEpG,EAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,OAAA,KAAY,IAAA,EAAM;AACxC,IAAA,OAAA,CAAQ,IAAA,CAAK,GAAG,kCAAA,CAAmC,OAAO,GAAG,GAAG,8BAAA,CAA+B,OAAO,CAAC,CAAA;AAAA,EACzG;AAEA,EAAA,OAAO,OAAA;AACT;AAoBA,SAAS,sBAAsB,OAAA,EAA0C;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,yBAAA;AAAA,IACN,OAAA,EAAS,KAAA;AAAA,IACT,OAAO,UAAA,EAAiC;AACtC,MAAA,MAAM,YAAY,UAAA,CAAW,KAAA;AAG7B,MAAA,MAAM,iBAAiBA,iCAAA,CAAwB,UAAA,CAAW,MAAA,EAAQ,OAAA,IAAW,WAAW,IAAI,CAAA;AAE5F,MAAA,OAAO;AAAA,QACL,QAAQ,EAAE,sCAAA,EAAwC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAA,EAAE;AAAA,QACjF,KAAA,EAAO;AAAA,UACL,GAAI,sBAAA;AAAA;AAAA,YAEF,EAAE,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,cAAA,EAAgB,WAAW,cAAA,EAAe;AAAA,YAG7E;AAAA,WACF;AAAA;AAAA,UAEA,GAAI,cAAA,IAAkB,EAAE,eAAe,EAAE,oBAAA,EAAsB,gBAAe;AAAE;AAClF,OACF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"sentrySolidStart.js","names":["normalizeTunnelBasePath"],"sources":["../../../src/vite/sentrySolidStart.ts"],"sourcesContent":["import {\n _INTERNAL_normalizeTunnelBasePath as normalizeTunnelBasePath,\n type BuildTimeOptionsBase,\n stringifyForCodeInjection,\n warnOnRemovedBuildOptions,\n} from '@sentry/core';\nimport { setupSentryNitroModule } from '@sentry/nitro';\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeAddSentryVitePluginSolidStart2, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Build-time options for the Sentry SolidStart SDK on SolidStart 2.\n */\nexport type SentrySolidStartOptions = BuildTimeOptionsBase;\n\n/**\n * Vite plugins for the Sentry SolidStart SDK. Requires SolidStart 2.\n *\n * On SolidStart 1, use `withSentry` in `app.config.ts` instead.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { sentrySolidStart } from '@sentry/solidstart/vite';\n * import { solidStart } from '@solidjs/start/config';\n * import { nitro } from 'nitro/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [\n * solidStart(),\n * sentrySolidStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * nitro(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentrySolidStart(options: SentrySolidStartOptions = {}): Plugin[] {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const plugins: Plugin[] = [makeSentryNitroPlugin(options), makeServerEntryPlugin()];\n\n // Only the Nitro and server entry plugins are dev-safe; the Nitro module handles `dev` itself.\n if (process.env.NODE_ENV === 'development') {\n return plugins;\n }\n\n // Injects `diagnostics_channel` publishers into instrumented deps at build time, which is what\n // lets `Sentry.init()` run from a bundled Nitro plugin rather than an `--import` preload.\n plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));\n\n if (options.sourcemaps?.disable !== true) {\n plugins.push(...makeAddSentryVitePluginSolidStart2(options), ...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n\nconst SERVER_RUNTIME_CONDITION = 'sentry-solidstart-runtime';\n\n/**\n * Resolves `@sentry/solidstart` in server environments to the entry without the deprecated SolidStart 1\n * `withSentry`. Its build-time imports (Sentry CLI, oxc-parser) otherwise end up in the server output:\n * Nitro traces their native files, and Rolldown still emits the CLI's dynamic-import chunks after\n * tree-shaking the code that imports them.\n */\nfunction makeServerEntryPlugin(): Plugin {\n return {\n name: 'sentry-solidstart-server-entry',\n configEnvironment(name, config) {\n // Vite concatenates the returned conditions onto these. If none are set yet, returning one would\n // replace Vite's defaults, so leave resolution alone.\n if (name === 'client' || config.consumer === 'client' || !config.resolve?.conditions) {\n return;\n }\n\n return { resolve: { conditions: [SERVER_RUNTIME_CONDITION] } };\n },\n };\n}\n\n// Nitro's `NitroConfig` only matches `@sentry/nitro`'s when both resolve the same `nitro` install,\n// which is not guaranteed, so the key stays opaque rather than coupling the two copies.\ntype ViteConfigWithNitro = UserConfig & {\n nitro?: Record<string, unknown>;\n server?: UserConfig['server'] & { baseURL?: string };\n};\n\n/**\n * Delivers everything only Nitro can reach — server source maps, runtime hooks, the\n * `sourcemapMinify` opt-out — through Vite's `nitro` key, and the app's base path to the browser SDK.\n *\n * `setupSentryNitroModule` is handed only the keys it reads, never the user's whole config, so what\n * comes back is purely Sentry's additions. Vite concatenates arrays when merging a `config` return\n * value, so echoing the user's own `modules`/`plugins` back would duplicate every entry.\n *\n * `enforce: 'pre'` is load-bearing: Nitro creates its instance inside its own `config` hook, so a\n * normal-priority hook sorting after it would be read too late and silently ignored.\n */\nfunction makeSentryNitroPlugin(options: SentrySolidStartOptions): Plugin {\n return {\n name: 'sentry-solidstart-nitro',\n enforce: 'pre',\n config(userConfig: ViteConfigWithNitro) {\n const userNitro = userConfig.nitro;\n // SolidStart serves the app under Vite's `base` (or `server.baseURL`), not Nitro's `baseURL`, so the browser\n // and the server both serve the managed tunnel under it.\n const tunnelBasePath = normalizeTunnelBasePath(userConfig.server?.baseURL || userConfig.base);\n\n return {\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: stringifyForCodeInjection(tunnelBasePath) },\n nitro: {\n ...(setupSentryNitroModule(\n // `sourcemap` decides whether Sentry enables its own; `tracingChannel` is left as the user set it.\n { sourcemap: userNitro?.sourcemap, tracingChannel: userNitro?.tracingChannel } as Parameters<\n typeof setupSentryNitroModule\n >[0],\n options,\n ) as Record<string, unknown>),\n // `@sentry/nitro` serves the tunnel under this instead of Nitro's `baseURL`.\n ...(tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }),\n },\n } as Omit<UserConfig, 'plugins'>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,iBAAiB,UAAmC,CAAC,GAAa;CAChF,0BAA0B,SAAS,CAAC,kCAAkC,CAAC;CAEvE,MAAM,UAAoB,CAAC,sBAAsB,OAAO,GAAG,sBAAsB,CAAC;CAGlF,IAAA,QAAA,IAAA,aAA6B,eAC3B,OAAO;CAKT,QAAQ,KAAK,wBAAwB,EAAE,0BAA0B,QAAQ,yBAAyB,CAAC,CAAC;CAEpG,IAAI,QAAQ,YAAY,YAAY,MAClC,QAAQ,KAAK,GAAG,mCAAmC,OAAO,GAAG,GAAG,+BAA+B,OAAO,CAAC;CAGzG,OAAO;AACT;AAEA,MAAM,2BAA2B;;;;;;;AAQjC,SAAS,wBAAgC;CACvC,OAAO;EACL,MAAM;EACN,kBAAkB,MAAM,QAAQ;GAG9B,IAAI,SAAS,YAAY,OAAO,aAAa,YAAY,CAAC,OAAO,SAAS,YACxE;GAGF,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,wBAAwB,EAAE,EAAE;EAC/D;CACF;AACF;;;;;;;;;;;;AAoBA,SAAS,sBAAsB,SAA0C;CACvE,OAAO;EACL,MAAM;EACN,SAAS;EACT,OAAO,YAAiC;GACtC,MAAM,YAAY,WAAW;GAG7B,MAAM,iBAAiBA,kCAAwB,WAAW,QAAQ,WAAW,WAAW,IAAI;GAE5F,OAAO;IACL,QAAQ,EAAE,wCAAwC,0BAA0B,cAAc,EAAE;IAC5F,OAAO;KACL,GAAI,uBAEF;MAAE,WAAW,WAAW;MAAW,gBAAgB,WAAW;KAAe,GAG7E,OACF;KAEA,GAAI,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,eAAe,EAAE;IAClF;GACF;EACF;CACF;AACF"}
@@ -1,38 +1,37 @@
1
- import { warnOnRemovedBuildOptions } from '@sentry/core';
2
- import { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile.js';
3
- import { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps.js';
4
-
1
+ import { makeBuildInstrumentationFilePlugin } from "./buildInstrumentationFile.js";
2
+ import { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from "./sourceMaps.js";
3
+ import { stringifyForCodeInjection, warnOnRemovedBuildOptions } from "@sentry/core";
4
+ // src/vite/sentrySolidStartVite.ts
5
+ /**
6
+ * Various Sentry vite plugins to be used for SolidStart.
7
+ */
5
8
  const sentrySolidStartVite = (options = {}, viteConfig, tunnelBasePath = "") => {
6
- warnOnRemovedBuildOptions(options, ["unstable_sentryVitePluginOptions"]);
7
- const sentryPlugins = [
8
- {
9
- name: "sentry-solidstart-tunnel-base-path",
10
- // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.
11
- config: () => ({
12
- define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) }
13
- })
14
- }
15
- ];
16
- if (options.autoInjectServerSentry !== "experimental_dynamic-import") {
17
- sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));
18
- }
19
- if (process.env.NODE_ENV !== "development") {
20
- if (options.sourcemaps?.disable !== true) {
21
- const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);
22
- const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);
23
- sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);
24
- }
25
- }
26
- return sentryPlugins;
9
+ warnOnRemovedBuildOptions(options, ["unstable_sentryVitePluginOptions"]);
10
+ const sentryPlugins = [{
11
+ name: "sentry-solidstart-tunnel-base-path",
12
+ config: () => ({ define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: stringifyForCodeInjection(tunnelBasePath) } })
13
+ }];
14
+ if (options.autoInjectServerSentry !== "experimental_dynamic-import") sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));
15
+ if (process.env.NODE_ENV !== "development") {
16
+ if (options.sourcemaps?.disable !== true) {
17
+ const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);
18
+ const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);
19
+ sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);
20
+ }
21
+ }
22
+ return sentryPlugins;
27
23
  };
24
+ /**
25
+ * Helper to add the Sentry SolidStart vite plugin to a vite config.
26
+ */
28
27
  const addSentryPluginToVite = (config = {}, options, tunnelBasePath) => {
29
- const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];
30
- plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));
31
- return {
32
- ...config,
33
- plugins
34
- };
28
+ const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];
29
+ plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));
30
+ return {
31
+ ...config,
32
+ plugins
33
+ };
35
34
  };
36
-
37
35
  export { addSentryPluginToVite, sentrySolidStartVite };
38
- //# sourceMappingURL=sentrySolidStartVite.js.map
36
+
37
+ //# sourceMappingURL=sentrySolidStartVite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStartVite.js","sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import { warnOnRemovedBuildOptions } from '@sentry/core';\nimport 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 = (\n options: SentrySolidStartPluginOptions = {},\n viteConfig: UserConfig,\n tunnelBasePath = '',\n): Plugin[] => {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const sentryPlugins: Plugin[] = [\n {\n name: 'sentry-solidstart-tunnel-base-path',\n // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.\n config: () => ({\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n }),\n },\n ];\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.sourcemaps?.disable !== 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 = (\n config: UserConfig = {},\n options: SentrySolidStartPluginOptions,\n tunnelBasePath?: string,\n): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"names":[],"mappings":";;;;AASO,MAAM,uBAAuB,CAClC,OAAA,GAAyC,EAAC,EAC1C,UAAA,EACA,iBAAiB,EAAA,KACJ;AACb,EAAA,yBAAA,CAA0B,OAAA,EAAS,CAAC,kCAAkC,CAAC,CAAA;AAEvE,EAAA,MAAM,aAAA,GAA0B;AAAA,IAC9B;AAAA,MACE,IAAA,EAAM,oCAAA;AAAA;AAAA,MAEN,QAAQ,OAAO;AAAA,QACb,QAAQ,EAAE,sCAAA,EAAwC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAA;AAAE,OACnF;AAAA;AACF,GACF;AAEA,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,UAAA,EAAY,OAAA,KAAY,IAAA,EAAM;AACxC,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,wBAAwB,CACnC,MAAA,GAAqB,EAAC,EACtB,SACA,cAAA,KACe;AACf,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,MAAA,EAAQ,cAAc,CAAC,CAAA;AAErE,EAAA,OAAO;AAAA,IACL,GAAG,MAAA;AAAA,IACH;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"sentrySolidStartVite.js","names":[],"sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import { stringifyForCodeInjection, warnOnRemovedBuildOptions } from '@sentry/core';\nimport 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 = (\n options: SentrySolidStartPluginOptions = {},\n viteConfig: UserConfig,\n tunnelBasePath = '',\n): Plugin[] => {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const sentryPlugins: Plugin[] = [\n {\n name: 'sentry-solidstart-tunnel-base-path',\n // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.\n config: () => ({\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: stringifyForCodeInjection(tunnelBasePath) },\n }),\n },\n ];\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.sourcemaps?.disable !== 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 = (\n config: UserConfig = {},\n options: SentrySolidStartPluginOptions,\n tunnelBasePath?: string,\n): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"mappings":";;;;;;;AASA,MAAa,wBACX,UAAyC,CAAC,GAC1C,YACA,iBAAiB,OACJ;CACb,0BAA0B,SAAS,CAAC,kCAAkC,CAAC;CAEvE,MAAM,gBAA0B,CAC9B;EACE,MAAM;EAEN,eAAe,EACb,QAAQ,EAAE,wCAAwC,0BAA0B,cAAc,EAAE,EAC9F;CACF,CACF;CAEA,IAAI,QAAQ,2BAA2B,+BACrC,cAAc,KAAK,mCAAmC,OAAO,CAAC;CAGhE,IAAA,QAAA,IAAA,aAA6B,eACvB;MAAA,QAAQ,YAAY,YAAY,MAAM;GACxC,MAAM,mBAAmB,wBAAwB,SAAS,UAAU;GACpE,MAAM,yBAAyB,+BAA+B,OAAO;GAErE,cAAc,KAAK,GAAG,kBAAkB,GAAG,sBAAsB;EACnE;;CAGF,OAAO;AACT;;;;AAKA,MAAa,yBACX,SAAqB,CAAC,GACtB,SACA,mBACe;CACf,MAAM,UAAU,MAAM,QAAQ,OAAO,OAAO,IAAI,CAAC,GAAG,OAAO,OAAO,IAAI,CAAC;CACvE,QAAQ,QAAQ,qBAAqB,SAAS,QAAQ,cAAc,CAAC;CAErE,OAAO;EACL,GAAG;EACH;CACF;AACF"}
@@ -1,159 +1,126 @@
1
- import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
2
-
1
+ import { sentryVitePlugin } from "@sentry/bundler-plugins/vite";
2
+ // src/vite/sourceMaps.ts
3
+ /**
4
+ * A Sentry plugin for adding the @sentry/bundler-plugins/vite plugin to automatically upload source maps to Sentry.
5
+ */
3
6
  function makeAddSentryVitePlugin(options, viteConfig) {
4
- const {
5
- applicationKey,
6
- authToken,
7
- bundleSizeOptimizations,
8
- debug,
9
- errorHandler,
10
- headers,
11
- moduleMetadata,
12
- org,
13
- project,
14
- release,
15
- sentryUrl,
16
- silent,
17
- sourcemaps,
18
- telemetry
19
- } = options;
20
- let updatedFilesToDeleteAfterUpload = void 0;
21
- if (typeof sourcemaps?.filesToDeleteAfterUpload === "undefined" && // Only if source maps were previously not set, we update the "filesToDeleteAfterUpload" (as we override the setting with "hidden")
22
- typeof viteConfig.build?.sourcemap === "undefined") {
23
- updatedFilesToDeleteAfterUpload = [".*/**/*.map"];
24
- debug && // eslint-disable-next-line no-console
25
- console.log(
26
- `[Sentry] Automatically setting \`sourcemaps.filesToDeleteAfterUpload: ${JSON.stringify(
27
- updatedFilesToDeleteAfterUpload
28
- )}\` to delete generated source maps after they were uploaded to Sentry.`
29
- );
30
- }
31
- return [
32
- ...sentryVitePlugin({
33
- applicationKey,
34
- authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
35
- bundleSizeOptimizations,
36
- debug: debug ?? false,
37
- errorHandler,
38
- headers,
39
- moduleMetadata,
40
- org: org ?? process.env.SENTRY_ORG,
41
- project: project ?? process.env.SENTRY_PROJECT,
42
- release,
43
- silent,
44
- telemetry: telemetry ?? true,
45
- url: sentryUrl,
46
- sourcemaps: {
47
- ...sourcemaps,
48
- filesToDeleteAfterUpload: sourcemaps?.filesToDeleteAfterUpload ?? updatedFilesToDeleteAfterUpload
49
- },
50
- _metaOptions: {
51
- telemetry: {
52
- metaFramework: "solidstart"
53
- }
54
- }
55
- })
56
- ];
7
+ const { applicationKey, authToken, bundleSizeOptimizations, debug, errorHandler, headers, moduleMetadata, org, project, release, sentryUrl, silent, sourcemaps, telemetry } = options;
8
+ let updatedFilesToDeleteAfterUpload = void 0;
9
+ if (typeof sourcemaps?.filesToDeleteAfterUpload === "undefined" && typeof viteConfig.build?.sourcemap === "undefined") {
10
+ updatedFilesToDeleteAfterUpload = [".*/**/*.map"];
11
+ debug && console.log(`[Sentry] Automatically setting \`sourcemaps.filesToDeleteAfterUpload: ${JSON.stringify(updatedFilesToDeleteAfterUpload)}\` to delete generated source maps after they were uploaded to Sentry.`);
12
+ }
13
+ return [...sentryVitePlugin({
14
+ applicationKey,
15
+ authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
16
+ bundleSizeOptimizations,
17
+ debug: debug ?? false,
18
+ errorHandler,
19
+ headers,
20
+ moduleMetadata,
21
+ org: org ?? process.env.SENTRY_ORG,
22
+ project: project ?? process.env.SENTRY_PROJECT,
23
+ release,
24
+ silent,
25
+ telemetry: telemetry ?? true,
26
+ url: sentryUrl,
27
+ sourcemaps: {
28
+ ...sourcemaps,
29
+ filesToDeleteAfterUpload: sourcemaps?.filesToDeleteAfterUpload ?? updatedFilesToDeleteAfterUpload
30
+ },
31
+ _metaOptions: { telemetry: { metaFramework: "solidstart" } }
32
+ })];
57
33
  }
34
+ /**
35
+ * SolidStart 2 counterpart of `makeAddSentryVitePlugin`, reading the flat `BuildTimeOptionsBase`
36
+ * fields rather than the nested `sourceMapsUploadOptions`.
37
+ *
38
+ * Covers the Vite-built client assets only; Nitro emits the server bundle outside Vite's output dir
39
+ * and the Sentry Nitro module uploads that.
40
+ */
58
41
  function makeAddSentryVitePluginSolidStart2(options) {
59
- const {
60
- authToken,
61
- buildTimeInstrumentation: _buildTimeInstrumentation,
62
- debug,
63
- org,
64
- project,
65
- sentryUrl,
66
- sourcemaps,
67
- telemetry,
68
- ...passthroughOptions
69
- } = options;
70
- let resolveFilesToDeleteAfterUpload;
71
- const filesToDeleteAfterUploadPromise = new Promise((resolve) => {
72
- resolveFilesToDeleteAfterUpload = resolve;
73
- });
74
- const configPlugin = {
75
- name: "sentry-solidstart-files-to-delete-after-upload",
76
- apply: "build",
77
- enforce: "post",
78
- config(config) {
79
- const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;
80
- if (typeof userFilesToDelete === "undefined" && typeof config.build?.sourcemap === "undefined") {
81
- if (debug) {
82
- console.log(
83
- '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: ["./**/*.map"]` to delete generated source maps after they were uploaded to Sentry.'
84
- );
85
- }
86
- resolveFilesToDeleteAfterUpload?.(["./**/*.map"]);
87
- } else {
88
- resolveFilesToDeleteAfterUpload?.(userFilesToDelete);
89
- }
90
- }
91
- };
92
- const sentryPlugins = sentryVitePlugin({
93
- ...passthroughOptions,
94
- authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
95
- debug: debug ?? false,
96
- org: org ?? process.env.SENTRY_ORG,
97
- project: project ?? process.env.SENTRY_PROJECT,
98
- telemetry: telemetry ?? true,
99
- url: sentryUrl,
100
- sourcemaps: {
101
- ...sourcemaps,
102
- filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise
103
- },
104
- _metaOptions: {
105
- telemetry: {
106
- metaFramework: "solidstart"
107
- }
108
- }
109
- });
110
- return [configPlugin, ...sentryPlugins];
42
+ const { authToken, buildTimeInstrumentation: _buildTimeInstrumentation, debug, org, project, sentryUrl, sourcemaps, telemetry, ...passthroughOptions } = options;
43
+ let resolveFilesToDeleteAfterUpload;
44
+ const filesToDeleteAfterUploadPromise = new Promise((resolve) => {
45
+ resolveFilesToDeleteAfterUpload = resolve;
46
+ });
47
+ return [{
48
+ name: "sentry-solidstart-files-to-delete-after-upload",
49
+ apply: "build",
50
+ enforce: "post",
51
+ config(config) {
52
+ const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;
53
+ if (typeof userFilesToDelete === "undefined" && typeof config.build?.sourcemap === "undefined") {
54
+ if (debug) console.log("[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: [\"./**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.");
55
+ resolveFilesToDeleteAfterUpload?.(["./**/*.map"]);
56
+ } else resolveFilesToDeleteAfterUpload?.(userFilesToDelete);
57
+ }
58
+ }, ...sentryVitePlugin({
59
+ ...passthroughOptions,
60
+ authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
61
+ debug: debug ?? false,
62
+ org: org ?? process.env.SENTRY_ORG,
63
+ project: project ?? process.env.SENTRY_PROJECT,
64
+ telemetry: telemetry ?? true,
65
+ url: sentryUrl,
66
+ sourcemaps: {
67
+ ...sourcemaps,
68
+ filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise
69
+ },
70
+ _metaOptions: { telemetry: { metaFramework: "solidstart" } }
71
+ })];
111
72
  }
73
+ /**
74
+ * A Sentry plugin for SolidStart to enable "hidden" source maps if they are unset. Used by both
75
+ * SolidStart majors.
76
+ */
112
77
  function makeEnableSourceMapsVitePlugin(options) {
113
- return [
114
- {
115
- name: "sentry-solidstart-update-source-map-setting",
116
- apply: "build",
117
- enforce: "post",
118
- config(viteConfig) {
119
- return {
120
- build: {
121
- sourcemap: getUpdatedSourceMapSettings(viteConfig, options)
122
- }
123
- };
124
- }
125
- }
126
- ];
78
+ return [{
79
+ name: "sentry-solidstart-update-source-map-setting",
80
+ apply: "build",
81
+ enforce: "post",
82
+ config(viteConfig) {
83
+ return { build: { sourcemap: getUpdatedSourceMapSettings(viteConfig, options) } };
84
+ }
85
+ }];
127
86
  }
87
+ /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
88
+ *
89
+ * 1. User explicitly disabled source maps
90
+ * - keep this setting (emit a warning that errors won't be unminified in Sentry)
91
+ * - We won't upload anything
92
+ *
93
+ * 2. Users enabled source map generation (true, 'hidden', 'inline').
94
+ * - keep this setting (don't do anything - like deletion - besides uploading)
95
+ *
96
+ * 3. Users didn't set source maps generation
97
+ * - we enable 'hidden' source maps generation
98
+ * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
99
+ *
100
+ * --> only exported for testing
101
+ */
128
102
  function getUpdatedSourceMapSettings(viteConfig, sentryPluginOptions) {
129
- const viteSourceMap = viteConfig?.build?.sourcemap;
130
- let updatedSourceMapSetting = viteSourceMap;
131
- const settingKey = "vite.build.sourcemap";
132
- const debug = sentryPluginOptions?.debug;
133
- if (viteSourceMap === false) {
134
- updatedSourceMapSetting = viteSourceMap;
135
- if (debug) {
136
- console.warn(
137
- `[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\`).`
138
- );
139
- } else {
140
- console.warn("[Sentry] Source map generation is disabled in your SolidStart configuration.");
141
- }
142
- } else if (viteSourceMap && ["hidden", "inline", true].includes(viteSourceMap)) {
143
- updatedSourceMapSetting = viteSourceMap;
144
- debug && // eslint-disable-next-line no-console
145
- console.log(
146
- `[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.`
147
- );
148
- } else {
149
- updatedSourceMapSetting = "hidden";
150
- debug && // eslint-disable-next-line no-console
151
- console.log(
152
- `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`
153
- );
154
- }
155
- return updatedSourceMapSetting;
103
+ const viteSourceMap = viteConfig?.build?.sourcemap;
104
+ let updatedSourceMapSetting = viteSourceMap;
105
+ const settingKey = "vite.build.sourcemap";
106
+ const debug = sentryPluginOptions?.debug;
107
+ if (viteSourceMap === false) {
108
+ updatedSourceMapSetting = viteSourceMap;
109
+ if (debug) console.warn(`[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\`).`);
110
+ else console.warn("[Sentry] Source map generation is disabled in your SolidStart configuration.");
111
+ } else if (viteSourceMap && [
112
+ "hidden",
113
+ "inline",
114
+ true
115
+ ].includes(viteSourceMap)) {
116
+ updatedSourceMapSetting = viteSourceMap;
117
+ debug && console.log(`[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.`);
118
+ } else {
119
+ updatedSourceMapSetting = "hidden";
120
+ debug && console.log(`[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`);
121
+ }
122
+ return updatedSourceMapSetting;
156
123
  }
157
-
158
124
  export { getUpdatedSourceMapSettings, makeAddSentryVitePlugin, makeAddSentryVitePluginSolidStart2, makeEnableSourceMapsVitePlugin };
159
- //# sourceMappingURL=sourceMaps.js.map
125
+
126
+ //# sourceMappingURL=sourceMaps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartOptions } from './sentrySolidStart';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n// `debug` is all the source map setting logic needs, and all the two majors' option types share.\ntype SourceMapSettingOptions = { debug?: boolean };\n\ntype FilesToDeleteAfterUpload = string | string[] | undefined;\n\n/**\n * A Sentry plugin for adding the @sentry/bundler-plugins/vite plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: SentrySolidStartPluginOptions, viteConfig: UserConfig): Plugin[] {\n const {\n applicationKey,\n authToken,\n bundleSizeOptimizations,\n debug,\n errorHandler,\n headers,\n moduleMetadata,\n org,\n project,\n release,\n sentryUrl,\n silent,\n sourcemaps,\n telemetry,\n } = options;\n\n let updatedFilesToDeleteAfterUpload: string[] | undefined = undefined;\n\n if (\n typeof sourcemaps?.filesToDeleteAfterUpload === '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 \\`sourcemaps.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 applicationKey,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations,\n debug: debug ?? false,\n errorHandler,\n headers,\n moduleMetadata,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n release,\n silent,\n telemetry: telemetry ?? true,\n url: sentryUrl,\n sourcemaps: {\n ...sourcemaps,\n filesToDeleteAfterUpload: sourcemaps?.filesToDeleteAfterUpload ?? updatedFilesToDeleteAfterUpload,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n }),\n ];\n}\n\n/**\n * SolidStart 2 counterpart of `makeAddSentryVitePlugin`, reading the flat `BuildTimeOptionsBase`\n * fields rather than the nested `sourceMapsUploadOptions`.\n *\n * Covers the Vite-built client assets only; Nitro emits the server bundle outside Vite's output dir\n * and the Sentry Nitro module uploads that.\n */\nexport function makeAddSentryVitePluginSolidStart2(options: SentrySolidStartOptions): Plugin[] {\n // Everything not destructured out is field-for-field what `sentryVitePlugin` accepts, so it is\n // spread through — a new shared option then reaches the plugin without editing a list here.\n const {\n authToken,\n buildTimeInstrumentation: _buildTimeInstrumentation,\n debug,\n org,\n project,\n sentryUrl,\n sourcemaps,\n telemetry,\n ...passthroughOptions\n } = options;\n\n // Deferred because the default depends on whether the user set `build.sourcemap` themselves,\n // which is only known once Vite resolves its config.\n let resolveFilesToDeleteAfterUpload:\n | ((value: FilesToDeleteAfterUpload | PromiseLike<FilesToDeleteAfterUpload>) => void)\n | undefined;\n const filesToDeleteAfterUploadPromise = new Promise<FilesToDeleteAfterUpload>(resolve => {\n resolveFilesToDeleteAfterUpload = resolve;\n });\n\n const configPlugin: Plugin = {\n name: 'sentry-solidstart-files-to-delete-after-upload',\n apply: 'build',\n enforce: 'post',\n config(config) {\n const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;\n\n // Only clean up source maps we turned on ourselves.\n if (typeof userFilesToDelete === 'undefined' && typeof config.build?.sourcemap === 'undefined') {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: [\"./**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n }\n resolveFilesToDeleteAfterUpload?.(['./**/*.map']);\n } else {\n resolveFilesToDeleteAfterUpload?.(userFilesToDelete);\n }\n },\n };\n\n const sentryPlugins = sentryVitePlugin({\n ...passthroughOptions,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n telemetry: telemetry ?? true,\n url: sentryUrl,\n sourcemaps: {\n ...sourcemaps,\n filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n });\n\n return [configPlugin, ...sentryPlugins];\n}\n\n/**\n * A Sentry plugin for SolidStart to enable \"hidden\" source maps if they are unset. Used by both\n * SolidStart majors.\n */\nexport function makeEnableSourceMapsVitePlugin(options: SourceMapSettingOptions): Plugin[] {\n return [\n {\n name: 'sentry-solidstart-update-source-map-setting',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n // Return only what changed: Vite concatenates arrays when merging a `config` return value,\n // so echoing the whole config back would duplicate every array the user had.\n return {\n 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?: SourceMapSettingOptions,\n): boolean | 'inline' | 'hidden' {\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":";;AAaO,SAAS,uBAAA,CAAwB,SAAwC,UAAA,EAAkC;AAChH,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,SAAA;AAAA,IACA,uBAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AAEJ,EAAA,IAAI,+BAAA,GAAwD,MAAA;AAE5D,EAAA,IACE,OAAO,YAAY,wBAAA,KAA6B,WAAA;AAAA,EAEhD,OAAO,UAAA,CAAW,KAAA,EAAO,SAAA,KAAc,WAAA,EACvC;AAEA,IAAA,+BAAA,GAAkC,CAAC,aAAa,CAAA;AAEhD,IAAA,KAAA;AAAA,IAEE,OAAA,CAAQ,GAAA;AAAA,MACN,yEAAyE,IAAA,CAAK,SAAA;AAAA,QAC5E;AAAA,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Content":["import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartOptions } from './sentrySolidStart';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n// `debug` is all the source map setting logic needs, and all the two majors' option types share.\ntype SourceMapSettingOptions = { debug?: boolean };\n\ntype FilesToDeleteAfterUpload = string | string[] | undefined;\n\n/**\n * A Sentry plugin for adding the @sentry/bundler-plugins/vite plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: SentrySolidStartPluginOptions, viteConfig: UserConfig): Plugin[] {\n const {\n applicationKey,\n authToken,\n bundleSizeOptimizations,\n debug,\n errorHandler,\n headers,\n moduleMetadata,\n org,\n project,\n release,\n sentryUrl,\n silent,\n sourcemaps,\n telemetry,\n } = options;\n\n let updatedFilesToDeleteAfterUpload: string[] | undefined = undefined;\n\n if (\n typeof sourcemaps?.filesToDeleteAfterUpload === '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 \\`sourcemaps.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 applicationKey,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations,\n debug: debug ?? false,\n errorHandler,\n headers,\n moduleMetadata,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n release,\n silent,\n telemetry: telemetry ?? true,\n url: sentryUrl,\n sourcemaps: {\n ...sourcemaps,\n filesToDeleteAfterUpload: sourcemaps?.filesToDeleteAfterUpload ?? updatedFilesToDeleteAfterUpload,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n }),\n ];\n}\n\n/**\n * SolidStart 2 counterpart of `makeAddSentryVitePlugin`, reading the flat `BuildTimeOptionsBase`\n * fields rather than the nested `sourceMapsUploadOptions`.\n *\n * Covers the Vite-built client assets only; Nitro emits the server bundle outside Vite's output dir\n * and the Sentry Nitro module uploads that.\n */\nexport function makeAddSentryVitePluginSolidStart2(options: SentrySolidStartOptions): Plugin[] {\n // Everything not destructured out is field-for-field what `sentryVitePlugin` accepts, so it is\n // spread through — a new shared option then reaches the plugin without editing a list here.\n const {\n authToken,\n buildTimeInstrumentation: _buildTimeInstrumentation,\n debug,\n org,\n project,\n sentryUrl,\n sourcemaps,\n telemetry,\n ...passthroughOptions\n } = options;\n\n // Deferred because the default depends on whether the user set `build.sourcemap` themselves,\n // which is only known once Vite resolves its config.\n let resolveFilesToDeleteAfterUpload:\n | ((value: FilesToDeleteAfterUpload | PromiseLike<FilesToDeleteAfterUpload>) => void)\n | undefined;\n const filesToDeleteAfterUploadPromise = new Promise<FilesToDeleteAfterUpload>(resolve => {\n resolveFilesToDeleteAfterUpload = resolve;\n });\n\n const configPlugin: Plugin = {\n name: 'sentry-solidstart-files-to-delete-after-upload',\n apply: 'build',\n enforce: 'post',\n config(config) {\n const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;\n\n // Only clean up source maps we turned on ourselves.\n if (typeof userFilesToDelete === 'undefined' && typeof config.build?.sourcemap === 'undefined') {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: [\"./**/*.map\"]` to delete generated source maps after they were uploaded to Sentry.',\n );\n }\n resolveFilesToDeleteAfterUpload?.(['./**/*.map']);\n } else {\n resolveFilesToDeleteAfterUpload?.(userFilesToDelete);\n }\n },\n };\n\n const sentryPlugins = sentryVitePlugin({\n ...passthroughOptions,\n authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n debug: debug ?? false,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n telemetry: telemetry ?? true,\n url: sentryUrl,\n sourcemaps: {\n ...sourcemaps,\n filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'solidstart',\n },\n },\n });\n\n return [configPlugin, ...sentryPlugins];\n}\n\n/**\n * A Sentry plugin for SolidStart to enable \"hidden\" source maps if they are unset. Used by both\n * SolidStart majors.\n */\nexport function makeEnableSourceMapsVitePlugin(options: SourceMapSettingOptions): Plugin[] {\n return [\n {\n name: 'sentry-solidstart-update-source-map-setting',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n // Return only what changed: Vite concatenates arrays when merging a `config` return value,\n // so echoing the whole config back would duplicate every array the user had.\n return {\n 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?: SourceMapSettingOptions,\n): boolean | 'inline' | 'hidden' {\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"],"mappings":";;;;;AAaA,SAAgB,wBAAwB,SAAwC,YAAkC;CAChH,MAAM,EACJ,gBACA,WACA,yBACA,OACA,cACA,SACA,gBACA,KACA,SACA,SACA,WACA,QACA,YACA,cACE;CAEJ,IAAI,kCAAwD,KAAA;CAE5D,IACE,OAAO,YAAY,6BAA6B,eAEhD,OAAO,WAAW,OAAO,cAAc,aACvC;EAEA,kCAAkC,CAAC,aAAa;EAEhD,SAEE,QAAQ,IACN,yEAAyE,KAAK,UAC5E,+BACF,EAAE,uEACJ;CACJ;CAEA,OAAO,CACL,GAAG,iBAAiB;EAClB;EACA,WAAW,aAAa,QAAQ,IAAI;EACpC;EACA,OAAO,SAAS;EAChB;EACA;EACA;EACA,KAAK,OAAO,QAAQ,IAAI;EACxB,SAAS,WAAW,QAAQ,IAAI;EAChC;EACA;EACA,WAAW,aAAa;EACxB,KAAK;EACL,YAAY;GACV,GAAG;GACH,0BAA0B,YAAY,4BAA4B;EACpE;EACA,c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FAA4F,WAAW,6QAA6Q,WAAW,yCACjY;OAGA,QAAQ,KAAK,8EAA8E;CAE/F,OAAO,IAAI,iBAAiB;EAAC;EAAU;EAAU;CAAI,CAAC,CAAC,SAAS,aAAa,GAAG;EAC9E,0BAA0B;EAE1B,SAEE,QAAQ,IACN,4BAA4B,WAAW,iBAAiB,cAAc,SAAS,EAAE,6GACnF;CACJ,OAAO;EACL,0BAA0B;EAE1B,SAEE,QAAQ,IACN,sEAAsE,WAAW,mFACnF;CACJ;CAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/config/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,wCAAwC,CAAC;AACjF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA2B5G;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBxF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/config/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,wCAAwC,CAAC;AACjF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA2B5G;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../../src/config/withSentry.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAMnE,OAAO,KAAK,EAAgB,sBAAsB,EAAgC,MAAM,SAAS,CAAC;AAclG;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,gBAAgB,EAAE,sBAAsB,YAAK,EAC7C,6BAA6B,EAAE,6BAA6B,GAC3D,sBAAsB,CAmGxB"}
1
+ {"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../../src/config/withSentry.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAMnE,OAAO,KAAK,EAAgB,sBAAsB,EAAgC,MAAM,SAAS,CAAC;AAclG;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,gBAAgB,EAAE,sBAAsB,YAAK,EAC7C,6BAA6B,EAAE,6BAA6B,GAC3D,sBAAsB,CAmGxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStart.d.ts","sourceRoot":"","sources":["../../../src/vite/sentrySolidStart.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAC;AAG/C;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,MAAM,EAAE,CAmBhF"}
1
+ {"version":3,"file":"sentrySolidStart.d.ts","sourceRoot":"","sources":["../../../src/vite/sentrySolidStart.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAG1B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAC;AAG/C;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,MAAM,EAAE,CAmBhF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/solidstart",
3
- "version": "11.12.0",
3
+ "version": "11.14.0",
4
4
  "description": "Official Sentry SDK for Solid Start",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,6 +33,10 @@
33
33
  "./package.json": "./package.json",
34
34
  ".": {
35
35
  "types": "./build/types/index.types.d.ts",
36
+ "sentry-solidstart-runtime": {
37
+ "import": "./build/esm/server/index.js",
38
+ "require": "./build/cjs/server/index.js"
39
+ },
36
40
  "browser": {
37
41
  "import": "./build/esm/index.client.js",
38
42
  "require": "./build/cjs/index.client.js"
@@ -83,19 +87,19 @@
83
87
  }
84
88
  },
85
89
  "dependencies": {
86
- "@sentry/core": "11.12.0",
87
- "@sentry/nitro": "11.12.0",
88
- "@sentry/node": "11.12.0",
89
- "@sentry/server-runtime-injection": "11.12.0",
90
- "@sentry/server-utils": "11.12.0",
91
- "@sentry/solid": "11.12.0",
92
- "@sentry/bundler-plugins": "11.12.0",
93
- "@sentry/conventions": "0.32.0",
90
+ "@sentry/core": "11.14.0",
91
+ "@sentry/nitro": "11.14.0",
92
+ "@sentry/node": "11.14.0",
93
+ "@sentry/server-runtime-injection": "11.14.0",
94
+ "@sentry/server-utils": "11.14.0",
95
+ "@sentry/solid": "11.14.0",
96
+ "@sentry/bundler-plugins": "11.14.0",
97
+ "@sentry/conventions": "0.33.0",
94
98
  "h3": "^1.15.10"
95
99
  },
96
100
  "devDependencies": {
97
- "@sentry-internal/rollup-utils": "11.12.0",
98
- "@sentry/browser": "11.12.0",
101
+ "@sentry-internal/rollup-utils": "11.14.0",
102
+ "@sentry/browser": "11.14.0",
99
103
  "@solidjs/router": "^1.0.0",
100
104
  "@solidjs/start": "^1.3.2",
101
105
  "@solidjs/testing-library": "0.8.5",
@@ -122,25 +126,21 @@
122
126
  }
123
127
  },
124
128
  "scripts": {
125
- "build": "run-p build:transpile build:types",
129
+ "build": "pnpm run \"/^build:(transpile|types)$/\"",
126
130
  "build:dev": "pnpm run build",
127
- "build:transpile": "rollup -c rollup.npm.config.mjs",
128
- "build:types": "run-s build:types:core build:types:subexports",
131
+ "build:transpile": "rolldown -c rollup.npm.config.mjs",
132
+ "build:types": "pnpm run build:types:core && pnpm run build:types:subexports",
129
133
  "build:types:core": "tsc -p tsconfig.types.json",
130
134
  "build:types:subexports": "tsc -p tsconfig.subexports-types.json",
131
- "build:watch": "run-p build:transpile:watch",
132
- "build:dev:watch": "pnpm run build:watch",
133
- "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
134
135
  "build:tarball": "pnpm pack",
135
- "circularDepCheck": "madge --circular src/index.client.ts src/index.server.ts src/index.types.ts src/solidrouter.client.ts src/solidrouter.server.ts src/solidrouter.ts",
136
136
  "clean": "node ../../scripts/rm.mjs build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client ./server",
137
137
  "lint:fix": "oxlint . --fix --type-aware",
138
138
  "lint": "oxlint . --type-aware",
139
139
  "lint:types": "oxlint src --type-aware --type-check",
140
- "lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module",
140
+ "lint:es-compatibility": "node ../../scripts/es-check.mjs es2020",
141
141
  "test": "pnpm run test:unit",
142
142
  "test:unit": "vitest run",
143
143
  "test:watch": "vitest --watch",
144
- "yalc:publish": "yalc publish --push --sig"
144
+ "yalc:publish": "pnpm dlx yalc publish --push --sig"
145
145
  }
146
146
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}