@sentry/bundler-plugin-core 2.13.0 → 2.14.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.
- package/dist/cjs/index.js +27 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +25 -14
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/sentry/telemetry.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import SentryCli from '@sentry/cli';
|
|
2
2
|
import { transformAsync } from '@babel/core';
|
|
3
|
-
import
|
|
3
|
+
import componentNameAnnotatePlugin from '@sentry/babel-plugin-component-annotate';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import fs__default from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
@@ -340,6 +340,15 @@ function _regeneratorRuntime() {
|
|
|
340
340
|
}
|
|
341
341
|
}, exports;
|
|
342
342
|
}
|
|
343
|
+
function _typeof(obj) {
|
|
344
|
+
"@babel/helpers - typeof";
|
|
345
|
+
|
|
346
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
347
|
+
return typeof obj;
|
|
348
|
+
} : function (obj) {
|
|
349
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
350
|
+
}, _typeof(obj);
|
|
351
|
+
}
|
|
343
352
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
344
353
|
try {
|
|
345
354
|
var info = gen[key](arg);
|
|
@@ -705,7 +714,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
705
714
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
706
715
|
tracesSampleRate: 1,
|
|
707
716
|
sampleRate: 1,
|
|
708
|
-
release: "2.
|
|
717
|
+
release: "2.14.1",
|
|
709
718
|
integrations: [],
|
|
710
719
|
tracePropagationTargets: ["sentry.io/api"],
|
|
711
720
|
stackParser: defaultStackParser,
|
|
@@ -770,7 +779,8 @@ function setTelemetryDataOnHub(options, hub, bundler) {
|
|
|
770
779
|
project = options.project,
|
|
771
780
|
release = options.release,
|
|
772
781
|
errorHandler = options.errorHandler,
|
|
773
|
-
sourcemaps = options.sourcemaps
|
|
782
|
+
sourcemaps = options.sourcemaps,
|
|
783
|
+
reactComponentAnnotation = options.reactComponentAnnotation;
|
|
774
784
|
hub.setTag("upload-legacy-sourcemaps", !!release.uploadLegacySourcemaps);
|
|
775
785
|
if (release.uploadLegacySourcemaps) {
|
|
776
786
|
hub.setTag("uploadLegacySourcemapsEntries", Array.isArray(release.uploadLegacySourcemaps) ? release.uploadLegacySourcemaps.length : 1);
|
|
@@ -792,6 +802,7 @@ function setTelemetryDataOnHub(options, hub, bundler) {
|
|
|
792
802
|
hub.setTag("custom-error-handler", !!errorHandler);
|
|
793
803
|
hub.setTag("sourcemaps-assets", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.assets));
|
|
794
804
|
hub.setTag("delete-after-upload", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.deleteFilesAfterUpload) || !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.filesToDeleteAfterUpload));
|
|
805
|
+
hub.setTag("react-annotate", !!(reactComponentAnnotation !== null && reactComponentAnnotation !== void 0 && reactComponentAnnotation.enabled));
|
|
795
806
|
hub.setTag("node", process.version);
|
|
796
807
|
hub.setTag("platform", process.platform);
|
|
797
808
|
hub.setTags({
|
|
@@ -1583,17 +1594,17 @@ function sentryUnpluginFactory(_ref) {
|
|
|
1583
1594
|
silent: (_userOptions$silent = userOptions.silent) !== null && _userOptions$silent !== void 0 ? _userOptions$silent : false,
|
|
1584
1595
|
debug: (_userOptions$debug = userOptions.debug) !== null && _userOptions$debug !== void 0 ? _userOptions$debug : false
|
|
1585
1596
|
});
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1592
|
-
// @ts-ignore Accessing `code` on error should be safe
|
|
1593
|
-
if (dotenvResult.error && dotenvResult.error.code !== "ENOENT") {
|
|
1594
|
-
throw dotenvResult.error;
|
|
1595
|
-
} else if (dotenvResult.parsed) {
|
|
1597
|
+
try {
|
|
1598
|
+
var dotenvFile = fs.readFileSync(path.join(process.cwd(), ".env.sentry-build-plugin"), "utf-8");
|
|
1599
|
+
// NOTE: Do not use the dotenv.config API directly to read the dotenv file! For some ungodly reason, it falls back to reading `${process.cwd()}/.env` which is absolutely not what we want.
|
|
1600
|
+
var dotenvResult = dotenv.parse(dotenvFile);
|
|
1601
|
+
process.env = _objectSpread2(_objectSpread2({}, process.env), dotenvResult);
|
|
1596
1602
|
logger.info('Using environment variables configured in ".env.sentry-build-plugin".');
|
|
1603
|
+
} catch (e) {
|
|
1604
|
+
// Ignore "file not found" errors but throw all others
|
|
1605
|
+
if (_typeof(e) === "object" && e && "code" in e && e.code !== "ENOENT") {
|
|
1606
|
+
throw e;
|
|
1607
|
+
}
|
|
1597
1608
|
}
|
|
1598
1609
|
var options = normalizeUserOptions(userOptions);
|
|
1599
1610
|
if (unpluginMetaContext.watchMode || options.disable) {
|
|
@@ -1617,7 +1628,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
1617
1628
|
});
|
|
1618
1629
|
|
|
1619
1630
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
1620
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.
|
|
1631
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.14.1");
|
|
1621
1632
|
function handleRecoverableError(unknownError) {
|
|
1622
1633
|
sentrySession.status = "abnormal";
|
|
1623
1634
|
try {
|