@sentry/bundler-plugin-core 2.16.1 → 2.17.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
@@ -630,7 +630,11 @@ function determineReleaseName() {
630
630
  // Zeit (now known as Vercel)
631
631
  process.env["ZEIT_GITHUB_COMMIT_SHA"] || process.env["ZEIT_GITLAB_COMMIT_SHA"] || process.env["ZEIT_BITBUCKET_COMMIT_SHA"] ||
632
632
  // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables
633
- process.env["FC_GIT_COMMIT_SHA"] || gitRevision()
633
+ process.env["FC_GIT_COMMIT_SHA"] ||
634
+ // Heroku #1 https://devcenter.heroku.com/changelog-items/630
635
+ process.env["SOURCE_VERSION"] ||
636
+ // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases
637
+ process.env["HEROKU_SLUG_COMMIT"] || gitRevision()
634
638
  );
635
639
  }
636
640
 
@@ -696,7 +700,7 @@ function replaceBooleanFlagsInCode(code, replacementValues) {
696
700
 
697
701
  var SENTRY_SAAS_URL = "https://sentry.io";
698
702
  function normalizeUserOptions(userOptions) {
699
- 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$release$6, _userOptions$release6, _userOptions$_experim;
703
+ 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$_experim;
700
704
  var options = {
701
705
  org: (_userOptions$org = userOptions.org) !== null && _userOptions$org !== void 0 ? _userOptions$org : process.env["SENTRY_ORG"],
702
706
  project: (_userOptions$project = userOptions.project) !== null && _userOptions$project !== void 0 ? _userOptions$project : process.env["SENTRY_PROJECT"],
@@ -714,8 +718,7 @@ function normalizeUserOptions(userOptions) {
714
718
  inject: (_userOptions$release$2 = (_userOptions$release2 = userOptions.release) === null || _userOptions$release2 === void 0 ? void 0 : _userOptions$release2.inject) !== null && _userOptions$release$2 !== void 0 ? _userOptions$release$2 : true,
715
719
  create: (_userOptions$release$3 = (_userOptions$release3 = userOptions.release) === null || _userOptions$release3 === void 0 ? void 0 : _userOptions$release3.create) !== null && _userOptions$release$3 !== void 0 ? _userOptions$release$3 : true,
716
720
  finalize: (_userOptions$release$4 = (_userOptions$release4 = userOptions.release) === null || _userOptions$release4 === void 0 ? void 0 : _userOptions$release4.finalize) !== null && _userOptions$release$4 !== void 0 ? _userOptions$release$4 : true,
717
- vcsRemote: (_ref3 = (_userOptions$release$5 = (_userOptions$release5 = userOptions.release) === null || _userOptions$release5 === void 0 ? void 0 : _userOptions$release5.vcsRemote) !== null && _userOptions$release$5 !== void 0 ? _userOptions$release$5 : process.env["SENTRY_VSC_REMOTE"]) !== null && _ref3 !== void 0 ? _ref3 : "origin",
718
- cleanArtifacts: (_userOptions$release$6 = (_userOptions$release6 = userOptions.release) === null || _userOptions$release6 === void 0 ? void 0 : _userOptions$release6.cleanArtifacts) !== null && _userOptions$release$6 !== void 0 ? _userOptions$release$6 : false
721
+ vcsRemote: (_ref3 = (_userOptions$release$5 = (_userOptions$release5 = userOptions.release) === null || _userOptions$release5 === void 0 ? void 0 : _userOptions$release5.vcsRemote) !== null && _userOptions$release$5 !== void 0 ? _userOptions$release$5 : process.env["SENTRY_VSC_REMOTE"]) !== null && _ref3 !== void 0 ? _ref3 : "origin"
719
722
  }),
720
723
  bundleSizeOptimizations: userOptions.bundleSizeOptimizations,
721
724
  reactComponentAnnotation: userOptions.reactComponentAnnotation,
@@ -13601,7 +13604,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
13601
13604
  dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
13602
13605
  tracesSampleRate: 1,
13603
13606
  sampleRate: 1,
13604
- release: "2.16.1",
13607
+ release: "2.17.0",
13605
13608
  integrations: [],
13606
13609
  tracePropagationTargets: ["sentry.io/api"],
13607
13610
  stackParser: defaultStackParser,
@@ -13676,7 +13679,6 @@ function setTelemetryDataOnHub(options, hub, bundler) {
13676
13679
  hub.setTag("inject-build-information", !!options._experiments.injectBuildInformation);
13677
13680
 
13678
13681
  // Optional release pipeline steps
13679
- hub.setTag("clean-artifacts", release.cleanArtifacts);
13680
13682
  if (release.setCommits) {
13681
13683
  hub.setTag("set-commits", release.setCommits.auto === true ? "auto" : "manual");
13682
13684
  } else {
@@ -14263,7 +14265,6 @@ function releaseManagementPlugin(_ref) {
14263
14265
  dist = _ref.dist,
14264
14266
  setCommitsOption = _ref.setCommitsOption,
14265
14267
  shouldCreateRelease = _ref.shouldCreateRelease,
14266
- shouldCleanArtifacts = _ref.shouldCleanArtifacts,
14267
14268
  shouldFinalizeRelease = _ref.shouldFinalizeRelease,
14268
14269
  deployOptions = _ref.deployOptions,
14269
14270
  handleRecoverableError = _ref.handleRecoverableError,
@@ -14287,15 +14288,8 @@ function releaseManagementPlugin(_ref) {
14287
14288
  _context.next = 5;
14288
14289
  return cliInstance.releases["new"](releaseName);
14289
14290
  case 5:
14290
- if (!shouldCleanArtifacts) {
14291
- _context.next = 8;
14292
- break;
14293
- }
14294
- _context.next = 8;
14295
- return cliInstance.releases.execute(["releases", "files", releaseName, "delete", "--all"], true);
14296
- case 8:
14297
14291
  if (!include) {
14298
- _context.next = 12;
14292
+ _context.next = 9;
14299
14293
  break;
14300
14294
  }
14301
14295
  normalizedInclude = arrayify$1(include).map(function (includeItem) {
@@ -14312,48 +14306,48 @@ function releaseManagementPlugin(_ref) {
14312
14306
  ignore: includeEntry.ignore ? arrayify$1(includeEntry.ignore) : undefined
14313
14307
  });
14314
14308
  });
14315
- _context.next = 12;
14309
+ _context.next = 9;
14316
14310
  return cliInstance.releases.uploadSourceMaps(releaseName, {
14317
14311
  include: normalizedInclude,
14318
14312
  dist: dist
14319
14313
  });
14320
- case 12:
14314
+ case 9:
14321
14315
  if (!setCommitsOption) {
14322
- _context.next = 15;
14316
+ _context.next = 12;
14323
14317
  break;
14324
14318
  }
14325
- _context.next = 15;
14319
+ _context.next = 12;
14326
14320
  return cliInstance.releases.setCommits(releaseName, setCommitsOption);
14327
- case 15:
14321
+ case 12:
14328
14322
  if (!shouldFinalizeRelease) {
14329
- _context.next = 18;
14323
+ _context.next = 15;
14330
14324
  break;
14331
14325
  }
14332
- _context.next = 18;
14326
+ _context.next = 15;
14333
14327
  return cliInstance.releases.finalize(releaseName);
14334
- case 18:
14328
+ case 15:
14335
14329
  if (!deployOptions) {
14336
- _context.next = 21;
14330
+ _context.next = 18;
14337
14331
  break;
14338
14332
  }
14339
- _context.next = 21;
14333
+ _context.next = 18;
14340
14334
  return cliInstance.releases.newDeploy(releaseName, deployOptions);
14341
- case 21:
14342
- _context.next = 29;
14335
+ case 18:
14336
+ _context.next = 26;
14343
14337
  break;
14344
- case 23:
14345
- _context.prev = 23;
14338
+ case 20:
14339
+ _context.prev = 20;
14346
14340
  _context.t0 = _context["catch"](0);
14347
14341
  sentryHub.captureException('Error in "releaseManagementPlugin" writeBundle hook');
14348
- _context.next = 28;
14342
+ _context.next = 25;
14349
14343
  return safeFlushTelemetry(sentryClient);
14350
- case 28:
14344
+ case 25:
14351
14345
  handleRecoverableError(_context.t0);
14352
- case 29:
14346
+ case 26:
14353
14347
  case "end":
14354
14348
  return _context.stop();
14355
14349
  }
14356
- }, _callee, null, [[0, 23]]);
14350
+ }, _callee, null, [[0, 20]]);
14357
14351
  }))();
