@sentry/nuxt 10.65.0 → 10.67.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/module.js +4 -0
- package/build/cjs/module.js.map +1 -1
- package/build/cjs/vite/orchestrion.js +27 -0
- package/build/cjs/vite/orchestrion.js.map +1 -0
- package/build/cjs/vite/sourceMaps.js +1 -3
- package/build/cjs/vite/sourceMaps.js.map +1 -1
- package/build/esm/module.js +4 -0
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/vite/orchestrion.js +25 -0
- package/build/esm/vite/orchestrion.js.map +1 -0
- package/build/esm/vite/sourceMaps.js +1 -3
- package/build/esm/vite/sourceMaps.js.map +1 -1
- package/build/module/client/vueIntegration.d.ts +12 -0
- package/build/module/{module.d.mts → common/types.d.ts} +38 -11
- package/build/module/module.d.ts +4 -232
- package/build/module/module.json +2 -6
- package/build/module/module.mjs +29 -7
- package/build/module/runtime/hooks/captureErrorHook.js +7 -4
- package/build/module/runtime/hooks/updateRouteBeforeResponse.js +5 -2
- package/build/module/runtime/hooks/wrapMiddlewareHandler.js +5 -14
- package/build/module/runtime/plugins/database-legacy.server.js +8 -5
- package/build/module/runtime/plugins/database.server.js +8 -5
- package/build/module/runtime/plugins/handler-legacy.server.js +6 -3
- package/build/module/runtime/plugins/handler.server.js +6 -3
- package/build/module/runtime/plugins/index.d.ts +1 -1
- package/build/module/runtime/plugins/index.js +1 -1
- package/build/module/runtime/plugins/route-detector-legacy.server.js +8 -5
- package/build/module/runtime/plugins/route-detector.server.js +8 -5
- package/build/module/runtime/plugins/sentry-cloudflare.server.js +10 -7
- package/build/module/runtime/plugins/sentry.client.js +8 -5
- package/build/module/runtime/plugins/sentry.server.js +8 -5
- package/build/module/runtime/plugins/storage-legacy.server.js +8 -5
- package/build/module/runtime/plugins/storage.server.js +8 -5
- package/build/module/runtime/plugins/update-route-name-legacy.server.js +6 -3
- package/build/module/runtime/plugins/update-route-name.server.js +6 -3
- package/build/module/runtime/utils/database-span-data.js +3 -1
- package/build/module/runtime/utils/event-type-check.js +6 -4
- package/build/module/runtime/utils/instrumentDatabase.d.ts +1 -1
- package/build/module/runtime/utils/instrumentDatabase.js +6 -12
- package/build/module/runtime/utils/instrumentStorage.js +6 -15
- package/build/module/runtime/utils/patchEventHandler.js +5 -8
- package/build/module/runtime/utils/route-extraction.js +5 -2
- package/build/module/runtime/utils.js +7 -4
- package/build/module/vendor/server-template.d.ts +7 -0
- package/build/module/vite/addServerConfig.d.ts +22 -0
- package/build/module/vite/databaseConfig.d.ts +6 -0
- package/build/module/vite/middlewareConfig.d.ts +11 -0
- package/build/module/vite/orchestrion.d.ts +6 -0
- package/build/module/vite/sentryVitePlugin.d.ts +11 -0
- package/build/module/vite/sourceMaps.d.ts +66 -0
- package/build/module/vite/storageConfig.d.ts +5 -0
- package/build/module/vite/utils.d.ts +58 -0
- package/build/types/common/types.d.ts +16 -0
- package/build/types/common/types.d.ts.map +1 -1
- package/build/types/module.d.ts.map +1 -1
- package/build/types/vite/orchestrion.d.ts +7 -0
- package/build/types/vite/orchestrion.d.ts.map +1 -0
- package/build/types/vite/sourceMaps.d.ts.map +1 -1
- package/package.json +11 -12
- package/build/module/module.cjs +0 -5
- package/build/module/types.d.mts +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VueIntegrationOptions } from '@sentry/vue';
|
|
2
|
+
type Options = Omit<VueIntegrationOptions, 'app' | 'Vue'>;
|
|
3
|
+
export type GlobalObjWithIntegrationOptions = {
|
|
4
|
+
_sentryNuxtVueIntegrationOptions?: Options;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Add additional error and span instrumentation specialized for Vue.
|
|
8
|
+
*/
|
|
9
|
+
export declare const vueIntegration: (options?: Options | undefined) => import("@sentry/core").Integration & {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { SentryRollupPluginOptions } from '@sentry/rollup-plugin';
|
|
4
|
-
import { SentryVitePluginOptions } from '@sentry/vite-plugin';
|
|
5
|
-
|
|
1
|
+
import type { BuildTimeOptionsBase } from '@sentry/core';
|
|
2
|
+
import type { init as initNode } from '@sentry/node';
|
|
3
|
+
import type { SentryRollupPluginOptions } from '@sentry/rollup-plugin';
|
|
4
|
+
import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
|
|
5
|
+
import type { init as initVue } from '@sentry/vue';
|
|
6
|
+
export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'>;
|
|
7
|
+
export type SentryNuxtServerOptions = Parameters<typeof initNode>[0] & {
|
|
8
|
+
/**
|
|
9
|
+
* Enables the Sentry error handler for the Nitro error hook.
|
|
10
|
+
*
|
|
11
|
+
* When enabled, exceptions are automatically sent to Sentry with additional data such as the transaction name and Nitro error context.
|
|
12
|
+
* It's recommended to keep this enabled unless you need to implement a custom error handler.
|
|
13
|
+
*
|
|
14
|
+
* If you need a custom implementation, disable this option and refer to the default handler as a reference:
|
|
15
|
+
* https://github.com/getsentry/sentry-javascript/blob/da8ba8d77a28b43da5014acc8dd98906d2180cc1/packages/nuxt/src/runtime/plugins/sentry.server.ts#L20-L46
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
enableNitroErrorHandler?: boolean;
|
|
20
|
+
};
|
|
6
21
|
type SourceMapsOptions = {
|
|
7
22
|
/**
|
|
8
23
|
* Suppresses all logs.
|
|
@@ -144,13 +159,29 @@ type SourceMapsOptions = {
|
|
|
144
159
|
/**
|
|
145
160
|
* Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
|
|
146
161
|
*/
|
|
147
|
-
type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
162
|
+
export type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
148
163
|
/**
|
|
149
164
|
* Enable the Sentry Nuxt Module.
|
|
150
165
|
*
|
|
151
166
|
* @default true
|
|
152
167
|
*/
|
|
153
168
|
enabled?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Experimental build-time options that may change or be removed without notice.
|
|
171
|
+
*/
|
|
172
|
+
_experimental?: {
|
|
173
|
+
/**
|
|
174
|
+
* Enables build-time diagnostics-channel instrumentation for supported dependencies bundled into the Nitro server.
|
|
175
|
+
*
|
|
176
|
+
* 1. Call `Sentry.experimentalUseDiagnosticsChannelInjection()` just before `Sentry.init()`
|
|
177
|
+
* 2. Remove `--import ./.output/server/sentry.server.config.mjs` from your `start`script
|
|
178
|
+
* 3. Add `sentry.autoInjectServerSentry: 'top-level-import'` in `nuxt.config.ts` so Sentry's server configuration is automatically imported
|
|
179
|
+
*
|
|
180
|
+
* @default false
|
|
181
|
+
* @experimental May change or be removed in any release.
|
|
182
|
+
*/
|
|
183
|
+
useDiagnosticsChannelInjection?: boolean;
|
|
184
|
+
};
|
|
154
185
|
/**
|
|
155
186
|
* Options for the Sentry Vite plugin to customize the source maps upload process.
|
|
156
187
|
*
|
|
@@ -225,8 +256,4 @@ type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
225
256
|
*/
|
|
226
257
|
unstable_sentryBundlerPluginOptions?: SentryRollupPluginOptions & SentryVitePluginOptions;
|
|
227
258
|
};
|
|
228
|
-
|
|
229
|
-
type ModuleOptions = SentryNuxtModuleOptions;
|
|
230
|
-
declare const _default: _nuxt_schema.NuxtModule<SentryNuxtModuleOptions, SentryNuxtModuleOptions, false>;
|
|
231
|
-
|
|
232
|
-
export { type ModuleOptions, _default as default };
|
|
259
|
+
export {};
|
package/build/module/module.d.ts
CHANGED
|
@@ -1,232 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type SourceMapsOptions = {
|
|
7
|
-
/**
|
|
8
|
-
* Suppresses all logs.
|
|
9
|
-
*
|
|
10
|
-
* @default false
|
|
11
|
-
* @deprecated Use option `silent` instead of `sourceMapsUploadOptions.silent`
|
|
12
|
-
*/
|
|
13
|
-
silent?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
|
|
16
|
-
*
|
|
17
|
-
* By default, the plugin will simply throw an error, thereby stopping the bundling process.
|
|
18
|
-
* If an `errorHandler` callback is provided, compilation will continue, unless an error is
|
|
19
|
-
* thrown in the provided callback.
|
|
20
|
-
*
|
|
21
|
-
* To allow compilation to continue but still emit a warning, set this option to the following:
|
|
22
|
-
*
|
|
23
|
-
* ```js
|
|
24
|
-
* (err) => {
|
|
25
|
-
* console.warn(err);
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @deprecated Use option `errorHandler` instead of `sourceMapsUploadOptions.errorHandler`
|
|
30
|
-
*/
|
|
31
|
-
errorHandler?: (err: Error) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Options related to managing the Sentry releases for a build.
|
|
34
|
-
*
|
|
35
|
-
* More info: https://docs.sentry.io/product/releases/
|
|
36
|
-
*
|
|
37
|
-
* @deprecated Use option `release` instead of `sourceMapsUploadOptions.release`
|
|
38
|
-
*/
|
|
39
|
-
release?: {
|
|
40
|
-
/**
|
|
41
|
-
* Unique identifier for the release you want to create.
|
|
42
|
-
*
|
|
43
|
-
* This value can also be specified via the `SENTRY_RELEASE` environment variable.
|
|
44
|
-
*
|
|
45
|
-
* Defaults to automatically detecting a value for your environment.
|
|
46
|
-
* This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
|
|
47
|
-
* (the latter requires access to git CLI and for the root directory to be a valid repository)
|
|
48
|
-
*
|
|
49
|
-
* If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
|
|
50
|
-
*
|
|
51
|
-
* @deprecated Use `release.name` instead of `sourceMapsUploadOptions.release.name`
|
|
52
|
-
*/
|
|
53
|
-
name?: string;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* If this flag is `true`, and an auth token is detected, the Sentry SDK will
|
|
57
|
-
* automatically generate and upload source maps to Sentry during a production build.
|
|
58
|
-
*
|
|
59
|
-
* @default true
|
|
60
|
-
* @deprecated Use option `sourcemaps.disable` instead of `sourceMapsUploadOptions.enabled`
|
|
61
|
-
*/
|
|
62
|
-
enabled?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* The auth token to use when uploading source maps to Sentry.
|
|
65
|
-
*
|
|
66
|
-
* Instead of specifying this option, you can also set the `SENTRY_AUTH_TOKEN` environment variable.
|
|
67
|
-
*
|
|
68
|
-
* To create an auth token, follow this guide:
|
|
69
|
-
* @see https://docs.sentry.io/product/accounts/auth-tokens/#organization-auth-tokens
|
|
70
|
-
* @deprecated Use option `authToken` instead of `sourceMapsUploadOptions.authToken`
|
|
71
|
-
*/
|
|
72
|
-
authToken?: string;
|
|
73
|
-
/**
|
|
74
|
-
* The organization slug of your Sentry organization.
|
|
75
|
-
* Instead of specifying this option, you can also set the `SENTRY_ORG` environment variable.
|
|
76
|
-
* @deprecated Use option `org` instead of `sourceMapsUploadOptions.org`
|
|
77
|
-
*/
|
|
78
|
-
org?: string;
|
|
79
|
-
/**
|
|
80
|
-
* The URL of your Sentry instance if you're using self-hosted Sentry.
|
|
81
|
-
*
|
|
82
|
-
* @default https://sentry.io by default the plugin will point towards the Sentry SaaS URL
|
|
83
|
-
* @deprecated Use `sentryUrl` instead of `sourceMapsUploadOptions.url`
|
|
84
|
-
*/
|
|
85
|
-
url?: string;
|
|
86
|
-
/**
|
|
87
|
-
* The project slug of your Sentry project.
|
|
88
|
-
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.
|
|
89
|
-
*
|
|
90
|
-
* @deprecated Use option `project` instead of `sourceMapsUploadOptions.project`
|
|
91
|
-
*/
|
|
92
|
-
project?: string;
|
|
93
|
-
/**
|
|
94
|
-
* If this flag is `true`, the Sentry plugin will collect some telemetry data and send it to Sentry.
|
|
95
|
-
* It will not collect any sensitive or user-specific data.
|
|
96
|
-
*
|
|
97
|
-
* @default true
|
|
98
|
-
* @deprecated Use option `telemetry` instead of `sourceMapsUploadOptions.telemetry`
|
|
99
|
-
*/
|
|
100
|
-
telemetry?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Options related to sourcemaps
|
|
103
|
-
*
|
|
104
|
-
* @deprecated Use option `sourcemaps` instead of `sourceMapsUploadOptions.sourcemaps`
|
|
105
|
-
*/
|
|
106
|
-
sourcemaps?: {
|
|
107
|
-
/**
|
|
108
|
-
* A glob or an array of globs that specify the build artifacts and source maps that will be uploaded to Sentry.
|
|
109
|
-
*
|
|
110
|
-
* If this option is not specified, sensible defaults based on your adapter and nuxt.config.js
|
|
111
|
-
* setup will be used. Use this option to override these defaults, for instance if you have a
|
|
112
|
-
* customized build setup that diverges from Nuxt's defaults.
|
|
113
|
-
*
|
|
114
|
-
* The globbing patterns must follow the implementation of the `glob` package.
|
|
115
|
-
* @see https://www.npmjs.com/package/glob#glob-primer
|
|
116
|
-
*
|
|
117
|
-
* @deprecated Use option `sourcemaps.assets` instead of `sourceMapsUploadOptions.sourcemaps.assets`
|
|
118
|
-
*/
|
|
119
|
-
assets?: string | Array<string>;
|
|
120
|
-
/**
|
|
121
|
-
* A glob or an array of globs that specifies which build artifacts should not be uploaded to Sentry.
|
|
122
|
-
*
|
|
123
|
-
* @default [] - By default no files are ignored. Thus, all files matching the `assets` glob
|
|
124
|
-
* or the default value for `assets` are uploaded.
|
|
125
|
-
*
|
|
126
|
-
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
|
|
127
|
-
*
|
|
128
|
-
* @deprecated Use option `sourcemaps.ignore` instead of `sourceMapsUploadOptions.sourcemaps.ignore`
|
|
129
|
-
*/
|
|
130
|
-
ignore?: string | Array<string>;
|
|
131
|
-
/**
|
|
132
|
-
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
|
|
133
|
-
* upload to Sentry has been completed.
|
|
134
|
-
*
|
|
135
|
-
* @default [] - By default no files are deleted.
|
|
136
|
-
*
|
|
137
|
-
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
|
|
138
|
-
*
|
|
139
|
-
* @deprecated Use option `sourcemaps.filesToDeleteAfterUpload` instead of `sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload`
|
|
140
|
-
*/
|
|
141
|
-
filesToDeleteAfterUpload?: string | Array<string>;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Build options for the Sentry module. These options are used during build-time by the Sentry SDK.
|
|
146
|
-
*/
|
|
147
|
-
type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
148
|
-
/**
|
|
149
|
-
* Enable the Sentry Nuxt Module.
|
|
150
|
-
*
|
|
151
|
-
* @default true
|
|
152
|
-
*/
|
|
153
|
-
enabled?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Options for the Sentry Vite plugin to customize the source maps upload process.
|
|
156
|
-
*
|
|
157
|
-
* These options are always read from the `sentry` module options in the `nuxt.config.(js|ts).
|
|
158
|
-
* Do not define them in the `sentry.client.config.(js|ts)` or `sentry.server.config.(js|ts)` files.
|
|
159
|
-
*
|
|
160
|
-
* @deprecated This option was deprecated as it adds unnecessary nesting.
|
|
161
|
-
* Put the options one level higher to the root-level of the `sentry` module options.
|
|
162
|
-
*/
|
|
163
|
-
sourceMapsUploadOptions?: SourceMapsOptions;
|
|
164
|
-
/**
|
|
165
|
-
*
|
|
166
|
-
* Enables (partial) server tracing by automatically injecting Sentry for environments where modifying the node option `--import` is not possible.
|
|
167
|
-
*
|
|
168
|
-
* **DO NOT** add the node CLI flag `--import` in your node start script, when auto-injecting Sentry.
|
|
169
|
-
* This would initialize Sentry twice on the server-side and this leads to unexpected issues.
|
|
170
|
-
*
|
|
171
|
-
* ---
|
|
172
|
-
*
|
|
173
|
-
* **"top-level-import"**
|
|
174
|
-
*
|
|
175
|
-
* Enabling basic server tracing with top-level import can be used for environments where modifying the node option `--import` is not possible.
|
|
176
|
-
* However, enabling this option only supports limited tracing instrumentation. Only http traces will be collected (but no database-specific traces etc.).
|
|
177
|
-
*
|
|
178
|
-
* If `"top-level-import"` is enabled, the Sentry SDK will import the Sentry server config at the top of the server entry file to load the SDK on the server.
|
|
179
|
-
*
|
|
180
|
-
* ---
|
|
181
|
-
* **"experimental_dynamic-import"**
|
|
182
|
-
*
|
|
183
|
-
* Wraps the server entry file with a dynamic `import()`. This will make it possible to preload Sentry and register
|
|
184
|
-
* necessary hooks before other code runs. (Node docs: https://nodejs.org/api/module.html#enabling)
|
|
185
|
-
*
|
|
186
|
-
* If `"experimental_dynamic-import"` is enabled, the Sentry SDK wraps the server entry file with `import()`.
|
|
187
|
-
*
|
|
188
|
-
* @default undefined
|
|
189
|
-
*/
|
|
190
|
-
autoInjectServerSentry?: 'top-level-import' | 'experimental_dynamic-import';
|
|
191
|
-
/**
|
|
192
|
-
* Provide the resolved path to a custom Sentry client config file.
|
|
193
|
-
*
|
|
194
|
-
* If not provided, the default location (`<projectRoot>/sentry.(client|server).config.(js|ts)`) will be used to look up the config file.
|
|
195
|
-
* If there is no file at the default location either, the SDK won't be initialized.
|
|
196
|
-
*
|
|
197
|
-
* Resolves the full path to a file or directory, respecting Nuxt alias and extensions options.
|
|
198
|
-
* @example
|
|
199
|
-
*
|
|
200
|
-
* ```ts
|
|
201
|
-
* sentry: {
|
|
202
|
-
* configDir: '~/sentry-config',
|
|
203
|
-
* // Sentry will search for `<rootDir>/<srcDir>/sentry-config/sentry.(client|server).config.(js|ts)` files.
|
|
204
|
-
* }
|
|
205
|
-
* ```
|
|
206
|
-
*/
|
|
207
|
-
configDir?: string;
|
|
208
|
-
/**
|
|
209
|
-
* When `autoInjectServerSentry` is set to `"experimental_dynamic-import"`, the SDK will wrap your Nitro server entrypoint
|
|
210
|
-
* with a dynamic `import()` to ensure all dependencies can be properly instrumented. Any previous exports from the entrypoint are still exported.
|
|
211
|
-
* Most exports of the server entrypoint are serverless functions and those are wrapped by Sentry. Other exports stay as-is.
|
|
212
|
-
*
|
|
213
|
-
* By default, the SDK will wrap the default export as well as a `handler` or `server` export from the entrypoint.
|
|
214
|
-
* If your server has a different main export that is used to run the server, you can overwrite this by providing an array of export names to wrap.
|
|
215
|
-
* Any wrapped export is expected to be an async function.
|
|
216
|
-
*
|
|
217
|
-
* @default ['default', 'handler', 'server']
|
|
218
|
-
*/
|
|
219
|
-
experimental_entrypointWrappedFunctions?: string[];
|
|
220
|
-
/**
|
|
221
|
-
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) and Sentry Vite Plugin (`@sentry/vite-plugin`) that ship with the Sentry Nuxt SDK.
|
|
222
|
-
* You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin.
|
|
223
|
-
*
|
|
224
|
-
* Please note that this option is unstable and may change in a breaking way in any release.
|
|
225
|
-
*/
|
|
226
|
-
unstable_sentryBundlerPluginOptions?: SentryRollupPluginOptions & SentryVitePluginOptions;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
type ModuleOptions = SentryNuxtModuleOptions;
|
|
230
|
-
declare const _default: _nuxt_schema.NuxtModule<SentryNuxtModuleOptions, SentryNuxtModuleOptions, false>;
|
|
231
|
-
|
|
232
|
-
export { type ModuleOptions, _default as default };
|
|
1
|
+
import type { SentryNuxtModuleOptions } from './common/types';
|
|
2
|
+
export type ModuleOptions = SentryNuxtModuleOptions;
|
|
3
|
+
declare const _default: import("@nuxt/schema").NuxtModule<SentryNuxtModuleOptions, SentryNuxtModuleOptions, false>;
|
|
4
|
+
export default _default;
|
package/build/module/module.json
CHANGED
package/build/module/module.mjs
CHANGED
|
@@ -3,6 +3,8 @@ import { consoleSandbox, debug } from '@sentry/core';
|
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import * as fs from 'fs';
|
|
6
|
+
import { INSTRUMENTED_MODULE_NAMES } from '@sentry/server-utils/orchestrion/config';
|
|
7
|
+
import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/rollup';
|
|
6
8
|
import { sentryRollupPlugin } from '@sentry/rollup-plugin';
|
|
7
9
|
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|
8
10
|
|
|
@@ -233,8 +235,7 @@ function wrapEntryWithDynamicImport({
|
|
|
233
235
|
}
|
|
234
236
|
if (options.isEntry && source.includes(".mjs") && !source.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`)) {
|
|
235
237
|
const resolution = await this.resolve(source, importer, options);
|
|
236
|
-
if (!resolution || resolution?.external)
|
|
237
|
-
return resolution;
|
|
238
|
+
if (!resolution || resolution?.external) return resolution;
|
|
238
239
|
const moduleInfo = await this.load(resolution);
|
|
239
240
|
moduleInfo.moduleSideEffects = true;
|
|
240
241
|
return resolution.id.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`) ? resolution.id : `${resolutionIdPrefix}${resolution.id.concat(SENTRY_WRAPPED_ENTRY).concat(
|
|
@@ -360,6 +361,26 @@ ${originalCode.replace(/defineEventHandler\(/g, "defineInstrumentedEventHandler(
|
|
|
360
361
|
`;
|
|
361
362
|
}
|
|
362
363
|
|
|
364
|
+
const IORedisDependencies = ["standard-as-callback"];
|
|
365
|
+
function setupOrchestrion(nuxt) {
|
|
366
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
367
|
+
if (nuxt.options?._prepare) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
nitroConfig.rollupConfig ?? (nitroConfig.rollupConfig = {});
|
|
371
|
+
if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === void 0) {
|
|
372
|
+
nitroConfig.rollupConfig.plugins = [];
|
|
373
|
+
} else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {
|
|
374
|
+
nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];
|
|
375
|
+
}
|
|
376
|
+
nitroConfig.rollupConfig.plugins.push(sentryOrchestrionPlugin());
|
|
377
|
+
const externals = nitroConfig.externals || (nitroConfig.externals = {});
|
|
378
|
+
const inline = externals.inline;
|
|
379
|
+
const existingInline = Array.isArray(inline) ? inline : inline ? [inline] : [];
|
|
380
|
+
externals.inline = [.../* @__PURE__ */ new Set([...existingInline, ...INSTRUMENTED_MODULE_NAMES, ...IORedisDependencies])];
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
363
384
|
function validateSourceMapsOptionsPlugin(options) {
|
|
364
385
|
const { nuxt, moduleOptions, sourceMapsEnabled } = options;
|
|
365
386
|
const isDebug = moduleOptions.debug;
|
|
@@ -427,9 +448,7 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
427
448
|
}
|
|
428
449
|
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
429
450
|
if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {
|
|
430
|
-
|
|
431
|
-
nitroConfig.rollupConfig = {};
|
|
432
|
-
}
|
|
451
|
+
nitroConfig.rollupConfig ?? (nitroConfig.rollupConfig = {});
|
|
433
452
|
if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === void 0) {
|
|
434
453
|
nitroConfig.rollupConfig.plugins = [];
|
|
435
454
|
} else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {
|
|
@@ -647,7 +666,7 @@ function addStorageInstrumentation(nuxt, isLegacyNitro) {
|
|
|
647
666
|
}
|
|
648
667
|
}
|
|
649
668
|
|
|
650
|
-
|
|
669
|
+
var module$1 = defineNuxtModule({
|
|
651
670
|
meta: {
|
|
652
671
|
name: "@sentry/nuxt/module",
|
|
653
672
|
configKey: "sentry",
|
|
@@ -700,6 +719,9 @@ const module = defineNuxtModule({
|
|
|
700
719
|
const nuxtMajor = parseInt(nuxt._version?.split(".")[0] ?? "3", 10);
|
|
701
720
|
const isMinNuxtV4 = nuxtMajor >= 4;
|
|
702
721
|
if (serverConfigFile) {
|
|
722
|
+
if (moduleOptions._experimental?.useDiagnosticsChannelInjection) {
|
|
723
|
+
setupOrchestrion(nuxt);
|
|
724
|
+
}
|
|
703
725
|
if (isNitroV3) {
|
|
704
726
|
addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/handler.server"));
|
|
705
727
|
addServerPlugin(moduleDirResolver.resolve("./runtime/plugins/update-route-name.server"));
|
|
@@ -815,4 +837,4 @@ const module = defineNuxtModule({
|
|
|
815
837
|
}
|
|
816
838
|
});
|
|
817
839
|
|
|
818
|
-
export { module as default };
|
|
840
|
+
export { module$1 as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { H3Error } from
|
|
3
|
-
import { extractErrorContext } from
|
|
4
|
-
|
|
1
|
+
import { getClient, getCurrentScope, captureException, flushIfServerless } from '@sentry/core';
|
|
2
|
+
import { H3Error } from 'h3';
|
|
3
|
+
import { extractErrorContext } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
async function sentryCaptureErrorHook(error, errorContext) {
|
|
5
6
|
const sentryClient = getClient();
|
|
6
7
|
const sentryClientOptions = sentryClient?.getOptions();
|
|
7
8
|
if (sentryClientOptions && "enableNitroErrorHandler" in sentryClientOptions && sentryClientOptions.enableNitroErrorHandler === false) {
|
|
@@ -29,3 +30,5 @@ export async function sentryCaptureErrorHook(error, errorContext) {
|
|
|
29
30
|
});
|
|
30
31
|
await flushIfServerless();
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
export { sentryCaptureErrorHook };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, isObjectLike, debug } from '@sentry/core';
|
|
2
|
+
|
|
2
3
|
function getMatchedRoutePath(event) {
|
|
3
4
|
const matchedRoute = event.context.matchedRoute;
|
|
4
5
|
return matchedRoute?.path ?? matchedRoute?.route;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
function updateRouteBeforeResponse(event) {
|
|
7
8
|
if (!event.context.matchedRoute) {
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
@@ -37,3 +38,5 @@ export function updateRouteBeforeResponse(event) {
|
|
|
37
38
|
debug.log(`Updated transaction name for parametrized route: ${matchedRoutePath}`);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
export { updateRouteBeforeResponse };
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
flushIfServerless,
|
|
5
|
-
getClient,
|
|
6
|
-
httpHeadersToSpanAttributes,
|
|
7
|
-
SEMANTIC_ATTRIBUTE_SENTRY_OP,
|
|
8
|
-
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
9
|
-
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
|
|
10
|
-
SPAN_STATUS_ERROR,
|
|
11
|
-
SPAN_STATUS_OK,
|
|
12
|
-
startSpan
|
|
13
|
-
} from "@sentry/core";
|
|
14
|
-
export function wrapMiddlewareHandlerWithSentry(handler, fileName) {
|
|
1
|
+
import { debug, httpHeadersToSpanAttributes, getClient, startSpan, SPAN_STATUS_OK, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, flushIfServerless, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
function wrapMiddlewareHandlerWithSentry(handler, fileName) {
|
|
15
4
|
if (!isEventHandlerObject(handler)) {
|
|
16
5
|
return wrapEventHandler(handler, fileName);
|
|
17
6
|
}
|
|
@@ -112,3 +101,5 @@ function getSpanAttributes(event, middlewareName, hookName, index) {
|
|
|
112
101
|
function isEventHandlerObject(handler) {
|
|
113
102
|
return typeof handler !== "function";
|
|
114
103
|
}
|
|
104
|
+
|
|
105
|
+
export { wrapMiddlewareHandlerWithSentry };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { useDatabase } from
|
|
2
|
-
import { databaseConfig } from
|
|
3
|
-
import { createDatabasePlugin } from
|
|
4
|
-
|
|
1
|
+
import { useDatabase } from 'nitropack/runtime';
|
|
2
|
+
import { databaseConfig } from '#sentry/database-config.mjs';
|
|
3
|
+
import { createDatabasePlugin } from '../utils/instrumentDatabase.js';
|
|
4
|
+
|
|
5
|
+
var databaseLegacy_server = (() => {
|
|
5
6
|
createDatabasePlugin(useDatabase, databaseConfig);
|
|
6
|
-
};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { databaseLegacy_server as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { useDatabase } from
|
|
2
|
-
import { databaseConfig } from
|
|
3
|
-
import { createDatabasePlugin } from
|
|
4
|
-
|
|
1
|
+
import { useDatabase } from 'nitro/database';
|
|
2
|
+
import { databaseConfig } from '#sentry/database-config.mjs';
|
|
3
|
+
import { createDatabasePlugin } from '../utils/instrumentDatabase.js';
|
|
4
|
+
|
|
5
|
+
var database_server = (() => {
|
|
5
6
|
createDatabasePlugin(useDatabase, databaseConfig);
|
|
6
|
-
};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { database_server as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { patchEventHandler } from
|
|
2
|
-
|
|
1
|
+
import { patchEventHandler } from '../utils/patchEventHandler.js';
|
|
2
|
+
|
|
3
|
+
var handlerLegacy_server = ((nitroApp) => {
|
|
3
4
|
nitroApp.h3App.handler = patchEventHandler(nitroApp.h3App.handler);
|
|
4
|
-
};
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export { handlerLegacy_server as default };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { patchEventHandler } from
|
|
2
|
-
|
|
1
|
+
import { patchEventHandler } from '../utils/patchEventHandler.js';
|
|
2
|
+
|
|
3
|
+
var handler_server = ((nitroApp) => {
|
|
3
4
|
if (nitroApp?.h3?.handler) {
|
|
4
5
|
nitroApp.h3.handler = patchEventHandler(nitroApp.h3.handler);
|
|
5
6
|
}
|
|
6
|
-
};
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { handler_server as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { sentryCloudflareNitroPlugin } from './sentry-cloudflare.server
|
|
1
|
+
export { sentryCloudflareNitroPlugin } from './sentry-cloudflare.server';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { sentryCloudflareNitroPlugin } from
|
|
1
|
+
export { sentryCloudflareNitroPlugin } from './sentry-cloudflare.server.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { debug, getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from
|
|
2
|
-
import { defineNuxtPlugin } from
|
|
3
|
-
import { extractParametrizedRouteFromContext } from
|
|
4
|
-
|
|
1
|
+
import { debug, getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';
|
|
2
|
+
import { defineNuxtPlugin } from 'nuxt/app';
|
|
3
|
+
import { extractParametrizedRouteFromContext } from '../utils/route-extraction.js';
|
|
4
|
+
|
|
5
|
+
var routeDetectorLegacy_server = defineNuxtPlugin((nuxtApp) => {
|
|
5
6
|
nuxtApp.hooks.hook("app:rendered", async (renderContext) => {
|
|
6
7
|
let buildTimePagesData;
|
|
7
8
|
try {
|
|
8
|
-
const { default: importedPagesData } = await import(
|
|
9
|
+
const { default: importedPagesData } = await import('#build/sentry--nuxt-pages-data.mjs');
|
|
9
10
|
buildTimePagesData = importedPagesData || [];
|
|
10
11
|
debug.log("Imported build-time pages data:", buildTimePagesData);
|
|
11
12
|
} catch (error) {
|
|
@@ -35,3 +36,5 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
});
|
|
39
|
+
|
|
40
|
+
export { routeDetectorLegacy_server as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { debug, getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from
|
|
2
|
-
import { defineNuxtPlugin } from
|
|
3
|
-
import { extractParametrizedRouteFromContext } from
|
|
4
|
-
|
|
1
|
+
import { debug, getActiveSpan, getRootSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';
|
|
2
|
+
import { defineNuxtPlugin } from 'nuxt/app';
|
|
3
|
+
import { extractParametrizedRouteFromContext } from '../utils/route-extraction.js';
|
|
4
|
+
|
|
5
|
+
var routeDetector_server = defineNuxtPlugin((nuxtApp) => {
|
|
5
6
|
nuxtApp.hooks.hook("app:rendered", async (renderContext) => {
|
|
6
7
|
let buildTimePagesData;
|
|
7
8
|
try {
|
|
8
|
-
const { default: importedPagesData } = await import(
|
|
9
|
+
const { default: importedPagesData } = await import('#sentry/nuxt-pages-data.mjs');
|
|
9
10
|
buildTimePagesData = importedPagesData || [];
|
|
10
11
|
debug.log("Imported build-time pages data:", buildTimePagesData);
|
|
11
12
|
} catch (error) {
|
|
@@ -35,3 +36,5 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
});
|
|
39
|
+
|
|
40
|
+
export { routeDetector_server as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { setAsyncLocalStorageAsyncContextStrategy, wrapRequestHandler } from
|
|
2
|
-
import { debug,
|
|
3
|
-
import { sentryCaptureErrorHook } from
|
|
4
|
-
import { updateRouteBeforeResponse } from
|
|
5
|
-
import { addSentryTracingMetaTags } from
|
|
6
|
-
import { getCfProperties, getCloudflareProperties, hasCfProperty
|
|
7
|
-
|
|
1
|
+
import { setAsyncLocalStorageAsyncContextStrategy, wrapRequestHandler } from '@sentry/cloudflare';
|
|
2
|
+
import { debug, getIsolationScope, getDefaultIsolationScope, getTraceData } from '@sentry/core';
|
|
3
|
+
import { sentryCaptureErrorHook } from '../hooks/captureErrorHook.js';
|
|
4
|
+
import { updateRouteBeforeResponse } from '../hooks/updateRouteBeforeResponse.js';
|
|
5
|
+
import { addSentryTracingMetaTags } from '../utils.js';
|
|
6
|
+
import { isEventType, getCfProperties, getCloudflareProperties, hasCfProperty } from '../utils/event-type-check.js';
|
|
7
|
+
|
|
8
|
+
const sentryCloudflareNitroPlugin = (optionsOrFn) => (nitroApp) => {
|
|
8
9
|
const traceDataMap = /* @__PURE__ */ new WeakMap();
|
|
9
10
|
nitroApp.localFetch = new Proxy(nitroApp.localFetch, {
|
|
10
11
|
async apply(handlerTarget, handlerThisArg, handlerArgs) {
|
|
@@ -61,3 +62,5 @@ export const sentryCloudflareNitroPlugin = (optionsOrFn) => (nitroApp) => {
|
|
|
61
62
|
});
|
|
62
63
|
nitroApp.hooks.hook("error", sentryCaptureErrorHook);
|
|
63
64
|
};
|
|
65
|
+
|
|
66
|
+
export { sentryCloudflareNitroPlugin };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { getClient, GLOBAL_OBJ } from
|
|
2
|
-
import { browserTracingIntegration, vueIntegration } from
|
|
3
|
-
import { defineNuxtPlugin, isNuxtError } from
|
|
4
|
-
import { reportNuxtError } from
|
|
5
|
-
|
|
1
|
+
import { getClient, GLOBAL_OBJ } from '@sentry/core';
|
|
2
|
+
import { browserTracingIntegration, vueIntegration } from '@sentry/vue';
|
|
3
|
+
import { defineNuxtPlugin, isNuxtError } from 'nuxt/app';
|
|
4
|
+
import { reportNuxtError } from '../utils.js';
|
|
5
|
+
|
|
6
|
+
var sentry_client = defineNuxtPlugin({
|
|
6
7
|
name: "sentry-client-integrations",
|
|
7
8
|
dependsOn: ["sentry-client-config"],
|
|
8
9
|
async setup(nuxtApp) {
|
|
@@ -40,3 +41,5 @@ export default defineNuxtPlugin({
|
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
});
|
|
44
|
+
|
|
45
|
+
export { sentry_client as default };
|