@sentry/bundler-plugin-core 4.5.0 → 4.6.1

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.
@@ -8299,7 +8299,7 @@ function createSentryInstance(options, shouldSendTelemetry, buildTool) {
8299
8299
  dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
8300
8300
  tracesSampleRate: 1,
8301
8301
  sampleRate: 1,
8302
- release: "4.5.0",
8302
+ release: "4.6.1",
8303
8303
  integrations: [],
8304
8304
  tracePropagationTargets: ["sentry.io/api"],
8305
8305
  stackParser: stackParser,
@@ -8908,7 +8908,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
8908
8908
  });
8909
8909
 
8910
8910
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
8911
- process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.5.0");
8911
+ process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.6.1");
8912
8912
 
8913
8913
  // Propagate debug flag to Sentry CLI via environment variable
8914
8914
  // Only set if not already defined to respect user's explicit configuration
@@ -9116,7 +9116,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9116
9116
  */
9117
9117
  createRelease: function createRelease() {
9118
9118
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
9119
- var freeWriteBundleInvocationDependencyOnSourcemapFiles, cliInstance, normalizedInclude;
9119
+ var freeWriteBundleInvocationDependencyOnSourcemapFiles, cliInstance, releaseOutput, normalizedInclude;
9120
9120
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
9121
9121
  while (1) switch (_context7.prev = _context7.next) {
9122
9122
  case 0:
@@ -9161,14 +9161,17 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9161
9161
  _context7.prev = 24;
9162
9162
  cliInstance = createCliInstance(options);
9163
9163
  if (!options.release.create) {
9164
- _context7.next = 29;
9164
+ _context7.next = 31;
9165
9165
  break;
9166
9166
  }
9167
9167
  _context7.next = 29;
9168
9168
  return cliInstance.releases["new"](options.release.name);
9169
9169
  case 29:
9170
+ releaseOutput = _context7.sent;
9171
+ logger.debug("Release created:", releaseOutput);
9172
+ case 31:
9170
9173
  if (!options.release.uploadLegacySourcemaps) {
9171
- _context7.next = 33;
9174
+ _context7.next = 35;
9172
9175
  break;
9173
9176
  }
9174
9177
  normalizedInclude = arrayify(options.release.uploadLegacySourcemaps).map(function (includeItem) {
@@ -9185,77 +9188,75 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9185
9188
  ignore: includeEntry.ignore ? arrayify(includeEntry.ignore) : undefined
9186
9189
  });
9187
9190
  });
9188
- _context7.next = 33;
9191
+ _context7.next = 35;
9189
9192
  return cliInstance.releases.uploadSourceMaps(options.release.name, {
9190
9193
  include: normalizedInclude,
9191
9194
  dist: options.release.dist,
9192
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9193
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9194
9195
  projects: getProjects(options.project),
9195
9196
  // We want this promise to throw if the sourcemaps fail to upload so that we know about it.
9196
9197
  // see: https://github.com/getsentry/sentry-cli/pull/2605
9197
9198
  live: "rejectOnError"
9198
9199
  });
9199
- case 33:
9200
+ case 35:
9200
9201
  if (!(options.release.setCommits !== false)) {
9201
- _context7.next = 46;
9202
+ _context7.next = 48;
9202
9203
  break;
9203
9204
  }
9204
- _context7.prev = 34;
9205
- _context7.next = 37;
9205
+ _context7.prev = 36;
9206
+ _context7.next = 39;
9206
9207
  return cliInstance.releases.setCommits(options.release.name,
9207
9208
  // set commits always exists due to the normalize function
9208
9209
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9209
9210
  options.release.setCommits);
9210
- case 37:
9211
- _context7.next = 46;
9212
- break;
9213
9211
  case 39:
9214
- _context7.prev = 39;
9215
- _context7.t0 = _context7["catch"](34);
9212
+ _context7.next = 48;
9213
+ break;
9214
+ case 41:
9215
+ _context7.prev = 41;
9216
+ _context7.t0 = _context7["catch"](36);
9216
9217
  if (!(options.release.setCommits && "shouldNotThrowOnFailure" in options.release.setCommits && options.release.setCommits.shouldNotThrowOnFailure)) {
9217
- _context7.next = 45;
9218
+ _context7.next = 47;
9218
9219
  break;
9219
9220
  }
