@hot-updater/plugin-core 0.20.15 → 0.21.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/index.cjs +441 -169
- package/dist/index.d.cts +133 -4
- package/dist/index.d.ts +133 -4
- package/dist/index.js +272 -13
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -30,16 +30,22 @@ let node_os = require("node:os");
|
|
|
30
30
|
node_os = __toESM(node_os);
|
|
31
31
|
let node_tty = require("node:tty");
|
|
32
32
|
node_tty = __toESM(node_tty);
|
|
33
|
-
let
|
|
34
|
-
|
|
33
|
+
let mime = require("mime");
|
|
34
|
+
mime = __toESM(mime);
|
|
35
35
|
let path = require("path");
|
|
36
36
|
path = __toESM(path);
|
|
37
|
+
let fs_promises = require("fs/promises");
|
|
38
|
+
fs_promises = __toESM(fs_promises);
|
|
37
39
|
let fs = require("fs");
|
|
38
40
|
fs = __toESM(fs);
|
|
39
41
|
let fast_glob = require("fast-glob");
|
|
40
42
|
fast_glob = __toESM(fast_glob);
|
|
41
43
|
let semver = require("semver");
|
|
42
44
|
semver = __toESM(semver);
|
|
45
|
+
let tar = require("tar");
|
|
46
|
+
tar = __toESM(tar);
|
|
47
|
+
let zlib = require("zlib");
|
|
48
|
+
zlib = __toESM(zlib);
|
|
43
49
|
let cosmiconfig = require("cosmiconfig");
|
|
44
50
|
cosmiconfig = __toESM(cosmiconfig);
|
|
45
51
|
let cosmiconfig_typescript_loader = require("cosmiconfig-typescript-loader");
|
|
@@ -1562,6 +1568,56 @@ function calculatePagination(total, options) {
|
|
|
1562
1568
|
};
|
|
1563
1569
|
}
|
|
1564
1570
|
|
|
1571
|
+
//#endregion
|
|
1572
|
+
//#region src/compressionFormat.ts
|
|
1573
|
+
/**
|
|
1574
|
+
* Compression formats registry
|
|
1575
|
+
* Add new formats here to support additional compression types
|
|
1576
|
+
*/
|
|
1577
|
+
const COMPRESSION_FORMATS = {
|
|
1578
|
+
zip: {
|
|
1579
|
+
format: "zip",
|
|
1580
|
+
fileExtension: ".zip",
|
|
1581
|
+
mimeType: "application/zip"
|
|
1582
|
+
},
|
|
1583
|
+
"tar.br": {
|
|
1584
|
+
format: "tar.br",
|
|
1585
|
+
fileExtension: ".tar.br",
|
|
1586
|
+
mimeType: "application/x-tar"
|
|
1587
|
+
},
|
|
1588
|
+
"tar.gz": {
|
|
1589
|
+
format: "tar.gz",
|
|
1590
|
+
fileExtension: ".tar.gz",
|
|
1591
|
+
mimeType: "application/x-tar"
|
|
1592
|
+
}
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* Detects compression format from filename
|
|
1596
|
+
* @param filename The filename to detect format from
|
|
1597
|
+
* @returns Compression format information
|
|
1598
|
+
*/
|
|
1599
|
+
function detectCompressionFormat(filename) {
|
|
1600
|
+
for (const info of Object.values(COMPRESSION_FORMATS)) if (filename.endsWith(info.fileExtension)) return info;
|
|
1601
|
+
return COMPRESSION_FORMATS.zip;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Gets MIME type for a filename
|
|
1605
|
+
* @param filename The filename to get MIME type for
|
|
1606
|
+
* @returns MIME type string
|
|
1607
|
+
*/
|
|
1608
|
+
function getCompressionMimeType(filename) {
|
|
1609
|
+
return detectCompressionFormat(filename).mimeType;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Gets Content-Type for a bundle file with 3-tier fallback
|
|
1613
|
+
* @param bundlePath The bundle file path
|
|
1614
|
+
* @returns Content-Type string (never undefined, falls back to application/octet-stream)
|
|
1615
|
+
*/
|
|
1616
|
+
function getContentType(bundlePath) {
|
|
1617
|
+
const filename = path.default.basename(bundlePath);
|
|
1618
|
+
return mime.default.getType(bundlePath) ?? getCompressionMimeType(filename) ?? "application/octet-stream";
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1565
1621
|
//#endregion
|
|
1566
1622
|
//#region ../../node_modules/.pnpm/workspace-tools@0.36.4/node_modules/workspace-tools/lib/graph/getPackageDependencies.js
|
|
1567
1623
|
var require_getPackageDependencies = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/workspace-tools@0.36.4/node_modules/workspace-tools/lib/graph/getPackageDependencies.js": ((exports) => {
|
|
@@ -6259,12 +6315,12 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6259
6315
|
result.data = null;
|
|
6260
6316
|
return result;
|
|
6261
6317
|
}
|
|
6262
|
-
function arg_to_path(path$
|
|
6263
|
-
if (typeof path$
|
|
6264
|
-
if (path$
|
|
6265
|
-
if (typeof path$
|
|
6266
|
-
if (!Array.isArray(path$
|
|
6267
|
-
return path$
|
|
6318
|
+
function arg_to_path(path$10) {
|
|
6319
|
+
if (typeof path$10 === "number") path$10 = String(path$10);
|
|
6320
|
+
if (path$10 === "") path$10 = [];
|
|
6321
|
+
if (typeof path$10 === "string") path$10 = path$10.split(".");
|
|
6322
|
+
if (!Array.isArray(path$10)) throw Error("Invalid path type, string or array expected");
|
|
6323
|
+
return path$10;
|
|
6268
6324
|
}
|
|
6269
6325
|
function find_element_in_tokenlist(element$1, lvl, tokens, begin, end) {
|
|
6270
6326
|
while (tokens[begin].stack[lvl] != element$1) if (begin++ >= end) return false;
|
|
@@ -6349,23 +6405,23 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6349
6405
|
} else throw error(" of an array");
|
|
6350
6406
|
else return true;
|
|
6351
6407
|
}
|
|
6352
|
-
Document.prototype.set = function(path$
|
|
6353
|
-
path$
|
|
6354
|
-
if (path$
|
|
6408
|
+
Document.prototype.set = function(path$10, value) {
|
|
6409
|
+
path$10 = arg_to_path(path$10);
|
|
6410
|
+
if (path$10.length === 0) {
|
|
6355
6411
|
if (value === void 0) throw Error("can't remove root document");
|
|
6356
6412
|
this._data = value;
|
|
6357
6413
|
var new_key = false;
|
|
6358
6414
|
} else {
|
|
6359
6415
|
var data = this._data;
|
|
6360
|
-
for (var i$3 = 0; i$3 < path$
|
|
6361
|
-
check_if_can_be_placed(path$
|
|
6362
|
-
data = data[path$
|
|
6416
|
+
for (var i$3 = 0; i$3 < path$10.length - 1; i$3++) {
|
|
6417
|
+
check_if_can_be_placed(path$10[i$3], data, false);
|
|
6418
|
+
data = data[path$10[i$3]];
|
|
6363
6419
|
}
|
|
6364
|
-
if (i$3 === path$
|
|
6365
|
-
var new_key = !(path$
|
|
6420
|
+
if (i$3 === path$10.length - 1) check_if_can_be_placed(path$10[i$3], data, value === void 0);
|
|
6421
|
+
var new_key = !(path$10[i$3] in data);
|
|
6366
6422
|
if (value === void 0) if (Array.isArray(data)) data.pop();
|
|
6367
|
-
else delete data[path$
|
|
6368
|
-
else data[path$
|
|
6423
|
+
else delete data[path$10[i$3]];
|
|
6424
|
+
else data[path$10[i$3]] = value;
|
|
6369
6425
|
}
|
|
6370
6426
|
if (!this._tokens.length) this._tokens = [{
|
|
6371
6427
|
raw: "",
|
|
@@ -6374,14 +6430,14 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6374
6430
|
value: void 0
|
|
6375
6431
|
}];
|
|
6376
6432
|
var position = [find_first_non_ws_token(this._tokens, 0, this._tokens.length - 1), find_last_non_ws_token(this._tokens, 0, this._tokens.length - 1)];
|
|
6377
|
-
for (var i$3 = 0; i$3 < path$
|
|
6378
|
-
position = find_element_in_tokenlist(path$
|
|
6433
|
+
for (var i$3 = 0; i$3 < path$10.length - 1; i$3++) {
|
|
6434
|
+
position = find_element_in_tokenlist(path$10[i$3], i$3, this._tokens, position[0], position[1]);
|
|
6379
6435
|
if (position == false) throw Error("internal error, please report this");
|
|
6380
6436
|
}
|
|
6381
|
-
if (path$
|
|
6437
|
+
if (path$10.length === 0) var newtokens = value_to_tokenlist(value, path$10, this._options);
|
|
6382
6438
|
else if (!new_key) {
|
|
6383
6439
|
var pos_old = position;
|
|
6384
|
-
position = find_element_in_tokenlist(path$
|
|
6440
|
+
position = find_element_in_tokenlist(path$10[i$3], i$3, this._tokens, position[0], position[1]);
|
|
6385
6441
|
if (value === void 0 && position !== false) {
|
|
6386
6442
|
var newtokens = [];
|
|
6387
6443
|
if (!Array.isArray(data)) {
|
|
@@ -6391,7 +6447,7 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6391
6447
|
position[0] = pos2;
|
|
6392
6448
|
var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1);
|
|
6393
6449
|
assert.equal(this._tokens[pos2].type, "key");
|
|
6394
|
-
assert.equal(this._tokens[pos2].value, path$
|
|
6450
|
+
assert.equal(this._tokens[pos2].value, path$10[path$10.length - 1]);
|
|
6395
6451
|
position[0] = pos2;
|
|
6396
6452
|
}
|
|
6397
6453
|
var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1);
|
|
@@ -6404,19 +6460,19 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6404
6460
|
}
|
|
6405
6461
|
} else {
|
|
6406
6462
|
var indent = pos2 !== false ? detect_indent_style(this._tokens, Array.isArray(data), pos_old[0], position[1] - 1, i$3) : {};
|
|
6407
|
-
var newtokens = value_to_tokenlist(value, path$
|
|
6463
|
+
var newtokens = value_to_tokenlist(value, path$10, this._options, false, indent);
|
|
6408
6464
|
}
|
|
6409
6465
|
} else {
|
|
6410
|
-
var path_1$13 = path$
|
|
6466
|
+
var path_1$13 = path$10.slice(0, i$3);
|
|
6411
6467
|
var pos2 = find_last_non_ws_token(this._tokens, position[0] + 1, position[1] - 1);
|
|
6412
6468
|
assert(pos2 !== false);
|
|
6413
6469
|
var indent = pos2 !== false ? detect_indent_style(this._tokens, Array.isArray(data), position[0] + 1, pos2, i$3) : {};
|
|
6414
|
-
var newtokens = value_to_tokenlist(value, path$
|
|
6470
|
+
var newtokens = value_to_tokenlist(value, path$10, this._options, false, indent);
|
|
6415
6471
|
var prefix = [];
|
|
6416
6472
|
if (indent.newline && indent.newline.length) prefix = prefix.concat(indent.newline);
|
|
6417
6473
|
if (indent.prefix && indent.prefix.length) prefix = prefix.concat(indent.prefix);
|
|
6418
6474
|
if (!Array.isArray(data)) {
|
|
6419
|
-
prefix = prefix.concat(value_to_tokenlist(path$
|
|
6475
|
+
prefix = prefix.concat(value_to_tokenlist(path$10[path$10.length - 1], path_1$13, this._options, true));
|
|
6420
6476
|
if (indent.sep1 && indent.sep1.length) prefix = prefix.concat(indent.sep1);
|
|
6421
6477
|
prefix.push({
|
|
6422
6478
|
raw: ":",
|
|
@@ -6426,7 +6482,7 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6426
6482
|
if (indent.sep2 && indent.sep2.length) prefix = prefix.concat(indent.sep2);
|
|
6427
6483
|
}
|
|
6428
6484
|
newtokens.unshift.apply(newtokens, prefix);
|
|
6429
|
-
if (this._tokens[pos2].type === "separator" && this._tokens[pos2].stack.length === path$
|
|
6485
|
+
if (this._tokens[pos2].type === "separator" && this._tokens[pos2].stack.length === path$10.length - 1) {
|
|
6430
6486
|
if (this._tokens[pos2].raw === ",") newtokens.push({
|
|
6431
6487
|
raw: ",",
|
|
6432
6488
|
type: "separator",
|
|
@@ -6447,24 +6503,24 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6447
6503
|
this._tokens.splice.apply(this._tokens, newtokens);
|
|
6448
6504
|
return this;
|
|
6449
6505
|
};
|
|
6450
|
-
Document.prototype.unset = function(path$
|
|
6451
|
-
return this.set(path$
|
|
6506
|
+
Document.prototype.unset = function(path$10) {
|
|
6507
|
+
return this.set(path$10, void 0);
|
|
6452
6508
|
};
|
|
6453
|
-
Document.prototype.get = function(path$
|
|
6454
|
-
path$
|
|
6509
|
+
Document.prototype.get = function(path$10) {
|
|
6510
|
+
path$10 = arg_to_path(path$10);
|
|
6455
6511
|
var data = this._data;
|
|
6456
|
-
for (var i$3 = 0; i$3 < path$
|
|
6512
|
+
for (var i$3 = 0; i$3 < path$10.length; i$3++) {
|
|
6457
6513
|
if (!isObject$3(data)) return void 0;
|
|
6458
|
-
data = data[path$
|
|
6514
|
+
data = data[path$10[i$3]];
|
|
6459
6515
|
}
|
|
6460
6516
|
return data;
|
|
6461
6517
|
};
|
|
6462
|
-
Document.prototype.has = function(path$
|
|
6463
|
-
path$
|
|
6518
|
+
Document.prototype.has = function(path$10) {
|
|
6519
|
+
path$10 = arg_to_path(path$10);
|
|
6464
6520
|
var data = this._data;
|
|
6465
|
-
for (var i$3 = 0; i$3 < path$
|
|
6521
|
+
for (var i$3 = 0; i$3 < path$10.length; i$3++) {
|
|
6466
6522
|
if (!isObject$3(data)) return false;
|
|
6467
|
-
data = data[path$
|
|
6523
|
+
data = data[path$10[i$3]];
|
|
6468
6524
|
}
|
|
6469
6525
|
return data !== void 0;
|
|
6470
6526
|
};
|
|
@@ -6472,31 +6528,31 @@ var require_document = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jj
|
|
|
6472
6528
|
var self$1 = this;
|
|
6473
6529
|
change([], self$1._data, value);
|
|
6474
6530
|
return self$1;
|
|
6475
|
-
function change(path$
|
|
6531
|
+
function change(path$10, old_data, new_data) {
|
|
6476
6532
|
if (!isObject$3(new_data) || !isObject$3(old_data)) {
|
|
6477
|
-
if (new_data !== old_data) self$1.set(path$
|
|
6478
|
-
} else if (Array.isArray(new_data) != Array.isArray(old_data)) self$1.set(path$
|
|
6533
|
+
if (new_data !== old_data) self$1.set(path$10, new_data);
|
|
6534
|
+
} else if (Array.isArray(new_data) != Array.isArray(old_data)) self$1.set(path$10, new_data);
|
|
6479
6535
|
else if (Array.isArray(new_data)) if (new_data.length > old_data.length) for (var i$3 = 0; i$3 < new_data.length; i$3++) {
|
|
6480
|
-
path$
|
|
6481
|
-
change(path$
|
|
6482
|
-
path$
|
|
6536
|
+
path$10.push(String(i$3));
|
|
6537
|
+
change(path$10, old_data[i$3], new_data[i$3]);
|
|
6538
|
+
path$10.pop();
|
|
6483
6539
|
}
|
|
6484
6540
|
else for (var i$3 = old_data.length - 1; i$3 >= 0; i$3--) {
|
|
6485
|
-
path$
|
|
6486
|
-
change(path$
|
|
6487
|
-
path$
|
|
6541
|
+
path$10.push(String(i$3));
|
|
6542
|
+
change(path$10, old_data[i$3], new_data[i$3]);
|
|
6543
|
+
path$10.pop();
|
|
6488
6544
|
}
|
|
6489
6545
|
else {
|
|
6490
6546
|
for (var i$3 in new_data) {
|
|
6491
|
-
path$
|
|
6492
|
-
change(path$
|
|
6493
|
-
path$
|
|
6547
|
+
path$10.push(String(i$3));
|
|
6548
|
+
change(path$10, old_data[i$3], new_data[i$3]);
|
|
6549
|
+
path$10.pop();
|
|
6494
6550
|
}
|
|
6495
6551
|
for (var i$3 in old_data) {
|
|
6496
6552
|
if (i$3 in new_data) continue;
|
|
6497
|
-
path$
|
|
6498
|
-
change(path$
|
|
6499
|
-
path$
|
|
6553
|
+
path$10.push(String(i$3));
|
|
6554
|
+
change(path$10, old_data[i$3], new_data[i$3]);
|
|
6555
|
+
path$10.pop();
|
|
6500
6556
|
}
|
|
6501
6557
|
}
|
|
6502
6558
|
}
|
|
@@ -7973,7 +8029,7 @@ var require_braces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/brac
|
|
|
7973
8029
|
//#endregion
|
|
7974
8030
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
7975
8031
|
var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js": ((exports, module) => {
|
|
7976
|
-
const path$
|
|
8032
|
+
const path$8 = require("path");
|
|
7977
8033
|
const WIN_SLASH = "\\\\/";
|
|
7978
8034
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
7979
8035
|
/**
|
|
@@ -8098,7 +8154,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
8098
8154
|
CHAR_UNDERSCORE: 95,
|
|
8099
8155
|
CHAR_VERTICAL_LINE: 124,
|
|
8100
8156
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
8101
|
-
SEP: path$
|
|
8157
|
+
SEP: path$8.sep,
|
|
8102
8158
|
extglobChars(chars) {
|
|
8103
8159
|
return {
|
|
8104
8160
|
"!": {
|
|
@@ -8137,7 +8193,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
8137
8193
|
//#endregion
|
|
8138
8194
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
8139
8195
|
var require_utils$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js": ((exports) => {
|
|
8140
|
-
const path$
|
|
8196
|
+
const path$7 = require("path");
|
|
8141
8197
|
const win32 = process.platform === "win32";
|
|
8142
8198
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
|
|
8143
8199
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -8157,7 +8213,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pic
|
|
|
8157
8213
|
};
|
|
8158
8214
|
exports.isWindows = (options) => {
|
|
8159
8215
|
if (options && typeof options.windows === "boolean") return options.windows;
|
|
8160
|
-
return win32 === true || path$
|
|
8216
|
+
return win32 === true || path$7.sep === "\\";
|
|
8161
8217
|
};
|
|
8162
8218
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
8163
8219
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -9333,7 +9389,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
|
|
|
9333
9389
|
//#endregion
|
|
9334
9390
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
9335
9391
|
var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
|
|
9336
|
-
const path$
|
|
9392
|
+
const path$6 = require("path");
|
|
9337
9393
|
const scan = require_scan();
|
|
9338
9394
|
const parse = require_parse();
|
|
9339
9395
|
const utils$29 = require_utils$1();
|
|
@@ -9472,7 +9528,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
9472
9528
|
* @api public
|
|
9473
9529
|
*/
|
|
9474
9530
|
picomatch$1.matchBase = (input, glob, options, posix = utils$29.isWindows(options)) => {
|
|
9475
|
-
return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$
|
|
9531
|
+
return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$6.basename(input));
|
|
9476
9532
|
};
|
|
9477
9533
|
/**
|
|
9478
9534
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -10989,9 +11045,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
10989
11045
|
};
|
|
10990
11046
|
})();
|
|
10991
11047
|
let getEolFromFile = (() => {
|
|
10992
|
-
var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path$
|
|
10993
|
-
if (!(yield exists(path$
|
|
10994
|
-
const buffer$2 = yield readFileBuffer(path$
|
|
11048
|
+
var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path$10) {
|
|
11049
|
+
if (!(yield exists(path$10))) return;
|
|
11050
|
+
const buffer$2 = yield readFileBuffer(path$10);
|
|
10995
11051
|
for (let i$3 = 0; i$3 < buffer$2.length; ++i$3) {
|
|
10996
11052
|
if (buffer$2[i$3] === cr) return "\r\n";
|
|
10997
11053
|
if (buffer$2[i$3] === lf) return "\n";
|
|
@@ -11002,10 +11058,10 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11002
11058
|
};
|
|
11003
11059
|
})();
|
|
11004
11060
|
exports$1.writeFilePreservingEol = (() => {
|
|
11005
|
-
var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path$
|
|
11006
|
-
const eol = (yield getEolFromFile(path$
|
|
11061
|
+
var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path$10, data) {
|
|
11062
|
+
const eol = (yield getEolFromFile(path$10)) || (_os || _load_os()).default.EOL;
|
|
11007
11063
|
if (eol !== "\n") data = data.replace(/\n/g, eol);
|
|
11008
|
-
yield writeFile(path$
|
|
11064
|
+
yield writeFile(path$10, data);
|
|
11009
11065
|
});
|
|
11010
11066
|
return function writeFilePreservingEol(_x30, _x31) {
|
|
11011
11067
|
return _ref31.apply(this, arguments);
|
|
@@ -11054,10 +11110,10 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11054
11110
|
if (_i15.done) break;
|
|
11055
11111
|
_ref35 = _i15.value;
|
|
11056
11112
|
}
|
|
11057
|
-
const path$
|
|
11113
|
+
const path$10 = _ref35;
|
|
11058
11114
|
try {
|
|
11059
|
-
const fd = yield open(path$
|
|
11060
|
-
return (_fs || _load_fs()).default.createReadStream(path$
|
|
11115
|
+
const fd = yield open(path$10, "r");
|
|
11116
|
+
return (_fs || _load_fs()).default.createReadStream(path$10, { fd });
|
|
11061
11117
|
} catch (err$1) {}
|
|
11062
11118
|
}
|
|
11063
11119
|
return null;
|
|
@@ -11212,7 +11268,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11212
11268
|
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
11213
11269
|
exports$1.getPathKey = getPathKey;
|
|
11214
11270
|
const os$1 = __webpack_require__(36);
|
|
11215
|
-
const path$
|
|
11271
|
+
const path$10 = __webpack_require__(0);
|
|
11216
11272
|
const userHome = __webpack_require__(45).default;
|
|
11217
11273
|
var _require = __webpack_require__(171);
|
|
11218
11274
|
const getCacheDir = _require.getCacheDir, getConfigDir = _require.getConfigDir, getDataDir = _require.getDataDir;
|
|
@@ -11242,25 +11298,25 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11242
11298
|
];
|
|
11243
11299
|
function getPreferredCacheDirectories() {
|
|
11244
11300
|
const preferredCacheDirectories = [getCacheDir()];
|
|
11245
|
-
if (process.getuid) preferredCacheDirectories.push(path$
|
|
11246
|
-
preferredCacheDirectories.push(path$
|
|
11301
|
+
if (process.getuid) preferredCacheDirectories.push(path$10.join(os$1.tmpdir(), `.yarn-cache-${process.getuid()}`));
|
|
11302
|
+
preferredCacheDirectories.push(path$10.join(os$1.tmpdir(), `.yarn-cache`));
|
|
11247
11303
|
return preferredCacheDirectories;
|
|
11248
11304
|
}
|
|
11249
11305
|
exports$1.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories();
|
|
11250
11306
|
exports$1.CONFIG_DIRECTORY = getConfigDir();
|
|
11251
11307
|
const DATA_DIRECTORY = exports$1.DATA_DIRECTORY = getDataDir();
|
|
11252
|
-
exports$1.LINK_REGISTRY_DIRECTORY = path$
|
|
11253
|
-
exports$1.GLOBAL_MODULE_DIRECTORY = path$
|
|
11308
|
+
exports$1.LINK_REGISTRY_DIRECTORY = path$10.join(DATA_DIRECTORY, "link");
|
|
11309
|
+
exports$1.GLOBAL_MODULE_DIRECTORY = path$10.join(DATA_DIRECTORY, "global");
|
|
11254
11310
|
exports$1.NODE_BIN_PATH = process.execPath;
|
|
11255
11311
|
exports$1.YARN_BIN_PATH = getYarnBinPath();
|
|
11256
11312
|
function getYarnBinPath() {
|
|
11257
11313
|
if (isWebpackBundle) return __filename;
|
|
11258
|
-
else return path$
|
|
11314
|
+
else return path$10.join(__dirname, "..", "bin", "yarn.js");
|
|
11259
11315
|
}
|
|
11260
11316
|
exports$1.NODE_MODULES_FOLDER = "node_modules";
|
|
11261
11317
|
exports$1.NODE_PACKAGE_JSON = "package.json";
|
|
11262
11318
|
exports$1.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ""}/usr/local`;
|
|
11263
|
-
exports$1.FALLBACK_GLOBAL_PREFIX = path$
|
|
11319
|
+
exports$1.FALLBACK_GLOBAL_PREFIX = path$10.join(userHome, ".yarn");
|
|
11264
11320
|
exports$1.META_FOLDER = ".yarn-meta";
|
|
11265
11321
|
exports$1.INTEGRITY_FILENAME = ".yarn-integrity";
|
|
11266
11322
|
exports$1.LOCKFILE_FILENAME = "yarn.lock";
|
|
@@ -11480,7 +11536,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11480
11536
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
11481
11537
|
}
|
|
11482
11538
|
const invariant = __webpack_require__(7);
|
|
11483
|
-
const path$
|
|
11539
|
+
const path$10 = __webpack_require__(0);
|
|
11484
11540
|
const ssri = __webpack_require__(55);
|
|
11485
11541
|
function getName(pattern) {
|
|
11486
11542
|
return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name;
|
|
@@ -11535,7 +11591,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11535
11591
|
}
|
|
11536
11592
|
static fromDirectory(dir, reporter) {
|
|
11537
11593
|
return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
|
|
11538
|
-
const lockfileLoc = path$
|
|
11594
|
+
const lockfileLoc = path$10.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME);
|
|
11539
11595
|
let lockfile;
|
|
11540
11596
|
let rawLockfile = "";
|
|
11541
11597
|
let parseResult;
|
|
@@ -11884,9 +11940,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
11884
11940
|
function _interopRequireDefault(obj) {
|
|
11885
11941
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
11886
11942
|
}
|
|
11887
|
-
const path$
|
|
11943
|
+
const path$10 = __webpack_require__(0);
|
|
11888
11944
|
const home = exports$1.home = __webpack_require__(36).homedir();
|
|
11889
|
-
exports$1.default = (_rootUser || _load_rootUser()).default ? path$
|
|
11945
|
+
exports$1.default = (_rootUser || _load_rootUser()).default ? path$10.resolve("/usr/local/share") : home;
|
|
11890
11946
|
}),
|
|
11891
11947
|
(function(module$1, exports$1) {
|
|
11892
11948
|
module$1.exports = function(it) {
|
|
@@ -12237,9 +12293,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
12237
12293
|
(function(module$1, exports$1, __webpack_require__) {
|
|
12238
12294
|
module$1.exports = minimatch;
|
|
12239
12295
|
minimatch.Minimatch = Minimatch;
|
|
12240
|
-
var path$
|
|
12296
|
+
var path$10 = { sep: "/" };
|
|
12241
12297
|
try {
|
|
12242
|
-
path$
|
|
12298
|
+
path$10 = __webpack_require__(0);
|
|
12243
12299
|
} catch (er) {}
|
|
12244
12300
|
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
12245
12301
|
var expand$2 = __webpack_require__(175);
|
|
@@ -12323,7 +12379,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
12323
12379
|
if (typeof pattern !== "string") throw new TypeError("glob pattern string required");
|
|
12324
12380
|
if (!options) options = {};
|
|
12325
12381
|
pattern = pattern.trim();
|
|
12326
|
-
if (path$
|
|
12382
|
+
if (path$10.sep !== "/") pattern = pattern.split(path$10.sep).join("/");
|
|
12327
12383
|
this.options = options;
|
|
12328
12384
|
this.set = [];
|
|
12329
12385
|
this.pattern = pattern;
|
|
@@ -12638,7 +12694,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
12638
12694
|
if (this.empty) return f === "";
|
|
12639
12695
|
if (f === "/" && partial) return true;
|
|
12640
12696
|
var options = this.options;
|
|
12641
|
-
if (path$
|
|
12697
|
+
if (path$10.sep !== "/") f = f.split(path$10.sep).join("/");
|
|
12642
12698
|
f = f.split(slashSplit);
|
|
12643
12699
|
this.debug(this.pattern, "split", f);
|
|
12644
12700
|
var set = this.set;
|
|
@@ -12844,13 +12900,13 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
12844
12900
|
}),
|
|
12845
12901
|
(function(module$1, exports$1, __webpack_require__) {
|
|
12846
12902
|
module$1.exports = glob;
|
|
12847
|
-
var fs$
|
|
12903
|
+
var fs$7 = __webpack_require__(3);
|
|
12848
12904
|
var rp = __webpack_require__(114);
|
|
12849
12905
|
var minimatch = __webpack_require__(60);
|
|
12850
12906
|
minimatch.Minimatch;
|
|
12851
12907
|
var inherits = __webpack_require__(42);
|
|
12852
12908
|
var EE = __webpack_require__(54).EventEmitter;
|
|
12853
|
-
var path$
|
|
12909
|
+
var path$10 = __webpack_require__(0);
|
|
12854
12910
|
var assert$1 = __webpack_require__(22);
|
|
12855
12911
|
var isAbsolute = __webpack_require__(76);
|
|
12856
12912
|
var globSync = __webpack_require__(218);
|
|
@@ -13081,7 +13137,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13081
13137
|
var e = matchedEntries[i$3];
|
|
13082
13138
|
if (prefix) if (prefix !== "/") e = prefix + "/" + e;
|
|
13083
13139
|
else e = prefix + e;
|
|
13084
|
-
if (e.charAt(0) === "/" && !this.nomount) e = path$
|
|
13140
|
+
if (e.charAt(0) === "/" && !this.nomount) e = path$10.join(this.root, e);
|
|
13085
13141
|
this._emitMatch(index, e);
|
|
13086
13142
|
}
|
|
13087
13143
|
return cb();
|
|
@@ -13121,7 +13177,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13121
13177
|
var lstatkey = "lstat\0" + abs;
|
|
13122
13178
|
var self$1 = this;
|
|
13123
13179
|
var lstatcb = inflight(lstatkey, lstatcb_);
|
|
13124
|
-
if (lstatcb) fs$
|
|
13180
|
+
if (lstatcb) fs$7.lstat(abs, lstatcb);
|
|
13125
13181
|
function lstatcb_(er, lstat) {
|
|
13126
13182
|
if (er && er.code === "ENOENT") return cb();
|
|
13127
13183
|
var isSym = lstat && lstat.isSymbolicLink();
|
|
@@ -13142,7 +13198,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13142
13198
|
if (!c$1 || c$1 === "FILE") return cb();
|
|
13143
13199
|
if (Array.isArray(c$1)) return cb(null, c$1);
|
|
13144
13200
|
}
|
|
13145
|
-
fs$
|
|
13201
|
+
fs$7.readdir(abs, readdirCb(this, abs, cb));
|
|
13146
13202
|
};
|
|
13147
13203
|
function readdirCb(self$1, abs, cb) {
|
|
13148
13204
|
return function(er, entries) {
|
|
@@ -13228,9 +13284,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13228
13284
|
if (!exists) return cb();
|
|
13229
13285
|
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
13230
13286
|
var trail = /[\/\\]$/.test(prefix);
|
|
13231
|
-
if (prefix.charAt(0) === "/") prefix = path$
|
|
13287
|
+
if (prefix.charAt(0) === "/") prefix = path$10.join(this.root, prefix);
|
|
13232
13288
|
else {
|
|
13233
|
-
prefix = path$
|
|
13289
|
+
prefix = path$10.resolve(this.root, prefix);
|
|
13234
13290
|
if (trail) prefix += "/";
|
|
13235
13291
|
}
|
|
13236
13292
|
}
|
|
@@ -13257,9 +13313,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13257
13313
|
}
|
|
13258
13314
|
var self$1 = this;
|
|
13259
13315
|
var statcb = inflight("stat\0" + abs, lstatcb_);
|
|
13260
|
-
if (statcb) fs$
|
|
13316
|
+
if (statcb) fs$7.lstat(abs, statcb);
|
|
13261
13317
|
function lstatcb_(er, lstat) {
|
|
13262
|
-
if (lstat && lstat.isSymbolicLink()) return fs$
|
|
13318
|
+
if (lstat && lstat.isSymbolicLink()) return fs$7.stat(abs, function(er$1, stat$1) {
|
|
13263
13319
|
if (er$1) self$1._stat2(f, abs, null, lstat, cb);
|
|
13264
13320
|
else self$1._stat2(f, abs, er$1, stat$1, cb);
|
|
13265
13321
|
});
|
|
@@ -13282,11 +13338,11 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
13282
13338
|
};
|
|
13283
13339
|
}),
|
|
13284
13340
|
(function(module$1, exports$1, __webpack_require__) {
|
|
13285
|
-
function posix(path$
|
|
13286
|
-
return path$
|
|
13341
|
+
function posix(path$10) {
|
|
13342
|
+
return path$10.charAt(0) === "/";
|
|
13287
13343
|
}
|
|
13288
|
-
function win32$1(path$
|
|
13289
|
-
var result = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(path$
|
|
13344
|
+
function win32$1(path$10) {
|
|
13345
|
+
var result = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(path$10);
|
|
13290
13346
|
var device = result[1] || "";
|
|
13291
13347
|
var isUnc = Boolean(device && device.charAt(1) !== ":");
|
|
13292
13348
|
return Boolean(result[2] || isUnc);
|
|
@@ -14142,9 +14198,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14142
14198
|
realpath.realpathSync = realpathSync;
|
|
14143
14199
|
realpath.monkeypatch = monkeypatch;
|
|
14144
14200
|
realpath.unmonkeypatch = unmonkeypatch;
|
|
14145
|
-
var fs$
|
|
14146
|
-
var origRealpath = fs$
|
|
14147
|
-
var origRealpathSync = fs$
|
|
14201
|
+
var fs$7 = __webpack_require__(3);
|
|
14202
|
+
var origRealpath = fs$7.realpath;
|
|
14203
|
+
var origRealpathSync = fs$7.realpathSync;
|
|
14148
14204
|
var version = process.version;
|
|
14149
14205
|
var ok = /^v[0-5]\./.test(version);
|
|
14150
14206
|
var old = __webpack_require__(217);
|
|
@@ -14172,12 +14228,12 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14172
14228
|
}
|
|
14173
14229
|
}
|
|
14174
14230
|
function monkeypatch() {
|
|
14175
|
-
fs$
|
|
14176
|
-
fs$
|
|
14231
|
+
fs$7.realpath = realpath;
|
|
14232
|
+
fs$7.realpathSync = realpathSync;
|
|
14177
14233
|
}
|
|
14178
14234
|
function unmonkeypatch() {
|
|
14179
|
-
fs$
|
|
14180
|
-
fs$
|
|
14235
|
+
fs$7.realpath = origRealpath;
|
|
14236
|
+
fs$7.realpathSync = origRealpathSync;
|
|
14181
14237
|
}
|
|
14182
14238
|
}),
|
|
14183
14239
|
(function(module$1, exports$1, __webpack_require__) {
|
|
@@ -14193,7 +14249,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14193
14249
|
function ownProp(obj, field) {
|
|
14194
14250
|
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
14195
14251
|
}
|
|
14196
|
-
var path$
|
|
14252
|
+
var path$10 = __webpack_require__(0);
|
|
14197
14253
|
var minimatch = __webpack_require__(60);
|
|
14198
14254
|
var isAbsolute = __webpack_require__(76);
|
|
14199
14255
|
var Minimatch = minimatch.Minimatch;
|
|
@@ -14249,11 +14305,11 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14249
14305
|
var cwd = process.cwd();
|
|
14250
14306
|
if (!ownProp(options, "cwd")) self$1.cwd = cwd;
|
|
14251
14307
|
else {
|
|
14252
|
-
self$1.cwd = path$
|
|
14308
|
+
self$1.cwd = path$10.resolve(options.cwd);
|
|
14253
14309
|
self$1.changedCwd = self$1.cwd !== cwd;
|
|
14254
14310
|
}
|
|
14255
|
-
self$1.root = options.root || path$
|
|
14256
|
-
self$1.root = path$
|
|
14311
|
+
self$1.root = options.root || path$10.resolve(self$1.cwd, "/");
|
|
14312
|
+
self$1.root = path$10.resolve(self$1.root);
|
|
14257
14313
|
if (process.platform === "win32") self$1.root = self$1.root.replace(/\\/g, "/");
|
|
14258
14314
|
self$1.cwdAbs = isAbsolute(self$1.cwd) ? self$1.cwd : makeAbs(self$1, self$1.cwd);
|
|
14259
14315
|
if (process.platform === "win32") self$1.cwdAbs = self$1.cwdAbs.replace(/\\/g, "/");
|
|
@@ -14317,29 +14373,29 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14317
14373
|
}
|
|
14318
14374
|
function makeAbs(self$1, f) {
|
|
14319
14375
|
var abs = f;
|
|
14320
|
-
if (f.charAt(0) === "/") abs = path$
|
|
14376
|
+
if (f.charAt(0) === "/") abs = path$10.join(self$1.root, f);
|
|
14321
14377
|
else if (isAbsolute(f) || f === "") abs = f;
|
|
14322
|
-
else if (self$1.changedCwd) abs = path$
|
|
14323
|
-
else abs = path$
|
|
14378
|
+
else if (self$1.changedCwd) abs = path$10.resolve(self$1.cwd, f);
|
|
14379
|
+
else abs = path$10.resolve(f);
|
|
14324
14380
|
if (process.platform === "win32") abs = abs.replace(/\\/g, "/");
|
|
14325
14381
|
return abs;
|
|
14326
14382
|
}
|
|
14327
|
-
function isIgnored(self$1, path$
|
|
14383
|
+
function isIgnored(self$1, path$11) {
|
|
14328
14384
|
if (!self$1.ignore.length) return false;
|
|
14329
14385
|
return self$1.ignore.some(function(item) {
|
|
14330
|
-
return item.matcher.match(path$
|
|
14386
|
+
return item.matcher.match(path$11) || !!(item.gmatcher && item.gmatcher.match(path$11));
|
|
14331
14387
|
});
|
|
14332
14388
|
}
|
|
14333
|
-
function childrenIgnored(self$1, path$
|
|
14389
|
+
function childrenIgnored(self$1, path$11) {
|
|
14334
14390
|
if (!self$1.ignore.length) return false;
|
|
14335
14391
|
return self$1.ignore.some(function(item) {
|
|
14336
|
-
return !!(item.gmatcher && item.gmatcher.match(path$
|
|
14392
|
+
return !!(item.gmatcher && item.gmatcher.match(path$11));
|
|
14337
14393
|
});
|
|
14338
14394
|
}
|
|
14339
14395
|
}),
|
|
14340
14396
|
(function(module$1, exports$1, __webpack_require__) {
|
|
14341
|
-
var path$
|
|
14342
|
-
var fs$
|
|
14397
|
+
var path$10 = __webpack_require__(0);
|
|
14398
|
+
var fs$7 = __webpack_require__(3);
|
|
14343
14399
|
var _0777 = parseInt("0777", 8);
|
|
14344
14400
|
module$1.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
14345
14401
|
function mkdirP(p$1, opts, f, made) {
|
|
@@ -14348,11 +14404,11 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14348
14404
|
opts = {};
|
|
14349
14405
|
} else if (!opts || typeof opts !== "object") opts = { mode: opts };
|
|
14350
14406
|
var mode = opts.mode;
|
|
14351
|
-
var xfs = opts.fs || fs$
|
|
14407
|
+
var xfs = opts.fs || fs$7;
|
|
14352
14408
|
if (mode === void 0) mode = _0777 & ~process.umask();
|
|
14353
14409
|
if (!made) made = null;
|
|
14354
14410
|
var cb = f || function() {};
|
|
14355
|
-
p$1 = path$
|
|
14411
|
+
p$1 = path$10.resolve(p$1);
|
|
14356
14412
|
xfs.mkdir(p$1, mode, function(er) {
|
|
14357
14413
|
if (!er) {
|
|
14358
14414
|
made = made || p$1;
|
|
@@ -14360,7 +14416,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14360
14416
|
}
|
|
14361
14417
|
switch (er.code) {
|
|
14362
14418
|
case "ENOENT":
|
|
14363
|
-
mkdirP(path$
|
|
14419
|
+
mkdirP(path$10.dirname(p$1), opts, function(er$1, made$1) {
|
|
14364
14420
|
if (er$1) cb(er$1, made$1);
|
|
14365
14421
|
else mkdirP(p$1, opts, cb, made$1);
|
|
14366
14422
|
});
|
|
@@ -14377,17 +14433,17 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14377
14433
|
mkdirP.sync = function sync(p$1, opts, made) {
|
|
14378
14434
|
if (!opts || typeof opts !== "object") opts = { mode: opts };
|
|
14379
14435
|
var mode = opts.mode;
|
|
14380
|
-
var xfs = opts.fs || fs$
|
|
14436
|
+
var xfs = opts.fs || fs$7;
|
|
14381
14437
|
if (mode === void 0) mode = _0777 & ~process.umask();
|
|
14382
14438
|
if (!made) made = null;
|
|
14383
|
-
p$1 = path$
|
|
14439
|
+
p$1 = path$10.resolve(p$1);
|
|
14384
14440
|
try {
|
|
14385
14441
|
xfs.mkdirSync(p$1, mode);
|
|
14386
14442
|
made = made || p$1;
|
|
14387
14443
|
} catch (err0) {
|
|
14388
14444
|
switch (err0.code) {
|
|
14389
14445
|
case "ENOENT":
|
|
14390
|
-
made = sync(path$
|
|
14446
|
+
made = sync(path$10.dirname(p$1), opts, made);
|
|
14391
14447
|
sync(p$1, opts, made);
|
|
14392
14448
|
break;
|
|
14393
14449
|
default:
|
|
@@ -14837,32 +14893,32 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
14837
14893
|
exports$1.getDataDir = getDataDir;
|
|
14838
14894
|
exports$1.getCacheDir = getCacheDir;
|
|
14839
14895
|
exports$1.getConfigDir = getConfigDir;
|
|
14840
|
-
const path$
|
|
14896
|
+
const path$10 = __webpack_require__(0);
|
|
14841
14897
|
const userHome = __webpack_require__(45).default;
|
|
14842
|
-
const FALLBACK_CONFIG_DIR = path$
|
|
14843
|
-
const FALLBACK_CACHE_DIR = path$
|
|
14898
|
+
const FALLBACK_CONFIG_DIR = path$10.join(userHome, ".config", "yarn");
|
|
14899
|
+
const FALLBACK_CACHE_DIR = path$10.join(userHome, ".cache", "yarn");
|
|
14844
14900
|
function getDataDir() {
|
|
14845
14901
|
if (process.platform === "win32") {
|
|
14846
14902
|
const WIN32_APPDATA_DIR = getLocalAppDataDir();
|
|
14847
|
-
return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path$
|
|
14848
|
-
} else if (process.env.XDG_DATA_HOME) return path$
|
|
14903
|
+
return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path$10.join(WIN32_APPDATA_DIR, "Data");
|
|
14904
|
+
} else if (process.env.XDG_DATA_HOME) return path$10.join(process.env.XDG_DATA_HOME, "yarn");
|
|
14849
14905
|
else return FALLBACK_CONFIG_DIR;
|
|
14850
14906
|
}
|
|
14851
14907
|
function getCacheDir() {
|
|
14852
|
-
if (process.platform === "win32") return path$
|
|
14853
|
-
else if (process.env.XDG_CACHE_HOME) return path$
|
|
14854
|
-
else if (process.platform === "darwin") return path$
|
|
14908
|
+
if (process.platform === "win32") return path$10.join(getLocalAppDataDir() || path$10.join(userHome, "AppData", "Local", "Yarn"), "Cache");
|
|
14909
|
+
else if (process.env.XDG_CACHE_HOME) return path$10.join(process.env.XDG_CACHE_HOME, "yarn");
|
|
14910
|
+
else if (process.platform === "darwin") return path$10.join(userHome, "Library", "Caches", "Yarn");
|
|
14855
14911
|
else return FALLBACK_CACHE_DIR;
|
|
14856
14912
|
}
|
|
14857
14913
|
function getConfigDir() {
|
|
14858
14914
|
if (process.platform === "win32") {
|
|
14859
14915
|
const WIN32_APPDATA_DIR = getLocalAppDataDir();
|
|
14860
|
-
return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path$
|
|
14861
|
-
} else if (process.env.XDG_CONFIG_HOME) return path$
|
|
14916
|
+
return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path$10.join(WIN32_APPDATA_DIR, "Config");
|
|
14917
|
+
} else if (process.env.XDG_CONFIG_HOME) return path$10.join(process.env.XDG_CONFIG_HOME, "yarn");
|
|
14862
14918
|
else return FALLBACK_CONFIG_DIR;
|
|
14863
14919
|
}
|
|
14864
14920
|
function getLocalAppDataDir() {
|
|
14865
|
-
return process.env.LOCALAPPDATA ? path$
|
|
14921
|
+
return process.env.LOCALAPPDATA ? path$10.join(process.env.LOCALAPPDATA, "Yarn") : null;
|
|
14866
14922
|
}
|
|
14867
14923
|
}),
|
|
14868
14924
|
,
|
|
@@ -16230,7 +16286,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16230
16286
|
(function(module$1, exports$1, __webpack_require__) {
|
|
16231
16287
|
var pathModule = __webpack_require__(0);
|
|
16232
16288
|
var isWindows = process.platform === "win32";
|
|
16233
|
-
var fs$
|
|
16289
|
+
var fs$7 = __webpack_require__(3);
|
|
16234
16290
|
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
16235
16291
|
function rethrow() {
|
|
16236
16292
|
var callback;
|
|
@@ -16281,7 +16337,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16281
16337
|
base = m[0];
|
|
16282
16338
|
previous = "";
|
|
16283
16339
|
if (isWindows && !knownHard[base]) {
|
|
16284
|
-
fs$
|
|
16340
|
+
fs$7.lstatSync(base);
|
|
16285
16341
|
knownHard[base] = true;
|
|
16286
16342
|
}
|
|
16287
16343
|
}
|
|
@@ -16296,7 +16352,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16296
16352
|
var resolvedLink;
|
|
16297
16353
|
if (cache$1 && Object.prototype.hasOwnProperty.call(cache$1, base)) resolvedLink = cache$1[base];
|
|
16298
16354
|
else {
|
|
16299
|
-
var stat = fs$
|
|
16355
|
+
var stat = fs$7.lstatSync(base);
|
|
16300
16356
|
if (!stat.isSymbolicLink()) {
|
|
16301
16357
|
knownHard[base] = true;
|
|
16302
16358
|
if (cache$1) cache$1[base] = base;
|
|
@@ -16308,8 +16364,8 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16308
16364
|
if (seenLinks.hasOwnProperty(id)) linkTarget = seenLinks[id];
|
|
16309
16365
|
}
|
|
16310
16366
|
if (linkTarget === null) {
|
|
16311
|
-
fs$
|
|
16312
|
-
linkTarget = fs$
|
|
16367
|
+
fs$7.statSync(base);
|
|
16368
|
+
linkTarget = fs$7.readlinkSync(base);
|
|
16313
16369
|
}
|
|
16314
16370
|
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
16315
16371
|
if (cache$1) cache$1[base] = resolvedLink;
|
|
@@ -16340,7 +16396,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16340
16396
|
current = m[0];
|
|
16341
16397
|
base = m[0];
|
|
16342
16398
|
previous = "";
|
|
16343
|
-
if (isWindows && !knownHard[base]) fs$
|
|
16399
|
+
if (isWindows && !knownHard[base]) fs$7.lstat(base, function(err$1) {
|
|
16344
16400
|
if (err$1) return cb(err$1);
|
|
16345
16401
|
knownHard[base] = true;
|
|
16346
16402
|
LOOP();
|
|
@@ -16360,7 +16416,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16360
16416
|
pos = nextPartRe.lastIndex;
|
|
16361
16417
|
if (knownHard[base] || cache$1 && cache$1[base] === base) return process.nextTick(LOOP);
|
|
16362
16418
|
if (cache$1 && Object.prototype.hasOwnProperty.call(cache$1, base)) return gotResolvedLink(cache$1[base]);
|
|
16363
|
-
return fs$
|
|
16419
|
+
return fs$7.lstat(base, gotStat);
|
|
16364
16420
|
}
|
|
16365
16421
|
function gotStat(err$1, stat) {
|
|
16366
16422
|
if (err$1) return cb(err$1);
|
|
@@ -16373,9 +16429,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16373
16429
|
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
16374
16430
|
if (seenLinks.hasOwnProperty(id)) return gotTarget(null, seenLinks[id], base);
|
|
16375
16431
|
}
|
|
16376
|
-
fs$
|
|
16432
|
+
fs$7.stat(base, function(err$2) {
|
|
16377
16433
|
if (err$2) return cb(err$2);
|
|
16378
|
-
fs$
|
|
16434
|
+
fs$7.readlink(base, function(err$3, target) {
|
|
16379
16435
|
if (!isWindows) seenLinks[id] = target;
|
|
16380
16436
|
gotTarget(err$3, target);
|
|
16381
16437
|
});
|
|
@@ -16396,13 +16452,13 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16396
16452
|
(function(module$1, exports$1, __webpack_require__) {
|
|
16397
16453
|
module$1.exports = globSync;
|
|
16398
16454
|
globSync.GlobSync = GlobSync;
|
|
16399
|
-
var fs$
|
|
16455
|
+
var fs$7 = __webpack_require__(3);
|
|
16400
16456
|
var rp = __webpack_require__(114);
|
|
16401
16457
|
var minimatch = __webpack_require__(60);
|
|
16402
16458
|
minimatch.Minimatch;
|
|
16403
16459
|
__webpack_require__(75).Glob;
|
|
16404
16460
|
__webpack_require__(2);
|
|
16405
|
-
var path$
|
|
16461
|
+
var path$10 = __webpack_require__(0);
|
|
16406
16462
|
var assert$1 = __webpack_require__(22);
|
|
16407
16463
|
var isAbsolute = __webpack_require__(76);
|
|
16408
16464
|
var common$5 = __webpack_require__(115);
|
|
@@ -16498,7 +16554,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16498
16554
|
var e = matchedEntries[i$3];
|
|
16499
16555
|
if (prefix) if (prefix.slice(-1) !== "/") e = prefix + "/" + e;
|
|
16500
16556
|
else e = prefix + e;
|
|
16501
|
-
if (e.charAt(0) === "/" && !this.nomount) e = path$
|
|
16557
|
+
if (e.charAt(0) === "/" && !this.nomount) e = path$10.join(this.root, e);
|
|
16502
16558
|
this._emitMatch(index, e);
|
|
16503
16559
|
}
|
|
16504
16560
|
return;
|
|
@@ -16530,7 +16586,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16530
16586
|
var entries;
|
|
16531
16587
|
var lstat;
|
|
16532
16588
|
try {
|
|
16533
|
-
lstat = fs$
|
|
16589
|
+
lstat = fs$7.lstatSync(abs);
|
|
16534
16590
|
} catch (er) {
|
|
16535
16591
|
if (er.code === "ENOENT") return null;
|
|
16536
16592
|
}
|
|
@@ -16548,7 +16604,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16548
16604
|
if (Array.isArray(c$1)) return c$1;
|
|
16549
16605
|
}
|
|
16550
16606
|
try {
|
|
16551
|
-
return this._readdirEntries(abs, fs$
|
|
16607
|
+
return this._readdirEntries(abs, fs$7.readdirSync(abs));
|
|
16552
16608
|
} catch (er) {
|
|
16553
16609
|
this._readdirError(abs, er);
|
|
16554
16610
|
return null;
|
|
@@ -16613,9 +16669,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16613
16669
|
if (!exists) return;
|
|
16614
16670
|
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
16615
16671
|
var trail = /[\/\\]$/.test(prefix);
|
|
16616
|
-
if (prefix.charAt(0) === "/") prefix = path$
|
|
16672
|
+
if (prefix.charAt(0) === "/") prefix = path$10.join(this.root, prefix);
|
|
16617
16673
|
else {
|
|
16618
|
-
prefix = path$
|
|
16674
|
+
prefix = path$10.resolve(this.root, prefix);
|
|
16619
16675
|
if (trail) prefix += "/";
|
|
16620
16676
|
}
|
|
16621
16677
|
}
|
|
@@ -16636,7 +16692,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16636
16692
|
if (!stat) {
|
|
16637
16693
|
var lstat;
|
|
16638
16694
|
try {
|
|
16639
|
-
lstat = fs$
|
|
16695
|
+
lstat = fs$7.lstatSync(abs);
|
|
16640
16696
|
} catch (er) {
|
|
16641
16697
|
if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
|
16642
16698
|
this.statCache[abs] = false;
|
|
@@ -16644,7 +16700,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16644
16700
|
}
|
|
16645
16701
|
}
|
|
16646
16702
|
if (lstat && lstat.isSymbolicLink()) try {
|
|
16647
|
-
stat = fs$
|
|
16703
|
+
stat = fs$7.statSync(abs);
|
|
16648
16704
|
} catch (er) {
|
|
16649
16705
|
stat = lstat;
|
|
16650
16706
|
}
|
|
@@ -16852,8 +16908,8 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16852
16908
|
module$1.exports = rimraf;
|
|
16853
16909
|
rimraf.sync = rimrafSync;
|
|
16854
16910
|
var assert$1 = __webpack_require__(22);
|
|
16855
|
-
var path$
|
|
16856
|
-
var fs$
|
|
16911
|
+
var path$10 = __webpack_require__(0);
|
|
16912
|
+
var fs$7 = __webpack_require__(3);
|
|
16857
16913
|
var glob = __webpack_require__(75);
|
|
16858
16914
|
var _0666 = parseInt("666", 8);
|
|
16859
16915
|
var defaultGlobOpts = {
|
|
@@ -16871,9 +16927,9 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
16871
16927
|
"rmdir",
|
|
16872
16928
|
"readdir"
|
|
16873
16929
|
].forEach(function(m) {
|
|
16874
|
-
options[m] = options[m] || fs$
|
|
16930
|
+
options[m] = options[m] || fs$7[m];
|
|
16875
16931
|
m = m + "Sync";
|
|
16876
|
-
options[m] = options[m] || fs$
|
|
16932
|
+
options[m] = options[m] || fs$7[m];
|
|
16877
16933
|
});
|
|
16878
16934
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
16879
16935
|
options.emfileWait = options.emfileWait || 1e3;
|
|
@@ -17001,7 +17057,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
17001
17057
|
if (n === 0) return options.rmdir(p$1, cb);
|
|
17002
17058
|
var errState;
|
|
17003
17059
|
files.forEach(function(f) {
|
|
17004
|
-
rimraf(path$
|
|
17060
|
+
rimraf(path$10.join(p$1, f), options, function(er$1) {
|
|
17005
17061
|
if (errState) return;
|
|
17006
17062
|
if (er$1) return cb(errState = er$1);
|
|
17007
17063
|
if (--n === 0) options.rmdir(p$1, cb);
|
|
@@ -17060,7 +17116,7 @@ var require_lockfile$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
|
|
|
17060
17116
|
assert$1(p$1);
|
|
17061
17117
|
assert$1(options);
|
|
17062
17118
|
options.readdirSync(p$1).forEach(function(f) {
|
|
17063
|
-
rimrafSync(path$
|
|
17119
|
+
rimrafSync(path$10.join(p$1, f), options);
|
|
17064
17120
|
});
|
|
17065
17121
|
var retries = isWindows ? 100 : 1;
|
|
17066
17122
|
var i$3 = 0;
|
|
@@ -18060,11 +18116,11 @@ const createBlobDatabasePlugin = ({ name, getContext, listObjects, loadObject, u
|
|
|
18060
18116
|
const updatedTargetFilePaths = /* @__PURE__ */ new Set();
|
|
18061
18117
|
if (isTargetAppVersionChanged) for (const platform of PLATFORMS) {
|
|
18062
18118
|
const updatedPaths = await updateTargetVersionsForPlatform(context, platform);
|
|
18063
|
-
for (const path$
|
|
18119
|
+
for (const path$10 of updatedPaths) updatedTargetFilePaths.add(path$10);
|
|
18064
18120
|
}
|
|
18065
|
-
for (const path$
|
|
18121
|
+
for (const path$10 of updatedTargetFilePaths) pathsToInvalidate.add(path$10);
|
|
18066
18122
|
const encondedPaths = /* @__PURE__ */ new Set();
|
|
18067
|
-
for (const path$
|
|
18123
|
+
for (const path$10 of pathsToInvalidate) encondedPaths.add(encodeURI(path$10));
|
|
18068
18124
|
await invalidatePaths(context, Array.from(encondedPaths));
|
|
18069
18125
|
pendingBundlesMap.clear();
|
|
18070
18126
|
hooks?.onDatabaseUpdated?.();
|
|
@@ -18078,6 +18134,156 @@ const createStorageKeyBuilder = (basePath) => (...args) => {
|
|
|
18078
18134
|
return [basePath || "", ...args].filter(Boolean).join("/");
|
|
18079
18135
|
};
|
|
18080
18136
|
|
|
18137
|
+
//#endregion
|
|
18138
|
+
//#region src/createTarBr.ts
|
|
18139
|
+
const createTarBrTargetFiles = async ({ outfile, targetFiles }) => {
|
|
18140
|
+
await fs_promises.default.rm(outfile, { force: true });
|
|
18141
|
+
const tmpDir = path.default.join(path.default.dirname(outfile), `.tmp-tar-${Date.now()}`);
|
|
18142
|
+
await fs_promises.default.mkdir(tmpDir, { recursive: true });
|
|
18143
|
+
try {
|
|
18144
|
+
for (const target of targetFiles) {
|
|
18145
|
+
const sourcePath = target.path;
|
|
18146
|
+
const destPath = path.default.join(tmpDir, target.name);
|
|
18147
|
+
await fs_promises.default.mkdir(path.default.dirname(destPath), { recursive: true });
|
|
18148
|
+
if ((await fs_promises.default.stat(sourcePath)).isDirectory()) await copyDir$1(sourcePath, destPath);
|
|
18149
|
+
else await fs_promises.default.copyFile(sourcePath, destPath);
|
|
18150
|
+
}
|
|
18151
|
+
const tmpTarFile = outfile.replace(/\.tar\.br$/, ".tar");
|
|
18152
|
+
await tar.create({
|
|
18153
|
+
file: tmpTarFile,
|
|
18154
|
+
cwd: tmpDir,
|
|
18155
|
+
portable: true,
|
|
18156
|
+
mtime: /* @__PURE__ */ new Date(0),
|
|
18157
|
+
gzip: false
|
|
18158
|
+
}, await fs_promises.default.readdir(tmpDir));
|
|
18159
|
+
const compressedData = (0, zlib.brotliCompressSync)(await fs_promises.default.readFile(tmpTarFile), { params: {
|
|
18160
|
+
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
|
|
18161
|
+
[zlib.constants.BROTLI_PARAM_LGWIN]: 24
|
|
18162
|
+
} });
|
|
18163
|
+
await fs_promises.default.mkdir(path.default.dirname(outfile), { recursive: true });
|
|
18164
|
+
await fs_promises.default.writeFile(outfile, compressedData);
|
|
18165
|
+
await fs_promises.default.rm(tmpTarFile, { force: true });
|
|
18166
|
+
return outfile;
|
|
18167
|
+
} finally {
|
|
18168
|
+
await fs_promises.default.rm(tmpDir, {
|
|
18169
|
+
recursive: true,
|
|
18170
|
+
force: true
|
|
18171
|
+
});
|
|
18172
|
+
}
|
|
18173
|
+
};
|
|
18174
|
+
async function copyDir$1(src, dest) {
|
|
18175
|
+
await fs_promises.default.mkdir(dest, { recursive: true });
|
|
18176
|
+
const entries = await fs_promises.default.readdir(src, { withFileTypes: true });
|
|
18177
|
+
for (const entry of entries) {
|
|
18178
|
+
const srcPath = path.default.join(src, entry.name);
|
|
18179
|
+
const destPath = path.default.join(dest, entry.name);
|
|
18180
|
+
if (entry.isDirectory()) await copyDir$1(srcPath, destPath);
|
|
18181
|
+
else await fs_promises.default.copyFile(srcPath, destPath);
|
|
18182
|
+
}
|
|
18183
|
+
}
|
|
18184
|
+
const createTarBr = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
18185
|
+
await fs_promises.default.rm(outfile, { force: true });
|
|
18186
|
+
const tmpTarFile = outfile.replace(/\.tar\.br$/, ".tar");
|
|
18187
|
+
async function getFiles(dir, baseDir = "") {
|
|
18188
|
+
const entries = await fs_promises.default.readdir(dir, { withFileTypes: true });
|
|
18189
|
+
const files = [];
|
|
18190
|
+
for (const entry of entries) {
|
|
18191
|
+
if (excludeExts.some((pattern) => entry.name.includes(pattern))) continue;
|
|
18192
|
+
const fullPath = path.default.join(dir, entry.name);
|
|
18193
|
+
const relativePath = path.default.join(baseDir, entry.name);
|
|
18194
|
+
if (entry.isDirectory()) {
|
|
18195
|
+
const subFiles = await getFiles(fullPath, relativePath);
|
|
18196
|
+
files.push(...subFiles);
|
|
18197
|
+
} else files.push(relativePath);
|
|
18198
|
+
}
|
|
18199
|
+
return files;
|
|
18200
|
+
}
|
|
18201
|
+
const filesToInclude = await getFiles(targetDir);
|
|
18202
|
+
filesToInclude.sort();
|
|
18203
|
+
await tar.create({
|
|
18204
|
+
file: tmpTarFile,
|
|
18205
|
+
cwd: targetDir,
|
|
18206
|
+
portable: true,
|
|
18207
|
+
mtime: /* @__PURE__ */ new Date(0),
|
|
18208
|
+
gzip: false
|
|
18209
|
+
}, filesToInclude);
|
|
18210
|
+
const compressedData = (0, zlib.brotliCompressSync)(await fs_promises.default.readFile(tmpTarFile), { params: {
|
|
18211
|
+
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
|
|
18212
|
+
[zlib.constants.BROTLI_PARAM_LGWIN]: 24
|
|
18213
|
+
} });
|
|
18214
|
+
await fs_promises.default.writeFile(outfile, compressedData);
|
|
18215
|
+
await fs_promises.default.rm(tmpTarFile, { force: true });
|
|
18216
|
+
return outfile;
|
|
18217
|
+
};
|
|
18218
|
+
|
|
18219
|
+
//#endregion
|
|
18220
|
+
//#region src/createTarGz.ts
|
|
18221
|
+
const createTarGzTargetFiles = async ({ outfile, targetFiles }) => {
|
|
18222
|
+
await fs_promises.default.rm(outfile, { force: true });
|
|
18223
|
+
const tmpDir = path.default.join(path.default.dirname(outfile), `.tmp-tar-${Date.now()}`);
|
|
18224
|
+
await fs_promises.default.mkdir(tmpDir, { recursive: true });
|
|
18225
|
+
try {
|
|
18226
|
+
for (const target of targetFiles) {
|
|
18227
|
+
const sourcePath = target.path;
|
|
18228
|
+
const destPath = path.default.join(tmpDir, target.name);
|
|
18229
|
+
await fs_promises.default.mkdir(path.default.dirname(destPath), { recursive: true });
|
|
18230
|
+
if ((await fs_promises.default.stat(sourcePath)).isDirectory()) await copyDir(sourcePath, destPath);
|
|
18231
|
+
else await fs_promises.default.copyFile(sourcePath, destPath);
|
|
18232
|
+
}
|
|
18233
|
+
await fs_promises.default.mkdir(path.default.dirname(outfile), { recursive: true });
|
|
18234
|
+
await tar.create({
|
|
18235
|
+
file: outfile,
|
|
18236
|
+
cwd: tmpDir,
|
|
18237
|
+
portable: true,
|
|
18238
|
+
mtime: /* @__PURE__ */ new Date(0),
|
|
18239
|
+
gzip: true
|
|
18240
|
+
}, await fs_promises.default.readdir(tmpDir));
|
|
18241
|
+
return outfile;
|
|
18242
|
+
} finally {
|
|
18243
|
+
await fs_promises.default.rm(tmpDir, {
|
|
18244
|
+
recursive: true,
|
|
18245
|
+
force: true
|
|
18246
|
+
});
|
|
18247
|
+
}
|
|
18248
|
+
};
|
|
18249
|
+
async function copyDir(src, dest) {
|
|
18250
|
+
await fs_promises.default.mkdir(dest, { recursive: true });
|
|
18251
|
+
const entries = await fs_promises.default.readdir(src, { withFileTypes: true });
|
|
18252
|
+
for (const entry of entries) {
|
|
18253
|
+
const srcPath = path.default.join(src, entry.name);
|
|
18254
|
+
const destPath = path.default.join(dest, entry.name);
|
|
18255
|
+
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
18256
|
+
else await fs_promises.default.copyFile(srcPath, destPath);
|
|
18257
|
+
}
|
|
18258
|
+
}
|
|
18259
|
+
const createTarGz = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
18260
|
+
await fs_promises.default.rm(outfile, { force: true });
|
|
18261
|
+
async function getFiles(dir, baseDir = "") {
|
|
18262
|
+
const entries = await fs_promises.default.readdir(dir, { withFileTypes: true });
|
|
18263
|
+
const files = [];
|
|
18264
|
+
for (const entry of entries) {
|
|
18265
|
+
if (excludeExts.some((pattern) => entry.name.includes(pattern))) continue;
|
|
18266
|
+
const fullPath = path.default.join(dir, entry.name);
|
|
18267
|
+
const relativePath = path.default.join(baseDir, entry.name);
|
|
18268
|
+
if (entry.isDirectory()) {
|
|
18269
|
+
const subFiles = await getFiles(fullPath, relativePath);
|
|
18270
|
+
files.push(...subFiles);
|
|
18271
|
+
} else files.push(relativePath);
|
|
18272
|
+
}
|
|
18273
|
+
return files;
|
|
18274
|
+
}
|
|
18275
|
+
const filesToInclude = await getFiles(targetDir);
|
|
18276
|
+
filesToInclude.sort();
|
|
18277
|
+
await tar.create({
|
|
18278
|
+
file: outfile,
|
|
18279
|
+
cwd: targetDir,
|
|
18280
|
+
portable: true,
|
|
18281
|
+
mtime: /* @__PURE__ */ new Date(0),
|
|
18282
|
+
gzip: true
|
|
18283
|
+
}, filesToInclude);
|
|
18284
|
+
return outfile;
|
|
18285
|
+
};
|
|
18286
|
+
|
|
18081
18287
|
//#endregion
|
|
18082
18288
|
//#region ../../node_modules/.pnpm/process-nextick-args@2.0.1/node_modules/process-nextick-args/index.js
|
|
18083
18289
|
var require_process_nextick_args = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/process-nextick-args@2.0.1/node_modules/process-nextick-args/index.js": ((exports, module) => {
|
|
@@ -20620,8 +20826,8 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jszip
|
|
|
20620
20826
|
* @param {string} path A path with / or \ separators
|
|
20621
20827
|
* @returns {string} The path with all relative path components resolved.
|
|
20622
20828
|
*/
|
|
20623
|
-
exports.resolve = function(path$
|
|
20624
|
-
var parts = path$
|
|
20829
|
+
exports.resolve = function(path$10) {
|
|
20830
|
+
var parts = path$10.split("/");
|
|
20625
20831
|
var result = [];
|
|
20626
20832
|
for (var index = 0; index < parts.length; index++) {
|
|
20627
20833
|
var part = parts[index];
|
|
@@ -26105,10 +26311,10 @@ var require_object = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jszi
|
|
|
26105
26311
|
* @param {string} path the path to use
|
|
26106
26312
|
* @return {string} the parent folder, or ""
|
|
26107
26313
|
*/
|
|
26108
|
-
var parentFolder = function(path$
|
|
26109
|
-
if (path$
|
|
26110
|
-
var lastSlash = path$
|
|
26111
|
-
return lastSlash > 0 ? path$
|
|
26314
|
+
var parentFolder = function(path$10) {
|
|
26315
|
+
if (path$10.slice(-1) === "/") path$10 = path$10.substring(0, path$10.length - 1);
|
|
26316
|
+
var lastSlash = path$10.lastIndexOf("/");
|
|
26317
|
+
return lastSlash > 0 ? path$10.substring(0, lastSlash) : "";
|
|
26112
26318
|
};
|
|
26113
26319
|
/**
|
|
26114
26320
|
* Returns the path with a slash at the end.
|
|
@@ -26116,9 +26322,9 @@ var require_object = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jszi
|
|
|
26116
26322
|
* @param {String} path the path to check.
|
|
26117
26323
|
* @return {String} the path with a trailing slash.
|
|
26118
26324
|
*/
|
|
26119
|
-
var forceTrailingSlash = function(path$
|
|
26120
|
-
if (path$
|
|
26121
|
-
return path$
|
|
26325
|
+
var forceTrailingSlash = function(path$10) {
|
|
26326
|
+
if (path$10.slice(-1) !== "/") path$10 += "/";
|
|
26327
|
+
return path$10;
|
|
26122
26328
|
};
|
|
26123
26329
|
/**
|
|
26124
26330
|
* Add a (sub) folder in the current folder.
|
|
@@ -26911,6 +27117,28 @@ const createZip = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
|
26911
27117
|
return outfile;
|
|
26912
27118
|
};
|
|
26913
27119
|
|
|
27120
|
+
//#endregion
|
|
27121
|
+
//#region src/semverSatisfies.ts
|
|
27122
|
+
const semverSatisfies = (targetAppVersion, currentVersion) => {
|
|
27123
|
+
const currentCoerce = semver.default.coerce(currentVersion);
|
|
27124
|
+
if (!currentCoerce) return false;
|
|
27125
|
+
return semver.default.satisfies(currentCoerce.version, targetAppVersion);
|
|
27126
|
+
};
|
|
27127
|
+
|
|
27128
|
+
//#endregion
|
|
27129
|
+
//#region src/filterCompatibleAppVersions.ts
|
|
27130
|
+
/**
|
|
27131
|
+
* Filters target app versions that are compatible with the current app version.
|
|
27132
|
+
* Returns only versions that are compatible with the current version according to semver rules.
|
|
27133
|
+
*
|
|
27134
|
+
* @param targetAppVersionList - List of target app versions to filter
|
|
27135
|
+
* @param currentVersion - Current app version
|
|
27136
|
+
* @returns Array of target app versions compatible with the current version
|
|
27137
|
+
*/
|
|
27138
|
+
const filterCompatibleAppVersions = (targetAppVersionList, currentVersion) => {
|
|
27139
|
+
return targetAppVersionList.filter((version) => semverSatisfies(version, currentVersion)).sort((a, b) => b.localeCompare(a));
|
|
27140
|
+
};
|
|
27141
|
+
|
|
26914
27142
|
//#endregion
|
|
26915
27143
|
//#region src/generateMinBundleId.ts
|
|
26916
27144
|
const generateMinBundleId = () => {
|
|
@@ -26957,6 +27185,7 @@ const getDefaultConfig = () => {
|
|
|
26957
27185
|
return {
|
|
26958
27186
|
releaseChannel: "production",
|
|
26959
27187
|
updateStrategy: "appVersion",
|
|
27188
|
+
compressStrategy: "zip",
|
|
26960
27189
|
fingerprint: { extraSources: [] },
|
|
26961
27190
|
console: { port: 1422 },
|
|
26962
27191
|
platform: getDefaultPlatformConfig(),
|
|
@@ -27068,6 +27297,39 @@ const makeEnv = async (newEnvVars, filePath = ".env.hotupdater") => {
|
|
|
27068
27297
|
}
|
|
27069
27298
|
};
|
|
27070
27299
|
|
|
27300
|
+
//#endregion
|
|
27301
|
+
//#region src/parseStorageUri.ts
|
|
27302
|
+
/**
|
|
27303
|
+
* Parses a storage URI and validates the protocol.
|
|
27304
|
+
*
|
|
27305
|
+
* @param storageUri - The storage URI to parse (e.g., "s3://bucket/path/to/file")
|
|
27306
|
+
* @param expectedProtocol - The expected protocol without colon (e.g., "s3", "r2", "gs")
|
|
27307
|
+
* @returns Parsed storage URI components
|
|
27308
|
+
* @throws Error if the URI is invalid or protocol doesn't match
|
|
27309
|
+
*
|
|
27310
|
+
* @example
|
|
27311
|
+
* ```typescript
|
|
27312
|
+
* const { bucket, key } = parseStorageUri("s3://my-bucket/path/to/file.zip", "s3");
|
|
27313
|
+
* // bucket: "my-bucket"
|
|
27314
|
+
* // key: "path/to/file.zip"
|
|
27315
|
+
* ```
|
|
27316
|
+
*/
|
|
27317
|
+
function parseStorageUri(storageUri, expectedProtocol) {
|
|
27318
|
+
try {
|
|
27319
|
+
const url = new URL(storageUri);
|
|
27320
|
+
const protocol = url.protocol.replace(":", "");
|
|
27321
|
+
if (protocol !== expectedProtocol) throw new Error(`Invalid storage URI protocol. Expected ${expectedProtocol}, got ${protocol}`);
|
|
27322
|
+
return {
|
|
27323
|
+
protocol,
|
|
27324
|
+
bucket: url.hostname,
|
|
27325
|
+
key: url.pathname.slice(1)
|
|
27326
|
+
};
|
|
27327
|
+
} catch (error) {
|
|
27328
|
+
if (error instanceof TypeError) throw new Error(`Invalid storage URI format: ${storageUri}`);
|
|
27329
|
+
throw error;
|
|
27330
|
+
}
|
|
27331
|
+
}
|
|
27332
|
+
|
|
27071
27333
|
//#endregion
|
|
27072
27334
|
//#region src/transformEnv.ts
|
|
27073
27335
|
const transformEnv = (filename, env$2) => {
|
|
@@ -27103,15 +27365,25 @@ exports.copyDirToTmp = copyDirToTmp;
|
|
|
27103
27365
|
exports.createBlobDatabasePlugin = createBlobDatabasePlugin;
|
|
27104
27366
|
exports.createDatabasePlugin = createDatabasePlugin;
|
|
27105
27367
|
exports.createStorageKeyBuilder = createStorageKeyBuilder;
|
|
27368
|
+
exports.createTarBr = createTarBr;
|
|
27369
|
+
exports.createTarBrTargetFiles = createTarBrTargetFiles;
|
|
27370
|
+
exports.createTarGz = createTarGz;
|
|
27371
|
+
exports.createTarGzTargetFiles = createTarGzTargetFiles;
|
|
27106
27372
|
exports.createZip = createZip;
|
|
27107
27373
|
exports.createZipTargetFiles = createZipTargetFiles;
|
|
27374
|
+
exports.detectCompressionFormat = detectCompressionFormat;
|
|
27375
|
+
exports.filterCompatibleAppVersions = filterCompatibleAppVersions;
|
|
27108
27376
|
exports.generateMinBundleId = generateMinBundleId;
|
|
27377
|
+
exports.getCompressionMimeType = getCompressionMimeType;
|
|
27378
|
+
exports.getContentType = getContentType;
|
|
27109
27379
|
exports.getCwd = getCwd;
|
|
27110
27380
|
exports.link = link;
|
|
27111
27381
|
exports.loadConfig = loadConfig;
|
|
27112
27382
|
exports.loadConfigSync = loadConfigSync;
|
|
27113
27383
|
exports.log = log;
|
|
27114
27384
|
exports.makeEnv = makeEnv;
|
|
27385
|
+
exports.parseStorageUri = parseStorageUri;
|
|
27115
27386
|
exports.printBanner = printBanner;
|
|
27387
|
+
exports.semverSatisfies = semverSatisfies;
|
|
27116
27388
|
exports.transformEnv = transformEnv;
|
|
27117
27389
|
exports.transformTemplate = transformTemplate;
|