diff --git a/nx.json b/nx.json index 407ad942..5fcc7fdc 100644 --- a/nx.json +++ b/nx.json @@ -1,7 +1,6 @@ { "extends": "nx/presets/npm.json", "$schema": "./node_modules/nx/schemas/nx-schema.json", - "npmScope": "sentry", "affected": { "defaultBase": "main" }, @@ -14,6 +13,9 @@ } }, "targetDefaults": { + "build": { + "dependsOn": ["^build"] + }, "lint": { "dependsOn": ["^build", "build"] }, diff --git a/package.json b/package.json index cb478294..30c27d7b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@sentry/unplugin-root", + "name": "@sentry/sentry-unplugin-root", "version": "0.0.0", "description": "Root of the sentry unplugin monorepo.", "repository": "git@github.com:lforst/sentry-unplugin.git", diff --git a/packages/esbuild-plugin/.babelrc.json b/packages/esbuild-plugin/.babelrc.json new file mode 100644 index 00000000..0c20c06e --- /dev/null +++ b/packages/esbuild-plugin/.babelrc.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/env", "@babel/typescript"] +} diff --git a/packages/esbuild-plugin/.eslintrc.js b/packages/esbuild-plugin/.eslintrc.js new file mode 100644 index 00000000..42b35d84 --- /dev/null +++ b/packages/esbuild-plugin/.eslintrc.js @@ -0,0 +1,20 @@ +const jestPackageJson = require("jest/package.json"); + +/** @type {import('eslint').ESLint.Options} */ +module.exports = { + root: true, + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], + ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"], + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./src/tsconfig.json", "./test/tsconfig.json"], + }, + env: { + node: true, + }, + settings: { + jest: { + version: jestPackageJson.version, + }, + }, +}; diff --git a/packages/esbuild-plugin/.gitignore b/packages/esbuild-plugin/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/esbuild-plugin/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/esbuild-plugin/LICENSE b/packages/esbuild-plugin/LICENSE new file mode 100644 index 00000000..4acee9a3 --- /dev/null +++ b/packages/esbuild-plugin/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/esbuild-plugin/jest.config.js b/packages/esbuild-plugin/jest.config.js new file mode 100644 index 00000000..160178bb --- /dev/null +++ b/packages/esbuild-plugin/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + testEnvironment: "node", + transform: { + "^.+\\.(t|j)sx?$": ["@swc/jest"], + }, +}; diff --git a/packages/esbuild-plugin/package.json b/packages/esbuild-plugin/package.json new file mode 100644 index 00000000..686ddc6b --- /dev/null +++ b/packages/esbuild-plugin/package.json @@ -0,0 +1,61 @@ +{ + "name": "@sentry/esbuild-plugin", + "version": "0.0.1", + "description": "Official Sentry esbuild plugin", + "repository": "git://github.com/getsentry/sentry-unplugin.git", + "homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/esbuild-plugin", + "author": "Sentry", + "license": "MIT", + "keywords": [ + "Sentry", + "esbuild", + "bundler", + "plugin" + ], + "publishConfig": { + "access": "public" + }, + "files": [ + "dist" + ], + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "scripts": { + "build": "rimraf ./out && run-p build:rollup build:types", + "build:watch": "run-p build:rollup:watch build:types:watch", + "build:rollup": "rollup --config rollup.config.js", + "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen", + "build:types": "tsc --project types.tsconfig.json", + "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput", + "check:types": "run-p check:types:src check:types:test", + "check:types:src": "tsc --project ./src/tsconfig.json --noEmit", + "check:types:test": "tsc --project ./test/tsconfig.json --noEmit", + "test": "jest", + "lint": "eslint ./src ./test" + }, + "dependencies": { + "@sentry/sentry-unplugin": "0.0.1" + }, + "devDependencies": { + "@babel/core": "7.18.5", + "@babel/preset-env": "7.18.2", + "@babel/preset-typescript": "7.17.12", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-commonjs": "22.0.1", + "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-node-resolve": "13.3.0", + "@swc/core": "^1.2.205", + "@swc/jest": "^0.2.21", + "@types/jest": "^28.1.3", + "@types/node": "^18.6.3", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", + "eslint": "^8.18.0", + "jest": "^28.1.1", + "npm-run-all": "^4.1.5", + "rimraf": "^3.0.2", + "rollup": "2.75.7", + "typescript": "^4.7.4" + } +} diff --git a/packages/esbuild-plugin/rollup.config.js b/packages/esbuild-plugin/rollup.config.js new file mode 100644 index 00000000..eb423e78 --- /dev/null +++ b/packages/esbuild-plugin/rollup.config.js @@ -0,0 +1,35 @@ +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; +import packageJson from "./package.json"; +import modulePackage from "module"; + +const input = ["src/index.ts"]; + +const extensions = [".ts"]; + +export default { + input, + external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules], + plugins: [ + resolve({ extensions, preferBuiltins: true }), + babel({ + extensions, + babelHelpers: "bundled", + include: ["src/**/*"], + }), + ], + output: [ + { + file: packageJson.module, + format: "esm", + exports: "named", + sourcemap: true, + }, + { + file: packageJson.main, + format: "cjs", + exports: "named", + sourcemap: true, + }, + ], +}; diff --git a/packages/esbuild-plugin/src/index.ts b/packages/esbuild-plugin/src/index.ts new file mode 100644 index 00000000..92e50783 --- /dev/null +++ b/packages/esbuild-plugin/src/index.ts @@ -0,0 +1,2 @@ +export { sentryEsbuildPlugin as default } from "@sentry/sentry-unplugin"; +export type { Options } from "@sentry/sentry-unplugin"; diff --git a/packages/esbuild-plugin/src/tsconfig.json b/packages/esbuild-plugin/src/tsconfig.json new file mode 100644 index 00000000..86051fab --- /dev/null +++ b/packages/esbuild-plugin/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", + "include": ["./**/*", "../package.json"], + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/packages/esbuild-plugin/test/public-api.test.ts b/packages/esbuild-plugin/test/public-api.test.ts new file mode 100644 index 00000000..7a5ea909 --- /dev/null +++ b/packages/esbuild-plugin/test/public-api.test.ts @@ -0,0 +1,6 @@ +import sentryEsbuildPlugin from "../src"; + +test("Esbuild plugin should exist", () => { + expect(sentryEsbuildPlugin).toBeDefined(); + expect(typeof sentryEsbuildPlugin).toBe("function"); +}); diff --git a/packages/esbuild-plugin/test/tsconfig.json b/packages/esbuild-plugin/test/tsconfig.json new file mode 100644 index 00000000..b73d9b53 --- /dev/null +++ b/packages/esbuild-plugin/test/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../src/tsconfig.json", + "include": ["../src/**/*", "./**/*"], + "compilerOptions": { + "types": ["node", "jest"] + } +} diff --git a/packages/esbuild-plugin/types.tsconfig.json b/packages/esbuild-plugin/types.tsconfig.json new file mode 100644 index 00000000..fb161bc4 --- /dev/null +++ b/packages/esbuild-plugin/types.tsconfig.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./src/tsconfig.json", + "include": ["./src/**/*"], + "compilerOptions": { + "rootDir": "./src", + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "./dist/types" + } +} diff --git a/packages/eslint-configs/package.json b/packages/eslint-configs/package.json index bdbdec96..9f71e0e1 100644 --- a/packages/eslint-configs/package.json +++ b/packages/eslint-configs/package.json @@ -1,6 +1,7 @@ { - "name": "eslint-config-local", + "name": "@sentry-internal/eslint-config", "version": "0.0.0", + "license": "MIT", "private": true, "peerDependencies": { "eslint": "^8.14.0" diff --git a/packages/integration-tests/.eslintrc.js b/packages/integration-tests/.eslintrc.js index 3e552209..bf333cd9 100644 --- a/packages/integration-tests/.eslintrc.js +++ b/packages/integration-tests/.eslintrc.js @@ -3,7 +3,7 @@ const jestPackageJson = require("jest/package.json"); /** @type {import('eslint').ESLint.Options} */ module.exports = { root: true, - extends: ["local/jest", "local/base"], + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], ignorePatterns: [".eslintrc.js", "fixtures/*/out", "jest.config.js"], parserOptions: { tsconfigRootDir: __dirname, diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 37bf574c..f04bd92c 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -1,6 +1,7 @@ { - "name": "@sentry/integration-tests", - "version": "1.0.0", + "name": "@sentry-internal/integration-tests", + "version": "0.0.0", + "license": "MIT", "private": true, "scripts": { "test": "run-s test:setup test:jest", @@ -12,10 +13,10 @@ "dependencies": { "@swc/jest": "^0.2.21", "@types/jest": "^28.1.3", - "@sentry/unplugin": "*", + "@sentry/sentry-unplugin": "*", "@types/webpack4": "npm:@types/webpack@4.41.32", - "eslint-config-local": "*", - "sentry-unplugin-tsconfigs": "*", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", "esbuild": "0.14.49", "jest": "^28.1.3", "npm-run-all": "4.1.5", diff --git a/packages/integration-tests/tsconfig.json b/packages/integration-tests/tsconfig.json index 4eedee32..c697299a 100644 --- a/packages/integration-tests/tsconfig.json +++ b/packages/integration-tests/tsconfig.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "sentry-unplugin-tsconfigs/base-config.json", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", "include": ["./**/*"], "compilerOptions": { "esModuleInterop": true, diff --git a/packages/integration-tests/utils/create-cjs-bundles.ts b/packages/integration-tests/utils/create-cjs-bundles.ts index e75b8848..d335d656 100644 --- a/packages/integration-tests/utils/create-cjs-bundles.ts +++ b/packages/integration-tests/utils/create-cjs-bundles.ts @@ -10,7 +10,7 @@ import { sentryVitePlugin, sentryWebpackPlugin, Options, -} from "@sentry/unplugin"; +} from "@sentry/sentry-unplugin"; export function createCjsBundles( entrypoints: { [name: string]: string }, diff --git a/packages/playground/build-esbuild.js b/packages/playground/build-esbuild.js index 7aa5bf99..6eee7f2a 100644 --- a/packages/playground/build-esbuild.js +++ b/packages/playground/build-esbuild.js @@ -1,4 +1,4 @@ -const { sentryEsbuildPlugin } = require("@sentry/unplugin"); +const { sentryEsbuildPlugin } = require("@sentry/sentry-unplugin"); const { build } = require("esbuild"); const placeHolderOptions = require("./config.json"); diff --git a/packages/playground/build-webpack4.js b/packages/playground/build-webpack4.js index 50b00612..3de801e1 100644 --- a/packages/playground/build-webpack4.js +++ b/packages/playground/build-webpack4.js @@ -1,7 +1,7 @@ // @ts-check const path = require("path"); const webpack4 = require("webpack4"); -const { sentryWebpackPlugin } = require("@sentry/unplugin"); +const { sentryWebpackPlugin } = require("@sentry/sentry-unplugin"); const placeHolderOptions = require("./config.json"); diff --git a/packages/playground/build-webpack5.js b/packages/playground/build-webpack5.js index 886763ce..0295c797 100644 --- a/packages/playground/build-webpack5.js +++ b/packages/playground/build-webpack5.js @@ -1,7 +1,7 @@ // @ts-check const path = require("path"); const webpack5 = require("webpack"); -const { sentryWebpackPlugin } = require("@sentry/unplugin"); +const { sentryWebpackPlugin } = require("@sentry/sentry-unplugin"); const placeHolderOptions = require("./config.json"); diff --git a/packages/playground/package.json b/packages/playground/package.json index e0d23ef5..3d800318 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,8 +1,6 @@ { - "name": "@sentry/playground", - "version": "1.0.0", - "main": "index.js", - "author": "Luca Forstner", + "name": "@sentry-internal/unplugin-playground", + "version": "0.0.0", "license": "MIT", "private": true, "scripts": { @@ -18,7 +16,7 @@ "dependencies": { "@sentry/integrations": "^7.11.1", "@sentry/node": "^7.11.1", - "@sentry/unplugin": "*", + "@sentry/sentry-unplugin": "*", "@types/express": "^4.17.13", "@types/http-proxy": "^1.17.9", "esbuild": "0.14.49", diff --git a/packages/playground/rollup.config.js b/packages/playground/rollup.config.js index ab714fbf..3eb8f319 100644 --- a/packages/playground/rollup.config.js +++ b/packages/playground/rollup.config.js @@ -1,7 +1,7 @@ // @ts-check import commonjs from "@rollup/plugin-commonjs"; import resolve from "@rollup/plugin-node-resolve"; -import { sentryRollupPlugin } from "@sentry/unplugin"; +import { sentryRollupPlugin } from "@sentry/sentry-unplugin"; import placeHolderOptions from "./config.json"; const input = ["src/entrypoint1.js"]; diff --git a/packages/playground/vite.config.js b/packages/playground/vite.config.js index 90c5df75..c68a6a8f 100644 --- a/packages/playground/vite.config.js +++ b/packages/playground/vite.config.js @@ -1,5 +1,5 @@ // @ts-check -import { sentryVitePlugin } from "@sentry/unplugin"; +import { sentryVitePlugin } from "@sentry/sentry-unplugin"; import { defineConfig } from "vite"; import * as path from "path"; import placeHolderOptions from "./config.json"; diff --git a/packages/playground/vite.config.smallNodeApp.js b/packages/playground/vite.config.smallNodeApp.js index e1b9d13b..c4d11270 100644 --- a/packages/playground/vite.config.smallNodeApp.js +++ b/packages/playground/vite.config.smallNodeApp.js @@ -1,5 +1,5 @@ // @ts-check -import { sentryVitePlugin } from "@sentry/unplugin"; +import { sentryVitePlugin } from "@sentry/sentry-unplugin"; import { defineConfig } from "vite"; import * as path from "path"; diff --git a/packages/rollup-plugin/.babelrc.json b/packages/rollup-plugin/.babelrc.json new file mode 100644 index 00000000..0c20c06e --- /dev/null +++ b/packages/rollup-plugin/.babelrc.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/env", "@babel/typescript"] +} diff --git a/packages/rollup-plugin/.eslintrc.js b/packages/rollup-plugin/.eslintrc.js new file mode 100644 index 00000000..42b35d84 --- /dev/null +++ b/packages/rollup-plugin/.eslintrc.js @@ -0,0 +1,20 @@ +const jestPackageJson = require("jest/package.json"); + +/** @type {import('eslint').ESLint.Options} */ +module.exports = { + root: true, + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], + ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"], + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./src/tsconfig.json", "./test/tsconfig.json"], + }, + env: { + node: true, + }, + settings: { + jest: { + version: jestPackageJson.version, + }, + }, +}; diff --git a/packages/rollup-plugin/.gitignore b/packages/rollup-plugin/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/rollup-plugin/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/rollup-plugin/LICENSE b/packages/rollup-plugin/LICENSE new file mode 100644 index 00000000..4acee9a3 --- /dev/null +++ b/packages/rollup-plugin/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/rollup-plugin/jest.config.js b/packages/rollup-plugin/jest.config.js new file mode 100644 index 00000000..160178bb --- /dev/null +++ b/packages/rollup-plugin/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + testEnvironment: "node", + transform: { + "^.+\\.(t|j)sx?$": ["@swc/jest"], + }, +}; diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json new file mode 100644 index 00000000..10a3e9eb --- /dev/null +++ b/packages/rollup-plugin/package.json @@ -0,0 +1,62 @@ +{ + "name": "@sentry/rollup-plugin", + "version": "0.0.1", + "description": "Official Sentry Rollup plugin", + "repository": "git://github.com/getsentry/sentry-unplugin.git", + "homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/rollup-plugin", + "author": "Sentry", + "license": "MIT", + "keywords": [ + "Sentry", + "rollup-plugin", + "Rollup", + "bundler", + "plugin" + ], + "publishConfig": { + "access": "public" + }, + "files": [ + "dist" + ], + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "scripts": { + "build": "rimraf ./out && run-p build:rollup build:types", + "build:watch": "run-p build:rollup:watch build:types:watch", + "build:rollup": "rollup --config rollup.config.js", + "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen", + "build:types": "tsc --project types.tsconfig.json", + "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput", + "check:types": "run-p check:types:src check:types:test", + "check:types:src": "tsc --project ./src/tsconfig.json --noEmit", + "check:types:test": "tsc --project ./test/tsconfig.json --noEmit", + "test": "jest", + "lint": "eslint ./src ./test" + }, + "dependencies": { + "@sentry/sentry-unplugin": "0.0.1" + }, + "devDependencies": { + "@babel/core": "7.18.5", + "@babel/preset-env": "7.18.2", + "@babel/preset-typescript": "7.17.12", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-commonjs": "22.0.1", + "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-node-resolve": "13.3.0", + "@swc/core": "^1.2.205", + "@swc/jest": "^0.2.21", + "@types/jest": "^28.1.3", + "@types/node": "^18.6.3", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", + "eslint": "^8.18.0", + "jest": "^28.1.1", + "npm-run-all": "^4.1.5", + "rimraf": "^3.0.2", + "rollup": "2.75.7", + "typescript": "^4.7.4" + } +} diff --git a/packages/rollup-plugin/rollup.config.js b/packages/rollup-plugin/rollup.config.js new file mode 100644 index 00000000..eb423e78 --- /dev/null +++ b/packages/rollup-plugin/rollup.config.js @@ -0,0 +1,35 @@ +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; +import packageJson from "./package.json"; +import modulePackage from "module"; + +const input = ["src/index.ts"]; + +const extensions = [".ts"]; + +export default { + input, + external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules], + plugins: [ + resolve({ extensions, preferBuiltins: true }), + babel({ + extensions, + babelHelpers: "bundled", + include: ["src/**/*"], + }), + ], + output: [ + { + file: packageJson.module, + format: "esm", + exports: "named", + sourcemap: true, + }, + { + file: packageJson.main, + format: "cjs", + exports: "named", + sourcemap: true, + }, + ], +}; diff --git a/packages/rollup-plugin/src/index.ts b/packages/rollup-plugin/src/index.ts new file mode 100644 index 00000000..1a96f42a --- /dev/null +++ b/packages/rollup-plugin/src/index.ts @@ -0,0 +1,2 @@ +export { sentryRollupPlugin as default } from "@sentry/sentry-unplugin"; +export type { Options } from "@sentry/sentry-unplugin"; diff --git a/packages/rollup-plugin/src/tsconfig.json b/packages/rollup-plugin/src/tsconfig.json new file mode 100644 index 00000000..86051fab --- /dev/null +++ b/packages/rollup-plugin/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", + "include": ["./**/*", "../package.json"], + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/packages/rollup-plugin/test/public-api.test.ts b/packages/rollup-plugin/test/public-api.test.ts new file mode 100644 index 00000000..59cfdaa3 --- /dev/null +++ b/packages/rollup-plugin/test/public-api.test.ts @@ -0,0 +1,6 @@ +import sentryRollupPlugin from "../src"; + +test("Rollup plugin should exist", () => { + expect(sentryRollupPlugin).toBeDefined(); + expect(typeof sentryRollupPlugin).toBe("function"); +}); diff --git a/packages/rollup-plugin/test/tsconfig.json b/packages/rollup-plugin/test/tsconfig.json new file mode 100644 index 00000000..b73d9b53 --- /dev/null +++ b/packages/rollup-plugin/test/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../src/tsconfig.json", + "include": ["../src/**/*", "./**/*"], + "compilerOptions": { + "types": ["node", "jest"] + } +} diff --git a/packages/rollup-plugin/types.tsconfig.json b/packages/rollup-plugin/types.tsconfig.json new file mode 100644 index 00000000..fb161bc4 --- /dev/null +++ b/packages/rollup-plugin/types.tsconfig.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./src/tsconfig.json", + "include": ["./src/**/*"], + "compilerOptions": { + "rootDir": "./src", + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "./dist/types" + } +} diff --git a/packages/tsconfigs/package.json b/packages/tsconfigs/package.json index a64464ad..6060149e 100644 --- a/packages/tsconfigs/package.json +++ b/packages/tsconfigs/package.json @@ -1,5 +1,6 @@ { - "name": "sentry-unplugin-tsconfigs", + "name": "@sentry-internal/sentry-unplugin-tsconfig", "version": "0.0.0", + "license": "MIT", "private": true } diff --git a/packages/unplugin/.eslintrc.js b/packages/unplugin/.eslintrc.js index fe53c9eb..42b35d84 100644 --- a/packages/unplugin/.eslintrc.js +++ b/packages/unplugin/.eslintrc.js @@ -3,7 +3,7 @@ const jestPackageJson = require("jest/package.json"); /** @type {import('eslint').ESLint.Options} */ module.exports = { root: true, - extends: ["local/jest", "local/base"], + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"], parserOptions: { tsconfigRootDir: __dirname, diff --git a/packages/unplugin/package.json b/packages/unplugin/package.json index c21f50a4..7af44494 100644 --- a/packages/unplugin/package.json +++ b/packages/unplugin/package.json @@ -1,11 +1,20 @@ { - "name": "@sentry/unplugin", + "name": "@sentry/sentry-unplugin", "version": "0.0.1", - "description": "Sentry unplugin.", + "description": "Official Sentry unplugin", + "repository": "git://github.com/getsentry/sentry-unplugin.git", + "homepage": "https://github.com/getsentry/sentry-unplugin", + "author": "Sentry", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "files": [ + "dist" + ], "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/types/index.d.ts", - "repository": "https://github.com/lforst/sentry-unplugin", "scripts": { "build": "rimraf ./out && run-p build:rollup build:types", "build:watch": "run-p build:rollup:watch build:types:watch", @@ -33,14 +42,14 @@ "@babel/preset-typescript": "7.17.12", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "22.0.1", - "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "13.3.0", "@swc/core": "^1.2.205", "@swc/jest": "^0.2.21", "@types/jest": "^28.1.3", "@types/node": "^18.6.3", - "eslint-config-local": "*", - "sentry-unplugin-tsconfigs": "*", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", "eslint": "^8.18.0", "jest": "^28.1.1", "npm-run-all": "^4.1.5", diff --git a/packages/unplugin/src/tsconfig.json b/packages/unplugin/src/tsconfig.json index c7d27b2e..d1b12b41 100644 --- a/packages/unplugin/src/tsconfig.json +++ b/packages/unplugin/src/tsconfig.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "sentry-unplugin-tsconfigs/base-config.json", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", "include": ["./**/*", "../package.json"], "compilerOptions": { "esModuleInterop": true, diff --git a/packages/vite-plugin/.babelrc.json b/packages/vite-plugin/.babelrc.json new file mode 100644 index 00000000..0c20c06e --- /dev/null +++ b/packages/vite-plugin/.babelrc.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/env", "@babel/typescript"] +} diff --git a/packages/vite-plugin/.eslintrc.js b/packages/vite-plugin/.eslintrc.js new file mode 100644 index 00000000..42b35d84 --- /dev/null +++ b/packages/vite-plugin/.eslintrc.js @@ -0,0 +1,20 @@ +const jestPackageJson = require("jest/package.json"); + +/** @type {import('eslint').ESLint.Options} */ +module.exports = { + root: true, + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], + ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"], + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./src/tsconfig.json", "./test/tsconfig.json"], + }, + env: { + node: true, + }, + settings: { + jest: { + version: jestPackageJson.version, + }, + }, +}; diff --git a/packages/vite-plugin/.gitignore b/packages/vite-plugin/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/vite-plugin/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/vite-plugin/LICENSE b/packages/vite-plugin/LICENSE new file mode 100644 index 00000000..4acee9a3 --- /dev/null +++ b/packages/vite-plugin/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/vite-plugin/jest.config.js b/packages/vite-plugin/jest.config.js new file mode 100644 index 00000000..160178bb --- /dev/null +++ b/packages/vite-plugin/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + testEnvironment: "node", + transform: { + "^.+\\.(t|j)sx?$": ["@swc/jest"], + }, +}; diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json new file mode 100644 index 00000000..b7bd0b1b --- /dev/null +++ b/packages/vite-plugin/package.json @@ -0,0 +1,61 @@ +{ + "name": "@sentry/vite-plugin", + "version": "0.0.1", + "description": "Official Sentry Vite plugin", + "repository": "git://github.com/getsentry/sentry-unplugin.git", + "homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/vite-plugin", + "author": "Sentry", + "license": "MIT", + "keywords": [ + "Sentry", + "Vite", + "bundler", + "plugin" + ], + "publishConfig": { + "access": "public" + }, + "files": [ + "dist" + ], + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "scripts": { + "build": "rimraf ./out && run-p build:rollup build:types", + "build:watch": "run-p build:rollup:watch build:types:watch", + "build:rollup": "rollup --config rollup.config.js", + "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen", + "build:types": "tsc --project types.tsconfig.json", + "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput", + "check:types": "run-p check:types:src check:types:test", + "check:types:src": "tsc --project ./src/tsconfig.json --noEmit", + "check:types:test": "tsc --project ./test/tsconfig.json --noEmit", + "test": "jest", + "lint": "eslint ./src ./test" + }, + "dependencies": { + "@sentry/sentry-unplugin": "0.0.1" + }, + "devDependencies": { + "@babel/core": "7.18.5", + "@babel/preset-env": "7.18.2", + "@babel/preset-typescript": "7.17.12", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-commonjs": "22.0.1", + "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-node-resolve": "13.3.0", + "@swc/core": "^1.2.205", + "@swc/jest": "^0.2.21", + "@types/jest": "^28.1.3", + "@types/node": "^18.6.3", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", + "eslint": "^8.18.0", + "jest": "^28.1.1", + "npm-run-all": "^4.1.5", + "rimraf": "^3.0.2", + "rollup": "2.75.7", + "typescript": "^4.7.4" + } +} diff --git a/packages/vite-plugin/rollup.config.js b/packages/vite-plugin/rollup.config.js new file mode 100644 index 00000000..eb423e78 --- /dev/null +++ b/packages/vite-plugin/rollup.config.js @@ -0,0 +1,35 @@ +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; +import packageJson from "./package.json"; +import modulePackage from "module"; + +const input = ["src/index.ts"]; + +const extensions = [".ts"]; + +export default { + input, + external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules], + plugins: [ + resolve({ extensions, preferBuiltins: true }), + babel({ + extensions, + babelHelpers: "bundled", + include: ["src/**/*"], + }), + ], + output: [ + { + file: packageJson.module, + format: "esm", + exports: "named", + sourcemap: true, + }, + { + file: packageJson.main, + format: "cjs", + exports: "named", + sourcemap: true, + }, + ], +}; diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts new file mode 100644 index 00000000..216d37ad --- /dev/null +++ b/packages/vite-plugin/src/index.ts @@ -0,0 +1,2 @@ +export { sentryVitePlugin as default } from "@sentry/sentry-unplugin"; +export type { Options } from "@sentry/sentry-unplugin"; diff --git a/packages/vite-plugin/src/tsconfig.json b/packages/vite-plugin/src/tsconfig.json new file mode 100644 index 00000000..86051fab --- /dev/null +++ b/packages/vite-plugin/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", + "include": ["./**/*", "../package.json"], + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/packages/vite-plugin/test/public-api.test.ts b/packages/vite-plugin/test/public-api.test.ts new file mode 100644 index 00000000..1de1f84d --- /dev/null +++ b/packages/vite-plugin/test/public-api.test.ts @@ -0,0 +1,6 @@ +import sentryVitePlugin from "../src"; + +test("Vite plugin should exist", () => { + expect(sentryVitePlugin).toBeDefined(); + expect(typeof sentryVitePlugin).toBe("function"); +}); diff --git a/packages/vite-plugin/test/tsconfig.json b/packages/vite-plugin/test/tsconfig.json new file mode 100644 index 00000000..b73d9b53 --- /dev/null +++ b/packages/vite-plugin/test/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../src/tsconfig.json", + "include": ["../src/**/*", "./**/*"], + "compilerOptions": { + "types": ["node", "jest"] + } +} diff --git a/packages/vite-plugin/types.tsconfig.json b/packages/vite-plugin/types.tsconfig.json new file mode 100644 index 00000000..fb161bc4 --- /dev/null +++ b/packages/vite-plugin/types.tsconfig.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./src/tsconfig.json", + "include": ["./src/**/*"], + "compilerOptions": { + "rootDir": "./src", + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "./dist/types" + } +} diff --git a/packages/webpack-plugin/.babelrc.json b/packages/webpack-plugin/.babelrc.json new file mode 100644 index 00000000..0c20c06e --- /dev/null +++ b/packages/webpack-plugin/.babelrc.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/env", "@babel/typescript"] +} diff --git a/packages/webpack-plugin/.eslintrc.js b/packages/webpack-plugin/.eslintrc.js new file mode 100644 index 00000000..42b35d84 --- /dev/null +++ b/packages/webpack-plugin/.eslintrc.js @@ -0,0 +1,20 @@ +const jestPackageJson = require("jest/package.json"); + +/** @type {import('eslint').ESLint.Options} */ +module.exports = { + root: true, + extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"], + ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"], + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./src/tsconfig.json", "./test/tsconfig.json"], + }, + env: { + node: true, + }, + settings: { + jest: { + version: jestPackageJson.version, + }, + }, +}; diff --git a/packages/webpack-plugin/.gitignore b/packages/webpack-plugin/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/webpack-plugin/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/webpack-plugin/LICENSE b/packages/webpack-plugin/LICENSE new file mode 100644 index 00000000..4acee9a3 --- /dev/null +++ b/packages/webpack-plugin/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/webpack-plugin/jest.config.js b/packages/webpack-plugin/jest.config.js new file mode 100644 index 00000000..160178bb --- /dev/null +++ b/packages/webpack-plugin/jest.config.js @@ -0,0 +1,6 @@ +module.exports = { + testEnvironment: "node", + transform: { + "^.+\\.(t|j)sx?$": ["@swc/jest"], + }, +}; diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json new file mode 100644 index 00000000..ea00ca44 --- /dev/null +++ b/packages/webpack-plugin/package.json @@ -0,0 +1,62 @@ +{ + "name": "@sentry/webpack-plugin", + "version": "0.0.1", + "description": "Official Sentry Webpack plugin", + "repository": "git://github.com/getsentry/sentry-unplugin.git", + "homepage": "https://github.com/getsentry/sentry-unplugin/tree/main/packages/webpack-plugin", + "author": "Sentry", + "license": "MIT", + "keywords": [ + "Sentry", + "Vite", + "bundler", + "plugin" + ], + "private": true, + "publishConfig": { + "access": "restricted" + }, + "files": [ + "dist" + ], + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/types/index.d.ts", + "scripts": { + "build": "rimraf ./out && run-p build:rollup build:types", + "build:watch": "run-p build:rollup:watch build:types:watch", + "build:rollup": "rollup --config rollup.config.js", + "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen", + "build:types": "tsc --project types.tsconfig.json", + "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput", + "check:types": "run-p check:types:src check:types:test", + "check:types:src": "tsc --project ./src/tsconfig.json --noEmit", + "check:types:test": "tsc --project ./test/tsconfig.json --noEmit", + "test": "jest", + "lint": "eslint ./src ./test" + }, + "dependencies": { + "@sentry/sentry-unplugin": "0.0.1" + }, + "devDependencies": { + "@babel/core": "7.18.5", + "@babel/preset-env": "7.18.2", + "@babel/preset-typescript": "7.17.12", + "@rollup/plugin-babel": "5.3.1", + "@rollup/plugin-commonjs": "22.0.1", + "@rollup/plugin-json": "4.1.0", + "@rollup/plugin-node-resolve": "13.3.0", + "@swc/core": "^1.2.205", + "@swc/jest": "^0.2.21", + "@types/jest": "^28.1.3", + "@types/node": "^18.6.3", + "@sentry-internal/eslint-config": "*", + "@sentry-internal/sentry-unplugin-tsconfig": "*", + "eslint": "^8.18.0", + "jest": "^28.1.1", + "npm-run-all": "^4.1.5", + "rimraf": "^3.0.2", + "rollup": "2.75.7", + "typescript": "^4.7.4" + } +} diff --git a/packages/webpack-plugin/rollup.config.js b/packages/webpack-plugin/rollup.config.js new file mode 100644 index 00000000..eb423e78 --- /dev/null +++ b/packages/webpack-plugin/rollup.config.js @@ -0,0 +1,35 @@ +import resolve from "@rollup/plugin-node-resolve"; +import babel from "@rollup/plugin-babel"; +import packageJson from "./package.json"; +import modulePackage from "module"; + +const input = ["src/index.ts"]; + +const extensions = [".ts"]; + +export default { + input, + external: [...Object.keys(packageJson.dependencies), ...modulePackage.builtinModules], + plugins: [ + resolve({ extensions, preferBuiltins: true }), + babel({ + extensions, + babelHelpers: "bundled", + include: ["src/**/*"], + }), + ], + output: [ + { + file: packageJson.module, + format: "esm", + exports: "named", + sourcemap: true, + }, + { + file: packageJson.main, + format: "cjs", + exports: "named", + sourcemap: true, + }, + ], +}; diff --git a/packages/webpack-plugin/src/index.ts b/packages/webpack-plugin/src/index.ts new file mode 100644 index 00000000..7f1b86e6 --- /dev/null +++ b/packages/webpack-plugin/src/index.ts @@ -0,0 +1,2 @@ +export { sentryWebpackPlugin as default } from "@sentry/sentry-unplugin"; +export type { Options } from "@sentry/sentry-unplugin"; diff --git a/packages/webpack-plugin/src/tsconfig.json b/packages/webpack-plugin/src/tsconfig.json new file mode 100644 index 00000000..86051fab --- /dev/null +++ b/packages/webpack-plugin/src/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "@sentry-internal/sentry-unplugin-tsconfig/base-config.json", + "include": ["./**/*", "../package.json"], + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/packages/webpack-plugin/test/public-api.test.ts b/packages/webpack-plugin/test/public-api.test.ts new file mode 100644 index 00000000..81979a74 --- /dev/null +++ b/packages/webpack-plugin/test/public-api.test.ts @@ -0,0 +1,6 @@ +import sentryWebpackPlugin from "../src"; + +test("Webpack plugin should exist", () => { + expect(sentryWebpackPlugin).toBeDefined(); + expect(typeof sentryWebpackPlugin).toBe("function"); +}); diff --git a/packages/webpack-plugin/test/tsconfig.json b/packages/webpack-plugin/test/tsconfig.json new file mode 100644 index 00000000..b73d9b53 --- /dev/null +++ b/packages/webpack-plugin/test/tsconfig.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "../src/tsconfig.json", + "include": ["../src/**/*", "./**/*"], + "compilerOptions": { + "types": ["node", "jest"] + } +} diff --git a/packages/webpack-plugin/types.tsconfig.json b/packages/webpack-plugin/types.tsconfig.json new file mode 100644 index 00000000..fb161bc4 --- /dev/null +++ b/packages/webpack-plugin/types.tsconfig.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./src/tsconfig.json", + "include": ["./src/**/*"], + "compilerOptions": { + "rootDir": "./src", + "declaration": true, + "emitDeclarationOnly": true, + "declarationDir": "./dist/types" + } +} diff --git a/yarn.lock b/yarn.lock index d34d5050..a71a052c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1564,7 +1564,7 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-json@^4.1.0": +"@rollup/plugin-json@4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==