@sentry/bundler-plugin-core 2.22.6 → 2.23.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 +24 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +24 -13
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/options-mapping.d.ts +1 -0
- package/dist/types/options-mapping.d.ts.map +1 -1
- package/dist/types/plugins/release-management.d.ts +5 -0
- package/dist/types/plugins/release-management.d.ts.map +1 -1
- package/dist/types/sentry/logger.d.ts.map +1 -1
- package/dist/types/sentry/telemetry.d.ts.map +1 -1
- package/dist/types/types.d.ts +4 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +5 -5
- package/sentry-esbuild-debugid-injection-file.js +2 -0
package/dist/cjs/index.js
CHANGED
|
@@ -647,6 +647,8 @@ function determineReleaseName() {
|
|
|
647
647
|
process.env["HEROKU_TEST_RUN_COMMIT_VERSION"] ||
|
|
648
648
|
// Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
|
|
649
649
|
process.env["HEROKU_SLUG_COMMIT"] ||
|
|
650
|
+
// Railway - https://docs.railway.app/reference/variables#git-variables
|
|
651
|
+
process.env["RAILWAY_GIT_COMMIT_SHA"] ||
|
|
650
652
|
// Render - https://render.com/docs/environment-variables
|
|
651
653
|
process.env["RENDER_GIT_COMMIT"] ||
|
|
652
654
|
// Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables
|
|
@@ -684,7 +686,7 @@ function generateGlobalInjectorCode(_ref2) {
|
|
|
684
686
|
injectBuildInformation = _ref2.injectBuildInformation;
|
|
685
687
|
// The code below is mostly ternary operators because it saves bundle size.
|
|
686
688
|
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
|
|
687
|
-
var code = "\n var _global =\n typeof window !== 'undefined' ?\n window :\n typeof global !== 'undefined' ?\n global :\n typeof
|
|
689
|
+
var code = "\n var _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), "};");
|
|
688
690
|
if (injectBuildInformation) {
|
|
689
691
|
var buildInfo = getBuildInformation$1();
|
|
690
692
|
code += "\n _global.SENTRY_BUILD_INFO=".concat(JSON.stringify(buildInfo), ";");
|
|
@@ -697,7 +699,7 @@ function generateModuleMetadataInjectorCode(metadata) {
|
|
|
697
699
|
// The code below is mostly ternary operators because it saves bundle size.
|
|
698
700
|
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
|
|
699
701
|
// We are merging the metadata objects in case modules are bundled twice with the plugin
|
|
700
|
-
return "{\n var _sentryModuleMetadataGlobal =\n typeof window !== \"undefined\"\n ? window\n : typeof global !== \"undefined\"\n ? global\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}");
|
|
702
|
+
return "{\n var _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}");
|
|
701
703
|
}
|
|
702
704
|
function getBuildInformation$1() {
|
|
703
705
|
var packageJson = getPackageJson();
|
|
@@ -8108,7 +8110,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
8108
8110
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
8109
8111
|
tracesSampleRate: 1,
|
|
8110
8112
|
sampleRate: 1,
|
|
8111
|
-
release: "2.
|
|
8113
|
+
release: "2.23.0",
|
|
8112
8114
|
integrations: [],
|
|
8113
8115
|
tracePropagationTargets: ["sentry.io/api"],
|
|
8114
8116
|
stackParser: stackParser,
|
|
@@ -8172,6 +8174,7 @@ function setTelemetryDataOnScope(options, scope, bundler) {
|
|
|
8172
8174
|
scope.setTag("platform", process.platform);
|
|
8173
8175
|
scope.setTag("meta-framework", (_options$_metaOptions = options._metaOptions.telemetry.metaFramework) !== null && _options$_metaOptions !== void 0 ? _options$_metaOptions : "none");
|
|
8174
8176
|
scope.setTag("application-key-set", options.applicationKey !== undefined);
|
|
8177
|
+
scope.setTag("ci", !!process.env["CI"]);
|
|
8175
8178
|
scope.setTags({
|
|
8176
8179
|
organization: org,
|
|
8177
8180
|
project: project,
|
|
@@ -8791,6 +8794,11 @@ function defaultRewriteSourcesHook(source) {
|
|
|
8791
8794
|
}
|
|
8792
8795
|
}
|
|
8793
8796
|
|
|
8797
|
+
/**
|
|
8798
|
+
* Creates a plugin that creates releases, sets commits, deploys and finalizes releases.
|
|
8799
|
+
*
|
|
8800
|
+
* Additionally, if legacy upload options are set, it uploads source maps in the legacy (non-debugId) way.
|
|
8801
|
+
*/
|
|
8794
8802
|
function releaseManagementPlugin(_ref) {
|
|
8795
8803
|
var releaseName = _ref.releaseName,
|
|
8796
8804
|
include = _ref.include,
|
|
@@ -8806,7 +8814,7 @@ function releaseManagementPlugin(_ref) {
|
|
|
8806
8814
|
createDependencyOnSourcemapFiles = _ref.createDependencyOnSourcemapFiles;
|
|
8807
8815
|
var freeGlobalDependencyOnSourcemapFiles = createDependencyOnSourcemapFiles();
|
|
8808
8816
|
return {
|
|
8809
|
-
name: "sentry-
|
|
8817
|
+
name: "sentry-release-management-plugin",
|
|
8810
8818
|
writeBundle: function writeBundle() {
|
|
8811
8819
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8812
8820
|
var freeWriteBundleInvocationDependencyOnSourcemapFiles, cliInstance, normalizedInclude;
|
|
@@ -8933,6 +8941,7 @@ function telemetryPlugin(_ref) {
|
|
|
8933
8941
|
};
|
|
8934
8942
|
}
|
|
8935
8943
|
|
|
8944
|
+
// Logging everything to stderr not to interfere with stdout
|
|
8936
8945
|
function createLogger(options) {
|
|
8937
8946
|
return {
|
|
8938
8947
|
info: function info(message) {
|
|
@@ -8942,7 +8951,7 @@ function createLogger(options) {
|
|
|
8942
8951
|
params[_key - 1] = arguments[_key];
|
|
8943
8952
|
}
|
|
8944
8953
|
// eslint-disable-next-line no-console
|
|
8945
|
-
(_console = console).
|
|
8954
|
+
(_console = console).error.apply(_console, ["".concat(options.prefix, " Info: ").concat(message)].concat(params));
|
|
8946
8955
|
}
|
|
8947
8956
|
},
|
|
8948
8957
|
warn: function warn(message) {
|
|
@@ -8952,7 +8961,7 @@ function createLogger(options) {
|
|
|
8952
8961
|
params[_key2 - 1] = arguments[_key2];
|
|
8953
8962
|
}
|
|
8954
8963
|
// eslint-disable-next-line no-console
|
|
8955
|
-
(_console2 = console).
|
|
8964
|
+
(_console2 = console).error.apply(_console2, ["".concat(options.prefix, " Warning: ").concat(message)].concat(params));
|
|
8956
8965
|
}
|
|
8957
8966
|
},
|
|
8958
8967
|
error: function error(message) {
|
|
@@ -8962,7 +8971,7 @@ function createLogger(options) {
|
|
|
8962
8971
|
params[_key3 - 1] = arguments[_key3];
|
|
8963
8972
|
}
|
|
8964
8973
|
// eslint-disable-next-line no-console
|
|
8965
|
-
(_console3 = console).
|
|
8974
|
+
(_console3 = console).error.apply(_console3, ["".concat(options.prefix, " Error: ").concat(message)].concat(params));
|
|
8966
8975
|
}
|
|
8967
8976
|
},
|
|
8968
8977
|
debug: function debug(message) {
|
|
@@ -8972,7 +8981,7 @@ function createLogger(options) {
|
|
|
8972
8981
|
params[_key4 - 1] = arguments[_key4];
|
|
8973
8982
|
}
|
|
8974
8983
|
// eslint-disable-next-line no-console
|
|
8975
|
-
(_console4 = console).
|
|
8984
|
+
(_console4 = console).error.apply(_console4, ["".concat(options.prefix, " Debug: ").concat(message)].concat(params));
|
|
8976
8985
|
}
|
|
8977
8986
|
}
|
|
8978
8987
|
};
|
|
@@ -9142,7 +9151,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9142
9151
|
});
|
|
9143
9152
|
|
|
9144
9153
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
9145
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.
|
|
9154
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.23.0");
|
|
9146
9155
|
function handleRecoverableError(unknownError) {
|
|
9147
9156
|
sentrySession.status = "abnormal";
|
|
9148
9157
|
try {
|
|
@@ -9355,7 +9364,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9355
9364
|
} else if (options.reactComponentAnnotation.enabled && !componentNameAnnotatePlugin) {
|
|
9356
9365
|
logger.warn("The component name annotate plugin is currently not supported by '@sentry/esbuild-plugin'");
|
|
9357
9366
|
} else {
|
|
9358
|
-
componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin());
|
|
9367
|
+
componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin(options.reactComponentAnnotation.ignoredComponents));
|
|
9359
9368
|
}
|
|
9360
9369
|
}
|
|
9361
9370
|
plugins.push(fileDeletionPlugin({
|
|
@@ -9584,7 +9593,7 @@ function createRollupDebugIdUploadHooks(upload) {
|
|
|
9584
9593
|
}
|
|
9585
9594
|
};
|
|
9586
9595
|
}
|
|
9587
|
-
function createComponentNameAnnotateHooks() {
|
|
9596
|
+
function createComponentNameAnnotateHooks(ignoredComponents) {
|
|
9588
9597
|
return {
|
|
9589
9598
|
transform: function transform(code, id) {
|
|
9590
9599
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -9617,7 +9626,9 @@ function createComponentNameAnnotateHooks() {
|
|
|
9617
9626
|
_context2.prev = 7;
|
|
9618
9627
|
_context2.next = 10;
|
|
9619
9628
|
return core.transformAsync(code, {
|
|
9620
|
-
plugins: [[componentNameAnnotatePlugin__default["default"]
|
|
9629
|
+
plugins: [[componentNameAnnotatePlugin__default["default"], {
|
|
9630
|
+
ignoredComponents: ignoredComponents
|
|
9631
|
+
}]],
|
|
9621
9632
|
filename: id,
|
|
9622
9633
|
parserOpts: {
|
|
9623
9634
|
sourceType: "module",
|
|
@@ -9653,7 +9664,7 @@ function createComponentNameAnnotateHooks() {
|
|
|
9653
9664
|
};
|
|
9654
9665
|
}
|
|
9655
9666
|
function getDebugIdSnippet(debugId) {
|
|
9656
|
-
return ";!function(){try{var e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"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){}}();");
|
|
9667
|
+
return ";!function(){try{var 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){}}();");
|
|
9657
9668
|
}
|
|
9658
9669
|
|
|
9659
9670
|
exports.createComponentNameAnnotateHooks = createComponentNameAnnotateHooks;
|