@sentry/esbuild-plugin 0.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -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.
package/README.md ADDED
@@ -0,0 +1,43 @@
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
+ # Sentry Esbuild Plugin (WIP)
8
+
9
+ **WARNING: This package is work in progress! Use with caution and do not yet use it in production. We're happy to receive your feedback!**
10
+
11
+ A esbuild plugin that provides release management features for Sentry:
12
+
13
+ - Sourcemap upload
14
+ - Release creation
15
+ - Automatic release name discovery (based on CI environment - Vercel, AWS, Heroku, CircleCI, or current Git SHA)
16
+ - Automatically association of errors with releases (Release injection)
17
+
18
+ ### Configuration
19
+
20
+ Every plugin takes an options argument with the following properties:
21
+
22
+ | Option | Type | Required | Description |
23
+ | -------------- | ----------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | include | `string` | required | A path that the plugin should scan recursively for source maps. It will upload all `.map` files and match associated `.js` files. |
25
+ | org | `string` | optional | The slug of the Sentry organization associated with the app. |
26
+ | project | `string` | optional | The slug of the Sentry project associated with the app. |
27
+ | authToken | `string` | optional | The authentication token to use for all communication with Sentry. Can be obtained from https://sentry.io/settings/account/api/auth-tokens/. Required scopes: `project:releases` (and `org:read` if `setCommits` option is used). |
28
+ | url | `string` | optional | The base URL of your Sentry instance. Defaults to https://sentry.io/, which is the correct value for SAAS customers. |
29
+ | release | `string` | optional | Unique identifier for the release. Defaults to automatically detected values for CI environments like Vercel, AWS, Heroku, CircleCI. If no such CI environment is detected, the plugin uses the git `HEAD`'s commit SHA. (**For `HEAD` option, requires access to the `git` CLI**). |
30
+ | entries | `(string \| RegExp)[] \| RegExp \| string \| function(absoluteFilePath: string): boolean` | optional | Filter for entry points that should be processed. By default, the release will be injected into all entry points. |
31
+ | ext | `array` | optional | The file extensions to be considered for the sourcemaps upload. By default the following file extensions are processed: `js`, `map`, `jsbundle`, and `bundle`. |
32
+ | finalize | `boolean` | optional | Indicates whether Sentry release record should be automatically finalized (`date_released` timestamp added) after artifact upload. Defaults to `true` |
33
+ | debug | `boolean` | optional | Print useful debug information. Defaults to `false`. |
34
+ | cleanArtifacts | `boolean` | optional | Remove all existing artifacts in the Sentry release before uploading sourcemaps. Defaults to `false`. |
35
+ | errorHandler | `function(err: Error): void` | optional | Function that is called when an error occurs during rlease creation or sourcemaps upload. When this function is provided, thrown errors will not cause the process to abort. If you still want to abort the process you can throw an error in the function. |
36
+
37
+ ### More information
38
+
39
+ - [Sentry Documentation](https://docs.sentry.io/quickstart/)
40
+ - [Troubleshooting Sourcemaps](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/)
41
+ - [Sentry CLI](https://docs.sentry.io/learn/cli/)
42
+ - [Sentry Discord](https://discord.gg/Ww9hbqr)
43
+ - [Sentry Stackoverflow](http://stackoverflow.com/questions/tagged/sentry)
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var bundlerPluginCore = require('@sentry/bundler-plugin-core');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'default', {
10
+ enumerable: true,
11
+ get: function () { return bundlerPluginCore.sentryEsbuildPlugin; }
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export { sentryEsbuildPlugin as default } from '@sentry/bundler-plugin-core';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { sentryEsbuildPlugin as default } from "@sentry/bundler-plugin-core";
2
+ export type { Options } from "@sentry/bundler-plugin-core";
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@sentry/esbuild-plugin",
3
+ "version": "0.0.1-alpha.0",
4
+ "description": "Official Sentry esbuild plugin",
5
+ "repository": "git@github.com:getsentry/sentry-javascript-bundler-plugins.git",
6
+ "homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/esbuild-plugin",
7
+ "author": "Sentry",
8
+ "license": "MIT",
9
+ "keywords": [
10
+ "Sentry",
11
+ "esbuild",
12
+ "bundler",
13
+ "plugin"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "main": "dist/cjs/index.js",
22
+ "module": "dist/esm/index.js",
23
+ "types": "dist/types/index.d.ts",
24
+ "scripts": {
25
+ "build": "rimraf ./out && run-p build:rollup build:types",
26
+ "build:watch": "run-p build:rollup:watch build:types:watch",
27
+ "build:rollup": "rollup --config rollup.config.js",
28
+ "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen",
29
+ "build:types": "tsc --project types.tsconfig.json",
30
+ "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
31
+ "build:npm": "npm pack",
32
+ "check:types": "run-p check:types:src check:types:test",
33
+ "check:types:src": "tsc --project ./src/tsconfig.json --noEmit",
34
+ "check:types:test": "tsc --project ./test/tsconfig.json --noEmit",
35
+ "test": "jest",
36
+ "lint": "eslint ./src ./test"
37
+ },
38
+ "dependencies": {
39
+ "@sentry/bundler-plugin-core": "0.0.1-alpha.0"
40
+ },
41
+ "devDependencies": {
42
+ "@babel/core": "7.18.5",
43
+ "@babel/preset-env": "7.18.2",
44
+ "@babel/preset-typescript": "7.17.12",
45
+ "@rollup/plugin-babel": "5.3.1",
46
+ "@rollup/plugin-commonjs": "22.0.1",
47
+ "@rollup/plugin-json": "4.1.0",
48
+ "@rollup/plugin-node-resolve": "13.3.0",
49
+ "@sentry-internal/eslint-config": "0.0.1-alpha.0",
50
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "0.0.1-alpha.0",
51
+ "@swc/core": "^1.2.205",
52
+ "@swc/jest": "^0.2.21",
53
+ "@types/jest": "^28.1.3",
54
+ "@types/node": "^18.6.3",
55
+ "eslint": "^8.18.0",
56
+ "jest": "^28.1.1",
57
+ "npm-run-all": "^4.1.5",
58
+ "rimraf": "^3.0.2",
59
+ "rollup": "2.75.7",
60
+ "typescript": "^4.7.4"
61
+ }
62
+ }