@sentry/bundler-plugin-core 0.6.0 → 0.7.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 +177 -112
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +178 -113
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/options-mapping.d.ts +54 -4
- package/dist/types/sentry/cli.d.ts +2 -2
- package/dist/types/sentry/releasePipeline.d.ts +8 -8
- package/dist/types/sentry/telemetry.d.ts +3 -3
- package/dist/types/types.d.ts +28 -19
- package/package.json +25 -5
- package/sentry-esbuild-debugid-injection-file.js +18 -0
package/dist/cjs/index.js
CHANGED
|
@@ -46,7 +46,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
|
46
46
|
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
47
47
|
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
|
48
48
|
var util__namespace = /*#__PURE__*/_interopNamespace(util);
|
|
49
|
-
var
|
|
49
|
+
var webpackSources__default = /*#__PURE__*/_interopDefaultLegacy(webpackSources);
|
|
50
50
|
|
|
51
51
|
function _regeneratorRuntime() {
|
|
52
52
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
@@ -982,6 +982,7 @@ function normalizeUserOptions(userOptions) {
|
|
|
982
982
|
injectReleasesMap: (_userOptions$injectRe = userOptions.injectReleasesMap) !== null && _userOptions$injectRe !== void 0 ? _userOptions$injectRe : false,
|
|
983
983
|
injectRelease: (_userOptions$injectRe2 = userOptions.injectRelease) !== null && _userOptions$injectRe2 !== void 0 ? _userOptions$injectRe2 : true,
|
|
984
984
|
uploadSourceMaps: (_userOptions$uploadSo = userOptions.uploadSourceMaps) !== null && _userOptions$uploadSo !== void 0 ? _userOptions$uploadSo : true,
|
|
985
|
+
sourcemaps: userOptions.sourcemaps,
|
|
985
986
|
_experiments: (_userOptions$_experim = userOptions._experiments) !== null && _userOptions$_experim !== void 0 ? _userOptions$_experim : {},
|
|
986
987
|
// These options and can also be set via env variables or the config file.
|
|
987
988
|
// If they're set in the options, we simply pass them to the CLI constructor.
|
|
@@ -1033,6 +1034,10 @@ function normalizeReleaseInjectionTargets(userReleaseInjectionTargets) {
|
|
|
1033
1034
|
|
|
1034
1035
|
|
|
1035
1036
|
function normalizeInclude(userOptions) {
|
|
1037
|
+
if (!userOptions.include) {
|
|
1038
|
+
return [];
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1036
1041
|
return arrayify(userOptions.include).map(function (includeItem) {
|
|
1037
1042
|
return typeof includeItem === "string" ? {
|
|
1038
1043
|
paths: [includeItem]
|
|
@@ -1122,7 +1127,7 @@ function makeSentryClient(dsn, allowedToSendTelemetryPromise, userProject) {
|
|
|
1122
1127
|
// a dashboard.
|
|
1123
1128
|
// Yes, this is slightly abusing the purpose of this field.
|
|
1124
1129
|
dist: userProject,
|
|
1125
|
-
release: "0.
|
|
1130
|
+
release: "0.7.1",
|
|
1126
1131
|
integrations: [],
|
|
1127
1132
|
tracePropagationTargets: ["sentry.io/api"],
|
|
1128
1133
|
stackParser: node.defaultStackParser,
|
|
@@ -1225,7 +1230,7 @@ function addPluginOptionInformationToHub(options, hub, bundler) {
|
|
|
1225
1230
|
errorHandler = options.errorHandler,
|
|
1226
1231
|
deploy = options.deploy,
|
|
1227
1232
|
include = options.include,
|
|
1228
|
-
|
|
1233
|
+
sourcemaps = options.sourcemaps;
|
|
1229
1234
|
hub.setTag("include", include.length > 1 ? "multiple-entries" : "single-entry"); // Optional release pipeline steps
|
|
1230
1235
|
|
|
1231
1236
|
if (cleanArtifacts) {
|
|
@@ -1257,7 +1262,7 @@ function addPluginOptionInformationToHub(options, hub, bundler) {
|
|
|
1257
1262
|
hub.setTag("error-handler", "custom");
|
|
1258
1263
|
}
|
|
1259
1264
|
|
|
1260
|
-
if (
|
|
1265
|
+
if (sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.assets) {
|
|
1261
1266
|
hub.setTag("debug-id-upload", true);
|
|
1262
1267
|
}
|
|
1263
1268
|
|
|
@@ -2147,6 +2152,8 @@ function _prepareSourceMapForDebugIdUpload() {
|
|
|
2147
2152
|
var ALLOWED_TRANSFORMATION_FILE_ENDINGS = [".js", ".ts", ".jsx", ".tsx", ".mjs"];
|
|
2148
2153
|
|
|
2149
2154
|
var releaseInjectionFilePath = require.resolve("@sentry/bundler-plugin-core/sentry-release-injection-file");
|
|
2155
|
+
|
|
2156
|
+
var esbuildDebugIdInjectionFilePath = require.resolve("@sentry/bundler-plugin-core/sentry-esbuild-debugid-injection-file");
|
|
2150
2157
|
/**
|
|
2151
2158
|
* The sentry bundler plugin concerns itself with two things:
|
|
2152
2159
|
* - Release injection
|
|
@@ -2176,15 +2183,15 @@ var releaseInjectionFilePath = require.resolve("@sentry/bundler-plugin-core/sent
|
|
|
2176
2183
|
*/
|
|
2177
2184
|
|
|
2178
2185
|
|
|
2179
|
-
var unplugin = unplugin$1.createUnplugin(function (
|
|
2180
|
-
var
|
|
2181
|
-
var allowedToSendTelemetryPromise = shouldSendTelemetry(
|
|
2186
|
+
var unplugin = unplugin$1.createUnplugin(function (userOptions, unpluginMetaContext) {
|
|
2187
|
+
var options = normalizeUserOptions(userOptions);
|
|
2188
|
+
var allowedToSendTelemetryPromise = shouldSendTelemetry(options);
|
|
2182
2189
|
|
|
2183
|
-
var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise,
|
|
2190
|
+
var _makeSentryClient = makeSentryClient("https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737", allowedToSendTelemetryPromise, options.project),
|
|
2184
2191
|
sentryHub = _makeSentryClient.sentryHub,
|
|
2185
2192
|
sentryClient = _makeSentryClient.sentryClient;
|
|
2186
2193
|
|
|
2187
|
-
addPluginOptionInformationToHub(
|
|
2194
|
+
addPluginOptionInformationToHub(options, sentryHub, unpluginMetaContext.framework); //TODO: This call is problematic because as soon as we set our hub as the current hub
|
|
2188
2195
|
// we might interfere with other plugins that use Sentry. However, for now, we'll
|
|
2189
2196
|
// leave it in because without it, we can't get distributed traces (which are pretty nice)
|
|
2190
2197
|
// Let's keep it until someone complains about interference.
|
|
@@ -2193,25 +2200,26 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2193
2200
|
node.makeMain(sentryHub);
|
|
2194
2201
|
var logger = createLogger({
|
|
2195
2202
|
prefix: "[sentry-".concat(unpluginMetaContext.framework, "-plugin]"),
|
|
2196
|
-
silent:
|
|
2197
|
-
debug:
|
|
2203
|
+
silent: options.silent,
|
|
2204
|
+
debug: options.debug
|
|
2198
2205
|
});
|
|
2199
2206
|
|
|
2200
|
-
if (!validateOptions(
|
|
2201
|
-
handleError(new Error("Options were not set correctly. See output above for more details."), logger,
|
|
2207
|
+
if (!validateOptions(options, logger)) {
|
|
2208
|
+
handleError(new Error("Options were not set correctly. See output above for more details."), logger, options.errorHandler);
|
|
2202
2209
|
}
|
|
2203
2210
|
|
|
2204
|
-
var cli = getSentryCli(
|
|
2211
|
+
var cli = getSentryCli(options, logger);
|
|
2205
2212
|
var releaseNamePromise = new Promise(function (resolve) {
|
|
2206
|
-
if (
|
|
2207
|
-
resolve(
|
|
2213
|
+
if (userOptions.release) {
|
|
2214
|
+
resolve(userOptions.release);
|
|
2208
2215
|
} else {
|
|
2209
2216
|
resolve(cli.releases.proposeVersion());
|
|
2210
2217
|
}
|
|
2211
2218
|
});
|
|
2212
2219
|
var transaction;
|
|
2213
2220
|
var releaseInjectionSpan;
|
|
2214
|
-
|
|
2221
|
+
var plugins = [];
|
|
2222
|
+
plugins.push({
|
|
2215
2223
|
name: "sentry-plugin",
|
|
2216
2224
|
enforce: "pre",
|
|
2217
2225
|
// needed for Vite to call resolveId hook
|
|
@@ -2259,7 +2267,7 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2259
2267
|
|
|
2260
2268
|
// At this point, we either have determined a release or we have to bail
|
|
2261
2269
|
if (!releaseName) {
|
|
2262
|
-
handleError(new Error("Unable to determine a release name. Make sure to set the `release` option or use an environment that supports auto-detection https://docs.sentry.io/cli/releases/#creating-releases`"), logger,
|
|
2270
|
+
handleError(new Error("Unable to determine a release name. Make sure to set the `release` option or use an environment that supports auto-detection https://docs.sentry.io/cli/releases/#creating-releases`"), logger, options.errorHandler);
|
|
2263
2271
|
}
|
|
2264
2272
|
|
|
2265
2273
|
transaction = sentryHub.startTransaction({
|
|
@@ -2328,13 +2336,13 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2328
2336
|
|
|
2329
2337
|
var normalizedId = path__default["default"].normalize(id);
|
|
2330
2338
|
|
|
2331
|
-
if (
|
|
2339
|
+
if (options.releaseInjectionTargets) {
|
|
2332
2340
|
// If there's an `releaseInjectionTargets` option transform (ie. inject the release varible) when the file path matches the option.
|
|
2333
|
-
if (typeof
|
|
2334
|
-
return
|
|
2341
|
+
if (typeof options.releaseInjectionTargets === "function") {
|
|
2342
|
+
return options.releaseInjectionTargets(normalizedId);
|
|
2335
2343
|
}
|
|
2336
2344
|
|
|
2337
|
-
return
|
|
2345
|
+
return options.releaseInjectionTargets.some(function (entry) {
|
|
2338
2346
|
if (entry instanceof RegExp) {
|
|
2339
2347
|
return entry.test(normalizedId);
|
|
2340
2348
|
} else {
|
|
@@ -2370,7 +2378,7 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2370
2378
|
id: id
|
|
2371
2379
|
});
|
|
2372
2380
|
|
|
2373
|
-
if (
|
|
2381
|
+
if (options.injectRelease) {
|
|
2374
2382
|
_context2.next = 3;
|
|
2375
2383
|
break;
|
|
2376
2384
|
}
|
|
@@ -2393,10 +2401,10 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2393
2401
|
|
|
2394
2402
|
case 9:
|
|
2395
2403
|
_context2.t2 = _context2.sent;
|
|
2396
|
-
_context2.t3 =
|
|
2397
|
-
_context2.t4 =
|
|
2398
|
-
_context2.t5 =
|
|
2399
|
-
_context2.t6 =
|
|
2404
|
+
_context2.t3 = options.injectReleasesMap;
|
|
2405
|
+
_context2.t4 = options._experiments.injectBuildInformation || false;
|
|
2406
|
+
_context2.t5 = options.org;
|
|
2407
|
+
_context2.t6 = options.project;
|
|
2400
2408
|
_context2.t7 = {
|
|
2401
2409
|
release: _context2.t2,
|
|
2402
2410
|
injectReleasesMap: _context2.t3,
|
|
@@ -2445,14 +2453,14 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2445
2453
|
* Sentry.io, uploading sourcemaps, associating commits and deploys and finalizing the release)
|
|
2446
2454
|
*/
|
|
2447
2455
|
writeBundle: function writeBundle() {
|
|
2448
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2456
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
2449
2457
|
var _releaseInjectionSpan;
|
|
2450
2458
|
|
|
2451
|
-
var releasePipelineSpan, ctx, releaseName, tmpUploadFolder, _transaction, debugIdChunkFilePaths, sourceFileUploadFolderPromise, _transaction2, _transaction3;
|
|
2459
|
+
var releasePipelineSpan, ctx, releaseName, tmpUploadFolder, _transaction, _options$sourcemaps, debugIdChunkFilePaths, sourceFileUploadFolderPromise, _transaction2, _transaction3;
|
|
2452
2460
|
|
|
2453
|
-
return _regeneratorRuntime().wrap(function
|
|
2461
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2454
2462
|
while (1) {
|
|
2455
|
-
switch (
|
|
2463
|
+
switch (_context5.prev = _context5.next) {
|
|
2456
2464
|
case 0:
|
|
2457
2465
|
logger.debug('Called "writeBundle"');
|
|
2458
2466
|
(_releaseInjectionSpan = releaseInjectionSpan) === null || _releaseInjectionSpan === void 0 ? void 0 : _releaseInjectionSpan.finish();
|
|
@@ -2472,55 +2480,59 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2472
2480
|
logger: logger,
|
|
2473
2481
|
cli: cli
|
|
2474
2482
|
};
|
|
2475
|
-
|
|
2483
|
+
_context5.next = 7;
|
|
2476
2484
|
return releaseNamePromise;
|
|
2477
2485
|
|
|
2478
2486
|
case 7:
|
|
2479
|
-
releaseName =
|
|
2480
|
-
|
|
2487
|
+
releaseName = _context5.sent;
|
|
2488
|
+
_context5.prev = 8;
|
|
2481
2489
|
|
|
2482
2490
|
if (unpluginMetaContext.watchMode) {
|
|
2483
|
-
|
|
2491
|
+
_context5.next = 37;
|
|
2484
2492
|
break;
|
|
2485
2493
|
}
|
|
2486
2494
|
|
|
2487
|
-
if (!
|
|
2488
|
-
|
|
2495
|
+
if (!((_options$sourcemaps = options.sourcemaps) !== null && _options$sourcemaps !== void 0 && _options$sourcemaps.assets)) {
|
|
2496
|
+
_context5.next = 25;
|
|
2489
2497
|
break;
|
|
2490
2498
|
}
|
|
2491
2499
|
|
|
2492
|
-
|
|
2493
|
-
return glob.glob(
|
|
2500
|
+
_context5.next = 13;
|
|
2501
|
+
return glob.glob(options.sourcemaps.assets, {
|
|
2494
2502
|
absolute: true,
|
|
2495
2503
|
nodir: true,
|
|
2496
|
-
ignore:
|
|
2504
|
+
ignore: options.sourcemaps.ignore
|
|
2497
2505
|
});
|
|
2498
2506
|
|
|
2499
2507
|
case 13:
|
|
2500
|
-
debugIdChunkFilePaths =
|
|
2501
|
-
return p.endsWith(".js") || p.endsWith(".mjs");
|
|
2508
|
+
debugIdChunkFilePaths = _context5.sent.filter(function (p) {
|
|
2509
|
+
return p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs");
|
|
2502
2510
|
});
|
|
2503
|
-
|
|
2504
|
-
|
|
2511
|
+
|
|
2512
|
+
if (!(unpluginMetaContext.framework === "esbuild")) {
|
|
2513
|
+
_context5.next = 17;
|
|
2514
|
+
break;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
_context5.next = 17;
|
|
2505
2518
|
return Promise.all(debugIdChunkFilePaths.map( /*#__PURE__*/function () {
|
|
2506
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(
|
|
2519
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(debugIdChunkFilePath) {
|
|
2520
|
+
var chunkFileContents, debugId, newChunkFileContents;
|
|
2507
2521
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2508
2522
|
while (1) {
|
|
2509
2523
|
switch (_context3.prev = _context3.next) {
|
|
2510
2524
|
case 0:
|
|
2511
|
-
_context3.
|
|
2512
|
-
|
|
2513
|
-
_context3.next = 4;
|
|
2514
|
-
return sourceFileUploadFolderPromise;
|
|
2525
|
+
_context3.next = 2;
|
|
2526
|
+
return util.promisify(fs__default["default"].readFile)(debugIdChunkFilePath, "utf-8");
|
|
2515
2527
|
|
|
2516
|
-
case
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
_context3.next =
|
|
2521
|
-
return (
|
|
2528
|
+
case 2:
|
|
2529
|
+
chunkFileContents = _context3.sent;
|
|
2530
|
+
debugId = stringToUUID(chunkFileContents);
|
|
2531
|
+
newChunkFileContents = chunkFileContents.replace(/__SENTRY_DEBUG_ID__/g, debugId);
|
|
2532
|
+
_context3.next = 7;
|
|
2533
|
+
return util.promisify(fs__default["default"].writeFile)(debugIdChunkFilePath, newChunkFileContents, "utf-8");
|
|
2522
2534
|
|
|
2523
|
-
case
|
|
2535
|
+
case 7:
|
|
2524
2536
|
case "end":
|
|
2525
2537
|
return _context3.stop();
|
|
2526
2538
|
}
|
|
@@ -2528,61 +2540,95 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2528
2540
|
}, _callee3);
|
|
2529
2541
|
}));
|
|
2530
2542
|
|
|
2531
|
-
return function (_x
|
|
2543
|
+
return function (_x) {
|
|
2532
2544
|
return _ref2.apply(this, arguments);
|
|
2533
2545
|
};
|
|
2534
2546
|
}()));
|
|
2535
2547
|
|
|
2536
2548
|
case 17:
|
|
2537
|
-
|
|
2538
|
-
|
|
2549
|
+
sourceFileUploadFolderPromise = util.promisify(fs__default["default"].mkdtemp)(path__default["default"].join(os__default["default"].tmpdir(), "sentry-bundler-plugin-upload-"));
|
|
2550
|
+
_context5.next = 20;
|
|
2551
|
+
return Promise.all(debugIdChunkFilePaths.map( /*#__PURE__*/function () {
|
|
2552
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(chunkFilePath, chunkIndex) {
|
|
2553
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2554
|
+
while (1) {
|
|
2555
|
+
switch (_context4.prev = _context4.next) {
|
|
2556
|
+
case 0:
|
|
2557
|
+
_context4.t0 = prepareBundleForDebugIdUpload;
|
|
2558
|
+
_context4.t1 = chunkFilePath;
|
|
2559
|
+
_context4.next = 4;
|
|
2560
|
+
return sourceFileUploadFolderPromise;
|
|
2539
2561
|
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2562
|
+
case 4:
|
|
2563
|
+
_context4.t2 = _context4.sent;
|
|
2564
|
+
_context4.t3 = String(chunkIndex);
|
|
2565
|
+
_context4.t4 = logger;
|
|
2566
|
+
_context4.next = 9;
|
|
2567
|
+
return (0, _context4.t0)(_context4.t1, _context4.t2, _context4.t3, _context4.t4);
|
|
2568
|
+
|
|
2569
|
+
case 9:
|
|
2570
|
+
case "end":
|
|
2571
|
+
return _context4.stop();
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
}, _callee4);
|
|
2575
|
+
}));
|
|
2576
|
+
|
|
2577
|
+
return function (_x2, _x3) {
|
|
2578
|
+
return _ref3.apply(this, arguments);
|
|
2579
|
+
};
|
|
2580
|
+
}()));
|
|
2581
|
+
|
|
2582
|
+
case 20:
|
|
2583
|
+
_context5.next = 22;
|
|
2584
|
+
return sourceFileUploadFolderPromise;
|
|
2544
2585
|
|
|
2545
2586
|
case 22:
|
|
2546
|
-
|
|
2547
|
-
|
|
2587
|
+
tmpUploadFolder = _context5.sent;
|
|
2588
|
+
_context5.next = 25;
|
|
2589
|
+
return uploadDebugIdSourcemaps(options, ctx, tmpUploadFolder, releaseName);
|
|
2548
2590
|
|
|
2549
|
-
case
|
|
2550
|
-
|
|
2551
|
-
return
|
|
2591
|
+
case 25:
|
|
2592
|
+
_context5.next = 27;
|
|
2593
|
+
return createNewRelease(options, ctx, releaseName);
|
|
2594
|
+
|
|
2595
|
+
case 27:
|
|
2596
|
+
_context5.next = 29;
|
|
2597
|
+
return cleanArtifacts(options, ctx, releaseName);
|
|
2552
2598
|
|
|
2553
|
-
case
|
|
2554
|
-
|
|
2555
|
-
return uploadSourceMaps(
|
|
2599
|
+
case 29:
|
|
2600
|
+
_context5.next = 31;
|
|
2601
|
+
return uploadSourceMaps(options, ctx, releaseName);
|
|
2556
2602
|
|
|
2557
|
-
case
|
|
2558
|
-
|
|
2559
|
-
return setCommits(
|
|
2603
|
+
case 31:
|
|
2604
|
+
_context5.next = 33;
|
|
2605
|
+
return setCommits(options, ctx, releaseName);
|
|
2560
2606
|
|
|
2561
|
-
case
|
|
2562
|
-
|
|
2563
|
-
return finalizeRelease(
|
|
2607
|
+
case 33:
|
|
2608
|
+
_context5.next = 35;
|
|
2609
|
+
return finalizeRelease(options, ctx, releaseName);
|
|
2564
2610
|
|
|
2565
|
-
case
|
|
2566
|
-
|
|
2567
|
-
return addDeploy(
|
|
2611
|
+
case 35:
|
|
2612
|
+
_context5.next = 37;
|
|
2613
|
+
return addDeploy(options, ctx, releaseName);
|
|
2568
2614
|
|
|
2569
|
-
case
|
|
2615
|
+
case 37:
|
|
2570
2616
|
(_transaction = transaction) === null || _transaction === void 0 ? void 0 : _transaction.setStatus("ok");
|
|
2571
|
-
|
|
2617
|
+
_context5.next = 45;
|
|
2572
2618
|
break;
|
|
2573
2619
|
|
|
2574
|
-
case
|
|
2575
|
-
|
|
2576
|
-
|
|
2620
|
+
case 40:
|
|
2621
|
+
_context5.prev = 40;
|
|
2622
|
+
_context5.t0 = _context5["catch"](8);
|
|
2577
2623
|
(_transaction2 = transaction) === null || _transaction2 === void 0 ? void 0 : _transaction2.setStatus("cancelled");
|
|
2578
2624
|
sentryHub.addBreadcrumb({
|
|
2579
2625
|
level: "error",
|
|
2580
2626
|
message: "Error during writeBundle"
|
|
2581
2627
|
});
|
|
2582
|
-
handleError(
|
|
2628
|
+
handleError(_context5.t0, logger, options.errorHandler);
|
|
2583
2629
|
|
|
2584
|
-
case
|
|
2585
|
-
|
|
2630
|
+
case 45:
|
|
2631
|
+
_context5.prev = 45;
|
|
2586
2632
|
|
|
2587
2633
|
if (tmpUploadFolder) {
|
|
2588
2634
|
fs__default["default"].rm(tmpUploadFolder, {
|
|
@@ -2594,33 +2640,33 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2594
2640
|
|
|
2595
2641
|
releasePipelineSpan === null || releasePipelineSpan === void 0 ? void 0 : releasePipelineSpan.finish();
|
|
2596
2642
|
(_transaction3 = transaction) === null || _transaction3 === void 0 ? void 0 : _transaction3.finish();
|
|
2597
|
-
|
|
2643
|
+
_context5.next = 51;
|
|
2598
2644
|
return sentryClient.flush().then(null, function () {
|
|
2599
2645
|
logger.warn("Sending of telemetry failed");
|
|
2600
2646
|
});
|
|
2601
2647
|
|
|
2602
|
-
case
|
|
2603
|
-
return
|
|
2648
|
+
case 51:
|
|
2649
|
+
return _context5.finish(45);
|
|
2604
2650
|
|
|
2605
|
-
case
|
|
2651
|
+
case 52:
|
|
2606
2652
|
sentryHub.addBreadcrumb({
|
|
2607
2653
|
category: "writeBundle:finish",
|
|
2608
2654
|
level: "info"
|
|
2609
2655
|
});
|
|
2610
2656
|
|
|
2611
|
-
case
|
|
2657
|
+
case 53:
|
|
2612
2658
|
case "end":
|
|
2613
|
-
return
|
|
2659
|
+
return _context5.stop();
|
|
2614
2660
|
}
|
|
2615
2661
|
}
|
|
2616
|
-
},
|
|
2662
|
+
}, _callee5, null, [[8, 40, 45, 52]]);
|
|
2617
2663
|
}))();
|
|
2618
2664
|
},
|
|
2619
2665
|
rollup: {
|
|
2620
2666
|
renderChunk: function renderChunk(code, chunk) {
|
|
2621
|
-
var _options$
|
|
2667
|
+
var _options$sourcemaps2;
|
|
2622
2668
|
|
|
2623
|
-
if ((_options$
|
|
2669
|
+
if ((_options$sourcemaps2 = options.sourcemaps) !== null && _options$sourcemaps2 !== void 0 && _options$sourcemaps2.assets && [".js", ".mjs", ".cjs"].some(function (ending) {
|
|
2624
2670
|
return chunk.fileName.endsWith(ending);
|
|
2625
2671
|
}) // chunks could be any file (html, md, ...)
|
|
2626
2672
|
) {
|
|
@@ -2632,9 +2678,9 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2632
2678
|
},
|
|
2633
2679
|
vite: {
|
|
2634
2680
|
renderChunk: function renderChunk(code, chunk) {
|
|
2635
|
-
var _options$
|
|
2681
|
+
var _options$sourcemaps3;
|
|
2636
2682
|
|
|
2637
|
-
if ((_options$
|
|
2683
|
+
if ((_options$sourcemaps3 = options.sourcemaps) !== null && _options$sourcemaps3 !== void 0 && _options$sourcemaps3.assets && [".js", ".mjs", ".cjs"].some(function (ending) {
|
|
2638
2684
|
return chunk.fileName.endsWith(ending);
|
|
2639
2685
|
}) // chunks could be any file (html, md, ...)
|
|
2640
2686
|
) {
|
|
@@ -2645,9 +2691,9 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2645
2691
|
}
|
|
2646
2692
|
},
|
|
2647
2693
|
webpack: function webpack(compiler) {
|
|
2648
|
-
var _options$
|
|
2694
|
+
var _options$sourcemaps4;
|
|
2649
2695
|
|
|
2650
|
-
if ((_options$
|
|
2696
|
+
if ((_options$sourcemaps4 = options.sourcemaps) !== null && _options$sourcemaps4 !== void 0 && _options$sourcemaps4.assets) {
|
|
2651
2697
|
// Cache inspired by https://github.com/webpack/webpack/pull/15454
|
|
2652
2698
|
var cache = new WeakMap();
|
|
2653
2699
|
compiler.hooks.compilation.tap("sentry-plugin", function (compilation) {
|
|
@@ -2682,7 +2728,7 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2682
2728
|
newSourceMap.sources = originalSourceMap.sources; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2683
2729
|
|
|
2684
2730
|
newSourceMap.sourcesContent = originalSourceMap.sourcesContent;
|
|
2685
|
-
var newSource = new
|
|
2731
|
+
var newSource = new webpackSources__default["default"].SourceMapSource(newCode, fileName, // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
2686
2732
|
originalSourceMap, originalCode, newSourceMap, false);
|
|
2687
2733
|
cache.set(oldSource, newSource);
|
|
2688
2734
|
return newSource;
|
|
@@ -2693,7 +2739,26 @@ var unplugin = unplugin$1.createUnplugin(function (options, unpluginMetaContext)
|
|
|
2693
2739
|
});
|
|
2694
2740
|
}
|
|
2695
2741
|
}
|
|
2696
|
-
};
|
|
2742
|
+
});
|
|
2743
|
+
|
|
2744
|
+
if (unpluginMetaContext.framework === "esbuild") {
|
|
2745
|
+
var _options$sourcemaps5;
|
|
2746
|
+
|
|
2747
|
+
if ((_options$sourcemaps5 = options.sourcemaps) !== null && _options$sourcemaps5 !== void 0 && _options$sourcemaps5.assets) {
|
|
2748
|
+
plugins.push({
|
|
2749
|
+
name: "sentry-esbuild-debug-id-plugin",
|
|
2750
|
+
esbuild: {
|
|
2751
|
+
setup: function setup(_ref4) {
|
|
2752
|
+
var initialOptions = _ref4.initialOptions;
|
|
2753
|
+
initialOptions.inject = initialOptions.inject || [];
|
|
2754
|
+
initialOptions.inject.push(esbuildDebugIdInjectionFilePath);
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
});
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
return plugins;
|
|
2697
2762
|
});
|
|
2698
2763
|
|
|
2699
2764
|
function handleError(unknownError, logger, errorHandler) {
|
|
@@ -2719,12 +2784,12 @@ function handleError(unknownError, logger, errorHandler) {
|
|
|
2719
2784
|
*/
|
|
2720
2785
|
|
|
2721
2786
|
|
|
2722
|
-
function generateGlobalInjectorCode(
|
|
2723
|
-
var release =
|
|
2724
|
-
injectReleasesMap =
|
|
2725
|
-
injectBuildInformation =
|
|
2726
|
-
org =
|
|
2727
|
-
project =
|
|
2787
|
+
function generateGlobalInjectorCode(_ref5) {
|
|
2788
|
+
var release = _ref5.release,
|
|
2789
|
+
injectReleasesMap = _ref5.injectReleasesMap,
|
|
2790
|
+
injectBuildInformation = _ref5.injectBuildInformation,
|
|
2791
|
+
org = _ref5.org,
|
|
2792
|
+
project = _ref5.project;
|
|
2728
2793
|
// The code below is mostly ternary operators because it saves bundle size.
|
|
2729
2794
|
// The checks are to support as many environments as possible. (Node.js, Browser, webworkers, etc.)
|
|
2730
2795
|
var code = "\n var _global =\n typeof window !== 'undefined' ?\n window :\n typeof global !== 'undefined' ?\n global :\n typeof self !== 'undefined' ?\n self :\n {};\n\n _global.SENTRY_RELEASE={id:\"".concat(release, "\"};");
|
|
@@ -2745,12 +2810,12 @@ function generateGlobalInjectorCode(_ref3) {
|
|
|
2745
2810
|
function getBuildInformation() {
|
|
2746
2811
|
var packageJson = getPackageJson();
|
|
2747
2812
|
|
|
2748
|
-
var
|
|
2813
|
+
var _ref6 = packageJson ? getDependencies(packageJson) : {
|
|
2749
2814
|
deps: [],
|
|
2750
2815
|
depsVersions: {}
|
|
2751
2816
|
},
|
|
2752
|
-
deps =
|
|
2753
|
-
depsVersions =
|
|
2817
|
+
deps = _ref6.deps,
|
|
2818
|
+
depsVersions = _ref6.depsVersions;
|
|
2754
2819
|
|
|
2755
2820
|
return {
|
|
2756
2821
|
deps: deps,
|