@sentry/wizard 6.0.0 → 6.1.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/CHANGELOG.md +8 -0
- package/dist/e2e-tests/tests/angular-17.test.js +6 -0
- package/dist/e2e-tests/tests/angular-17.test.js.map +1 -1
- package/dist/e2e-tests/tests/angular-19.test.js +7 -1
- package/dist/e2e-tests/tests/angular-19.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-14.test.js +5 -1
- package/dist/e2e-tests/tests/nextjs-14.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js +5 -1
- package/dist/e2e-tests/tests/nextjs-15.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +9 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +9 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +8 -2
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +15 -3
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/src/angular/angular-wizard.js +5 -0
- package/dist/src/angular/angular-wizard.js.map +1 -1
- package/dist/src/angular/codemods/main.d.ts +4 -1
- package/dist/src/angular/codemods/main.js +3 -0
- package/dist/src/angular/codemods/main.js.map +1 -1
- package/dist/src/angular/sdk-setup.d.ts +1 -0
- package/dist/src/angular/sdk-setup.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +5 -0
- package/dist/src/apple/xcode-manager.js +44 -40
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +5 -0
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.d.ts +3 -0
- package/dist/src/nextjs/templates.js +15 -2
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.js +5 -0
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.d.ts +1 -0
- package/dist/src/nuxt/templates.js +3 -2
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +5 -0
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-setup.d.ts +5 -0
- package/dist/src/remix/sdk-setup.js +4 -0
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +11 -0
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/templates.d.ts +2 -0
- package/dist/src/sveltekit/templates.js +10 -0
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +119 -0
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +119 -0
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +56 -0
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +37 -1
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +67 -0
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instrumentation.test.js","sourceRoot":"","sources":["../../../test/remix/server-instrumentation.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,yDAA8E;AAE9E,IAAA,iBAAQ,EAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,IAAA,WAAE,EAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,MAAM,GAAG,IAAA,6CAAiC,EAAC,uBAAuB,EAAE;YACxE,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"server-instrumentation.test.js","sourceRoot":"","sources":["../../../test/remix/server-instrumentation.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,yDAA8E;AAE9E,IAAA,iBAAQ,EAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,IAAA,WAAE,EAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,MAAM,GAAG,IAAA,6CAAiC,EAAC,uBAAuB,EAAE;YACxE,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;aAClD,qBAAqB,CAAC;;;;;;;;KAQxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,0EAA0E,EAAE,GAAG,EAAE;QAClF,MAAM,MAAM,GAAG,IAAA,6CAAiC,EAAC,uBAAuB,EAAE;YACxE,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,IAAI;YACZ,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;aAClD,qBAAqB,CAAC;;;;;;KAMxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,MAAM,GAAG,IAAA,6CAAiC,EAAC,uBAAuB,EAAE;YACxE,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;aAClD,qBAAqB,CAAC;;;;;;;KAOxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,+EAA+E,EAAE,GAAG,EAAE;QACvF,MAAM,MAAM,GAAG,IAAA,6CAAiC,EAAC,uBAAuB,EAAE;YACxE,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,IAAA,eAAM,EAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;aAClD,qBAAqB,CAAC;;;;;;;;KAQxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from 'vitest';\nimport { generateServerInstrumentationFile } from '../../src/remix/sdk-setup';\n\ndescribe('generateServerInstrumentationFile', () => {\n it('should generate server instrumentation file', () => {\n const result = generateServerInstrumentationFile('https://sentry.io/123', {\n performance: true,\n replay: true,\n logs: true,\n });\n\n expect(result.instrumentationFileMod.generate().code)\n .toMatchInlineSnapshot(`\n \"import * as Sentry from \"@sentry/remix\";\n\n Sentry.init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true\n })\"\n `);\n });\n\n it('should generate server instrumentation file when performance is disabled', () => {\n const result = generateServerInstrumentationFile('https://sentry.io/123', {\n performance: false,\n replay: true,\n logs: false,\n });\n\n expect(result.instrumentationFileMod.generate().code)\n .toMatchInlineSnapshot(`\n \"import * as Sentry from \"@sentry/remix\";\n\n Sentry.init({\n dsn: \"https://sentry.io/123\"\n })\"\n `);\n });\n\n it('should generate server instrumentation file with only logs enabled', () => {\n const result = generateServerInstrumentationFile('https://sentry.io/123', {\n performance: false,\n replay: false,\n logs: true,\n });\n\n expect(result.instrumentationFileMod.generate().code)\n .toMatchInlineSnapshot(`\n \"import * as Sentry from \"@sentry/remix\";\n\n Sentry.init({\n dsn: \"https://sentry.io/123\",\n enableLogs: true\n })\"\n `);\n });\n\n it('should generate server instrumentation file with performance and logs enabled', () => {\n const result = generateServerInstrumentationFile('https://sentry.io/123', {\n performance: true,\n replay: false,\n logs: true,\n });\n\n expect(result.instrumentationFileMod.generate().code)\n .toMatchInlineSnapshot(`\n \"import * as Sentry from \"@sentry/remix\";\n\n Sentry.init({\n dsn: \"https://sentry.io/123\",\n tracesSampleRate: 1,\n enableLogs: true\n })\"\n `);\n });\n});\n"]}
|
|
@@ -7,6 +7,7 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
7
7
|
const result = (0, templates_1.getClientHooksTemplate)('https://sentry.io/123', {
|
|
8
8
|
performance: true,
|
|
9
9
|
replay: true,
|
|
10
|
+
logs: true,
|
|
10
11
|
});
|
|
11
12
|
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
12
13
|
"import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
|
@@ -17,6 +18,9 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
17
18
|
|
|
18
19
|
tracesSampleRate: 1.0,
|
|
19
20
|
|
|
21
|
+
// Enable logs to be sent to Sentry
|
|
22
|
+
enableLogs: true,
|
|
23
|
+
|
|
20
24
|
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
21
25
|
// in development and sample at a lower rate in production
|
|
22
26
|
replaysSessionSampleRate: 0.1,
|
|
@@ -38,6 +42,7 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
38
42
|
const result = (0, templates_1.getClientHooksTemplate)('https://sentry.io/123', {
|
|
39
43
|
performance: false,
|
|
40
44
|
replay: true,
|
|
45
|
+
logs: false,
|
|
41
46
|
});
|
|
42
47
|
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
43
48
|
"import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
|
@@ -46,6 +51,7 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
46
51
|
Sentry.init({
|
|
47
52
|
dsn: 'https://sentry.io/123',
|
|
48
53
|
|
|
54
|
+
|
|
49
55
|
// This sets the sample rate to be 10%. You may want this to be 100% while
|
|
50
56
|
// in development and sample at a lower rate in production
|
|
51
57
|
replaysSessionSampleRate: 0.1,
|
|
@@ -67,6 +73,7 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
67
73
|
const result = (0, templates_1.getClientHooksTemplate)('https://sentry.io/123', {
|
|
68
74
|
performance: true,
|
|
69
75
|
replay: false,
|
|
76
|
+
logs: false,
|
|
70
77
|
});
|
|
71
78
|
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
72
79
|
"import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
|
@@ -78,6 +85,31 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
78
85
|
tracesSampleRate: 1.0,
|
|
79
86
|
|
|
80
87
|
|
|
88
|
+
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
|
|
92
|
+
export const handleError = handleErrorWithSentry();
|
|
93
|
+
"
|
|
94
|
+
`);
|
|
95
|
+
});
|
|
96
|
+
(0, vitest_1.it)('should generate client hooks template with only logs enabled', () => {
|
|
97
|
+
const result = (0, templates_1.getClientHooksTemplate)('https://sentry.io/123', {
|
|
98
|
+
performance: false,
|
|
99
|
+
replay: false,
|
|
100
|
+
logs: true,
|
|
101
|
+
});
|
|
102
|
+
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
103
|
+
"import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
|
|
104
|
+
import * as Sentry from '@sentry/sveltekit';
|
|
105
|
+
|
|
106
|
+
Sentry.init({
|
|
107
|
+
dsn: 'https://sentry.io/123',
|
|
108
|
+
|
|
109
|
+
// Enable logs to be sent to Sentry
|
|
110
|
+
enableLogs: true,
|
|
111
|
+
|
|
112
|
+
|
|
81
113
|
});
|
|
82
114
|
|
|
83
115
|
// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
|
|
@@ -91,6 +123,7 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
91
123
|
const result = (0, templates_1.getServerHooksTemplate)('https://sentry.io/123', {
|
|
92
124
|
performance: true,
|
|
93
125
|
replay: true,
|
|
126
|
+
logs: true,
|
|
94
127
|
});
|
|
95
128
|
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
96
129
|
"import { sequence } from "@sveltejs/kit/hooks";
|
|
@@ -102,6 +135,9 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
102
135
|
|
|
103
136
|
tracesSampleRate: 1.0,
|
|
104
137
|
|
|
138
|
+
// Enable logs to be sent to Sentry
|
|
139
|
+
enableLogs: true,
|
|
140
|
+
|
|
105
141
|
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
|
|
106
142
|
// spotlight: import.meta.env.DEV,
|
|
107
143
|
});
|
|
@@ -118,6 +154,34 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
118
154
|
const result = (0, templates_1.getServerHooksTemplate)('https://sentry.io/123', {
|
|
119
155
|
performance: false,
|
|
120
156
|
replay: true,
|
|
157
|
+
logs: false,
|
|
158
|
+
});
|
|
159
|
+
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
160
|
+
"import { sequence } from "@sveltejs/kit/hooks";
|
|
161
|
+
import { handleErrorWithSentry, sentryHandle } from "@sentry/sveltekit";
|
|
162
|
+
import * as Sentry from '@sentry/sveltekit';
|
|
163
|
+
|
|
164
|
+
Sentry.init({
|
|
165
|
+
dsn: 'https://sentry.io/123',
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
|
|
169
|
+
// spotlight: import.meta.env.DEV,
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// If you have custom handlers, make sure to place them after \`sentryHandle()\` in the \`sequence\` function.
|
|
173
|
+
export const handle = sequence(sentryHandle());
|
|
174
|
+
|
|
175
|
+
// If you have a custom error handler, pass it to \`handleErrorWithSentry\`
|
|
176
|
+
export const handleError = handleErrorWithSentry();
|
|
177
|
+
"
|
|
178
|
+
`);
|
|
179
|
+
});
|
|
180
|
+
(0, vitest_1.it)('should generate server hooks template with only logs enabled', () => {
|
|
181
|
+
const result = (0, templates_1.getServerHooksTemplate)('https://sentry.io/123', {
|
|
182
|
+
performance: false,
|
|
183
|
+
replay: false,
|
|
184
|
+
logs: true,
|
|
121
185
|
});
|
|
122
186
|
(0, vitest_1.expect)(result).toMatchInlineSnapshot(`
|
|
123
187
|
"import { sequence } from "@sveltejs/kit/hooks";
|
|
@@ -127,6 +191,9 @@ const templates_1 = require("../../src/sveltekit/templates");
|
|
|
127
191
|
Sentry.init({
|
|
128
192
|
dsn: 'https://sentry.io/123',
|
|
129
193
|
|
|
194
|
+
// Enable logs to be sent to Sentry
|
|
195
|
+
enableLogs: true,
|
|
196
|
+
|
|
130
197
|
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
|
|
131
198
|
// spotlight: import.meta.env.DEV,
|
|
132
199
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/sveltekit/templates.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,6DAGuC;AAEvC,IAAA,iBAAQ,EAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAA,WAAE,EAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,MAAM,GAAG,IAAA,kCAAsB,EAAC,uBAAuB,EAAE;YAC7D,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"templates.test.js","sourceRoot":"","sources":["../../../test/sveltekit/templates.test.ts"],"names":[],"mappings":"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","sourcesContent":["import { describe, expect, it } from 'vitest';\nimport {\n getClientHooksTemplate,\n getServerHooksTemplate,\n} from '../../src/sveltekit/templates';\n\ndescribe('getClientHooksTemplate', () => {\n it('should generate client hooks template with all features enabled', () => {\n const result = getClientHooksTemplate('https://sentry.io/123', {\n performance: true,\n replay: true,\n logs: true,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n tracesSampleRate: 1.0,\n\n // Enable logs to be sent to Sentry\n enableLogs: true,\n\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // If the entire session is not sampled, use the below sample rate to sample\n // sessions when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],\n });\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n\n it('should generate client hooks template when performance disabled', () => {\n const result = getClientHooksTemplate('https://sentry.io/123', {\n performance: false,\n replay: true,\n logs: false,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n\n // This sets the sample rate to be 10%. You may want this to be 100% while\n // in development and sample at a lower rate in production\n replaysSessionSampleRate: 0.1,\n\n // If the entire session is not sampled, use the below sample rate to sample\n // sessions when an error occurs.\n replaysOnErrorSampleRate: 1.0,\n\n // If you don't want to use Session Replay, just remove the line below:\n integrations: [replayIntegration()],\n });\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n\n it('should generate client hooks template when replay disabled', () => {\n const result = getClientHooksTemplate('https://sentry.io/123', {\n performance: true,\n replay: false,\n logs: false,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n tracesSampleRate: 1.0,\n\n\n\n });\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n\n it('should generate client hooks template with only logs enabled', () => {\n const result = getClientHooksTemplate('https://sentry.io/123', {\n performance: false,\n replay: false,\n logs: true,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { handleErrorWithSentry, replayIntegration } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n // Enable logs to be sent to Sentry\n enableLogs: true,\n\n\n });\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n});\n\ndescribe('getServerHooksTemplate', () => {\n it('should generate server hooks template with all features enabled', () => {\n const result = getServerHooksTemplate('https://sentry.io/123', {\n performance: true,\n replay: true,\n logs: true,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { sequence } from \"@sveltejs/kit/hooks\";\n import { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n tracesSampleRate: 1.0,\n\n // Enable logs to be sent to Sentry\n enableLogs: true,\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n });\n\n // If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\n export const handle = sequence(sentryHandle());\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n\n it('should generate server hooks template when performance disabled', () => {\n const result = getServerHooksTemplate('https://sentry.io/123', {\n performance: false,\n replay: true,\n logs: false,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { sequence } from \"@sveltejs/kit/hooks\";\n import { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n });\n\n // If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\n export const handle = sequence(sentryHandle());\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n\n it('should generate server hooks template with only logs enabled', () => {\n const result = getServerHooksTemplate('https://sentry.io/123', {\n performance: false,\n replay: false,\n logs: true,\n });\n\n expect(result).toMatchInlineSnapshot(`\n \"import { sequence } from \"@sveltejs/kit/hooks\";\n import { handleErrorWithSentry, sentryHandle } from \"@sentry/sveltekit\";\n import * as Sentry from '@sentry/sveltekit';\n\n Sentry.init({\n dsn: 'https://sentry.io/123',\n\n // Enable logs to be sent to Sentry\n enableLogs: true,\n\n // uncomment the line below to enable Spotlight (https://spotlightjs.com)\n // spotlight: import.meta.env.DEV,\n });\n\n // If you have custom handlers, make sure to place them after \\`sentryHandle()\\` in the \\`sequence\\` function.\n export const handle = sequence(sentryHandle());\n\n // If you have a custom error handler, pass it to \\`handleErrorWithSentry\\`\n export const handleError = handleErrorWithSentry();\n \"\n `);\n });\n});\n"]}
|
package/package.json
CHANGED