@sentry/react-router 10.22.0 → 10.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/vite/buildEnd/handleOnBuildEnd.js +24 -8
- package/build/cjs/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
- package/build/cjs/vite/plugin.js +2 -2
- package/build/cjs/vite/plugin.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/vite/buildEnd/handleOnBuildEnd.js +24 -8
- package/build/esm/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
- package/build/esm/vite/plugin.js +2 -2
- package/build/esm/vite/plugin.js.map +1 -1
- package/build/types/vite/buildEnd/handleOnBuildEnd.d.ts.map +1 -1
- package/build/types/vite/plugin.d.ts +1 -1
- package/build/types/vite/plugin.d.ts.map +1 -1
- package/build/types/vite/types.d.ts +7 -95
- package/build/types/vite/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -21,17 +21,31 @@ function getSentryConfig(viteConfig) {
|
|
|
21
21
|
const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
22
22
|
const sentryConfig = getSentryConfig(viteConfig);
|
|
23
23
|
|
|
24
|
+
// todo(v11): Remove deprecated sourceMapsUploadOptions support (no need for spread/pick anymore)
|
|
25
|
+
const {
|
|
26
|
+
sourceMapsUploadOptions, // extract to exclude from rest config
|
|
27
|
+
...sentryConfigWithoutDeprecatedSourceMapOption
|
|
28
|
+
} = sentryConfig;
|
|
29
|
+
|
|
24
30
|
const {
|
|
25
31
|
authToken,
|
|
26
32
|
org,
|
|
27
33
|
project,
|
|
28
34
|
release,
|
|
29
|
-
|
|
35
|
+
sourcemaps = { disable: false },
|
|
30
36
|
debug = false,
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
= {
|
|
33
40
|
...sentryConfig.unstable_sentryVitePluginOptions,
|
|
34
|
-
...
|
|
41
|
+
...sentryConfigWithoutDeprecatedSourceMapOption, // spread in the config without the deprecated sourceMapsUploadOptions
|
|
42
|
+
sourcemaps: {
|
|
43
|
+
...sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps,
|
|
44
|
+
...sentryConfig.sourcemaps,
|
|
45
|
+
...sourceMapsUploadOptions,
|
|
46
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
47
|
+
disable: sourceMapsUploadOptions?.enabled === false ? true : sentryConfig.sourcemaps?.disable,
|
|
48
|
+
},
|
|
35
49
|
release: {
|
|
36
50
|
...sentryConfig.unstable_sentryVitePluginOptions?.release,
|
|
37
51
|
...sentryConfig.release,
|
|
@@ -42,8 +56,9 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
42
56
|
authToken,
|
|
43
57
|
org,
|
|
44
58
|
project,
|
|
45
|
-
...unstable_sentryVitePluginOptions,
|
|
59
|
+
...sentryConfig.unstable_sentryVitePluginOptions,
|
|
46
60
|
});
|
|
61
|
+
|
|
47
62
|
// check if release should be created
|
|
48
63
|
if (release?.name) {
|
|
49
64
|
try {
|
|
@@ -54,7 +69,7 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
54
69
|
}
|
|
55
70
|
}
|
|
56
71
|
|
|
57
|
-
if (
|
|
72
|
+
if (!sourcemaps?.disable && viteConfig.build.sourcemap !== false) {
|
|
58
73
|
// inject debugIds
|
|
59
74
|
try {
|
|
60
75
|
await cliInstance.execute(
|
|
@@ -82,9 +97,10 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
82
97
|
}
|
|
83
98
|
}
|
|
84
99
|
// delete sourcemaps after upload
|
|
85
|
-
let updatedFilesToDeleteAfterUpload =
|
|
100
|
+
let updatedFilesToDeleteAfterUpload = await sourcemaps?.filesToDeleteAfterUpload;
|
|
101
|
+
|
|
86
102
|
// set a default value no option was set
|
|
87
|
-
if (typeof
|
|
103
|
+
if (typeof updatedFilesToDeleteAfterUpload === 'undefined') {
|
|
88
104
|
updatedFilesToDeleteAfterUpload = [`${reactRouterConfig.buildDirectory}/**/*.map`];
|
|
89
105
|
debug &&
|
|
90
106
|
// eslint-disable-next-line no-console
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleOnBuildEnd.js","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"sourcesContent":["import { rm } from 'node:fs/promises';\nimport type { Config } from '@react-router/dev/config';\nimport SentryCli from '@sentry/cli';\nimport { glob } from 'glob';\nimport type { SentryReactRouterBuildOptions } from '../types';\n\ntype BuildEndHook = NonNullable<Config['buildEnd']>;\n\nfunction getSentryConfig(viteConfig: unknown): SentryReactRouterBuildOptions {\n if (!viteConfig || typeof viteConfig !== 'object' || !('sentryConfig' in viteConfig)) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] sentryConfig not found - it needs to be passed to vite.config.ts');\n }\n\n return (viteConfig as { sentryConfig: SentryReactRouterBuildOptions }).sentryConfig;\n}\n\n/**\n * A build end hook that handles Sentry release creation and source map uploads.\n * It creates a new Sentry release if configured, uploads source maps to Sentry,\n * and optionally deletes the source map files after upload.\n */\nexport const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteConfig }) => {\n const sentryConfig = getSentryConfig(viteConfig);\n\n const {\n authToken,\n org,\n project,\n release,\n
|
|
1
|
+
{"version":3,"file":"handleOnBuildEnd.js","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"sourcesContent":["import { rm } from 'node:fs/promises';\nimport type { Config } from '@react-router/dev/config';\nimport SentryCli from '@sentry/cli';\nimport type { SentryVitePluginOptions } from '@sentry/vite-plugin';\nimport { glob } from 'glob';\nimport type { SentryReactRouterBuildOptions } from '../types';\n\ntype BuildEndHook = NonNullable<Config['buildEnd']>;\n\nfunction getSentryConfig(viteConfig: unknown): SentryReactRouterBuildOptions {\n if (!viteConfig || typeof viteConfig !== 'object' || !('sentryConfig' in viteConfig)) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] sentryConfig not found - it needs to be passed to vite.config.ts');\n }\n\n return (viteConfig as { sentryConfig: SentryReactRouterBuildOptions }).sentryConfig;\n}\n\n/**\n * A build end hook that handles Sentry release creation and source map uploads.\n * It creates a new Sentry release if configured, uploads source maps to Sentry,\n * and optionally deletes the source map files after upload.\n */\nexport const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteConfig }) => {\n const sentryConfig = getSentryConfig(viteConfig);\n\n // todo(v11): Remove deprecated sourceMapsUploadOptions support (no need for spread/pick anymore)\n const {\n sourceMapsUploadOptions, // extract to exclude from rest config\n ...sentryConfigWithoutDeprecatedSourceMapOption\n } = sentryConfig;\n\n const {\n authToken,\n org,\n project,\n release,\n sourcemaps = { disable: false },\n debug = false,\n }: Omit<SentryReactRouterBuildOptions, 'sourcemaps' | 'sourceMapsUploadOptions'> &\n // Pick 'sourcemaps' from Vite plugin options as the types allow more (e.g. Promise values for `deleteFilesAfterUpload`)\n Pick<SentryVitePluginOptions, 'sourcemaps'> = {\n ...sentryConfig.unstable_sentryVitePluginOptions,\n ...sentryConfigWithoutDeprecatedSourceMapOption, // spread in the config without the deprecated sourceMapsUploadOptions\n sourcemaps: {\n ...sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps,\n ...sentryConfig.sourcemaps,\n ...sourceMapsUploadOptions,\n // eslint-disable-next-line deprecation/deprecation\n disable: sourceMapsUploadOptions?.enabled === false ? true : sentryConfig.sourcemaps?.disable,\n },\n release: {\n ...sentryConfig.unstable_sentryVitePluginOptions?.release,\n ...sentryConfig.release,\n },\n };\n\n const cliInstance = new SentryCli(null, {\n authToken,\n org,\n project,\n ...sentryConfig.unstable_sentryVitePluginOptions,\n });\n\n // check if release should be created\n if (release?.name) {\n try {\n await cliInstance.releases.new(release.name);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not create release', error);\n }\n }\n\n if (!sourcemaps?.disable && viteConfig.build.sourcemap !== false) {\n // inject debugIds\n try {\n await cliInstance.execute(\n ['sourcemaps', 'inject', reactRouterConfig.buildDirectory],\n debug ? 'rejectOnError' : false,\n );\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not inject debug ids', error);\n }\n\n // upload sourcemaps\n try {\n await cliInstance.releases.uploadSourceMaps(release?.name || 'undefined', {\n include: [\n {\n paths: [reactRouterConfig.buildDirectory],\n },\n ],\n live: 'rejectOnError',\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not upload sourcemaps', error);\n }\n }\n // delete sourcemaps after upload\n let updatedFilesToDeleteAfterUpload = await sourcemaps?.filesToDeleteAfterUpload;\n\n // set a default value no option was set\n if (typeof updatedFilesToDeleteAfterUpload === 'undefined') {\n updatedFilesToDeleteAfterUpload = [`${reactRouterConfig.buildDirectory}/**/*.map`];\n debug &&\n // eslint-disable-next-line no-console\n console.info(\n `[Sentry] Automatically setting \\`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(\n updatedFilesToDeleteAfterUpload,\n )}\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n if (updatedFilesToDeleteAfterUpload) {\n try {\n const filePathsToDelete = await glob(updatedFilesToDeleteAfterUpload, {\n absolute: true,\n nodir: true,\n });\n if (debug) {\n filePathsToDelete.forEach(filePathToDelete => {\n // eslint-disable-next-line no-console\n console.info(`Deleting asset after upload: ${filePathToDelete}`);\n });\n }\n await Promise.all(\n filePathsToDelete.map(filePathToDelete =>\n rm(filePathToDelete, { force: true }).catch((e: unknown) => {\n // This is allowed to fail - we just don't do anything\n debug &&\n // eslint-disable-next-line no-console\n console.debug(`An error occurred while attempting to delete asset: ${filePathToDelete}`, e);\n }),\n ),\n );\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error deleting files after sourcemap upload:', error);\n }\n }\n};\n"],"names":["SentryCli","glob","rm"],"mappings":";;;;;;AASA,SAAS,eAAe,CAAC,UAAU,EAA0C;AAC7E,EAAE,IAAI,CAAC,U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AA,CAAA,SAAA,CAAA,CAAA;AACA,IAAA,KAAA;AACA;AACA,MAAA,OAAA,CAAA,IAAA;AACA,QAAA,CAAA,mFAAA,EAAA,IAAA,CAAA,SAAA;AACA,UAAA,+BAAA;AACA,SAAA,CAAA,sEAAA,CAAA;AACA,OAAA;AACA;AACA,EAAA,IAAA,+BAAA,EAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,iBAAA,GAAA,MAAAC,SAAA,CAAA,+BAAA,EAAA;AACA,QAAA,QAAA,EAAA,IAAA;AACA,QAAA,KAAA,EAAA,IAAA;AACA,OAAA,CAAA;AACA,MAAA,IAAA,KAAA,EAAA;AACA,QAAA,iBAAA,CAAA,OAAA,CAAA,gBAAA,IAAA;AACA;AACA,UAAA,OAAA,CAAA,IAAA,CAAA,CAAA,6BAAA,EAAA,gBAAA,CAAA,CAAA,CAAA;AACA,SAAA,CAAA;AACA;AACA,MAAA,MAAA,OAAA,CAAA,GAAA;AACA,QAAA,iBAAA,CAAA,GAAA,CAAA,gBAAA;AACA,UAAAC,WAAA,CAAA,gBAAA,EAAA,EAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,KAAA;AACA;AACA,YAAA,KAAA;AACA;AACA,cAAA,OAAA,CAAA,KAAA,CAAA,CAAA,oDAAA,EAAA,gBAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA,WAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA,OAAA,KAAA,EAAA;AACA;AACA,MAAA,OAAA,CAAA,KAAA,CAAA,8CAAA,EAAA,KAAA,CAAA;AACA;AACA;AACA;;;;"}
|
package/build/cjs/vite/plugin.js
CHANGED
|
@@ -13,13 +13,13 @@ const makeEnableSourceMapsPlugin = require('./makeEnableSourceMapsPlugin.js');
|
|
|
13
13
|
*/
|
|
14
14
|
async function sentryReactRouter(
|
|
15
15
|
options = {},
|
|
16
|
-
|
|
16
|
+
viteConfig,
|
|
17
17
|
) {
|
|
18
18
|
const plugins = [];
|
|
19
19
|
|
|
20
20
|
plugins.push(makeConfigInjectorPlugin.makeConfigInjectorPlugin(options));
|
|
21
21
|
|
|
22
|
-
if (process.env.NODE_ENV !== 'development' &&
|
|
22
|
+
if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {
|
|
23
23
|
plugins.push(makeEnableSourceMapsPlugin.makeEnableSourceMapsPlugin(options));
|
|
24
24
|
plugins.push(...(await makeCustomSentryVitePlugins.makeCustomSentryVitePlugins(options)));
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import type { ConfigEnv } from 'vite';\nimport { type Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import type { ConfigEnv } from 'vite';\nimport { type Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n viteConfig: ConfigEnv,\n): Promise<Plugin[]> {\n const plugins: Plugin[] = [];\n\n plugins.push(makeConfigInjectorPlugin(options));\n\n if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {\n plugins.push(makeEnableSourceMapsPlugin(options));\n plugins.push(...(await makeCustomSentryVitePlugins(options)));\n }\n\n return plugins;\n}\n"],"names":["makeConfigInjectorPlugin","makeEnableSourceMapsPlugin","makeCustomSentryVitePlugins"],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,iBAAiB;AACvC,EAAE,OAAO,GAAkC,EAAE;AAC7C,EAAE,UAAU;AACZ,EAAqB;AACrB,EAAE,MAAM,OAAO,GAAa,EAAE;;AAE9B,EAAE,OAAO,CAAC,IAAI,CAACA,iDAAwB,CAAC,OAAO,CAAC,CAAC;;AAEjD,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAA,KAAa,aAAA,IAAiB,UAAU,CAAC,OAAA,KAAY,OAAA,IAAW,UAAU,CAAC,IAAA,KAAS,aAAa,EAAE;AACrH,IAAI,OAAO,CAAC,IAAI,CAACC,qDAA0B,CAAC,OAAO,CAAC,CAAC;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,MAAMC,uDAA2B,CAAC,OAAO,CAAC,CAAC,CAAC;AACjE;;AAEA,EAAE,OAAO,OAAO;AAChB;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.23.0"}
|
|
@@ -19,17 +19,31 @@ function getSentryConfig(viteConfig) {
|
|
|
19
19
|
const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
20
20
|
const sentryConfig = getSentryConfig(viteConfig);
|
|
21
21
|
|
|
22
|
+
// todo(v11): Remove deprecated sourceMapsUploadOptions support (no need for spread/pick anymore)
|
|
23
|
+
const {
|
|
24
|
+
sourceMapsUploadOptions, // extract to exclude from rest config
|
|
25
|
+
...sentryConfigWithoutDeprecatedSourceMapOption
|
|
26
|
+
} = sentryConfig;
|
|
27
|
+
|
|
22
28
|
const {
|
|
23
29
|
authToken,
|
|
24
30
|
org,
|
|
25
31
|
project,
|
|
26
32
|
release,
|
|
27
|
-
|
|
33
|
+
sourcemaps = { disable: false },
|
|
28
34
|
debug = false,
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
= {
|
|
31
38
|
...sentryConfig.unstable_sentryVitePluginOptions,
|
|
32
|
-
...
|
|
39
|
+
...sentryConfigWithoutDeprecatedSourceMapOption, // spread in the config without the deprecated sourceMapsUploadOptions
|
|
40
|
+
sourcemaps: {
|
|
41
|
+
...sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps,
|
|
42
|
+
...sentryConfig.sourcemaps,
|
|
43
|
+
...sourceMapsUploadOptions,
|
|
44
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
45
|
+
disable: sourceMapsUploadOptions?.enabled === false ? true : sentryConfig.sourcemaps?.disable,
|
|
46
|
+
},
|
|
33
47
|
release: {
|
|
34
48
|
...sentryConfig.unstable_sentryVitePluginOptions?.release,
|
|
35
49
|
...sentryConfig.release,
|
|
@@ -40,8 +54,9 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
40
54
|
authToken,
|
|
41
55
|
org,
|
|
42
56
|
project,
|
|
43
|
-
...unstable_sentryVitePluginOptions,
|
|
57
|
+
...sentryConfig.unstable_sentryVitePluginOptions,
|
|
44
58
|
});
|
|
59
|
+
|
|
45
60
|
// check if release should be created
|
|
46
61
|
if (release?.name) {
|
|
47
62
|
try {
|
|
@@ -52,7 +67,7 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
52
67
|
}
|
|
53
68
|
}
|
|
54
69
|
|
|
55
|
-
if (
|
|
70
|
+
if (!sourcemaps?.disable && viteConfig.build.sourcemap !== false) {
|
|
56
71
|
// inject debugIds
|
|
57
72
|
try {
|
|
58
73
|
await cliInstance.execute(
|
|
@@ -80,9 +95,10 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
80
95
|
}
|
|
81
96
|
}
|
|
82
97
|
// delete sourcemaps after upload
|
|
83
|
-
let updatedFilesToDeleteAfterUpload =
|
|
98
|
+
let updatedFilesToDeleteAfterUpload = await sourcemaps?.filesToDeleteAfterUpload;
|
|
99
|
+
|
|
84
100
|
// set a default value no option was set
|
|
85
|
-
if (typeof
|
|
101
|
+
if (typeof updatedFilesToDeleteAfterUpload === 'undefined') {
|
|
86
102
|
updatedFilesToDeleteAfterUpload = [`${reactRouterConfig.buildDirectory}/**/*.map`];
|
|
87
103
|
debug &&
|
|
88
104
|
// eslint-disable-next-line no-console
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleOnBuildEnd.js","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"sourcesContent":["import { rm } from 'node:fs/promises';\nimport type { Config } from '@react-router/dev/config';\nimport SentryCli from '@sentry/cli';\nimport { glob } from 'glob';\nimport type { SentryReactRouterBuildOptions } from '../types';\n\ntype BuildEndHook = NonNullable<Config['buildEnd']>;\n\nfunction getSentryConfig(viteConfig: unknown): SentryReactRouterBuildOptions {\n if (!viteConfig || typeof viteConfig !== 'object' || !('sentryConfig' in viteConfig)) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] sentryConfig not found - it needs to be passed to vite.config.ts');\n }\n\n return (viteConfig as { sentryConfig: SentryReactRouterBuildOptions }).sentryConfig;\n}\n\n/**\n * A build end hook that handles Sentry release creation and source map uploads.\n * It creates a new Sentry release if configured, uploads source maps to Sentry,\n * and optionally deletes the source map files after upload.\n */\nexport const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteConfig }) => {\n const sentryConfig = getSentryConfig(viteConfig);\n\n const {\n authToken,\n org,\n project,\n release,\n
|
|
1
|
+
{"version":3,"file":"handleOnBuildEnd.js","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"sourcesContent":["import { rm } from 'node:fs/promises';\nimport type { Config } from '@react-router/dev/config';\nimport SentryCli from '@sentry/cli';\nimport type { SentryVitePluginOptions } from '@sentry/vite-plugin';\nimport { glob } from 'glob';\nimport type { SentryReactRouterBuildOptions } from '../types';\n\ntype BuildEndHook = NonNullable<Config['buildEnd']>;\n\nfunction getSentryConfig(viteConfig: unknown): SentryReactRouterBuildOptions {\n if (!viteConfig || typeof viteConfig !== 'object' || !('sentryConfig' in viteConfig)) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] sentryConfig not found - it needs to be passed to vite.config.ts');\n }\n\n return (viteConfig as { sentryConfig: SentryReactRouterBuildOptions }).sentryConfig;\n}\n\n/**\n * A build end hook that handles Sentry release creation and source map uploads.\n * It creates a new Sentry release if configured, uploads source maps to Sentry,\n * and optionally deletes the source map files after upload.\n */\nexport const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteConfig }) => {\n const sentryConfig = getSentryConfig(viteConfig);\n\n // todo(v11): Remove deprecated sourceMapsUploadOptions support (no need for spread/pick anymore)\n const {\n sourceMapsUploadOptions, // extract to exclude from rest config\n ...sentryConfigWithoutDeprecatedSourceMapOption\n } = sentryConfig;\n\n const {\n authToken,\n org,\n project,\n release,\n sourcemaps = { disable: false },\n debug = false,\n }: Omit<SentryReactRouterBuildOptions, 'sourcemaps' | 'sourceMapsUploadOptions'> &\n // Pick 'sourcemaps' from Vite plugin options as the types allow more (e.g. Promise values for `deleteFilesAfterUpload`)\n Pick<SentryVitePluginOptions, 'sourcemaps'> = {\n ...sentryConfig.unstable_sentryVitePluginOptions,\n ...sentryConfigWithoutDeprecatedSourceMapOption, // spread in the config without the deprecated sourceMapsUploadOptions\n sourcemaps: {\n ...sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps,\n ...sentryConfig.sourcemaps,\n ...sourceMapsUploadOptions,\n // eslint-disable-next-line deprecation/deprecation\n disable: sourceMapsUploadOptions?.enabled === false ? true : sentryConfig.sourcemaps?.disable,\n },\n release: {\n ...sentryConfig.unstable_sentryVitePluginOptions?.release,\n ...sentryConfig.release,\n },\n };\n\n const cliInstance = new SentryCli(null, {\n authToken,\n org,\n project,\n ...sentryConfig.unstable_sentryVitePluginOptions,\n });\n\n // check if release should be created\n if (release?.name) {\n try {\n await cliInstance.releases.new(release.name);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not create release', error);\n }\n }\n\n if (!sourcemaps?.disable && viteConfig.build.sourcemap !== false) {\n // inject debugIds\n try {\n await cliInstance.execute(\n ['sourcemaps', 'inject', reactRouterConfig.buildDirectory],\n debug ? 'rejectOnError' : false,\n );\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not inject debug ids', error);\n }\n\n // upload sourcemaps\n try {\n await cliInstance.releases.uploadSourceMaps(release?.name || 'undefined', {\n include: [\n {\n paths: [reactRouterConfig.buildDirectory],\n },\n ],\n live: 'rejectOnError',\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not upload sourcemaps', error);\n }\n }\n // delete sourcemaps after upload\n let updatedFilesToDeleteAfterUpload = await sourcemaps?.filesToDeleteAfterUpload;\n\n // set a default value no option was set\n if (typeof updatedFilesToDeleteAfterUpload === 'undefined') {\n updatedFilesToDeleteAfterUpload = [`${reactRouterConfig.buildDirectory}/**/*.map`];\n debug &&\n // eslint-disable-next-line no-console\n console.info(\n `[Sentry] Automatically setting \\`sourceMapsUploadOptions.filesToDeleteAfterUpload: ${JSON.stringify(\n updatedFilesToDeleteAfterUpload,\n )}\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n if (updatedFilesToDeleteAfterUpload) {\n try {\n const filePathsToDelete = await glob(updatedFilesToDeleteAfterUpload, {\n absolute: true,\n nodir: true,\n });\n if (debug) {\n filePathsToDelete.forEach(filePathToDelete => {\n // eslint-disable-next-line no-console\n console.info(`Deleting asset after upload: ${filePathToDelete}`);\n });\n }\n await Promise.all(\n filePathsToDelete.map(filePathToDelete =>\n rm(filePathToDelete, { force: true }).catch((e: unknown) => {\n // This is allowed to fail - we just don't do anything\n debug &&\n // eslint-disable-next-line no-console\n console.debug(`An error occurred while attempting to delete asset: ${filePathToDelete}`, e);\n }),\n ),\n );\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error deleting files after sourcemap upload:', error);\n }\n }\n};\n"],"names":[],"mappings":";;;;AASA,SAAS,eAAe,CAAC,UAAU,EAA0C;AAC7E,EAAE,IAAI,CAAC,UAAA,IAAc,OAAO,UAAA,KAAe,QAAA,IAAY,EAAE,cAAA,IAAkB,UAAU,CAAC,EAAE;AACxF;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,2EAA2E,CAAC;AAC9F;;AAEA,EAAE,OAAO,CAAC,UAAA,GAA+D,YAAY;AACrF;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,gBAAgB,GAAiB,OAAO,EAAE,iBAAiB,EAAE,UAAA,EAAY,KAAK;AAC3F,EAAE,MAAM,YAAA,GAAe,eAAe,CAAC,UAAU,CAAC;;AAElD;AACA,EAAE,MAAM;AACR,IAAI,uBAAuB;AAC3B,IAAI,GAAG;AACP,GAAE,GAAI,YAAY;;AAElB,EAAE,MAAM;AACR,IAAI,SAAS;AACb,IAAI,GAAG;AACP,IAAI,OAAO;AACX,IAAI,OAAO;AACX,IAAI,aAAa,EAAE,OAAO,EAAE,OAAO;AACnC,IAAI,KAAA,GAAQ,KAAK;AACjB;;AAEI,GAA8C;AAClD,IAAI,GAAG,YAAY,CAAC,gCAAgC;AACpD,IAAI,GAAG,4CAA4C;AACnD,IAAI,UAAU,EAAE;AAChB,MAAM,GAAG,YAAY,CAAC,gCAAgC,EAAE,UAAU;AAClE,MAAM,GAAG,YAAY,CAAC,UAAU;AAChC,MAAM,GAAG,uBAAuB;AAChC;AACA,MAAM,OAAO,EAAE,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,EAAA,CAAA,CAAA;AACA,WAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA,OAAA,KAAA,EAAA;AACA;AACA,MAAA,OAAA,CAAA,KAAA,CAAA,8CAAA,EAAA,KAAA,CAAA;AACA;AACA;AACA;;;;"}
|
package/build/esm/vite/plugin.js
CHANGED
|
@@ -11,13 +11,13 @@ import { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin.js';
|
|
|
11
11
|
*/
|
|
12
12
|
async function sentryReactRouter(
|
|
13
13
|
options = {},
|
|
14
|
-
|
|
14
|
+
viteConfig,
|
|
15
15
|
) {
|
|
16
16
|
const plugins = [];
|
|
17
17
|
|
|
18
18
|
plugins.push(makeConfigInjectorPlugin(options));
|
|
19
19
|
|
|
20
|
-
if (process.env.NODE_ENV !== 'development' &&
|
|
20
|
+
if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {
|
|
21
21
|
plugins.push(makeEnableSourceMapsPlugin(options));
|
|
22
22
|
plugins.push(...(await makeCustomSentryVitePlugins(options)));
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import type { ConfigEnv } from 'vite';\nimport { type Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../../../src/vite/plugin.ts"],"sourcesContent":["import type { ConfigEnv } from 'vite';\nimport { type Plugin } from 'vite';\nimport { makeConfigInjectorPlugin } from './makeConfigInjectorPlugin';\nimport { makeCustomSentryVitePlugins } from './makeCustomSentryVitePlugins';\nimport { makeEnableSourceMapsPlugin } from './makeEnableSourceMapsPlugin';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * A Vite plugin for Sentry that handles source map uploads and bundle size optimizations.\n *\n * @param options - Configuration options for the Sentry Vite plugin\n * @param viteConfig - The Vite user config object\n * @returns An array of Vite plugins\n */\nexport async function sentryReactRouter(\n options: SentryReactRouterBuildOptions = {},\n viteConfig: ConfigEnv,\n): Promise<Plugin[]> {\n const plugins: Plugin[] = [];\n\n plugins.push(makeConfigInjectorPlugin(options));\n\n if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {\n plugins.push(makeEnableSourceMapsPlugin(options));\n plugins.push(...(await makeCustomSentryVitePlugins(options)));\n }\n\n return plugins;\n}\n"],"names":[],"mappings":";;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,iBAAiB;AACvC,EAAE,OAAO,GAAkC,EAAE;AAC7C,EAAE,UAAU;AACZ,EAAqB;AACrB,EAAE,MAAM,OAAO,GAAa,EAAE;;AAE9B,EAAE,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;;AAEjD,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAA,KAAa,aAAA,IAAiB,UAAU,CAAC,OAAA,KAAY,OAAA,IAAW,UAAU,CAAC,IAAA,KAAS,aAAa,EAAE;AACrH,IAAI,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;AACrD,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,MAAM,2BAA2B,CAAC,OAAO,CAAC,CAAC,CAAC;AACjE;;AAEA,EAAE,OAAO,OAAO;AAChB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleOnBuildEnd.d.ts","sourceRoot":"","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"handleOnBuildEnd.d.ts","sourceRoot":"","sources":["../../../../src/vite/buildEnd/handleOnBuildEnd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AAWpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAuH9B,CAAC"}
|
|
@@ -8,5 +8,5 @@ import type { SentryReactRouterBuildOptions } from './types';
|
|
|
8
8
|
* @param viteConfig - The Vite user config object
|
|
9
9
|
* @returns An array of Vite plugins
|
|
10
10
|
*/
|
|
11
|
-
export declare function sentryReactRouter(options: SentryReactRouterBuildOptions | undefined,
|
|
11
|
+
export declare function sentryReactRouter(options: SentryReactRouterBuildOptions | undefined, viteConfig: ConfigEnv): Promise<Plugin[]>;
|
|
12
12
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,6BAA6B,YAAK,EAC3C,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAInC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,6BAA6B,YAAK,EAC3C,UAAU,EAAE,SAAS,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAWnB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core';
|
|
1
2
|
import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
|
|
2
3
|
type SourceMapsOptions = {
|
|
3
4
|
/**
|
|
@@ -5,6 +6,7 @@ type SourceMapsOptions = {
|
|
|
5
6
|
* automatically generate and upload source maps to Sentry during a production build.
|
|
6
7
|
*
|
|
7
8
|
* @default true
|
|
9
|
+
* @deprecated Use `sourcemaps.disable` option instead of `sourceMapsUploadOptions.enabled`.
|
|
8
10
|
*/
|
|
9
11
|
enabled?: boolean;
|
|
10
12
|
/**
|
|
@@ -14,12 +16,16 @@ type SourceMapsOptions = {
|
|
|
14
16
|
* @default [] - By default no files are deleted.
|
|
15
17
|
*
|
|
16
18
|
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
|
|
19
|
+
*
|
|
20
|
+
* @deprecated Use `sourcemaps.filesToDeleteAfterUpload` option instead of `sourceMapsUploadOptions.filesToDeleteAfterUpload`.
|
|
17
21
|
*/
|
|
18
22
|
filesToDeleteAfterUpload?: string | Array<string>;
|
|
19
23
|
/**
|
|
20
24
|
* Options related to managing the Sentry releases for a build.
|
|
21
25
|
*
|
|
22
26
|
* More info: https://docs.sentry.io/product/releases/
|
|
27
|
+
*
|
|
28
|
+
* @deprecated Use the `release` option at the root of `SentryVitePluginOptions` instead.
|
|
23
29
|
*/
|
|
24
30
|
release?: {
|
|
25
31
|
/**
|
|
@@ -36,80 +42,7 @@ type SourceMapsOptions = {
|
|
|
36
42
|
name?: string;
|
|
37
43
|
};
|
|
38
44
|
};
|
|
39
|
-
type
|
|
40
|
-
/**
|
|
41
|
-
* If set to `true`, the plugin will attempt to tree-shake (remove) any debugging code within the Sentry SDK.
|
|
42
|
-
* Note that the success of this depends on tree shaking being enabled in your build tooling.
|
|
43
|
-
*
|
|
44
|
-
* Setting this option to `true` will disable features like the SDK's `debug` option.
|
|
45
|
-
*/
|
|
46
|
-
excludeDebugStatements?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If set to true, the plugin will try to tree-shake tracing statements out.
|
|
49
|
-
* Note that the success of this depends on tree shaking generally being enabled in your build.
|
|
50
|
-
* Attention: DO NOT enable this when you're using any performance monitoring-related SDK features (e.g. Sentry.startSpan()).
|
|
51
|
-
*/
|
|
52
|
-
excludeTracing?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay Shadow DOM recording functionality.
|
|
55
|
-
* Note that the success of this depends on tree shaking being enabled in your build tooling.
|
|
56
|
-
*
|
|
57
|
-
* This option is safe to be used when you do not want to capture any Shadow DOM activity via Sentry Session Replay.
|
|
58
|
-
*/
|
|
59
|
-
excludeReplayShadowDom?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay `iframe` recording functionality.
|
|
62
|
-
* Note that the success of this depends on tree shaking being enabled in your build tooling.
|
|
63
|
-
*
|
|
64
|
-
* You can safely do this when you do not want to capture any `iframe` activity via Sentry Session Replay.
|
|
65
|
-
*/
|
|
66
|
-
excludeReplayIframe?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay's Compression Web Worker.
|
|
69
|
-
* Note that the success of this depends on tree shaking being enabled in your build tooling.
|
|
70
|
-
*
|
|
71
|
-
* **Notice:** You should only do use this option if you manually host a compression worker and configure it in your Sentry Session Replay integration config via the `workerUrl` option.
|
|
72
|
-
*/
|
|
73
|
-
excludeReplayWorker?: boolean;
|
|
74
|
-
};
|
|
75
|
-
export type SentryReactRouterBuildOptions = {
|
|
76
|
-
/**
|
|
77
|
-
* Options for configuring the Sentry release.
|
|
78
|
-
*/
|
|
79
|
-
release?: {
|
|
80
|
-
/**
|
|
81
|
-
* The name of the release to create in Sentry
|
|
82
|
-
*/
|
|
83
|
-
name?: string;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* The auth token to use when uploading source maps to Sentry.
|
|
87
|
-
*
|
|
88
|
-
* Instead of specifying this option, you can also set the `SENTRY_AUTH_TOKEN` environment variable.
|
|
89
|
-
*
|
|
90
|
-
* To create an auth token, follow this guide:
|
|
91
|
-
* @see https://docs.sentry.io/product/accounts/auth-tokens/#organization-auth-tokens
|
|
92
|
-
*/
|
|
93
|
-
authToken?: string;
|
|
94
|
-
/**
|
|
95
|
-
* The organization slug of your Sentry organization.
|
|
96
|
-
* Instead of specifying this option, you can also set the `SENTRY_ORG` environment variable.
|
|
97
|
-
*/
|
|
98
|
-
org?: string;
|
|
99
|
-
/**
|
|
100
|
-
* The project slug of your Sentry project.
|
|
101
|
-
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.
|
|
102
|
-
*/
|
|
103
|
-
project?: string;
|
|
104
|
-
/**
|
|
105
|
-
* Options for the Sentry Vite plugin to customize bundle size optimizations.
|
|
106
|
-
*/
|
|
107
|
-
bundleSizeOptimizations?: BundleSizeOptimizationOptions;
|
|
108
|
-
/**
|
|
109
|
-
* If this flag is `true`, Sentry will log debug information during build time.
|
|
110
|
-
* @default false.
|
|
111
|
-
*/
|
|
112
|
-
debug?: boolean;
|
|
45
|
+
export type SentryReactRouterBuildOptions = BuildTimeOptionsBase & UnstableVitePluginOptions<Partial<SentryVitePluginOptions>> & {
|
|
113
46
|
/**
|
|
114
47
|
* Options related to react component name annotations.
|
|
115
48
|
* Disabled by default, unless a value is set for this option.
|
|
@@ -132,27 +65,6 @@ export type SentryReactRouterBuildOptions = {
|
|
|
132
65
|
*
|
|
133
66
|
*/
|
|
134
67
|
sourceMapsUploadOptions?: SourceMapsOptions;
|
|
135
|
-
/**
|
|
136
|
-
* If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
|
|
137
|
-
* It will not collect any sensitive or user-specific data.
|
|
138
|
-
*
|
|
139
|
-
* @default true
|
|
140
|
-
*/
|
|
141
|
-
telemetry?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly.
|
|
144
|
-
* Options specified in this object take precedence over the options specified in
|
|
145
|
-
* the `sourcemaps` and `release` objects.
|
|
146
|
-
*
|
|
147
|
-
* @see https://www.npmjs.com/package/@sentry/vite-plugin/v/2.22.2#options which lists all available options.
|
|
148
|
-
*
|
|
149
|
-
* Warning: Options within this object are subject to change at any time.
|
|
150
|
-
* We DO NOT guarantee semantic versioning for these options, meaning breaking
|
|
151
|
-
* changes can occur at any time within a major SDK version.
|
|
152
|
-
*
|
|
153
|
-
* Furthermore, some options are untested with SvelteKit specifically. Use with caution.
|
|
154
|
-
*/
|
|
155
|
-
unstable_sentryVitePluginOptions?: Partial<SentryVitePluginOptions>;
|
|
156
68
|
};
|
|
157
69
|
export {};
|
|
158
70
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,KAAK,iBAAiB,GAAG;IACvB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,KAAK,iBAAiB,GAAG;IACvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAElD;;;;;;OAMG;IAEH,OAAO,CAAC,EAAE;QACR;;;;;;;;;;WAUG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,oBAAoB,GAC9D,yBAAyB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG;IAC5D;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE;QACzB;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IAEF;;;OAGG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC;CAE7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/react-router",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.23.0",
|
|
4
4
|
"description": "Official Sentry SDK for React Router (Framework)",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react-router",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@opentelemetry/core": "^2.1.0",
|
|
50
50
|
"@opentelemetry/instrumentation": "^0.204.0",
|
|
51
51
|
"@opentelemetry/semantic-conventions": "^1.37.0",
|
|
52
|
-
"@sentry/browser": "10.
|
|
52
|
+
"@sentry/browser": "10.23.0",
|
|
53
53
|
"@sentry/cli": "^2.56.0",
|
|
54
|
-
"@sentry/core": "10.
|
|
55
|
-
"@sentry/node": "10.
|
|
56
|
-
"@sentry/react": "10.
|
|
54
|
+
"@sentry/core": "10.23.0",
|
|
55
|
+
"@sentry/node": "10.23.0",
|
|
56
|
+
"@sentry/react": "10.23.0",
|
|
57
57
|
"@sentry/vite-plugin": "^4.1.0",
|
|
58
58
|
"glob": "11.0.1"
|
|
59
59
|
},
|