@sentry/bundler-plugin-core 0.5.1 → 0.7.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/dist/cjs/index.js +233 -112
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +234 -112
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/debug-id.d.ts +1 -1
- package/dist/types/options-mapping.d.ts +54 -4
- package/dist/types/sentry/cli.d.ts +2 -2
- package/dist/types/sentry/releasePipeline.d.ts +8 -8
- package/dist/types/sentry/telemetry.d.ts +3 -3
- package/dist/types/types.d.ts +28 -19
- package/package.json +27 -6
- package/sentry-esbuild-debugid-injection-file.js +18 -0
package/dist/types/debug-id.d.ts
CHANGED
|
@@ -1,19 +1,69 @@
|
|
|
1
1
|
import { Logger } from "./sentry/logger";
|
|
2
2
|
import { IncludeEntry as UserIncludeEntry, Options as UserOptions } from "./types";
|
|
3
3
|
declare type RequiredInternalOptions = Required<Pick<UserOptions, "finalize" | "dryRun" | "debug" | "silent" | "cleanArtifacts" | "telemetry" | "injectReleasesMap" | "_experiments" | "injectRelease" | "uploadSourceMaps">>;
|
|
4
|
-
declare type OptionalInternalOptions = Partial<Pick<UserOptions, "org" | "project" | "authToken" | "url" | "vcsRemote" | "dist" | "errorHandler" | "setCommits" | "deploy" | "configFile" | "headers">>;
|
|
4
|
+
declare type OptionalInternalOptions = Partial<Pick<UserOptions, "org" | "project" | "authToken" | "url" | "vcsRemote" | "dist" | "errorHandler" | "setCommits" | "deploy" | "configFile" | "headers" | "sourcemaps">>;
|
|
5
5
|
declare type NormalizedInternalOptions = {
|
|
6
6
|
releaseInjectionTargets: (string | RegExp)[] | ((filePath: string) => boolean) | undefined;
|
|
7
7
|
include: InternalIncludeEntry[];
|
|
8
8
|
};
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type NormalizedOptions = RequiredInternalOptions & OptionalInternalOptions & NormalizedInternalOptions;
|
|
10
10
|
declare type RequiredInternalIncludeEntry = Required<Pick<UserIncludeEntry, "paths" | "ext" | "stripCommonPrefix" | "sourceMapReference" | "rewrite" | "validate">>;
|
|
11
11
|
declare type OptionalInternalIncludeEntry = Partial<Pick<UserIncludeEntry, "ignoreFile" | "urlPrefix" | "urlSuffix" | "stripPrefix">>;
|
|
12
12
|
export declare type InternalIncludeEntry = RequiredInternalIncludeEntry & OptionalInternalIncludeEntry & {
|
|
13
13
|
ignore: string[];
|
|
14
14
|
};
|
|
15
15
|
export declare const SENTRY_SAAS_URL = "https://sentry.io";
|
|
16
|
-
export declare function normalizeUserOptions(userOptions: UserOptions):
|
|
16
|
+
export declare function normalizeUserOptions(userOptions: UserOptions): {
|
|
17
|
+
include: InternalIncludeEntry[];
|
|
18
|
+
org: string | undefined;
|
|
19
|
+
project: string | undefined;
|
|
20
|
+
release: string;
|
|
21
|
+
url: string;
|
|
22
|
+
finalize: boolean;
|
|
23
|
+
cleanArtifacts: boolean;
|
|
24
|
+
dryRun: boolean;
|
|
25
|
+
debug: boolean;
|
|
26
|
+
silent: boolean;
|
|
27
|
+
telemetry: boolean;
|
|
28
|
+
injectReleasesMap: boolean;
|
|
29
|
+
injectRelease: boolean;
|
|
30
|
+
uploadSourceMaps: boolean;
|
|
31
|
+
sourcemaps: {
|
|
32
|
+
assets: string | string[];
|
|
33
|
+
ignore?: string | string[] | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
_experiments: {
|
|
36
|
+
injectBuildInformation?: boolean | undefined;
|
|
37
|
+
};
|
|
38
|
+
authToken: string | undefined;
|
|
39
|
+
headers: Record<string, string> | undefined;
|
|
40
|
+
vcsRemote: string | undefined;
|
|
41
|
+
setCommits: (({
|
|
42
|
+
auto: true;
|
|
43
|
+
repo?: undefined;
|
|
44
|
+
commit?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
auto?: false | undefined;
|
|
47
|
+
repo: string;
|
|
48
|
+
commit: string;
|
|
49
|
+
}) & {
|
|
50
|
+
previousCommit?: string | undefined;
|
|
51
|
+
ignoreMissing?: boolean | undefined;
|
|
52
|
+
ignoreEmpty?: boolean | undefined;
|
|
53
|
+
}) | undefined;
|
|
54
|
+
deploy: {
|
|
55
|
+
env: string;
|
|
56
|
+
started?: string | number | undefined;
|
|
57
|
+
finished?: string | number | undefined;
|
|
58
|
+
time?: number | undefined;
|
|
59
|
+
name?: string | undefined;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
} | undefined;
|
|
62
|
+
releaseInjectionTargets: (string | RegExp)[] | ((filePath: string) => boolean) | undefined;
|
|
63
|
+
dist: string | undefined;
|
|
64
|
+
errorHandler: ((err: Error) => void) | undefined;
|
|
65
|
+
configFile: string | undefined;
|
|
66
|
+
};
|
|
17
67
|
/**
|
|
18
68
|
* Validates a few combinations of options that are not checked by Sentry CLI.
|
|
19
69
|
*
|
|
@@ -26,5 +76,5 @@ export declare function normalizeUserOptions(userOptions: UserOptions): Internal
|
|
|
26
76
|
*
|
|
27
77
|
* @returns `true` if the options are valid, `false` otherwise
|
|
28
78
|
*/
|
|
29
|
-
export declare function validateOptions(options:
|
|
79
|
+
export declare function validateOptions(options: NormalizedOptions, logger: Logger): boolean;
|
|
30
80
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import SentryCli, { SentryCliReleases } from "@sentry/cli";
|
|
2
|
-
import {
|
|
2
|
+
import { NormalizedOptions } from "../options-mapping";
|
|
3
3
|
import { Logger } from "./logger";
|
|
4
4
|
declare type SentryDryRunCLI = {
|
|
5
5
|
releases: Omit<SentryCliReleases, "listDeploys">;
|
|
@@ -12,5 +12,5 @@ export declare type SentryCLILike = SentryCli | SentryDryRunCLI;
|
|
|
12
12
|
* In case, users selected the `dryRun` options, this returns a stub
|
|
13
13
|
* that makes no-ops out of most CLI operations
|
|
14
14
|
*/
|
|
15
|
-
export declare function getSentryCli(internalOptions:
|
|
15
|
+
export declare function getSentryCli(internalOptions: NormalizedOptions, logger: Logger): SentryCLILike;
|
|
16
16
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NormalizedOptions } from "../options-mapping";
|
|
2
2
|
import { BuildContext } from "../types";
|
|
3
|
-
export declare function createNewRelease(options:
|
|
4
|
-
export declare function cleanArtifacts(options:
|
|
5
|
-
export declare function uploadSourceMaps(options:
|
|
6
|
-
export declare function uploadDebugIdSourcemaps(options:
|
|
7
|
-
export declare function setCommits(options:
|
|
8
|
-
export declare function finalizeRelease(options:
|
|
9
|
-
export declare function addDeploy(options:
|
|
3
|
+
export declare function createNewRelease(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
4
|
+
export declare function cleanArtifacts(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
5
|
+
export declare function uploadSourceMaps(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
6
|
+
export declare function uploadDebugIdSourcemaps(options: NormalizedOptions, ctx: BuildContext, folderPathToUpload: string, releaseName: string): Promise<void>;
|
|
7
|
+
export declare function setCommits(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
8
|
+
export declare function finalizeRelease(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
9
|
+
export declare function addDeploy(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hub, NodeClient, Span } from "@sentry/node";
|
|
2
|
-
import {
|
|
2
|
+
import { NormalizedOptions } from "../options-mapping";
|
|
3
3
|
import { BuildContext } from "../types";
|
|
4
4
|
export declare function makeSentryClient(dsn: string, allowedToSendTelemetryPromise: Promise<boolean>, userProject: string | undefined): {
|
|
5
5
|
sentryHub: Hub;
|
|
@@ -9,5 +9,5 @@ export declare function makeSentryClient(dsn: string, allowedToSendTelemetryProm
|
|
|
9
9
|
* Adds a span to the passed parentSpan or to the current transaction that's on the passed hub's scope.
|
|
10
10
|
*/
|
|
11
11
|
export declare function addSpanToTransaction(ctx: BuildContext, op?: string, description?: string): Span | undefined;
|
|
12
|
-
export declare function addPluginOptionInformationToHub(options:
|
|
13
|
-
export declare function shouldSendTelemetry(options:
|
|
12
|
+
export declare function addPluginOptionInformationToHub(options: NormalizedOptions, hub: Hub, bundler: "rollup" | "webpack" | "vite" | "esbuild"): void;
|
|
13
|
+
export declare function shouldSendTelemetry(options: NormalizedOptions): Promise<boolean>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -77,9 +77,9 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
77
77
|
* types can be uploaded by using the `ext` option.
|
|
78
78
|
* Each path can be given as a string or an object with path-specific options
|
|
79
79
|
*
|
|
80
|
-
*
|
|
80
|
+
* @deprecated Use the `sourcemaps` option instead.
|
|
81
81
|
*/
|
|
82
|
-
include
|
|
82
|
+
include?: string | IncludeEntry | Array<string | IncludeEntry>;
|
|
83
83
|
/**
|
|
84
84
|
* Version control system remote name.
|
|
85
85
|
*
|
|
@@ -181,8 +181,34 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
181
181
|
* Defaults to `true`.
|
|
182
182
|
*/
|
|
183
183
|
uploadSourceMaps?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Options for source maps uploading.
|
|
186
|
+
*/
|
|
187
|
+
sourcemaps?: {
|
|
188
|
+
/**
|
|
189
|
+
* A glob or an array of globs that specify the build artifacts that should be uploaded to Sentry.
|
|
190
|
+
* Leave this option undefined if you do not want to upload source maps to Sentry.
|
|
191
|
+
*
|
|
192
|
+
* The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob)
|
|
193
|
+
*
|
|
194
|
+
* Use the `debug` option to print information about which files end up being uploaded.
|
|
195
|
+
*/
|
|
196
|
+
assets: string | string[];
|
|
197
|
+
/**
|
|
198
|
+
* A glob or an array of globs that specify which build artifacts should not be uploaded to Sentry.
|
|
199
|
+
*
|
|
200
|
+
* Default: `[]`
|
|
201
|
+
*
|
|
202
|
+
* The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob)
|
|
203
|
+
*
|
|
204
|
+
* Use the `debug` option to print information about which files end up being uploaded.
|
|
205
|
+
*/
|
|
206
|
+
ignore?: string | string[];
|
|
207
|
+
};
|
|
184
208
|
/**
|
|
185
209
|
* Options that are considered experimental and subject to change.
|
|
210
|
+
*
|
|
211
|
+
* @experimental API may change in any release
|
|
186
212
|
*/
|
|
187
213
|
_experiments?: {
|
|
188
214
|
/**
|
|
@@ -192,23 +218,6 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
192
218
|
* Defaults to `false`.
|
|
193
219
|
*/
|
|
194
220
|
injectBuildInformation?: boolean;
|
|
195
|
-
/**
|
|
196
|
-
* Configuration for debug ID upload.
|
|
197
|
-
*
|
|
198
|
-
* Note: Currently only functional for Vite and Rollup.
|
|
199
|
-
*/
|
|
200
|
-
debugIdUpload?: {
|
|
201
|
-
/**
|
|
202
|
-
* Glob paths to files that should get be injected with a debug ID and uploaded.
|
|
203
|
-
*/
|
|
204
|
-
include: string | string[];
|
|
205
|
-
/**
|
|
206
|
-
* Glob paths to files that should be ignored for debug ID injection and upload.
|
|
207
|
-
*
|
|
208
|
-
* Default: `[]`
|
|
209
|
-
*/
|
|
210
|
-
ignore?: string | string[];
|
|
211
|
-
};
|
|
212
221
|
};
|
|
213
222
|
};
|
|
214
223
|
export declare type IncludeEntry = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/bundler-plugin-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Sentry Bundler Plugin Core",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/bundler-plugin-core",
|
|
@@ -11,8 +11,24 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
|
-
"sentry-release-injection-file.js"
|
|
14
|
+
"sentry-release-injection-file.js",
|
|
15
|
+
"sentry-esbuild-debugid-injection-file.js"
|
|
15
16
|
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/esm/index.mjs",
|
|
20
|
+
"require": "./dist/cjs/index.js",
|
|
21
|
+
"types": "./dist/types/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./sentry-release-injection-file": {
|
|
24
|
+
"import": "./sentry-release-injection-file.js",
|
|
25
|
+
"require": "./sentry-release-injection-file.js"
|
|
26
|
+
},
|
|
27
|
+
"./sentry-esbuild-debugid-injection-file": {
|
|
28
|
+
"import": "./sentry-esbuild-debugid-injection-file.js",
|
|
29
|
+
"require": "./sentry-esbuild-debugid-injection-file.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
16
32
|
"main": "dist/cjs/index.js",
|
|
17
33
|
"module": "dist/esm/index.mjs",
|
|
18
34
|
"types": "dist/types/index.d.ts",
|
|
@@ -42,7 +58,8 @@
|
|
|
42
58
|
"find-up": "5.0.0",
|
|
43
59
|
"glob": "9.3.2",
|
|
44
60
|
"magic-string": "0.27.0",
|
|
45
|
-
"unplugin": "1.0.1"
|
|
61
|
+
"unplugin": "1.0.1",
|
|
62
|
+
"webpack-sources": "3.2.3"
|
|
46
63
|
},
|
|
47
64
|
"devDependencies": {
|
|
48
65
|
"@babel/core": "7.18.5",
|
|
@@ -53,8 +70,8 @@
|
|
|
53
70
|
"@rollup/plugin-json": "4.1.0",
|
|
54
71
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
55
72
|
"@rollup/plugin-replace": "^4.0.0",
|
|
56
|
-
"@sentry-internal/eslint-config": "0.
|
|
57
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.
|
|
73
|
+
"@sentry-internal/eslint-config": "0.7.0",
|
|
74
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.7.0",
|
|
58
75
|
"@swc/core": "^1.2.205",
|
|
59
76
|
"@swc/jest": "^0.2.21",
|
|
60
77
|
"@types/jest": "^28.1.3",
|
|
@@ -70,5 +87,9 @@
|
|
|
70
87
|
},
|
|
71
88
|
"engines": {
|
|
72
89
|
"node": ">= 10"
|
|
73
|
-
}
|
|
90
|
+
},
|
|
91
|
+
"sideEffects": [
|
|
92
|
+
"./sentry-release-injection-file.js",
|
|
93
|
+
"./sentry-esbuild-debugid-injection-file.js"
|
|
94
|
+
]
|
|
74
95
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
try {
|
|
2
|
+
var globalObject =
|
|
3
|
+
"undefined" != typeof window
|
|
4
|
+
? window
|
|
5
|
+
: "undefined" != typeof global
|
|
6
|
+
? global
|
|
7
|
+
: "undefined" != typeof self
|
|
8
|
+
? self
|
|
9
|
+
: {};
|
|
10
|
+
|
|
11
|
+
var stack = new Error().stack;
|
|
12
|
+
|
|
13
|
+
if (stack) {
|
|
14
|
+
globalObject._sentryDebugIds = globalObject._sentryDebugIds || {};
|
|
15
|
+
globalObject._sentryDebugIds[stack] = "__SENTRY_DEBUG_ID__";
|
|
16
|
+
globalObject._sentryDebugIdIdentifier = "sentry-dbid-__SENTRY_DEBUG_ID__";
|
|
17
|
+
}
|
|
18
|
+
} catch (e) {}
|