@sentry/react-router 11.0.0-alpha.0 → 11.0.0-alpha.2
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/README.md +2 -2
- package/build/cjs/client/createClientInstrumentation.js +32 -24
- package/build/cjs/client/createClientInstrumentation.js.map +1 -1
- package/build/cjs/client/hydratedRouter.js +15 -22
- package/build/cjs/client/hydratedRouter.js.map +1 -1
- package/build/cjs/client/tracingIntegration.js.map +1 -1
- package/build/cjs/client/utils.js +32 -12
- package/build/cjs/client/utils.js.map +1 -1
- package/build/cjs/cloudflare/index.js +3 -2
- package/build/cjs/cloudflare/index.js.map +1 -1
- package/build/cjs/common/utils.js.map +1 -1
- package/build/cjs/index.server.js +0 -7
- package/build/cjs/index.server.js.map +1 -1
- package/build/cjs/server/createServerInstrumentation.js +22 -15
- package/build/cjs/server/createServerInstrumentation.js.map +1 -1
- package/build/cjs/server/getMetaTagTransformer.js +3 -2
- package/build/cjs/server/getMetaTagTransformer.js.map +1 -1
- package/build/cjs/server/integration/lowQualityTransactionsFilterIntegration.js +4 -3
- package/build/cjs/server/integration/lowQualityTransactionsFilterIntegration.js.map +1 -1
- package/build/cjs/server/sdk.js +1 -1
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/server/wrapSentryHandleRequest.js +2 -4
- package/build/cjs/server/wrapSentryHandleRequest.js.map +1 -1
- package/build/cjs/vite/buildEnd/handleOnBuildEnd.js +19 -41
- package/build/cjs/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
- package/build/cjs/vite/index.js +12 -0
- package/build/cjs/vite/index.js.map +1 -0
- package/build/cjs/vite/makeCustomSentryVitePlugins.js +21 -32
- package/build/cjs/vite/makeCustomSentryVitePlugins.js.map +1 -1
- package/build/esm/client/createClientInstrumentation.js +24 -16
- package/build/esm/client/createClientInstrumentation.js.map +1 -1
- package/build/esm/client/hydratedRouter.js +18 -25
- package/build/esm/client/hydratedRouter.js.map +1 -1
- package/build/esm/client/tracingIntegration.js.map +1 -1
- package/build/esm/client/utils.js +34 -14
- package/build/esm/client/utils.js.map +1 -1
- package/build/esm/cloudflare/index.js +3 -2
- package/build/esm/cloudflare/index.js.map +1 -1
- package/build/esm/common/utils.js.map +1 -1
- package/build/esm/index.server.js +1 -4
- package/build/esm/index.server.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/createServerInstrumentation.js +25 -18
- package/build/esm/server/createServerInstrumentation.js.map +1 -1
- package/build/esm/server/getMetaTagTransformer.js +3 -2
- package/build/esm/server/getMetaTagTransformer.js.map +1 -1
- package/build/esm/server/integration/lowQualityTransactionsFilterIntegration.js +4 -3
- package/build/esm/server/integration/lowQualityTransactionsFilterIntegration.js.map +1 -1
- package/build/esm/server/sdk.js +1 -1
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/server/wrapSentryHandleRequest.js +5 -6
- package/build/esm/server/wrapSentryHandleRequest.js.map +1 -1
- package/build/esm/vite/buildEnd/handleOnBuildEnd.js +19 -41
- package/build/esm/vite/buildEnd/handleOnBuildEnd.js.map +1 -1
- package/build/esm/vite/index.js +4 -0
- package/build/esm/vite/index.js.map +1 -0
- package/build/esm/vite/makeCustomSentryVitePlugins.js +21 -32
- package/build/esm/vite/makeCustomSentryVitePlugins.js.map +1 -1
- package/build/types/client/createClientInstrumentation.d.ts +1 -1
- package/build/types/client/createClientInstrumentation.d.ts.map +1 -1
- package/build/types/client/hydratedRouter.d.ts.map +1 -1
- package/build/types/client/tracingIntegration.d.ts +1 -1
- package/build/types/client/tracingIntegration.d.ts.map +1 -1
- package/build/types/client/utils.d.ts +7 -1
- package/build/types/client/utils.d.ts.map +1 -1
- package/build/types/cloudflare/index.d.ts.map +1 -1
- package/build/types/common/utils.d.ts +3 -2
- package/build/types/common/utils.d.ts.map +1 -1
- package/build/types/index.server.d.ts +0 -1
- package/build/types/index.server.d.ts.map +1 -1
- package/build/types/index.types.d.ts +3 -1
- package/build/types/index.types.d.ts.map +1 -1
- package/build/types/server/createServerInstrumentation.d.ts +1 -1
- package/build/types/server/createServerInstrumentation.d.ts.map +1 -1
- package/build/types/server/getMetaTagTransformer.d.ts.map +1 -1
- package/build/types/server/index.d.ts +1 -1
- package/build/types/server/index.d.ts.map +1 -1
- package/build/types/server/integration/lowQualityTransactionsFilterIntegration.d.ts +1 -2
- package/build/types/server/integration/lowQualityTransactionsFilterIntegration.d.ts.map +1 -1
- package/build/types/server/wrapSentryHandleRequest.d.ts +0 -2
- package/build/types/server/wrapSentryHandleRequest.d.ts.map +1 -1
- package/build/types/vite/buildEnd/handleOnBuildEnd.d.ts.map +1 -1
- package/build/types/vite/makeCustomSentryVitePlugins.d.ts.map +1 -1
- package/build/types/vite/types.d.ts +12 -58
- package/build/types/vite/types.d.ts.map +1 -1
- package/package.json +16 -10
- package/build/types/common/types.d.ts +0 -86
- package/build/types/common/types.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rm } from 'node:fs/promises';
|
|
2
|
-
import
|
|
2
|
+
import { createSentrySDK } from 'sentry';
|
|
3
3
|
import { glob } from 'glob';
|
|
4
4
|
|
|
5
5
|
function getSentryConfig(viteConfig) {
|
|
@@ -8,53 +8,38 @@ function getSentryConfig(viteConfig) {
|
|
|
8
8
|
}
|
|
9
9
|
return viteConfig.sentryConfig;
|
|
10
10
|
}
|
|
11
|
-
function resolveSourceMapsDisable(sentryConfig) {
|
|
12
|
-
if (sentryConfig.sourceMapsUploadOptions?.enabled === false) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
return sentryConfig.sourcemaps?.disable ?? sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps?.disable;
|
|
16
|
-
}
|
|
17
11
|
const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
18
12
|
const sentryConfig = getSentryConfig(viteConfig);
|
|
19
|
-
const {
|
|
20
|
-
sourceMapsUploadOptions,
|
|
21
|
-
// extract to exclude from rest config
|
|
22
|
-
...sentryConfigWithoutDeprecatedSourceMapOption
|
|
23
|
-
} = sentryConfig;
|
|
24
|
-
const unstableSentryVitePluginOptions = sentryConfig.unstable_sentryVitePluginOptions;
|
|
25
13
|
const {
|
|
26
14
|
authToken,
|
|
15
|
+
headers,
|
|
27
16
|
org,
|
|
28
17
|
project,
|
|
29
18
|
release,
|
|
19
|
+
sentryUrl,
|
|
30
20
|
sourcemaps = { disable: false },
|
|
31
21
|
debug = false
|
|
32
22
|
} = {
|
|
33
|
-
...
|
|
34
|
-
...sentryConfigWithoutDeprecatedSourceMapOption,
|
|
35
|
-
// spread in the config without the deprecated sourceMapsUploadOptions
|
|
23
|
+
...sentryConfig,
|
|
36
24
|
sourcemaps: {
|
|
37
|
-
...unstableSentryVitePluginOptions?.sourcemaps,
|
|
38
25
|
...sentryConfig.sourcemaps,
|
|
39
|
-
|
|
40
|
-
disable: resolveSourceMapsDisable(sentryConfig)
|
|
26
|
+
disable: sentryConfig.sourcemaps?.disable
|
|
41
27
|
},
|
|
42
28
|
release: {
|
|
43
|
-
...unstableSentryVitePluginOptions?.release,
|
|
44
29
|
...sentryConfig.release
|
|
45
|
-
}
|
|
46
|
-
project: unstableSentryVitePluginOptions?.project ? Array.isArray(unstableSentryVitePluginOptions?.project) ? unstableSentryVitePluginOptions?.project[0] : unstableSentryVitePluginOptions?.project : sentryConfigWithoutDeprecatedSourceMapOption.project
|
|
30
|
+
}
|
|
47
31
|
};
|
|
48
|
-
const
|
|
49
|
-
authToken,
|
|
32
|
+
const sentryOptions = {
|
|
33
|
+
token: authToken,
|
|
50
34
|
org,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
35
|
+
url: sentryUrl,
|
|
36
|
+
project,
|
|
37
|
+
headers
|
|
38
|
+
};
|
|
39
|
+
const sentry = createSentrySDK(sentryOptions);
|
|
55
40
|
if (release?.name) {
|
|
56
41
|
try {
|
|
57
|
-
await
|
|
42
|
+
await sentry.release.create({ orgVersion: release.name });
|
|
58
43
|
} catch (error) {
|
|
59
44
|
console.error("[Sentry] Could not create release", error);
|
|
60
45
|
}
|
|
@@ -63,22 +48,15 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
63
48
|
const uploadDisabled = sourceMapsFullyDisabled || sourcemaps?.disable === "disable-upload";
|
|
64
49
|
if (!sourceMapsFullyDisabled && viteConfig.build.sourcemap !== false) {
|
|
65
50
|
try {
|
|
66
|
-
await
|
|
67
|
-
["sourcemaps", "inject", reactRouterConfig.buildDirectory],
|
|
68
|
-
debug ? "rejectOnError" : false
|
|
69
|
-
);
|
|
51
|
+
await sentry.sourcemap.inject({ directory: reactRouterConfig.buildDirectory });
|
|
70
52
|
} catch (error) {
|
|
71
53
|
console.error("[Sentry] Could not inject debug ids", error);
|
|
72
54
|
}
|
|
73
55
|
if (!uploadDisabled) {
|
|
74
56
|
try {
|
|
75
|
-
await
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
paths: [reactRouterConfig.buildDirectory]
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
live: "rejectOnError"
|
|
57
|
+
await sentry.sourcemap.upload({
|
|
58
|
+
directory: reactRouterConfig.buildDirectory,
|
|
59
|
+
release: release?.name || "undefined"
|
|
82
60
|
});
|
|
83
61
|
} catch (error) {
|
|
84
62
|
console.error("[Sentry] Could not upload sourcemaps", error);
|
|
@@ -93,7 +71,7 @@ const sentryOnBuildEnd = async ({ reactRouterConfig, viteConfig }) => {
|
|
|
93
71
|
updatedFilesToDeleteAfterUpload = [`${reactRouterConfig.buildDirectory}/**/*.map`];
|
|
94
72
|
debug && // eslint-disable-next-line no-console
|
|
95
73
|
console.info(
|
|
96
|
-
`[Sentry] Automatically setting \`
|
|
74
|
+
`[Sentry] Automatically setting \`sourcemaps.filesToDeleteAfterUpload: ${JSON.stringify(
|
|
97
75
|
updatedFilesToDeleteAfterUpload
|
|
98
76
|
)}\` to delete generated source maps after they were uploaded to Sentry.`
|
|
99
77
|
);
|
|
@@ -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 type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\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 * This hook is the only place that injects debug IDs and uploads source maps for React\n * Router, so `disable` has to be honoured wherever the user set it. Reading it from the\n * top-level config only would silently ignore `unstable_sentryVitePluginOptions`.\n */\nfunction resolveSourceMapsDisable(sentryConfig: SentryReactRouterBuildOptions): boolean | 'disable-upload' | undefined {\n // eslint-disable-next-line typescript/no-deprecated\n if (sentryConfig.sourceMapsUploadOptions?.enabled === false) {\n return true;\n }\n\n return sentryConfig.sourcemaps?.disable ?? sentryConfig.unstable_sentryVitePluginOptions?.sourcemaps?.disable;\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 unstableSentryVitePluginOptions = sentryConfig.unstable_sentryVitePluginOptions;\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 ...unstableSentryVitePluginOptions,\n ...sentryConfigWithoutDeprecatedSourceMapOption, // spread in the config without the deprecated sourceMapsUploadOptions\n sourcemaps: {\n ...unstableSentryVitePluginOptions?.sourcemaps,\n ...sentryConfig.sourcemaps,\n ...sourceMapsUploadOptions,\n disable: resolveSourceMapsDisable(sentryConfig),\n },\n release: {\n ...unstableSentryVitePluginOptions?.release,\n ...sentryConfig.release,\n },\n project: unstableSentryVitePluginOptions?.project\n ? Array.isArray(unstableSentryVitePluginOptions?.project)\n ? unstableSentryVitePluginOptions?.project[0]\n : unstableSentryVitePluginOptions?.project\n : sentryConfigWithoutDeprecatedSourceMapOption.project,\n };\n\n const cliInstance = new SentryCli(null, {\n authToken,\n org,\n ...sentryConfig.unstable_sentryVitePluginOptions,\n // same handling as in bundler plugins: https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/05084f214c763a05137d863ff5a05ef38254f68d/packages/bundler-plugin-core/src/build-plugin-manager.ts#L102-L103\n project: Array.isArray(project) ? project[0] : project,\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 // `disable: 'disable-upload'` still injects debug IDs, so that source maps can be\n // uploaded manually at a later point - only `true` turns source maps off entirely.\n const sourceMapsFullyDisabled = sourcemaps?.disable === true;\n const uploadDisabled = sourceMapsFullyDisabled || sourcemaps?.disable === 'disable-upload';\n\n if (!sourceMapsFullyDisabled && 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 if (!uploadDisabled) {\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 }\n\n // Only clean up source maps that were actually uploaded. Deleting them after skipping\n // the upload would leave the user with neither, breaking a manual upload.\n if (uploadDisabled) {\n return;\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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BAAA,EAAkB,EAAE,KAAA,EAAO,MAAM,CAAA,CAAE,KAAA,CAAM,CAAC,CAAA,KAAe;AAE1D,YAAA,KAAA;AAAA,YAEE,OAAA,CAAQ,KAAA,CAAM,CAAA,oDAAA,EAAuD,gBAAgB,IAAI,CAAC,CAAA;AAAA,UAC9F,CAAC;AAAA;AACH,OACF;AAAA,IACF,SAAS,KAAA,EAAO;AAEd,MAAA,OAAA,CAAQ,KAAA,CAAM,gDAAgD,KAAK,CAAA;AAAA,IACrE;AAAA,EACF;AACF;;;;"}
|
|
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 { createSentrySDK } from 'sentry';\nimport type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\nimport { glob } from 'glob';\nimport type { SentryReactRouterBuildOptions } from '../types';\n\ntype BuildEndHook = NonNullable<Config['buildEnd']>;\ntype SentryOptions = NonNullable<Parameters<typeof createSentrySDK>[0]>;\n\n/**\n * The CLI accepts `headers` since 0.44.0, but its bundled type declarations do not list the\n * option yet.\n * TODO: Drop once `SentryOptions` in the `sentry` package declares `headers`: https://github.com/getsentry/cli/pull/1500\n */\ntype SentryOptionsWithHeaders = SentryOptions & { headers?: Record<string, string> };\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 headers,\n org,\n project,\n release,\n sentryUrl,\n sourcemaps = { disable: false },\n debug = false,\n }: Omit<SentryReactRouterBuildOptions, 'sourcemaps'> &\n // Pick 'sourcemaps' from Vite plugin options as the types allow more (e.g. Promise values for `deleteFilesAfterUpload`)\n Pick<SentryVitePluginOptions, 'sourcemaps'> = {\n ...sentryConfig,\n sourcemaps: {\n ...sentryConfig.sourcemaps,\n disable: sentryConfig.sourcemaps?.disable,\n },\n release: {\n ...sentryConfig.release,\n },\n };\n\n const sentryOptions: SentryOptionsWithHeaders = {\n token: authToken,\n org,\n url: sentryUrl,\n project,\n headers,\n };\n\n const sentry = createSentrySDK(sentryOptions);\n\n // check if release should be created\n if (release?.name) {\n try {\n await sentry.release.create({ orgVersion: 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 // `disable: 'disable-upload'` still injects debug IDs, so that source maps can be\n // uploaded manually at a later point - only `true` turns source maps off entirely.\n const sourceMapsFullyDisabled = sourcemaps?.disable === true;\n const uploadDisabled = sourceMapsFullyDisabled || sourcemaps?.disable === 'disable-upload';\n\n if (!sourceMapsFullyDisabled && viteConfig.build.sourcemap !== false) {\n // inject debugIds\n try {\n await sentry.sourcemap.inject({ directory: reactRouterConfig.buildDirectory });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not inject debug ids', error);\n }\n\n if (!uploadDisabled) {\n // upload sourcemaps\n try {\n await sentry.sourcemap.upload({\n directory: reactRouterConfig.buildDirectory,\n release: release?.name || 'undefined',\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('[Sentry] Could not upload sourcemaps', error);\n }\n }\n }\n\n // Only clean up source maps that were actually uploaded. Deleting them after skipping\n // the upload would leave the user with neither, breaking a manual upload.\n if (uploadDisabled) {\n return;\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 \\`sourcemaps.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":";;;;AAiBA,SAAS,gBAAgB,UAAA,EAAoD;AAC3E,EAAA,IAAI,CAAC,UAAA,IAAc,OAAO,eAAe,QAAA,IAAY,EAAE,kBAAkB,UAAA,CAAA,EAAa;AAEpF,IAAA,OAAA,CAAQ,MAAM,2EAA2E,CAAA;AAAA,EAC3F;AAEA,EAAA,OAAQ,UAAA,CAA+D,YAAA;AACzE;AAOO,MAAM,gBAAA,GAAiC,OAAO,EAAE,iBAAA,EAAmB,YAAW,KAAM;AACzF,EAAA,MAAM,YAAA,GAAe,gBAAgB,UAAU,CAAA;AAE/C,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,OAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA,GAAa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KAAe;AAE1D,YAAA,KAAA;AAAA,YAEE,OAAA,CAAQ,KAAA,CAAM,CAAA,oDAAA,EAAuD,gBAAgB,IAAI,CAAC,CAAA;AAAA,UAC9F,CAAC;AAAA;AACH,OACF;AAAA,IACF,SAAS,KAAA,EAAO;AAEd,MAAA,OAAA,CAAQ,KAAA,CAAM,gDAAgD,KAAK,CAAA;AAAA,IACrE;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,64 +1,53 @@
|
|
|
1
1
|
import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
|
|
2
|
+
import { warnOnRemovedBuildOptions } from '@sentry/core';
|
|
2
3
|
|
|
3
4
|
async function makeCustomSentryVitePlugins(options) {
|
|
5
|
+
warnOnRemovedBuildOptions(options, ["unstable_sentryVitePluginOptions"]);
|
|
4
6
|
const {
|
|
5
7
|
debug,
|
|
6
|
-
unstable_sentryVitePluginOptions,
|
|
7
8
|
bundleSizeOptimizations,
|
|
8
9
|
applicationKey,
|
|
9
10
|
authToken,
|
|
11
|
+
errorHandler,
|
|
12
|
+
headers,
|
|
13
|
+
moduleMetadata,
|
|
10
14
|
org,
|
|
11
15
|
project,
|
|
16
|
+
sentryUrl,
|
|
17
|
+
silent,
|
|
12
18
|
telemetry,
|
|
13
19
|
reactComponentAnnotation,
|
|
14
20
|
release
|
|
15
21
|
} = options;
|
|
16
|
-
const unstableSourcemapsDisable = unstable_sentryVitePluginOptions?.sourcemaps?.disable;
|
|
17
|
-
if (unstableSourcemapsDisable !== void 0 && unstableSourcemapsDisable !== true) {
|
|
18
|
-
console.warn(
|
|
19
|
-
`[Sentry] \`unstable_sentryVitePluginOptions.sourcemaps.disable: ${JSON.stringify(
|
|
20
|
-
unstableSourcemapsDisable
|
|
21
|
-
)}\` does not apply to the Vite plugin. Debug ID injection and source map upload are handled by the \`sentryOnBuildEnd\` hook for React Router, so letting the Vite plugin do it as well would inject a second debug ID per chunk. The option still applies to \`sentryOnBuildEnd\`.`
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
22
|
const sentryVitePlugins = sentryVitePlugin({
|
|
25
23
|
applicationKey,
|
|
26
24
|
authToken: authToken ?? process.env.SENTRY_AUTH_TOKEN,
|
|
27
25
|
bundleSizeOptimizations,
|
|
28
26
|
debug: debug ?? false,
|
|
27
|
+
errorHandler,
|
|
28
|
+
headers,
|
|
29
|
+
moduleMetadata,
|
|
29
30
|
org: org ?? process.env.SENTRY_ORG,
|
|
30
31
|
project: project ?? process.env.SENTRY_PROJECT,
|
|
32
|
+
reactComponentAnnotation,
|
|
33
|
+
release,
|
|
34
|
+
silent,
|
|
31
35
|
telemetry: telemetry ?? true,
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
36
|
+
// Release creation runs in the plugin's `writeBundle` even with `sourcemaps.disable` set below,
|
|
37
|
+
// so the plugin needs its own URL rather than relying on the `sentryOnBuildEnd` CLI instance.
|
|
38
|
+
url: sentryUrl,
|
|
35
39
|
_metaOptions: {
|
|
36
|
-
...unstable_sentryVitePluginOptions?._metaOptions,
|
|
37
40
|
telemetry: {
|
|
38
|
-
...unstable_sentryVitePluginOptions?._metaOptions?.telemetry,
|
|
39
41
|
metaFramework: "react-router"
|
|
40
42
|
}
|
|
41
43
|
},
|
|
42
|
-
reactComponentAnnotation: {
|
|
43
|
-
// Only assign when set, as an explicit `undefined` would erase the unstable value
|
|
44
|
-
...reactComponentAnnotation?.enabled !== void 0 && { enabled: reactComponentAnnotation.enabled },
|
|
45
|
-
...reactComponentAnnotation?.ignoredComponents !== void 0 && {
|
|
46
|
-
ignoredComponents: reactComponentAnnotation.ignoredComponents
|
|
47
|
-
},
|
|
48
|
-
...unstable_sentryVitePluginOptions?.reactComponentAnnotation
|
|
49
|
-
},
|
|
50
|
-
release: {
|
|
51
|
-
...unstable_sentryVitePluginOptions?.release,
|
|
52
|
-
...release
|
|
53
|
-
},
|
|
54
44
|
sourcemaps: {
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
//
|
|
45
|
+
// Debug ID injection and upload are handled by the `sentryOnBuildEnd` hook, so the Vite plugin
|
|
46
|
+
// must never do it as well - that would inject a second debug ID per chunk and break source
|
|
47
|
+
// map resolution.
|
|
58
48
|
disable: true,
|
|
59
|
-
// The plugin deletes these in a `finally` block that runs regardless of `disable`,
|
|
60
|
-
//
|
|
61
|
-
// Deletion is handled there instead, from the same option.
|
|
49
|
+
// The plugin deletes these in a `finally` block that runs regardless of `disable`, which would
|
|
50
|
+
// remove the maps before `sentryOnBuildEnd` gets to upload them. Deletion happens there instead.
|
|
62
51
|
filesToDeleteAfterUpload: void 0
|
|
63
52
|
}
|
|
64
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeCustomSentryVitePlugins.js","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';\nimport { type Plugin } from 'vite';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * Create a custom subset of sentry's vite plugins\n */\nexport async function makeCustomSentryVitePlugins(options: SentryReactRouterBuildOptions): Promise<Plugin[]> {\n const {\n debug,\n
|
|
1
|
+
{"version":3,"file":"makeCustomSentryVitePlugins.js","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"sourcesContent":["import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';\nimport { warnOnRemovedBuildOptions } from '@sentry/core';\nimport { type Plugin } from 'vite';\nimport type { SentryReactRouterBuildOptions } from './types';\n\n/**\n * Create a custom subset of sentry's vite plugins\n */\nexport async function makeCustomSentryVitePlugins(options: SentryReactRouterBuildOptions): Promise<Plugin[]> {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const {\n debug,\n bundleSizeOptimizations,\n applicationKey,\n authToken,\n errorHandler,\n headers,\n moduleMetadata,\n org,\n project,\n sentryUrl,\n silent,\n telemetry,\n reactComponentAnnotation,\n release,\n } = options;\n\n const sentryVitePlugins = 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 reactComponentAnnotation,\n release,\n silent,\n telemetry: telemetry ?? true,\n // Release creation runs in the plugin's `writeBundle` even with `sourcemaps.disable` set below,\n // so the plugin needs its own URL rather than relying on the `sentryOnBuildEnd` CLI instance.\n url: sentryUrl,\n _metaOptions: {\n telemetry: {\n metaFramework: 'react-router',\n },\n },\n sourcemaps: {\n // Debug ID injection and upload are handled by the `sentryOnBuildEnd` hook, so the Vite plugin\n // must never do it as well - that would inject a second debug ID per chunk and break source\n // map resolution.\n disable: true,\n // The plugin deletes these in a `finally` block that runs regardless of `disable`, which would\n // remove the maps before `sentryOnBuildEnd` gets to upload them. Deletion happens there instead.\n filesToDeleteAfterUpload: undefined,\n },\n }) as Plugin[];\n\n return sentryVitePlugins;\n}\n"],"names":[],"mappings":";;;AAQA,eAAsB,4BAA4B,OAAA,EAA2D;AAC3G,EAAA,yBAAA,CAA0B,OAAA,EAAS,CAAC,kCAAkC,CAAC,CAAA;AAEvE,EAAA,MAAM;AAAA,IACJ,KAAA;AAAA,IACA,uBAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,wBAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AAEJ,EAAA,MAAM,oBAAoB,gBAAA,CAAiB;AAAA,IACzC,cAAA;AAAA,IACA,SAAA,EAAW,SAAA,IAAa,OAAA,CAAQ,GAAA,CAAI,iBAAA;AAAA,IACpC,uBAAA;AAAA,IACA,OAAO,KAAA,IAAS,KAAA;AAAA,IAChB,YAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,GAAA,EAAK,GAAA,IAAO,OAAA,CAAQ,GAAA,CAAI,UAAA;AAAA,IACxB,OAAA,EAAS,OAAA,IAAW,OAAA,CAAQ,GAAA,CAAI,cAAA;AAAA,IAChC,wBAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,WAAW,SAAA,IAAa,IAAA;AAAA;AAAA;AAAA,IAGxB,GAAA,EAAK,SAAA;AAAA,IACL,YAAA,EAAc;AAAA,MACZ,SAAA,EAAW;AAAA,QACT,aAAA,EAAe;AAAA;AACjB,KACF;AAAA,IACA,UAAA,EAAY;AAAA;AAAA;AAAA;AAAA,MAIV,OAAA,EAAS,IAAA;AAAA;AAAA;AAAA,MAGT,wBAAA,EAA0B;AAAA;AAC5B,GACD,CAAA;AAED,EAAA,OAAO,iBAAA;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createClientInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/client/createClientInstrumentation.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"createClientInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/client/createClientInstrumentation.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAuC1D;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CA6SvB;AA2BD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydratedRouter.d.ts","sourceRoot":"","sources":["../../../src/client/hydratedRouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hydratedRouter.d.ts","sourceRoot":"","sources":["../../../src/client/hydratedRouter.ts"],"names":[],"mappings":"AAmCA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAgI/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Integration } from '@sentry/core';
|
|
2
|
-
import type { ClientInstrumentation } from '
|
|
2
|
+
import type { ClientInstrumentation } from 'react-router';
|
|
3
3
|
import { type CreateSentryClientInstrumentationOptions } from './createClientInstrumentation';
|
|
4
4
|
/**
|
|
5
5
|
* Options for the React Router tracing integration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracingIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/tracingIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tracingIntegration.d.ts","sourceRoot":"","sources":["../../../src/client/tracingIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAEL,KAAK,wCAAwC,EAC9C,MAAM,+BAA+B,CAAC;AAGvC;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD;;OAEG;IACH,sBAAsB,CAAC,EAAE,wCAAwC,CAAC;IAElE,uHAAuH;IACvH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE;;;;;;OAMG;IACH,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;CACvD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAAyC,GACjD,6BAA6B,CAsB/B"}
|
|
@@ -26,7 +26,13 @@ export declare function resolveNavigateAbsoluteUrl(target: unknown, currentUrl?:
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function updateNavigationSpanUrlFromLocation(span: Span): void;
|
|
28
28
|
export declare function normalizePathname(pathname: string): string;
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Names a root span after the route the router matched.
|
|
31
|
+
*
|
|
32
|
+
* With span streaming there is nothing low cardinality to fall back to when nothing matched, so
|
|
33
|
+
* the span keeps the name it started with rather than taking on the raw URL.
|
|
34
|
+
*/
|
|
35
|
+
export declare function updateSpanWithParameterizedRoute(span: Span, routerState: RouterState): void;
|
|
30
36
|
/**
|
|
31
37
|
* Updates a navigation span's URL attributes and parameterizes its name from the router state.
|
|
32
38
|
* Used after numeric navigations (`navigate(-1)` / `navigate(1)`) where route hooks may not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/client/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/client/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASzC,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AAQ5D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAc1D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAU1D;AA0BD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CASvF;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAgBpE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1D;AA8BD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAe3F;AAED;;;;;;;GAOG;AACH,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAehG;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAOzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cloudflare/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cloudflare/index.ts"],"names":[],"mappings":"AAEA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAgCxE"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { InstrumentationResult } from './types';
|
|
2
1
|
/**
|
|
3
2
|
* Extracts pathname from request URL.
|
|
4
3
|
* Falls back to '<unknown>' with DEBUG warning if URL cannot be parsed.
|
|
@@ -23,5 +22,7 @@ export declare function normalizeRoutePath(pattern?: string): string | undefined
|
|
|
23
22
|
* Captures an error from instrumentation result.
|
|
24
23
|
* Caller must verify result contains an Error before calling.
|
|
25
24
|
*/
|
|
26
|
-
export declare function captureInstrumentationError(result:
|
|
25
|
+
export declare function captureInstrumentationError(result: {
|
|
26
|
+
error: unknown;
|
|
27
|
+
}, captureErrors: boolean, mechanismType: string, data: Record<string, string | boolean>): void;
|
|
27
28
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAYnE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAEpG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKvE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,EAC1B,aAAa,EAAE,OAAO,EACtB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GACrC,IAAI,CAUN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -3,12 +3,14 @@ import type * as clientSdk from './client';
|
|
|
3
3
|
import type * as serverSdk from './server';
|
|
4
4
|
export * from './client';
|
|
5
5
|
export * from './server';
|
|
6
|
-
export * from './vite';
|
|
7
6
|
/** Initializes Sentry React Router SDK */
|
|
8
7
|
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): void;
|
|
9
8
|
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
10
9
|
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
11
10
|
export declare const spanStreamingIntegration: typeof clientSdk.spanStreamingIntegration;
|
|
11
|
+
export declare const startSpan: typeof clientSdk.startSpan;
|
|
12
|
+
export declare const startSpanManual: typeof clientSdk.startSpanManual;
|
|
13
|
+
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;
|
|
12
14
|
export declare const withStaticSpan: typeof clientSdk.withStaticSpan;
|
|
13
15
|
export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
|
|
14
16
|
export declare const defaultStackParser: StackParser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAG3C,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,KAAK,SAAS,MAAM,UAAU,CAAC;AAG3C,cAAc,UAAU,CAAC;A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AS,CAAC,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServerInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/createServerInstrumentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createServerInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/createServerInstrumentation.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAa1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE,wCAA6C,GACrD,qBAAqB,CAmNvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetaTagTransformer.d.ts","sourceRoot":"","sources":["../../../src/server/getMetaTagTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"getMetaTagTransformer.d.ts","sourceRoot":"","sources":["../../../src/server/getMetaTagTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAoBlE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@sentry/node';
|
|
2
2
|
export { init } from './sdk';
|
|
3
|
-
export { wrapSentryHandleRequest
|
|
3
|
+
export { wrapSentryHandleRequest } from './wrapSentryHandleRequest';
|
|
4
4
|
export { createSentryHandleRequest, type SentryHandleRequestOptions } from './createSentryHandleRequest';
|
|
5
5
|
export { createSentryHandleError, type SentryHandleErrorOptions } from './createSentryHandleError';
|
|
6
6
|
export { getMetaTagTransformer } from './getMetaTagTransformer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,KAAK,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,KAAK,wCAAwC,GAC9C,MAAM,+BAA+B,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { NodeOptions } from '@sentry/node';
|
|
2
1
|
/**
|
|
3
2
|
* Integration that filters out noisy http transactions such as requests to node_modules, favicon.ico, @id/, __manifest.
|
|
4
3
|
* Adds entries to `ignoreSpans` so the filter applies in both static and streaming trace lifecycles.
|
|
5
4
|
*/
|
|
6
|
-
export declare const lowQualityTransactionsFilterIntegration: (
|
|
5
|
+
export declare const lowQualityTransactionsFilterIntegration: () => import("@sentry/core").Integration & {
|
|
7
6
|
name: "LowQualityTransactionsFilter";
|
|
8
7
|
};
|
|
9
8
|
//# sourceMappingURL=lowQualityTransactionsFilterIntegration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowQualityTransactionsFilterIntegration.d.ts","sourceRoot":"","sources":["../../../../src/server/integration/lowQualityTransactionsFilterIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lowQualityTransactionsFilterIntegration.d.ts","sourceRoot":"","sources":["../../../../src/server/integration/lowQualityTransactionsFilterIntegration.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,uCAAuC;;CAA8D,CAAC"}
|
|
@@ -15,7 +15,5 @@ export declare function wrapSentryHandleRequest(originalHandle: OriginalHandleRe
|
|
|
15
15
|
* @returns A wrapped version of the handle request function with Sentry instrumentation
|
|
16
16
|
*/
|
|
17
17
|
export declare function wrapSentryHandleRequest(originalHandle: OriginalHandleRequestWithMiddleware): OriginalHandleRequestWithMiddleware;
|
|
18
|
-
/** @deprecated Use `wrapSentryHandleRequest` instead. */
|
|
19
|
-
export declare const sentryHandleRequest: typeof wrapSentryHandleRequest;
|
|
20
18
|
export {};
|
|
21
19
|
//# sourceMappingURL=wrapSentryHandleRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapSentryHandleRequest.d.ts","sourceRoot":"","sources":["../../../src/server/wrapSentryHandleRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapSentryHandleRequest.d.ts","sourceRoot":"","sources":["../../../src/server/wrapSentryHandleRequest.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAGxF,KAAK,sCAAsC,GAAG,CAC5C,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,OAAO,EACxB,aAAa,EAAE,YAAY,EAC3B,WAAW,EAAE,cAAc,KACxB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,KAAK,mCAAmC,GAAG,CACzC,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,OAAO,EACxB,aAAa,EAAE,YAAY,EAC3B,WAAW,EAAE,qBAAqB,KAC/B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,sCAAsC,GACrD,sCAAsC,CAAC;AAC1C;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,mCAAmC,GAClD,mCAAmC,CAAC"}
|
|
@@ -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;AAMvD,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,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;AAmBpD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAwH9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeCustomSentryVitePlugins.d.ts","sourceRoot":"","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeCustomSentryVitePlugins.d.ts","sourceRoot":"","sources":["../../../src/vite/makeCustomSentryVitePlugins.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D;;GAEG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAsD3G"}
|
|
@@ -1,48 +1,16 @@
|
|
|
1
|
-
import type { BuildTimeOptionsBase,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { BuildTimeOptionsBase, ReactComponentAnnotationOptions } from '@sentry/core';
|
|
2
|
+
/**
|
|
3
|
+
* `resolveSourceMap` is a bundler-plugin hook, applied during the plugin's own debug ID upload.
|
|
4
|
+
* React Router keeps the Vite plugin's source map handling disabled and uploads through `SentryCli`
|
|
5
|
+
* in `sentryOnBuildEnd` instead, so there is nowhere to apply the hook - it is omitted rather than
|
|
6
|
+
* accepted and silently ignored.
|
|
7
|
+
*/
|
|
8
|
+
type SourceMapsOptions = Omit<NonNullable<BuildTimeOptionsBase['sourcemaps']>, 'resolveSourceMap'>;
|
|
9
|
+
export type SentryReactRouterBuildOptions = Omit<BuildTimeOptionsBase, 'sourcemaps'> & {
|
|
4
10
|
/**
|
|
5
|
-
*
|
|
6
|
-
* automatically generate and upload source maps to Sentry during a production build.
|
|
7
|
-
*
|
|
8
|
-
* @default true
|
|
9
|
-
* @deprecated Use `sourcemaps.disable` option instead of `sourceMapsUploadOptions.enabled`.
|
|
11
|
+
* Options related to source maps upload and processing.
|
|
10
12
|
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
|
|
14
|
-
* upload to Sentry has been completed.
|
|
15
|
-
*
|
|
16
|
-
* @default [] - By default no files are deleted.
|
|
17
|
-
*
|
|
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`.
|
|
21
|
-
*/
|
|
22
|
-
filesToDeleteAfterUpload?: string | Array<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Options related to managing the Sentry releases for a build.
|
|
25
|
-
*
|
|
26
|
-
* More info: https://docs.sentry.io/product/releases/
|
|
27
|
-
*
|
|
28
|
-
* @deprecated Use the `release` option at the root of `SentryVitePluginOptions` instead.
|
|
29
|
-
*/
|
|
30
|
-
release?: {
|
|
31
|
-
/**
|
|
32
|
-
* Unique identifier for the release you want to create.
|
|
33
|
-
*
|
|
34
|
-
* This value can also be specified via the `SENTRY_RELEASE` environment variable.
|
|
35
|
-
*
|
|
36
|
-
* Defaults to automatically detecting a value for your environment.
|
|
37
|
-
* This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
|
|
38
|
-
* (the latter requires access to git CLI and for the root directory to be a valid repository)
|
|
39
|
-
*
|
|
40
|
-
* If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
|
|
41
|
-
*/
|
|
42
|
-
name?: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
export type SentryReactRouterBuildOptions = BuildTimeOptionsBase & UnstableVitePluginOptions<Partial<SentryVitePluginOptions>> & {
|
|
13
|
+
sourcemaps?: SourceMapsOptions;
|
|
46
14
|
/**
|
|
47
15
|
* Options related to react component name annotations.
|
|
48
16
|
* Disabled by default, unless a value is set for this option.
|
|
@@ -50,21 +18,7 @@ export type SentryReactRouterBuildOptions = BuildTimeOptionsBase & UnstableViteP
|
|
|
50
18
|
* This will unlock the capability to search for Replays in Sentry by component name, as well as see component names in breadcrumbs and performance monitoring.
|
|
51
19
|
* Please note that this feature is not currently supported by the esbuild bundler plugins, and will only annotate React components
|
|
52
20
|
*/
|
|
53
|
-
reactComponentAnnotation?:
|
|
54
|
-
/**
|
|
55
|
-
* Whether the component name annotate plugin should be enabled or not.
|
|
56
|
-
*/
|
|
57
|
-
enabled?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
|
|
60
|
-
*/
|
|
61
|
-
ignoredComponents?: string[];
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Options for the Sentry Vite plugin to customize the source maps upload process.
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
sourceMapsUploadOptions?: SourceMapsOptions;
|
|
21
|
+
reactComponentAnnotation?: ReactComponentAnnotationOptions;
|
|
68
22
|
};
|
|
69
23
|
export {};
|
|
70
24
|
//# 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,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAE1F;;;;;GAKG;AACH,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAEnG,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,GAAG;IACrF;;OAEG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,+BAA+B,CAAC;CAC5D,CAAC"}
|