Skip to content

Commit 8c655e4

Browse files
authored
feat(solidstart): Add solidstart SDK basic package (#12730)
1 parent bd484cf commit 8c655e4

40 files changed

+1506
-26
lines changed

dev-packages/e2e-tests/verdaccio-config/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ packages:
140140
unpublish: $all
141141
# proxy: npmjs # Don't proxy for E2E tests!
142142

143+
'@sentry/solidstart':
144+
access: $all
145+
publish: $all
146+
unpublish: $all
147+
# proxy: npmjs # Don't proxy for E2E tests!
148+
143149
'@sentry/svelte':
144150
access: $all
145151
publish: $all

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"packages/replay-canvas",
7373
"packages/replay-worker",
7474
"packages/solid",
75+
"packages/solidstart",
7576
"packages/svelte",
7677
"packages/sveltekit",
7778
"packages/types",

packages/solid/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ render(
5252
);
5353
```
5454

55-
# ErrorBoundary
55+
# Solid ErrorBoundary
5656

5757
To automatically capture exceptions from inside a component tree and render a fallback component, wrap the native Solid
5858
JS `ErrorBoundary` component with `Sentry.withSentryErrorBoundary`.

packages/solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
7979
"build:types:watch": "tsc -p tsconfig.types.json --watch",
8080
"build:tarball": "npm pack",
81-
"circularDepCheck": "madge --circular src/index.ts",
81+
"circularDepCheck": "madge --circular src/index.ts && madge --circular src/solidrouter.ts",
8282
"clean": "rimraf build coverage sentry-solid-*.tgz ./*.d.ts ./*.d.ts.map",
8383
"fix": "eslint . --format stylish --fix",
8484
"lint": "eslint . --format stylish",

packages/solid/test/errorboundary.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('withSentryErrorBoundary', () => {
4444
it('calls `captureException` when an error occurs`', () => {
4545
render(() => (
4646
<SentryErrorBoundary fallback={<div>Ooops, an error occurred.</div>}>
47+
{/* @ts-expect-error: component doesn't exist on purpose */}
4748
<NonExistentComponent />
4849
</SentryErrorBoundary>
4950
));
@@ -55,6 +56,7 @@ describe('withSentryErrorBoundary', () => {
5556
it('renders the fallback component', async () => {
5657
const { findByText } = render(() => (
5758
<SentryErrorBoundary fallback={<div>Ooops, an error occurred.</div>}>
59+
{/* @ts-expect-error: component doesn't exist on purpose */}
5860
<NonExistentComponent />
5961
</SentryErrorBoundary>
6062
));
@@ -65,11 +67,12 @@ describe('withSentryErrorBoundary', () => {
6567
it('passes the `error` and `reset` function to the fallback component', () => {
6668
const mockFallback = vi.fn();
6769

68-
render(() => {
70+
render(() => (
6971
<SentryErrorBoundary fallback={mockFallback}>
72+
{/* @ts-expect-error: component doesn't exist on purpose */}
7073
<NonExistentComponent />
71-
</SentryErrorBoundary>;
72-
});
74+
</SentryErrorBoundary>
75+
));
7376

7477
expect(mockFallback).toHaveBeenCalledTimes(1);
7578
expect(mockFallback).toHaveBeenCalledWith(
@@ -81,6 +84,7 @@ describe('withSentryErrorBoundary', () => {
8184
it('calls `captureException` again after resetting', async () => {
8285
const { findByRole } = render(() => (
8386
<SentryErrorBoundary fallback={(_, reset) => <button onClick={reset}>Reset</button>}>
87+
{/* @ts-expect-error: component doesn't exist on purpose */}
8488
<NonExistentComponent />
8589
</SentryErrorBoundary>
8690
));

packages/solid/test/sdk.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { init as solidInit } from '../src/sdk';
66

77
const browserInit = vi.spyOn(SentryBrowser, 'init');
88

9-
describe('Initialize Solid SDk', () => {
9+
describe('Initialize Solid SDK', () => {
1010
beforeEach(() => {
1111
vi.clearAllMocks();
1212
});

packages/solidstart/.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/client
2+
/server
3+
/*.d.ts
4+
/*.d.ts.map

packages/solidstart/.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
node: true,
5+
},
6+
overrides: [
7+
{
8+
files: ['vite.config.ts'],
9+
parserOptions: {
10+
project: ['tsconfig.test.json'],
11+
},
12+
},
13+
{
14+
files: ['src/vite/**', 'src/server/**'],
15+
rules: {
16+
'@sentry-internal/sdk/no-optional-chaining': 'off',
17+
},
18+
},
19+
],
20+
extends: ['../../.eslintrc.js'],
21+
};

packages/solidstart/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# types for the solidrouter integration that get output in root
2+
/client
3+
/server
4+
/*.d.ts
5+
/*.d.ts.map

packages/solidstart/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.

0 commit comments

Comments
 (0)