@sentry/bundler-plugin-core 0.2.2 → 0.2.4

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
@@ -937,12 +937,16 @@ function validateOptions(options, logger) {
937
937
  }
938
938
 
939
939
  var SENTRY_SAAS_HOSTNAME = "sentry.io";
940
- function makeSentryClient(dsn, allowedToSendTelemetryPromise) {
940
+ function makeSentryClient(dsn, allowedToSendTelemetryPromise, userProject) {
941
941
  var client = new node.NodeClient({
942
942
  dsn: dsn,
943
943
  tracesSampleRate: 1,
944
944
  sampleRate: 1,
945
- release: "0.2.2",
945
+ // We're also sending the user project in dist because it is an indexed fieldso we can use this data effectively in
946
+ // a dashboard.
947
+ // Yes, this is slightly abusing the purpose of this field.
948
+ dist: userProject,
949
+ release: "0.2.4",
946
950
  integrations: [],
947
951
  tracePropagationTargets: ["sentry.io/api"],
948
952
  stackParser: node.defaultStackParser,
@@ -1655,7 +1659,7 @@ function getDryRunCLI(cli, logger) {
1655
1659
  // This probably doesn't work for all bundlers but for rollup it does.
1656
1660
 
1657
1661
  var RELEASE_INJECTOR_ID = "\0sentry-release-injector";
1658
- var ALLOWED_TRANSFORMATION_FILE_ENDINGS = [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs"];
1662
+ var ALLOWED_TRANSFORMATION_FILE_ENDINGS = [".js", ".ts", ".jsx", ".tsx", ".mjs"];
1659
1663
  /**
1660
1664
  * The sentry bundler plugin concerns itself with two things:
1661
1665
  * - Release injection
@@ -1688,7 +1692,7 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
1688
1692
  var internalOptions = normalizeUserOptions(options);
1689
1693
  var allowedToSendTelemetryPromise = shouldSendTelemetry(internalOptions);
1690
1694
 
1691
- var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise),
1695
+ var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise, internalOptions.project),
1692
1696
  sentryHub = _makeSentryClient.sentryHub,
1693
1697
  sentryClient = _makeSentryClient.sentryClient;
1694
1698
 
@@ -1904,11 +1908,12 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
1904
1908
  }
1905
1909
  });
1906
1910
  } else {
1911
+ var isInNodeModules = normalizedId.split(path__default["default"].sep).includes("node_modules");
1907
1912
  var pathIsOrdinary = !normalizedId.includes("?") && !normalizedId.includes("#");
1908
1913
  var pathHasAllowedFileEnding = ALLOWED_TRANSFORMATION_FILE_ENDINGS.some(function (allowedFileEnding) {
1909
1914
  return normalizedId.endsWith(allowedFileEnding);
1910
1915
  });
1911
- return pathIsOrdinary && pathHasAllowedFileEnding;
1916
+ return !isInNodeModules && pathIsOrdinary && pathHasAllowedFileEnding;
1912
1917
  }
1913
1918
  },
1914
1919