@sentry/bundler-plugin-core 4.4.0 → 4.6.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 +122 -78
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +122 -78
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/build-plugin-manager.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/options-mapping.d.ts +1 -1
- package/dist/types/options-mapping.d.ts.map +1 -1
- package/dist/types/sentry/telemetry.d.ts.map +1 -1
- package/dist/types/types.d.ts +12 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +4 -0
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/cjs/index.js
CHANGED
|
@@ -8023,12 +8023,27 @@ function getTurborepoEnvPassthroughWarning(envVarName) {
|
|
|
8023
8023
|
return process.env["TURBO_HASH"] ? "\nYou seem to be using Turborepo, did you forget to put ".concat(envVarName, " in `passThroughEnv`? https://turbo.build/repo/docs/reference/configuration#passthroughenv") : "";
|
|
8024
8024
|
}
|
|
8025
8025
|
|
|
8026
|
+
/**
|
|
8027
|
+
* Gets the projects from the project option. This might be a single project or an array of projects.
|
|
8028
|
+
*/
|
|
8029
|
+
function getProjects(project) {
|
|
8030
|
+
if (Array.isArray(project)) {
|
|
8031
|
+
return project;
|
|
8032
|
+
}
|
|
8033
|
+
if (project) {
|
|
8034
|
+
return [project];
|
|
8035
|
+
}
|
|
8036
|
+
return undefined;
|
|
8037
|
+
}
|
|
8038
|
+
|
|
8026
8039
|
var SENTRY_SAAS_URL = "https://sentry.io";
|
|
8027
8040
|
function normalizeUserOptions(userOptions) {
|
|
8028
|
-
var _userOptions$org, _userOptions$project, _userOptions$authToke, _ref, _userOptions$url, _userOptions$debug, _userOptions$silent, _userOptions$telemetr, _userOptions$disable, _ref2, _userOptions$release$, _userOptions$release, _userOptions$release$2, _userOptions$release2, _userOptions$release$3, _userOptions$release3, _userOptions$release$4, _userOptions$release4, _ref3, _userOptions$release$5, _userOptions$release5, _userOptions$release6, _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$_experim;
|
|
8041
|
+
var _userOptions$org, _userOptions$project, _process$env$SENTRY_P, _userOptions$authToke, _ref, _userOptions$url, _userOptions$debug, _userOptions$silent, _userOptions$telemetr, _userOptions$disable, _ref2, _userOptions$release$, _userOptions$release, _userOptions$release$2, _userOptions$release2, _userOptions$release$3, _userOptions$release3, _userOptions$release$4, _userOptions$release4, _ref3, _userOptions$release$5, _userOptions$release5, _userOptions$release6, _userOptions$_metaOpt, _userOptions$_metaOpt2, _userOptions$_experim;
|
|
8029
8042
|
var options = {
|
|
8030
8043
|
org: (_userOptions$org = userOptions.org) !== null && _userOptions$org !== void 0 ? _userOptions$org : process.env["SENTRY_ORG"],
|
|
8031
|
-
project: (_userOptions$project = userOptions.project) !== null && _userOptions$project !== void 0 ? _userOptions$project : process.env["SENTRY_PROJECT"],
|
|
8044
|
+
project: (_userOptions$project = userOptions.project) !== null && _userOptions$project !== void 0 ? _userOptions$project : (_process$env$SENTRY_P = process.env["SENTRY_PROJECT"]) !== null && _process$env$SENTRY_P !== void 0 && _process$env$SENTRY_P.includes(",") ? process.env["SENTRY_PROJECT"].split(",").map(function (p) {
|
|
8045
|
+
return p.trim();
|
|
8046
|
+
}) : process.env["SENTRY_PROJECT"],
|
|
8032
8047
|
authToken: (_userOptions$authToke = userOptions.authToken) !== null && _userOptions$authToke !== void 0 ? _userOptions$authToke : process.env["SENTRY_AUTH_TOKEN"],
|
|
8033
8048
|
url: (_ref = (_userOptions$url = userOptions.url) !== null && _userOptions$url !== void 0 ? _userOptions$url : process.env["SENTRY_URL"]) !== null && _ref !== void 0 ? _ref : SENTRY_SAAS_URL,
|
|
8034
8049
|
headers: userOptions.headers,
|
|
@@ -8117,6 +8132,20 @@ function validateOptions(options, logger) {
|
|
|
8117
8132
|
logger.error("The `deploy` option was specified but is missing the required `env` property.", "Please set the `env` property.");
|
|
8118
8133
|
return false;
|
|
8119
8134
|
}
|
|
8135
|
+
if (options.project && Array.isArray(options.project)) {
|
|
8136
|
+
if (options.project.length === 0) {
|
|
8137
|
+
logger.error("The `project` option was specified as an array but is empty.", "Please provide at least one project slug.");
|
|
8138
|
+
return false;
|
|
8139
|
+
}
|
|
8140
|
+
// Check each project is a non-empty string
|
|
8141
|
+
var invalidProjects = options.project.filter(function (p) {
|
|
8142
|
+
return typeof p !== "string" || p.trim() === "";
|
|
8143
|
+
});
|
|
8144
|
+
if (invalidProjects.length > 0) {
|
|
8145
|
+
logger.error("The `project` option contains invalid project slugs.", "All projects must be non-empty strings.");
|
|
8146
|
+
return false;
|
|
8147
|
+
}
|
|
8148
|
+
}
|
|
8120
8149
|
return true;
|
|
8121
8150
|
}
|
|
8122
8151
|
|
|
@@ -8307,7 +8336,7 @@ function createSentryInstance(options, shouldSendTelemetry, buildTool) {
|
|
|
8307
8336
|
dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
|
|
8308
8337
|
tracesSampleRate: 1,
|
|
8309
8338
|
sampleRate: 1,
|
|
8310
|
-
release: "4.
|
|
8339
|
+
release: "4.6.0",
|
|
8311
8340
|
integrations: [],
|
|
8312
8341
|
tracePropagationTargets: ["sentry.io/api"],
|
|
8313
8342
|
stackParser: stackParser,
|
|
@@ -8374,7 +8403,7 @@ function setTelemetryDataOnScope(options, scope, buildTool) {
|
|
|
8374
8403
|
scope.setTag("ci", !!process.env["CI"]);
|
|
8375
8404
|
scope.setTags({
|
|
8376
8405
|
organization: org,
|
|
8377
|
-
project: project,
|
|
8406
|
+
project: Array.isArray(project) ? project.join(", ") : project !== null && project !== void 0 ? project : "undefined",
|
|
8378
8407
|
bundler: buildTool
|
|
8379
8408
|
});
|
|
8380
8409
|
scope.setUser({
|
|
@@ -8390,7 +8419,7 @@ function allowedToSendTelemetry(_x) {
|
|
|
8390
8419
|
*/
|
|
8391
8420
|
function _allowedToSendTelemetry() {
|
|
8392
8421
|
_allowedToSendTelemetry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
8393
|
-
var _cliInfo$split$, _cliInfo$split$$repla;
|
|
8422
|
+
var _getProjects, _cliInfo$split$, _cliInfo$split$$repla;
|
|
8394
8423
|
var silent, org, project, authToken, url, headers, telemetry, release, cli, cliInfo, cliInfoUrl;
|
|
8395
8424
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8396
8425
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -8412,7 +8441,7 @@ function _allowedToSendTelemetry() {
|
|
|
8412
8441
|
url: url,
|
|
8413
8442
|
authToken: authToken,
|
|
8414
8443
|
org: org,
|
|
8415
|
-
project: project,
|
|
8444
|
+
project: (_getProjects = getProjects(project)) === null || _getProjects === void 0 ? void 0 : _getProjects[0],
|
|
8416
8445
|
vcsRemote: release.vcsRemote,
|
|
8417
8446
|
silent: silent,
|
|
8418
8447
|
headers: headers
|
|
@@ -8749,10 +8778,12 @@ function defaultRewriteSourcesHook(source) {
|
|
|
8749
8778
|
}
|
|
8750
8779
|
|
|
8751
8780
|
function createCliInstance(options) {
|
|
8781
|
+
var _getProjects;
|
|
8752
8782
|
return new SentryCli__default["default"](null, {
|
|
8753
8783
|
authToken: options.authToken,
|
|
8754
8784
|
org: options.org,
|
|
8755
|
-
project
|
|
8785
|
+
// Default to the first project if multiple projects are specified
|
|
8786
|
+
project: (_getProjects = getProjects(options.project)) === null || _getProjects === void 0 ? void 0 : _getProjects[0],
|
|
8756
8787
|
silent: options.silent,
|
|
8757
8788
|
url: options.url,
|
|
8758
8789
|
vcsRemote: options.release.vcsRemote,
|
|
@@ -8914,7 +8945,13 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
8914
8945
|
});
|
|
8915
8946
|
|
|
8916
8947
|
// Set the User-Agent that Sentry CLI will use when interacting with Sentry
|
|
8917
|
-
process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.
|
|
8948
|
+
process.env["SENTRY_PIPELINE"] = "".concat(bundlerPluginMetaContext.buildTool, "-plugin/", "4.6.0");
|
|
8949
|
+
|
|
8950
|
+
// Propagate debug flag to Sentry CLI via environment variable
|
|
8951
|
+
// Only set if not already defined to respect user's explicit configuration
|
|
8952
|
+
if (options.debug && !process.env["SENTRY_LOG_LEVEL"]) {
|
|
8953
|
+
process.env["SENTRY_LOG_LEVEL"] = "debug";
|
|
8954
|
+
}
|
|
8918
8955
|
|
|
8919
8956
|
// Not a bulletproof check but should be good enough to at least sometimes determine
|
|
8920
8957
|
// if the plugin is called in dev/watch mode or for a prod build. The important part
|
|
@@ -9036,9 +9073,11 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9036
9073
|
bundleMetadata["_sentryBundlerPluginAppKey:".concat(options.applicationKey)] = true;
|
|
9037
9074
|
}
|
|
9038
9075
|
if (typeof options.moduleMetadata === "function") {
|
|
9076
|
+
var _getProjects2;
|
|
9039
9077
|
var args = {
|
|
9040
9078
|
org: options.org,
|
|
9041
|
-
project: options.project,
|
|
9079
|
+
project: (_getProjects2 = getProjects(options.project)) === null || _getProjects2 === void 0 ? void 0 : _getProjects2[0],
|
|
9080
|
+
projects: getProjects(options.project),
|
|
9042
9081
|
release: options.release.name
|
|
9043
9082
|
};
|
|
9044
9083
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -9146,7 +9185,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9146
9185
|
logger.warn("No organization slug provided. Will not create release. Please set the `org` option to your Sentry organization slug." + getTurborepoEnvPassthroughWarning("SENTRY_ORG"));
|
|
9147
9186
|
return _context7.abrupt("return");
|
|
9148
9187
|
case 20:
|
|
9149
|
-
if (options.project) {
|
|
9188
|
+
if (!(!options.project || Array.isArray(options.project) && options.project.length === 0)) {
|
|
9150
9189
|
_context7.next = 23;
|
|
9151
9190
|
break;
|
|
9152
9191
|
}
|
|
@@ -9187,6 +9226,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9187
9226
|
return cliInstance.releases.uploadSourceMaps(options.release.name, {
|
|
9188
9227
|
include: normalizedInclude,
|
|
9189
9228
|
dist: options.release.dist,
|
|
9229
|
+
projects: getProjects(options.project),
|
|
9190
9230
|
// We want this promise to throw if the sourcemaps fail to upload so that we know about it.
|
|
9191
9231
|
// see: https://github.com/getsentry/sentry-cli/pull/2605
|
|
9192
9232
|
live: "rejectOnError"
|
|
@@ -9389,6 +9429,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9389
9429
|
dist: options.release.dist
|
|
9390
9430
|
}],
|
|
9391
9431
|
ignore: ignorePaths,
|
|
9432
|
+
projects: getProjects(options.project),
|
|
9392
9433
|
live: "rejectOnError"
|
|
9393
9434
|
});
|
|
9394
9435
|
case 3:
|
|
@@ -9578,6 +9619,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9578
9619
|
rewrite: false,
|
|
9579
9620
|
dist: options.release.dist
|
|
9580
9621
|
}],
|
|
9622
|
+
projects: getProjects(options.project),
|
|
9581
9623
|
live: "rejectOnError"
|
|
9582
9624
|
});
|
|
9583
9625
|
case 3:
|
|
@@ -9609,6 +9651,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9609
9651
|
case 34:
|
|
9610
9652
|
_context18.prev = 34;
|
|
9611
9653
|
if (folderToCleanUp && !((_process$env2 = process.env) !== null && _process$env2 !== void 0 && _process$env2["SENTRY_TEST_OVERRIDE_TEMP_DIR"])) {
|
|
9654
|
+
logger.debug("Cleaning up temporary files...");
|
|
9612
9655
|
void startSpan({
|
|
9613
9656
|
name: "cleanup",
|
|
9614
9657
|
scope: sentryScope
|
|
@@ -9617,7 +9660,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9617
9660
|
while (1) switch (_context17.prev = _context17.next) {
|
|
9618
9661
|
case 0:
|
|
9619
9662
|
if (!folderToCleanUp) {
|
|
9620
|
-
_context17.next =
|
|
9663
|
+
_context17.next = 4;
|
|
9621
9664
|
break;
|
|
9622
9665
|
}
|
|
9623
9666
|
_context17.next = 3;
|
|
@@ -9626,22 +9669,27 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9626
9669
|
force: true
|
|
9627
9670
|
});
|
|
9628
9671
|
case 3:
|
|
9672
|
+
logger.debug("Temporary folder deleted: ".concat(folderToCleanUp));
|
|
9673
|
+
case 4:
|
|
9629
9674
|
case "end":
|
|
9630
9675
|
return _context17.stop();
|
|
9631
9676
|
}
|
|
9632
9677
|
}, _callee17);
|
|
9633
9678
|
})));
|
|
9634
9679
|
}
|
|
9680
|
+
logger.debug("Freeing upload dependencies...");
|
|
9635
9681
|
freeUploadDependencyOnBuildArtifacts();
|
|
9636
|
-
|
|
9682
|
+
logger.debug("Flushing telemetry data...");
|
|
9683
|
+
_context18.next = 41;
|
|
9637
9684
|
return safeFlushTelemetry(sentryClient);
|
|
9638
|
-
case
|
|
9685
|
+
case 41:
|
|
9686
|
+
logger.debug("Telemetry flushed. Plugin upload process complete.");
|
|
9639
9687
|
return _context18.finish(34);
|
|
9640
|
-
case
|
|
9688
|
+
case 43:
|
|
9641
9689
|
case "end":
|
|
9642
9690
|
return _context18.stop();
|
|
9643
9691
|
}
|
|
9644
|
-
}, _callee18, null, [[2, 30, 34,
|
|
9692
|
+
}, _callee18, null, [[2, 30, 34, 43]]);
|
|
9645
9693
|
})));
|
|
9646
9694
|
case 8:
|
|
9647
9695
|
case "end":
|
|
@@ -9715,7 +9763,7 @@ function createSentryBuildPluginManager(userOptions, bundlerPluginMetaContext) {
|
|
|
9715
9763
|
};
|
|
9716
9764
|
}
|
|
9717
9765
|
function canUploadSourceMaps(options, logger, isDevMode) {
|
|
9718
|
-
var _options$sourcemaps10;
|
|
9766
|
+
var _options$sourcemaps10, _getProjects3;
|
|
9719
9767
|
if ((_options$sourcemaps10 = options.sourcemaps) !== null && _options$sourcemaps10 !== void 0 && _options$sourcemaps10.disable) {
|
|
9720
9768
|
logger.debug("Source map upload was disabled. Will not upload sourcemaps using debug ID process.");
|
|
9721
9769
|
return false;
|
|
@@ -9732,7 +9780,7 @@ function canUploadSourceMaps(options, logger, isDevMode) {
|
|
|
9732
9780
|
logger.warn("No org provided. Will not upload source maps. Please set the `org` option to your Sentry organization slug." + getTurborepoEnvPassthroughWarning("SENTRY_ORG"));
|
|
9733
9781
|
return false;
|
|
9734
9782
|
}
|
|
9735
|
-
if (!options.project) {
|
|
9783
|
+
if (!((_getProjects3 = getProjects(options.project)) !== null && _getProjects3 !== void 0 && _getProjects3[0])) {
|
|
9736
9784
|
logger.warn("No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug." + getTurborepoEnvPassthroughWarning("SENTRY_PROJECT"));
|
|
9737
9785
|
return false;
|
|
9738
9786
|
}
|
|
@@ -9774,18 +9822,14 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9774
9822
|
plugins.push({
|
|
9775
9823
|
name: "sentry-telemetry-plugin",
|
|
9776
9824
|
buildStart: function buildStart() {
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
return _context.stop();
|
|
9786
|
-
}
|
|
9787
|
-
}, _callee);
|
|
9788
|
-
}))();
|
|
9825
|
+
// Technically, for very fast builds we might miss the telemetry signal
|
|
9826
|
+
// but it's okay because telemetry is not critical for us.
|
|
9827
|
+
// We cannot await the flush here because it would block the build start
|
|
9828
|
+
// which in turn would break module federation builds, see
|
|
9829
|
+
// https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/816
|
|
9830
|
+
void sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal()["catch"](function () {
|
|
9831
|
+
// Nothing for the users to do here. If telemetry fails it's acceptable.
|
|
9832
|
+
});
|
|
9789
9833
|
}
|
|
9790
9834
|
});
|
|
9791
9835
|
if (Object.keys(bundleSizeOptimizationReplacementValues).length > 0) {
|
|
@@ -9812,22 +9856,22 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9812
9856
|
plugins.push({
|
|
9813
9857
|
name: "sentry-release-management-plugin",
|
|
9814
9858
|
writeBundle: function writeBundle() {
|
|
9815
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
9816
|
-
return _regeneratorRuntime().wrap(function
|
|
9817
|
-
while (1) switch (
|
|
9859
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9860
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9861
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9818
9862
|
case 0:
|
|
9819
|
-
|
|
9820
|
-
|
|
9863
|
+
_context.prev = 0;
|
|
9864
|
+
_context.next = 3;
|
|
9821
9865
|
return sentryBuildPluginManager.createRelease();
|
|
9822
9866
|
case 3:
|
|
9823
|
-
|
|
9867
|
+
_context.prev = 3;
|
|
9824
9868
|
freeGlobalDependencyOnBuildArtifacts();
|
|
9825
|
-
return
|
|
9869
|
+
return _context.finish(3);
|
|
9826
9870
|
case 6:
|
|
9827
9871
|
case "end":
|
|
9828
|
-
return
|
|
9872
|
+
return _context.stop();
|
|
9829
9873
|
}
|
|
9830
|
-
},
|
|
9874
|
+
}, _callee, null, [[0,, 3, 6]]);
|
|
9831
9875
|
}))();
|
|
9832
9876
|
}
|
|
9833
9877
|
});
|
|
@@ -9856,17 +9900,17 @@ function sentryUnpluginFactory(_ref) {
|
|
|
9856
9900
|
plugins.push({
|
|
9857
9901
|
name: "sentry-file-deletion-plugin",
|
|
9858
9902
|
writeBundle: function writeBundle() {
|
|
9859
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
9860
|
-
return _regeneratorRuntime().wrap(function
|
|
9861
|
-
while (1) switch (
|
|
9903
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9904
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9905
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
9862
9906
|
case 0:
|
|
9863
|
-
|
|
9907
|
+
_context2.next = 2;
|
|
9864
9908
|
return sentryBuildPluginManager.deleteArtifacts();
|
|
9865
9909
|
case 2:
|
|
9866
9910
|
case "end":
|
|
9867
|
-
return
|
|
9911
|
+
return _context2.stop();
|
|
9868
9912
|
}
|
|
9869
|
-
},
|
|
9913
|
+
}, _callee2);
|
|
9870
9914
|
}))();
|
|
9871
9915
|
}
|
|
9872
9916
|
});
|
|
@@ -10016,18 +10060,18 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
|
|
|
10016
10060
|
var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
|
|
10017
10061
|
return {
|
|
10018
10062
|
writeBundle: function writeBundle(outputOptions, bundle) {
|
|
10019
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
10063
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
10020
10064
|
var outputDir, _buildArtifacts, _buildArtifacts2;
|
|
10021
|
-
return _regeneratorRuntime().wrap(function
|
|
10022
|
-
while (1) switch (
|
|
10065
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10066
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
10023
10067
|
case 0:
|
|
10024
|
-
|
|
10068
|
+
_context3.prev = 0;
|
|
10025
10069
|
if (!outputOptions.dir) {
|
|
10026
|
-
|
|
10070
|
+
_context3.next = 10;
|
|
10027
10071
|
break;
|
|
10028
10072
|
}
|
|
10029
10073
|
outputDir = outputOptions.dir;
|
|
10030
|
-
|
|
10074
|
+
_context3.next = 5;
|
|
10031
10075
|
return glob.glob(["/**/*.js", "/**/*.mjs", "/**/*.cjs", "/**/*.js.map", "/**/*.mjs.map", "/**/*.cjs.map"].map(function (q) {
|
|
10032
10076
|
return "".concat(q, "?(\\?*)?(#*)");
|
|
10033
10077
|
}),
|
|
@@ -10038,37 +10082,37 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
|
|
|
10038
10082
|
nodir: true
|
|
10039
10083
|
});
|
|
10040
10084
|
case 5:
|
|
10041
|
-
_buildArtifacts =
|
|
10042
|
-
|
|
10085
|
+
_buildArtifacts = _context3.sent;
|
|
10086
|
+
_context3.next = 8;
|
|
10043
10087
|
return upload(_buildArtifacts);
|
|
10044
10088
|
case 8:
|
|
10045
|
-
|
|
10089
|
+
_context3.next = 18;
|
|
10046
10090
|
break;
|
|
10047
10091
|
case 10:
|
|
10048
10092
|
if (!outputOptions.file) {
|
|
10049
|
-
|
|
10093
|
+
_context3.next = 15;
|
|
10050
10094
|
break;
|
|
10051
10095
|
}
|
|
10052
|
-
|
|
10096
|
+
_context3.next = 13;
|
|
10053
10097
|
return upload([outputOptions.file]);
|
|
10054
10098
|
case 13:
|
|
10055
|
-
|
|
10099
|
+
_context3.next = 18;
|
|
10056
10100
|
break;
|
|
10057
10101
|
case 15:
|
|
10058
10102
|
_buildArtifacts2 = Object.keys(bundle).map(function (asset) {
|
|
10059
10103
|
return path__namespace.join(path__namespace.resolve(), asset);
|
|
10060
10104
|
});
|
|
10061
|
-
|
|
10105
|
+
_context3.next = 18;
|
|
10062
10106
|
return upload(_buildArtifacts2);
|
|
10063
10107
|
case 18:
|
|
10064
|
-
|
|
10108
|
+
_context3.prev = 18;
|
|
10065
10109
|
freeGlobalDependencyOnDebugIdSourcemapArtifacts();
|
|
10066
|
-
return
|
|
10110
|
+
return _context3.finish(18);
|
|
10067
10111
|
case 21:
|
|
10068
10112
|
case "end":
|
|
10069
|
-
return
|
|
10113
|
+
return _context3.stop();
|
|
10070
10114
|
}
|
|
10071
|
-
},
|
|
10115
|
+
}, _callee3, null, [[0,, 18, 21]]);
|
|
10072
10116
|
}))();
|
|
10073
10117
|
}
|
|
10074
10118
|
};
|
|
@@ -10076,26 +10120,26 @@ function createRollupDebugIdUploadHooks(upload, _logger, createDependencyOnBuild
|
|
|
10076
10120
|
function createComponentNameAnnotateHooks(ignoredComponents) {
|
|
10077
10121
|
return {
|
|
10078
10122
|
transform: function transform(code, id) {
|
|
10079
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
10123
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
10080
10124
|
var idWithoutQueryAndHash, parserPlugins, _result$code, result;
|
|
10081
|
-
return _regeneratorRuntime().wrap(function
|
|
10082
|
-
while (1) switch (
|
|
10125
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
10126
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
10083
10127
|
case 0:
|
|
10084
10128
|
// id may contain query and hash which will trip up our file extension logic below
|
|
10085
10129
|
idWithoutQueryAndHash = stripQueryAndHashFromPath(id);
|
|
10086
10130
|
if (!idWithoutQueryAndHash.match(/\\node_modules\\|\/node_modules\//)) {
|
|
10087
|
-
|
|
10131
|
+
_context4.next = 3;
|
|
10088
10132
|
break;
|
|
10089
10133
|
}
|
|
10090
|
-
return
|
|
10134
|
+
return _context4.abrupt("return", null);
|
|
10091
10135
|
case 3:
|
|
10092
10136
|
if ([".jsx", ".tsx"].some(function (ending) {
|
|
10093
10137
|
return idWithoutQueryAndHash.endsWith(ending);
|
|
10094
10138
|
})) {
|
|
10095
|
-
|
|
10139
|
+
_context4.next = 5;
|
|
10096
10140
|
break;
|
|
10097
10141
|
}
|
|
10098
|
-
return
|
|
10142
|
+
return _context4.abrupt("return", null);
|
|
10099
10143
|
case 5:
|
|
10100
10144
|
parserPlugins = [];
|
|
10101
10145
|
if (idWithoutQueryAndHash.endsWith(".jsx")) {
|
|
@@ -10103,8 +10147,8 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
|
|
|
10103
10147
|
} else if (idWithoutQueryAndHash.endsWith(".tsx")) {
|
|
10104
10148
|
parserPlugins.push("jsx", "typescript");
|
|
10105
10149
|
}
|
|
10106
|
-
|
|
10107
|
-
|
|
10150
|
+
_context4.prev = 7;
|
|
10151
|
+
_context4.next = 10;
|
|
10108
10152
|
return core.transformAsync(code, {
|
|
10109
10153
|
plugins: [[componentNameAnnotatePlugin__default["default"], {
|
|
10110
10154
|
ignoredComponents: ignoredComponents
|
|
@@ -10121,24 +10165,24 @@ function createComponentNameAnnotateHooks(ignoredComponents) {
|
|
|
10121
10165
|
sourceMaps: true
|
|
10122
10166
|
});
|
|
10123
10167
|
case 10:
|
|
10124
|
-
result =
|
|
10125
|
-
return
|
|
10168
|
+
result = _context4.sent;
|
|
10169
|
+
return _context4.abrupt("return", {
|
|
10126
10170
|
code: (_result$code = result === null || result === void 0 ? void 0 : result.code) !== null && _result$code !== void 0 ? _result$code : code,
|
|
10127
10171
|
map: result === null || result === void 0 ? void 0 : result.map
|
|
10128
10172
|
});
|
|
10129
10173
|
case 14:
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
logger.error("Failed to apply react annotate plugin",
|
|
10174
|
+
_context4.prev = 14;
|
|
10175
|
+
_context4.t0 = _context4["catch"](7);
|
|
10176
|
+
logger.error("Failed to apply react annotate plugin", _context4.t0);
|
|
10133
10177
|
case 17:
|
|
10134
|
-
return
|
|
10178
|
+
return _context4.abrupt("return", {
|
|
10135
10179
|
code: code
|
|
10136
10180
|
});
|
|
10137
10181
|
case 18:
|
|
10138
10182
|
case "end":
|
|
10139
|
-
return
|
|
10183
|
+
return _context4.stop();
|
|
10140
10184
|
}
|
|
10141
|
-
},
|
|
10185
|
+
}, _callee4, null, [[7, 14]]);
|
|
10142
10186
|
}))();
|
|
10143
10187
|
}
|
|
10144
10188
|
};
|