14358
14352
  }
14359
14353
  };
@@ -14458,11 +14452,10 @@ function createLogger(options) {
14458
14452
  * release creation pipeline:
14459
14453
  *
14460
14454
  * 1. Create a new release
14461
- * 2. Delete already uploaded artifacts for this release (if `cleanArtifacts` is enabled)
14462
- * 3. Upload sourcemaps based on `include` and source-map-specific options
14463
- * 4. Associate a range of commits with the release (if `setCommits` is specified)
14464
- * 5. Finalize the release (unless `finalize` is disabled)
14465
- * 6. Add deploy information to the release (if `deploy` is specified)
14455
+ * 2. Upload sourcemaps based on `include` and source-map-specific options
14456
+ * 3. Associate a range of commits with the release (if `setCommits` is specified)
14457
+ * 4. Finalize the release (unless `finalize` is disabled)
14458
+ * 5. Add deploy information to the release (if `deploy` is specified)
14466
14459
  *
14467
14460
  * This release creation pipeline relies on Sentry CLI to execute the different steps.
14468
14461
  */
@@ -14516,7 +14509,7 @@ function sentryUnpluginFactory(_ref) {
14516
14509
  });
14517
14510
 
14518
14511
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
14519
- process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.16.1");
14512
+ process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.17.0");
14520
14513
  function handleRecoverableError(unknownError) {
14521
14514
  sentrySession.status = "abnormal";
14522
14515
  try {
@@ -14620,7 +14613,6 @@ function sentryUnpluginFactory(_ref) {
14620
14613
  logger: logger,
14621
14614
  releaseName: options.release.name,
14622
14615
  shouldCreateRelease: options.release.create,
14623
- shouldCleanArtifacts: options.release.cleanArtifacts,
14624
14616
  shouldFinalizeRelease: options.release.finalize,
14625
14617
  include: options.release.uploadLegacySourcemaps,
14626
14618
  setCommitsOption: options.release.setCommits,
@@ -14640,7 +14632,7 @@ function sentryUnpluginFactory(_ref) {
14640
14632
  }
14641
14633
  }));
14642
14634
  }
14643
- plugins.push(debugIdInjectionPlugin());
14635
+ plugins.push(debugIdInjectionPlugin(logger));
14644
14636
  if (!options.authToken) {
14645
14637
  logger.warn("No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/");
14646
14638
  } else if (!options.org && !options.authToken.startsWith("sntrys_")) {