@sentry/solidstart 11.12.0 → 11.13.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 (101) 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/package.json +20 -20
  86. package/build/cjs/client/index.js.map +0 -1
  87. package/build/cjs/client/solidrouter.js.map +0 -1
  88. package/build/cjs/index.client.js.map +0 -1
  89. package/build/cjs/server/index.js.map +0 -1
  90. package/build/cjs/solidrouter.client.js.map +0 -1
  91. package/build/cjs/solidrouter.js.map +0 -1
  92. package/build/cjs/solidrouter.server.js.map +0 -1
  93. package/build/cjs/vite/index.js.map +0 -1
  94. package/build/esm/client/index.js.map +0 -1
  95. package/build/esm/client/solidrouter.js.map +0 -1
  96. package/build/esm/index.client.js.map +0 -1
  97. package/build/esm/server/index.js.map +0 -1
  98. package/build/esm/solidrouter.client.js.map +0 -1
  99. package/build/esm/solidrouter.js.map +0 -1
  100. package/build/esm/solidrouter.server.js.map +0 -1
  101. package/build/esm/vite/index.js.map +0 -1
@@ -1,164 +1,129 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const vite = require('@sentry/bundler-plugins/vite');
4
-
1
+ let _sentry_bundler_plugins_vite = require("@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
+ */
5
6
  function makeAddSentryVitePlugin(options, viteConfig) {
6
- const {
7
- applicationKey,
8
- authToken,
9
- bundleSizeOptimizations,
10
- debug,
11
- errorHandler,
12
- headers,
13
- moduleMetadata,
14
- org,
15
- project,
16
- release,
17
- sentryUrl,
18
- silent,
19
- sourcemaps,
20
- telemetry
21
- } = options;
22
- let updatedFilesToDeleteAfterUpload = void 0;
23
- if (typeof sourcemaps?.filesToDeleteAfterUpload === "undefined" && // Only if source maps were previously not set, we update the "filesToDeleteAfterUpload" (as we override the setting with "hidden")
24
- typeof viteConfig.build?.sourcemap === "undefined") {
25
- updatedFilesToDeleteAfterUpload = [".*/**/*.map"];
26
- debug && // eslint-disable-next-line no-console
27
- console.log(
28
- `[Sentry] Automatically setting \`sourcemaps.filesToDeleteAfterUpload: ${JSON.stringify(
29
- updatedFilesToDeleteAfterUpload
30
- )}\` to delete generated source maps after they were uploaded to Sentry.`
31
- );
32
- }
33
- return [
34
- ...vite.sentryVitePlugin({
35
- applicationKey,
36
- authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
37
- bundleSizeOptimizations,
38
- debug: debug ?? false,
39
- errorHandler,
40
- headers,
41
- moduleMetadata,
42
- org: org ?? process.env.SENTRY_ORG,
43
- project: project ?? process.env.SENTRY_PROJECT,
44
- release,
45
- silent,
46
- telemetry: telemetry ?? true,
47
- url: sentryUrl,
48
- sourcemaps: {
49
- ...sourcemaps,
50
- filesToDeleteAfterUpload: sourcemaps?.filesToDeleteAfterUpload ?? updatedFilesToDeleteAfterUpload
51
- },
52
- _metaOptions: {
53
- telemetry: {
54
- metaFramework: "solidstart"
55
- }
56
- }
57
- })
58
- ];
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 [...(0, _sentry_bundler_plugins_vite.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
+ })];
59
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
+ */
60
41
  function makeAddSentryVitePluginSolidStart2(options) {
61
- const {
62
- authToken,
63
- buildTimeInstrumentation: _buildTimeInstrumentation,
64
- debug,
65
- org,
66
- project,
67
- sentryUrl,
68
- sourcemaps,
69
- telemetry,
70
- ...passthroughOptions
71
- } = options;
72
- let resolveFilesToDeleteAfterUpload;
73
- const filesToDeleteAfterUploadPromise = new Promise((resolve) => {
74
- resolveFilesToDeleteAfterUpload = resolve;
75
- });
76
- const configPlugin = {
77
- name: "sentry-solidstart-files-to-delete-after-upload",
78
- apply: "build",
79
- enforce: "post",
80
- config(config) {
81
- const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;
82
- if (typeof userFilesToDelete === "undefined" && typeof config.build?.sourcemap === "undefined") {
83
- if (debug) {
84
- console.log(
85
- '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: ["./**/*.map"]` to delete generated source maps after they were uploaded to Sentry.'
86
- );
87
- }
88
- resolveFilesToDeleteAfterUpload?.(["./**/*.map"]);
89
- } else {
90
- resolveFilesToDeleteAfterUpload?.(userFilesToDelete);
91
- }
92
- }
93
- };
94
- const sentryPlugins = vite.sentryVitePlugin({
95
- ...passthroughOptions,
96
- authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
97
- debug: debug ?? false,
98
- org: org ?? process.env.SENTRY_ORG,
99
- project: project ?? process.env.SENTRY_PROJECT,
100
- telemetry: telemetry ?? true,
101
- url: sentryUrl,
102
- sourcemaps: {
103
- ...sourcemaps,
104
- filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise
105
- },
106
- _metaOptions: {
107
- telemetry: {
108
- metaFramework: "solidstart"
109
- }
110
- }
111
- });
112
- 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
+ }, ...(0, _sentry_bundler_plugins_vite.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
+ })];
113
72
  }
