@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.
package/dist/cjs/index.js CHANGED
@@ -8336,7 +8336,7 @@ function createSentryInstance(options, shouldSendTelemetry, buildTool) {
8336
8336
  dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
8337
8337
  tracesSampleRate: 1,
8338
8338
  sampleRate: 1,
8339
- release: "4.5.0",
8339
+ release: "4.6.0",
8340
8340
  integrations: [],
8341
8341
  tracePropagationTargets: ["sentry.io/api"],
8342
8342
  stackParser: stackParser,
@@ -8945,7 +8945,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
8945
8945
  });
8946
8946
 
8947
8947
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
8948
- process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.5.0");
8948
+ process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.6.0");
8949
8949
 
8950
8950
  // Propagate debug flag to Sentry CLI via environment variable
8951
8951
  // Only set if not already defined to respect user's explicit configuration
@@ -9226,8 +9226,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9226
9226
  return cliInstance.releases.uploadSourceMaps(options.release.name, {
9227
9227
  include: normalizedInclude,
9228
9228
  dist: options.release.dist,
9229
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9230
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9231
9229
  projects: getProjects(options.project),
9232
9230
  // We want this promise to throw if the sourcemaps fail to upload so that we know about it.
9233
9231
  // see: https://github.com/getsentry/sentry-cli/pull/2605
@@ -9431,8 +9429,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9431
9429
  dist: options.release.dist
9432
9430
  }],
9433
9431
  ignore: ignorePaths,
9434
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9435
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9436
9432
  projects: getProjects(options.project),
9437
9433
  live: "rejectOnError"
9438
9434
  });
@@ -9623,8 +9619,6 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
9623
9619
  rewrite: false,
9624
9620
  dist: options.release.dist
9625
9621
  }],
9626
- // @ts-expect-error - projects is not a valid option for uploadSourceMaps but is implemented in the CLI
9627
- // Remove once https://github.com/getsentry/sentry-cli/pull/2856 is released
9628
9622
  projects: getProjects(options.project),
9629
9623
  live: "rejectOnError"
9630
9624
  });
@@ -9828,18 +9822,14 @@ function sentryUnpluginFactory(_ref) {
9828
9822
  plugins.push({
9829
9823
  name: "sentry-telemetry-plugin",
9830
9824
  buildStart: function buildStart() {
9831
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9832
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9833
- while (1) switch (_context.prev = _context.next) {
9834
- case 0:
9835
- _context.next = 2;
9836
- return sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
9837
- case 2:
9838
- case "end":
9839
- return _context.stop();
9840
- }
9841
- }, _callee);
9842
- }))();
9825
+ // Technically, for very fast builds we might miss the telemetry signal
9826
+ // but it's okay because telemetry is not critical for us.
9827
+ // We cannot await the flush here because it would block the build start
9828
+ // which in turn would break module federation builds, see
9829
+ // https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/816
9830
+ void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal()["catch"](function () {
9831
+ // Nothing for the users to do here. If telemetry fails it's acceptable.
9832
+ });
9843
9833
  }
9844
9834
  });
9845
9835
  if (Object.keys(bundleSizeOptimizationReplacementValues).length > 0) {
@@ -9866,22 +9856,22 @@ function sentryUnpluginFactory(_ref) {
9866
9856
  plugins.push({
9867
9857
  name: "sentry-release-management-plugin",
9868
9858
  writeBundle: function writeBundle() {
9869
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9870
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9871
- while (1) switch (_context2.prev = _context2.next) {
9859
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9860
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9861
+ while (1) switch (_context.prev = _context.next) {
9872
9862
  case 0:
9873
- _context2.prev = 0;
9874
- _context2.next = 3;
9863
+ _context.prev = 0;
9864
+ _context.next = 3;
9875
9865
  return sentryBuildPluginManager.createRelease();
9876
9866
  case 3:
9877
- _context2.prev = 3;
9867
+ _context.prev = 3;
9878
9868
  freeGlobalDependencyOnBuildArtifacts();
9879
- return _context2.finish(3);
9869
+ return _context.finish(3);
9880
9870
  case 6:
9881
9871
  case "end":
9882
- return _context2.stop();
9872
+ return _context.stop();
9883
9873
  }
9884
- }, _callee2, null, [[0,, 3, 6]]);
9874
+ }, _callee, null, [[0,, 3, 6]]);
9885
9875
  }))();
