diff --git a/package.json b/package.json index 4df884840b8d..dff4d9e6fc14 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "packages/react", "packages/remix", "packages/serverless", + "packages/svelte", "packages/tracing", "packages/types", "packages/typescript", diff --git a/packages/svelte/.eslintrc.js b/packages/svelte/.eslintrc.js new file mode 100644 index 000000000000..46d8d10cc538 --- /dev/null +++ b/packages/svelte/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + env: { + browser: true, + }, + extends: ['../../.eslintrc.js'], +}; diff --git a/packages/svelte/LICENSE b/packages/svelte/LICENSE new file mode 100644 index 000000000000..81b248b1b42e --- /dev/null +++ b/packages/svelte/LICENSE @@ -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. diff --git a/packages/svelte/README.md b/packages/svelte/README.md new file mode 100644 index 000000000000..8f4742d3a37b --- /dev/null +++ b/packages/svelte/README.md @@ -0,0 +1,9 @@ +

+ + Sentry + +

+ +# Official Sentry SDK for Svelte + +This SDK is work in progress, and should not be used before officially released. diff --git a/packages/svelte/jest.config.js b/packages/svelte/jest.config.js new file mode 100644 index 000000000000..cd02790794a7 --- /dev/null +++ b/packages/svelte/jest.config.js @@ -0,0 +1,6 @@ +const baseConfig = require('../../jest/jest.config.js'); + +module.exports = { + ...baseConfig, + testEnvironment: 'jsdom', +}; diff --git a/packages/svelte/package.json b/packages/svelte/package.json new file mode 100644 index 000000000000..0ccd07ff99f7 --- /dev/null +++ b/packages/svelte/package.json @@ -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", + "test:watch": "jest --watch" + }, + "volta": { + "extends": "../../package.json" + }, + "sideEffects": false +} diff --git a/packages/svelte/rollup.npm.config.js b/packages/svelte/rollup.npm.config.js new file mode 100644 index 000000000000..5a62b528ef44 --- /dev/null +++ b/packages/svelte/rollup.npm.config.js @@ -0,0 +1,3 @@ +import { makeBaseNPMConfig, makeNPMConfigVariants } from '../../rollup/index.js'; + +export default makeNPMConfigVariants(makeBaseNPMConfig()); diff --git a/packages/svelte/src/index.ts b/packages/svelte/src/index.ts new file mode 100644 index 000000000000..7646bbd17d04 --- /dev/null +++ b/packages/svelte/src/index.ts @@ -0,0 +1 @@ +export default null; diff --git a/packages/svelte/test/tsconfig.json b/packages/svelte/test/tsconfig.json new file mode 100644 index 000000000000..074ceb45a9db --- /dev/null +++ b/packages/svelte/test/tsconfig.json @@ -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": ["./**/*"] +} diff --git a/packages/svelte/tsconfig.json b/packages/svelte/tsconfig.json new file mode 100644 index 000000000000..b0eb9ecb6476 --- /dev/null +++ b/packages/svelte/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + + "include": ["src/**/*"], + + "compilerOptions": {} +} diff --git a/packages/svelte/tsconfig.test.json b/packages/svelte/tsconfig.test.json new file mode 100644 index 000000000000..af7e36ec0eda --- /dev/null +++ b/packages/svelte/tsconfig.test.json @@ -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 + } +} diff --git a/packages/svelte/tsconfig.types.json b/packages/svelte/tsconfig.types.json new file mode 100644 index 000000000000..65455f66bd75 --- /dev/null +++ b/packages/svelte/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "build/types" + } +}