@sentry/bundler-plugin-core 2.3.0 → 2.4.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 +23 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +22 -8
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +5 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import * as util from 'util';
|
|
|
14
14
|
import { promisify } from 'util';
|
|
15
15
|
import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils';
|
|
16
16
|
import { NodeClient, defaultStackParser, makeNodeTransport, Hub } from '@sentry/node';
|
|
17
|
+
import * as dotenv from 'dotenv';
|
|
17
18
|
|
|
18
19
|
function ownKeys(object, enumerableOnly) {
|
|
19
20
|
var keys = Object.keys(object);
|
|
@@ -546,7 +547,7 @@ function stringToUUID(str) {
|
|
|
546
547
|
function determineReleaseName() {
|
|
547
548
|
var gitRevision;
|
|
548
549
|
try {
|
|
549
|
-
gitRevision = childProcess.execSync("git rev-parse
|
|
550
|
+
gitRevision = childProcess.execSync("git rev-parse HEAD").toString().trim();
|
|
550
551
|
} catch (e) {
|
|
551
552
|
// noop
|
|
552
553
|
}
|
|
@@ -1258,7 +1259,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
1258
1259
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
1259
1260
|
tracesSampleRate: 1,
|
|
1260
1261
|
sampleRate: 1,
|
|
1261
|
-
release: "2.
|
|
1262
|
+
release: "2.4.0",
|
|
1262
1263
|
integrations: [],
|
|
1263
1264
|
tracePropagationTargets: ["sentry.io/api"],
|
|
1264
1265
|
stackParser: defaultStackParser,
|
|
@@ -1447,6 +1448,24 @@ function sentryUnpluginFactory(_ref) {
|
|
|
1447
1448
|
debugIdInjectionPlugin = _ref.debugIdInjectionPlugin,
|
|
1448
1449
|
debugIdUploadPlugin = _ref.debugIdUploadPlugin;
|
|
1449
1450
|
return createUnplugin(function (userOptions, unpluginMetaContext) {
|
|
1451
|
+
var _userOptions$silent, _userOptions$debug;
|
|
1452
|
+
var logger = createLogger({
|
|
1453
|
+
prefix: "[sentry-".concat(unpluginMetaContext.framework, "-plugin]"),
|
|
1454
|
+
silent: (_userOptions$silent = userOptions.silent) !== null && _userOptions$silent !== void 0 ? _userOptions$silent : false,
|
|
1455
|
+
debug: (_userOptions$debug = userOptions.debug) !== null && _userOptions$debug !== void 0 ? _userOptions$debug : false
|
|
1456
|
+
});
|
|
1457
|
+
var dotenvResult = dotenv.config({
|
|
1458
|
+
path: path.join(process.cwd(), ".env.sentry-build-plugin")
|
|
1459
|
+
});
|
|
1460
|
+
|
|
1461
|
+
// Ignore "file not found" errors but throw all others
|
|
1462
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1463
|
+
// @ts-ignore Accessing `code` on error should be safe
|
|
1464
|
+
if (dotenvResult.error && dotenvResult.error.code !== "ENOENT") {
|
|
1465
|
+
throw dotenvResult.error;
|
|
1466
|
+
} else if (dotenvResult.parsed) {
|
|
1467
|
+
logger.info('Using environment variables configured in ".env.sentry-build-plugin".');
|
|
1468
|
+
}
|
|
1450
1469
|
var options = normalizeUserOptions(userOptions);
|
|
1451
1470
|
if (unpluginMetaContext.watchMode || options.disable) {
|
|
1452
1471
|
return [{
|
|
@@ -1467,14 +1486,9 @@ function sentryUnpluginFactory(_ref) {
|
|
|
1467
1486
|
sentEndSession = true;
|
|
1468
1487
|
}
|
|
1469
1488
|
});
|
|
1470
|
-
var logger = createLogger({
|
|
1471
|
-
prefix: "[sentry-".concat(unpluginMetaContext.framework, "-plugin]"),
|
|
1472
|
-
silent: options.silent,
|
|
1473
|
-
debug: options.debug
|
|
1474
|
-
});
|
|
1475
1489
|
|
|
1476
1490
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
1477
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.
|
|
1491
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.4.0");
|
|
1478
1492
|
function handleRecoverableError(unknownError) {
|
|
1479
1493
|
sentrySession.status = "abnormal";
|
|
1480
1494
|
try {
|