9886
9876
  }
9887
9877
  });
@@ -9910,17 +9900,17 @@ function sentryUnpluginFactory(_ref) {
9910
9900
  plugins.push({
9911
9901
  name: "sentry-file-deletion-plugin",
9912
9902
  writeBundle: function writeBundle() {
9913
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
9914
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
9915
- while (1) switch (_context3.prev = _context3.next) {
9903
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9904
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9905
+ while (1) switch (_context2.prev = _context2.next) {
9916
9906
  case 0:
9917
- _context3.next = 2;
9907
+ _context2.next = 2;
9918
9908
  return sentryBuildPluginManager.deleteArtifacts();
9919
9909
  case 2:
9920
9910
  case "end":
9921
- return _context3.stop();
9911
+ return _context2.stop();
9922
9912
  }
9923
- }, _callee3);
9913
+ }, _callee2);
9924
9914
  }))();
9925
9915
  }
9926
9916
  });
@@ -10070,18 +10060,18 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10070
10060
  var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
10071
10061
  return {
10072
10062
  writeBundle: function writeBundle(outputOptions, bundle) {
10073
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10063
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10074
10064
  var outputDir, _buildArtifacts, _buildArtifacts2;
10075
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10076
- while (1) switch (_context4.prev = _context4.next) {
10065
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10066
+ while (1) switch (_context3.prev = _context3.next) {
10077
10067
  case 0:
10078
- _context4.prev = 0;
10068
+ _context3.prev = 0;
10079
10069
  if (!outputOptions.dir) {
10080
- _context4.next = 10;
10070
+ _context3.next = 10;
10081
10071
  break;
10082
10072
  }
10083
10073
  outputDir = outputOptions.dir;
10084
- _context4.next = 5;
10074
+ _context3.next = 5;
10085
10075
  return glob.glob(["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(function (q) {
10086
10076
  return "".concat(q, "?(\\?*)?(#*)");
10087
10077
  }),
@@ -10092,37 +10082,37 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10092
10082
  nodir: true
10093
10083
  });
10094
10084
  case 5:
10095
- _buildArtifacts = _context4.sent;
10096
- _context4.next = 8;
10085
+ _buildArtifacts = _context3.sent;
10086
+ _context3.next = 8;
10097
10087
  return upload(_buildArtifacts);
10098
10088
  case 8:
10099
- _context4.next = 18;
10089
+ _context3.next = 18;
10100
10090
  break;
10101
10091
  case 10:
10102
10092
  if (!outputOptions.file) {
10103
- _context4.next = 15;
10093
+ _context3.next = 15;
10104
10094
  break;
10105
10095
  }
10106
- _context4.next = 13;
10096
+ _context3.next = 13;
10107
10097
  return upload([outputOptions.file]);
10108
10098
  case 13:
10109
- _context4.next = 18;
10099
+ _context3.next = 18;
10110
10100
  break;
10111
10101
  case 15:
10112
10102
  _buildArtifacts2 = Object.keys(bundle).map(function (asset) {
10113
10103
  return path__namespace.join(path__namespace.resolve(), asset);
10114
10104
  });
10115
- _context4.next = 18;
10105
+ _context3.next = 18;
10116
10106
  return upload(_buildArtifacts2);
10117
10107
  case 18:
10118
- _context4.prev = 18;
10108
+ _context3.prev = 18;
10119
10109
  freeGlobalDependencyOnDebugIdSourcemapArtifacts();
10120
- return _context4.finish(18);
10110
+ return _context3.finish(18);
10121
10111
  case 21:
10122
10112
  case "end":
10123
- return _context4.stop();
10113
+ return _context3.stop();
10124
10114
  }
10125
- }, _callee4, null, [[0,, 18, 21]]);
10115
+ }, _callee3, null, [[0,, 18, 21]]);
10126
10116
  }))();
