@sentry/bundler-plugin-core 4.5.0 → 4.6.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.
@@ -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.0",
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.0");
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
@@ -9189,8 +9189,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9189
9189
  return cliInstance.releases.uploadSourceMaps(options.release.name, {
9190
9190
  include: normalizedInclude,
9191
9191
  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
9192
  projects: getProjects(options.project),
9195
9193
  // We want this promise to throw if the sourcemaps fail to upload so that we know about it.
9196
9194
  // see: https://github.com/getsentry/sentry-cli/pull/2605
@@ -9394,8 +9392,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9394
9392
  dist: options.release.dist
9395
9393
  }],
9396
9394
  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
9395
  projects: getProjects(options.project),
9400
9396
  live: "rejectOnError"
9401
9397
  });
@@ -9586,8 +9582,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9586
9582
  rewrite: false,
9587
9583
  dist: options.release.dist
9588
9584
  }],
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
9585
  projects: getProjects(options.project),
9592
9586
  live: "rejectOnError"
9593
9587
  });
@@ -9791,18 +9785,14 @@ function sentryUnpluginFactory(_ref) {
9791
9785
  plugins.push({
9792
9786
  name: "sentry-telemetry-plugin",
9793
9787
  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
- }))();
9788
+ // Technically, for very fast builds we might miss the telemetry signal
9789
+ // but it's okay because telemetry is not critical for us.
9790
+ // We cannot await the flush here because it would block the build start
9791
+ // which in turn would break module federation builds, see
9792
+ // https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/816
9793
+ void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal()["catch"](function () {
9794
+ // Nothing for the users to do here. If telemetry fails it's acceptable.
9795
+ });
9806
9796
  }
9807
9797
  });
9808
9798
  if (Object.keys(bundleSizeOptimizationReplacementValues).length > 0) {
@@ -9829,22 +9819,22 @@ function sentryUnpluginFactory(_ref) {
9829
9819
  plugins.push({
9830
9820
  name: "sentry-release-management-plugin",
9831
9821
  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) {
9822
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9823
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9824
+ while (1) switch (_context.prev = _context.next) {
9835
9825
  case 0:
9836
- _context2.prev = 0;
9837
- _context2.next = 3;
9826
+ _context.prev = 0;
9827
+ _context.next = 3;
9838
9828
  return sentryBuildPluginManager.createRelease();
9839
9829
  case 3:
9840
- _context2.prev = 3;
9830
+ _context.prev = 3;
9841
9831
  freeGlobalDependencyOnBuildArtifacts();
9842
- return _context2.finish(3);
9832
+ return _context.finish(3);
9843
9833
  case 6:
9844
9834
  case "end":
9845
- return _context2.stop();
9835
+ return _context.stop();
9846
9836
  }
9847
- }, _callee2, null, [[0,, 3, 6]]);
9837
+ }, _callee, null, [[0,, 3, 6]]);
9848
9838
  }))();
9849
9839
  }
9850
9840
  });
@@ -9873,17 +9863,17 @@ function sentryUnpluginFactory(_ref) {
9873
9863
  plugins.push({
9874
9864
  name: "sentry-file-deletion-plugin",
9875
9865
  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) {
9866
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9867
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9868
+ while (1) switch (_context2.prev = _context2.next) {
9879
9869
  case 0:
9880
- _context3.next = 2;
9870
+ _context2.next = 2;
9881
9871
  return sentryBuildPluginManager.deleteArtifacts();
9882
9872
  case 2:
9883
9873
  case "end":
9884
- return _context3.stop();
9874
+ return _context2.stop();
9885
9875
  }
9886
- }, _callee3);
9876
+ }, _callee2);
9887
9877
  }))();
9888
9878
  }
9889
9879
  });
@@ -10033,18 +10023,18 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10033
10023
  var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
