@sentry/bundler-plugin-core 2.20.0 → 2.21.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 +179 -137
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +179 -137
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/debug-id-upload.d.ts +2 -2
- package/dist/types/debug-id-upload.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/options-mapping.d.ts +1 -0
- package/dist/types/options-mapping.d.ts.map +1 -1
- package/dist/types/plugins/release-management.d.ts +2 -2
- package/dist/types/plugins/release-management.d.ts.map +1 -1
- package/dist/types/plugins/sourcemap-deletion.d.ts +5 -2
- package/dist/types/plugins/sourcemap-deletion.d.ts.map +1 -1
- package/dist/types/sentry/telemetry.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -13659,7 +13659,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
|
|
|
13659
13659
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
13660
13660
|
tracesSampleRate: 1,
|
|
13661
13661
|
sampleRate: 1,
|
|
13662
|
-
release: "2.
|
|
13662
|
+
release: "2.21.0",
|
|
13663
13663
|
integrations: [],
|
|
13664
13664
|
tracePropagationTargets: ["sentry.io/api"],
|
|
13665
13665
|
stackParser: defaultStackParser,
|
|
@@ -13747,10 +13747,12 @@ function setTelemetryDataOnHub(options, hub, bundler) {
|
|
|
13747
13747
|
hub.setTag("custom-error-handler", !!errorHandler);
|
|
13748
13748
|
hub.setTag("sourcemaps-assets", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.assets));
|
|
13749
13749
|
hub.setTag("delete-after-upload", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.deleteFilesAfterUpload) || !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.filesToDeleteAfterUpload));
|
|
13750
|
+
hub.setTag("sourcemaps-disabled", !!(sourcemaps !== null && sourcemaps !== void 0 && sourcemaps.disable));
|
|
13750
13751
|
hub.setTag("react-annotate", !!(reactComponentAnnotation !== null && reactComponentAnnotation !== void 0 && reactComponentAnnotation.enabled));
|
|
13751
13752
|
hub.setTag("node", process.version);
|
|
13752
13753
|
hub.setTag("platform", process.platform);
|
|
13753
13754
|
hub.setTag("meta-framework", (_options$_metaOptions = options._metaOptions.telemetry.metaFramework) !== null && _options$_metaOptions !== void 0 ? _options$_metaOptions : "none");
|
|
13755
|
+
hub.setTag("application-key-set", options.applicationKey !== undefined);
|
|
13754
13756
|
hub.setTags({
|
|
13755
13757
|
organization: org,
|
|
13756
13758
|
project: project,
|
|
@@ -13861,7 +13863,7 @@ function createDebugIdUploadFunction(_ref) {
|
|
|
13861
13863
|
sentryClient = _ref.sentryClient,
|
|
13862
13864
|
sentryCliOptions = _ref.sentryCliOptions,
|
|
13863
13865
|
rewriteSourcesHook = _ref.rewriteSourcesHook,
|
|
13864
|
-
|
|
13866
|
+
freeDependencyOnSourcemapFiles = _ref.freeDependencyOnSourcemapFiles;
|
|
13865
13867
|
return /*#__PURE__*/function () {
|
|
13866
13868
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(buildArtifactPaths) {
|
|
13867
13869
|
var artifactBundleUploadTransaction, folderToCleanUp, mkdtempSpan, tmpUploadFolder, globAssets, globSpan, globResult, debugIdChunkFilePaths, prepareSpan, preparationTasks, workers, worker, workerIndex, files, stats, uploadSize, uploadSpan, cliInstance, cleanupSpan;
|
|
@@ -14017,21 +14019,18 @@ function createDebugIdUploadFunction(_ref) {
|
|
|
14017
14019
|
uploadSpan.finish();
|
|
14018
14020
|
logger.info("Successfully uploaded source maps to Sentry");
|
|
14019
14021
|
case 47:
|
|
14020
|
-
_context3.next =
|
|
14021
|
-
return deleteFilesUpForDeletion();
|
|
14022
|
-
case 49:
|
|
14023
|
-
_context3.next = 55;
|
|
14022
|
+
_context3.next = 53;
|
|
14024
14023
|
break;
|
|
14025
|
-
case
|
|
14026
|
-
_context3.prev =
|
|
14024
|
+
case 49:
|
|
14025
|
+
_context3.prev = 49;
|
|
14027
14026
|
_context3.t0 = _context3["catch"](1);
|
|
14028
14027
|
sentryHub.withScope(function (scope) {
|
|
14029
14028
|
scope.setSpan(artifactBundleUploadTransaction);
|
|
14030
14029
|
sentryHub.captureException('Error in "debugIdUploadPlugin" writeBundle hook');
|
|
14031
14030
|
});
|
|
14032
14031
|
handleRecoverableError(_context3.t0);
|
|
14033
|
-
case
|
|
14034
|
-
_context3.prev =
|
|
14032
|
+
case 53:
|
|
14033
|
+
_context3.prev = 53;
|
|
14035
14034
|
if (folderToCleanUp) {
|
|
14036
14035
|
cleanupSpan = artifactBundleUploadTransaction.startChild({
|
|
14037
14036
|
description: "cleanup"
|
|
@@ -14043,15 +14042,16 @@ function createDebugIdUploadFunction(_ref) {
|
|
|
14043
14042
|
cleanupSpan.finish();
|
|
14044
14043
|
}
|
|
14045
14044
|
artifactBundleUploadTransaction.finish();
|
|
14046
|
-
|
|
14045
|
+
freeDependencyOnSourcemapFiles();
|
|
14046
|
+
_context3.next = 59;
|
|
14047
14047
|
return safeFlushTelemetry(sentryClient);
|
|
14048
|
+
case 59:
|
|
14049
|
+
return _context3.finish(53);
|
|
14048
14050
|
case 60:
|
|
14049
|
-
return _context3.finish(55);
|
|
14050
|
-
case 61:
|
|
14051
14051
|
case "end":
|
|
14052
14052
|
return _context3.stop();
|
|
14053
14053
|
}
|
|
14054
|
-
}, _callee3, null, [[1,
|
|
14054
|
+
}, _callee3, null, [[1, 49, 53, 60]]);
|
|
14055
14055
|
}));
|
|
14056
14056
|
return function (_x) {
|
|
14057
14057
|
return _ref2.apply(this, arguments);
|
|
@@ -14298,7 +14298,7 @@ function releaseManagementPlugin(_ref) {
|
|
|
14298
14298
|
sentryHub = _ref.sentryHub,
|
|
14299
14299
|
sentryClient = _ref.sentryClient,
|
|
14300
14300
|
sentryCliOptions = _ref.sentryCliOptions,
|
|
14301
|
-
|
|
14301
|
+
freeDependencyOnSourcemapFiles = _ref.freeDependencyOnSourcemapFiles;
|
|
14302
14302
|
return {
|
|
14303
14303
|
name: "sentry-debug-id-upload-plugin",
|
|
14304
14304
|
writeBundle: function writeBundle() {
|
|
@@ -14361,24 +14361,25 @@ function releaseManagementPlugin(_ref) {
|
|
|
14361
14361
|
_context.next = 18;
|
|
14362
14362
|
return cliInstance.releases.newDeploy(releaseName, deployOptions);
|
|
14363
14363
|
case 18:
|
|
14364
|
-
_context.next =
|
|
14365
|
-
return deleteFilesUpForDeletion();
|
|
14366
|
-
case 20:
|
|
14367
|
-
_context.next = 28;
|
|
14364
|
+
_context.next = 26;
|
|
14368
14365
|
break;
|
|
14369
|
-
case
|
|
14370
|
-
_context.prev =
|
|
14366
|
+
case 20:
|
|
14367
|
+
_context.prev = 20;
|
|
14371
14368
|
_context.t0 = _context["catch"](0);
|
|
14372
14369
|
sentryHub.captureException('Error in "releaseManagementPlugin" writeBundle hook');
|
|
14373
|
-
_context.next =
|
|
14370
|
+
_context.next = 25;
|
|
14374
14371
|
return safeFlushTelemetry(sentryClient);
|
|
14375
|
-
case
|
|
14372
|
+
case 25:
|
|
14376
14373
|
handleRecoverableError(_context.t0);
|
|
14377
|
-
case
|
|
14374
|
+
case 26:
|
|
14375
|
+
_context.prev = 26;
|
|
14376
|
+
freeDependencyOnSourcemapFiles();
|
|
14377
|
+
return _context.finish(26);
|
|
14378
|
+
case 29:
|
|
14378
14379
|
case "end":
|
|
14379
14380
|
return _context.stop();
|
|
14380
14381
|
}
|
|
14381
|
-
}, _callee, null, [[0,
|
|
14382
|
+
}, _callee, null, [[0, 20, 26, 29]]);
|
|
14382
14383
|
}))();
|
|
14383
14384
|
}
|
|
14384
14385
|
};
|
|
@@ -14468,35 +14469,74 @@ function fileDeletionPlugin(_ref) {
|
|
|
14468
14469
|
var handleRecoverableError = _ref.handleRecoverableError,
|
|
14469
14470
|
sentryHub = _ref.sentryHub,
|
|
14470
14471
|
sentryClient = _ref.sentryClient,
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
case 3:
|
|
14472
|
+
filesToDeleteAfterUpload = _ref.filesToDeleteAfterUpload,
|
|
14473
|
+
dependenciesAreFreedPromise = _ref.dependenciesAreFreedPromise,
|
|
14474
|
+
logger = _ref.logger;
|
|
14475
|
+
var writeBundle = /*#__PURE__*/function () {
|
|
14476
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
14477
|
+
var filePathsToDelete;
|
|
14478
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14479
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14480
|
+
case 0:
|
|
14481
|
+
_context.prev = 0;
|
|
14482
|
+
if (!(filesToDeleteAfterUpload !== undefined)) {
|
|
14483
14483
|
_context.next = 11;
|
|
14484
14484
|
break;
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14485
|
+
}
|
|
14486
|
+
_context.next = 4;
|
|
14487
|
+
return glob.glob(filesToDeleteAfterUpload, {
|
|
14488
|
+
absolute: true,
|
|
14489
|
+
nodir: true
|
|
14490
|
+
});
|
|
14491
|
+
case 4:
|
|
14492
|
+
filePathsToDelete = _context.sent;
|
|
14493
|
+
logger.debug("Waiting for dependencies on generated files to be freed before deleting...");
|
|
14494
|
+
_context.next = 8;
|
|
14495
|
+
return dependenciesAreFreedPromise;
|
|
14496
|
+
case 8:
|
|
14497
|
+
filePathsToDelete.forEach(function (filePathToDelete) {
|
|
14498
|
+
logger.debug("Deleting asset after upload: ".concat(filePathToDelete));
|
|
14499
|
+
});
|
|
14500
|
+
_context.next = 11;
|
|
14501
|
+
return Promise.all(filePathsToDelete.map(function (filePathToDelete) {
|
|
14502
|
+
return fs__default["default"].promises.rm(filePathToDelete, {
|
|
14503
|
+
force: true
|
|
14504
|
+
})["catch"](function (e) {
|
|
14505
|
+
// This is allowed to fail - we just don't do anything
|
|
14506
|
+
logger.debug("An error occurred while attempting to delete asset: ".concat(filePathToDelete), e);
|
|
14507
|
+
});
|
|
14508
|
+
}));
|
|
14509
|
+
case 11:
|
|
14510
|
+
_context.next = 19;
|
|
14511
|
+
break;
|
|
14512
|
+
case 13:
|
|
14513
|
+
_context.prev = 13;
|
|
14514
|
+
_context.t0 = _context["catch"](0);
|
|
14515
|
+
sentryHub.captureException('Error in "sentry-file-deletion-plugin" buildEnd hook');
|
|
14516
|
+
_context.next = 18;
|
|
14517
|
+
return safeFlushTelemetry(sentryClient);
|
|
14518
|
+
case 18:
|
|
14519
|
+
handleRecoverableError(_context.t0);
|
|
14520
|
+
case 19:
|
|
14521
|
+
case "end":
|
|
14522
|
+
return _context.stop();
|
|
14523
|
+
}
|
|
14524
|
+
}, _callee, null, [[0, 13]]);
|
|
14525
|
+
}));
|
|
14526
|
+
return function writeBundle() {
|
|
14527
|
+
return _ref2.apply(this, arguments);
|
|
14528
|
+
};
|
|
14529
|
+
}();
|
|
14530
|
+
return {
|
|
14531
|
+
name: "sentry-file-deletion-plugin",
|
|
14532
|
+
vite: {
|
|
14533
|
+
writeBundle: {
|
|
14534
|
+
sequential: true,
|
|
14535
|
+
order: "post",
|
|
14536
|
+
handler: writeBundle
|
|
14537
|
+
}
|
|
14538
|
+
},
|
|
14539
|
+
writeBundle: writeBundle
|
|
14500
14540
|
};
|
|
14501
14541
|
}
|
|
14502
14542
|
|
|
@@ -14534,7 +14574,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14534
14574
|
debugIdUploadPlugin = _ref.debugIdUploadPlugin,
|
|
14535
14575
|
bundleSizeOptimizationsPlugin = _ref.bundleSizeOptimizationsPlugin;
|
|
14536
14576
|
return unplugin.createUnplugin(function () {
|
|
14537
|
-
var _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$silent, _userOptions$debug, _userOptions$_experim;
|
|
14577
|
+
var _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$silent, _userOptions$debug, _userOptions$_experim, _options$sourcemaps, _options$sourcemaps$f, _options$sourcemaps5, _options$sourcemaps6;
|
|
14538
14578
|
var userOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14539
14579
|
var unpluginMetaContext = arguments.length > 1 ? arguments[1] : undefined;
|
|
14540
14580
|
var logger = createLogger({
|
|
@@ -14584,7 +14624,7 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14584
14624
|
});
|
|
14585
14625
|
|
|
14586
14626
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
14587
|
-
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.
|
|
14627
|
+
process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "2.21.0");
|
|
14588
14628
|
function handleRecoverableError(unknownError) {
|
|
14589
14629
|
sentrySession.status = "abnormal";
|
|
14590
14630
|
try {
|
|
@@ -14620,47 +14660,43 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14620
14660
|
logger: logger,
|
|
14621
14661
|
shouldSendTelemetry: shouldSendTelemetry
|
|
14622
14662
|
}));
|
|
14623
|
-
|
|
14624
|
-
|
|
14663
|
+
|
|
14664
|
+
// We have multiple plugins depending on generated source map files. (debug ID upload, legacy upload)
|
|
14665
|
+
// Additionally, we also want to have the functionality to delete files after uploading sourcemaps.
|
|
14666
|
+
// All of these plugins and the delete functionality need to run in the same hook (`writeBundle`).
|
|
14667
|
+
// Since the plugins among themselves are not aware of when they run and finish, we need a system to
|
|
14668
|
+
// track their dependencies on the generated files, so that we can initiate the file deletion only after
|
|
14669
|
+
// nothing depends on the files anymore.
|
|
14670
|
+
var dependenciesOnSourcemapFiles = new Set();
|
|
14671
|
+
var sourcemapFileDependencySubscribers = [];
|
|
14672
|
+
function notifySourcemapFileDependencySubscribers() {
|
|
14673
|
+
sourcemapFileDependencySubscribers.forEach(function (subscriber) {
|
|
14674
|
+
subscriber();
|
|
14675
|
+
});
|
|
14625
14676
|
}
|
|
14626
|
-
function
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
case 4:
|
|
14644
|
-
filePathsToDelete = _context.sent;
|
|
14645
|
-
filePathsToDelete.forEach(function (filePathToDelete) {
|
|
14646
|
-
logger.debug("Deleting asset after upload: ".concat(filePathToDelete));
|
|
14647
|
-
});
|
|
14648
|
-
_context.next = 8;
|
|
14649
|
-
return Promise.all(filePathsToDelete.map(function (filePathToDelete) {
|
|
14650
|
-
return fs__namespace.promises.rm(filePathToDelete, {
|
|
14651
|
-
force: true
|
|
14652
|
-
})["catch"](function (e) {
|
|
14653
|
-
// This is allowed to fail - we just don't do anything
|
|
14654
|
-
logger.debug("An error occurred while attempting to delete asset: ".concat(filePathToDelete), e);
|
|
14655
|
-
});
|
|
14656
|
-
}));
|
|
14657
|
-
case 8:
|
|
14658
|
-
case "end":
|
|
14659
|
-
return _context.stop();
|
|
14677
|
+
function createDependencyOnSourcemapFiles() {
|
|
14678
|
+
var dependencyIdentifier = Symbol();
|
|
14679
|
+
dependenciesOnSourcemapFiles.add(dependencyIdentifier);
|
|
14680
|
+
return function freeDependencyOnSourcemapFiles() {
|
|
14681
|
+
dependenciesOnSourcemapFiles["delete"](dependencyIdentifier);
|
|
14682
|
+
notifySourcemapFileDependencySubscribers();
|
|
14683
|
+
};
|
|
14684
|
+
}
|
|
14685
|
+
|
|
14686
|
+
/**
|
|
14687
|
+
* Returns a Promise that resolves when all the currently active dependencies are freed again.
|
|
14688
|
+
*/
|
|
14689
|
+
function waitUntilSourcemapFileDependenciesAreFreed() {
|
|
14690
|
+
return new Promise(function (resolve) {
|
|
14691
|
+
sourcemapFileDependencySubscribers.push(function () {
|
|
14692
|
+
if (dependenciesOnSourcemapFiles.size === 0) {
|
|
14693
|
+
resolve();
|
|
14660
14694
|
}
|
|
14661
|
-
}
|
|
14662
|
-
|
|
14663
|
-
|
|
14695
|
+
});
|
|
14696
|
+
if (dependenciesOnSourcemapFiles.size === 0) {
|
|
14697
|
+
resolve();
|
|
14698
|
+
}
|
|
14699
|
+
});
|
|
14664
14700
|
}
|
|
14665
14701
|
if (options.bundleSizeOptimizations) {
|
|
14666
14702
|
var bundleSizeOptimizations = options.bundleSizeOptimizations;
|
|
@@ -14724,7 +14760,9 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14724
14760
|
var _injectionCode2 = generateModuleMetadataInjectorCode(metadata);
|
|
14725
14761
|
plugins.push(moduleMetadataInjectionPlugin(_injectionCode2));
|
|
14726
14762
|
}
|
|
14727
|
-
if (
|
|
14763
|
+
if ((_options$sourcemaps = options.sourcemaps) !== null && _options$sourcemaps !== void 0 && _options$sourcemaps.disable) {
|
|
14764
|
+
logger.debug("Source map upload was disabled. Will not upload sourcemaps.");
|
|
14765
|
+
} else if (!options.release.name) {
|
|
14728
14766
|
logger.warn("No release name provided. Will not create release. Please set the `release.name` option to identify your release.");
|
|
14729
14767
|
} else if (!options.authToken) {
|
|
14730
14768
|
logger.warn("No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/");
|
|
@@ -14754,16 +14792,10 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14754
14792
|
vcsRemote: options.release.vcsRemote,
|
|
14755
14793
|
headers: options.headers
|
|
14756
14794
|
},
|
|
14757
|
-
|
|
14795
|
+
freeDependencyOnSourcemapFiles: createDependencyOnSourcemapFiles()
|
|
14758
14796
|
}));
|
|
14759
14797
|
}
|
|
14760
14798
|
plugins.push(debugIdInjectionPlugin(logger));
|
|
14761
|
-
plugins.push(fileDeletionPlugin({
|
|
14762
|
-
deleteFilesUpForDeletion: deleteFilesUpForDeletion,
|
|
14763
|
-
handleRecoverableError: handleRecoverableError,
|
|
14764
|
-
sentryHub: sentryHub,
|
|
14765
|
-
sentryClient: sentryClient
|
|
14766
|
-
}));
|
|
14767
14799
|
if (!options.authToken) {
|
|
14768
14800
|
logger.warn("No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/");
|
|
14769
14801
|
} else if (!options.org && !options.authToken.startsWith("sntrys_")) {
|
|
@@ -14771,16 +14803,16 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14771
14803
|
} else if (!options.project) {
|
|
14772
14804
|
logger.warn("No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug.");
|
|
14773
14805
|
} else {
|
|
14774
|
-
var _options$
|
|
14806
|
+
var _options$sourcemaps2, _options$sourcemaps3, _options$sourcemaps4;
|
|
14775
14807
|
plugins.push(debugIdUploadPlugin(createDebugIdUploadFunction({
|
|
14776
|
-
assets: (_options$
|
|
14777
|
-
ignore: (_options$
|
|
14778
|
-
|
|
14808
|
+
assets: (_options$sourcemaps2 = options.sourcemaps) === null || _options$sourcemaps2 === void 0 ? void 0 : _options$sourcemaps2.assets,
|
|
14809
|
+
ignore: (_options$sourcemaps3 = options.sourcemaps) === null || _options$sourcemaps3 === void 0 ? void 0 : _options$sourcemaps3.ignore,
|
|
14810
|
+
freeDependencyOnSourcemapFiles: createDependencyOnSourcemapFiles(),
|
|
14779
14811
|
dist: options.release.dist,
|
|
14780
14812
|
releaseName: options.release.name,
|
|
14781
14813
|
logger: logger,
|
|
14782
14814
|
handleRecoverableError: handleRecoverableError,
|
|
14783
|
-
rewriteSourcesHook: (_options$
|
|
14815
|
+
rewriteSourcesHook: (_options$sourcemaps4 = options.sourcemaps) === null || _options$sourcemaps4 === void 0 ? void 0 : _options$sourcemaps4.rewriteSources,
|
|
14784
14816
|
sentryHub: sentryHub,
|
|
14785
14817
|
sentryClient: sentryClient,
|
|
14786
14818
|
sentryCliOptions: {
|
|
@@ -14803,6 +14835,16 @@ function sentryUnpluginFactory(_ref) {
|
|
|
14803
14835
|
componentNameAnnotatePlugin && plugins.push(componentNameAnnotatePlugin());
|
|
14804
14836
|
}
|
|
14805
14837
|
}
|
|
14838
|
+
plugins.push(fileDeletionPlugin({
|
|
14839
|
+
// It is very important that this is only called after all other dependencies have been created with `createDependencyOnSourcemapFiles`.
|
|
14840
|
+
// Ideally, we always register this plugin last.
|
|
14841
|
+
dependenciesAreFreedPromise: waitUntilSourcemapFileDependenciesAreFreed(),
|
|
14842
|
+
filesToDeleteAfterUpload: (_options$sourcemaps$f = (_options$sourcemaps5 = options.sourcemaps) === null || _options$sourcemaps5 === void 0 ? void 0 : _options$sourcemaps5.filesToDeleteAfterUpload) !== null && _options$sourcemaps$f !== void 0 ? _options$sourcemaps$f : (_options$sourcemaps6 = options.sourcemaps) === null || _options$sourcemaps6 === void 0 ? void 0 : _options$sourcemaps6.deleteFilesAfterUpload,
|
|
14843
|
+
logger: logger,
|
|
14844
|
+
handleRecoverableError: handleRecoverableError,
|
|
14845
|
+
sentryHub: sentryHub,
|
|
14846
|
+
sentryClient: sentryClient
|
|
14847
|
+
}));
|
|
14806
14848
|
return plugins;
|
|
14807
14849
|
});
|
|
14808
14850
|
}
|
|
@@ -14967,50 +15009,50 @@ function createRollupModuleMetadataInjectionHooks(injectionCode) {
|
|
|
14967
15009
|
function createRollupDebugIdUploadHooks(upload) {
|
|
14968
15010
|
return {
|
|
14969
15011
|
writeBundle: function writeBundle(outputOptions, bundle) {
|
|
14970
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15012
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
14971
15013
|
var outputDir, _buildArtifacts, _buildArtifacts2;
|
|
14972
|
-
return _regeneratorRuntime().wrap(function
|
|
14973
|
-
while (1) switch (
|
|
15014
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15015
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14974
15016
|
case 0:
|
|
14975
15017
|
if (!outputOptions.dir) {
|
|
14976
|
-
|
|
15018
|
+
_context.next = 9;
|
|
14977
15019
|
break;
|
|
14978
15020
|
}
|
|
14979
15021
|
outputDir = outputOptions.dir;
|
|
14980
|
-
|
|
15022
|
+
_context.next = 4;
|
|
14981
15023
|
return glob.glob(["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"], {
|
|
14982
15024
|
root: outputDir,
|
|
14983
15025
|
absolute: true,
|
|
14984
15026
|
nodir: true
|
|
14985
15027
|
});
|
|
14986
15028
|
case 4:
|
|
14987
|
-
_buildArtifacts =
|
|
14988
|
-
|
|
15029
|
+
_buildArtifacts = _context.sent;
|
|
15030
|
+
_context.next = 7;
|
|
14989
15031
|
return upload(_buildArtifacts);
|
|
14990
15032
|
case 7:
|
|
14991
|
-
|
|
15033
|
+
_context.next = 17;
|
|
14992
15034
|
break;
|
|
14993
15035
|
case 9:
|
|
14994
15036
|
if (!outputOptions.file) {
|
|
14995
|
-
|
|
15037
|
+
_context.next = 14;
|
|
14996
15038
|
break;
|
|
14997
15039
|
}
|
|
14998
|
-
|
|
15040
|
+
_context.next = 12;
|
|
14999
15041
|
return upload([outputOptions.file]);
|
|
15000
15042
|
case 12:
|
|
15001
|
-
|
|
15043
|
+
_context.next = 17;
|
|
15002
15044
|
break;
|
|
15003
15045
|
case 14:
|
|
15004
15046
|
_buildArtifacts2 = Object.keys(bundle).map(function (asset) {
|
|
15005
15047
|
return path__namespace.join(path__namespace.resolve(), asset);
|
|
15006
15048
|
});
|
|
15007
|
-
|
|
15049
|
+
_context.next = 17;
|
|
15008
15050
|
return upload(_buildArtifacts2);
|
|
15009
15051
|
case 17:
|
|
15010
15052
|
case "end":
|
|
15011
|
-
return
|
|
15053
|
+
return _context.stop();
|
|
15012
15054
|
}
|
|
15013
|
-
},
|
|
15055
|
+
}, _callee);
|
|
15014
15056
|
}))();
|
|
15015
15057
|
}
|
|
15016
15058
|
};
|
|
@@ -15018,26 +15060,26 @@ function createRollupDebugIdUploadHooks(upload) {
|
|
|
15018
15060
|
function createComponentNameAnnotateHooks() {
|
|
15019
15061
|
return {
|
|
15020
15062
|
transform: function transform(code, id) {
|
|
15021
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15063
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
15022
15064
|
var idWithoutQueryAndHash, parserPlugins, _result$code, result;
|
|
15023
|
-
return _regeneratorRuntime().wrap(function
|
|
15024
|
-
while (1) switch (
|
|
15065
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
15066
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
15025
15067
|
case 0:
|
|
15026
15068
|
// id may contain query and hash which will trip up our file extension logic below
|
|
15027
15069
|
idWithoutQueryAndHash = stripQueryAndHashFromPath(id);
|
|
15028
15070
|
if (!idWithoutQueryAndHash.match(/\\node_modules\\|\/node_modules\//)) {
|
|
15029
|
-
|
|
15071
|
+
_context2.next = 3;
|
|
15030
15072
|
break;
|
|
15031
15073
|
}
|
|
15032
|
-
return
|
|
15074
|
+
return _context2.abrupt("return", null);
|
|
15033
15075
|
case 3:
|
|
15034
15076
|
if ([".jsx", ".tsx"].some(function (ending) {
|
|
15035
15077
|
return idWithoutQueryAndHash.endsWith(ending);
|
|
15036
15078
|
})) {
|
|
15037
|
-
|
|
15079
|
+
_context2.next = 5;
|
|
15038
15080
|
break;
|
|
15039
15081
|
}
|
|
15040
|
-
return
|
|
15082
|
+
return _context2.abrupt("return", null);
|
|
15041
15083
|
case 5:
|
|
15042
15084
|
parserPlugins = [];
|
|
15043
15085
|
if (idWithoutQueryAndHash.endsWith(".jsx")) {
|
|
@@ -15045,8 +15087,8 @@ function createComponentNameAnnotateHooks() {
|
|
|
15045
15087
|
} else if (idWithoutQueryAndHash.endsWith(".tsx")) {
|
|
15046
15088
|
parserPlugins.push("jsx", "typescript");
|
|
15047
15089
|
}
|
|
15048
|
-
|
|
15049
|
-
|
|
15090
|
+
_context2.prev = 7;
|
|
15091
|
+
_context2.next = 10;
|
|
15050
15092
|
return core.transformAsync(code, {
|
|
15051
15093
|
plugins: [[componentNameAnnotatePlugin__default["default"]]],
|
|
15052
15094
|
filename: id,
|
|
@@ -15061,24 +15103,24 @@ function createComponentNameAnnotateHooks() {
|
|
|
15061
15103
|
sourceMaps: true
|
|
15062
15104
|
});
|
|
15063
15105
|
case 10:
|
|
15064
|
-
result =
|
|
15065
|
-
return
|
|
15106
|
+
result = _context2.sent;
|
|
15107
|
+
return _context2.abrupt("return", {
|
|
15066
15108
|
code: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : code,
|
|
15067
15109
|
map: result === null || result === void 0 ? void 0 : result.map
|
|
15068
15110
|
});
|
|
15069
15111
|
case 14:
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
logger.error("Failed to apply react annotate plugin",
|
|
15112
|
+
_context2.prev = 14;
|
|
15113
|
+
_context2.t0 = _context2["catch"](7);
|
|
15114
|
+
logger.error("Failed to apply react annotate plugin", _context2.t0);
|
|
15073
15115
|
case 17:
|
|
15074
|
-
return
|
|
15116
|
+
return _context2.abrupt("return", {
|
|
15075
15117
|
code: code
|
|
15076
15118
|
});
|
|
15077
15119
|
case 18:
|
|
15078
15120
|
case "end":
|
|
15079
|
-
return
|
|
15121
|
+
return _context2.stop();
|
|
15080
15122
|
}
|
|
15081
|
-
},
|
|
15123
|
+
}, _callee2, null, [[7, 14]]);
|
|
15082
15124
|
}))();
|
|
15083
15125
|
}
|
|
15084
15126
|
};
|