10127
10117
  }
10128
10118
  };
@@ -10130,26 +10120,26 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
10130
10120
  function createComponentNameAnnotateHooks(ignoredComponents) {
10131
10121
  return {
10132
10122
  transform: function transform(code, id) {
10133
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
10123
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10134
10124
  var idWithoutQueryAndHash, parserPlugins, _result$code, result;
10135
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10136
- while (1) switch (_context5.prev = _context5.next) {
10125
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10126
+ while (1) switch (_context4.prev = _context4.next) {
10137
10127
  case 0:
10138
10128
  // id may contain query and hash which will trip up our file extension logic below
10139
10129
  idWithoutQueryAndHash = stripQueryAndHashFromPath(id);
10140
10130
  if (!idWithoutQueryAndHash.match(/\\node_modules\\|\/node_modules\//)) {
10141
- _context5.next = 3;
10131
+ _context4.next = 3;
10142
10132
  break;
10143
10133
  }
10144
- return _context5.abrupt("return", null);
10134
+ return _context4.abrupt("return", null);
10145
10135
  case 3:
10146
10136
  if ([".jsx", ".tsx"].some(function (ending) {
10147
10137
  return idWithoutQueryAndHash.endsWith(ending);
10148
10138
  })) {
10149
- _context5.next = 5;
10139
+ _context4.next = 5;
10150
10140
  break;
10151
10141
  }
10152
- return _context5.abrupt("return", null);
10142
+ return _context4.abrupt("return", null);
10153
10143
  case 5:
10154
10144
  parserPlugins = [];
10155
10145
  if (idWithoutQueryAndHash.endsWith(".jsx")) {
@@ -10157,8 +10147,8 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10157
10147
  } else if (idWithoutQueryAndHash.endsWith(".tsx")) {
10158
10148
  parserPlugins.push("jsx", "typescript");
10159
10149
  }
10160
- _context5.prev = 7;
10161
- _context5.next = 10;
10150
+ _context4.prev = 7;
10151
+ _context4.next = 10;
10162
10152
  return core.transformAsync(code, {
10163
10153
  plugins: [[componentNameAnnotatePlugin__default["default"], {
10164
10154
  ignoredComponents: ignoredComponents
@@ -10175,24 +10165,24 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
10175
10165
  sourceMaps: true
10176
10166
  });
10177
10167
  case 10:
10178
- result = _context5.sent;
10179
- return _context5.abrupt("return", {
10168
+ result = _context4.sent;
10169
+ return _context4.abrupt("return", {
10180
10170
  code: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : code,
10181
10171
  map: result === null || result === void 0 ? void 0 : result.map
10182
10172
  });
10183
10173
  case 14:
10184
- _context5.prev = 14;
10185
- _context5.t0 = _context5["catch"](7);
10186
- logger.error("Failed to apply react annotate plugin", _context5.t0);
10174
+ _context4.prev = 14;
10175
+ _context4.t0 = _context4["catch"](7);
10176
+ logger.error("Failed to apply react annotate plugin", _context4.t0);
10187
10177
  case 17:
10188
- return _context5.abrupt("return", {
10178
+ return _context4.abrupt("return", {
10189
10179
  code: code
10190
10180
  });
10191
10181
  case 18:
10192
10182
  case "end":
10193
- return _context5.stop();
10183
+ return _context4.stop();
10194
10184
  }
10195
- }, _callee5, null, [[7, 14]]);
10185
+ }, _callee4, null, [[7, 14]]);
10196
10186
  }))();
10197
10187
  }
10198
10188
  };