@sentry/bundler-plugin-core 3.2.3 → 3.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 +21 -44
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +21 -44
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/debug-id-upload.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/esm/index.mjs
CHANGED
|
@@ -8101,7 +8101,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
8101
8101
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
8102
8102
|
tracesSampleRate: 1,
|
|
8103
8103
|
sampleRate: 1,
|
|
8104
|
-
release: "3.2.
|
|
8104
|
+
release: "3.2.4",
|
|
8105
8105
|
integrations: [],
|
|
8106
8106
|
tracePropagationTargets: ["sentry.io/api"],
|
|
8107
8107
|
stackParser: stackParser,
|
|
@@ -8475,8 +8475,7 @@ function createDebugIdUploadFunction(_ref) {
|
|
|
8475
8475
|
paths: [tmpUploadFolder],
|
|
8476
8476
|
rewrite: false,
|
|
8477
8477
|
dist: dist
|
|
8478
|
-
}]
|
|
8479
|
-
useArtifactBundle: true
|
|
8478
|
+
}]
|
|
8480
8479
|
});
|
|
8481
8480
|
case 3:
|
|
8482
8481
|
case "end":
|
|
@@ -8560,9 +8559,16 @@ function createDebugIdUploadFunction(_ref) {
|
|
|
8560
8559
|
function prepareBundleForDebugIdUpload(_x4, _x5, _x6, _x7, _x8) {
|
|
8561
8560
|
return _prepareBundleForDebugIdUpload.apply(this, arguments);
|
|
8562
8561
|
}
|
|
8562
|
+
|
|
8563
|
+
/**
|
|
8564
|
+
* Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle
|
|
8565
|
+
* source and extracts the bundle's debug ID from it.
|
|
8566
|
+
*
|
|
8567
|
+
* The string pattern is injected via the debug ID injection snipped.
|
|
8568
|
+
*/
|
|
8563
8569
|
function _prepareBundleForDebugIdUpload() {
|
|
8564
8570
|
_prepareBundleForDebugIdUpload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(bundleFilePath, uploadFolder, chunkIndex, logger, rewriteSourcesHook) {
|
|
8565
|
-
var bundleContent, debugId,
|
|
8571
|
+
var bundleContent, debugId, uniqueUploadName, writeSourceFilePromise, writeSourceMapFilePromise;
|
|
8566
8572
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
8567
8573
|
while (1) switch (_context11.prev = _context11.next) {
|
|
8568
8574
|
case 0:
|
|
@@ -8587,13 +8593,9 @@ function _prepareBundleForDebugIdUpload() {
|
|
|
8587
8593
|
logger.debug("Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: ".concat(bundleFilePath));
|
|
8588
8594
|
return _context11.abrupt("return");
|
|
8589
8595
|
case 14:
|
|
8590
|
-
|
|
8596
|
+
uniqueUploadName = "".concat(debugId, "-").concat(chunkIndex);
|
|
8591
8597
|
bundleContent += "\n//# debugId=".concat(debugId);
|
|
8592
|
-
writeSourceFilePromise = fs__default.promises.
|
|
8593
|
-
recursive: true
|
|
8594
|
-
}).then(function () {
|
|
8595
|
-
return fs__default.promises.writeFile(uniqueSourceFileUploadPath, bundleContent, "utf-8");
|
|
8596
|
-
});
|
|
8598
|
+
writeSourceFilePromise = fs__default.promises.writeFile(path__default.join(uploadFolder, "".concat(uniqueUploadName, ".js")), bundleContent, "utf-8");
|
|
8597
8599
|
writeSourceMapFilePromise = determineSourceMapPathFromBundle(bundleFilePath, bundleContent, logger).then( /*#__PURE__*/function () {
|
|
8598
8600
|
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(sourceMapPath) {
|
|
8599
8601
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
@@ -8604,7 +8606,7 @@ function _prepareBundleForDebugIdUpload() {
|
|
|
8604
8606
|
break;
|
|
8605
8607
|
}
|
|
8606
8608
|
_context10.next = 3;
|
|
8607
|
-
return prepareSourceMapForDebugIdUpload(sourceMapPath,
|
|
8609
|
+
return prepareSourceMapForDebugIdUpload(sourceMapPath, path__default.join(uploadFolder, "".concat(uniqueUploadName, ".js.map")), debugId, rewriteSourcesHook, logger);
|
|
8608
8610
|
case 3:
|
|
8609
8611
|
case "end":
|
|
8610
8612
|
return _context10.stop();
|
|
@@ -8628,26 +8630,6 @@ function _prepareBundleForDebugIdUpload() {
|
|
|
8628
8630
|
}));
|
|
8629
8631
|
return _prepareBundleForDebugIdUpload.apply(this, arguments);
|
|
8630
8632
|
}
|
|
8631
|
-
function getUniqueUploadPath(uploadFolder, chunkIndex, filePath) {
|
|
8632
|
-
return path__default.join(uploadFolder, // We add a "chunk index" segment to the path that is a simple incrementing number to avoid name collisions.
|
|
8633
|
-
// Name collisions can happen when files are located "outside" of the current working directory, at different levels but they share a subpath.
|
|
8634
|
-
// Example:
|
|
8635
|
-
// - CWD: /root/foo/cwd
|
|
8636
|
-
// - File 1: /root/foo/index.js -> ../foo/index.js -> foo/index.js
|
|
8637
|
-
// - File 2: /foo/index.js -> ../../foo/index.js -> foo/index.js
|
|
8638
|
-
"".concat(chunkIndex), path__default.normalize(path__default.relative(process.cwd(), filePath).split(path__default.sep)
|
|
8639
|
-
// We filter out these "navigation" segments because a) they look ugly b) they will cause us to break out of the upload folder.
|
|
8640
|
-
.filter(function (segment) {
|
|
8641
|
-
return segment !== ".." && segment !== ".";
|
|
8642
|
-
}).join(path__default.sep)));
|
|
8643
|
-
}
|
|
8644
|
-
|
|
8645
|
-
/**
|
|
8646
|
-
* Looks for a particular string pattern (`sdbid-[debug ID]`) in the bundle
|
|
8647
|
-
* source and extracts the bundle's debug ID from it.
|
|
8648
|
-
*
|
|
8649
|
-
* The string pattern is injected via the debug ID injection snipped.
|
|
8650
|
-
*/
|
|
8651
8633
|
function determineDebugIdFromBundleSource(code) {
|
|
8652
8634
|
var match = code.match(/sentry-dbid-([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})/);
|
|
8653
8635
|
if (match) {
|
|
@@ -8774,27 +8756,22 @@ function _prepareSourceMapForDebugIdUpload() {
|
|
|
8774
8756
|
}
|
|
8775
8757
|
_context13.prev = 21;
|
|
8776
8758
|
_context13.next = 24;
|
|
8777
|
-
return fs__default.
|
|
8778
|
-
recursive: true
|
|
8779
|
-
});
|
|
8780
|
-
case 24:
|
|
8781
|
-
_context13.next = 26;
|
|
8782
|
-
return fs__default.promises.writeFile(targetPath, JSON.stringify(map), {
|
|
8759
|
+
return util.promisify(fs__default.writeFile)(targetPath, JSON.stringify(map), {
|
|
8783
8760
|
encoding: "utf8"
|
|
8784
8761
|
});
|
|
8785
|
-
case
|
|
8786
|
-
_context13.next =
|
|
8762
|
+
case 24:
|
|
8763
|
+
_context13.next = 30;
|
|
8787
8764
|
break;
|
|
8788
|
-
case
|
|
8789
|
-
_context13.prev =
|
|
8765
|
+
case 26:
|
|
8766
|
+
_context13.prev = 26;
|
|
8790
8767
|
_context13.t2 = _context13["catch"](21);
|
|
8791
8768
|
logger.error("Failed to prepare source map for debug ID upload: ".concat(sourceMapPath), _context13.t2);
|
|
8792
8769
|
return _context13.abrupt("return");
|
|
8793
|
-
case
|
|
8770
|
+
case 30:
|
|
8794
8771
|
case "end":
|
|
8795
8772
|
return _context13.stop();
|
|
8796
8773
|
}
|
|
8797
|
-
}, _callee13, null, [[0, 6], [10, 16], [21,
|
|
8774
|
+
}, _callee13, null, [[0, 6], [10, 16], [21, 26]]);
|
|
8798
8775
|
}));
|
|
8799
8776
|
return _prepareSourceMapForDebugIdUpload.apply(this, arguments);
|
|
8800
8777
|
}
|
|
@@ -9187,7 +9164,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9187
9164
|
});
|
|
9188
9165
|
|
|
9189
9166
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
9190
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "3.2.
|
|
9167
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "3.2.4");
|
|
9191
9168
|
|
|
9192
9169
|
/**
|
|
9193
9170
|
* Handles errors caught and emitted in various areas of the plugin.
|