@sentry/bundler-plugin-core 0.2.3 → 0.3.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
@@ -814,6 +814,7 @@ function normalizeUserOptions(userOptions) {
814
814
  // but CLI v2 uses `SENTRY_HEADER` (which is also better aligned with other naming)
815
815
  // In the spirit of maximum compatibility, we allow both here.
816
816
  customHeader: (_ref3 = (_userOptions$customHe = userOptions.customHeader) !== null && _userOptions$customHe !== void 0 ? _userOptions$customHe : process.env["SENTRY_HEADER"]) !== null && _ref3 !== void 0 ? _ref3 : process.env["CUSTOM_HEADER"],
817
+ headers: userOptions.headers,
817
818
  vcsRemote: userOptions.vcsRemote,
818
819
  // env var: `SENTRY_VSC_REMOTE`
819
820
  // Optional options
@@ -937,12 +938,16 @@ function validateOptions(options, logger) {
937
938
  }
938
939
 
939
940
  var SENTRY_SAAS_HOSTNAME = "sentry.io";
940
- function makeSentryClient(dsn, allowedToSendTelemetryPromise) {
941
+ function makeSentryClient(dsn, allowedToSendTelemetryPromise, userProject) {
941
942
  var client = new node.NodeClient({
942
943
  dsn: dsn,
943
944
  tracesSampleRate: 1,
944
945
  sampleRate: 1,
945
- release: "0.2.3",
946
+ // We're also sending the user project in dist because it is an indexed fieldso we can use this data effectively in
947
+ // a dashboard.
948
+ // Yes, this is slightly abusing the purpose of this field.
949
+ dist: userProject,
950
+ release: "0.3.0",
946
951
  integrations: [],
947
952
  tracePropagationTargets: ["sentry.io/api"],
948
953
  stackParser: node.defaultStackParser,
@@ -1094,12 +1099,12 @@ function _shouldSendTelemetry() {
1094
1099
  _shouldSendTelemetry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
1095
1100
  var _cliInfo$split$, _cliInfo$split$$repla;
1096
1101
 
1097
- var silent, org, project, authToken, url, vcsRemote, customHeader, dist, telemetry, dryRun, cli, cliInfo, cliInfoUrl;
1102
+ var silent, org, project, authToken, url, vcsRemote, customHeader, headers, telemetry, dryRun, cli, cliInfo, cliInfoUrl;
1098
1103
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1099
1104
  while (1) {
1100
1105
  switch (_context2.prev = _context2.next) {
1101
1106
  case 0:
1102
- silent = options.silent, org = options.org, project = options.project, authToken = options.authToken, url = options.url, vcsRemote = options.vcsRemote, customHeader = options.customHeader, dist = options.dist, telemetry = options.telemetry, dryRun = options.dryRun; // `options.telemetry` defaults to true
1107
+ silent = options.silent, org = options.org, project = options.project, authToken = options.authToken, url = options.url, vcsRemote = options.vcsRemote, customHeader = options.customHeader, headers = options.headers, telemetry = options.telemetry, dryRun = options.dryRun; // `options.telemetry` defaults to true
1103
1108
 
1104
1109
  if (!(telemetry === false)) {
1105
1110
  _context2.next = 3;
@@ -1131,9 +1136,9 @@ function _shouldSendTelemetry() {
1131
1136
  org: org,
1132
1137
  project: project,
1133
1138
  vcsRemote: vcsRemote,
1134
- dist: dist,
1135
1139
  silent: silent,
1136
- customHeader: customHeader
1140
+ customHeader: customHeader,
1141
+ headers: headers
1137
1142
  });
1138
1143
  _context2.prev = 8;
1139
1144
  _context2.next = 11;
@@ -1295,7 +1300,8 @@ function _uploadSourceMaps() {
1295
1300
  _context3.prev = 2;
1296
1301
  _context3.next = 5;
1297
1302
  return ctx.cli.releases.uploadSourceMaps(releaseName, {
1298
- include: options.include
1303
+ include: options.include,
1304
+ dist: options.dist
1299
1305
  });
1300
1306
 
1301
1307
  case 5:
@@ -1590,16 +1596,16 @@ function getSentryCli(internalOptions, logger) {
1590
1596
  url = internalOptions.url,
1591
1597
  vcsRemote = internalOptions.vcsRemote,
1592
1598
  customHeader = internalOptions.customHeader,
1593
- dist = internalOptions.dist;
1599
+ headers = internalOptions.headers;
1594
1600
  var cli = new SentryCli__default["default"](internalOptions.configFile, {
1595
1601
  url: url,
1596
1602
  authToken: authToken,
1597
1603
  org: org,
1598
1604
  project: project,
1599
1605
  vcsRemote: vcsRemote,
1600
- dist: dist,
1601
1606
  silent: silent,
1602
- customHeader: customHeader
1607
+ customHeader: customHeader,
1608
+ headers: headers
1603
1609
  });
1604
1610
 
1605
1611
  if (internalOptions.dryRun) {
@@ -1688,7 +1694,7 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
1688
1694
  var internalOptions = normalizeUserOptions(options);
1689
1695
  var allowedToSendTelemetryPromise = shouldSendTelemetry(internalOptions);
1690
1696
 
1691
- var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise),
1697
+ var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise, internalOptions.project),
1692
1698
  sentryHub = _makeSentryClient.sentryHub,
1693
1699
  sentryClient = _makeSentryClient.sentryClient;
1694
1700