73
+ /**
74
+ * A Sentry plugin for SolidStart to enable "hidden" source maps if they are unset. Used by both
75
+ * SolidStart majors.
76
+ */
114
77
  function makeEnableSourceMapsVitePlugin(options) {
115
- return [
116
- {
117
- name: "sentry-solidstart-update-source-map-setting",
118
- apply: "build",
119
- enforce: "post",
120
- config(viteConfig) {
121
- return {
122
- build: {
123
- sourcemap: getUpdatedSourceMapSettings(viteConfig, options)
124
- }
125
- };
126
- }
127
- }
128
- ];
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
+ }];
129
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
+ */
130
102
  function getUpdatedSourceMapSettings(viteConfig, sentryPluginOptions) {
131
- const viteSourceMap = viteConfig?.build?.sourcemap;
132
- let updatedSourceMapSetting = viteSourceMap;
133
- const settingKey = "vite.build.sourcemap";
134
- const debug = sentryPluginOptions?.debug;
135
- if (viteSourceMap === false) {
136
- updatedSourceMapSetting = viteSourceMap;
137
- if (debug) {
138
- console.warn(
139
- `[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\`).`
140
- );
141
- } else {
142
- console.warn("[Sentry] Source map generation is disabled in your SolidStart configuration.");
143
- }
144
- } else if (viteSourceMap && ["hidden", "inline", true].includes(viteSourceMap)) {
145
- updatedSourceMapSetting = viteSourceMap;
146
- debug && // eslint-disable-next-line no-console
147
- console.log(
148
- `[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.`
149
- );
150
- } else {
151
- updatedSourceMapSetting = "hidden";
152
- debug && // eslint-disable-next-line no-console
153
- console.log(
154
- `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`
155
- );
156
- }
157
- 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;
158
123
  }
159
-
160
124
  exports.getUpdatedSourceMapSettings = getUpdatedSourceMapSettings;
161
125
  exports.makeAddSentryVitePlugin = makeAddSentryVitePlugin;
162
126
  exports.makeAddSentryVitePluginSolidStart2 = makeAddSentryVitePluginSolidStart2;
163
127
  exports.makeEnableSourceMapsVitePlugin = makeEnableSourceMapsVitePlugin;
