@sentry/bundler-plugin-core 0.3.0 → 0.5.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 +822 -214
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +799 -216
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/debug-id.d.ts +6 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/options-mapping.d.ts +2 -2
- package/dist/types/sentry/releasePipeline.d.ts +1 -0
- package/dist/types/types.d.ts +43 -11
- package/dist/types/utils.d.ts +21 -0
- package/package.json +9 -12
- package/sentry-release-injection-file.js +4 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Logger } from "./sentry/logger";
|
|
2
|
+
export declare function injectDebugIdSnippetIntoChunk(code: string): {
|
|
3
|
+
code: string;
|
|
4
|
+
map: import("magic-string").SourceMap;
|
|
5
|
+
};
|
|
6
|
+
export declare function prepareBundleForDebugIdUpload(bundleFilePath: string, uploadFolder: string, uniqueUploadName: string, logger: Logger): Promise<[void, void] | undefined>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { Options } from "./types";
|
|
2
2
|
import "@sentry/tracing";
|
|
3
|
+
export declare function getBuildInformation(): {
|
|
4
|
+
deps: string[];
|
|
5
|
+
depsVersions: Record<string, number>;
|
|
6
|
+
nodeVersion: number | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Determines whether the Sentry CLI binary is in its expected location.
|
|
10
|
+
* This function is useful since `@sentry/cli` installs the binary via a post-install
|
|
11
|
+
* script and post-install scripts may not always run. E.g. with `npm i --ignore-scripts`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sentryCliBinaryExists(): boolean;
|
|
3
14
|
export declare const sentryVitePlugin: (options: Options) => any;
|
|
4
15
|
export declare const sentryRollupPlugin: (options: Options) => any;
|
|
5
16
|
export declare const sentryWebpackPlugin: (options: Options) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from "./sentry/logger";
|
|
2
2
|
import { IncludeEntry as UserIncludeEntry, Options as UserOptions } from "./types";
|
|
3
|
-
declare type RequiredInternalOptions = Required<Pick<UserOptions, "finalize" | "dryRun" | "debug" | "silent" | "cleanArtifacts" | "telemetry" | "injectReleasesMap">>;
|
|
4
|
-
declare type OptionalInternalOptions = Partial<Pick<UserOptions, "org" | "project" | "authToken" | "url" | "vcsRemote" | "dist" | "errorHandler" | "setCommits" | "deploy" | "configFile" | "
|
|
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">>;
|
|
5
5
|
declare type NormalizedInternalOptions = {
|
|
6
6
|
releaseInjectionTargets: (string | RegExp)[] | ((filePath: string) => boolean) | undefined;
|
|
7
7
|
include: InternalIncludeEntry[];
|
|
@@ -3,6 +3,7 @@ import { BuildContext } from "../types";
|
|
|
3
3
|
export declare function createNewRelease(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
4
4
|
export declare function cleanArtifacts(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
5
5
|
export declare function uploadSourceMaps(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
6
|
+
export declare function uploadDebugIdSourcemaps(options: InternalOptions, ctx: BuildContext, folderPathToUpload: string, releaseName: string): Promise<void>;
|
|
6
7
|
export declare function setCommits(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
7
8
|
export declare function finalizeRelease(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
|
8
9
|
export declare function addDeploy(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -60,9 +60,8 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
60
60
|
* if the release should be injected into the module and `false` otherwise. String
|
|
61
61
|
* values of this option require a full match with the absolute path of the module.
|
|
62
62
|
*
|
|
63
|
-
* By default, the release will be injected into all
|
|
64
|
-
*
|
|
65
|
-
* If release injection should be disabled, provide an empty array here.
|
|
63
|
+
* By default, the release will be injected into all entrypoints. If release
|
|
64
|
+
* injection should be disabled, provide an empty array here.
|
|
66
65
|
*/
|
|
67
66
|
releaseInjectionTargets?: (string | RegExp)[] | RegExp | string | ((filePath: string) => boolean);
|
|
68
67
|
/**
|
|
@@ -89,16 +88,8 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
89
88
|
* Defaults to 'origin'.
|
|
90
89
|
*/
|
|
91
90
|
vcsRemote?: string;
|
|
92
|
-
/**
|
|
93
|
-
* A header added to every outgoing network request.
|
|
94
|
-
* The format should be `header-key: header-value`.
|
|
95
|
-
*
|
|
96
|
-
* This value can also be specified via the `CUSTOM_HEADER` environment variable.
|
|
97
|
-
*/
|
|
98
|
-
customHeader?: string;
|
|
99
91
|
/**
|
|
100
92
|
* Headers added to every outgoing network request.
|
|
101
|
-
* This value does not set any env variable, and is overridden by customHeader.
|
|
102
93
|
*/
|
|
103
94
|
headers?: Record<string, string>;
|
|
104
95
|
/**
|
|
@@ -170,6 +161,12 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
170
161
|
* defaults from ~/.sentryclirc are always loaded
|
|
171
162
|
*/
|
|
172
163
|
configFile?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Whether the plugin should inject release information into the build.
|
|
166
|
+
*
|
|
167
|
+
* Defaults to `true`.
|
|
168
|
+
*/
|
|
169
|
+
injectRelease?: boolean;
|
|
173
170
|
/**
|
|
174
171
|
* If set to true, the plugin will inject an additional `SENTRY_RELEASES` variable that
|
|
175
172
|
* maps from `{org}@{project}` to the `release` value. This might be helpful for webpack
|
|
@@ -178,6 +175,41 @@ export declare type Options = Omit<IncludeEntry, "paths"> & {
|
|
|
178
175
|
* Defaults to `false`.
|
|
179
176
|
*/
|
|
180
177
|
injectReleasesMap?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Whether the plugin should upload source maps to Sentry.
|
|
180
|
+
*
|
|
181
|
+
* Defaults to `true`.
|
|
182
|
+
*/
|
|
183
|
+
uploadSourceMaps?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Options that are considered experimental and subject to change.
|
|
186
|
+
*/
|
|
187
|
+
_experiments?: {
|
|
188
|
+
/**
|
|
189
|
+
* If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable.
|
|
190
|
+
* This contains information about the build, e.g. dependencies, node version and other useful data.
|
|
191
|
+
*
|
|
192
|
+
* Defaults to `false`.
|
|
193
|
+
*/
|
|
194
|
+
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
|
+
};
|
|
181
213
|
};
|
|
182
214
|
export declare type IncludeEntry = {
|
|
183
215
|
/**
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -5,3 +5,24 @@
|
|
|
5
5
|
* @returns The input, if already an array, or an array with the input as the only element, if not
|
|
6
6
|
*/
|
|
7
7
|
export declare function arrayify<T = unknown>(maybeArray: T | T[]): T[];
|
|
8
|
+
declare type PackageJson = Record<string, unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* Get the closes package.json from a given starting point upwards.
|
|
11
|
+
* This handles a few edge cases:
|
|
12
|
+
* * Check if a given file package.json appears to be an actual NPM package.json file
|
|
13
|
+
* * Stop at the home dir, to avoid looking too deeply
|
|
14
|
+
*/
|
|
15
|
+
export declare function getPackageJson({ cwd, stopAt }?: {
|
|
16
|
+
cwd?: string;
|
|
17
|
+
stopAt?: string;
|
|
18
|
+
}): PackageJson | undefined;
|
|
19
|
+
export declare function parseMajorVersion(version: string): number | undefined;
|
|
20
|
+
export declare function getDependencies(packageJson: PackageJson): {
|
|
21
|
+
deps: string[];
|
|
22
|
+
depsVersions: Record<string, number>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Deterministically hashes a string and turns the hash into a uuid.
|
|
26
|
+
*/
|
|
27
|
+
export declare function stringToUUID(str: string): string;
|
|
28
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/bundler-plugin-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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",
|
|
@@ -10,14 +10,9 @@
|
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"sentry-release-injection-file.js"
|
|
14
15
|
],
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"import": "./dist/esm/index.mjs",
|
|
18
|
-
"require": "./dist/cjs/index.js"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
16
|
"main": "dist/cjs/index.js",
|
|
22
17
|
"module": "dist/esm/index.mjs",
|
|
23
18
|
"types": "dist/types/index.d.ts",
|
|
@@ -41,11 +36,13 @@
|
|
|
41
36
|
"fix": "eslint ./src ./test --format stylish --fix"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
44
|
-
"@sentry/cli": "^2.
|
|
39
|
+
"@sentry/cli": "^2.17.0",
|
|
45
40
|
"@sentry/node": "^7.19.0",
|
|
46
41
|
"@sentry/tracing": "^7.19.0",
|
|
42
|
+
"find-up": "5.0.0",
|
|
43
|
+
"glob": "9.3.2",
|
|
47
44
|
"magic-string": "0.27.0",
|
|
48
|
-
"unplugin": "0.
|
|
45
|
+
"unplugin": "1.0.1"
|
|
49
46
|
},
|
|
50
47
|
"devDependencies": {
|
|
51
48
|
"@babel/core": "7.18.5",
|
|
@@ -56,8 +53,8 @@
|
|
|
56
53
|
"@rollup/plugin-json": "4.1.0",
|
|
57
54
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
58
55
|
"@rollup/plugin-replace": "^4.0.0",
|
|
59
|
-
"@sentry-internal/eslint-config": "0.
|
|
60
|
-
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.
|
|
56
|
+
"@sentry-internal/eslint-config": "0.5.0",
|
|
57
|
+
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.5.0",
|
|
61
58
|
"@swc/core": "^1.2.205",
|
|
62
59
|
"@swc/jest": "^0.2.21",
|
|
63
60
|
"@types/jest": "^28.1.3",
|