10034
10024
  return {
10035
10025
  writeBundle: function writeBundle(outputOptions, bundle) {
10036
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10026
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10037
10027
  var outputDir, _buildArtifacts, _buildArtifacts2;
10038
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10039
- while (1) switch (_context4.prev = _context4.next) {
10028
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10029
+ while (1) switch (_context3.prev = _context3.next) {
10040
10030
  case 0:
10041
- _context4.prev = 0;
10031
+ _context3.prev = 0;
10042
10032
  if (!outputOptions.dir) {
10043
- _context4.next = 10;
10033
+ _context3.next = 10;
10044
10034
  break;
10045
10035
  }
10046
10036
  outputDir = outputOptions.dir;
10047
- _context4.next = 5;
10037
+ _context3.next = 5;
10048
10038
  return glob(["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(function (q) {
10049
10039
  return "".concat(q, "?(\\?*)?(#*)");
10050
10040
  }),
@@ -10055,37 +10045,37 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10055
10045
  nodir: true
10056
10046
  });
10057
10047
  case 5:
10058
- _buildArtifacts = _context4.sent;
10059
- _context4.next = 8;
10048
+ _buildArtifacts = _context3.sent;
10049
+ _context3.next = 8;
10060
10050
  return upload(_buildArtifacts);
10061
10051
  case 8:
10062
- _context4.next = 18;
10052
+ _context3.next = 18;
10063
10053
  break;
10064
10054
  case 10:
10065
10055
  if (!outputOptions.file) {
10066
- _context4.next = 15;
10056
+ _context3.next = 15;
10067
10057
  break;
10068
10058
  }
10069
- _context4.next = 13;
10059
+ _context3.next = 13;
10070
10060
  return upload([outputOptions.file]);
10071
10061
  case 13:
10072
- _context4.next = 18;
10062
+ _context3.next = 18;
10073
10063
  break;
10074
10064
  case 15:
10075
10065
  _buildArtifacts2 = Object.keys(bundle).map(function (asset) {
10076
10066
  return path.join(path.resolve(), asset);
10077
10067
  });
10078
- _context4.next = 18;
10068
+ _context3.next = 18;
10079
10069
  return upload(_buildArtifacts2);
10080
10070
  case 18:
10081
- _context4.prev = 18;
10071
+ _context3.prev = 18;
10082
10072
  freeGlobalDependencyOnDebugIdSourcemapArtifacts();
10083
- return _context4.finish(18);
10073
+ return _context3.finish(18);
10084
10074
  case 21:
10085
10075
  case "end":
10086
- return _context4.stop();
10076
+ return _context3.stop();
10087
10077
  }
10088
- }, _callee4, null, [[0,, 18, 21]]);
10078
+ }, _callee3, null, [[0,, 18, 21]]);
10089
10079
  }))();
10090
10080
  }
10091
10081
  };
@@ -10093,26 +10083,26 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10093
10083
  function createComponentNameAnnotateHooks(ignoredComponents) {
10094
10084
  return {
10095
10085
  transform: function transform(code, id) {
10096
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
10086
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10097
10087
  var idWithoutQueryAndHash, parserPlugins, _result$code, result;
10098
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10099
- while (1) switch (_context5.prev = _context5.next) {
10088
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10089
+ while (1) switch (_context4.prev = _context4.next) {
10100
10090
  case 0:
10101
10091
  // id may contain query and hash which will trip up our file extension logic below
10102
10092
  idWithoutQueryAndHash = stripQueryAndHashFromPath(id);
10103
10093
  if (!idWithoutQueryAndHash.match(/\\node_modules\\|\/node_modules\//)) {
10104
- _context5.next = 3;
10094
+ _context4.next = 3;
10105
10095
  break;
10106
10096
  }
10107
- return _context5.abrupt("return", null);
10097
+ return _context4.abrupt("return", null);
10108
10098
  case 3:
10109
10099
  if ([".jsx", ".tsx"].some(function (ending) {
10110
10100
  return idWithoutQueryAndHash.endsWith(ending);
10111
10101
  })) {
10112
- _context5.next = 5;
10102
+ _context4.next = 5;
10113
10103
  break;
10114
10104
  }
10115
- return _context5.abrupt("return", null);
10105
+ return _context4.abrupt("return", null);
10116
10106
  case 5:
10117
10107
  parserPlugins = [];
10118
10108
  if (idWithoutQueryAndHash.endsWith(".jsx")) {
@@ -10120,8 +10110,8 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10120
10110
  } else if (idWithoutQueryAndHash.endsWith(".tsx")) {
10121
10111
  parserPlugins.push("jsx", "typescript");
10122
10112
  }
10123
- _context5.prev = 7;
10124
- _context5.next = 10;
10113
+ _context4.prev = 7;
10114
+ _context4.next = 10;
10125
10115
  return transformAsync(code, {
10126
10116
  plugins: [[componentNameAnnotatePlugin, {
10127
10117
  ignoredComponents: ignoredComponents
@@ -10138,24 +10128,24 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10138
10128
  sourceMaps: true
10139
10129
  });
10140
10130
  case 10:
10141
- result = _context5.sent;
10142
- return _context5.abrupt("return", {
10131
+ result = _context4.sent;
10132
+ return _context4.abrupt("return", {
10143
10133
  code: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : code,
10144
10134
  map: result === null || result === void 0 ? void 0 : result.map
10145
10135
  });
10146
10136
  case 14:
10147
- _context5.prev = 14;
10148
- _context5.t0 = _context5["catch"](7);
10149
- logger.error("Failed to apply react annotate plugin", _context5.t0);
10137
+ _context4.prev = 14;
10138
+ _context4.t0 = _context4["catch"](7);
10139
+ logger.error("Failed to apply react annotate plugin", _context4.t0);
10150
10140
  case 17:
10151
- return _context5.abrupt("return", {
10141
+ return _context4.abrupt("return", {
10152
10142
  code: code
10153
10143
  });
10154
10144
  case 18:
10155
10145
  case "end":
10156
- return _context5.stop();
10146
+ return _context4.stop();
10157
10147
  }
10158
- }, _callee5, null, [[7, 14]]);
10148
+ }, _callee4, null, [[7, 14]]);
10159
10149
  }))();
10160
10150
  }
10161
10151
  };