@sentry/bundler-plugin-core 2.22.7 → 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 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 self !== 'undefined' ?\n self :\n {};\n\n _global.SENTRY_RELEASE={id:".concat(JSON.stringify(release), "};");
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.22.7",
8113
+ release: "2.23.0",
8112
8114
  integrations: [],
8113
8115
  tracePropagationTargets: ["sentry.io/api"],
8114
8116
  stackParser: stackParser,
@@ -8792,6 +8794,11 @@ function defaultRewriteSourcesHook(source) {
8792
8794
  }
8793
8795
  }
8794
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
+ */
8795
8802
  function releaseManagementPlugin(_ref) {
8796
8803
  var releaseName = _ref.releaseName,
8797
8804
  include = _ref.include,
@@ -8807,7 +8814,7 @@ function releaseManagementPlugin(_ref) {
8807
8814
  createDependencyOnSourcemapFiles = _ref.createDependencyOnSourcemapFiles;
8808
8815
  var freeGlobalDependencyOnSourcemapFiles = createDependencyOnSourcemapFiles();
8809
8816
  return {
8810
- name: "sentry-debug-id-upload-plugin",
8817
+ name: "sentry-release-management-plugin",
8811
8818
  writeBundle: function writeBundle() {
8812
8819
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8813
8820
  var freeWriteBundleInvocationDependencyOnSourcemapFiles, cliInstance, normalizedInclude;
@@ -9144,7 +9151,7 @@ function sentryUnpluginFactory(_ref) {
9144
9151
  });
9145
9152
 
9146
9153
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
9147
- process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.22.7");
9154
+ process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.23.0");
9148
9155
  function handleRecoverableError(unknownError) {
9149
9156
  sentrySession.status = "abnormal";
9150
9157
  try {
@@ -9357,7 +9364,7 @@ function sentryUnpluginFactory(_ref) {
9357
9364
  } else if (options.reactComponentAnnotation.enabled && !componentNameAnnotatePlugin) {
9358
9365
  logger.warn("The component name annotate plugin is currently not supported by '@sentry/esbuild-plugin'");
9359
9366
  } else {
9360
- componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin());
9367
+ componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin(options.reactComponentAnnotation.ignoredComponents));
9361
9368
  }
9362
9369
  }
9363
9370
  plugins.push(fileDeletionPlugin({
@@ -9586,7 +9593,7 @@ function createRollupDebugIdUploadHooks(upload) {
9586
9593
  }
9587
9594
  };
9588
9595
  }
9589
- function createComponentNameAnnotateHooks() {
9596
+ function createComponentNameAnnotateHooks(ignoredComponents) {
9590
9597
  return {
9591
9598
  transform: function transform(code, id) {
9592
9599
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
@@ -9619,7 +9626,9 @@ function createComponentNameAnnotateHooks() {
9619
9626
  _context2.prev = 7;
9620
9627
  _context2.next = 10;
9621
9628
  return core.transformAsync(code, {
9622
- plugins: [[componentNameAnnotatePlugin__default["default"]]],
9629
+ plugins: [[componentNameAnnotatePlugin__default["default"], {
9630
+ ignoredComponents: ignoredComponents
9631
+ }]],
9623
9632
  filename: id,
9624
9633
  parserOpts: {
9625
9634
  sourceType: "module",
@@ -9655,7 +9664,7 @@ function createComponentNameAnnotateHooks() {
9655
9664
  };
9656
9665
  }
9657
9666
  function getDebugIdSnippet(debugId) {
9658
- 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){}}();");
9659
9668
  }
9660
9669
 
9661
9670
  exports.createComponentNameAnnotateHooks = createComponentNameAnnotateHooks;