9220
9221
  logger.debug("An error occurred setting commits on release (this message can be ignored unless you commits on release are desired):", _context7.t0);
9221
- _context7.next = 46;
9222
+ _context7.next = 48;
9222
9223
  break;
9223
- case 45:
9224
+ case 47:
9224
9225
  throw _context7.t0;
9225
- case 46:
9226
+ case 48:
9226
9227
  if (!options.release.finalize) {
9227
- _context7.next = 49;
9228
+ _context7.next = 51;
9228
9229
  break;
9229
9230
  }
9230
- _context7.next = 49;
9231
+ _context7.next = 51;
9231
9232
  return cliInstance.releases.finalize(options.release.name);
9232
- case 49:
9233
+ case 51:
9233
9234
  if (!options.release.deploy) {
9234
- _context7.next = 52;
9235
+ _context7.next = 54;
9235
9236
  break;
9236
9237
  }
9237
- _context7.next = 52;
9238
+ _context7.next = 54;
9238
9239
  return cliInstance.releases.newDeploy(options.release.name, options.release.deploy);
9239
- case 52:
9240
- _context7.next = 60;
9241
- break;
9242
9240
  case 54:
9243
- _context7.prev = 54;
9241
+ _context7.next = 62;
9242
+ break;
9243
+ case 56:
9244
+ _context7.prev = 56;
9244
9245
  _context7.t1 = _context7["catch"](24);
9245
9246
  sentryScope.captureException('Error in "releaseManagementPlugin" writeBundle hook');
9246
- _context7.next = 59;
9247
+ _context7.next = 61;
9247
9248
  return safeFlushTelemetry(sentryClient);
9248
- case 59:
9249
+ case 61:
9249
9250
  handleRecoverableError(_context7.t1, false);
9250
- case 60:
9251
- _context7.prev = 60;
9251
+ case 62:
9252
+ _context7.prev = 62;
9252
9253
  freeWriteBundleInvocationDependencyOnSourcemapFiles();
9253
- return _context7.finish(60);
9254
- case 63:
9254
+ return _context7.finish(62);
9255
+ case 65:
9255
9256
  case "end":
9256
9257
  return _context7.stop();
9257
9258
  }
9258
- }, _callee7, null, [[24, 54, 60, 63], [34, 39]]);
9259
+ }, _callee7, null, [[24, 56, 62, 65], [36, 41]]);
9259
9260
  }))();
9260
9261
  },
