@sentry/bundler-plugin-core 2.23.0 → 3.1.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 +20 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +20 -22
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/options-mapping.d.ts +2 -6
- package/dist/types/options-mapping.d.ts.map +1 -1
- package/dist/types/sentry/telemetry.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -48
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/sentry-esbuild-debugid-injection-file.js +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -686,11 +686,12 @@ function generateGlobalInjectorCode(_ref2) {
|
|
|
686
686
|
injectBuildInformation = _ref2.injectBuildInformation;
|
|
687
687
|
// The code below is mostly ternary operators because it saves bundle size.
|
|
688
688
|
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
|
|
689
|
-
var code = "\n
|
|
689
|
+
var code = "{\n let _global =\n typeof window !== 'undefined' ?\n window :\n typeof global !== 'undefined' ?\n global :\n typeof globalThis !== 'undefined' ?\n globalThis :\n typeof self !== 'undefined' ?\n self :\n {};\n\n _global.SENTRY_RELEASE={id:".concat(JSON.stringify(release), "};");
|
|
690
690
|
if (injectBuildInformation) {
|
|
691
691
|
var buildInfo = getBuildInformation$1();
|
|
692
692
|
code += "\n _global.SENTRY_BUILD_INFO=".concat(JSON.stringify(buildInfo), ";");
|
|
693
693
|
}
|
|
694
|
+
code += "}";
|
|
694
695
|
return code;
|
|
695
696
|
}
|
|
696
697
|
|
|
@@ -699,7 +700,7 @@ function generateModuleMetadataInjectorCode(metadata) {
|
|
|
699
700
|
// The code below is mostly ternary operators because it saves bundle size.
|
|
700
701
|
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
|
|
701
702
|
// We are merging the metadata objects in case modules are bundled twice with the plugin
|
|
702
|
-
return "{\n
|
|
703
|
+
return "{\n let _sentryModuleMetadataGlobal =\n typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\n : typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof self !== \"undefined\"\n ? self\n : {};\n\n _sentryModuleMetadataGlobal._sentryModuleMetadata =\n _sentryModuleMetadataGlobal._sentryModuleMetadata || {};\n\n _sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack] =\n Object.assign(\n {},\n _sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack],\n ".concat(JSON.stringify(metadata), "\n );\n}");
|
|
703
704
|
}
|
|
704
705
|
function getBuildInformation$1() {
|
|
705
706
|
var packageJson = getPackageJson();
|
|
@@ -740,7 +741,7 @@ function replaceBooleanFlagsInCode(code, replacementValues) {
|
|
|
740
741
|
|
|
741
742
|
var SENTRY_SAAS_URL = "https://sentry.io";
|
|
742
743
|
function normalizeUserOptions(userOptions) {
|
|
743
|
-
var _userOptions$org, _userOptions$project, _userOptions$authToke, _ref, _userOptions$url, _userOptions$debug, _userOptions$silent, _userOptions$telemetr, _userOptions$disable, _ref2, _userOptions$release$, _userOptions$release, _userOptions$release$2, _userOptions$release2, _userOptions$release$3, _userOptions$release3, _userOptions$release$4, _userOptions$release4, _ref3, _userOptions$release$5, _userOptions$release5, _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$_experim
|
|
744
|
+
var _userOptions$org, _userOptions$project, _userOptions$authToke, _ref, _userOptions$url, _userOptions$debug, _userOptions$silent, _userOptions$telemetr, _userOptions$disable, _ref2, _userOptions$release$, _userOptions$release, _userOptions$release$2, _userOptions$release2, _userOptions$release$3, _userOptions$release3, _userOptions$release$4, _userOptions$release4, _ref3, _userOptions$release$5, _userOptions$release5, _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$_experim;
|
|
744
745
|
var options = {
|
|
745
746
|
org: (_userOptions$org = userOptions.org) !== null && _userOptions$org !== void 0 ? _userOptions$org : process.env["SENTRY_ORG"],
|
|
746
747
|
project: (_userOptions$project = userOptions.project) !== null && _userOptions$project !== void 0 ? _userOptions$project : process.env["SENTRY_PROJECT"],
|
|
@@ -768,8 +769,8 @@ function normalizeUserOptions(userOptions) {
|
|
|
768
769
|
}
|
|
769
770
|
},
|
|
770
771
|
applicationKey: userOptions.applicationKey,
|
|
771
|
-
moduleMetadata: userOptions.moduleMetadata
|
|
772
|
-
_experiments: (_userOptions$
|
|
772
|
+
moduleMetadata: userOptions.moduleMetadata,
|
|
773
|
+
_experiments: (_userOptions$_experim = userOptions._experiments) !== null && _userOptions$_experim !== void 0 ? _userOptions$_experim : {}
|
|
773
774
|
};
|
|
774
775
|
return options;
|
|
775
776
|
}
|
|
@@ -8110,7 +8111,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
8110
8111
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
8111
8112
|
tracesSampleRate: 1,
|
|
8112
8113
|
sampleRate: 1,
|
|
8113
|
-
release: "
|
|
8114
|
+
release: "3.1.0",
|
|
8114
8115
|
integrations: [],
|
|
8115
8116
|
tracePropagationTargets: ["sentry.io/api"],
|
|
8116
8117
|
stackParser: stackParser,
|
|
@@ -8167,7 +8168,7 @@ function setTelemetryDataOnScope(options, scope, bundler) {
|
|
|
8167
8168
|
// Miscellaneous options
|
|
8168
8169
|
scope.setTag("custom-error-handler", !!errorHandler);
|
|
8169
8170
|
scope.setTag("sourcemaps-assets", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.assets));
|
|
8170
|
-
scope.setTag("delete-after-upload", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.
|
|
8171
|
+
scope.setTag("delete-after-upload", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.filesToDeleteAfterUpload));
|
|
8171
8172
|
scope.setTag("sourcemaps-disabled", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.disable));
|
|
8172
8173
|
scope.setTag("react-annotate", !!(reactComponentAnnotation !== null && reactComponentAnnotation !== void 0 && reactComponentAnnotation.enabled));
|
|
8173
8174
|
scope.setTag("node", process.version);
|
|
@@ -8951,7 +8952,7 @@ function createLogger(options) {
|
|
|
8951
8952
|
params[_key - 1] = arguments[_key];
|
|
8952
8953
|
}
|
|
8953
8954
|
// eslint-disable-next-line no-console
|
|
8954
|
-
(_console = console).
|
|
8955
|
+
(_console = console).info.apply(_console, ["".concat(options.prefix, " Info: ").concat(message)].concat(params));
|
|
8955
8956
|
}
|
|
8956
8957
|
},
|
|
8957
8958
|
warn: function warn(message) {
|
|
@@ -8961,7 +8962,7 @@ function createLogger(options) {
|
|
|
8961
8962
|
params[_key2 - 1] = arguments[_key2];
|
|
8962
8963
|
}
|
|
8963
8964
|
// eslint-disable-next-line no-console
|
|
8964
|
-
(_console2 = console).
|
|
8965
|
+
(_console2 = console).warn.apply(_console2, ["".concat(options.prefix, " Warning: ").concat(message)].concat(params));
|
|
8965
8966
|
}
|
|
8966
8967
|
},
|
|
8967
8968
|
error: function error(message) {
|
|
@@ -8981,7 +8982,7 @@ function createLogger(options) {
|
|
|
8981
8982
|
params[_key4 - 1] = arguments[_key4];
|
|
8982
8983
|
}
|
|
8983
8984
|
// eslint-disable-next-line no-console
|
|
8984
|
-
(_console4 = console).
|
|
8985
|
+
(_console4 = console).debug.apply(_console4, ["".concat(options.prefix, " Debug: ").concat(message)].concat(params));
|
|
8985
8986
|
}
|
|
8986
8987
|
}
|
|
8987
8988
|
};
|
|
@@ -9085,7 +9086,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9085
9086
|
debugIdUploadPlugin = _ref.debugIdUploadPlugin,
|
|
9086
9087
|
bundleSizeOptimizationsPlugin = _ref.bundleSizeOptimizationsPlugin;
|
|
9087
9088
|
return unplugin.createUnplugin(function () {
|
|
9088
|
-
var _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$silent, _userOptions$debug,
|
|
9089
|
+
var _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$silent, _userOptions$debug, _options$sourcemaps, _options$sourcemaps2, _options$sourcemaps6;
|
|
9089
9090
|
var userOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9090
9091
|
var unpluginMetaContext = arguments.length > 1 ? arguments[1] : undefined;
|
|
9091
9092
|
var logger = createLogger({
|
|
@@ -9109,11 +9110,6 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9109
9110
|
}
|
|
9110
9111
|
}
|
|
9111
9112
|
var options = normalizeUserOptions(userOptions);
|
|
9112
|
-
|
|
9113
|
-
// TODO(v3): Remove this warning
|
|
9114
|
-
if ((_userOptions$_experim = userOptions._experiments) !== null && _userOptions$_experim !== void 0 && _userOptions$_experim.moduleMetadata) {
|
|
9115
|
-
logger.warn("The `_experiments.moduleMetadata` option has been promoted to being stable. You can safely move the option out of the `_experiments` object scope.");
|
|
9116
|
-
}
|
|
9117
9113
|
if (unpluginMetaContext.watchMode || options.disable) {
|
|
9118
9114
|
return [{
|
|
9119
9115
|
name: "sentry-noop-plugin"
|
|
@@ -9151,7 +9147,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9151
9147
|
});
|
|
9152
9148
|
|
|
9153
9149
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
9154
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "
|
|
9150
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "3.1.0");
|
|
9155
9151
|
function handleRecoverableError(unknownError) {
|
|
9156
9152
|
sentrySession.status = "abnormal";
|
|
9157
9153
|
try {
|
|
@@ -9234,8 +9230,8 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9234
9230
|
if (bundleSizeOptimizations.excludeDebugStatements) {
|
|
9235
9231
|
replacementValues["__SENTRY_DEBUG__"] = false;
|
|
9236
9232
|
}
|
|
9237
|
-
if (bundleSizeOptimizations.
|
|
9238
|
-
replacementValues["
|
|
9233
|
+
if (bundleSizeOptimizations.excludeTracing) {
|
|
9234
|
+
replacementValues["__SENTRY_TRACING__"] = false;
|
|
9239
9235
|
}
|
|
9240
9236
|
if (bundleSizeOptimizations.excludeReplayCanvas) {
|
|
9241
9237
|
replacementValues["__RRWEB_EXCLUDE_CANVAS__"] = true;
|
|
@@ -9336,6 +9332,8 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9336
9332
|
logger.warn("No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug.");
|
|
9337
9333
|
} else {
|
|
9338
9334
|
var _options$sourcemaps3, _options$sourcemaps4, _options$sourcemaps5;
|
|
9335
|
+
// This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
|
|
9336
|
+
var _webpack_forceExitOnBuildComplete = typeof options._experiments["forceExitOnBuildCompletion"] === "boolean" ? options._experiments["forceExitOnBuildCompletion"] : undefined;
|
|
9339
9337
|
plugins.push(debugIdUploadPlugin(createDebugIdUploadFunction({
|
|
9340
9338
|
assets: (_options$sourcemaps3 = options.sourcemaps) === null || _options$sourcemaps3 === void 0 ? void 0 : _options$sourcemaps3.assets,
|
|
9341
9339
|
ignore: (_options$sourcemaps4 = options.sourcemaps) === null || _options$sourcemaps4 === void 0 ? void 0 : _options$sourcemaps4.ignore,
|
|
@@ -9356,7 +9354,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9356
9354
|
vcsRemote: options.release.vcsRemote,
|
|
9357
9355
|
headers: options.headers
|
|
9358
9356
|
}
|
|
9359
|
-
})));
|
|
9357
|
+
}), logger, _webpack_forceExitOnBuildComplete));
|
|
9360
9358
|
}
|
|
9361
9359
|
if (options.reactComponentAnnotation) {
|
|
9362
9360
|
if (!options.reactComponentAnnotation.enabled) {
|
|
@@ -9369,7 +9367,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9369
9367
|
}
|
|
9370
9368
|
plugins.push(fileDeletionPlugin({
|
|
9371
9369
|
waitUntilSourcemapFileDependenciesAreFreed: waitUntilSourcemapFileDependenciesAreFreed,
|
|
9372
|
-
filesToDeleteAfterUpload: (_options$
|
|
9370
|
+
filesToDeleteAfterUpload: (_options$sourcemaps6 = options.sourcemaps) === null || _options$sourcemaps6 === void 0 ? void 0 : _options$sourcemaps6.filesToDeleteAfterUpload,
|
|
9373
9371
|
logger: logger,
|
|
9374
9372
|
handleRecoverableError: handleRecoverableError,
|
|
9375
9373
|
sentryScope: sentryScope,
|
|
@@ -9664,7 +9662,7 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
|
|
|
9664
9662
|
};
|
|
9665
9663
|
}
|
|
9666
9664
|
function getDebugIdSnippet(debugId) {
|
|
9667
|
-
return "
|
|
9665
|
+
return ";{try{let e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=\"".concat(debugId, "\",e._sentryDebugIdIdentifier=\"sentry-dbid-").concat(debugId, "\")}catch(e){}};");
|
|
9668
9666
|
}
|
|
9669
9667
|
|
|
9670
9668
|
exports.createComponentNameAnnotateHooks = createComponentNameAnnotateHooks;
|