@sentry/bundler-plugin-core
Advanced tools
Comparing version 0.6.0 to 0.7.0
import { Logger } from "./sentry/logger"; | ||
import { IncludeEntry as UserIncludeEntry, Options as UserOptions } from "./types"; | ||
declare type RequiredInternalOptions = Required<Pick<UserOptions, "finalize" | "dryRun" | "debug" | "silent" | "cleanArtifacts" | "telemetry" | "injectReleasesMap" | "_experiments" | "injectRelease" | "uploadSourceMaps">>; | ||
declare type OptionalInternalOptions = Partial<Pick<UserOptions, "org" | "project" | "authToken" | "url" | "vcsRemote" | "dist" | "errorHandler" | "setCommits" | "deploy" | "configFile" | "headers">>; | ||
declare type OptionalInternalOptions = Partial<Pick<UserOptions, "org" | "project" | "authToken" | "url" | "vcsRemote" | "dist" | "errorHandler" | "setCommits" | "deploy" | "configFile" | "headers" | "sourcemaps">>; | ||
declare type NormalizedInternalOptions = { | ||
@@ -9,3 +9,3 @@ releaseInjectionTargets: (string | RegExp)[] | ((filePath: string) => boolean) | undefined; | ||
}; | ||
export declare type InternalOptions = RequiredInternalOptions & OptionalInternalOptions & NormalizedInternalOptions; | ||
export declare type NormalizedOptions = RequiredInternalOptions & OptionalInternalOptions & NormalizedInternalOptions; | ||
declare type RequiredInternalIncludeEntry = Required<Pick<UserIncludeEntry, "paths" | "ext" | "stripCommonPrefix" | "sourceMapReference" | "rewrite" | "validate">>; | ||
@@ -17,3 +17,53 @@ declare type OptionalInternalIncludeEntry = Partial<Pick<UserIncludeEntry, "ignoreFile" | "urlPrefix" | "urlSuffix" | "stripPrefix">>; | ||
export declare const SENTRY_SAAS_URL = "https://sentry.io"; | ||
export declare function normalizeUserOptions(userOptions: UserOptions): InternalOptions; | ||
export declare function normalizeUserOptions(userOptions: UserOptions): { | ||
include: InternalIncludeEntry[]; | ||
org: string | undefined; | ||
project: string | undefined; | ||
release: string; | ||
url: string; | ||
finalize: boolean; | ||
cleanArtifacts: boolean; | ||
dryRun: boolean; | ||
debug: boolean; | ||
silent: boolean; | ||
telemetry: boolean; | ||
injectReleasesMap: boolean; | ||
injectRelease: boolean; | ||
uploadSourceMaps: boolean; | ||
sourcemaps: { | ||
assets: string | string[]; | ||
ignore?: string | string[] | undefined; | ||
} | undefined; | ||
_experiments: { | ||
injectBuildInformation?: boolean | undefined; | ||
}; | ||
authToken: string | undefined; | ||
headers: Record<string, string> | undefined; | ||
vcsRemote: string | undefined; | ||
setCommits: (({ | ||
auto: true; | ||
repo?: undefined; | ||
commit?: undefined; | ||
} | { | ||
auto?: false | undefined; | ||
repo: string; | ||
commit: string; | ||
}) & { | ||
previousCommit?: string | undefined; | ||
ignoreMissing?: boolean | undefined; | ||
ignoreEmpty?: boolean | undefined; | ||
}) | undefined; | ||
deploy: { | ||
env: string; | ||
started?: string | number | undefined; | ||
finished?: string | number | undefined; | ||
time?: number | undefined; | ||
name?: string | undefined; | ||
url?: string | undefined; | ||
} | undefined; | ||
releaseInjectionTargets: (string | RegExp)[] | ((filePath: string) => boolean) | undefined; | ||
dist: string | undefined; | ||
errorHandler: ((err: Error) => void) | undefined; | ||
configFile: string | undefined; | ||
}; | ||
/** | ||
@@ -31,3 +81,3 @@ * Validates a few combinations of options that are not checked by Sentry CLI. | ||
*/ | ||
export declare function validateOptions(options: InternalOptions, logger: Logger): boolean; | ||
export declare function validateOptions(options: NormalizedOptions, logger: Logger): boolean; | ||
export {}; |
import SentryCli, { SentryCliReleases } from "@sentry/cli"; | ||
import { InternalOptions } from "../options-mapping"; | ||
import { NormalizedOptions } from "../options-mapping"; | ||
import { Logger } from "./logger"; | ||
@@ -15,3 +15,3 @@ declare type SentryDryRunCLI = { | ||
*/ | ||
export declare function getSentryCli(internalOptions: InternalOptions, logger: Logger): SentryCLILike; | ||
export declare function getSentryCli(internalOptions: NormalizedOptions, logger: Logger): SentryCLILike; | ||
export {}; |
@@ -1,9 +0,9 @@ | ||
import { InternalOptions } from "../options-mapping"; | ||
import { NormalizedOptions } from "../options-mapping"; | ||
import { BuildContext } from "../types"; | ||
export declare function createNewRelease(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function cleanArtifacts(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function uploadSourceMaps(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function uploadDebugIdSourcemaps(options: InternalOptions, ctx: BuildContext, folderPathToUpload: string, releaseName: string): Promise<void>; | ||
export declare function setCommits(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function finalizeRelease(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function addDeploy(options: InternalOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function createNewRelease(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function cleanArtifacts(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function uploadSourceMaps(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function uploadDebugIdSourcemaps(options: NormalizedOptions, ctx: BuildContext, folderPathToUpload: string, releaseName: string): Promise<void>; | ||
export declare function setCommits(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function finalizeRelease(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; | ||
export declare function addDeploy(options: NormalizedOptions, ctx: BuildContext, releaseName: string): Promise<void>; |
import { Hub, NodeClient, Span } from "@sentry/node"; | ||
import { InternalOptions } from "../options-mapping"; | ||
import { NormalizedOptions } from "../options-mapping"; | ||
import { BuildContext } from "../types"; | ||
@@ -12,3 +12,3 @@ export declare function makeSentryClient(dsn: string, allowedToSendTelemetryPromise: Promise<boolean>, userProject: string | undefined): { | ||
export declare function addSpanToTransaction(ctx: BuildContext, op?: string, description?: string): Span | undefined; | ||
export declare function addPluginOptionInformationToHub(options: InternalOptions, hub: Hub, bundler: "rollup" | "webpack" | "vite" | "esbuild"): void; | ||
export declare function shouldSendTelemetry(options: InternalOptions): Promise<boolean>; | ||
export declare function addPluginOptionInformationToHub(options: NormalizedOptions, hub: Hub, bundler: "rollup" | "webpack" | "vite" | "esbuild"): void; | ||
export declare function shouldSendTelemetry(options: NormalizedOptions): Promise<boolean>; |
@@ -80,5 +80,5 @@ import { Hub } from "@sentry/core"; | ||
* | ||
* This is a required field. | ||
* @deprecated Use the `sourcemaps` option instead. | ||
*/ | ||
include: string | IncludeEntry | Array<string | IncludeEntry>; | ||
include?: string | IncludeEntry | Array<string | IncludeEntry>; | ||
/** | ||
@@ -186,3 +186,29 @@ * Version control system remote name. | ||
/** | ||
* Options for source maps uploading. | ||
*/ | ||
sourcemaps?: { | ||
/** | ||
* A glob or an array of globs that specify the build artifacts that should be uploaded to Sentry. | ||
* Leave this option undefined if you do not want to upload source maps to Sentry. | ||
* | ||
* The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob) | ||
* | ||
* Use the `debug` option to print information about which files end up being uploaded. | ||
*/ | ||
assets: string | string[]; | ||
/** | ||
* A glob or an array of globs that specify which build artifacts should not be uploaded to Sentry. | ||
* | ||
* Default: `[]` | ||
* | ||
* The globbing patterns follow the implementation of the `glob` package. (https://www.npmjs.com/package/glob) | ||
* | ||
* Use the `debug` option to print information about which files end up being uploaded. | ||
*/ | ||
ignore?: string | string[]; | ||
}; | ||
/** | ||
* Options that are considered experimental and subject to change. | ||
* | ||
* @experimental API may change in any release | ||
*/ | ||
@@ -197,19 +223,2 @@ _experiments?: { | ||
injectBuildInformation?: boolean; | ||
/** | ||
* Configuration for debug ID upload. | ||
* | ||
* Note: Currently only functional for Vite, Webpack and Rollup. | ||
*/ | ||
debugIdUpload?: { | ||
/** | ||
* Glob paths to files that should get be injected with a debug ID and uploaded. | ||
*/ | ||
include: string | string[]; | ||
/** | ||
* Glob paths to files that should be ignored for debug ID injection and upload. | ||
* | ||
* Default: `[]` | ||
*/ | ||
ignore?: string | string[]; | ||
}; | ||
}; | ||
@@ -216,0 +225,0 @@ }; |
{ | ||
"name": "@sentry/bundler-plugin-core", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Sentry Bundler Plugin Core", | ||
@@ -14,4 +14,20 @@ "repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git", | ||
"dist", | ||
"sentry-release-injection-file.js" | ||
"sentry-release-injection-file.js", | ||
"sentry-esbuild-debugid-injection-file.js" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.mjs", | ||
"require": "./dist/cjs/index.js", | ||
"types": "./dist/types/index.d.ts" | ||
}, | ||
"./sentry-release-injection-file": { | ||
"import": "./sentry-release-injection-file.js", | ||
"require": "./sentry-release-injection-file.js" | ||
}, | ||
"./sentry-esbuild-debugid-injection-file": { | ||
"import": "./sentry-esbuild-debugid-injection-file.js", | ||
"require": "./sentry-esbuild-debugid-injection-file.js" | ||
} | ||
}, | ||
"main": "dist/cjs/index.js", | ||
@@ -58,4 +74,4 @@ "module": "dist/esm/index.mjs", | ||
"@rollup/plugin-replace": "^4.0.0", | ||
"@sentry-internal/eslint-config": "0.6.0", | ||
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.6.0", | ||
"@sentry-internal/eslint-config": "0.7.0", | ||
"@sentry-internal/sentry-bundler-plugin-tsconfig": "0.7.0", | ||
"@swc/core": "^1.2.205", | ||
@@ -76,3 +92,7 @@ "@swc/jest": "^0.2.21", | ||
"node": ">= 10" | ||
} | ||
}, | ||
"sideEffects": [ | ||
"./sentry-release-injection-file.js", | ||
"./sentry-esbuild-debugid-injection-file.js" | ||
] | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
566349
18
5431