9261
9262
  /*
@@ -9394,8 +9395,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9394
9395
  dist: options.release.dist
9395
9396
  }],
9396
9397
  ignore: ignorePaths,
9397
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9398
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9399
9398
  projects: getProjects(options.project),
9400
9399
  live: "rejectOnError"
9401
9400
  });
@@ -9586,8 +9585,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9586
9585
  rewrite: false,
9587
9586
  dist: options.release.dist
9588
9587
  }],
9589
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9590
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9591
9588
  projects: getProjects(options.project),
9592
9589
  live: "rejectOnError"
9593
9590
  });
@@ -9791,18 +9788,14 @@ function sentryUnpluginFactory(_ref) {
9791
9788
  plugins.push({
9792
9789
  name: "sentry-telemetry-plugin",
9793
9790
  buildStart: function buildStart() {
9794
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9795
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9796
- while (1) switch (_context.prev = _context.next) {
9797
- case 0:
9798
- _context.next = 2;
9799
- return sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
9800
- case 2:
9801
- case "end":
9802
- return _context.stop();
9803
- }
9804
- }, _callee);
9805
- }))();
9791
+ // Technically, for very fast builds we might miss the telemetry signal
9792
+ // but it's okay because telemetry is not critical for us.
9793
+ // We cannot await the flush here because it would block the build start
9794
+ // which in turn would break module federation builds, see
9795
+ // https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/816
9796
+ void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal()["catch"](function () {
9797
+ // Nothing for the users to do here. If telemetry fails it's acceptable.
9798
+ });
9806
9799
  }
9807
9800
  });
9808
9801
  if (Object.keys(bundleSizeOptimizationReplacementValues).length > 0) {
@@ -9829,22 +9822,22 @@ function sentryUnpluginFactory(_ref) {
9829
9822
  plugins.push({
9830
9823
  name: "sentry-release-management-plugin",
9831
9824
  writeBundle: function writeBundle() {
9832
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9833
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9834
- while (1) switch (_context2.prev = _context2.next) {
9825
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9826
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9827
+ while (1) switch (_context.prev = _context.next) {
9835
9828
  case 0:
9836
- _context2.prev = 0;
9837
- _context2.next = 3;
9829
+ _context.prev = 0;
9830
+ _context.next = 3;
9838
9831
  return sentryBuildPluginManager.createRelease();
9839
9832
  case 3:
9840
- _context2.prev = 3;
9833
+ _context.prev = 3;
9841
9834
  freeGlobalDependencyOnBuildArtifacts();
9842
- return _context2.finish(3);
9835
+ return _context.finish(3);
9843
9836
  case 6:
9844
9837
  case "end":
9845
- return _context2.stop();
9838
+ return _context.stop();
9846
9839
  }
9847
- }, _callee2, null, [[0,, 3, 6]]);
9840
+ }, _callee, null, [[0,, 3, 6]]);
9848
9841
  }))();
9849
9842
  }
9850
9843
  });
@@ -9873,17 +9866,17 @@ function sentryUnpluginFactory(_ref) {
9873
9866
  plugins.push({
9874
9867
  name: "sentry-file-deletion-plugin",
9875
9868
  writeBundle: function writeBundle() {
9876
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
9877
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
9878
- while (1) switch (_context3.prev = _context3.next) {
9869
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9870
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9871
+ while (1) switch (_context2.prev = _context2.next) {
9879
9872
  case 0:
9880
- _context3.next = 2;
9873
+ _context2.next = 2;
9881
9874
  return sentryBuildPluginManager.deleteArtifacts();
9882
9875
  case 2:
9883
9876
  case "end":
9884
- return _context3.stop();
9877
+ return _context2.stop();
9885
9878
  }
9886
- }, _callee3);
9879
+ }, _callee2);
9887
9880
  }))();
9888
9881
  }
9889
9882
  });
@@ -10033,18 +10026,18 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10033
10026
  var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
10034
10027
  return {
10035
10028
  writeBundle: function writeBundle(outputOptions, bundle) {
10036
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10029
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10037
10030
  var outputDir, _buildArtifacts, _buildArtifacts2;
10038
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10039
- while (1) switch (_context4.prev = _context4.next) {
10031
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10032
+ while (1) switch (_context3.prev = _context3.next) {
10040
10033
  case 0:
10041
- _context4.prev = 0;
10034
+ _context3.prev = 0;
10042
10035
  if (!outputOptions.dir) {
10043
- _context4.next = 10;
10036
+ _context3.next = 10;
10044
10037
  break;
10045
10038
  }
10046
10039
  outputDir = outputOptions.dir;
10047
- _context4.next = 5;
10040
+ _context3.next = 5;
10048
10041
  return glob(["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(function (q) {
10049
10042
  return "".concat(q, "?(\\?*)?(#*)");
10050
10043
  }),
@@ -10055,37 +10048,37 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10055
10048
  nodir: true
10056
10049
  });
10057
10050
  case 5:
10058
- _buildArtifacts = _context4.sent;
10059
- _context4.next = 8;
10051
+ _buildArtifacts = _context3.sent;
10052
+ _context3.next = 8;
10060
10053
  return upload(_buildArtifacts);
10061
10054
  case 8:
10062
- _context4.next = 18;
10055
+ _context3.next = 18;
10063
10056
  break;
10064
10057
  case 10:
10065
10058
  if (!outputOptions.file) {
10066
- _context4.next = 15;
10059
+ _context3.next = 15;
10067
10060
  break;
10068
10061
  }
10069
- _context4.next = 13;
10062
+ _context3.next = 13;
10070
10063
  return upload([outputOptions.file]);
10071
10064
  case 13:
10072
- _context4.next = 18;
10065
+ _context3.next = 18;
10073
10066
  break;
10074
10067
  case 15:
10075
10068
  _buildArtifacts2 = Object.keys(bundle).map(function (asset) {
10076
10069
  return path.join(path.resolve(), asset);
10077
10070
  });
10078
- _context4.next = 18;
10071
+ _context3.next = 18;
10079
10072
  return upload(_buildArtifacts2);
10080
10073
  case 18:
10081
- _context4.prev = 18;
10074
+ _context3.prev = 18;
10082
10075
  freeGlobalDependencyOnDebugIdSourcemapArtifacts();
10083
- return _context4.finish(18);
10076
+ return _context3.finish(18);
10084
10077
  case 21:
10085
10078
  case "end":
10086
- return _context4.stop();
10079
+ return _context3.stop();
10087
10080
  }
10088
- }, _callee4, null, [[0,, 18, 21]]);
10081
+ }, _callee3, null, [[0,, 18, 21]]);
10089
10082
  }))();
10090
10083
  }
10091
10084
  };
@@ -10093,26 +10086,26 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10093
10086
  function createComponentNameAnnotateHooks(ignoredComponents) {
10094
10087
  return {
10095
10088
  transform: function transform(code, id) {
10096
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
10089
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10097
10090
  var idWithoutQueryAndHash, parserPlugins, _result$code, result;
10098
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10099
- while (1) switch (_context5.prev = _context5.next) {
10091
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10092
+ while (1) switch (_context4.prev = _context4.next) {
10100
10093
  case 0:
10101
10094
  // id may contain query and hash which will trip up our file extension logic below
10102
10095
  idWithoutQueryAndHash = stripQueryAndHashFromPath(id);
10103
10096
  if (!idWithoutQueryAndHash.match(/\\node_modules\\|\/node_modules\//)) {
10104
- _context5.next = 3;
10097
+ _context4.next = 3;
10105
10098
  break;
10106
10099
  }
10107
- return _context5.abrupt("return", null);
10100
+ return _context4.abrupt("return", null);
10108
10101
  case 3:
10109
10102
  if ([".jsx", ".tsx"].some(function (ending) {
10110
10103
  return idWithoutQueryAndHash.endsWith(ending);
10111
10104
  })) {
10112
- _context5.next = 5;
10105
+ _context4.next = 5;
10113
10106
  break;
10114
10107
  }
10115
- return _context5.abrupt("return", null);
10108
+ return _context4.abrupt("return", null);
10116
10109
  case 5:
10117
10110
  parserPlugins = [];
10118
10111
  if (idWithoutQueryAndHash.endsWith(".jsx")) {
@@ -10120,8 +10113,8 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10120
10113
  } else if (idWithoutQueryAndHash.endsWith(".tsx")) {
10121
10114
  parserPlugins.push("jsx", "typescript");
10122
10115
  }
10123
- _context5.prev = 7;
10124
- _context5.next = 10;
10116
+ _context4.prev = 7;
10117
+ _context4.next = 10;
10125
10118
  return transformAsync(code, {
10126
10119
  plugins: [[componentNameAnnotatePlugin, {
10127
10120
  ignoredComponents: ignoredComponents
@@ -10138,24 +10131,24 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10138
10131
  sourceMaps: true
10139
10132
  });
10140
10133
  case 10:
10141
- result = _context5.sent;
10142
- return _context5.abrupt("return", {
10134
+ result = _context4.sent;
10135
+ return _context4.abrupt("return", {
10143
10136
  code: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : code,
10144
10137
  map: result === null || result === void 0 ? void 0 : result.map
10145
10138
  });
10146
10139
  case 14:
10147
- _context5.prev = 14;
10148
- _context5.t0 = _context5["catch"](7);
10149
- logger.error("Failed to apply react annotate plugin", _context5.t0);
10140
+ _context4.prev = 14;
10141
+ _context4.t0 = _context4["catch"](7);
10142
+ logger.error("Failed to apply react annotate plugin", _context4.t0);
10150
10143
  case 17:
10151
- return _context5.abrupt("return", {
10144
+ return _context4.abrupt("return", {
10152
10145
  code: code
10153
10146
  });
10154
10147
  case 18:
10155
10148
  case "end":
10156
- return _context5.stop();
10149
+ return _context4.stop();
10157
10150
  }
10158
- }, _callee5, null, [[7, 14]]);
10151
+ }, _callee4, null, [[7, 14]]);
10159
10152
  }))();
10160
10153
  }
10161
10154
  };