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