@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.
@@ -611,6 +611,8 @@ function determineReleaseName() {
611
611
  process.env["HEROKU_TEST_RUN_COMMIT_VERSION"] ||
612
612
  // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
613
613
  process.env["HEROKU_SLUG_COMMIT"] ||
614
+ // Railway - https://docs.railway.app/reference/variables#git-variables
615
+ process.env["RAILWAY_GIT_COMMIT_SHA"] ||
614
616
  // Render - https://render.com/docs/environment-variables
615
617
  process.env["RENDER_GIT_COMMIT"] ||
616
618
  // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables
@@ -648,7 +650,7 @@ function generateGlobalInjectorCode(_ref2) {
648
650
  injectBuildInformation = _ref2.injectBuildInformation;
649
651
  // The code below is mostly ternary operators because it saves bundle size.
650
652
  // The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
651
- 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), "};");
653
+ 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), "};");
652
654
  if (injectBuildInformation) {
653
655
  var buildInfo = getBuildInformation$1();
654
656
  code += "\n _global.SENTRY_BUILD_INFO=".concat(JSON.stringify(buildInfo), ";");
@@ -661,7 +663,7 @@ function generateModuleMetadataInjectorCode(metadata) {
661
663
  // The code below is mostly ternary operators because it saves bundle size.
662
664
  // The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
663
665
  // We are merging the metadata objects in case modules are bundled twice with the plugin
664
- 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}");
666
+ 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}");
665
667
  }
666
668
  function getBuildInformation$1() {
667
669
  var packageJson = getPackageJson();
@@ -8072,7 +8074,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
8072
8074
  dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
8073
8075
  tracesSampleRate: 1,
8074
8076
  sampleRate: 1,
8075
- release: "2.22.7",
8077
+ release: "2.23.0",
8076
8078
  integrations: [],
8077
8079
  tracePropagationTargets: ["sentry.io/api"],
8078
8080
  stackParser: stackParser,
@@ -8756,6 +8758,11 @@ function defaultRewriteSourcesHook(source) {
8756
8758
  }
8757
8759
  }
8758
8760
 
8761
+ /**
8762
+ * Creates a plugin that creates releases, sets commits, deploys and finalizes releases.
8763
+ *
8764
+ * Additionally, if legacy upload options are set, it uploads source maps in the legacy (non-debugId) way.
8765
+ */
8759
8766
  function releaseManagementPlugin(_ref) {
8760
8767
  var releaseName = _ref.releaseName,
8761
8768
  include = _ref.include,
@@ -8771,7 +8778,7 @@ function releaseManagementPlugin(_ref) {
8771
8778
  createDependencyOnSourcemapFiles = _ref.createDependencyOnSourcemapFiles;
8772
8779
  var freeGlobalDependencyOnSourcemapFiles = createDependencyOnSourcemapFiles();
8773
8780
  return {
8774
- name: "sentry-debug-id-upload-plugin",
8781
+ name: "sentry-release-management-plugin",
8775
8782
  writeBundle: function writeBundle() {
8776
8783
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8777
8784
  var freeWriteBundleInvocationDependencyOnSourcemapFiles, cliInstance, normalizedInclude;
@@ -9108,7 +9115,7 @@ function sentryUnpluginFactory(_ref) {
9108
9115
  });
9109
9116
 
9110
9117
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
9111
- process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.22.7");
9118
+ process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.23.0");
9112
9119
  function handleRecoverableError(unknownError) {
9113
9120
  sentrySession.status = "abnormal";
9114
9121
  try {
@@ -9321,7 +9328,7 @@ function sentryUnpluginFactory(_ref) {
9321
9328
  } else if (options.reactComponentAnnotation.enabled && !componentNameAnnotatePlugin) {
9322
9329
  logger.warn("The component name annotate plugin is currently not supported by '@sentry/esbuild-plugin'");
9323
9330
  } else {
9324
- componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin());
9331
+ componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin(options.reactComponentAnnotation.ignoredComponents));
9325
9332
  }
9326
9333
  }
9327
9334
  plugins.push(fileDeletionPlugin({
@@ -9550,7 +9557,7 @@ function createRollupDebugIdUploadHooks(upload) {
9550
9557
  }
9551
9558
  };
9552
9559
  }
9553
- function createComponentNameAnnotateHooks() {
9560
+ function createComponentNameAnnotateHooks(ignoredComponents) {
9554
9561
  return {
9555
9562
  transform: function transform(code, id) {
9556
9563
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
@@ -9583,7 +9590,9 @@ function createComponentNameAnnotateHooks() {
9583
9590
  _context2.prev = 7;
9584
9591
  _context2.next = 10;
9585
9592
  return transformAsync(code, {
9586
- plugins: [[componentNameAnnotatePlugin]],
9593
+ plugins: [[componentNameAnnotatePlugin, {
9594
+ ignoredComponents: ignoredComponents
9595
+ }]],
9587
9596
  filename: id,
9588
9597
  parserOpts: {
9589
9598
  sourceType: "module",
@@ -9619,7 +9628,7 @@ function createComponentNameAnnotateHooks() {
9619
9628
  };
9620
9629
  }
9621
9630
  function getDebugIdSnippet(debugId) {
9622
- 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){}}();");
9631
+ 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){}}();");
9623
9632
  }
9624
9633
 
9625
9634
  export { createComponentNameAnnotateHooks, createRollupBundleSizeOptimizationHooks, createRollupDebugIdInjectionHooks, createRollupDebugIdUploadHooks, createRollupModuleMetadataInjectionHooks, createRollupReleaseInjectionHooks, getBuildInformation, getDebugIdSnippet, replaceBooleanFlagsInCode, sentryCliBinaryExists, sentryUnpluginFactory, stringToUUID };