164
- //# sourceMappingURL=sourceMaps.js.map
128
+
129
+ //# 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 Sent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CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,OAChY;AAAA,IACF,CAAA,MAAO;AAEL,MAAA,OAAA,CAAQ,KAAK,8EAA8E,CAAA;AAAA,IAC7F;AAAA,EACF,CAAA,MAAA,IAAW,iBAAiB,CAAC,QAAA,EAAU,UAAU,IAAI,CAAA,CAAE,QAAA,CAAS,aAAa,CAAA,EAAG;AAC9E,IAAA,uBAAA,GAA0B,aAAA;AAE1B,IAAA,KAAA;AAAA,IAEE,OAAA,CAAQ,GAAA;AAAA,MACN,CAAA,yBAAA,EAA4B,UAAU,CAAA,eAAA,EAAkB,aAAA,CAAc,UAAU,CAAA,4GAAA;AAAA,KAClF;AAAA,EACJ,CAAA,MAAO;AACL,IAAA,uBAAA,GAA0B,QAAA;AAE1B,IAAA,KAAA;AAAA,IAEE,OAAA,CAAQ,GAAA;AAAA,MACN,sEAAsE,UAAU,CAAA,kFAAA;AAAA,KAClF;AAAA,EACJ;AAEA,EAAA,OAAO,uBAAA;AACT;;;;;;;"}
1
+ {"version":3,"file":"sourceMaps.js","names":["sentryVitePlugin"],"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"],"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,IAAA,GAAGA,6BAAAA,iBAAAA,CAAiB;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,cAAc,EACZ,WAAW,EACT,eAAe,aACjB,EACF;CACF,CAAC,CACH;AACF;;;;;;;;AASA,SAAgB,mCAAmC,SAA4C;CAG7F,MAAM,EACJ,WACA,0BAA0B,2BAC1B,OACA,KACA,SACA,WACA,YACA,WACA,GAAG,uBACD;CAIJ,IAAI;CAGJ,MAAM,kCAAkC,IAAI,SAAkC,YAAW;EACvF,kCAAkC;CACpC,CAAC;CA2CD,OAAO,CAAC;EAxCN,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO,QAAQ;GACb,MAAM,oBAAoB,YAAY;GAGtC,IAAI,OAAO,sBAAsB,eAAe,OAAO,OAAO,OAAO,cAAc,aAAa;IAC9F,IAAI,OAEF,QAAQ,IACN,4JACF;IAEF,kCAAkC,CAAC,YAAY,CAAC;GAClD,OACE,kCAAkC,iBAAiB;EAEvD;CAsBiB,GAAG,IAAA,GAnBAA,6BAAAA,iBAAAA,CAAiB;EACrC,GAAG;EACH,WAAW,aAAa,QAAQ,IAAI;EACpC,OAAO,SAAS;EAChB,KAAK,OAAO,QAAQ,IAAI;EACxB,SAAS,WAAW,QAAQ,IAAI;EAChC,WAAW,aAAa;EACxB,KAAK;EACL,YAAY;GACV,GAAG;GACH,0BAA0B;EAC5B;EACA,cAAc,EACZ,WAAW,EACT,eAAe,aACjB,EACF;CACF,CAEqC,CAAC;AACxC;;;;;AAMA,SAAgB,+BAA+B,SAA4C;CACzF,OAAO,CACL;EACE,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO,YAAY;GAGjB,OAAO,EACL,OAAO,EACL,WAAW,4BAA4B,YAAY,OAAO,EAC5D,EACF;EACF;CACF,CACF;AACF;;;;;;;;;;;;;;;;AAiBA,SAAgB,4BACd,YACA,qBAC+B;CAC/B,MAAM,gBAAgB,YAAY,OAAO;CACzC,IAAI,0BAA0B;CAE9B,MAAM,aAAa;CACnB,MAAM,QAAQ,qBAAqB;CAEnC,IAAI,kBAAkB,OAAO;EAC3B,0BAA0B;EAE1B,IAAI,OAGF,QAAQ,KACN,4FAA4F,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,3 +1,2 @@
1
- export * from '@sentry/solid';
2
- export { init } from './sdk.js';
3
- //# sourceMappingURL=index.js.map
1
+ export { init } from "./sdk.js";
2
+ export * from "@sentry/solid";
@@ -1,23 +1,24 @@
1
- import { applySdkMetadata } from '@sentry/core';
2
- import { applyTunnelBasePath } from '../common/tunnel.js';
3
- import { init as init$1, getDefaultIntegrations as getDefaultIntegrations$1, browserTracingIntegration } from '@sentry/solid';
4
-
1
+ import { applyTunnelBasePath } from "../common/tunnel.js";
2
+ import { browserTracingIntegration, getDefaultIntegrations as getDefaultIntegrations$1, init as init$1 } from "@sentry/solid";
3
+ import { applySdkMetadata } from "@sentry/core";
4
+ // src/client/sdk.ts
5
+ /**
6
+ * Initializes the client side of the Solid Start SDK.
7
+ */
5
8
  function init(options) {
6
- const opts = {
7
- defaultIntegrations: getDefaultIntegrations(options),
8
- ...options
9
- };
10
- applyTunnelBasePath(opts);
11
- applySdkMetadata(opts, "solidstart", ["solidstart", "solid"]);
12
- return init$1(opts);
9
+ const opts = {
10
+ defaultIntegrations: getDefaultIntegrations(options),
11
+ ...options
12
+ };
13
+ applyTunnelBasePath(opts);
14
+ applySdkMetadata(opts, "solidstart", ["solidstart", "solid"]);
15
+ return init$1(opts);
13
16
  }
