Skip to content

feat(svelte): Add Svelte SDK Package Boilerplate #5535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"packages/react",
"packages/remix",
"packages/serverless",
"packages/svelte",
"packages/tracing",
"packages/types",
"packages/typescript",
Expand Down
6 changes: 6 additions & 0 deletions packages/svelte/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
env: {
browser: true,
},
extends: ['../../.eslintrc.js'],
};
29 changes: 29 additions & 0 deletions packages/svelte/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MIT License

Copyright (c) 2022, Sentry
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions packages/svelte/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<p align="center">
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
</a>
</p>

# Official Sentry SDK for Svelte

This SDK is work in progress, and should not be used before officially released.
6 changes: 6 additions & 0 deletions packages/svelte/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const baseConfig = require('../../jest/jest.config.js');

module.exports = {
...baseConfig,
testEnvironment: 'jsdom',
};
53 changes: 53 additions & 0 deletions packages/svelte/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@sentry/svelte",
"version": "7.9.0",
"description": "Official Sentry SDK for Svelte",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte",
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=8"
},
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"private": "true",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@sentry/browser": "7.9.0",
"@sentry/types": "7.9.0",
"@sentry/utils": "7.9.0",
"tslib": "^1.9.3"
},
"peerDependencies": {
"svelte": "3.x"
},
"scripts": {
"build": "run-p build:rollup build:types",
"build:dev": "run-s build",
"build:rollup": "rollup -c rollup.npm.config.js",
"build:types": "tsc -p tsconfig.types.json",
"build:watch": "run-p build:rollup:watch build:types:watch",
"build:dev:watch": "run-s build:watch",
"build:rollup:watch": "rollup -c rollup.npm.config.js --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-svelte-*.tgz",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
"test": "jest --passWithNoTests",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added the --passWithNoTests flag so that CI passes until we actually have tests

"test:watch": "jest --watch"
},
"volta": {
"extends": "../../package.json"
},
"sideEffects": false
}
3 changes: 3 additions & 0 deletions packages/svelte/rollup.npm.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js';

export default makeNPMConfigVariants(makeBaseNPMConfig());
1 change: 1 addition & 0 deletions packages/svelte/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null;
8 changes: 8 additions & 0 deletions packages/svelte/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// TODO Once https://github.com/microsoft/TypeScript/issues/33094 is done (if it ever is), this file can disappear, as
// it's purely a placeholder to satisfy VSCode.

{
"extends": "../tsconfig.test.json",

"include": ["./**/*"]
}
7 changes: 7 additions & 0 deletions packages/svelte/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {}
}
12 changes: 12 additions & 0 deletions packages/svelte/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.json",

"include": ["test/**/*"],

"compilerOptions": {
// should include all types from `./tsconfig.json` plus types for all test frameworks used
"types": ["jest"]

// other package-specific, test-specific options
}
}
10 changes: 10 additions & 0 deletions packages/svelte/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",

"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "build/types"
}
}