Skip to content

Commit 0408887

Browse files
committed
feat(svelte): Add Svelte SDK Package Boilerplate
1 parent 42d0f50 commit 0408887

File tree

12 files changed

+145
-0
lines changed

12 files changed

+145
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"packages/react",
4848
"packages/remix",
4949
"packages/serverless",
50+
"packages/svelte",
5051
"packages/tracing",
5152
"packages/types",
5253
"packages/typescript",

packages/svelte/.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
},
5+
extends: ['../../.eslintrc.js'],
6+
};

packages/svelte/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
MIT License
2+
3+
Copyright (c) 2022, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/svelte/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 Svelte
8+
9+
This SDK is work in progress, and should not be used before officially released.

packages/svelte/jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const baseConfig = require('../../jest/jest.config.js');
2+
3+
module.exports = {
4+
...baseConfig,
5+
testEnvironment: 'jsdom',
6+
};

packages/svelte/package.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@sentry/svelte",
3+
"version": "7.9.0",
4+
"description": "Official Sentry SDK for Svelte",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"engines": {
10+
"node": ">=8"
11+
},
12+
"main": "build/cjs/index.js",
13+
"module": "build/esm/index.js",
14+
"types": "build/types/index.d.ts",
15+
"private": "true",
16+
"publishConfig": {
17+
"access": "public"
18+
},
19+
"dependencies": {
20+
"@sentry/browser": "7.9.0",
21+
"@sentry/types": "7.9.0",
22+
"@sentry/utils": "7.9.0",
23+
"tslib": "^1.9.3"
24+
},
25+
"peerDependencies": {
26+
"svelte": "3.x"
27+
},
28+
"scripts": {
29+
"build": "run-p build:rollup build:types",
30+
"build:dev": "run-s build",
31+
"build:rollup": "rollup -c rollup.npm.config.js",
32+
"build:types": "tsc -p tsconfig.types.json",
33+
"build:watch": "run-p build:rollup:watch build:types:watch",
34+
"build:dev:watch": "run-s build:watch",
35+
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
36+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
37+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
38+
"circularDepCheck": "madge --circular src/index.ts",
39+
"clean": "rimraf build coverage sentry-svelte-*.tgz",
40+
"fix": "run-s fix:eslint fix:prettier",
41+
"fix:eslint": "eslint . --format stylish --fix",
42+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
43+
"lint": "run-s lint:prettier lint:eslint",
44+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
45+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
46+
"test": "jest",
47+
"test:watch": "jest --watch"
48+
},
49+
"volta": {
50+
"extends": "../../package.json"
51+
},
52+
"sideEffects": false
53+
}

packages/svelte/rollup.npm.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js';
2+
3+
export default makeNPMConfigVariants(makeBaseNPMConfig());

packages/svelte/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default null;

packages/svelte/test/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// TODO Once https://github.com/microsoft/TypeScript/issues/33094 is done (if it ever is), this file can disappear, as
2+
// it's purely a placeholder to satisfy VSCode.
3+
4+
{
5+
"extends": "../tsconfig.test.json",
6+
7+
"include": ["./**/*"]
8+
}

packages/svelte/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
4+
"include": ["src/**/*"],
5+
6+
"compilerOptions": {}
7+
}

packages/svelte/tsconfig.test.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
"types": ["jest"]
9+
10+
// other package-specific, test-specific options
11+
}
12+
}

packages/svelte/tsconfig.types.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"declaration": true,
6+
"declarationMap": true,
7+
"emitDeclarationOnly": true,
8+
"outDir": "build/types"
9+
}
10+
}

0 commit comments

Comments
 (0)