@sentry/solidstart 8.25.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/LICENSE +21 -0
- package/README.md +219 -0
- package/build/cjs/client/index.js +19 -0
- package/build/cjs/client/index.js.map +1 -0
- package/build/cjs/client/sdk.js +20 -0
- package/build/cjs/client/sdk.js.map +1 -0
- package/build/cjs/client/solidrouter.js +17 -0
- package/build/cjs/client/solidrouter.js.map +1 -0
- package/build/cjs/common/debug-build.js +11 -0
- package/build/cjs/common/debug-build.js.map +1 -0
- package/build/cjs/index.client.js +19 -0
- package/build/cjs/index.client.js.map +1 -0
- package/build/cjs/index.server.js +134 -0
- package/build/cjs/index.server.js.map +1 -0
- package/build/cjs/middleware.js +54 -0
- package/build/cjs/middleware.js.map +1 -0
- package/build/cjs/server/index.js +134 -0
- package/build/cjs/server/index.js.map +1 -0
- package/build/cjs/server/sdk.js +22 -0
- package/build/cjs/server/sdk.js.map +1 -0
- package/build/cjs/server/solidrouter.js +44 -0
- package/build/cjs/server/solidrouter.js.map +1 -0
- package/build/cjs/server/utils.js +67 -0
- package/build/cjs/server/utils.js.map +1 -0
- package/build/cjs/server/withServerActionInstrumentation.js +63 -0
- package/build/cjs/server/withServerActionInstrumentation.js.map +1 -0
- package/build/cjs/solidrouter.client.js +17 -0
- package/build/cjs/solidrouter.client.js.map +1 -0
- package/build/cjs/solidrouter.js +19 -0
- package/build/cjs/solidrouter.js.map +1 -0
- package/build/cjs/solidrouter.server.js +8 -0
- package/build/cjs/solidrouter.server.js.map +1 -0
- package/build/esm/client/index.js +3 -0
- package/build/esm/client/index.js.map +1 -0
- package/build/esm/client/sdk.js +18 -0
- package/build/esm/client/sdk.js.map +1 -0
- package/build/esm/client/solidrouter.js +2 -0
- package/build/esm/client/solidrouter.js.map +1 -0
- package/build/esm/common/debug-build.js +9 -0
- package/build/esm/common/debug-build.js.map +1 -0
- package/build/esm/index.client.js +3 -0
- package/build/esm/index.client.js.map +1 -0
- package/build/esm/index.server.js +6 -0
- package/build/esm/index.server.js.map +1 -0
- package/build/esm/middleware.js +52 -0
- package/build/esm/middleware.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/server/index.js +6 -0
- package/build/esm/server/index.js.map +1 -0
- package/build/esm/server/sdk.js +20 -0
- package/build/esm/server/sdk.js.map +1 -0
- package/build/esm/server/solidrouter.js +42 -0
- package/build/esm/server/solidrouter.js.map +1 -0
- package/build/esm/server/utils.js +60 -0
- package/build/esm/server/utils.js.map +1 -0
- package/build/esm/server/withServerActionInstrumentation.js +61 -0
- package/build/esm/server/withServerActionInstrumentation.js.map +1 -0
- package/build/esm/solidrouter.client.js +2 -0
- package/build/esm/solidrouter.client.js.map +1 -0
- package/build/esm/solidrouter.js +3 -0
- package/build/esm/solidrouter.js.map +1 -0
- package/build/esm/solidrouter.server.js +2 -0
- package/build/esm/solidrouter.server.js.map +1 -0
- package/build/types/client/index.d.ts +3 -0
- package/build/types/client/index.d.ts.map +1 -0
- package/build/types/client/sdk.d.ts +7 -0
- package/build/types/client/sdk.d.ts.map +1 -0
- package/build/types/common/debug-build.d.ts +7 -0
- package/build/types/common/debug-build.d.ts.map +1 -0
- package/build/types/index.client.d.ts +2 -0
- package/build/types/index.client.d.ts.map +1 -0
- package/build/types/index.server.d.ts +2 -0
- package/build/types/index.server.d.ts.map +1 -0
- package/build/types/index.types.d.ts +18 -0
- package/build/types/index.types.d.ts.map +1 -0
- package/build/types/server/index.d.ts +6 -0
- package/build/types/server/index.d.ts.map +1 -0
- package/build/types/server/sdk.d.ts +6 -0
- package/build/types/server/sdk.d.ts.map +1 -0
- package/build/types/server/utils.d.ts +15 -0
- package/build/types/server/utils.d.ts.map +1 -0
- package/build/types/server/withServerActionInstrumentation.d.ts +6 -0
- package/build/types/server/withServerActionInstrumentation.d.ts.map +1 -0
- package/client/solidrouter.d.ts +2 -0
- package/client/solidrouter.d.ts.map +1 -0
- package/middleware.d.ts +11 -0
- package/middleware.d.ts.map +1 -0
- package/package.json +134 -0
- package/server/solidrouter.d.ts +8 -0
- package/server/solidrouter.d.ts.map +1 -0
- package/solidrouter.client.d.ts +2 -0
- package/solidrouter.client.d.ts.map +1 -0
- package/solidrouter.d.ts +5 -0
- package/solidrouter.d.ts.map +1 -0
- package/solidrouter.server.d.ts +2 -0
- package/solidrouter.server.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 Functional Software, Inc. dba Sentry
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
|
|
3
|
+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
# Official Sentry SDK for Solid Start (EXPERIMENTAL)
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@sentry/solidstart)
|
|
10
|
+
[](https://www.npmjs.com/package/@sentry/solidstart)
|
|
11
|
+
[](https://www.npmjs.com/package/@sentry/solidstart)
|
|
12
|
+
|
|
13
|
+
This SDK is considered ⚠️ **experimental and in an alpha state**. It may experience breaking changes. Please reach out
|
|
14
|
+
on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns. This
|
|
15
|
+
SDK is for [Solid Start](https://start.solidjs.com/). If you're using [Solid](https://www.solidjs.com/) see our
|
|
16
|
+
[Solid SDK here](https://github.com/getsentry/sentry-javascript/tree/develop/packages/solid).
|
|
17
|
+
|
|
18
|
+
## Links
|
|
19
|
+
|
|
20
|
+
- [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/solidstart/)
|
|
21
|
+
|
|
22
|
+
## General
|
|
23
|
+
|
|
24
|
+
This package is a wrapper around `@sentry/node` for the server and `@sentry/solid` for the client side, with added
|
|
25
|
+
functionality related to Solid Start.
|
|
26
|
+
|
|
27
|
+
## Manual Setup
|
|
28
|
+
|
|
29
|
+
If the setup through the wizard doesn't work for you, you can also set up the SDK manually.
|
|
30
|
+
|
|
31
|
+
### 1. Prerequesits & Installation
|
|
32
|
+
|
|
33
|
+
Install the Sentry Solid Start SDK:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Using npm
|
|
37
|
+
npm install @sentry/solidstart
|
|
38
|
+
|
|
39
|
+
# Using yarn
|
|
40
|
+
yarn add @sentry/solidstart
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Client-side Setup
|
|
44
|
+
|
|
45
|
+
Initialize the SDK in `entry-client.jsx`
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import * as Sentry from '@sentry/solidstart';
|
|
49
|
+
import { solidRouterBrowserTracingIntegration } from '@sentry/solidstart/solidrouter';
|
|
50
|
+
import { mount, StartClient } from '@solidjs/start/client';
|
|
51
|
+
|
|
52
|
+
Sentry.init({
|
|
53
|
+
dsn: '__PUBLIC_DSN__',
|
|
54
|
+
integrations: [solidRouterBrowserTracingIntegration()],
|
|
55
|
+
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
mount(() => <StartClient />, document.getElementById('app'));
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 3. Server-side Setup
|
|
62
|
+
|
|
63
|
+
Create an instrument file named `instrument.server.mjs` and add your initialization code for the server-side SDK.
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import * as Sentry from '@sentry/solidstart';
|
|
67
|
+
|
|
68
|
+
Sentry.init({
|
|
69
|
+
dsn: 'https://0e67f7dd5326d51506e92d7f1eff887a@o447951.ingest.us.sentry.io/4507459091824640',
|
|
70
|
+
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 4. Server instrumentation
|
|
75
|
+
|
|
76
|
+
Complete the setup by adding the Sentry middlware to your `src/middleware.ts` file:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware';
|
|
80
|
+
import { createMiddleware } from '@solidjs/start/middleware';
|
|
81
|
+
|
|
82
|
+
export default createMiddleware({
|
|
83
|
+
onBeforeResponse: [
|
|
84
|
+
sentryBeforeResponseMiddleware(),
|
|
85
|
+
// Add your other middleware handlers after `sentryBeforeResponseMiddleware`
|
|
86
|
+
],
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
And don't forget to specify `./src/middleware.ts` in your `app.config.ts`:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { defineConfig } from '@solidjs/start/config';
|
|
94
|
+
|
|
95
|
+
export default defineConfig({
|
|
96
|
+
// ...
|
|
97
|
+
middleware: './src/middleware.ts',
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The Sentry middleware enhances the data collected by Sentry on the server side by enabling distributed tracing between
|
|
102
|
+
the client and server.
|
|
103
|
+
|
|
104
|
+
### 5. Run your application
|
|
105
|
+
|
|
106
|
+
Then run your app
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
NODE_OPTIONS='--import=./instrument.server.mjs' yarn start
|
|
110
|
+
# or
|
|
111
|
+
NODE_OPTIONS='--require=./instrument.server.js' yarn start
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
# Solid Router
|
|
115
|
+
|
|
116
|
+
The Solid Router instrumentation uses the Solid Router library to create navigation spans to ensure you collect
|
|
117
|
+
meaningful performance data about the health of your page loads and associated requests.
|
|
118
|
+
|
|
119
|
+
Wrap `Router`, `MemoryRouter` or `HashRouter` from `@solidjs/router` using `withSentryRouterRouting`. This creates a
|
|
120
|
+
higher order component, which will enable Sentry to reach your router context.
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
import { withSentryRouterRouting } from '@sentry/solidstart/solidrouter';
|
|
124
|
+
import { Route, Router } from '@solidjs/router';
|
|
125
|
+
|
|
126
|
+
const SentryRouter = Sentry.withSentryRouterRouting(Router);
|
|
127
|
+
|
|
128
|
+
render(
|
|
129
|
+
() => (
|
|
130
|
+
<SentryRouter>
|
|
131
|
+
<Route path="/" component={App} />
|
|
132
|
+
...
|
|
133
|
+
</SentryRouter>
|
|
134
|
+
),
|
|
135
|
+
document.getElementById('root'),
|
|
136
|
+
);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
# Solid ErrorBoundary
|
|
140
|
+
|
|
141
|
+
To automatically capture exceptions from inside a component tree and render a fallback component, wrap the native Solid
|
|
142
|
+
JS `ErrorBoundary` component with `Sentry.withSentryErrorBoundary`.
|
|
143
|
+
|
|
144
|
+
```js
|
|
145
|
+
import * as Sentry from '@sentry/solidstart';
|
|
146
|
+
import { ErrorBoundary } from 'solid-js';
|
|
147
|
+
|
|
148
|
+
Sentry.init({
|
|
149
|
+
dsn: '__PUBLIC_DSN__',
|
|
150
|
+
tracesSampleRate: 1.0, // Capture 100% of the transactions
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const SentryErrorBoundary = Sentry.withSentryErrorBoundary(ErrorBoundary);
|
|
154
|
+
|
|
155
|
+
render(
|
|
156
|
+
() => (
|
|
157
|
+
<SentryErrorBoundary fallback={err => <div>Error: {err.message}</div>}>
|
|
158
|
+
<ProblematicComponent />
|
|
159
|
+
</SentryErrorBoundary>
|
|
160
|
+
),
|
|
161
|
+
document.getElementById('root'),
|
|
162
|
+
);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
# Sourcemaps and Releases
|
|
166
|
+
|
|
167
|
+
To generate and upload source maps of your Solid Start app use our Vite bundler plugin.
|
|
168
|
+
|
|
169
|
+
1. Install the Sentry Vite plugin
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Using npm
|
|
173
|
+
npm install @sentry/vite-plugin --save-dev
|
|
174
|
+
|
|
175
|
+
# Using yarn
|
|
176
|
+
yarn add @sentry/vite-plugin --dev
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
2. Configure the vite plugin
|
|
180
|
+
|
|
181
|
+
To upload source maps you have to configure an auth token. Auth tokens can be passed to the plugin explicitly with the
|
|
182
|
+
`authToken` option, with a `SENTRY_AUTH_TOKEN` environment variable, or with an `.env.sentry-build-plugin` file in the
|
|
183
|
+
working directory when building your project. We recommend you add the auth token to your CI/CD environment as an
|
|
184
|
+
environment variable.
|
|
185
|
+
|
|
186
|
+
Learn more about configuring the plugin in our
|
|
187
|
+
[Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin).
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
// .env.sentry-build-plugin
|
|
191
|
+
SENTRY_AUTH_TOKEN=<your auth token>
|
|
192
|
+
SENTRY_ORG=<your org>
|
|
193
|
+
SENTRY_PROJECT=<your project name>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
3. Finally, add the plugin to your `app.config.ts` file.
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
import { defineConfig } from '@solidjs/start/config';
|
|
200
|
+
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|
201
|
+
|
|
202
|
+
export default defineConfig({
|
|
203
|
+
// rest of your config
|
|
204
|
+
// ...
|
|
205
|
+
|
|
206
|
+
vite: {
|
|
207
|
+
build: {
|
|
208
|
+
sourcemap: true,
|
|
209
|
+
},
|
|
210
|
+
plugins: [
|
|
211
|
+
sentryVitePlugin({
|
|
212
|
+
org: process.env.SENTRY_ORG,
|
|
213
|
+
project: process.env.SENTRY_PROJECT,
|
|
214
|
+
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
215
|
+
}),
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const solid = require('@sentry/solid');
|
|
4
|
+
const sdk = require('./sdk.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.init = sdk.init;
|
|
9
|
+
Object.prototype.hasOwnProperty.call(solid, '__proto__') &&
|
|
10
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
11
|
+
Object.defineProperty(exports, '__proto__', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
value: solid['__proto__']
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
Object.keys(solid).forEach(k => {
|
|
17
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = solid[k];
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const solid = require('@sentry/solid');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Initializes the client side of the Solid Start SDK.
|
|
8
|
+
*/
|
|
9
|
+
function init(options) {
|
|
10
|
+
const opts = {
|
|
11
|
+
...options,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
core.applySdkMetadata(opts, 'solidstart', ['solidstart', 'solid']);
|
|
15
|
+
|
|
16
|
+
return solid.init(opts);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.init = init;
|
|
20
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/client/sdk.ts"],"sourcesContent":["import { applySdkMetadata } from '@sentry/core';\nimport type { BrowserOptions } from '@sentry/solid';\nimport { init as initSolidSDK } from '@sentry/solid';\nimport type { Client } from '@sentry/types';\n\n/**\n * Initializes the client side of the Solid Start SDK.\n */\nexport function init(options: BrowserOptions): Client | undefined {\n const opts = {\n ...options,\n };\n\n applySdkMetadata(opts, 'solidstart', ['solidstart', 'solid']);\n\n return initSolidSDK(opts);\n}\n"],"names":["applySdkMetadata","initSolidSDK"],"mappings":";;;;;AAKA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAsC;AAClE,EAAE,MAAM,OAAO;AACf,IAAI,GAAG,OAAO;AACd,GAAG,CAAA;AACH;AACA,EAAEA,qBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AAC/D;AACA,EAAE,OAAOC,UAAY,CAAC,IAAI,CAAC,CAAA;AAC3B;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const solidrouter = require('@sentry/solid/solidrouter');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.prototype.hasOwnProperty.call(solidrouter, '__proto__') &&
|
|
8
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
9
|
+
Object.defineProperty(exports, '__proto__', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
value: solidrouter['__proto__']
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
Object.keys(solidrouter).forEach(k => {
|
|
15
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = solidrouter[k];
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=solidrouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
5
|
+
*
|
|
6
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
7
|
+
*/
|
|
8
|
+
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
9
|
+
|
|
10
|
+
exports.DEBUG_BUILD = DEBUG_BUILD;
|
|
11
|
+
//# sourceMappingURL=debug-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-build.js","sources":["../../../src/common/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,IAAE,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const solid = require('@sentry/solid');
|
|
4
|
+
const sdk = require('./client/sdk.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.init = sdk.init;
|
|
9
|
+
Object.prototype.hasOwnProperty.call(solid, '__proto__') &&
|
|
10
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
11
|
+
Object.defineProperty(exports, '__proto__', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
value: solid['__proto__']
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
Object.keys(solid).forEach(k => {
|
|
17
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = solid[k];
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const node = require('@sentry/node');
|
|
4
|
+
const solid = require('@sentry/solid');
|
|
5
|
+
const sdk = require('./server/sdk.js');
|
|
6
|
+
const withServerActionInstrumentation = require('./server/withServerActionInstrumentation.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DEFAULT_USER_INCLUDES = node.DEFAULT_USER_INCLUDES;
|
|
11
|
+
exports.NodeClient = node.NodeClient;
|
|
12
|
+
exports.SDK_VERSION = node.SDK_VERSION;
|
|
13
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = node.SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
14
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = node.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
|
|
15
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = node.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
|
|
16
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = node.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
|
|
17
|
+
exports.Scope = node.Scope;
|
|
18
|
+
exports.addBreadcrumb = node.addBreadcrumb;
|
|
19
|
+
exports.addEventProcessor = node.addEventProcessor;
|
|
20
|
+
exports.addIntegration = node.addIntegration;
|
|
21
|
+
exports.addOpenTelemetryInstrumentation = node.addOpenTelemetryInstrumentation;
|
|
22
|
+
exports.addRequestDataToEvent = node.addRequestDataToEvent;
|
|
23
|
+
exports.anrIntegration = node.anrIntegration;
|
|
24
|
+
exports.captureCheckIn = node.captureCheckIn;
|
|
25
|
+
exports.captureConsoleIntegration = node.captureConsoleIntegration;
|
|
26
|
+
exports.captureEvent = node.captureEvent;
|
|
27
|
+
exports.captureException = node.captureException;
|
|
28
|
+
exports.captureFeedback = node.captureFeedback;
|
|
29
|
+
exports.captureMessage = node.captureMessage;
|
|
30
|
+
exports.captureSession = node.captureSession;
|
|
31
|
+
exports.close = node.close;
|
|
32
|
+
exports.connectIntegration = node.connectIntegration;
|
|
33
|
+
exports.consoleIntegration = node.consoleIntegration;
|
|
34
|
+
exports.contextLinesIntegration = node.contextLinesIntegration;
|
|
35
|
+
exports.continueTrace = node.continueTrace;
|
|
36
|
+
exports.createGetModuleFromFilename = node.createGetModuleFromFilename;
|
|
37
|
+
exports.createTransport = node.createTransport;
|
|
38
|
+
exports.cron = node.cron;
|
|
39
|
+
exports.debugIntegration = node.debugIntegration;
|
|
40
|
+
exports.dedupeIntegration = node.dedupeIntegration;
|
|
41
|
+
exports.defaultStackParser = node.defaultStackParser;
|
|
42
|
+
exports.endSession = node.endSession;
|
|
43
|
+
exports.expressErrorHandler = node.expressErrorHandler;
|
|
44
|
+
exports.expressIntegration = node.expressIntegration;
|
|
45
|
+
exports.extraErrorDataIntegration = node.extraErrorDataIntegration;
|
|
46
|
+
exports.extractRequestData = node.extractRequestData;
|
|
47
|
+
exports.fastifyIntegration = node.fastifyIntegration;
|
|
48
|
+
exports.flush = node.flush;
|
|
49
|
+
exports.functionToStringIntegration = node.functionToStringIntegration;
|
|
50
|
+
exports.generateInstrumentOnce = node.generateInstrumentOnce;
|
|
51
|
+
exports.getActiveSpan = node.getActiveSpan;
|
|
52
|
+
exports.getAutoPerformanceIntegrations = node.getAutoPerformanceIntegrations;
|
|
53
|
+
exports.getClient = node.getClient;
|
|
54
|
+
exports.getCurrentHub = node.getCurrentHub;
|
|
55
|
+
exports.getCurrentScope = node.getCurrentScope;
|
|
56
|
+
exports.getDefaultIntegrations = node.getDefaultIntegrations;
|
|
57
|
+
exports.getGlobalScope = node.getGlobalScope;
|
|
58
|
+
exports.getIsolationScope = node.getIsolationScope;
|
|
59
|
+
exports.getRootSpan = node.getRootSpan;
|
|
60
|
+
exports.getSentryRelease = node.getSentryRelease;
|
|
61
|
+
exports.getSpanDescendants = node.getSpanDescendants;
|
|
62
|
+
exports.getSpanStatusFromHttpCode = node.getSpanStatusFromHttpCode;
|
|
63
|
+
exports.graphqlIntegration = node.graphqlIntegration;
|
|
64
|
+
exports.hapiIntegration = node.hapiIntegration;
|
|
65
|
+
exports.httpIntegration = node.httpIntegration;
|
|
66
|
+
exports.inboundFiltersIntegration = node.inboundFiltersIntegration;
|
|
67
|
+
exports.initOpenTelemetry = node.initOpenTelemetry;
|
|
68
|
+
exports.isInitialized = node.isInitialized;
|
|
69
|
+
exports.koaIntegration = node.koaIntegration;
|
|
70
|
+
exports.lastEventId = node.lastEventId;
|
|
71
|
+
exports.linkedErrorsIntegration = node.linkedErrorsIntegration;
|
|
72
|
+
exports.localVariablesIntegration = node.localVariablesIntegration;
|
|
73
|
+
exports.makeNodeTransport = node.makeNodeTransport;
|
|
74
|
+
exports.metrics = node.metrics;
|
|
75
|
+
exports.modulesIntegration = node.modulesIntegration;
|
|
76
|
+
exports.mongoIntegration = node.mongoIntegration;
|
|
77
|
+
exports.mongooseIntegration = node.mongooseIntegration;
|
|
78
|
+
exports.mysql2Integration = node.mysql2Integration;
|
|
79
|
+
exports.mysqlIntegration = node.mysqlIntegration;
|
|
80
|
+
exports.nativeNodeFetchIntegration = node.nativeNodeFetchIntegration;
|
|
81
|
+
exports.nestIntegration = node.nestIntegration;
|
|
82
|
+
exports.nodeContextIntegration = node.nodeContextIntegration;
|
|
83
|
+
exports.onUncaughtExceptionIntegration = node.onUncaughtExceptionIntegration;
|
|
84
|
+
exports.onUnhandledRejectionIntegration = node.onUnhandledRejectionIntegration;
|
|
85
|
+
exports.parameterize = node.parameterize;
|
|
86
|
+
exports.postgresIntegration = node.postgresIntegration;
|
|
87
|
+
exports.prismaIntegration = node.prismaIntegration;
|
|
88
|
+
exports.redisIntegration = node.redisIntegration;
|
|
89
|
+
exports.requestDataIntegration = node.requestDataIntegration;
|
|
90
|
+
exports.rewriteFramesIntegration = node.rewriteFramesIntegration;
|
|
91
|
+
exports.sessionTimingIntegration = node.sessionTimingIntegration;
|
|
92
|
+
exports.setContext = node.setContext;
|
|
93
|
+
exports.setCurrentClient = node.setCurrentClient;
|
|
94
|
+
exports.setExtra = node.setExtra;
|
|
95
|
+
exports.setExtras = node.setExtras;
|
|
96
|
+
exports.setHttpStatus = node.setHttpStatus;
|
|
97
|
+
exports.setMeasurement = node.setMeasurement;
|
|
98
|
+
exports.setTag = node.setTag;
|
|
99
|
+
exports.setTags = node.setTags;
|
|
100
|
+
exports.setUser = node.setUser;
|
|
101
|
+
exports.setupConnectErrorHandler = node.setupConnectErrorHandler;
|
|
102
|
+
exports.setupExpressErrorHandler = node.setupExpressErrorHandler;
|
|
103
|
+
exports.setupHapiErrorHandler = node.setupHapiErrorHandler;
|
|
104
|
+
exports.setupKoaErrorHandler = node.setupKoaErrorHandler;
|
|
105
|
+
exports.setupNestErrorHandler = node.setupNestErrorHandler;
|
|
106
|
+
exports.spanToBaggageHeader = node.spanToBaggageHeader;
|
|
107
|
+
exports.spanToJSON = node.spanToJSON;
|
|
108
|
+
exports.spanToTraceHeader = node.spanToTraceHeader;
|
|
109
|
+
exports.spotlightIntegration = node.spotlightIntegration;
|
|
110
|
+
exports.startInactiveSpan = node.startInactiveSpan;
|
|
111
|
+
exports.startNewTrace = node.startNewTrace;
|
|
112
|
+
exports.startSession = node.startSession;
|
|
113
|
+
exports.startSpan = node.startSpan;
|
|
114
|
+
exports.startSpanManual = node.startSpanManual;
|
|
115
|
+
exports.trpcMiddleware = node.trpcMiddleware;
|
|
116
|
+
exports.withActiveSpan = node.withActiveSpan;
|
|
117
|
+
exports.withIsolationScope = node.withIsolationScope;
|
|
118
|
+
exports.withMonitor = node.withMonitor;
|
|
119
|
+
exports.withScope = node.withScope;
|
|
120
|
+
exports.zodErrorsIntegration = node.zodErrorsIntegration;
|
|
121
|
+
exports.withSentryErrorBoundary = solid.withSentryErrorBoundary;
|
|
122
|
+
exports.init = sdk.init;
|
|
123
|
+
exports.withServerActionInstrumentation = withServerActionInstrumentation.withServerActionInstrumentation;
|
|
124
|
+
Object.prototype.hasOwnProperty.call(node, '__proto__') &&
|
|
125
|
+
!Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
|
|
126
|
+
Object.defineProperty(exports, '__proto__', {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
value: node['__proto__']
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
Object.keys(node).forEach(k => {
|
|
132
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = node[k];
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=index.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const utils = require('@sentry/utils');
|
|
5
|
+
|
|
6
|
+
function addMetaTagToHead(html) {
|
|
7
|
+
const metaTags = core.getTraceMetaTags();
|
|
8
|
+
|
|
9
|
+
if (!metaTags) {
|
|
10
|
+
return html;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const content = `<head>\n${metaTags}\n`;
|
|
14
|
+
return html.replace('<head>', content);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns an `onBeforeResponse` solid start middleware handler that adds tracing data as
|
|
19
|
+
* <meta> tags to a page on pageload to enable distributed tracing.
|
|
20
|
+
*/
|
|
21
|
+
function sentryBeforeResponseMiddleware() {
|
|
22
|
+
return async function onBeforeResponse(event, response) {
|
|
23
|
+
if (!response.body || response.__sentry_wrapped__) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Ensure we don't double-wrap, in case a user has added the middleware twice
|
|
28
|
+
// e.g. once manually, once via the wizard
|
|
29
|
+
utils.addNonEnumerableProperty(response, '__sentry_wrapped__', true);
|
|
30
|
+
|
|
31
|
+
const contentType = event.response.headers.get('content-type');
|
|
32
|
+
const isPageloadRequest = contentType && contentType.startsWith('text/html');
|
|
33
|
+
|
|
34
|
+
if (!isPageloadRequest) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const body = response.body ;
|
|
39
|
+
const decoder = new TextDecoder();
|
|
40
|
+
response.body = new ReadableStream({
|
|
41
|
+
start: async controller => {
|
|
42
|
+
for await (const chunk of body) {
|
|
43
|
+
const html = typeof chunk === 'string' ? chunk : decoder.decode(chunk, { stream: true });
|
|
44
|
+
const modifiedHtml = addMetaTagToHead(html);
|
|
45
|
+
controller.enqueue(new TextEncoder().encode(modifiedHtml));
|
|
46
|
+
}
|
|
47
|
+
controller.close();
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.sentryBeforeResponseMiddleware = sentryBeforeResponseMiddleware;
|
|
54
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sources":["../../src/middleware.ts"],"sourcesContent":["import { getTraceMetaTags } from '@sentry/core';\nimport { addNonEnumerableProperty } from '@sentry/utils';\nimport type { ResponseMiddleware } from '@solidjs/start/middleware';\nimport type { FetchEvent } from '@solidjs/start/server';\n\nexport type ResponseMiddlewareResponse = Parameters<ResponseMiddleware>[1] & {\n __sentry_wrapped__?: boolean;\n};\n\nfunction addMetaTagToHead(html: string): string {\n const metaTags = getTraceMetaTags();\n\n if (!metaTags) {\n return html;\n }\n\n const content = `<head>\\n${metaTags}\\n`;\n return html.replace('<head>', content);\n}\n\n/**\n * Returns an `onBeforeResponse` solid start middleware handler that adds tracing data as\n * <meta> tags to a page on pageload to enable distributed tracing.\n */\nexport function sentryBeforeResponseMiddleware() {\n return async function onBeforeResponse(event: FetchEvent, response: ResponseMiddlewareResponse) {\n if (!response.body || response.__sentry_wrapped__) {\n return;\n }\n\n // Ensure we don't double-wrap, in case a user has added the middleware twice\n // e.g. once manually, once via the wizard\n addNonEnumerableProperty(response, '__sentry_wrapped__', true);\n\n const contentType = event.response.headers.get('content-type');\n const isPageloadRequest = contentType && contentType.startsWith('text/html');\n\n if (!isPageloadRequest) {\n return;\n }\n\n const body = response.body as NodeJS.ReadableStream;\n const decoder = new TextDecoder();\n response.body = new ReadableStream({\n start: async controller => {\n for await (const chunk of body) {\n const html = typeof chunk === 'string' ? chunk : decoder.decode(chunk, { stream: true });\n const modifiedHtml = addMetaTagToHead(html);\n controller.enqueue(new TextEncoder().encode(modifiedHtml));\n }\n controller.close();\n },\n });\n };\n}\n"],"names":["getTraceMetaTags","addNonEnumerableProperty"],"mappings":";;;;;AASA,SAAS,gBAAgB,CAAC,IAAI,EAAkB;AAChD,EAAE,MAAM,QAAA,GAAWA,qBAAgB,EAAE,CAAA;AACrC;AACA,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI,OAAO,IAAI,CAAA;AACf,GAAE;AACF;AACA,EAAE,MAAM,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAA;AACzC,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;AACxC,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,GAAG;AACjD,EAAE,OAAO,eAAe,gBAAgB,CAAC,KAAK,EAAc,QAAQ,EAA8B;AAClG,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,QAAQ,CAAC,kBAAkB,EAAE;AACvD,MAAM,OAAM;AACZ,KAAI;AACJ;AACA;AACA;AACA,IAAIC,8BAAwB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAA;AAClE;AACA,IAAI,MAAM,WAAA,GAAc,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAClE,IAAI,MAAM,iBAAkB,GAAE,WAAY,IAAG,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;AAChF;AACA,IAAI,IAAI,CAAC,iBAAiB,EAAE;AAC5B,MAAM,OAAM;AACZ,KAAI;AACJ;AACA,IAAI,MAAM,IAAA,GAAO,QAAQ,CAAC,IAAK,EAAA;AAC/B,IAAI,MAAM,OAAQ,GAAE,IAAI,WAAW,EAAE,CAAA;AACrC,IAAI,QAAQ,CAAC,IAAA,GAAO,IAAI,cAAc,CAAC;AACvC,MAAM,KAAK,EAAE,MAAM,UAAA,IAAc;AACjC,QAAQ,WAAW,MAAM,KAAM,IAAG,IAAI,EAAE;AACxC,UAAU,MAAM,OAAO,OAAO,UAAU,QAAA,GAAW,KAAM,GAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAK,EAAC,CAAC,CAAA;AAClG,UAAU,MAAM,YAAa,GAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;AACrD,UAAU,UAAU,CAAC,OAAO,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAA;AACpE,SAAQ;AACR,QAAQ,UAAU,CAAC,KAAK,EAAE,CAAA;AAC1B,OAAO;AACP,KAAK,CAAC,CAAA;AACN,GAAG,CAAA;AACH;;;;"}
|