@sentry/tanstackstart-react 10.34.0 → 10.36.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.
@@ -1,6 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const index = require('./server/index.js');
4
+ const sentryTanstackStart = require('./vite/sentryTanstackStart.js');
4
5
  const sdk = require('./server/sdk.js');
5
6
  const wrapFetchWithSentry = require('./server/wrapFetchWithSentry.js');
6
7
  const middleware = require('./server/middleware.js');
@@ -10,6 +11,7 @@ const node = require('@sentry/node');
10
11
 
11
12
  exports.ErrorBoundary = index.ErrorBoundary;
12
13
  exports.withErrorBoundary = index.withErrorBoundary;
14
+ exports.sentryTanstackStart = sentryTanstackStart.sentryTanstackStart;
13
15
  exports.init = sdk.init;
14
16
  exports.wrapFetchWithSentry = wrapFetchWithSentry.wrapFetchWithSentry;
15
17
  exports.wrapMiddlewaresWithSentry = middleware.wrapMiddlewaresWithSentry;
@@ -1 +1 @@
1
- {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,46 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const sourceMaps = require('./sourceMaps.js');
4
+
5
+ /**
6
+ * Vite plugins for the Sentry TanStack Start SDK.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // vite.config.ts
11
+ * import { defineConfig } from 'vite';
12
+ * import { sentryTanstackStart } from '@sentry/tanstackstart-react';
13
+ * import { tanstackStart } from '@tanstack/react-start/plugin/vite';
14
+ *
15
+ * export default defineConfig({
16
+ * plugins: [
17
+ * sentryTanstackStart({
18
+ * org: 'your-org',
19
+ * project: 'your-project',
20
+ * }),
21
+ * tanstackStart(),
22
+ * ],
23
+ * });
24
+ * ```
25
+ *
26
+ * @param options - Options to configure the Sentry Vite plugins
27
+ * @returns An array of Vite plugins
28
+ */
29
+ function sentryTanstackStart(options = {}) {
30
+ // Only add plugins in production builds
31
+ if (process.env.NODE_ENV === 'development') {
32
+ return [];
33
+ }
34
+
35
+ const plugins = [...sourceMaps.makeAddSentryVitePlugin(options)];
36
+
37
+ const sourceMapsDisabled = options.sourcemaps?.disable === true || options.sourcemaps?.disable === 'disable-upload';
38
+ if (!sourceMapsDisabled) {
39
+ plugins.push(...sourceMaps.makeEnableSourceMapsVitePlugin(options));
40
+ }
41
+
42
+ return plugins;
43
+ }
44
+
45
+ exports.sentryTanstackStart = sentryTanstackStart;
46
+ //# sourceMappingURL=sentryTanstackStart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentryTanstackStart.js","sources":["../../../src/vite/sentryTanstackStart.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport type { Plugin } from 'vite';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Vite plugins for the Sentry TanStack Start SDK.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import { sentryTanstackStart } from '@sentry/tanstackstart-react';\n * import { tanstackStart } from '@tanstack/react-start/plugin/vite';\n *\n * export default defineConfig({\n * plugins: [\n * sentryTanstackStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * tanstackStart(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentryTanstackStart(options: BuildTimeOptionsBase = {}): Plugin[] {\n // Only add plugins in production builds\n if (process.env.NODE_ENV === 'development') {\n return [];\n }\n\n const plugins: Plugin[] = [...makeAddSentryVitePlugin(options)];\n\n const sourceMapsDisabled = options.sourcemaps?.disable === true || options.sourcemaps?.disable === 'disable-upload';\n if (!sourceMapsDisabled) {\n plugins.push(...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n"],"names":["makeAddSentryVitePlugin","makeEnableSourceMapsVitePlugin"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,OAAO,GAAyB,EAAE,EAAY;AAClF;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAA,KAAa,aAAa,EAAE;AAC9C,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,OAAO,GAAa,CAAC,GAAGA,kCAAuB,CAAC,OAAO,CAAC,CAAC;;AAEjE,EAAE,MAAM,kBAAA,GAAqB,OAAO,CAAC,UAAU,EAAE,OAAA,KAAY,IAAA,IAAQ,OAAO,CAAC,UAAU,EAAE,OAAA,KAAY,gBAAgB;AACrH,EAAE,IAAI,CAAC,kBAAkB,EAAE;AAC3B,IAAI,OAAO,CAAC,IAAI,CAAC,GAAGC,yCAA8B,CAAC,OAAO,CAAC,CAAC;AAC5D,EAAE;;AAEF,EAAE,OAAO,OAAO;AAChB;;;;"}
@@ -0,0 +1,165 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const vitePlugin = require('@sentry/vite-plugin');
4
+
5
+ /**
6
+ * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.
7
+ */
8
+ function makeAddSentryVitePlugin(options) {
9
+ const {
10
+ authToken,
11
+ bundleSizeOptimizations,
12
+ debug,
13
+ errorHandler,
14
+ headers,
15
+ org,
16
+ project,
17
+ release,
18
+ sentryUrl,
19
+ silent,
20
+ sourcemaps,
21
+ telemetry,
22
+ } = options;
23
+
24
+ // defer resolving the filesToDeleteAfterUpload until we got access to the Vite config
25
+ let resolveFilesToDeleteAfterUpload;
26
+ const filesToDeleteAfterUploadPromise = new Promise(resolve => {
27
+ resolveFilesToDeleteAfterUpload = resolve;
28
+ });
29
+
30
+ const configPlugin = {
31
+ name: 'sentry-tanstackstart-files-to-delete-after-upload-plugin',
32
+ apply: 'build',
33
+ enforce: 'post',
34
+ config(config) {
35
+ const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;
36
+
37
+ // Only auto-delete source maps if the user didn't configure sourcemaps at all
38
+ if (typeof userFilesToDelete === 'undefined' && typeof config.build?.sourcemap === 'undefined') {
39
+ if (debug) {
40
+ // eslint-disable-next-line no-console
41
+ console.log(
42
+ '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: ["./**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
43
+ );
44
+ }
45
+ resolveFilesToDeleteAfterUpload?.(['./**/*.map']);
46
+ } else {
47
+ resolveFilesToDeleteAfterUpload?.(userFilesToDelete);
48
+ }
49
+ },
50
+ };
51
+
52
+ const sentryPlugins = vitePlugin.sentryVitePlugin({
53
+ authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
54
+ bundleSizeOptimizations: bundleSizeOptimizations ?? undefined,
55
+ debug: debug ?? false,
56
+ errorHandler,
57
+ headers,
58
+ org: org ?? process.env.SENTRY_ORG,
59
+ project: project ?? process.env.SENTRY_PROJECT,
60
+ release,
61
+ silent,
62
+ sourcemaps: {
63
+ assets: sourcemaps?.assets,
64
+ disable: sourcemaps?.disable,
65
+ ignore: sourcemaps?.ignore,
66
+ filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,
67
+ },
68
+ telemetry: telemetry ?? true,
69
+ url: sentryUrl,
70
+ _metaOptions: {
71
+ telemetry: {
72
+ metaFramework: 'tanstackstart-react',
73
+ },
74
+ },
75
+ });
76
+
77
+ return [configPlugin, ...sentryPlugins];
78
+ }
79
+
80
+ /**
81
+ * A Sentry plugin for TanStack Start React to enable "hidden" source maps if they are unset.
82
+ */
83
+ function makeEnableSourceMapsVitePlugin(options) {
84
+ return [
85
+ {
86
+ name: 'sentry-tanstackstart-react-source-maps',
87
+ apply: 'build',
88
+ enforce: 'post',
89
+ config(viteConfig) {
90
+ return {
91
+ ...viteConfig,
92
+ build: {
93
+ ...viteConfig.build,
94
+ sourcemap: getUpdatedSourceMapSettings(viteConfig, options),
95
+ },
96
+ };
97
+ },
98
+ },
99
+ ];
100
+ }
101
+
102
+ /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
103
+ *
104
+ * 1. User explicitly disabled source maps
105
+ * - keep this setting (emit a warning that errors won't be unminified in Sentry)
106
+ * - We won't upload anything
107
+ *
108
+ * 2. Users enabled source map generation (true, 'hidden', 'inline').
109
+ * - keep this setting (don't do anything - like deletion - besides uploading)
110
+ *
111
+ * 3. Users didn't set source maps generation
112
+ * - we enable 'hidden' source maps generation
113
+ * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
114
+ *
115
+ * --> only exported for testing
116
+ */
117
+ function getUpdatedSourceMapSettings(
118
+ viteConfig,
119
+ sentryPluginOptions,
120
+ ) {
121
+ viteConfig.build = viteConfig.build || {};
122
+
123
+ const viteUserSourceMapSetting = viteConfig.build?.sourcemap;
124
+ const settingKey = 'vite.build.sourcemap';
125
+ const debug = sentryPluginOptions?.debug;
126
+
127
+ // Respect user source map setting if it is explicitly set
128
+ if (viteUserSourceMapSetting === false) {
129
+ if (debug) {
130
+ // eslint-disable-next-line no-console
131
+ console.warn(
132
+ `[Sentry] Source map generation is currently disabled in your TanStack Start configuration (\`${settingKey}: false\`). Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified.`,
133
+ );
134
+ } else {
135
+ // eslint-disable-next-line no-console
136
+ console.warn('[Sentry] Source map generation is disabled in your TanStack Start configuration.');
137
+ }
138
+
139
+ return viteUserSourceMapSetting;
140
+ } else if (viteUserSourceMapSetting && ['hidden', 'inline', true].includes(viteUserSourceMapSetting)) {
141
+ if (debug) {
142
+ // eslint-disable-next-line no-console
143
+ console.log(
144
+ `[Sentry] We discovered \`${settingKey}\` is set to \`${viteUserSourceMapSetting.toString()}\`. Sentry will keep this source map setting.`,
145
+ );
146
+ }
147
+
148
+ return viteUserSourceMapSetting;
149
+ }
150
+
151
+ // If the user did not specify a source map setting, we enable 'hidden' by default
152
+ if (debug) {
153
+ // eslint-disable-next-line no-console
154
+ console.log(
155
+ `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`,
156
+ );
157
+ }
158
+
159
+ return 'hidden';
160
+ }
161
+
162
+ exports.getUpdatedSourceMapSettings = getUpdatedSourceMapSettings;
163
+ exports.makeAddSentryVitePlugin = makeAddSentryVitePlugin;
164
+ exports.makeEnableSourceMapsVitePlugin = makeEnableSourceMapsVitePlugin;
165
+ //# sourceMappingURL=sourceMaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport { sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { Plugin, UserConfig } from 'vite';\n\ntype FilesToDeleteAfterUpload = string | string[] | undefined;\n\n/**\n * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: BuildTimeOptionsBase): Plugin[] {\n const {\n authToken,\n bundleSizeOptimizations,\n debug,\n errorHandler,\n headers,\n org,\n project,\n release,\n sentryUrl,\n silent,\n sourcemaps,\n telemetry,\n } = options;\n\n // defer resolving the filesToDeleteAfterUpload until we got access to the Vite config\n let resolveFilesToDeleteAfterUpload: ((value: FilesToDeleteAfterUpload) => void) | undefined;\n const filesToDeleteAfterUploadPromise = new Promise<FilesToDeleteAfterUpload>(resolve => {\n resolveFilesToDeleteAfterUpload = resolve;\n });\n\n const configPlugin: Plugin = {\n name: 'sentry-tanstackstart-files-to-delete-after-upload-plugin',\n apply: 'build',\n enforce: 'post',\n config(config) {\n const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;\n\n // Only auto-delete source maps if the user didn't configure sourcemaps at all\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 authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations: bundleSizeOptimizations ?? undefined,\n debug: debug ?? false,\n errorHandler,\n headers,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n release,\n silent,\n sourcemaps: {\n assets: sourcemaps?.assets,\n disable: sourcemaps?.disable,\n ignore: sourcemaps?.ignore,\n filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,\n },\n telemetry: telemetry ?? true,\n url: sentryUrl,\n _metaOptions: {\n telemetry: {\n metaFramework: 'tanstackstart-react',\n },\n },\n });\n\n return [configPlugin, ...sentryPlugins];\n}\n\n/**\n * A Sentry plugin for TanStack Start React to enable \"hidden\" source maps if they are unset.\n */\nexport function makeEnableSourceMapsVitePlugin(options: BuildTimeOptionsBase): Plugin[] {\n return [\n {\n name: 'sentry-tanstackstart-react-source-maps',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n return {\n ...viteConfig,\n build: {\n ...viteConfig.build,\n sourcemap: getUpdatedSourceMapSettings(viteConfig, options),\n },\n };\n },\n },\n ];\n}\n\n/** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)\n *\n * 1. User explicitly disabled source maps\n * - keep this setting (emit a warning that errors won't be unminified in Sentry)\n * - We won't upload anything\n *\n * 2. Users enabled source map generation (true, 'hidden', 'inline').\n * - keep this setting (don't do anything - like deletion - besides uploading)\n *\n * 3. Users didn't set source maps generation\n * - we enable 'hidden' source maps generation\n * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n *\n * --> only exported for testing\n */\nexport function getUpdatedSourceMapSettings(\n viteConfig: UserConfig,\n sentryPluginOptions?: BuildTimeOptionsBase,\n): boolean | 'inline' | 'hidden' {\n viteConfig.build = viteConfig.build || {};\n\n const viteUserSourceMapSetting = viteConfig.build?.sourcemap;\n const settingKey = 'vite.build.sourcemap';\n const debug = sentryPluginOptions?.debug;\n\n // Respect user source map setting if it is explicitly set\n if (viteUserSourceMapSetting === false) {\n if (debug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your TanStack Start configuration (\\`${settingKey}: false\\`). Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Source map generation is disabled in your TanStack Start configuration.');\n }\n\n return viteUserSourceMapSetting;\n } else if (viteUserSourceMapSetting && ['hidden', 'inline', true].includes(viteUserSourceMapSetting)) {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${viteUserSourceMapSetting.toString()}\\`. Sentry will keep this source map setting.`,\n );\n }\n\n return viteUserSourceMapSetting;\n }\n\n // If the user did not specify a source map setting, we enable 'hidden' by default\n if (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 'hidden';\n}\n"],"names":["sentryVitePlugin"],"mappings":";;;;AAMA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAkC;AACjF,EAAE,MAAM;AACR,IAAI,SAAS;AACb,IAAI,uBAAuB;AAC3B,IAAI,KAAK;AACT,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,IAAI,GAAG;AACP,IAAI,OAAO;AACX,IAA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C3C,EAAE,MAAM,KAAA,GAAQ,mBAAmB,EAAE,KAAK;;AAE1C;AACA,EAAE,IAAI,wBAAA,KAA6B,KAAK,EAAE;AAC1C,IAAI,IAAI,KAAK,EAAE;AACf;AACA,MAAM,OAAO,CAAC,IAAI;AAClB,QAAQ,CAAC,6FAA6F,EAAE,UAAU,CAAC,kIAAkI,CAAC;AACtP,OAAO;AACP,IAAI,OAAO;AACX;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,kFAAkF,CAAC;AACtG,IAAI;;AAEJ,IAAI,OAAO,wBAAwB;AACnC,EAAE,OAAO,IAAI,wBAAA,IAA4B,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE;AACxG,IAAI,IAAI,KAAK,EAAE;AACf;AACA,MAAM,OAAO,CAAC,GAAG;AACjB,QAAQ,CAAC,yBAAyB,EAAE,UAAU,CAAC,eAAe,EAAE,wBAAwB,CAAC,QAAQ,EAAE,CAAC,6CAA6C,CAAC;AAClJ,OAAO;AACP,IAAI;;AAEJ,IAAI,OAAO,wBAAwB;AACnC,EAAE;;AAEF;AACA,EAAE,IAAI,KAAK,EAAE;AACb;AACA,IAAI,OAAO,CAAC,GAAG;AACf,MAAM,CAAC,mEAAmE,EAAE,UAAU,CAAC,iFAAiF,CAAC;AACzK,KAAK;AACL,EAAE;;AAEF,EAAE,OAAO,QAAQ;AACjB;;;;;;"}
@@ -1,4 +1,5 @@
1
1
  export { ErrorBoundary, withErrorBoundary } from './server/index.js';
2
+ export { sentryTanstackStart } from './vite/sentryTanstackStart.js';
2
3
  export { init } from './server/sdk.js';
3
4
  export { wrapFetchWithSentry } from './server/wrapFetchWithSentry.js';
4
5
  export { wrapMiddlewaresWithSentry } from './server/middleware.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.34.0","sideEffects":false}
1
+ {"type":"module","version":"10.36.0","sideEffects":false}
@@ -0,0 +1,44 @@
1
+ import { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps.js';
2
+
3
+ /**
4
+ * Vite plugins for the Sentry TanStack Start SDK.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * // vite.config.ts
9
+ * import { defineConfig } from 'vite';
10
+ * import { sentryTanstackStart } from '@sentry/tanstackstart-react';
11
+ * import { tanstackStart } from '@tanstack/react-start/plugin/vite';
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [
15
+ * sentryTanstackStart({
16
+ * org: 'your-org',
17
+ * project: 'your-project',
18
+ * }),
19
+ * tanstackStart(),
20
+ * ],
21
+ * });
22
+ * ```
23
+ *
24
+ * @param options - Options to configure the Sentry Vite plugins
25
+ * @returns An array of Vite plugins
26
+ */
27
+ function sentryTanstackStart(options = {}) {
28
+ // Only add plugins in production builds
29
+ if (process.env.NODE_ENV === 'development') {
30
+ return [];
31
+ }
32
+
33
+ const plugins = [...makeAddSentryVitePlugin(options)];
34
+
35
+ const sourceMapsDisabled = options.sourcemaps?.disable === true || options.sourcemaps?.disable === 'disable-upload';
36
+ if (!sourceMapsDisabled) {
37
+ plugins.push(...makeEnableSourceMapsVitePlugin(options));
38
+ }
39
+
40
+ return plugins;
41
+ }
42
+
43
+ export { sentryTanstackStart };
44
+ //# sourceMappingURL=sentryTanstackStart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentryTanstackStart.js","sources":["../../../src/vite/sentryTanstackStart.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport type { Plugin } from 'vite';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Vite plugins for the Sentry TanStack Start SDK.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import { sentryTanstackStart } from '@sentry/tanstackstart-react';\n * import { tanstackStart } from '@tanstack/react-start/plugin/vite';\n *\n * export default defineConfig({\n * plugins: [\n * sentryTanstackStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * tanstackStart(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentryTanstackStart(options: BuildTimeOptionsBase = {}): Plugin[] {\n // Only add plugins in production builds\n if (process.env.NODE_ENV === 'development') {\n return [];\n }\n\n const plugins: Plugin[] = [...makeAddSentryVitePlugin(options)];\n\n const sourceMapsDisabled = options.sourcemaps?.disable === true || options.sourcemaps?.disable === 'disable-upload';\n if (!sourceMapsDisabled) {\n plugins.push(...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,OAAO,GAAyB,EAAE,EAAY;AAClF;AACA,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAA,KAAa,aAAa,EAAE;AAC9C,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,OAAO,GAAa,CAAC,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;;AAEjE,EAAE,MAAM,kBAAA,GAAqB,OAAO,CAAC,UAAU,EAAE,OAAA,KAAY,IAAA,IAAQ,OAAO,CAAC,UAAU,EAAE,OAAA,KAAY,gBAAgB;AACrH,EAAE,IAAI,CAAC,kBAAkB,EAAE;AAC3B,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;AAC5D,EAAE;;AAEF,EAAE,OAAO,OAAO;AAChB;;;;"}
@@ -0,0 +1,161 @@
1
+ import { sentryVitePlugin } from '@sentry/vite-plugin';
2
+
3
+ /**
4
+ * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.
5
+ */
6
+ function makeAddSentryVitePlugin(options) {
7
+ const {
8
+ authToken,
9
+ bundleSizeOptimizations,
10
+ debug,
11
+ errorHandler,
12
+ headers,
13
+ org,
14
+ project,
15
+ release,
16
+ sentryUrl,
17
+ silent,
18
+ sourcemaps,
19
+ telemetry,
20
+ } = options;
21
+
22
+ // defer resolving the filesToDeleteAfterUpload until we got access to the Vite config
23
+ let resolveFilesToDeleteAfterUpload;
24
+ const filesToDeleteAfterUploadPromise = new Promise(resolve => {
25
+ resolveFilesToDeleteAfterUpload = resolve;
26
+ });
27
+
28
+ const configPlugin = {
29
+ name: 'sentry-tanstackstart-files-to-delete-after-upload-plugin',
30
+ apply: 'build',
31
+ enforce: 'post',
32
+ config(config) {
33
+ const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;
34
+
35
+ // Only auto-delete source maps if the user didn't configure sourcemaps at all
36
+ if (typeof userFilesToDelete === 'undefined' && typeof config.build?.sourcemap === 'undefined') {
37
+ if (debug) {
38
+ // eslint-disable-next-line no-console
39
+ console.log(
40
+ '[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: ["./**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
41
+ );
42
+ }
43
+ resolveFilesToDeleteAfterUpload?.(['./**/*.map']);
44
+ } else {
45
+ resolveFilesToDeleteAfterUpload?.(userFilesToDelete);
46
+ }
47
+ },
48
+ };
49
+
50
+ const sentryPlugins = sentryVitePlugin({
51
+ authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
52
+ bundleSizeOptimizations: bundleSizeOptimizations ?? undefined,
53
+ debug: debug ?? false,
54
+ errorHandler,
55
+ headers,
56
+ org: org ?? process.env.SENTRY_ORG,
57
+ project: project ?? process.env.SENTRY_PROJECT,
58
+ release,
59
+ silent,
60
+ sourcemaps: {
61
+ assets: sourcemaps?.assets,
62
+ disable: sourcemaps?.disable,
63
+ ignore: sourcemaps?.ignore,
64
+ filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,
65
+ },
66
+ telemetry: telemetry ?? true,
67
+ url: sentryUrl,
68
+ _metaOptions: {
69
+ telemetry: {
70
+ metaFramework: 'tanstackstart-react',
71
+ },
72
+ },
73
+ });
74
+
75
+ return [configPlugin, ...sentryPlugins];
76
+ }
77
+
78
+ /**
79
+ * A Sentry plugin for TanStack Start React to enable "hidden" source maps if they are unset.
80
+ */
81
+ function makeEnableSourceMapsVitePlugin(options) {
82
+ return [
83
+ {
84
+ name: 'sentry-tanstackstart-react-source-maps',
85
+ apply: 'build',
86
+ enforce: 'post',
87
+ config(viteConfig) {
88
+ return {
89
+ ...viteConfig,
90
+ build: {
91
+ ...viteConfig.build,
92
+ sourcemap: getUpdatedSourceMapSettings(viteConfig, options),
93
+ },
94
+ };
95
+ },
96
+ },
97
+ ];
98
+ }
99
+
100
+ /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
101
+ *
102
+ * 1. User explicitly disabled source maps
103
+ * - keep this setting (emit a warning that errors won't be unminified in Sentry)
104
+ * - We won't upload anything
105
+ *
106
+ * 2. Users enabled source map generation (true, 'hidden', 'inline').
107
+ * - keep this setting (don't do anything - like deletion - besides uploading)
108
+ *
109
+ * 3. Users didn't set source maps generation
110
+ * - we enable 'hidden' source maps generation
111
+ * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
112
+ *
113
+ * --> only exported for testing
114
+ */
115
+ function getUpdatedSourceMapSettings(
116
+ viteConfig,
117
+ sentryPluginOptions,
118
+ ) {
119
+ viteConfig.build = viteConfig.build || {};
120
+
121
+ const viteUserSourceMapSetting = viteConfig.build?.sourcemap;
122
+ const settingKey = 'vite.build.sourcemap';
123
+ const debug = sentryPluginOptions?.debug;
124
+
125
+ // Respect user source map setting if it is explicitly set
126
+ if (viteUserSourceMapSetting === false) {
127
+ if (debug) {
128
+ // eslint-disable-next-line no-console
129
+ console.warn(
130
+ `[Sentry] Source map generation is currently disabled in your TanStack Start configuration (\`${settingKey}: false\`). Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified.`,
131
+ );
132
+ } else {
133
+ // eslint-disable-next-line no-console
134
+ console.warn('[Sentry] Source map generation is disabled in your TanStack Start configuration.');
135
+ }
136
+
137
+ return viteUserSourceMapSetting;
138
+ } else if (viteUserSourceMapSetting && ['hidden', 'inline', true].includes(viteUserSourceMapSetting)) {
139
+ if (debug) {
140
+ // eslint-disable-next-line no-console
141
+ console.log(
142
+ `[Sentry] We discovered \`${settingKey}\` is set to \`${viteUserSourceMapSetting.toString()}\`. Sentry will keep this source map setting.`,
143
+ );
144
+ }
145
+
146
+ return viteUserSourceMapSetting;
147
+ }
148
+
149
+ // If the user did not specify a source map setting, we enable 'hidden' by default
150
+ if (debug) {
151
+ // eslint-disable-next-line no-console
152
+ console.log(
153
+ `[Sentry] Enabled source map generation in the build options with \`${settingKey}: 'hidden'\`. The source maps will be deleted after they were uploaded to Sentry.`,
154
+ );
155
+ }
156
+
157
+ return 'hidden';
158
+ }
159
+
160
+ export { getUpdatedSourceMapSettings, makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin };
161
+ //# sourceMappingURL=sourceMaps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport { sentryVitePlugin } from '@sentry/vite-plugin';\nimport type { Plugin, UserConfig } from 'vite';\n\ntype FilesToDeleteAfterUpload = string | string[] | undefined;\n\n/**\n * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.\n */\nexport function makeAddSentryVitePlugin(options: BuildTimeOptionsBase): Plugin[] {\n const {\n authToken,\n bundleSizeOptimizations,\n debug,\n errorHandler,\n headers,\n org,\n project,\n release,\n sentryUrl,\n silent,\n sourcemaps,\n telemetry,\n } = options;\n\n // defer resolving the filesToDeleteAfterUpload until we got access to the Vite config\n let resolveFilesToDeleteAfterUpload: ((value: FilesToDeleteAfterUpload) => void) | undefined;\n const filesToDeleteAfterUploadPromise = new Promise<FilesToDeleteAfterUpload>(resolve => {\n resolveFilesToDeleteAfterUpload = resolve;\n });\n\n const configPlugin: Plugin = {\n name: 'sentry-tanstackstart-files-to-delete-after-upload-plugin',\n apply: 'build',\n enforce: 'post',\n config(config) {\n const userFilesToDelete = sourcemaps?.filesToDeleteAfterUpload;\n\n // Only auto-delete source maps if the user didn't configure sourcemaps at all\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 authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,\n bundleSizeOptimizations: bundleSizeOptimizations ?? undefined,\n debug: debug ?? false,\n errorHandler,\n headers,\n org: org ?? process.env.SENTRY_ORG,\n project: project ?? process.env.SENTRY_PROJECT,\n release,\n silent,\n sourcemaps: {\n assets: sourcemaps?.assets,\n disable: sourcemaps?.disable,\n ignore: sourcemaps?.ignore,\n filesToDeleteAfterUpload: filesToDeleteAfterUploadPromise,\n },\n telemetry: telemetry ?? true,\n url: sentryUrl,\n _metaOptions: {\n telemetry: {\n metaFramework: 'tanstackstart-react',\n },\n },\n });\n\n return [configPlugin, ...sentryPlugins];\n}\n\n/**\n * A Sentry plugin for TanStack Start React to enable \"hidden\" source maps if they are unset.\n */\nexport function makeEnableSourceMapsVitePlugin(options: BuildTimeOptionsBase): Plugin[] {\n return [\n {\n name: 'sentry-tanstackstart-react-source-maps',\n apply: 'build',\n enforce: 'post',\n config(viteConfig) {\n return {\n ...viteConfig,\n build: {\n ...viteConfig.build,\n sourcemap: getUpdatedSourceMapSettings(viteConfig, options),\n },\n };\n },\n },\n ];\n}\n\n/** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)\n *\n * 1. User explicitly disabled source maps\n * - keep this setting (emit a warning that errors won't be unminified in Sentry)\n * - We won't upload anything\n *\n * 2. Users enabled source map generation (true, 'hidden', 'inline').\n * - keep this setting (don't do anything - like deletion - besides uploading)\n *\n * 3. Users didn't set source maps generation\n * - we enable 'hidden' source maps generation\n * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n *\n * --> only exported for testing\n */\nexport function getUpdatedSourceMapSettings(\n viteConfig: UserConfig,\n sentryPluginOptions?: BuildTimeOptionsBase,\n): boolean | 'inline' | 'hidden' {\n viteConfig.build = viteConfig.build || {};\n\n const viteUserSourceMapSetting = viteConfig.build?.sourcemap;\n const settingKey = 'vite.build.sourcemap';\n const debug = sentryPluginOptions?.debug;\n\n // Respect user source map setting if it is explicitly set\n if (viteUserSourceMapSetting === false) {\n if (debug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your TanStack Start configuration (\\`${settingKey}: false\\`). Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Source map generation is disabled in your TanStack Start configuration.');\n }\n\n return viteUserSourceMapSetting;\n } else if (viteUserSourceMapSetting && ['hidden', 'inline', true].includes(viteUserSourceMapSetting)) {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We discovered \\`${settingKey}\\` is set to \\`${viteUserSourceMapSetting.toString()}\\`. Sentry will keep this source map setting.`,\n );\n }\n\n return viteUserSourceMapSetting;\n }\n\n // If the user did not specify a source map setting, we enable 'hidden' by default\n if (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 ma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
4
+ export * from './vite';
4
5
  //# sourceMappingURL=index.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -5,6 +5,7 @@ export * from './config';
5
5
  export * from './client';
6
6
  export * from './server';
7
7
  export * from './common';
8
+ export * from './vite';
8
9
  /** Initializes Sentry TanStack Start SDK */
9
10
  export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
10
11
  export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
@@ -1 +1 @@
1
- {"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAE3C,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,4CAA4C;AAC5C,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAEtH,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CA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uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,gCAAgC,EAAE,OAAO,SAAS,CAAC,gCAAgC,CAAC;AACzG,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,SAAS,CAAC,sBAAsB,CAAC;AACrF,MAAM,CAAC,OAAO,CAAC,MAAM,0BAA0B,EAAE,OAAO,SAAS,CAAC,0BAA0B,CAAC;AAC7F,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC;AAC7E,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC;AAE7E,MAAM,CAAC,OAAO,CAAC,MAAM,yBAAyB,EAAE,OAAO,SAAS,CAAC,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { sentryTanstackStart } from './sentryTanstackStart';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { BuildTimeOptionsBase } from '@sentry/core';
2
+ import type { Plugin } from 'vite';
3
+ /**
4
+ * Vite plugins for the Sentry TanStack Start SDK.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * // vite.config.ts
9
+ * import { defineConfig } from 'vite';
10
+ * import { sentryTanstackStart } from '@sentry/tanstackstart-react';
11
+ * import { tanstackStart } from '@tanstack/react-start/plugin/vite';
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [
15
+ * sentryTanstackStart({
16
+ * org: 'your-org',
17
+ * project: 'your-project',
18
+ * }),
19
+ * tanstackStart(),
20
+ * ],
21
+ * });
22
+ * ```
23
+ *
24
+ * @param options - Options to configure the Sentry Vite plugins
25
+ * @returns An array of Vite plugins
26
+ */
27
+ export declare function sentryTanstackStart(options?: BuildTimeOptionsBase): Plugin[];
28
+ //# sourceMappingURL=sentryTanstackStart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentryTanstackStart.d.ts","sourceRoot":"","sources":["../../../src/vite/sentryTanstackStart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,EAAE,CAchF"}
@@ -0,0 +1,27 @@
1
+ import type { BuildTimeOptionsBase } from '@sentry/core';
2
+ import type { Plugin, UserConfig } from 'vite';
3
+ /**
4
+ * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.
5
+ */
6
+ export declare function makeAddSentryVitePlugin(options: BuildTimeOptionsBase): Plugin[];
7
+ /**
8
+ * A Sentry plugin for TanStack Start React to enable "hidden" source maps if they are unset.
9
+ */
10
+ export declare function makeEnableSourceMapsVitePlugin(options: BuildTimeOptionsBase): Plugin[];
11
+ /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
12
+ *
13
+ * 1. User explicitly disabled source maps
14
+ * - keep this setting (emit a warning that errors won't be unminified in Sentry)
15
+ * - We won't upload anything
16
+ *
17
+ * 2. Users enabled source map generation (true, 'hidden', 'inline').
18
+ * - keep this setting (don't do anything - like deletion - besides uploading)
19
+ *
20
+ * 3. Users didn't set source maps generation
21
+ * - we enable 'hidden' source maps generation
22
+ * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
23
+ *
24
+ * --> only exported for testing
25
+ */
26
+ export declare function getUpdatedSourceMapSettings(viteConfig: UserConfig, sentryPluginOptions?: BuildTimeOptionsBase): boolean | 'inline' | 'hidden';
27
+ //# sourceMappingURL=sourceMaps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceMaps.d.ts","sourceRoot":"","sources":["../../../src/vite/sourceMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAI/C;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAsE/E;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAiBtF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,UAAU,EACtB,mBAAmB,CAAC,EAAE,oBAAoB,GACzC,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAwC/B"}
@@ -1,4 +1,5 @@
1
1
  export * from './config';
2
2
  export * from './server';
3
3
  export * from './common';
4
+ export * from './vite';
4
5
  //# sourceMappingURL=index.server.d.ts.map
@@ -5,6 +5,7 @@ export * from './config';
5
5
  export * from './client';
6
6
  export * from './server';
7
7
  export * from './common';
8
+ export * from './vite';
8
9
  /** Initializes Sentry TanStack Start SDK */
9
10
  export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
10
11
  export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
@@ -0,0 +1,2 @@
1
+ export { sentryTanstackStart } from './sentryTanstackStart';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { BuildTimeOptionsBase } from '@sentry/core';
2
+ import { Plugin } from 'vite';
3
+ /**
4
+ * Vite plugins for the Sentry TanStack Start SDK.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * // vite.config.ts
9
+ * import { defineConfig } from 'vite';
10
+ * import { sentryTanstackStart } from '@sentry/tanstackstart-react';
11
+ * import { tanstackStart } from '@tanstack/react-start/plugin/vite';
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [
15
+ * sentryTanstackStart({
16
+ * org: 'your-org',
17
+ * project: 'your-project',
18
+ * }),
19
+ * tanstackStart(),
20
+ * ],
21
+ * });
22
+ * ```
23
+ *
24
+ * @param options - Options to configure the Sentry Vite plugins
25
+ * @returns An array of Vite plugins
26
+ */
27
+ export declare function sentryTanstackStart(options?: BuildTimeOptionsBase): Plugin[];
28
+ //# sourceMappingURL=sentryTanstackStart.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { BuildTimeOptionsBase } from '@sentry/core';
2
+ import { Plugin, UserConfig } from 'vite';
3
+ /**
4
+ * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry.
5
+ */
6
+ export declare function makeAddSentryVitePlugin(options: BuildTimeOptionsBase): Plugin[];
7
+ /**
8
+ * A Sentry plugin for TanStack Start React to enable "hidden" source maps if they are unset.
9
+ */
10
+ export declare function makeEnableSourceMapsVitePlugin(options: BuildTimeOptionsBase): Plugin[];
11
+ /** There are 3 ways to set up source map generation (https://github.com/getsentry/sentry-javascript/issues/13993)
12
+ *
13
+ * 1. User explicitly disabled source maps
14
+ * - keep this setting (emit a warning that errors won't be unminified in Sentry)
15
+ * - We won't upload anything
16
+ *
17
+ * 2. Users enabled source map generation (true, 'hidden', 'inline').
18
+ * - keep this setting (don't do anything - like deletion - besides uploading)
19
+ *
20
+ * 3. Users didn't set source maps generation
21
+ * - we enable 'hidden' source maps generation
22
+ * - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)
23
+ *
24
+ * --> only exported for testing
25
+ */
26
+ export declare function getUpdatedSourceMapSettings(viteConfig: UserConfig, sentryPluginOptions?: BuildTimeOptionsBase): boolean | 'inline' | 'hidden';
27
+ //# sourceMappingURL=sourceMaps.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/tanstackstart-react",
3
- "version": "10.34.0",
3
+ "version": "10.36.0",
4
4
  "description": "Official Sentry SDK for TanStack Start React",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/tanstackstart-react",
@@ -52,10 +52,14 @@
52
52
  "dependencies": {
53
53
  "@opentelemetry/api": "^1.9.0",
54
54
  "@opentelemetry/semantic-conventions": "^1.37.0",
55
- "@sentry-internal/browser-utils": "10.34.0",
56
- "@sentry/core": "10.34.0",
57
- "@sentry/node": "10.34.0",
58
- "@sentry/react": "10.34.0"
55
+ "@sentry-internal/browser-utils": "10.36.0",
56
+ "@sentry/core": "10.36.0",
57
+ "@sentry/node": "10.36.0",
58
+ "@sentry/react": "10.36.0",
59
+ "@sentry/vite-plugin": "^4.6.2"
60
+ },
61
+ "devDependencies": {
62
+ "vite": "^5.4.11"
59
63
  },
60
64
  "scripts": {
61
65
  "build": "run-p build:transpile build:types",