14
17
  function getDefaultIntegrations(options) {
15
- const integrations = getDefaultIntegrations$1(options);
16
- if (typeof __SENTRY_TRACING__ === "undefined" || __SENTRY_TRACING__) {
17
- integrations.push(browserTracingIntegration());
18
- }
19
- return integrations;
18
+ const integrations = getDefaultIntegrations$1(options);
19
+ if (typeof __SENTRY_TRACING__ === "undefined" || __SENTRY_TRACING__) integrations.push(browserTracingIntegration());
20
+ return integrations;
20
21
  }
21
-
22
22
  export { init };
23
- //# sourceMappingURL=sdk.js.map
23
+
24
+ //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../../src/client/sdk.ts"],"sourcesContent":["import type { Client, Integration } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { BrowserOptions } from '@sentry/solid';\nimport { applyTunnelBasePath } from '../common/tunnel';\nimport {\n browserTracingIntegration,\n getDefaultIntegrations as getDefaultSolidIntegrations,\n init as initSolidSDK,\n} from '@sentry/solid';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean;\n\n/**\n * Initializes the client side of the Solid Start SDK.\n */\nexport function init(options: BrowserOptions): Client | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applyTunnelBasePath(opts);\n applySdkMetadata(opts, 'solidstart', ['solidstart', 'solid']);\n\n return initSolidSDK(opts);\n}\n\nfunction getDefaultIntegrations(options: BrowserOptions): Integration[] {\n const integrations = getDefaultSolidIntegrations(options);\n\n // This evaluates to true unless __SENTRY_TRACING__ is text-replaced with \"false\",\n // in which case everything inside will get tree-shaken away\n if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {\n // We add the default BrowserTracingIntegration here always.\n // We can do this, even if `solidRouterBrowserTracingIntegration` is\n // supplied as integration in `init` by users because it will win\n // over the default integration by virtue of having the same\n // `BrowserTracing` integration name and being added later.\n integrations.push(browserTracingIntegration());\n }\n\n return integrations;\n}\n"],"names":["initSolidSDK","getDefaultSolidIntegrations"],"mappings":";;;;AAgBO,SAAS,KAAK,OAAA,EAA6C;AAChE,EAAA,MAAM,IAAA,GAAO;AAAA,IACX,mBAAA,EAAqB,uBAAuB,OAAO,CAAA;AAAA,IACnD,GAAG;AAAA,GACL;AAEA,EAAA,mBAAA,CAAoB,IAAI,CAAA;AACxB,EAAA,gBAAA,CAAiB,IAAA,EAAM,YAAA,EAAc,CAAC,YAAA,EAAc,OAAO,CAAC,CAAA;AAE5D,EAAA,OAAOA,OAAa,IAAI,CAAA;AAC1B;AAEA,SAAS,uBAAuB,OAAA,EAAwC;AACtE,EAAA,MAAM,YAAA,GAAeC,yBAA4B,OAAO,CAAA;AAIxD,EAAA,IAAI,OAAO,kBAAA,KAAuB,WAAA,IAAe,kBAAA,EAAoB;AAMnE,IAAA,YAAA,CAAa,IAAA,CAAK,2BAA2B,CAAA;AAAA,EAC/C;AAEA,EAAA,OAAO,YAAA;AACT;;;;"}
1
+ {"version":3,"file":"sdk.js","names":["initSolidSDK","getDefaultSolidIntegrations"],"sources":["../../../src/client/sdk.ts"],"sourcesContent":["import type { Client, Integration } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { BrowserOptions } from '@sentry/solid';\nimport { applyTunnelBasePath } from '../common/tunnel';\nimport {\n browserTracingIntegration,\n getDefaultIntegrations as getDefaultSolidIntegrations,\n init as initSolidSDK,\n} from '@sentry/solid';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean;\n\n/**\n * Initializes the client side of the Solid Start SDK.\n */\nexport function init(options: BrowserOptions): Client | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applyTunnelBasePath(opts);\n applySdkMetadata(opts, 'solidstart', ['solidstart', 'solid']);\n\n return initSolidSDK(opts);\n}\n\nfunction getDefaultIntegrations(options: BrowserOptions): Integration[] {\n const integrations = getDefaultSolidIntegrations(options);\n\n // This evaluates to true unless __SENTRY_TRACING__ is text-replaced with \"false\",\n // in which case everything inside will get tree-shaken away\n if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) {\n // We add the default BrowserTracingIntegration here always.\n // We can do this, even if `solidRouterBrowserTracingIntegration` is\n // supplied as integration in `init` by users because it will win\n // over the default integration by virtue of having the same\n // `BrowserTracing` integration name and being added later.\n integrations.push(browserTracingIntegration());\n }\n\n return integrations;\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,KAAK,SAA6C;CAChE,MAAM,OAAO;EACX,qBAAqB,uBAAuB,OAAO;EACnD,GAAG;CACL;CAEA,oBAAoB,IAAI;CACxB,iBAAiB,MAAM,cAAc,CAAC,cAAc,OAAO,CAAC;CAE5D,OAAOA,OAAa,IAAI;AAC1B;AAEA,SAAS,uBAAuB,SAAwC;CACtE,MAAM,eAAeC,yBAA4B,OAAO;CAIxD,IAAI,OAAO,uBAAuB,eAAe,oBAM/C,aAAa,KAAK,0BAA0B,CAAC;CAG/C,OAAO;AACT"}
@@ -1,2 +1 @@
1
- export * from '@sentry/solid/solidrouter';
2
- //# sourceMappingURL=solidrouter.js.map
1
+ export * from "@sentry/solid/solidrouter";
@@ -1,10 +1,15 @@
1
- import { _INTERNAL_applyBrowserTunnelDefaults } from '@sentry/core';
2
-
1
+ import { _INTERNAL_applyBrowserTunnelDefaults } from "@sentry/core";
2
+ // src/common/tunnel.ts
3
+ /** Set on the server by `withSentry` to the app's `server.baseURL`. */
3
4
  const TUNNEL_BASE_PATH_GLOBAL = "__sentry_solidstart_base_path";
5
+ /**
6
+ * Serves the browser's managed tunnel under the app's base path, which `withSentry` (SolidStart 1) or
7
+ * `sentrySolidStart` (SolidStart 2) defines at build time. A `basePath` the user set wins.
8
+ */
4
9
  function applyTunnelBasePath(options) {
5
- const basePath = typeof __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ !== "undefined" ? __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ : "";
6
- options.tunnel = _INTERNAL_applyBrowserTunnelDefaults(options.tunnel, { basePath });
10
+ const basePath = typeof __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ !== "undefined" ? __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ : "";
11
+ options.tunnel = _INTERNAL_applyBrowserTunnelDefaults(options.tunnel, { basePath });
7
12
  }
8
-
9
13
  export { TUNNEL_BASE_PATH_GLOBAL, applyTunnelBasePath };
10
- //# sourceMappingURL=tunnel.js.map
14
+
15
+ //# sourceMappingURL=tunnel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tunnel.js","sources":["../../../src/common/tunnel.ts"],"sourcesContent":["import type { Options } from '@sentry/core';\nimport { _INTERNAL_applyBrowserTunnelDefaults as applyBrowserTunnelDefaults } from '@sentry/core';\n\n/** Set on the server by `withSentry` to the app's `server.baseURL`. */\nexport const TUNNEL_BASE_PATH_GLOBAL = '__sentry_solidstart_base_path';\n\ndeclare const __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: string | undefined;\n\n/**\n * Serves the browser's managed tunnel under the app's base path, which `withSentry` (SolidStart 1) or\n * `sentrySolidStart` (SolidStart 2) defines at build time. A `basePath` the user set wins.\n */\nexport function applyTunnelBasePath(options: Pick<Options, 'tunnel'>): void {\n const basePath =\n typeof __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ !== 'undefined' ? __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ : '';\n options.tunnel = applyBrowserTunnelDefaults(options.tunnel, { basePath });\n}\n"],"names":["applyBrowserTunnelDefaults"],"mappings":";;AAIO,MAAM,uBAAA,GAA0B;AAQhC,SAAS,oBAAoB,OAAA,EAAwC;AAC1E,EAAA,MAAM,QAAA,GACJ,OAAO,sCAAA,KAA2C,WAAA,GAAc,sCAAA,GAAyC,EAAA;AAC3G,EAAA,OAAA,CAAQ,SAASA,oCAAA,CAA2B,OAAA,CAAQ,MAAA,EAAQ,EAAE,UAAU,CAAA;AAC1E;;;;"}
1
+ {"version":3,"file":"tunnel.js","names":["applyBrowserTunnelDefaults"],"sources":["../../../src/common/tunnel.ts"],"sourcesContent":["import type { Options } from '@sentry/core';\nimport { _INTERNAL_applyBrowserTunnelDefaults as applyBrowserTunnelDefaults } from '@sentry/core';\n\n/** Set on the server by `withSentry` to the app's `server.baseURL`. */\nexport const TUNNEL_BASE_PATH_GLOBAL = '__sentry_solidstart_base_path';\n\ndeclare const __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: string | undefined;\n\n/**\n * Serves the browser's managed tunnel under the app's base path, which `withSentry` (SolidStart 1) or\n * `sentrySolidStart` (SolidStart 2) defines at build time. A `basePath` the user set wins.\n */\nexport function applyTunnelBasePath(options: Pick<Options, 'tunnel'>): void {\n const basePath =\n typeof __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ !== 'undefined' ? __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__ : '';\n options.tunnel = applyBrowserTunnelDefaults(options.tunnel, { basePath });\n}\n"],"mappings":";;;AAIA,MAAa,0BAA0B;;;;;AAQvC,SAAgB,oBAAoB,SAAwC;CAC1E,MAAM,WACJ,OAAO,2CAA2C,cAAc,yCAAyC;CAC3G,QAAQ,SAASA,qCAA2B,QAAQ,QAAQ,EAAE,SAAS,CAAC;AAC1E"}