semantic-release-lerna 2.14.1 → 2.15.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/index.js +721 -2293
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var require_windows = __commonJS({
|
|
|
44
44
|
module.exports = isexe;
|
|
45
45
|
isexe.sync = sync;
|
|
46
46
|
var fs11 = __require("fs");
|
|
47
|
-
function checkPathExt(
|
|
47
|
+
function checkPathExt(path26, options) {
|
|
48
48
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
49
49
|
if (!pathext) {
|
|
50
50
|
return true;
|
|
@@ -55,25 +55,25 @@ var require_windows = __commonJS({
|
|
|
55
55
|
}
|
|
56
56
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
57
57
|
var p = pathext[i2].toLowerCase();
|
|
58
|
-
if (p &&
|
|
58
|
+
if (p && path26.substr(-p.length).toLowerCase() === p) {
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
|
-
function checkStat(stat,
|
|
64
|
+
function checkStat(stat, path26, options) {
|
|
65
65
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
|
-
return checkPathExt(
|
|
68
|
+
return checkPathExt(path26, options);
|
|
69
69
|
}
|
|
70
|
-
function isexe(
|
|
71
|
-
fs11.stat(
|
|
72
|
-
cb(er, er ? false : checkStat(stat,
|
|
70
|
+
function isexe(path26, options, cb) {
|
|
71
|
+
fs11.stat(path26, function(er, stat) {
|
|
72
|
+
cb(er, er ? false : checkStat(stat, path26, options));
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
function sync(
|
|
76
|
-
return checkStat(fs11.statSync(
|
|
75
|
+
function sync(path26, options) {
|
|
76
|
+
return checkStat(fs11.statSync(path26), path26, options);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
});
|
|
@@ -84,13 +84,13 @@ var require_mode = __commonJS({
|
|
|
84
84
|
module.exports = isexe;
|
|
85
85
|
isexe.sync = sync;
|
|
86
86
|
var fs11 = __require("fs");
|
|
87
|
-
function isexe(
|
|
88
|
-
fs11.stat(
|
|
87
|
+
function isexe(path26, options, cb) {
|
|
88
|
+
fs11.stat(path26, function(er, stat) {
|
|
89
89
|
cb(er, er ? false : checkStat(stat, options));
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function sync(
|
|
93
|
-
return checkStat(fs11.statSync(
|
|
92
|
+
function sync(path26, options) {
|
|
93
|
+
return checkStat(fs11.statSync(path26), options);
|
|
94
94
|
}
|
|
95
95
|
function checkStat(stat, options) {
|
|
96
96
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -123,7 +123,7 @@ var require_isexe = __commonJS({
|
|
|
123
123
|
}
|
|
124
124
|
module.exports = isexe;
|
|
125
125
|
isexe.sync = sync;
|
|
126
|
-
function isexe(
|
|
126
|
+
function isexe(path26, options, cb) {
|
|
127
127
|
if (typeof options === "function") {
|
|
128
128
|
cb = options;
|
|
129
129
|
options = {};
|
|
@@ -133,7 +133,7 @@ var require_isexe = __commonJS({
|
|
|
133
133
|
throw new TypeError("callback not provided");
|
|
134
134
|
}
|
|
135
135
|
return new Promise(function(resolve2, reject) {
|
|
136
|
-
isexe(
|
|
136
|
+
isexe(path26, options || {}, function(er, is) {
|
|
137
137
|
if (er) {
|
|
138
138
|
reject(er);
|
|
139
139
|
} else {
|
|
@@ -142,7 +142,7 @@ var require_isexe = __commonJS({
|
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
|
-
core2(
|
|
145
|
+
core2(path26, options || {}, function(er, is) {
|
|
146
146
|
if (er) {
|
|
147
147
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
148
148
|
er = null;
|
|
@@ -152,9 +152,9 @@ var require_isexe = __commonJS({
|
|
|
152
152
|
cb(er, is);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function sync(
|
|
155
|
+
function sync(path26, options) {
|
|
156
156
|
try {
|
|
157
|
-
return core2.sync(
|
|
157
|
+
return core2.sync(path26, options || {});
|
|
158
158
|
} catch (er) {
|
|
159
159
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
160
160
|
return false;
|
|
@@ -170,7 +170,7 @@ var require_isexe = __commonJS({
|
|
|
170
170
|
var require_which = __commonJS({
|
|
171
171
|
"node_modules/which/which.js"(exports, module) {
|
|
172
172
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
173
|
-
var
|
|
173
|
+
var path26 = __require("path");
|
|
174
174
|
var COLON = isWindows ? ";" : ":";
|
|
175
175
|
var isexe = require_isexe();
|
|
176
176
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -208,7 +208,7 @@ var require_which = __commonJS({
|
|
|
208
208
|
return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
|
|
209
209
|
const ppRaw = pathEnv[i2];
|
|
210
210
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
211
|
-
const pCmd =
|
|
211
|
+
const pCmd = path26.join(pathPart, cmd);
|
|
212
212
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
213
213
|
resolve2(subStep(p, i2, 0));
|
|
214
214
|
});
|
|
@@ -235,7 +235,7 @@ var require_which = __commonJS({
|
|
|
235
235
|
for (let i2 = 0; i2 < pathEnv.length; i2++) {
|
|
236
236
|
const ppRaw = pathEnv[i2];
|
|
237
237
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
238
|
-
const pCmd =
|
|
238
|
+
const pCmd = path26.join(pathPart, cmd);
|
|
239
239
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
240
240
|
for (let j = 0; j < pathExt.length; j++) {
|
|
241
241
|
const cur = p + pathExt[j];
|
|
@@ -283,7 +283,7 @@ var require_path_key = __commonJS({
|
|
|
283
283
|
var require_resolveCommand = __commonJS({
|
|
284
284
|
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
285
285
|
"use strict";
|
|
286
|
-
var
|
|
286
|
+
var path26 = __require("path");
|
|
287
287
|
var which = require_which();
|
|
288
288
|
var getPathKey = require_path_key();
|
|
289
289
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -301,7 +301,7 @@ var require_resolveCommand = __commonJS({
|
|
|
301
301
|
try {
|
|
302
302
|
resolved = which.sync(parsed.command, {
|
|
303
303
|
path: env[getPathKey({ env })],
|
|
304
|
-
pathExt: withoutPathExt ?
|
|
304
|
+
pathExt: withoutPathExt ? path26.delimiter : void 0
|
|
305
305
|
});
|
|
306
306
|
} catch (e) {
|
|
307
307
|
} finally {
|
|
@@ -310,7 +310,7 @@ var require_resolveCommand = __commonJS({
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
if (resolved) {
|
|
313
|
-
resolved =
|
|
313
|
+
resolved = path26.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
314
314
|
}
|
|
315
315
|
return resolved;
|
|
316
316
|
}
|
|
@@ -364,8 +364,8 @@ var require_shebang_command = __commonJS({
|
|
|
364
364
|
if (!match2) {
|
|
365
365
|
return null;
|
|
366
366
|
}
|
|
367
|
-
const [
|
|
368
|
-
const binary2 =
|
|
367
|
+
const [path26, argument] = match2[0].replace(/#! ?/, "").split(" ");
|
|
368
|
+
const binary2 = path26.split("/").pop();
|
|
369
369
|
if (binary2 === "env") {
|
|
370
370
|
return argument;
|
|
371
371
|
}
|
|
@@ -400,7 +400,7 @@ var require_readShebang = __commonJS({
|
|
|
400
400
|
var require_parse = __commonJS({
|
|
401
401
|
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
402
402
|
"use strict";
|
|
403
|
-
var
|
|
403
|
+
var path26 = __require("path");
|
|
404
404
|
var resolveCommand = require_resolveCommand();
|
|
405
405
|
var escape2 = require_escape();
|
|
406
406
|
var readShebang = require_readShebang();
|
|
@@ -425,7 +425,7 @@ var require_parse = __commonJS({
|
|
|
425
425
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
426
426
|
if (parsed.options.forceShell || needsShell) {
|
|
427
427
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
428
|
-
parsed.command =
|
|
428
|
+
parsed.command = path26.normalize(parsed.command);
|
|
429
429
|
parsed.command = escape2.command(parsed.command);
|
|
430
430
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
431
431
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -2465,9 +2465,9 @@ var require_semver2 = __commonJS({
|
|
|
2465
2465
|
}
|
|
2466
2466
|
});
|
|
2467
2467
|
|
|
2468
|
-
// node_modules/
|
|
2468
|
+
// node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/index.js
|
|
2469
2469
|
var require_commonjs = __commonJS({
|
|
2470
|
-
"node_modules/
|
|
2470
|
+
"node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
|
|
2471
2471
|
"use strict";
|
|
2472
2472
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2473
2473
|
exports.LRUCache = void 0;
|
|
@@ -3874,9 +3874,9 @@ var require_commonjs = __commonJS({
|
|
|
3874
3874
|
}
|
|
3875
3875
|
});
|
|
3876
3876
|
|
|
3877
|
-
// node_modules/
|
|
3877
|
+
// node_modules/hosted-git-info/lib/hosts.js
|
|
3878
3878
|
var require_hosts = __commonJS({
|
|
3879
|
-
"node_modules/
|
|
3879
|
+
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3880
3880
|
"use strict";
|
|
3881
3881
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
3882
3882
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
@@ -3884,13 +3884,13 @@ var require_hosts = __commonJS({
|
|
|
3884
3884
|
var defaults2 = {
|
|
3885
3885
|
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
3886
3886
|
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
3887
|
-
edittemplate: ({ domain, user, project, committish, editpath, path:
|
|
3887
|
+
edittemplate: ({ domain, user, project, committish, editpath, path: path26 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path26)}`,
|
|
3888
3888
|
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
3889
|
-
browsetreetemplate: ({ domain, user, project, committish, treepath, path:
|
|
3890
|
-
browseblobtemplate: ({ domain, user, project, committish, blobpath, path:
|
|
3889
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
3890
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
3891
3891
|
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
3892
3892
|
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
3893
|
-
filetemplate: ({ domain, user, project, committish, path:
|
|
3893
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
3894
3894
|
shortcuttemplate: ({ type: type2, user, project, committish }) => `${type2}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
3895
3895
|
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
3896
3896
|
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
@@ -3905,7 +3905,7 @@ var require_hosts = __commonJS({
|
|
|
3905
3905
|
treepath: "tree",
|
|
3906
3906
|
blobpath: "blob",
|
|
3907
3907
|
editpath: "edit",
|
|
3908
|
-
filetemplate: ({ auth, user, project, committish, path:
|
|
3908
|
+
filetemplate: ({ auth, user, project, committish, path: path26 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
3909
3909
|
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
3910
3910
|
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
3911
3911
|
extract: (url) => {
|
|
@@ -3931,7 +3931,7 @@ var require_hosts = __commonJS({
|
|
|
3931
3931
|
treepath: "src",
|
|
3932
3932
|
blobpath: "src",
|
|
3933
3933
|
editpath: "?mode=edit",
|
|
3934
|
-
edittemplate: ({ domain, user, project, committish, treepath, path:
|
|
3934
|
+
edittemplate: ({ domain, user, project, committish, treepath, path: path26, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path26, editpath)}`,
|
|
3935
3935
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
3936
3936
|
extract: (url) => {
|
|
3937
3937
|
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
@@ -3955,11 +3955,11 @@ var require_hosts = __commonJS({
|
|
|
3955
3955
|
editpath: "-/edit",
|
|
3956
3956
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
|
|
3957
3957
|
extract: (url) => {
|
|
3958
|
-
const
|
|
3959
|
-
if (
|
|
3958
|
+
const path26 = url.pathname.slice(1);
|
|
3959
|
+
if (path26.includes("/-/") || path26.includes("/archive.tar.gz")) {
|
|
3960
3960
|
return;
|
|
3961
3961
|
}
|
|
3962
|
-
const segments =
|
|
3962
|
+
const segments = path26.split("/");
|
|
3963
3963
|
let project = segments.pop();
|
|
3964
3964
|
if (project.endsWith(".git")) {
|
|
3965
3965
|
project = project.slice(0, -4);
|
|
@@ -3979,11 +3979,11 @@ var require_hosts = __commonJS({
|
|
|
3979
3979
|
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
3980
3980
|
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
3981
3981
|
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
3982
|
-
browsetreetemplate: ({ domain, project, committish, path:
|
|
3983
|
-
browseblobtemplate: ({ domain, project, committish, path:
|
|
3982
|
+
browsetreetemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
3983
|
+
browseblobtemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
3984
3984
|
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
3985
3985
|
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
3986
|
-
filetemplate: ({ user, project, committish, path:
|
|
3986
|
+
filetemplate: ({ user, project, committish, path: path26 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path26}`,
|
|
3987
3987
|
shortcuttemplate: ({ type: type2, project, committish }) => `${type2}:${project}${maybeJoin("#", committish)}`,
|
|
3988
3988
|
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
3989
3989
|
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
@@ -4015,7 +4015,7 @@ var require_hosts = __commonJS({
|
|
|
4015
4015
|
domain: "git.sr.ht",
|
|
4016
4016
|
treepath: "tree",
|
|
4017
4017
|
blobpath: "tree",
|
|
4018
|
-
filetemplate: ({ domain, user, project, committish, path:
|
|
4018
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path26}`,
|
|
4019
4019
|
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
4020
4020
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
4021
4021
|
bugstemplate: () => null,
|
|
@@ -4040,9 +4040,9 @@ var require_hosts = __commonJS({
|
|
|
4040
4040
|
}
|
|
4041
4041
|
});
|
|
4042
4042
|
|
|
4043
|
-
// node_modules/
|
|
4043
|
+
// node_modules/hosted-git-info/lib/parse-url.js
|
|
4044
4044
|
var require_parse_url = __commonJS({
|
|
4045
|
-
"node_modules/
|
|
4045
|
+
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
4046
4046
|
var url = __require("url");
|
|
4047
4047
|
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
4048
4048
|
const startPosition = str2.indexOf(beforeChar);
|
|
@@ -4091,9 +4091,9 @@ var require_parse_url = __commonJS({
|
|
|
4091
4091
|
}
|
|
4092
4092
|
});
|
|
4093
4093
|
|
|
4094
|
-
// node_modules/
|
|
4094
|
+
// node_modules/hosted-git-info/lib/from-url.js
|
|
4095
4095
|
var require_from_url = __commonJS({
|
|
4096
|
-
"node_modules/
|
|
4096
|
+
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
4097
4097
|
"use strict";
|
|
4098
4098
|
var parseUrl = require_parse_url();
|
|
4099
4099
|
var isGitHubShorthand = (arg) => {
|
|
@@ -4185,9 +4185,9 @@ var require_from_url = __commonJS({
|
|
|
4185
4185
|
}
|
|
4186
4186
|
});
|
|
4187
4187
|
|
|
4188
|
-
// node_modules/
|
|
4188
|
+
// node_modules/hosted-git-info/lib/index.js
|
|
4189
4189
|
var require_lib = __commonJS({
|
|
4190
|
-
"node_modules/
|
|
4190
|
+
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
4191
4191
|
"use strict";
|
|
4192
4192
|
var { LRUCache } = require_commonjs();
|
|
4193
4193
|
var hosts = require_hosts();
|
|
@@ -4205,8 +4205,8 @@ var require_lib = __commonJS({
|
|
|
4205
4205
|
return null;
|
|
4206
4206
|
}
|
|
4207
4207
|
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
4208
|
-
const
|
|
4209
|
-
return `${proto}//${hostname}${
|
|
4208
|
+
const path26 = pathname.replace(/\.git$/, "");
|
|
4209
|
+
return `${proto}//${hostname}${path26}`;
|
|
4210
4210
|
} catch {
|
|
4211
4211
|
return null;
|
|
4212
4212
|
}
|
|
@@ -4298,25 +4298,25 @@ var require_lib = __commonJS({
|
|
|
4298
4298
|
sshurl(opts) {
|
|
4299
4299
|
return this.#fill(this.sshurltemplate, opts);
|
|
4300
4300
|
}
|
|
4301
|
-
browse(
|
|
4302
|
-
if (typeof
|
|
4303
|
-
return this.#fill(this.browsetemplate,
|
|
4301
|
+
browse(path26, ...args) {
|
|
4302
|
+
if (typeof path26 !== "string") {
|
|
4303
|
+
return this.#fill(this.browsetemplate, path26);
|
|
4304
4304
|
}
|
|
4305
4305
|
if (typeof args[0] !== "string") {
|
|
4306
|
-
return this.#fill(this.browsetreetemplate, { ...args[0], path:
|
|
4306
|
+
return this.#fill(this.browsetreetemplate, { ...args[0], path: path26 });
|
|
4307
4307
|
}
|
|
4308
|
-
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path:
|
|
4308
|
+
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
4309
4309
|
}
|
|
4310
4310
|
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
4311
4311
|
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
4312
4312
|
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
4313
4313
|
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
4314
4314
|
// does not redirect to a different commit.
|
|
4315
|
-
browseFile(
|
|
4315
|
+
browseFile(path26, ...args) {
|
|
4316
4316
|
if (typeof args[0] !== "string") {
|
|
4317
|
-
return this.#fill(this.browseblobtemplate, { ...args[0], path:
|
|
4317
|
+
return this.#fill(this.browseblobtemplate, { ...args[0], path: path26 });
|
|
4318
4318
|
}
|
|
4319
|
-
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path:
|
|
4319
|
+
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
4320
4320
|
}
|
|
4321
4321
|
docs(opts) {
|
|
4322
4322
|
return this.#fill(this.docstemplate, opts);
|
|
@@ -4339,11 +4339,11 @@ var require_lib = __commonJS({
|
|
|
4339
4339
|
tarball(opts) {
|
|
4340
4340
|
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
4341
4341
|
}
|
|
4342
|
-
file(
|
|
4343
|
-
return this.#fill(this.filetemplate, { ...opts, path:
|
|
4342
|
+
file(path26, opts) {
|
|
4343
|
+
return this.#fill(this.filetemplate, { ...opts, path: path26 });
|
|
4344
4344
|
}
|
|
4345
|
-
edit(
|
|
4346
|
-
return this.#fill(this.edittemplate, { ...opts, path:
|
|
4345
|
+
edit(path26, opts) {
|
|
4346
|
+
return this.#fill(this.edittemplate, { ...opts, path: path26 });
|
|
4347
4347
|
}
|
|
4348
4348
|
getDefaultRepresentation() {
|
|
4349
4349
|
return this.default;
|
|
@@ -4616,7 +4616,7 @@ var require_npa = __commonJS({
|
|
|
4616
4616
|
"use strict";
|
|
4617
4617
|
var isWindows = process.platform === "win32";
|
|
4618
4618
|
var { URL: URL2 } = __require("node:url");
|
|
4619
|
-
var
|
|
4619
|
+
var path26 = isWindows ? __require("node:path/win32") : __require("node:path");
|
|
4620
4620
|
var { homedir } = __require("node:os");
|
|
4621
4621
|
var HostedGit = require_lib();
|
|
4622
4622
|
var semver = require_semver2();
|
|
@@ -4871,7 +4871,7 @@ var require_npa = __commonJS({
|
|
|
4871
4871
|
let resolvedUrl;
|
|
4872
4872
|
let specUrl;
|
|
4873
4873
|
try {
|
|
4874
|
-
resolvedUrl = new URL2(rawSpec, `${pathToFileURL3(
|
|
4874
|
+
resolvedUrl = new URL2(rawSpec, `${pathToFileURL3(path26.resolve(where))}/`);
|
|
4875
4875
|
specUrl = new URL2(rawSpec);
|
|
4876
4876
|
} catch (originalError) {
|
|
4877
4877
|
const er = new Error("Invalid file: URL, must comply with RFC 8089");
|
|
@@ -4890,13 +4890,13 @@ var require_npa = __commonJS({
|
|
|
4890
4890
|
}
|
|
4891
4891
|
if (/^\/~(\/|$)/.test(specPath)) {
|
|
4892
4892
|
res.saveSpec = `file:${specPath.substr(1)}`;
|
|
4893
|
-
resolvedPath =
|
|
4894
|
-
} else if (!
|
|
4895
|
-
res.saveSpec = `file:${
|
|
4893
|
+
resolvedPath = path26.resolve(homedir(), specPath.substr(3));
|
|
4894
|
+
} else if (!path26.isAbsolute(rawSpec.slice(5))) {
|
|
4895
|
+
res.saveSpec = `file:${path26.relative(where, resolvedPath)}`;
|
|
4896
4896
|
} else {
|
|
4897
|
-
res.saveSpec = `file:${
|
|
4897
|
+
res.saveSpec = `file:${path26.resolve(resolvedPath)}`;
|
|
4898
4898
|
}
|
|
4899
|
-
res.fetchSpec =
|
|
4899
|
+
res.fetchSpec = path26.resolve(where, resolvedPath);
|
|
4900
4900
|
res.saveSpec = res.saveSpec.split("\\").join("/");
|
|
4901
4901
|
if (res.saveSpec.startsWith("file://")) {
|
|
4902
4902
|
res.saveSpec = `file:/${res.saveSpec.slice(7)}`;
|
|
@@ -5077,7 +5077,7 @@ var require_path = __commonJS({
|
|
|
5077
5077
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5078
5078
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
5079
5079
|
var os4 = __require("os");
|
|
5080
|
-
var
|
|
5080
|
+
var path26 = __require("path");
|
|
5081
5081
|
var IS_WINDOWS_PLATFORM = os4.platform() === "win32";
|
|
5082
5082
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
5083
5083
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
@@ -5089,7 +5089,7 @@ var require_path = __commonJS({
|
|
|
5089
5089
|
}
|
|
5090
5090
|
exports.unixify = unixify;
|
|
5091
5091
|
function makeAbsolute(cwd, filepath) {
|
|
5092
|
-
return
|
|
5092
|
+
return path26.resolve(cwd, filepath);
|
|
5093
5093
|
}
|
|
5094
5094
|
exports.makeAbsolute = makeAbsolute;
|
|
5095
5095
|
function removeLeadingDotSegment(entry) {
|
|
@@ -6386,7 +6386,7 @@ var require_braces = __commonJS({
|
|
|
6386
6386
|
var require_constants3 = __commonJS({
|
|
6387
6387
|
"node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
6388
6388
|
"use strict";
|
|
6389
|
-
var
|
|
6389
|
+
var path26 = __require("path");
|
|
6390
6390
|
var WIN_SLASH = "\\\\/";
|
|
6391
6391
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
6392
6392
|
var DOT_LITERAL = "\\.";
|
|
@@ -6556,7 +6556,7 @@ var require_constants3 = __commonJS({
|
|
|
6556
6556
|
/* | */
|
|
6557
6557
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
6558
6558
|
/* \uFEFF */
|
|
6559
|
-
SEP:
|
|
6559
|
+
SEP: path26.sep,
|
|
6560
6560
|
/**
|
|
6561
6561
|
* Create EXTGLOB_CHARS
|
|
6562
6562
|
*/
|
|
@@ -6583,7 +6583,7 @@ var require_constants3 = __commonJS({
|
|
|
6583
6583
|
var require_utils2 = __commonJS({
|
|
6584
6584
|
"node_modules/picomatch/lib/utils.js"(exports) {
|
|
6585
6585
|
"use strict";
|
|
6586
|
-
var
|
|
6586
|
+
var path26 = __require("path");
|
|
6587
6587
|
var win32 = process.platform === "win32";
|
|
6588
6588
|
var {
|
|
6589
6589
|
REGEX_BACKSLASH,
|
|
@@ -6612,7 +6612,7 @@ var require_utils2 = __commonJS({
|
|
|
6612
6612
|
if (options && typeof options.windows === "boolean") {
|
|
6613
6613
|
return options.windows;
|
|
6614
6614
|
}
|
|
6615
|
-
return win32 === true ||
|
|
6615
|
+
return win32 === true || path26.sep === "\\";
|
|
6616
6616
|
};
|
|
6617
6617
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
6618
6618
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -7747,7 +7747,7 @@ var require_parse4 = __commonJS({
|
|
|
7747
7747
|
var require_picomatch = __commonJS({
|
|
7748
7748
|
"node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
7749
7749
|
"use strict";
|
|
7750
|
-
var
|
|
7750
|
+
var path26 = __require("path");
|
|
7751
7751
|
var scan = require_scan();
|
|
7752
7752
|
var parse2 = require_parse4();
|
|
7753
7753
|
var utils = require_utils2();
|
|
@@ -7832,7 +7832,7 @@ var require_picomatch = __commonJS({
|
|
|
7832
7832
|
};
|
|
7833
7833
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
7834
7834
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
7835
|
-
return regex.test(
|
|
7835
|
+
return regex.test(path26.basename(input));
|
|
7836
7836
|
};
|
|
7837
7837
|
picomatch.isMatch = (str2, patterns, options) => picomatch(patterns, options)(str2);
|
|
7838
7838
|
picomatch.parse = (pattern, options) => {
|
|
@@ -8059,7 +8059,7 @@ var require_pattern = __commonJS({
|
|
|
8059
8059
|
"use strict";
|
|
8060
8060
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8061
8061
|
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
|
8062
|
-
var
|
|
8062
|
+
var path26 = __require("path");
|
|
8063
8063
|
var globParent = require_glob_parent();
|
|
8064
8064
|
var micromatch = require_micromatch();
|
|
8065
8065
|
var GLOBSTAR2 = "**";
|
|
@@ -8154,7 +8154,7 @@ var require_pattern = __commonJS({
|
|
|
8154
8154
|
}
|
|
8155
8155
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
8156
8156
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
8157
|
-
const basename =
|
|
8157
|
+
const basename = path26.basename(pattern);
|
|
8158
8158
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
8159
8159
|
}
|
|
8160
8160
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -8212,7 +8212,7 @@ var require_pattern = __commonJS({
|
|
|
8212
8212
|
}
|
|
8213
8213
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
8214
8214
|
function isAbsolute(pattern) {
|
|
8215
|
-
return
|
|
8215
|
+
return path26.isAbsolute(pattern);
|
|
8216
8216
|
}
|
|
8217
8217
|
exports.isAbsolute = isAbsolute;
|
|
8218
8218
|
}
|
|
@@ -8389,8 +8389,8 @@ var require_utils3 = __commonJS({
|
|
|
8389
8389
|
exports.errno = errno;
|
|
8390
8390
|
var fs11 = require_fs();
|
|
8391
8391
|
exports.fs = fs11;
|
|
8392
|
-
var
|
|
8393
|
-
exports.path =
|
|
8392
|
+
var path26 = require_path();
|
|
8393
|
+
exports.path = path26;
|
|
8394
8394
|
var pattern = require_pattern();
|
|
8395
8395
|
exports.pattern = pattern;
|
|
8396
8396
|
var stream = require_stream();
|
|
@@ -8502,8 +8502,8 @@ var require_async = __commonJS({
|
|
|
8502
8502
|
"use strict";
|
|
8503
8503
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8504
8504
|
exports.read = void 0;
|
|
8505
|
-
function read2(
|
|
8506
|
-
settings.fs.lstat(
|
|
8505
|
+
function read2(path26, settings, callback) {
|
|
8506
|
+
settings.fs.lstat(path26, (lstatError, lstat) => {
|
|
8507
8507
|
if (lstatError !== null) {
|
|
8508
8508
|
callFailureCallback(callback, lstatError);
|
|
8509
8509
|
return;
|
|
@@ -8512,7 +8512,7 @@ var require_async = __commonJS({
|
|
|
8512
8512
|
callSuccessCallback(callback, lstat);
|
|
8513
8513
|
return;
|
|
8514
8514
|
}
|
|
8515
|
-
settings.fs.stat(
|
|
8515
|
+
settings.fs.stat(path26, (statError, stat) => {
|
|
8516
8516
|
if (statError !== null) {
|
|
8517
8517
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
8518
8518
|
callFailureCallback(callback, statError);
|
|
@@ -8544,13 +8544,13 @@ var require_sync = __commonJS({
|
|
|
8544
8544
|
"use strict";
|
|
8545
8545
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8546
8546
|
exports.read = void 0;
|
|
8547
|
-
function read2(
|
|
8548
|
-
const lstat = settings.fs.lstatSync(
|
|
8547
|
+
function read2(path26, settings) {
|
|
8548
|
+
const lstat = settings.fs.lstatSync(path26);
|
|
8549
8549
|
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
|
8550
8550
|
return lstat;
|
|
8551
8551
|
}
|
|
8552
8552
|
try {
|
|
8553
|
-
const stat = settings.fs.statSync(
|
|
8553
|
+
const stat = settings.fs.statSync(path26);
|
|
8554
8554
|
if (settings.markSymbolicLink) {
|
|
8555
8555
|
stat.isSymbolicLink = () => true;
|
|
8556
8556
|
}
|
|
@@ -8621,17 +8621,17 @@ var require_out = __commonJS({
|
|
|
8621
8621
|
var sync = require_sync();
|
|
8622
8622
|
var settings_1 = require_settings();
|
|
8623
8623
|
exports.Settings = settings_1.default;
|
|
8624
|
-
function stat(
|
|
8624
|
+
function stat(path26, optionsOrSettingsOrCallback, callback) {
|
|
8625
8625
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
8626
|
-
async.read(
|
|
8626
|
+
async.read(path26, getSettings(), optionsOrSettingsOrCallback);
|
|
8627
8627
|
return;
|
|
8628
8628
|
}
|
|
8629
|
-
async.read(
|
|
8629
|
+
async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
|
|
8630
8630
|
}
|
|
8631
8631
|
exports.stat = stat;
|
|
8632
|
-
function statSync3(
|
|
8632
|
+
function statSync3(path26, optionsOrSettings) {
|
|
8633
8633
|
const settings = getSettings(optionsOrSettings);
|
|
8634
|
-
return sync.read(
|
|
8634
|
+
return sync.read(path26, settings);
|
|
8635
8635
|
}
|
|
8636
8636
|
exports.statSync = statSync3;
|
|
8637
8637
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -8847,16 +8847,16 @@ var require_async2 = __commonJS({
|
|
|
8847
8847
|
return;
|
|
8848
8848
|
}
|
|
8849
8849
|
const tasks = names.map((name) => {
|
|
8850
|
-
const
|
|
8850
|
+
const path26 = common3.joinPathSegments(directory, name, settings.pathSegmentSeparator);
|
|
8851
8851
|
return (done) => {
|
|
8852
|
-
fsStat.stat(
|
|
8852
|
+
fsStat.stat(path26, settings.fsStatSettings, (error, stats) => {
|
|
8853
8853
|
if (error !== null) {
|
|
8854
8854
|
done(error);
|
|
8855
8855
|
return;
|
|
8856
8856
|
}
|
|
8857
8857
|
const entry = {
|
|
8858
8858
|
name,
|
|
8859
|
-
path:
|
|
8859
|
+
path: path26,
|
|
8860
8860
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
8861
8861
|
};
|
|
8862
8862
|
if (settings.stats) {
|
|
@@ -8974,7 +8974,7 @@ var require_settings2 = __commonJS({
|
|
|
8974
8974
|
"node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
|
|
8975
8975
|
"use strict";
|
|
8976
8976
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8977
|
-
var
|
|
8977
|
+
var path26 = __require("path");
|
|
8978
8978
|
var fsStat = require_out();
|
|
8979
8979
|
var fs11 = require_fs4();
|
|
8980
8980
|
var Settings = class {
|
|
@@ -8982,7 +8982,7 @@ var require_settings2 = __commonJS({
|
|
|
8982
8982
|
this._options = _options;
|
|
8983
8983
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
8984
8984
|
this.fs = fs11.createFileSystemAdapter(this._options.fs);
|
|
8985
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
8985
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
|
|
8986
8986
|
this.stats = this._getValue(this._options.stats, false);
|
|
8987
8987
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
8988
8988
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -9009,17 +9009,17 @@ var require_out2 = __commonJS({
|
|
|
9009
9009
|
var sync = require_sync2();
|
|
9010
9010
|
var settings_1 = require_settings2();
|
|
9011
9011
|
exports.Settings = settings_1.default;
|
|
9012
|
-
function scandir(
|
|
9012
|
+
function scandir(path26, optionsOrSettingsOrCallback, callback) {
|
|
9013
9013
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
9014
|
-
async.read(
|
|
9014
|
+
async.read(path26, getSettings(), optionsOrSettingsOrCallback);
|
|
9015
9015
|
return;
|
|
9016
9016
|
}
|
|
9017
|
-
async.read(
|
|
9017
|
+
async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
|
|
9018
9018
|
}
|
|
9019
9019
|
exports.scandir = scandir;
|
|
9020
|
-
function scandirSync(
|
|
9020
|
+
function scandirSync(path26, optionsOrSettings) {
|
|
9021
9021
|
const settings = getSettings(optionsOrSettings);
|
|
9022
|
-
return sync.read(
|
|
9022
|
+
return sync.read(path26, settings);
|
|
9023
9023
|
}
|
|
9024
9024
|
exports.scandirSync = scandirSync;
|
|
9025
9025
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -9643,7 +9643,7 @@ var require_settings3 = __commonJS({
|
|
|
9643
9643
|
"node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
|
|
9644
9644
|
"use strict";
|
|
9645
9645
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9646
|
-
var
|
|
9646
|
+
var path26 = __require("path");
|
|
9647
9647
|
var fsScandir = require_out2();
|
|
9648
9648
|
var Settings = class {
|
|
9649
9649
|
constructor(_options = {}) {
|
|
@@ -9653,7 +9653,7 @@ var require_settings3 = __commonJS({
|
|
|
9653
9653
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
9654
9654
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
9655
9655
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
9656
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator,
|
|
9656
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
|
|
9657
9657
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
9658
9658
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
9659
9659
|
fs: this._options.fs,
|
|
@@ -9715,7 +9715,7 @@ var require_reader2 = __commonJS({
|
|
|
9715
9715
|
"node_modules/fast-glob/out/readers/reader.js"(exports) {
|
|
9716
9716
|
"use strict";
|
|
9717
9717
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9718
|
-
var
|
|
9718
|
+
var path26 = __require("path");
|
|
9719
9719
|
var fsStat = require_out();
|
|
9720
9720
|
var utils = require_utils3();
|
|
9721
9721
|
var Reader = class {
|
|
@@ -9728,7 +9728,7 @@ var require_reader2 = __commonJS({
|
|
|
9728
9728
|
});
|
|
9729
9729
|
}
|
|
9730
9730
|
_getFullEntryPath(filepath) {
|
|
9731
|
-
return
|
|
9731
|
+
return path26.resolve(this._settings.cwd, filepath);
|
|
9732
9732
|
}
|
|
9733
9733
|
_makeEntry(stats, pattern) {
|
|
9734
9734
|
const entry = {
|
|
@@ -10144,7 +10144,7 @@ var require_provider = __commonJS({
|
|
|
10144
10144
|
"node_modules/fast-glob/out/providers/provider.js"(exports) {
|
|
10145
10145
|
"use strict";
|
|
10146
10146
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10147
|
-
var
|
|
10147
|
+
var path26 = __require("path");
|
|
10148
10148
|
var deep_1 = require_deep();
|
|
10149
10149
|
var entry_1 = require_entry();
|
|
10150
10150
|
var error_1 = require_error();
|
|
@@ -10158,7 +10158,7 @@ var require_provider = __commonJS({
|
|
|
10158
10158
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
10159
10159
|
}
|
|
10160
10160
|
_getRootDirectory(task) {
|
|
10161
|
-
return
|
|
10161
|
+
return path26.resolve(this._settings.cwd, task.base);
|
|
10162
10162
|
}
|
|
10163
10163
|
_getReaderOptions(task) {
|
|
10164
10164
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -10791,7 +10791,7 @@ var require_ignore = __commonJS({
|
|
|
10791
10791
|
// path matching.
|
|
10792
10792
|
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
10793
10793
|
// @returns {TestResult} true if a file is ignored
|
|
10794
|
-
test(
|
|
10794
|
+
test(path26, checkUnignored, mode) {
|
|
10795
10795
|
let ignored = false;
|
|
10796
10796
|
let unignored = false;
|
|
10797
10797
|
let matchedRule;
|
|
@@ -10800,7 +10800,7 @@ var require_ignore = __commonJS({
|
|
|
10800
10800
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
10801
10801
|
return;
|
|
10802
10802
|
}
|
|
10803
|
-
const matched = rule[mode].test(
|
|
10803
|
+
const matched = rule[mode].test(path26);
|
|
10804
10804
|
if (!matched) {
|
|
10805
10805
|
return;
|
|
10806
10806
|
}
|
|
@@ -10821,17 +10821,17 @@ var require_ignore = __commonJS({
|
|
|
10821
10821
|
var throwError2 = (message, Ctor) => {
|
|
10822
10822
|
throw new Ctor(message);
|
|
10823
10823
|
};
|
|
10824
|
-
var checkPath = (
|
|
10825
|
-
if (!isString2(
|
|
10824
|
+
var checkPath = (path26, originalPath, doThrow) => {
|
|
10825
|
+
if (!isString2(path26)) {
|
|
10826
10826
|
return doThrow(
|
|
10827
10827
|
`path must be a string, but got \`${originalPath}\``,
|
|
10828
10828
|
TypeError
|
|
10829
10829
|
);
|
|
10830
10830
|
}
|
|
10831
|
-
if (!
|
|
10831
|
+
if (!path26) {
|
|
10832
10832
|
return doThrow(`path must not be empty`, TypeError);
|
|
10833
10833
|
}
|
|
10834
|
-
if (checkPath.isNotRelative(
|
|
10834
|
+
if (checkPath.isNotRelative(path26)) {
|
|
10835
10835
|
const r = "`path.relative()`d";
|
|
10836
10836
|
return doThrow(
|
|
10837
10837
|
`path should be a ${r} string, but got "${originalPath}"`,
|
|
@@ -10840,7 +10840,7 @@ var require_ignore = __commonJS({
|
|
|
10840
10840
|
}
|
|
10841
10841
|
return true;
|
|
10842
10842
|
};
|
|
10843
|
-
var isNotRelative = (
|
|
10843
|
+
var isNotRelative = (path26) => REGEX_TEST_INVALID_PATH.test(path26);
|
|
10844
10844
|
checkPath.isNotRelative = isNotRelative;
|
|
10845
10845
|
checkPath.convert = (p) => p;
|
|
10846
10846
|
var Ignore = class {
|
|
@@ -10870,19 +10870,19 @@ var require_ignore = __commonJS({
|
|
|
10870
10870
|
}
|
|
10871
10871
|
// @returns {TestResult}
|
|
10872
10872
|
_test(originalPath, cache2, checkUnignored, slices) {
|
|
10873
|
-
const
|
|
10873
|
+
const path26 = originalPath && checkPath.convert(originalPath);
|
|
10874
10874
|
checkPath(
|
|
10875
|
-
|
|
10875
|
+
path26,
|
|
10876
10876
|
originalPath,
|
|
10877
10877
|
this._strictPathCheck ? throwError2 : RETURN_FALSE
|
|
10878
10878
|
);
|
|
10879
|
-
return this._t(
|
|
10879
|
+
return this._t(path26, cache2, checkUnignored, slices);
|
|
10880
10880
|
}
|
|
10881
|
-
checkIgnore(
|
|
10882
|
-
if (!REGEX_TEST_TRAILING_SLASH.test(
|
|
10883
|
-
return this.test(
|
|
10881
|
+
checkIgnore(path26) {
|
|
10882
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path26)) {
|
|
10883
|
+
return this.test(path26);
|
|
10884
10884
|
}
|
|
10885
|
-
const slices =
|
|
10885
|
+
const slices = path26.split(SLASH).filter(Boolean);
|
|
10886
10886
|
slices.pop();
|
|
10887
10887
|
if (slices.length) {
|
|
10888
10888
|
const parent = this._t(
|
|
@@ -10895,18 +10895,18 @@ var require_ignore = __commonJS({
|
|
|
10895
10895
|
return parent;
|
|
10896
10896
|
}
|
|
10897
10897
|
}
|
|
10898
|
-
return this._rules.test(
|
|
10898
|
+
return this._rules.test(path26, false, MODE_CHECK_IGNORE);
|
|
10899
10899
|
}
|
|
10900
|
-
_t(
|
|
10901
|
-
if (
|
|
10902
|
-
return cache2[
|
|
10900
|
+
_t(path26, cache2, checkUnignored, slices) {
|
|
10901
|
+
if (path26 in cache2) {
|
|
10902
|
+
return cache2[path26];
|
|
10903
10903
|
}
|
|
10904
10904
|
if (!slices) {
|
|
10905
|
-
slices =
|
|
10905
|
+
slices = path26.split(SLASH).filter(Boolean);
|
|
10906
10906
|
}
|
|
10907
10907
|
slices.pop();
|
|
10908
10908
|
if (!slices.length) {
|
|
10909
|
-
return cache2[
|
|
10909
|
+
return cache2[path26] = this._rules.test(path26, checkUnignored, MODE_IGNORE);
|
|
10910
10910
|
}
|
|
10911
10911
|
const parent = this._t(
|
|
10912
10912
|
slices.join(SLASH) + SLASH,
|
|
@@ -10914,29 +10914,29 @@ var require_ignore = __commonJS({
|
|
|
10914
10914
|
checkUnignored,
|
|
10915
10915
|
slices
|
|
10916
10916
|
);
|
|
10917
|
-
return cache2[
|
|
10917
|
+
return cache2[path26] = parent.ignored ? parent : this._rules.test(path26, checkUnignored, MODE_IGNORE);
|
|
10918
10918
|
}
|
|
10919
|
-
ignores(
|
|
10920
|
-
return this._test(
|
|
10919
|
+
ignores(path26) {
|
|
10920
|
+
return this._test(path26, this._ignoreCache, false).ignored;
|
|
10921
10921
|
}
|
|
10922
10922
|
createFilter() {
|
|
10923
|
-
return (
|
|
10923
|
+
return (path26) => !this.ignores(path26);
|
|
10924
10924
|
}
|
|
10925
10925
|
filter(paths) {
|
|
10926
10926
|
return makeArray(paths).filter(this.createFilter());
|
|
10927
10927
|
}
|
|
10928
10928
|
// @returns {TestResult}
|
|
10929
|
-
test(
|
|
10930
|
-
return this._test(
|
|
10929
|
+
test(path26) {
|
|
10930
|
+
return this._test(path26, this._testCache, true);
|
|
10931
10931
|
}
|
|
10932
10932
|
};
|
|
10933
10933
|
var factory = (options) => new Ignore(options);
|
|
10934
|
-
var isPathValid = (
|
|
10934
|
+
var isPathValid = (path26) => checkPath(path26 && checkPath.convert(path26), path26, RETURN_FALSE);
|
|
10935
10935
|
var setupWindows = () => {
|
|
10936
10936
|
const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/");
|
|
10937
10937
|
checkPath.convert = makePosix;
|
|
10938
10938
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
10939
|
-
checkPath.isNotRelative = (
|
|
10939
|
+
checkPath.isNotRelative = (path26) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path26) || isNotRelative(path26);
|
|
10940
10940
|
};
|
|
10941
10941
|
if (
|
|
10942
10942
|
// Detect `process` so that it can run in browsers.
|
|
@@ -11186,7 +11186,7 @@ var require_utils5 = __commonJS({
|
|
|
11186
11186
|
"use strict";
|
|
11187
11187
|
var fs11 = __require("fs");
|
|
11188
11188
|
var ini = require_ini();
|
|
11189
|
-
var
|
|
11189
|
+
var path26 = __require("path");
|
|
11190
11190
|
var stripJsonComments = require_strip_json_comments();
|
|
11191
11191
|
var parse2 = exports.parse = function(content) {
|
|
11192
11192
|
if (/^\s*{/.test(content))
|
|
@@ -11200,7 +11200,7 @@ var require_utils5 = __commonJS({
|
|
|
11200
11200
|
for (var i2 in args)
|
|
11201
11201
|
if ("string" !== typeof args[i2])
|
|
11202
11202
|
return;
|
|
11203
|
-
var file2 =
|
|
11203
|
+
var file2 = path26.join.apply(null, args);
|
|
11204
11204
|
var content;
|
|
11205
11205
|
try {
|
|
11206
11206
|
return fs11.readFileSync(file2, "utf-8");
|
|
@@ -11238,15 +11238,15 @@ var require_utils5 = __commonJS({
|
|
|
11238
11238
|
return obj;
|
|
11239
11239
|
};
|
|
11240
11240
|
var find = exports.find = function() {
|
|
11241
|
-
var rel =
|
|
11241
|
+
var rel = path26.join.apply(null, [].slice.call(arguments));
|
|
11242
11242
|
function find2(start, rel2) {
|
|
11243
|
-
var file2 =
|
|
11243
|
+
var file2 = path26.join(start, rel2);
|
|
11244
11244
|
try {
|
|
11245
11245
|
fs11.statSync(file2);
|
|
11246
11246
|
return file2;
|
|
11247
11247
|
} catch (err) {
|
|
11248
|
-
if (
|
|
11249
|
-
return find2(
|
|
11248
|
+
if (path26.dirname(start) !== start)
|
|
11249
|
+
return find2(path26.dirname(start), rel2);
|
|
11250
11250
|
}
|
|
11251
11251
|
}
|
|
11252
11252
|
return find2(process.cwd(), rel);
|
|
@@ -14491,1903 +14491,6 @@ var require_validate_npm_package_license = __commonJS({
|
|
|
14491
14491
|
}
|
|
14492
14492
|
});
|
|
14493
14493
|
|
|
14494
|
-
// node_modules/read-package-up/node_modules/lru-cache/dist/commonjs/index.js
|
|
14495
|
-
var require_commonjs2 = __commonJS({
|
|
14496
|
-
"node_modules/read-package-up/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
|
|
14497
|
-
"use strict";
|
|
14498
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14499
|
-
exports.LRUCache = void 0;
|
|
14500
|
-
var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
14501
|
-
var warned = /* @__PURE__ */ new Set();
|
|
14502
|
-
var PROCESS = typeof process === "object" && !!process ? process : {};
|
|
14503
|
-
var emitWarning = (msg, type2, code, fn) => {
|
|
14504
|
-
typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
|
|
14505
|
-
};
|
|
14506
|
-
var AC = globalThis.AbortController;
|
|
14507
|
-
var AS = globalThis.AbortSignal;
|
|
14508
|
-
if (typeof AC === "undefined") {
|
|
14509
|
-
AS = class AbortSignal {
|
|
14510
|
-
onabort;
|
|
14511
|
-
_onabort = [];
|
|
14512
|
-
reason;
|
|
14513
|
-
aborted = false;
|
|
14514
|
-
addEventListener(_, fn) {
|
|
14515
|
-
this._onabort.push(fn);
|
|
14516
|
-
}
|
|
14517
|
-
};
|
|
14518
|
-
AC = class AbortController {
|
|
14519
|
-
constructor() {
|
|
14520
|
-
warnACPolyfill();
|
|
14521
|
-
}
|
|
14522
|
-
signal = new AS();
|
|
14523
|
-
abort(reason) {
|
|
14524
|
-
if (this.signal.aborted)
|
|
14525
|
-
return;
|
|
14526
|
-
this.signal.reason = reason;
|
|
14527
|
-
this.signal.aborted = true;
|
|
14528
|
-
for (const fn of this.signal._onabort) {
|
|
14529
|
-
fn(reason);
|
|
14530
|
-
}
|
|
14531
|
-
this.signal.onabort?.(reason);
|
|
14532
|
-
}
|
|
14533
|
-
};
|
|
14534
|
-
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
14535
|
-
const warnACPolyfill = () => {
|
|
14536
|
-
if (!printACPolyfillWarning)
|
|
14537
|
-
return;
|
|
14538
|
-
printACPolyfillWarning = false;
|
|
14539
|
-
emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
|
14540
|
-
};
|
|
14541
|
-
}
|
|
14542
|
-
var shouldWarn = (code) => !warned.has(code);
|
|
14543
|
-
var TYPE = Symbol("type");
|
|
14544
|
-
var isPosInt = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
|
|
14545
|
-
var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
|
|
14546
|
-
var ZeroArray = class extends Array {
|
|
14547
|
-
constructor(size) {
|
|
14548
|
-
super(size);
|
|
14549
|
-
this.fill(0);
|
|
14550
|
-
}
|
|
14551
|
-
};
|
|
14552
|
-
var Stack = class _Stack {
|
|
14553
|
-
heap;
|
|
14554
|
-
length;
|
|
14555
|
-
// private constructor
|
|
14556
|
-
static #constructing = false;
|
|
14557
|
-
static create(max) {
|
|
14558
|
-
const HeapCls = getUintArray(max);
|
|
14559
|
-
if (!HeapCls)
|
|
14560
|
-
return [];
|
|
14561
|
-
_Stack.#constructing = true;
|
|
14562
|
-
const s = new _Stack(max, HeapCls);
|
|
14563
|
-
_Stack.#constructing = false;
|
|
14564
|
-
return s;
|
|
14565
|
-
}
|
|
14566
|
-
constructor(max, HeapCls) {
|
|
14567
|
-
if (!_Stack.#constructing) {
|
|
14568
|
-
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
14569
|
-
}
|
|
14570
|
-
this.heap = new HeapCls(max);
|
|
14571
|
-
this.length = 0;
|
|
14572
|
-
}
|
|
14573
|
-
push(n2) {
|
|
14574
|
-
this.heap[this.length++] = n2;
|
|
14575
|
-
}
|
|
14576
|
-
pop() {
|
|
14577
|
-
return this.heap[--this.length];
|
|
14578
|
-
}
|
|
14579
|
-
};
|
|
14580
|
-
var LRUCache = class _LRUCache {
|
|
14581
|
-
// options that cannot be changed without disaster
|
|
14582
|
-
#max;
|
|
14583
|
-
#maxSize;
|
|
14584
|
-
#dispose;
|
|
14585
|
-
#onInsert;
|
|
14586
|
-
#disposeAfter;
|
|
14587
|
-
#fetchMethod;
|
|
14588
|
-
#memoMethod;
|
|
14589
|
-
#perf;
|
|
14590
|
-
/**
|
|
14591
|
-
* {@link LRUCache.OptionsBase.perf}
|
|
14592
|
-
*/
|
|
14593
|
-
get perf() {
|
|
14594
|
-
return this.#perf;
|
|
14595
|
-
}
|
|
14596
|
-
/**
|
|
14597
|
-
* {@link LRUCache.OptionsBase.ttl}
|
|
14598
|
-
*/
|
|
14599
|
-
ttl;
|
|
14600
|
-
/**
|
|
14601
|
-
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
14602
|
-
*/
|
|
14603
|
-
ttlResolution;
|
|
14604
|
-
/**
|
|
14605
|
-
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
14606
|
-
*/
|
|
14607
|
-
ttlAutopurge;
|
|
14608
|
-
/**
|
|
14609
|
-
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
14610
|
-
*/
|
|
14611
|
-
updateAgeOnGet;
|
|
14612
|
-
/**
|
|
14613
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
14614
|
-
*/
|
|
14615
|
-
updateAgeOnHas;
|
|
14616
|
-
/**
|
|
14617
|
-
* {@link LRUCache.OptionsBase.allowStale}
|
|
14618
|
-
*/
|
|
14619
|
-
allowStale;
|
|
14620
|
-
/**
|
|
14621
|
-
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
14622
|
-
*/
|
|
14623
|
-
noDisposeOnSet;
|
|
14624
|
-
/**
|
|
14625
|
-
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
14626
|
-
*/
|
|
14627
|
-
noUpdateTTL;
|
|
14628
|
-
/**
|
|
14629
|
-
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
14630
|
-
*/
|
|
14631
|
-
maxEntrySize;
|
|
14632
|
-
/**
|
|
14633
|
-
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
14634
|
-
*/
|
|
14635
|
-
sizeCalculation;
|
|
14636
|
-
/**
|
|
14637
|
-
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
14638
|
-
*/
|
|
14639
|
-
noDeleteOnFetchRejection;
|
|
14640
|
-
/**
|
|
14641
|
-
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
14642
|
-
*/
|
|
14643
|
-
noDeleteOnStaleGet;
|
|
14644
|
-
/**
|
|
14645
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
14646
|
-
*/
|
|
14647
|
-
allowStaleOnFetchAbort;
|
|
14648
|
-
/**
|
|
14649
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
14650
|
-
*/
|
|
14651
|
-
allowStaleOnFetchRejection;
|
|
14652
|
-
/**
|
|
14653
|
-
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
14654
|
-
*/
|
|
14655
|
-
ignoreFetchAbort;
|
|
14656
|
-
// computed properties
|
|
14657
|
-
#size;
|
|
14658
|
-
#calculatedSize;
|
|
14659
|
-
#keyMap;
|
|
14660
|
-
#keyList;
|
|
14661
|
-
#valList;
|
|
14662
|
-
#next;
|
|
14663
|
-
#prev;
|
|
14664
|
-
#head;
|
|
14665
|
-
#tail;
|
|
14666
|
-
#free;
|
|
14667
|
-
#disposed;
|
|
14668
|
-
#sizes;
|
|
14669
|
-
#starts;
|
|
14670
|
-
#ttls;
|
|
14671
|
-
#hasDispose;
|
|
14672
|
-
#hasFetchMethod;
|
|
14673
|
-
#hasDisposeAfter;
|
|
14674
|
-
#hasOnInsert;
|
|
14675
|
-
/**
|
|
14676
|
-
* Do not call this method unless you need to inspect the
|
|
14677
|
-
* inner workings of the cache. If anything returned by this
|
|
14678
|
-
* object is modified in any way, strange breakage may occur.
|
|
14679
|
-
*
|
|
14680
|
-
* These fields are private for a reason!
|
|
14681
|
-
*
|
|
14682
|
-
* @internal
|
|
14683
|
-
*/
|
|
14684
|
-
static unsafeExposeInternals(c3) {
|
|
14685
|
-
return {
|
|
14686
|
-
// properties
|
|
14687
|
-
starts: c3.#starts,
|
|
14688
|
-
ttls: c3.#ttls,
|
|
14689
|
-
sizes: c3.#sizes,
|
|
14690
|
-
keyMap: c3.#keyMap,
|
|
14691
|
-
keyList: c3.#keyList,
|
|
14692
|
-
valList: c3.#valList,
|
|
14693
|
-
next: c3.#next,
|
|
14694
|
-
prev: c3.#prev,
|
|
14695
|
-
get head() {
|
|
14696
|
-
return c3.#head;
|
|
14697
|
-
},
|
|
14698
|
-
get tail() {
|
|
14699
|
-
return c3.#tail;
|
|
14700
|
-
},
|
|
14701
|
-
free: c3.#free,
|
|
14702
|
-
// methods
|
|
14703
|
-
isBackgroundFetch: (p) => c3.#isBackgroundFetch(p),
|
|
14704
|
-
backgroundFetch: (k, index, options, context) => c3.#backgroundFetch(k, index, options, context),
|
|
14705
|
-
moveToTail: (index) => c3.#moveToTail(index),
|
|
14706
|
-
indexes: (options) => c3.#indexes(options),
|
|
14707
|
-
rindexes: (options) => c3.#rindexes(options),
|
|
14708
|
-
isStale: (index) => c3.#isStale(index)
|
|
14709
|
-
};
|
|
14710
|
-
}
|
|
14711
|
-
// Protected read-only members
|
|
14712
|
-
/**
|
|
14713
|
-
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
14714
|
-
*/
|
|
14715
|
-
get max() {
|
|
14716
|
-
return this.#max;
|
|
14717
|
-
}
|
|
14718
|
-
/**
|
|
14719
|
-
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
14720
|
-
*/
|
|
14721
|
-
get maxSize() {
|
|
14722
|
-
return this.#maxSize;
|
|
14723
|
-
}
|
|
14724
|
-
/**
|
|
14725
|
-
* The total computed size of items in the cache (read-only)
|
|
14726
|
-
*/
|
|
14727
|
-
get calculatedSize() {
|
|
14728
|
-
return this.#calculatedSize;
|
|
14729
|
-
}
|
|
14730
|
-
/**
|
|
14731
|
-
* The number of items stored in the cache (read-only)
|
|
14732
|
-
*/
|
|
14733
|
-
get size() {
|
|
14734
|
-
return this.#size;
|
|
14735
|
-
}
|
|
14736
|
-
/**
|
|
14737
|
-
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
14738
|
-
*/
|
|
14739
|
-
get fetchMethod() {
|
|
14740
|
-
return this.#fetchMethod;
|
|
14741
|
-
}
|
|
14742
|
-
get memoMethod() {
|
|
14743
|
-
return this.#memoMethod;
|
|
14744
|
-
}
|
|
14745
|
-
/**
|
|
14746
|
-
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
14747
|
-
*/
|
|
14748
|
-
get dispose() {
|
|
14749
|
-
return this.#dispose;
|
|
14750
|
-
}
|
|
14751
|
-
/**
|
|
14752
|
-
* {@link LRUCache.OptionsBase.onInsert} (read-only)
|
|
14753
|
-
*/
|
|
14754
|
-
get onInsert() {
|
|
14755
|
-
return this.#onInsert;
|
|
14756
|
-
}
|
|
14757
|
-
/**
|
|
14758
|
-
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
14759
|
-
*/
|
|
14760
|
-
get disposeAfter() {
|
|
14761
|
-
return this.#disposeAfter;
|
|
14762
|
-
}
|
|
14763
|
-
constructor(options) {
|
|
14764
|
-
const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf } = options;
|
|
14765
|
-
if (perf !== void 0) {
|
|
14766
|
-
if (typeof perf?.now !== "function") {
|
|
14767
|
-
throw new TypeError("perf option must have a now() method if specified");
|
|
14768
|
-
}
|
|
14769
|
-
}
|
|
14770
|
-
this.#perf = perf ?? defaultPerf;
|
|
14771
|
-
if (max !== 0 && !isPosInt(max)) {
|
|
14772
|
-
throw new TypeError("max option must be a nonnegative integer");
|
|
14773
|
-
}
|
|
14774
|
-
const UintArray = max ? getUintArray(max) : Array;
|
|
14775
|
-
if (!UintArray) {
|
|
14776
|
-
throw new Error("invalid max value: " + max);
|
|
14777
|
-
}
|
|
14778
|
-
this.#max = max;
|
|
14779
|
-
this.#maxSize = maxSize;
|
|
14780
|
-
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
|
14781
|
-
this.sizeCalculation = sizeCalculation;
|
|
14782
|
-
if (this.sizeCalculation) {
|
|
14783
|
-
if (!this.#maxSize && !this.maxEntrySize) {
|
|
14784
|
-
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
14785
|
-
}
|
|
14786
|
-
if (typeof this.sizeCalculation !== "function") {
|
|
14787
|
-
throw new TypeError("sizeCalculation set to non-function");
|
|
14788
|
-
}
|
|
14789
|
-
}
|
|
14790
|
-
if (memoMethod !== void 0 && typeof memoMethod !== "function") {
|
|
14791
|
-
throw new TypeError("memoMethod must be a function if defined");
|
|
14792
|
-
}
|
|
14793
|
-
this.#memoMethod = memoMethod;
|
|
14794
|
-
if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
|
|
14795
|
-
throw new TypeError("fetchMethod must be a function if specified");
|
|
14796
|
-
}
|
|
14797
|
-
this.#fetchMethod = fetchMethod;
|
|
14798
|
-
this.#hasFetchMethod = !!fetchMethod;
|
|
14799
|
-
this.#keyMap = /* @__PURE__ */ new Map();
|
|
14800
|
-
this.#keyList = new Array(max).fill(void 0);
|
|
14801
|
-
this.#valList = new Array(max).fill(void 0);
|
|
14802
|
-
this.#next = new UintArray(max);
|
|
14803
|
-
this.#prev = new UintArray(max);
|
|
14804
|
-
this.#head = 0;
|
|
14805
|
-
this.#tail = 0;
|
|
14806
|
-
this.#free = Stack.create(max);
|
|
14807
|
-
this.#size = 0;
|
|
14808
|
-
this.#calculatedSize = 0;
|
|
14809
|
-
if (typeof dispose === "function") {
|
|
14810
|
-
this.#dispose = dispose;
|
|
14811
|
-
}
|
|
14812
|
-
if (typeof onInsert === "function") {
|
|
14813
|
-
this.#onInsert = onInsert;
|
|
14814
|
-
}
|
|
14815
|
-
if (typeof disposeAfter === "function") {
|
|
14816
|
-
this.#disposeAfter = disposeAfter;
|
|
14817
|
-
this.#disposed = [];
|
|
14818
|
-
} else {
|
|
14819
|
-
this.#disposeAfter = void 0;
|
|
14820
|
-
this.#disposed = void 0;
|
|
14821
|
-
}
|
|
14822
|
-
this.#hasDispose = !!this.#dispose;
|
|
14823
|
-
this.#hasOnInsert = !!this.#onInsert;
|
|
14824
|
-
this.#hasDisposeAfter = !!this.#disposeAfter;
|
|
14825
|
-
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
14826
|
-
this.noUpdateTTL = !!noUpdateTTL;
|
|
14827
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
14828
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
14829
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
14830
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
14831
|
-
if (this.maxEntrySize !== 0) {
|
|
14832
|
-
if (this.#maxSize !== 0) {
|
|
14833
|
-
if (!isPosInt(this.#maxSize)) {
|
|
14834
|
-
throw new TypeError("maxSize must be a positive integer if specified");
|
|
14835
|
-
}
|
|
14836
|
-
}
|
|
14837
|
-
if (!isPosInt(this.maxEntrySize)) {
|
|
14838
|
-
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
14839
|
-
}
|
|
14840
|
-
this.#initializeSizeTracking();
|
|
14841
|
-
}
|
|
14842
|
-
this.allowStale = !!allowStale;
|
|
14843
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
14844
|
-
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
14845
|
-
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
14846
|
-
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
14847
|
-
this.ttlAutopurge = !!ttlAutopurge;
|
|
14848
|
-
this.ttl = ttl || 0;
|
|
14849
|
-
if (this.ttl) {
|
|
14850
|
-
if (!isPosInt(this.ttl)) {
|
|
14851
|
-
throw new TypeError("ttl must be a positive integer if specified");
|
|
14852
|
-
}
|
|
14853
|
-
this.#initializeTTLTracking();
|
|
14854
|
-
}
|
|
14855
|
-
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
|
|
14856
|
-
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
14857
|
-
}
|
|
14858
|
-
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
|
14859
|
-
const code = "LRU_CACHE_UNBOUNDED";
|
|
14860
|
-
if (shouldWarn(code)) {
|
|
14861
|
-
warned.add(code);
|
|
14862
|
-
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
|
|
14863
|
-
emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);
|
|
14864
|
-
}
|
|
14865
|
-
}
|
|
14866
|
-
}
|
|
14867
|
-
/**
|
|
14868
|
-
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
14869
|
-
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
14870
|
-
*/
|
|
14871
|
-
getRemainingTTL(key) {
|
|
14872
|
-
return this.#keyMap.has(key) ? Infinity : 0;
|
|
14873
|
-
}
|
|
14874
|
-
#initializeTTLTracking() {
|
|
14875
|
-
const ttls = new ZeroArray(this.#max);
|
|
14876
|
-
const starts = new ZeroArray(this.#max);
|
|
14877
|
-
this.#ttls = ttls;
|
|
14878
|
-
this.#starts = starts;
|
|
14879
|
-
this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
|
|
14880
|
-
starts[index] = ttl !== 0 ? start : 0;
|
|
14881
|
-
ttls[index] = ttl;
|
|
14882
|
-
if (ttl !== 0 && this.ttlAutopurge) {
|
|
14883
|
-
const t = setTimeout(() => {
|
|
14884
|
-
if (this.#isStale(index)) {
|
|
14885
|
-
this.#delete(this.#keyList[index], "expire");
|
|
14886
|
-
}
|
|
14887
|
-
}, ttl + 1);
|
|
14888
|
-
if (t.unref) {
|
|
14889
|
-
t.unref();
|
|
14890
|
-
}
|
|
14891
|
-
}
|
|
14892
|
-
};
|
|
14893
|
-
this.#updateItemAge = (index) => {
|
|
14894
|
-
starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;
|
|
14895
|
-
};
|
|
14896
|
-
this.#statusTTL = (status, index) => {
|
|
14897
|
-
if (ttls[index]) {
|
|
14898
|
-
const ttl = ttls[index];
|
|
14899
|
-
const start = starts[index];
|
|
14900
|
-
if (!ttl || !start)
|
|
14901
|
-
return;
|
|
14902
|
-
status.ttl = ttl;
|
|
14903
|
-
status.start = start;
|
|
14904
|
-
status.now = cachedNow || getNow();
|
|
14905
|
-
const age = status.now - start;
|
|
14906
|
-
status.remainingTTL = ttl - age;
|
|
14907
|
-
}
|
|
14908
|
-
};
|
|
14909
|
-
let cachedNow = 0;
|
|
14910
|
-
const getNow = () => {
|
|
14911
|
-
const n2 = this.#perf.now();
|
|
14912
|
-
if (this.ttlResolution > 0) {
|
|
14913
|
-
cachedNow = n2;
|
|
14914
|
-
const t = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
14915
|
-
if (t.unref) {
|
|
14916
|
-
t.unref();
|
|
14917
|
-
}
|
|
14918
|
-
}
|
|
14919
|
-
return n2;
|
|
14920
|
-
};
|
|
14921
|
-
this.getRemainingTTL = (key) => {
|
|
14922
|
-
const index = this.#keyMap.get(key);
|
|
14923
|
-
if (index === void 0) {
|
|
14924
|
-
return 0;
|
|
14925
|
-
}
|
|
14926
|
-
const ttl = ttls[index];
|
|
14927
|
-
const start = starts[index];
|
|
14928
|
-
if (!ttl || !start) {
|
|
14929
|
-
return Infinity;
|
|
14930
|
-
}
|
|
14931
|
-
const age = (cachedNow || getNow()) - start;
|
|
14932
|
-
return ttl - age;
|
|
14933
|
-
};
|
|
14934
|
-
this.#isStale = (index) => {
|
|
14935
|
-
const s = starts[index];
|
|
14936
|
-
const t = ttls[index];
|
|
14937
|
-
return !!t && !!s && (cachedNow || getNow()) - s > t;
|
|
14938
|
-
};
|
|
14939
|
-
}
|
|
14940
|
-
// conditionally set private methods related to TTL
|
|
14941
|
-
#updateItemAge = () => {
|
|
14942
|
-
};
|
|
14943
|
-
#statusTTL = () => {
|
|
14944
|
-
};
|
|
14945
|
-
#setItemTTL = () => {
|
|
14946
|
-
};
|
|
14947
|
-
/* c8 ignore stop */
|
|
14948
|
-
#isStale = () => false;
|
|
14949
|
-
#initializeSizeTracking() {
|
|
14950
|
-
const sizes = new ZeroArray(this.#max);
|
|
14951
|
-
this.#calculatedSize = 0;
|
|
14952
|
-
this.#sizes = sizes;
|
|
14953
|
-
this.#removeItemSize = (index) => {
|
|
14954
|
-
this.#calculatedSize -= sizes[index];
|
|
14955
|
-
sizes[index] = 0;
|
|
14956
|
-
};
|
|
14957
|
-
this.#requireSize = (k, v, size, sizeCalculation) => {
|
|
14958
|
-
if (this.#isBackgroundFetch(v)) {
|
|
14959
|
-
return 0;
|
|
14960
|
-
}
|
|
14961
|
-
if (!isPosInt(size)) {
|
|
14962
|
-
if (sizeCalculation) {
|
|
14963
|
-
if (typeof sizeCalculation !== "function") {
|
|
14964
|
-
throw new TypeError("sizeCalculation must be a function");
|
|
14965
|
-
}
|
|
14966
|
-
size = sizeCalculation(v, k);
|
|
14967
|
-
if (!isPosInt(size)) {
|
|
14968
|
-
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
14969
|
-
}
|
|
14970
|
-
} else {
|
|
14971
|
-
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
14972
|
-
}
|
|
14973
|
-
}
|
|
14974
|
-
return size;
|
|
14975
|
-
};
|
|
14976
|
-
this.#addItemSize = (index, size, status) => {
|
|
14977
|
-
sizes[index] = size;
|
|
14978
|
-
if (this.#maxSize) {
|
|
14979
|
-
const maxSize = this.#maxSize - sizes[index];
|
|
14980
|
-
while (this.#calculatedSize > maxSize) {
|
|
14981
|
-
this.#evict(true);
|
|
14982
|
-
}
|
|
14983
|
-
}
|
|
14984
|
-
this.#calculatedSize += sizes[index];
|
|
14985
|
-
if (status) {
|
|
14986
|
-
status.entrySize = size;
|
|
14987
|
-
status.totalCalculatedSize = this.#calculatedSize;
|
|
14988
|
-
}
|
|
14989
|
-
};
|
|
14990
|
-
}
|
|
14991
|
-
#removeItemSize = (_i) => {
|
|
14992
|
-
};
|
|
14993
|
-
#addItemSize = (_i, _s, _st) => {
|
|
14994
|
-
};
|
|
14995
|
-
#requireSize = (_k, _v, size, sizeCalculation) => {
|
|
14996
|
-
if (size || sizeCalculation) {
|
|
14997
|
-
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
14998
|
-
}
|
|
14999
|
-
return 0;
|
|
15000
|
-
};
|
|
15001
|
-
*#indexes({ allowStale = this.allowStale } = {}) {
|
|
15002
|
-
if (this.#size) {
|
|
15003
|
-
for (let i2 = this.#tail; true; ) {
|
|
15004
|
-
if (!this.#isValidIndex(i2)) {
|
|
15005
|
-
break;
|
|
15006
|
-
}
|
|
15007
|
-
if (allowStale || !this.#isStale(i2)) {
|
|
15008
|
-
yield i2;
|
|
15009
|
-
}
|
|
15010
|
-
if (i2 === this.#head) {
|
|
15011
|
-
break;
|
|
15012
|
-
} else {
|
|
15013
|
-
i2 = this.#prev[i2];
|
|
15014
|
-
}
|
|
15015
|
-
}
|
|
15016
|
-
}
|
|
15017
|
-
}
|
|
15018
|
-
*#rindexes({ allowStale = this.allowStale } = {}) {
|
|
15019
|
-
if (this.#size) {
|
|
15020
|
-
for (let i2 = this.#head; true; ) {
|
|
15021
|
-
if (!this.#isValidIndex(i2)) {
|
|
15022
|
-
break;
|
|
15023
|
-
}
|
|
15024
|
-
if (allowStale || !this.#isStale(i2)) {
|
|
15025
|
-
yield i2;
|
|
15026
|
-
}
|
|
15027
|
-
if (i2 === this.#tail) {
|
|
15028
|
-
break;
|
|
15029
|
-
} else {
|
|
15030
|
-
i2 = this.#next[i2];
|
|
15031
|
-
}
|
|
15032
|
-
}
|
|
15033
|
-
}
|
|
15034
|
-
}
|
|
15035
|
-
#isValidIndex(index) {
|
|
15036
|
-
return index !== void 0 && this.#keyMap.get(this.#keyList[index]) === index;
|
|
15037
|
-
}
|
|
15038
|
-
/**
|
|
15039
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
15040
|
-
* in order from most recently used to least recently used.
|
|
15041
|
-
*/
|
|
15042
|
-
*entries() {
|
|
15043
|
-
for (const i2 of this.#indexes()) {
|
|
15044
|
-
if (this.#valList[i2] !== void 0 && this.#keyList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15045
|
-
yield [this.#keyList[i2], this.#valList[i2]];
|
|
15046
|
-
}
|
|
15047
|
-
}
|
|
15048
|
-
}
|
|
15049
|
-
/**
|
|
15050
|
-
* Inverse order version of {@link LRUCache.entries}
|
|
15051
|
-
*
|
|
15052
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
15053
|
-
* in order from least recently used to most recently used.
|
|
15054
|
-
*/
|
|
15055
|
-
*rentries() {
|
|
15056
|
-
for (const i2 of this.#rindexes()) {
|
|
15057
|
-
if (this.#valList[i2] !== void 0 && this.#keyList[i2] !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15058
|
-
yield [this.#keyList[i2], this.#valList[i2]];
|
|
15059
|
-
}
|
|
15060
|
-
}
|
|
15061
|
-
}
|
|
15062
|
-
/**
|
|
15063
|
-
* Return a generator yielding the keys in the cache,
|
|
15064
|
-
* in order from most recently used to least recently used.
|
|
15065
|
-
*/
|
|
15066
|
-
*keys() {
|
|
15067
|
-
for (const i2 of this.#indexes()) {
|
|
15068
|
-
const k = this.#keyList[i2];
|
|
15069
|
-
if (k !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15070
|
-
yield k;
|
|
15071
|
-
}
|
|
15072
|
-
}
|
|
15073
|
-
}
|
|
15074
|
-
/**
|
|
15075
|
-
* Inverse order version of {@link LRUCache.keys}
|
|
15076
|
-
*
|
|
15077
|
-
* Return a generator yielding the keys in the cache,
|
|
15078
|
-
* in order from least recently used to most recently used.
|
|
15079
|
-
*/
|
|
15080
|
-
*rkeys() {
|
|
15081
|
-
for (const i2 of this.#rindexes()) {
|
|
15082
|
-
const k = this.#keyList[i2];
|
|
15083
|
-
if (k !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15084
|
-
yield k;
|
|
15085
|
-
}
|
|
15086
|
-
}
|
|
15087
|
-
}
|
|
15088
|
-
/**
|
|
15089
|
-
* Return a generator yielding the values in the cache,
|
|
15090
|
-
* in order from most recently used to least recently used.
|
|
15091
|
-
*/
|
|
15092
|
-
*values() {
|
|
15093
|
-
for (const i2 of this.#indexes()) {
|
|
15094
|
-
const v = this.#valList[i2];
|
|
15095
|
-
if (v !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15096
|
-
yield this.#valList[i2];
|
|
15097
|
-
}
|
|
15098
|
-
}
|
|
15099
|
-
}
|
|
15100
|
-
/**
|
|
15101
|
-
* Inverse order version of {@link LRUCache.values}
|
|
15102
|
-
*
|
|
15103
|
-
* Return a generator yielding the values in the cache,
|
|
15104
|
-
* in order from least recently used to most recently used.
|
|
15105
|
-
*/
|
|
15106
|
-
*rvalues() {
|
|
15107
|
-
for (const i2 of this.#rindexes()) {
|
|
15108
|
-
const v = this.#valList[i2];
|
|
15109
|
-
if (v !== void 0 && !this.#isBackgroundFetch(this.#valList[i2])) {
|
|
15110
|
-
yield this.#valList[i2];
|
|
15111
|
-
}
|
|
15112
|
-
}
|
|
15113
|
-
}
|
|
15114
|
-
/**
|
|
15115
|
-
* Iterating over the cache itself yields the same results as
|
|
15116
|
-
* {@link LRUCache.entries}
|
|
15117
|
-
*/
|
|
15118
|
-
[Symbol.iterator]() {
|
|
15119
|
-
return this.entries();
|
|
15120
|
-
}
|
|
15121
|
-
/**
|
|
15122
|
-
* A String value that is used in the creation of the default string
|
|
15123
|
-
* description of an object. Called by the built-in method
|
|
15124
|
-
* `Object.prototype.toString`.
|
|
15125
|
-
*/
|
|
15126
|
-
[Symbol.toStringTag] = "LRUCache";
|
|
15127
|
-
/**
|
|
15128
|
-
* Find a value for which the supplied fn method returns a truthy value,
|
|
15129
|
-
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
15130
|
-
*/
|
|
15131
|
-
find(fn, getOptions = {}) {
|
|
15132
|
-
for (const i2 of this.#indexes()) {
|
|
15133
|
-
const v = this.#valList[i2];
|
|
15134
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15135
|
-
if (value === void 0)
|
|
15136
|
-
continue;
|
|
15137
|
-
if (fn(value, this.#keyList[i2], this)) {
|
|
15138
|
-
return this.get(this.#keyList[i2], getOptions);
|
|
15139
|
-
}
|
|
15140
|
-
}
|
|
15141
|
-
}
|
|
15142
|
-
/**
|
|
15143
|
-
* Call the supplied function on each item in the cache, in order from most
|
|
15144
|
-
* recently used to least recently used.
|
|
15145
|
-
*
|
|
15146
|
-
* `fn` is called as `fn(value, key, cache)`.
|
|
15147
|
-
*
|
|
15148
|
-
* If `thisp` is provided, function will be called in the `this`-context of
|
|
15149
|
-
* the provided object, or the cache if no `thisp` object is provided.
|
|
15150
|
-
*
|
|
15151
|
-
* Does not update age or recenty of use, or iterate over stale values.
|
|
15152
|
-
*/
|
|
15153
|
-
forEach(fn, thisp = this) {
|
|
15154
|
-
for (const i2 of this.#indexes()) {
|
|
15155
|
-
const v = this.#valList[i2];
|
|
15156
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15157
|
-
if (value === void 0)
|
|
15158
|
-
continue;
|
|
15159
|
-
fn.call(thisp, value, this.#keyList[i2], this);
|
|
15160
|
-
}
|
|
15161
|
-
}
|
|
15162
|
-
/**
|
|
15163
|
-
* The same as {@link LRUCache.forEach} but items are iterated over in
|
|
15164
|
-
* reverse order. (ie, less recently used items are iterated over first.)
|
|
15165
|
-
*/
|
|
15166
|
-
rforEach(fn, thisp = this) {
|
|
15167
|
-
for (const i2 of this.#rindexes()) {
|
|
15168
|
-
const v = this.#valList[i2];
|
|
15169
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15170
|
-
if (value === void 0)
|
|
15171
|
-
continue;
|
|
15172
|
-
fn.call(thisp, value, this.#keyList[i2], this);
|
|
15173
|
-
}
|
|
15174
|
-
}
|
|
15175
|
-
/**
|
|
15176
|
-
* Delete any stale entries. Returns true if anything was removed,
|
|
15177
|
-
* false otherwise.
|
|
15178
|
-
*/
|
|
15179
|
-
purgeStale() {
|
|
15180
|
-
let deleted = false;
|
|
15181
|
-
for (const i2 of this.#rindexes({ allowStale: true })) {
|
|
15182
|
-
if (this.#isStale(i2)) {
|
|
15183
|
-
this.#delete(this.#keyList[i2], "expire");
|
|
15184
|
-
deleted = true;
|
|
15185
|
-
}
|
|
15186
|
-
}
|
|
15187
|
-
return deleted;
|
|
15188
|
-
}
|
|
15189
|
-
/**
|
|
15190
|
-
* Get the extended info about a given entry, to get its value, size, and
|
|
15191
|
-
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
15192
|
-
*
|
|
15193
|
-
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
15194
|
-
* serialization, the `start` value is always the current timestamp, and the
|
|
15195
|
-
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
15196
|
-
*
|
|
15197
|
-
* Always returns stale values, if their info is found in the cache, so be
|
|
15198
|
-
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
15199
|
-
* if relevant.
|
|
15200
|
-
*/
|
|
15201
|
-
info(key) {
|
|
15202
|
-
const i2 = this.#keyMap.get(key);
|
|
15203
|
-
if (i2 === void 0)
|
|
15204
|
-
return void 0;
|
|
15205
|
-
const v = this.#valList[i2];
|
|
15206
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15207
|
-
if (value === void 0)
|
|
15208
|
-
return void 0;
|
|
15209
|
-
const entry = { value };
|
|
15210
|
-
if (this.#ttls && this.#starts) {
|
|
15211
|
-
const ttl = this.#ttls[i2];
|
|
15212
|
-
const start = this.#starts[i2];
|
|
15213
|
-
if (ttl && start) {
|
|
15214
|
-
const remain = ttl - (this.#perf.now() - start);
|
|
15215
|
-
entry.ttl = remain;
|
|
15216
|
-
entry.start = Date.now();
|
|
15217
|
-
}
|
|
15218
|
-
}
|
|
15219
|
-
if (this.#sizes) {
|
|
15220
|
-
entry.size = this.#sizes[i2];
|
|
15221
|
-
}
|
|
15222
|
-
return entry;
|
|
15223
|
-
}
|
|
15224
|
-
/**
|
|
15225
|
-
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
15226
|
-
* passed to {@link LRUCache#load}.
|
|
15227
|
-
*
|
|
15228
|
-
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
15229
|
-
* timestamp, even if `performance.now()` is available.
|
|
15230
|
-
*
|
|
15231
|
-
* Stale entries are always included in the `dump`, even if
|
|
15232
|
-
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
15233
|
-
*
|
|
15234
|
-
* Note: this returns an actual array, not a generator, so it can be more
|
|
15235
|
-
* easily passed around.
|
|
15236
|
-
*/
|
|
15237
|
-
dump() {
|
|
15238
|
-
const arr = [];
|
|
15239
|
-
for (const i2 of this.#indexes({ allowStale: true })) {
|
|
15240
|
-
const key = this.#keyList[i2];
|
|
15241
|
-
const v = this.#valList[i2];
|
|
15242
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15243
|
-
if (value === void 0 || key === void 0)
|
|
15244
|
-
continue;
|
|
15245
|
-
const entry = { value };
|
|
15246
|
-
if (this.#ttls && this.#starts) {
|
|
15247
|
-
entry.ttl = this.#ttls[i2];
|
|
15248
|
-
const age = this.#perf.now() - this.#starts[i2];
|
|
15249
|
-
entry.start = Math.floor(Date.now() - age);
|
|
15250
|
-
}
|
|
15251
|
-
if (this.#sizes) {
|
|
15252
|
-
entry.size = this.#sizes[i2];
|
|
15253
|
-
}
|
|
15254
|
-
arr.unshift([key, entry]);
|
|
15255
|
-
}
|
|
15256
|
-
return arr;
|
|
15257
|
-
}
|
|
15258
|
-
/**
|
|
15259
|
-
* Reset the cache and load in the items in entries in the order listed.
|
|
15260
|
-
*
|
|
15261
|
-
* The shape of the resulting cache may be different if the same options are
|
|
15262
|
-
* not used in both caches.
|
|
15263
|
-
*
|
|
15264
|
-
* The `start` fields are assumed to be calculated relative to a portable
|
|
15265
|
-
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
15266
|
-
*/
|
|
15267
|
-
load(arr) {
|
|
15268
|
-
this.clear();
|
|
15269
|
-
for (const [key, entry] of arr) {
|
|
15270
|
-
if (entry.start) {
|
|
15271
|
-
const age = Date.now() - entry.start;
|
|
15272
|
-
entry.start = this.#perf.now() - age;
|
|
15273
|
-
}
|
|
15274
|
-
this.set(key, entry.value, entry);
|
|
15275
|
-
}
|
|
15276
|
-
}
|
|
15277
|
-
/**
|
|
15278
|
-
* Add a value to the cache.
|
|
15279
|
-
*
|
|
15280
|
-
* Note: if `undefined` is specified as a value, this is an alias for
|
|
15281
|
-
* {@link LRUCache#delete}
|
|
15282
|
-
*
|
|
15283
|
-
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
15284
|
-
* their corresponding values in the constructor options for the scope
|
|
15285
|
-
* of this single `set()` operation.
|
|
15286
|
-
*
|
|
15287
|
-
* If `start` is provided, then that will set the effective start
|
|
15288
|
-
* time for the TTL calculation. Note that this must be a previous
|
|
15289
|
-
* value of `performance.now()` if supported, or a previous value of
|
|
15290
|
-
* `Date.now()` if not.
|
|
15291
|
-
*
|
|
15292
|
-
* Options object may also include `size`, which will prevent
|
|
15293
|
-
* calling the `sizeCalculation` function and just use the specified
|
|
15294
|
-
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
15295
|
-
* will prevent calling a `dispose` function in the case of
|
|
15296
|
-
* overwrites.
|
|
15297
|
-
*
|
|
15298
|
-
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
15299
|
-
* entry is greater than `maxEntrySize`, then the item will not be
|
|
15300
|
-
* added to the cache.
|
|
15301
|
-
*
|
|
15302
|
-
* Will update the recency of the entry.
|
|
15303
|
-
*
|
|
15304
|
-
* If the value is `undefined`, then this is an alias for
|
|
15305
|
-
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
15306
|
-
*/
|
|
15307
|
-
set(k, v, setOptions = {}) {
|
|
15308
|
-
if (v === void 0) {
|
|
15309
|
-
this.delete(k);
|
|
15310
|
-
return this;
|
|
15311
|
-
}
|
|
15312
|
-
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
|
15313
|
-
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
15314
|
-
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
|
15315
|
-
if (this.maxEntrySize && size > this.maxEntrySize) {
|
|
15316
|
-
if (status) {
|
|
15317
|
-
status.set = "miss";
|
|
15318
|
-
status.maxEntrySizeExceeded = true;
|
|
15319
|
-
}
|
|
15320
|
-
this.#delete(k, "set");
|
|
15321
|
-
return this;
|
|
15322
|
-
}
|
|
15323
|
-
let index = this.#size === 0 ? void 0 : this.#keyMap.get(k);
|
|
15324
|
-
if (index === void 0) {
|
|
15325
|
-
index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
|
|
15326
|
-
this.#keyList[index] = k;
|
|
15327
|
-
this.#valList[index] = v;
|
|
15328
|
-
this.#keyMap.set(k, index);
|
|
15329
|
-
this.#next[this.#tail] = index;
|
|
15330
|
-
this.#prev[index] = this.#tail;
|
|
15331
|
-
this.#tail = index;
|
|
15332
|
-
this.#size++;
|
|
15333
|
-
this.#addItemSize(index, size, status);
|
|
15334
|
-
if (status)
|
|
15335
|
-
status.set = "add";
|
|
15336
|
-
noUpdateTTL = false;
|
|
15337
|
-
if (this.#hasOnInsert) {
|
|
15338
|
-
this.#onInsert?.(v, k, "add");
|
|
15339
|
-
}
|
|
15340
|
-
} else {
|
|
15341
|
-
this.#moveToTail(index);
|
|
15342
|
-
const oldVal = this.#valList[index];
|
|
15343
|
-
if (v !== oldVal) {
|
|
15344
|
-
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
|
15345
|
-
oldVal.__abortController.abort(new Error("replaced"));
|
|
15346
|
-
const { __staleWhileFetching: s } = oldVal;
|
|
15347
|
-
if (s !== void 0 && !noDisposeOnSet) {
|
|
15348
|
-
if (this.#hasDispose) {
|
|
15349
|
-
this.#dispose?.(s, k, "set");
|
|
15350
|
-
}
|
|
15351
|
-
if (this.#hasDisposeAfter) {
|
|
15352
|
-
this.#disposed?.push([s, k, "set"]);
|
|
15353
|
-
}
|
|
15354
|
-
}
|
|
15355
|
-
} else if (!noDisposeOnSet) {
|
|
15356
|
-
if (this.#hasDispose) {
|
|
15357
|
-
this.#dispose?.(oldVal, k, "set");
|
|
15358
|
-
}
|
|
15359
|
-
if (this.#hasDisposeAfter) {
|
|
15360
|
-
this.#disposed?.push([oldVal, k, "set"]);
|
|
15361
|
-
}
|
|
15362
|
-
}
|
|
15363
|
-
this.#removeItemSize(index);
|
|
15364
|
-
this.#addItemSize(index, size, status);
|
|
15365
|
-
this.#valList[index] = v;
|
|
15366
|
-
if (status) {
|
|
15367
|
-
status.set = "replace";
|
|
15368
|
-
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
15369
|
-
if (oldValue !== void 0)
|
|
15370
|
-
status.oldValue = oldValue;
|
|
15371
|
-
}
|
|
15372
|
-
} else if (status) {
|
|
15373
|
-
status.set = "update";
|
|
15374
|
-
}
|
|
15375
|
-
if (this.#hasOnInsert) {
|
|
15376
|
-
this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
|
|
15377
|
-
}
|
|
15378
|
-
}
|
|
15379
|
-
if (ttl !== 0 && !this.#ttls) {
|
|
15380
|
-
this.#initializeTTLTracking();
|
|
15381
|
-
}
|
|
15382
|
-
if (this.#ttls) {
|
|
15383
|
-
if (!noUpdateTTL) {
|
|
15384
|
-
this.#setItemTTL(index, ttl, start);
|
|
15385
|
-
}
|
|
15386
|
-
if (status)
|
|
15387
|
-
this.#statusTTL(status, index);
|
|
15388
|
-
}
|
|
15389
|
-
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
|
15390
|
-
const dt = this.#disposed;
|
|
15391
|
-
let task;
|
|
15392
|
-
while (task = dt?.shift()) {
|
|
15393
|
-
this.#disposeAfter?.(...task);
|
|
15394
|
-
}
|
|
15395
|
-
}
|
|
15396
|
-
return this;
|
|
15397
|
-
}
|
|
15398
|
-
/**
|
|
15399
|
-
* Evict the least recently used item, returning its value or
|
|
15400
|
-
* `undefined` if cache is empty.
|
|
15401
|
-
*/
|
|
15402
|
-
pop() {
|
|
15403
|
-
try {
|
|
15404
|
-
while (this.#size) {
|
|
15405
|
-
const val = this.#valList[this.#head];
|
|
15406
|
-
this.#evict(true);
|
|
15407
|
-
if (this.#isBackgroundFetch(val)) {
|
|
15408
|
-
if (val.__staleWhileFetching) {
|
|
15409
|
-
return val.__staleWhileFetching;
|
|
15410
|
-
}
|
|
15411
|
-
} else if (val !== void 0) {
|
|
15412
|
-
return val;
|
|
15413
|
-
}
|
|
15414
|
-
}
|
|
15415
|
-
} finally {
|
|
15416
|
-
if (this.#hasDisposeAfter && this.#disposed) {
|
|
15417
|
-
const dt = this.#disposed;
|
|
15418
|
-
let task;
|
|
15419
|
-
while (task = dt?.shift()) {
|
|
15420
|
-
this.#disposeAfter?.(...task);
|
|
15421
|
-
}
|
|
15422
|
-
}
|
|
15423
|
-
}
|
|
15424
|
-
}
|
|
15425
|
-
#evict(free) {
|
|
15426
|
-
const head2 = this.#head;
|
|
15427
|
-
const k = this.#keyList[head2];
|
|
15428
|
-
const v = this.#valList[head2];
|
|
15429
|
-
if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
|
|
15430
|
-
v.__abortController.abort(new Error("evicted"));
|
|
15431
|
-
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
15432
|
-
if (this.#hasDispose) {
|
|
15433
|
-
this.#dispose?.(v, k, "evict");
|
|
15434
|
-
}
|
|
15435
|
-
if (this.#hasDisposeAfter) {
|
|
15436
|
-
this.#disposed?.push([v, k, "evict"]);
|
|
15437
|
-
}
|
|
15438
|
-
}
|
|
15439
|
-
this.#removeItemSize(head2);
|
|
15440
|
-
if (free) {
|
|
15441
|
-
this.#keyList[head2] = void 0;
|
|
15442
|
-
this.#valList[head2] = void 0;
|
|
15443
|
-
this.#free.push(head2);
|
|
15444
|
-
}
|
|
15445
|
-
if (this.#size === 1) {
|
|
15446
|
-
this.#head = this.#tail = 0;
|
|
15447
|
-
this.#free.length = 0;
|
|
15448
|
-
} else {
|
|
15449
|
-
this.#head = this.#next[head2];
|
|
15450
|
-
}
|
|
15451
|
-
this.#keyMap.delete(k);
|
|
15452
|
-
this.#size--;
|
|
15453
|
-
return head2;
|
|
15454
|
-
}
|
|
15455
|
-
/**
|
|
15456
|
-
* Check if a key is in the cache, without updating the recency of use.
|
|
15457
|
-
* Will return false if the item is stale, even though it is technically
|
|
15458
|
-
* in the cache.
|
|
15459
|
-
*
|
|
15460
|
-
* Check if a key is in the cache, without updating the recency of
|
|
15461
|
-
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
15462
|
-
* to `true` in either the options or the constructor.
|
|
15463
|
-
*
|
|
15464
|
-
* Will return `false` if the item is stale, even though it is technically in
|
|
15465
|
-
* the cache. The difference can be determined (if it matters) by using a
|
|
15466
|
-
* `status` argument, and inspecting the `has` field.
|
|
15467
|
-
*
|
|
15468
|
-
* Will not update item age unless
|
|
15469
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
15470
|
-
*/
|
|
15471
|
-
has(k, hasOptions = {}) {
|
|
15472
|
-
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
|
15473
|
-
const index = this.#keyMap.get(k);
|
|
15474
|
-
if (index !== void 0) {
|
|
15475
|
-
const v = this.#valList[index];
|
|
15476
|
-
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === void 0) {
|
|
15477
|
-
return false;
|
|
15478
|
-
}
|
|
15479
|
-
if (!this.#isStale(index)) {
|
|
15480
|
-
if (updateAgeOnHas) {
|
|
15481
|
-
this.#updateItemAge(index);
|
|
15482
|
-
}
|
|
15483
|
-
if (status) {
|
|
15484
|
-
status.has = "hit";
|
|
15485
|
-
this.#statusTTL(status, index);
|
|
15486
|
-
}
|
|
15487
|
-
return true;
|
|
15488
|
-
} else if (status) {
|
|
15489
|
-
status.has = "stale";
|
|
15490
|
-
this.#statusTTL(status, index);
|
|
15491
|
-
}
|
|
15492
|
-
} else if (status) {
|
|
15493
|
-
status.has = "miss";
|
|
15494
|
-
}
|
|
15495
|
-
return false;
|
|
15496
|
-
}
|
|
15497
|
-
/**
|
|
15498
|
-
* Like {@link LRUCache#get} but doesn't update recency or delete stale
|
|
15499
|
-
* items.
|
|
15500
|
-
*
|
|
15501
|
-
* Returns `undefined` if the item is stale, unless
|
|
15502
|
-
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
15503
|
-
*/
|
|
15504
|
-
peek(k, peekOptions = {}) {
|
|
15505
|
-
const { allowStale = this.allowStale } = peekOptions;
|
|
15506
|
-
const index = this.#keyMap.get(k);
|
|
15507
|
-
if (index === void 0 || !allowStale && this.#isStale(index)) {
|
|
15508
|
-
return;
|
|
15509
|
-
}
|
|
15510
|
-
const v = this.#valList[index];
|
|
15511
|
-
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
15512
|
-
}
|
|
15513
|
-
#backgroundFetch(k, index, options, context) {
|
|
15514
|
-
const v = index === void 0 ? void 0 : this.#valList[index];
|
|
15515
|
-
if (this.#isBackgroundFetch(v)) {
|
|
15516
|
-
return v;
|
|
15517
|
-
}
|
|
15518
|
-
const ac = new AC();
|
|
15519
|
-
const { signal } = options;
|
|
15520
|
-
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
15521
|
-
signal: ac.signal
|
|
15522
|
-
});
|
|
15523
|
-
const fetchOpts = {
|
|
15524
|
-
signal: ac.signal,
|
|
15525
|
-
options,
|
|
15526
|
-
context
|
|
15527
|
-
};
|
|
15528
|
-
const cb = (v2, updateCache = false) => {
|
|
15529
|
-
const { aborted: aborted2 } = ac.signal;
|
|
15530
|
-
const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0;
|
|
15531
|
-
if (options.status) {
|
|
15532
|
-
if (aborted2 && !updateCache) {
|
|
15533
|
-
options.status.fetchAborted = true;
|
|
15534
|
-
options.status.fetchError = ac.signal.reason;
|
|
15535
|
-
if (ignoreAbort)
|
|
15536
|
-
options.status.fetchAbortIgnored = true;
|
|
15537
|
-
} else {
|
|
15538
|
-
options.status.fetchResolved = true;
|
|
15539
|
-
}
|
|
15540
|
-
}
|
|
15541
|
-
if (aborted2 && !ignoreAbort && !updateCache) {
|
|
15542
|
-
return fetchFail(ac.signal.reason);
|
|
15543
|
-
}
|
|
15544
|
-
const bf2 = p;
|
|
15545
|
-
const vl = this.#valList[index];
|
|
15546
|
-
if (vl === p || ignoreAbort && updateCache && vl === void 0) {
|
|
15547
|
-
if (v2 === void 0) {
|
|
15548
|
-
if (bf2.__staleWhileFetching !== void 0) {
|
|
15549
|
-
this.#valList[index] = bf2.__staleWhileFetching;
|
|
15550
|
-
} else {
|
|
15551
|
-
this.#delete(k, "fetch");
|
|
15552
|
-
}
|
|
15553
|
-
} else {
|
|
15554
|
-
if (options.status)
|
|
15555
|
-
options.status.fetchUpdated = true;
|
|
15556
|
-
this.set(k, v2, fetchOpts.options);
|
|
15557
|
-
}
|
|
15558
|
-
}
|
|
15559
|
-
return v2;
|
|
15560
|
-
};
|
|
15561
|
-
const eb = (er) => {
|
|
15562
|
-
if (options.status) {
|
|
15563
|
-
options.status.fetchRejected = true;
|
|
15564
|
-
options.status.fetchError = er;
|
|
15565
|
-
}
|
|
15566
|
-
return fetchFail(er);
|
|
15567
|
-
};
|
|
15568
|
-
const fetchFail = (er) => {
|
|
15569
|
-
const { aborted: aborted2 } = ac.signal;
|
|
15570
|
-
const allowStaleAborted = aborted2 && options.allowStaleOnFetchAbort;
|
|
15571
|
-
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
15572
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
15573
|
-
const bf2 = p;
|
|
15574
|
-
if (this.#valList[index] === p) {
|
|
15575
|
-
const del = !noDelete || bf2.__staleWhileFetching === void 0;
|
|
15576
|
-
if (del) {
|
|
15577
|
-
this.#delete(k, "fetch");
|
|
15578
|
-
} else if (!allowStaleAborted) {
|
|
15579
|
-
this.#valList[index] = bf2.__staleWhileFetching;
|
|
15580
|
-
}
|
|
15581
|
-
}
|
|
15582
|
-
if (allowStale) {
|
|
15583
|
-
if (options.status && bf2.__staleWhileFetching !== void 0) {
|
|
15584
|
-
options.status.returnedStale = true;
|
|
15585
|
-
}
|
|
15586
|
-
return bf2.__staleWhileFetching;
|
|
15587
|
-
} else if (bf2.__returned === bf2) {
|
|
15588
|
-
throw er;
|
|
15589
|
-
}
|
|
15590
|
-
};
|
|
15591
|
-
const pcall = (res, rej) => {
|
|
15592
|
-
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
15593
|
-
if (fmp && fmp instanceof Promise) {
|
|
15594
|
-
fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);
|
|
15595
|
-
}
|
|
15596
|
-
ac.signal.addEventListener("abort", () => {
|
|
15597
|
-
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
|
15598
|
-
res(void 0);
|
|
15599
|
-
if (options.allowStaleOnFetchAbort) {
|
|
15600
|
-
res = (v2) => cb(v2, true);
|
|
15601
|
-
}
|
|
15602
|
-
}
|
|
15603
|
-
});
|
|
15604
|
-
};
|
|
15605
|
-
if (options.status)
|
|
15606
|
-
options.status.fetchDispatched = true;
|
|
15607
|
-
const p = new Promise(pcall).then(cb, eb);
|
|
15608
|
-
const bf = Object.assign(p, {
|
|
15609
|
-
__abortController: ac,
|
|
15610
|
-
__staleWhileFetching: v,
|
|
15611
|
-
__returned: void 0
|
|
15612
|
-
});
|
|
15613
|
-
if (index === void 0) {
|
|
15614
|
-
this.set(k, bf, { ...fetchOpts.options, status: void 0 });
|
|
15615
|
-
index = this.#keyMap.get(k);
|
|
15616
|
-
} else {
|
|
15617
|
-
this.#valList[index] = bf;
|
|
15618
|
-
}
|
|
15619
|
-
return bf;
|
|
15620
|
-
}
|
|
15621
|
-
#isBackgroundFetch(p) {
|
|
15622
|
-
if (!this.#hasFetchMethod)
|
|
15623
|
-
return false;
|
|
15624
|
-
const b = p;
|
|
15625
|
-
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC;
|
|
15626
|
-
}
|
|
15627
|
-
async fetch(k, fetchOptions = {}) {
|
|
15628
|
-
const {
|
|
15629
|
-
// get options
|
|
15630
|
-
allowStale = this.allowStale,
|
|
15631
|
-
updateAgeOnGet = this.updateAgeOnGet,
|
|
15632
|
-
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
|
15633
|
-
// set options
|
|
15634
|
-
ttl = this.ttl,
|
|
15635
|
-
noDisposeOnSet = this.noDisposeOnSet,
|
|
15636
|
-
size = 0,
|
|
15637
|
-
sizeCalculation = this.sizeCalculation,
|
|
15638
|
-
noUpdateTTL = this.noUpdateTTL,
|
|
15639
|
-
// fetch exclusive options
|
|
15640
|
-
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
|
15641
|
-
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
15642
|
-
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
15643
|
-
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
15644
|
-
context,
|
|
15645
|
-
forceRefresh = false,
|
|
15646
|
-
status,
|
|
15647
|
-
signal
|
|
15648
|
-
} = fetchOptions;
|
|
15649
|
-
if (!this.#hasFetchMethod) {
|
|
15650
|
-
if (status)
|
|
15651
|
-
status.fetch = "get";
|
|
15652
|
-
return this.get(k, {
|
|
15653
|
-
allowStale,
|
|
15654
|
-
updateAgeOnGet,
|
|
15655
|
-
noDeleteOnStaleGet,
|
|
15656
|
-
status
|
|
15657
|
-
});
|
|
15658
|
-
}
|
|
15659
|
-
const options = {
|
|
15660
|
-
allowStale,
|
|
15661
|
-
updateAgeOnGet,
|
|
15662
|
-
noDeleteOnStaleGet,
|
|
15663
|
-
ttl,
|
|
15664
|
-
noDisposeOnSet,
|
|
15665
|
-
size,
|
|
15666
|
-
sizeCalculation,
|
|
15667
|
-
noUpdateTTL,
|
|
15668
|
-
noDeleteOnFetchRejection,
|
|
15669
|
-
allowStaleOnFetchRejection,
|
|
15670
|
-
allowStaleOnFetchAbort,
|
|
15671
|
-
ignoreFetchAbort,
|
|
15672
|
-
status,
|
|
15673
|
-
signal
|
|
15674
|
-
};
|
|
15675
|
-
let index = this.#keyMap.get(k);
|
|
15676
|
-
if (index === void 0) {
|
|
15677
|
-
if (status)
|
|
15678
|
-
status.fetch = "miss";
|
|
15679
|
-
const p = this.#backgroundFetch(k, index, options, context);
|
|
15680
|
-
return p.__returned = p;
|
|
15681
|
-
} else {
|
|
15682
|
-
const v = this.#valList[index];
|
|
15683
|
-
if (this.#isBackgroundFetch(v)) {
|
|
15684
|
-
const stale = allowStale && v.__staleWhileFetching !== void 0;
|
|
15685
|
-
if (status) {
|
|
15686
|
-
status.fetch = "inflight";
|
|
15687
|
-
if (stale)
|
|
15688
|
-
status.returnedStale = true;
|
|
15689
|
-
}
|
|
15690
|
-
return stale ? v.__staleWhileFetching : v.__returned = v;
|
|
15691
|
-
}
|
|
15692
|
-
const isStale = this.#isStale(index);
|
|
15693
|
-
if (!forceRefresh && !isStale) {
|
|
15694
|
-
if (status)
|
|
15695
|
-
status.fetch = "hit";
|
|
15696
|
-
this.#moveToTail(index);
|
|
15697
|
-
if (updateAgeOnGet) {
|
|
15698
|
-
this.#updateItemAge(index);
|
|
15699
|
-
}
|
|
15700
|
-
if (status)
|
|
15701
|
-
this.#statusTTL(status, index);
|
|
15702
|
-
return v;
|
|
15703
|
-
}
|
|
15704
|
-
const p = this.#backgroundFetch(k, index, options, context);
|
|
15705
|
-
const hasStale = p.__staleWhileFetching !== void 0;
|
|
15706
|
-
const staleVal = hasStale && allowStale;
|
|
15707
|
-
if (status) {
|
|
15708
|
-
status.fetch = isStale ? "stale" : "refresh";
|
|
15709
|
-
if (staleVal && isStale)
|
|
15710
|
-
status.returnedStale = true;
|
|
15711
|
-
}
|
|
15712
|
-
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
|
15713
|
-
}
|
|
15714
|
-
}
|
|
15715
|
-
async forceFetch(k, fetchOptions = {}) {
|
|
15716
|
-
const v = await this.fetch(k, fetchOptions);
|
|
15717
|
-
if (v === void 0)
|
|
15718
|
-
throw new Error("fetch() returned undefined");
|
|
15719
|
-
return v;
|
|
15720
|
-
}
|
|
15721
|
-
memo(k, memoOptions = {}) {
|
|
15722
|
-
const memoMethod = this.#memoMethod;
|
|
15723
|
-
if (!memoMethod) {
|
|
15724
|
-
throw new Error("no memoMethod provided to constructor");
|
|
15725
|
-
}
|
|
15726
|
-
const { context, forceRefresh, ...options } = memoOptions;
|
|
15727
|
-
const v = this.get(k, options);
|
|
15728
|
-
if (!forceRefresh && v !== void 0)
|
|
15729
|
-
return v;
|
|
15730
|
-
const vv = memoMethod(k, v, {
|
|
15731
|
-
options,
|
|
15732
|
-
context
|
|
15733
|
-
});
|
|
15734
|
-
this.set(k, vv, options);
|
|
15735
|
-
return vv;
|
|
15736
|
-
}
|
|
15737
|
-
/**
|
|
15738
|
-
* Return a value from the cache. Will update the recency of the cache
|
|
15739
|
-
* entry found.
|
|
15740
|
-
*
|
|
15741
|
-
* If the key is not found, get() will return `undefined`.
|
|
15742
|
-
*/
|
|
15743
|
-
get(k, getOptions = {}) {
|
|
15744
|
-
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
|
15745
|
-
const index = this.#keyMap.get(k);
|
|
15746
|
-
if (index !== void 0) {
|
|
15747
|
-
const value = this.#valList[index];
|
|
15748
|
-
const fetching = this.#isBackgroundFetch(value);
|
|
15749
|
-
if (status)
|
|
15750
|
-
this.#statusTTL(status, index);
|
|
15751
|
-
if (this.#isStale(index)) {
|
|
15752
|
-
if (status)
|
|
15753
|
-
status.get = "stale";
|
|
15754
|
-
if (!fetching) {
|
|
15755
|
-
if (!noDeleteOnStaleGet) {
|
|
15756
|
-
this.#delete(k, "expire");
|
|
15757
|
-
}
|
|
15758
|
-
if (status && allowStale)
|
|
15759
|
-
status.returnedStale = true;
|
|
15760
|
-
return allowStale ? value : void 0;
|
|
15761
|
-
} else {
|
|
15762
|
-
if (status && allowStale && value.__staleWhileFetching !== void 0) {
|
|
15763
|
-
status.returnedStale = true;
|
|
15764
|
-
}
|
|
15765
|
-
return allowStale ? value.__staleWhileFetching : void 0;
|
|
15766
|
-
}
|
|
15767
|
-
} else {
|
|
15768
|
-
if (status)
|
|
15769
|
-
status.get = "hit";
|
|
15770
|
-
if (fetching) {
|
|
15771
|
-
return value.__staleWhileFetching;
|
|
15772
|
-
}
|
|
15773
|
-
this.#moveToTail(index);
|
|
15774
|
-
if (updateAgeOnGet) {
|
|
15775
|
-
this.#updateItemAge(index);
|
|
15776
|
-
}
|
|
15777
|
-
return value;
|
|
15778
|
-
}
|
|
15779
|
-
} else if (status) {
|
|
15780
|
-
status.get = "miss";
|
|
15781
|
-
}
|
|
15782
|
-
}
|
|
15783
|
-
#connect(p, n2) {
|
|
15784
|
-
this.#prev[n2] = p;
|
|
15785
|
-
this.#next[p] = n2;
|
|
15786
|
-
}
|
|
15787
|
-
#moveToTail(index) {
|
|
15788
|
-
if (index !== this.#tail) {
|
|
15789
|
-
if (index === this.#head) {
|
|
15790
|
-
this.#head = this.#next[index];
|
|
15791
|
-
} else {
|
|
15792
|
-
this.#connect(this.#prev[index], this.#next[index]);
|
|
15793
|
-
}
|
|
15794
|
-
this.#connect(this.#tail, index);
|
|
15795
|
-
this.#tail = index;
|
|
15796
|
-
}
|
|
15797
|
-
}
|
|
15798
|
-
/**
|
|
15799
|
-
* Deletes a key out of the cache.
|
|
15800
|
-
*
|
|
15801
|
-
* Returns true if the key was deleted, false otherwise.
|
|
15802
|
-
*/
|
|
15803
|
-
delete(k) {
|
|
15804
|
-
return this.#delete(k, "delete");
|
|
15805
|
-
}
|
|
15806
|
-
#delete(k, reason) {
|
|
15807
|
-
let deleted = false;
|
|
15808
|
-
if (this.#size !== 0) {
|
|
15809
|
-
const index = this.#keyMap.get(k);
|
|
15810
|
-
if (index !== void 0) {
|
|
15811
|
-
deleted = true;
|
|
15812
|
-
if (this.#size === 1) {
|
|
15813
|
-
this.#clear(reason);
|
|
15814
|
-
} else {
|
|
15815
|
-
this.#removeItemSize(index);
|
|
15816
|
-
const v = this.#valList[index];
|
|
15817
|
-
if (this.#isBackgroundFetch(v)) {
|
|
15818
|
-
v.__abortController.abort(new Error("deleted"));
|
|
15819
|
-
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
15820
|
-
if (this.#hasDispose) {
|
|
15821
|
-
this.#dispose?.(v, k, reason);
|
|
15822
|
-
}
|
|
15823
|
-
if (this.#hasDisposeAfter) {
|
|
15824
|
-
this.#disposed?.push([v, k, reason]);
|
|
15825
|
-
}
|
|
15826
|
-
}
|
|
15827
|
-
this.#keyMap.delete(k);
|
|
15828
|
-
this.#keyList[index] = void 0;
|
|
15829
|
-
this.#valList[index] = void 0;
|
|
15830
|
-
if (index === this.#tail) {
|
|
15831
|
-
this.#tail = this.#prev[index];
|
|
15832
|
-
} else if (index === this.#head) {
|
|
15833
|
-
this.#head = this.#next[index];
|
|
15834
|
-
} else {
|
|
15835
|
-
const pi = this.#prev[index];
|
|
15836
|
-
this.#next[pi] = this.#next[index];
|
|
15837
|
-
const ni = this.#next[index];
|
|
15838
|
-
this.#prev[ni] = this.#prev[index];
|
|
15839
|
-
}
|
|
15840
|
-
this.#size--;
|
|
15841
|
-
this.#free.push(index);
|
|
15842
|
-
}
|
|
15843
|
-
}
|
|
15844
|
-
}
|
|
15845
|
-
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
|
15846
|
-
const dt = this.#disposed;
|
|
15847
|
-
let task;
|
|
15848
|
-
while (task = dt?.shift()) {
|
|
15849
|
-
this.#disposeAfter?.(...task);
|
|
15850
|
-
}
|
|
15851
|
-
}
|
|
15852
|
-
return deleted;
|
|
15853
|
-
}
|
|
15854
|
-
/**
|
|
15855
|
-
* Clear the cache entirely, throwing away all values.
|
|
15856
|
-
*/
|
|
15857
|
-
clear() {
|
|
15858
|
-
return this.#clear("delete");
|
|
15859
|
-
}
|
|
15860
|
-
#clear(reason) {
|
|
15861
|
-
for (const index of this.#rindexes({ allowStale: true })) {
|
|
15862
|
-
const v = this.#valList[index];
|
|
15863
|
-
if (this.#isBackgroundFetch(v)) {
|
|
15864
|
-
v.__abortController.abort(new Error("deleted"));
|
|
15865
|
-
} else {
|
|
15866
|
-
const k = this.#keyList[index];
|
|
15867
|
-
if (this.#hasDispose) {
|
|
15868
|
-
this.#dispose?.(v, k, reason);
|
|
15869
|
-
}
|
|
15870
|
-
if (this.#hasDisposeAfter) {
|
|
15871
|
-
this.#disposed?.push([v, k, reason]);
|
|
15872
|
-
}
|
|
15873
|
-
}
|
|
15874
|
-
}
|
|
15875
|
-
this.#keyMap.clear();
|
|
15876
|
-
this.#valList.fill(void 0);
|
|
15877
|
-
this.#keyList.fill(void 0);
|
|
15878
|
-
if (this.#ttls && this.#starts) {
|
|
15879
|
-
this.#ttls.fill(0);
|
|
15880
|
-
this.#starts.fill(0);
|
|
15881
|
-
}
|
|
15882
|
-
if (this.#sizes) {
|
|
15883
|
-
this.#sizes.fill(0);
|
|
15884
|
-
}
|
|
15885
|
-
this.#head = 0;
|
|
15886
|
-
this.#tail = 0;
|
|
15887
|
-
this.#free.length = 0;
|
|
15888
|
-
this.#calculatedSize = 0;
|
|
15889
|
-
this.#size = 0;
|
|
15890
|
-
if (this.#hasDisposeAfter && this.#disposed) {
|
|
15891
|
-
const dt = this.#disposed;
|
|
15892
|
-
let task;
|
|
15893
|
-
while (task = dt?.shift()) {
|
|
15894
|
-
this.#disposeAfter?.(...task);
|
|
15895
|
-
}
|
|
15896
|
-
}
|
|
15897
|
-
}
|
|
15898
|
-
};
|
|
15899
|
-
exports.LRUCache = LRUCache;
|
|
15900
|
-
}
|
|
15901
|
-
});
|
|
15902
|
-
|
|
15903
|
-
// node_modules/read-package-up/node_modules/hosted-git-info/lib/hosts.js
|
|
15904
|
-
var require_hosts2 = __commonJS({
|
|
15905
|
-
"node_modules/read-package-up/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
15906
|
-
"use strict";
|
|
15907
|
-
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
15908
|
-
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
15909
|
-
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-");
|
|
15910
|
-
var defaults2 = {
|
|
15911
|
-
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
15912
|
-
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
15913
|
-
edittemplate: ({ domain, user, project, committish, editpath, path: path24 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path24)}`,
|
|
15914
|
-
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
15915
|
-
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path24, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path24}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
15916
|
-
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path24, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path24}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
15917
|
-
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
15918
|
-
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
15919
|
-
filetemplate: ({ domain, user, project, committish, path: path24 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path24}`,
|
|
15920
|
-
shortcuttemplate: ({ type: type2, user, project, committish }) => `${type2}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
15921
|
-
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
15922
|
-
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
15923
|
-
hashformat: formatHashFragment
|
|
15924
|
-
};
|
|
15925
|
-
var hosts = {};
|
|
15926
|
-
hosts.github = {
|
|
15927
|
-
// First two are insecure and generally shouldn't be used any more, but
|
|
15928
|
-
// they are still supported.
|
|
15929
|
-
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
15930
|
-
domain: "github.com",
|
|
15931
|
-
treepath: "tree",
|
|
15932
|
-
blobpath: "blob",
|
|
15933
|
-
editpath: "edit",
|
|
15934
|
-
filetemplate: ({ auth, user, project, committish, path: path24 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path24}`,
|
|
15935
|
-
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
15936
|
-
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
15937
|
-
extract: (url) => {
|
|
15938
|
-
let [, user, project, type2, committish] = url.pathname.split("/", 5);
|
|
15939
|
-
if (type2 && type2 !== "tree") {
|
|
15940
|
-
return;
|
|
15941
|
-
}
|
|
15942
|
-
if (!type2) {
|
|
15943
|
-
committish = url.hash.slice(1);
|
|
15944
|
-
}
|
|
15945
|
-
if (project && project.endsWith(".git")) {
|
|
15946
|
-
project = project.slice(0, -4);
|
|
15947
|
-
}
|
|
15948
|
-
if (!user || !project) {
|
|
15949
|
-
return;
|
|
15950
|
-
}
|
|
15951
|
-
return { user, project, committish };
|
|
15952
|
-
}
|
|
15953
|
-
};
|
|
15954
|
-
hosts.bitbucket = {
|
|
15955
|
-
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
15956
|
-
domain: "bitbucket.org",
|
|
15957
|
-
treepath: "src",
|
|
15958
|
-
blobpath: "src",
|
|
15959
|
-
editpath: "?mode=edit",
|
|
15960
|
-
edittemplate: ({ domain, user, project, committish, treepath, path: path24, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path24, editpath)}`,
|
|
15961
|
-
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
15962
|
-
extract: (url) => {
|
|
15963
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
15964
|
-
if (["get"].includes(aux)) {
|
|
15965
|
-
return;
|
|
15966
|
-
}
|
|
15967
|
-
if (project && project.endsWith(".git")) {
|
|
15968
|
-
project = project.slice(0, -4);
|
|
15969
|
-
}
|
|
15970
|
-
if (!user || !project) {
|
|
15971
|
-
return;
|
|
15972
|
-
}
|
|
15973
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
15974
|
-
}
|
|
15975
|
-
};
|
|
15976
|
-
hosts.gitlab = {
|
|
15977
|
-
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
15978
|
-
domain: "gitlab.com",
|
|
15979
|
-
treepath: "tree",
|
|
15980
|
-
blobpath: "tree",
|
|
15981
|
-
editpath: "-/edit",
|
|
15982
|
-
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
|
|
15983
|
-
extract: (url) => {
|
|
15984
|
-
const path24 = url.pathname.slice(1);
|
|
15985
|
-
if (path24.includes("/-/") || path24.includes("/archive.tar.gz")) {
|
|
15986
|
-
return;
|
|
15987
|
-
}
|
|
15988
|
-
const segments = path24.split("/");
|
|
15989
|
-
let project = segments.pop();
|
|
15990
|
-
if (project.endsWith(".git")) {
|
|
15991
|
-
project = project.slice(0, -4);
|
|
15992
|
-
}
|
|
15993
|
-
const user = segments.join("/");
|
|
15994
|
-
if (!user || !project) {
|
|
15995
|
-
return;
|
|
15996
|
-
}
|
|
15997
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
15998
|
-
}
|
|
15999
|
-
};
|
|
16000
|
-
hosts.gist = {
|
|
16001
|
-
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
16002
|
-
domain: "gist.github.com",
|
|
16003
|
-
editpath: "edit",
|
|
16004
|
-
sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`,
|
|
16005
|
-
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
16006
|
-
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
16007
|
-
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
16008
|
-
browsetreetemplate: ({ domain, project, committish, path: path24, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path24))}`,
|
|
16009
|
-
browseblobtemplate: ({ domain, project, committish, path: path24, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path24))}`,
|
|
16010
|
-
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
16011
|
-
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
16012
|
-
filetemplate: ({ user, project, committish, path: path24 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path24}`,
|
|
16013
|
-
shortcuttemplate: ({ type: type2, project, committish }) => `${type2}:${project}${maybeJoin("#", committish)}`,
|
|
16014
|
-
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
16015
|
-
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
16016
|
-
gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
16017
|
-
tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
16018
|
-
extract: (url) => {
|
|
16019
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
16020
|
-
if (aux === "raw") {
|
|
16021
|
-
return;
|
|
16022
|
-
}
|
|
16023
|
-
if (!project) {
|
|
16024
|
-
if (!user) {
|
|
16025
|
-
return;
|
|
16026
|
-
}
|
|
16027
|
-
project = user;
|
|
16028
|
-
user = null;
|
|
16029
|
-
}
|
|
16030
|
-
if (project.endsWith(".git")) {
|
|
16031
|
-
project = project.slice(0, -4);
|
|
16032
|
-
}
|
|
16033
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
16034
|
-
},
|
|
16035
|
-
hashformat: function(fragment) {
|
|
16036
|
-
return fragment && "file-" + formatHashFragment(fragment);
|
|
16037
|
-
}
|
|
16038
|
-
};
|
|
16039
|
-
hosts.sourcehut = {
|
|
16040
|
-
protocols: ["git+ssh:", "https:"],
|
|
16041
|
-
domain: "git.sr.ht",
|
|
16042
|
-
treepath: "tree",
|
|
16043
|
-
blobpath: "tree",
|
|
16044
|
-
filetemplate: ({ domain, user, project, committish, path: path24 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path24}`,
|
|
16045
|
-
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
16046
|
-
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
16047
|
-
bugstemplate: () => null,
|
|
16048
|
-
extract: (url) => {
|
|
16049
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
16050
|
-
if (["archive"].includes(aux)) {
|
|
16051
|
-
return;
|
|
16052
|
-
}
|
|
16053
|
-
if (project && project.endsWith(".git")) {
|
|
16054
|
-
project = project.slice(0, -4);
|
|
16055
|
-
}
|
|
16056
|
-
if (!user || !project) {
|
|
16057
|
-
return;
|
|
16058
|
-
}
|
|
16059
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
16060
|
-
}
|
|
16061
|
-
};
|
|
16062
|
-
for (const [name, host] of Object.entries(hosts)) {
|
|
16063
|
-
hosts[name] = Object.assign({}, defaults2, host);
|
|
16064
|
-
}
|
|
16065
|
-
module.exports = hosts;
|
|
16066
|
-
}
|
|
16067
|
-
});
|
|
16068
|
-
|
|
16069
|
-
// node_modules/read-package-up/node_modules/hosted-git-info/lib/parse-url.js
|
|
16070
|
-
var require_parse_url2 = __commonJS({
|
|
16071
|
-
"node_modules/read-package-up/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
16072
|
-
var url = __require("url");
|
|
16073
|
-
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
16074
|
-
const startPosition = str2.indexOf(beforeChar);
|
|
16075
|
-
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
16076
|
-
};
|
|
16077
|
-
var safeUrl = (u2) => {
|
|
16078
|
-
try {
|
|
16079
|
-
return new url.URL(u2);
|
|
16080
|
-
} catch {
|
|
16081
|
-
}
|
|
16082
|
-
};
|
|
16083
|
-
var correctProtocol = (arg, protocols) => {
|
|
16084
|
-
const firstColon = arg.indexOf(":");
|
|
16085
|
-
const proto = arg.slice(0, firstColon + 1);
|
|
16086
|
-
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
16087
|
-
return arg;
|
|
16088
|
-
}
|
|
16089
|
-
if (arg.substr(firstColon, 3) === "://") {
|
|
16090
|
-
return arg;
|
|
16091
|
-
}
|
|
16092
|
-
const firstAt = arg.indexOf("@");
|
|
16093
|
-
if (firstAt > -1) {
|
|
16094
|
-
if (firstAt > firstColon) {
|
|
16095
|
-
return `git+ssh://${arg}`;
|
|
16096
|
-
} else {
|
|
16097
|
-
return arg;
|
|
16098
|
-
}
|
|
16099
|
-
}
|
|
16100
|
-
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
16101
|
-
};
|
|
16102
|
-
var correctUrl = (giturl) => {
|
|
16103
|
-
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
16104
|
-
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
16105
|
-
if (lastColonBeforeHash > firstAt) {
|
|
16106
|
-
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
16107
|
-
}
|
|
16108
|
-
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
16109
|
-
giturl = `git+ssh://${giturl}`;
|
|
16110
|
-
}
|
|
16111
|
-
return giturl;
|
|
16112
|
-
};
|
|
16113
|
-
module.exports = (giturl, protocols) => {
|
|
16114
|
-
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
16115
|
-
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
16116
|
-
};
|
|
16117
|
-
}
|
|
16118
|
-
});
|
|
16119
|
-
|
|
16120
|
-
// node_modules/read-package-up/node_modules/hosted-git-info/lib/from-url.js
|
|
16121
|
-
var require_from_url2 = __commonJS({
|
|
16122
|
-
"node_modules/read-package-up/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
16123
|
-
"use strict";
|
|
16124
|
-
var parseUrl = require_parse_url2();
|
|
16125
|
-
var isGitHubShorthand = (arg) => {
|
|
16126
|
-
const firstHash = arg.indexOf("#");
|
|
16127
|
-
const firstSlash = arg.indexOf("/");
|
|
16128
|
-
const secondSlash = arg.indexOf("/", firstSlash + 1);
|
|
16129
|
-
const firstColon = arg.indexOf(":");
|
|
16130
|
-
const firstSpace = /\s/.exec(arg);
|
|
16131
|
-
const firstAt = arg.indexOf("@");
|
|
16132
|
-
const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash;
|
|
16133
|
-
const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash;
|
|
16134
|
-
const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash;
|
|
16135
|
-
const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash;
|
|
16136
|
-
const hasSlash = firstSlash > 0;
|
|
16137
|
-
const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/");
|
|
16138
|
-
const doesNotStartWithDot = !arg.startsWith(".");
|
|
16139
|
-
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
|
|
16140
|
-
};
|
|
16141
|
-
module.exports = (giturl, opts, { gitHosts, protocols }) => {
|
|
16142
|
-
if (!giturl) {
|
|
16143
|
-
return;
|
|
16144
|
-
}
|
|
16145
|
-
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
|
|
16146
|
-
const parsed = parseUrl(correctedUrl, protocols);
|
|
16147
|
-
if (!parsed) {
|
|
16148
|
-
return;
|
|
16149
|
-
}
|
|
16150
|
-
const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
|
|
16151
|
-
const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
|
|
16152
|
-
const gitHostName = gitHostShortcut || gitHostDomain;
|
|
16153
|
-
if (!gitHostName) {
|
|
16154
|
-
return;
|
|
16155
|
-
}
|
|
16156
|
-
const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain];
|
|
16157
|
-
let auth = null;
|
|
16158
|
-
if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) {
|
|
16159
|
-
auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`;
|
|
16160
|
-
}
|
|
16161
|
-
let committish = null;
|
|
16162
|
-
let user = null;
|
|
16163
|
-
let project = null;
|
|
16164
|
-
let defaultRepresentation = null;
|
|
16165
|
-
try {
|
|
16166
|
-
if (gitHostShortcut) {
|
|
16167
|
-
let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname;
|
|
16168
|
-
const firstAt = pathname.indexOf("@");
|
|
16169
|
-
if (firstAt > -1) {
|
|
16170
|
-
pathname = pathname.slice(firstAt + 1);
|
|
16171
|
-
}
|
|
16172
|
-
const lastSlash = pathname.lastIndexOf("/");
|
|
16173
|
-
if (lastSlash > -1) {
|
|
16174
|
-
user = decodeURIComponent(pathname.slice(0, lastSlash));
|
|
16175
|
-
if (!user) {
|
|
16176
|
-
user = null;
|
|
16177
|
-
}
|
|
16178
|
-
project = decodeURIComponent(pathname.slice(lastSlash + 1));
|
|
16179
|
-
} else {
|
|
16180
|
-
project = decodeURIComponent(pathname);
|
|
16181
|
-
}
|
|
16182
|
-
if (project.endsWith(".git")) {
|
|
16183
|
-
project = project.slice(0, -4);
|
|
16184
|
-
}
|
|
16185
|
-
if (parsed.hash) {
|
|
16186
|
-
committish = decodeURIComponent(parsed.hash.slice(1));
|
|
16187
|
-
}
|
|
16188
|
-
defaultRepresentation = "shortcut";
|
|
16189
|
-
} else {
|
|
16190
|
-
if (!gitHostInfo.protocols.includes(parsed.protocol)) {
|
|
16191
|
-
return;
|
|
16192
|
-
}
|
|
16193
|
-
const segments = gitHostInfo.extract(parsed);
|
|
16194
|
-
if (!segments) {
|
|
16195
|
-
return;
|
|
16196
|
-
}
|
|
16197
|
-
user = segments.user && decodeURIComponent(segments.user);
|
|
16198
|
-
project = decodeURIComponent(segments.project);
|
|
16199
|
-
committish = decodeURIComponent(segments.committish);
|
|
16200
|
-
defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1);
|
|
16201
|
-
}
|
|
16202
|
-
} catch (err) {
|
|
16203
|
-
if (err instanceof URIError) {
|
|
16204
|
-
return;
|
|
16205
|
-
} else {
|
|
16206
|
-
throw err;
|
|
16207
|
-
}
|
|
16208
|
-
}
|
|
16209
|
-
return [gitHostName, user, auth, project, committish, defaultRepresentation, opts];
|
|
16210
|
-
};
|
|
16211
|
-
}
|
|
16212
|
-
});
|
|
16213
|
-
|
|
16214
|
-
// node_modules/read-package-up/node_modules/hosted-git-info/lib/index.js
|
|
16215
|
-
var require_lib6 = __commonJS({
|
|
16216
|
-
"node_modules/read-package-up/node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
16217
|
-
"use strict";
|
|
16218
|
-
var { LRUCache } = require_commonjs2();
|
|
16219
|
-
var hosts = require_hosts2();
|
|
16220
|
-
var fromUrl = require_from_url2();
|
|
16221
|
-
var parseUrl = require_parse_url2();
|
|
16222
|
-
var cache2 = new LRUCache({ max: 1e3 });
|
|
16223
|
-
function unknownHostedUrl(url) {
|
|
16224
|
-
try {
|
|
16225
|
-
const {
|
|
16226
|
-
protocol,
|
|
16227
|
-
hostname,
|
|
16228
|
-
pathname
|
|
16229
|
-
} = new URL(url);
|
|
16230
|
-
if (!hostname) {
|
|
16231
|
-
return null;
|
|
16232
|
-
}
|
|
16233
|
-
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
16234
|
-
const path24 = pathname.replace(/\.git$/, "");
|
|
16235
|
-
return `${proto}//${hostname}${path24}`;
|
|
16236
|
-
} catch {
|
|
16237
|
-
return null;
|
|
16238
|
-
}
|
|
16239
|
-
}
|
|
16240
|
-
var GitHost = class _GitHost {
|
|
16241
|
-
constructor(type2, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
16242
|
-
Object.assign(this, _GitHost.#gitHosts[type2], {
|
|
16243
|
-
type: type2,
|
|
16244
|
-
user,
|
|
16245
|
-
auth,
|
|
16246
|
-
project,
|
|
16247
|
-
committish,
|
|
16248
|
-
default: defaultRepresentation,
|
|
16249
|
-
opts
|
|
16250
|
-
});
|
|
16251
|
-
}
|
|
16252
|
-
static #gitHosts = { byShortcut: {}, byDomain: {} };
|
|
16253
|
-
static #protocols = {
|
|
16254
|
-
"git+ssh:": { name: "sshurl" },
|
|
16255
|
-
"ssh:": { name: "sshurl" },
|
|
16256
|
-
"git+https:": { name: "https", auth: true },
|
|
16257
|
-
"git:": { auth: true },
|
|
16258
|
-
"http:": { auth: true },
|
|
16259
|
-
"https:": { auth: true },
|
|
16260
|
-
"git+http:": { auth: true }
|
|
16261
|
-
};
|
|
16262
|
-
static addHost(name, host) {
|
|
16263
|
-
_GitHost.#gitHosts[name] = host;
|
|
16264
|
-
_GitHost.#gitHosts.byDomain[host.domain] = name;
|
|
16265
|
-
_GitHost.#gitHosts.byShortcut[`${name}:`] = name;
|
|
16266
|
-
_GitHost.#protocols[`${name}:`] = { name };
|
|
16267
|
-
}
|
|
16268
|
-
static fromUrl(giturl, opts) {
|
|
16269
|
-
if (typeof giturl !== "string") {
|
|
16270
|
-
return;
|
|
16271
|
-
}
|
|
16272
|
-
const key = giturl + JSON.stringify(opts || {});
|
|
16273
|
-
if (!cache2.has(key)) {
|
|
16274
|
-
const hostArgs = fromUrl(giturl, opts, {
|
|
16275
|
-
gitHosts: _GitHost.#gitHosts,
|
|
16276
|
-
protocols: _GitHost.#protocols
|
|
16277
|
-
});
|
|
16278
|
-
cache2.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
16279
|
-
}
|
|
16280
|
-
return cache2.get(key);
|
|
16281
|
-
}
|
|
16282
|
-
static fromManifest(manifest, opts = {}) {
|
|
16283
|
-
if (!manifest || typeof manifest !== "object") {
|
|
16284
|
-
return;
|
|
16285
|
-
}
|
|
16286
|
-
const r = manifest.repository;
|
|
16287
|
-
const rurl = r && (typeof r === "string" ? r : typeof r === "object" && typeof r.url === "string" ? r.url : null);
|
|
16288
|
-
if (!rurl) {
|
|
16289
|
-
throw new Error("no repository");
|
|
16290
|
-
}
|
|
16291
|
-
const info = rurl && _GitHost.fromUrl(rurl.replace(/^git\+/, ""), opts) || null;
|
|
16292
|
-
if (info) {
|
|
16293
|
-
return info;
|
|
16294
|
-
}
|
|
16295
|
-
const unk = unknownHostedUrl(rurl);
|
|
16296
|
-
return _GitHost.fromUrl(unk, opts) || unk;
|
|
16297
|
-
}
|
|
16298
|
-
static parseUrl(url) {
|
|
16299
|
-
return parseUrl(url);
|
|
16300
|
-
}
|
|
16301
|
-
#fill(template, opts) {
|
|
16302
|
-
if (typeof template !== "function") {
|
|
16303
|
-
return null;
|
|
16304
|
-
}
|
|
16305
|
-
const options = { ...this, ...this.opts, ...opts };
|
|
16306
|
-
if (!options.path) {
|
|
16307
|
-
options.path = "";
|
|
16308
|
-
}
|
|
16309
|
-
if (options.path.startsWith("/")) {
|
|
16310
|
-
options.path = options.path.slice(1);
|
|
16311
|
-
}
|
|
16312
|
-
if (options.noCommittish) {
|
|
16313
|
-
options.committish = null;
|
|
16314
|
-
}
|
|
16315
|
-
const result = template(options);
|
|
16316
|
-
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
16317
|
-
}
|
|
16318
|
-
hash() {
|
|
16319
|
-
return this.committish ? `#${this.committish}` : "";
|
|
16320
|
-
}
|
|
16321
|
-
ssh(opts) {
|
|
16322
|
-
return this.#fill(this.sshtemplate, opts);
|
|
16323
|
-
}
|
|
16324
|
-
sshurl(opts) {
|
|
16325
|
-
return this.#fill(this.sshurltemplate, opts);
|
|
16326
|
-
}
|
|
16327
|
-
browse(path24, ...args) {
|
|
16328
|
-
if (typeof path24 !== "string") {
|
|
16329
|
-
return this.#fill(this.browsetemplate, path24);
|
|
16330
|
-
}
|
|
16331
|
-
if (typeof args[0] !== "string") {
|
|
16332
|
-
return this.#fill(this.browsetreetemplate, { ...args[0], path: path24 });
|
|
16333
|
-
}
|
|
16334
|
-
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path: path24 });
|
|
16335
|
-
}
|
|
16336
|
-
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
16337
|
-
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
16338
|
-
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
16339
|
-
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
16340
|
-
// does not redirect to a different commit.
|
|
16341
|
-
browseFile(path24, ...args) {
|
|
16342
|
-
if (typeof args[0] !== "string") {
|
|
16343
|
-
return this.#fill(this.browseblobtemplate, { ...args[0], path: path24 });
|
|
16344
|
-
}
|
|
16345
|
-
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path: path24 });
|
|
16346
|
-
}
|
|
16347
|
-
docs(opts) {
|
|
16348
|
-
return this.#fill(this.docstemplate, opts);
|
|
16349
|
-
}
|
|
16350
|
-
bugs(opts) {
|
|
16351
|
-
return this.#fill(this.bugstemplate, opts);
|
|
16352
|
-
}
|
|
16353
|
-
https(opts) {
|
|
16354
|
-
return this.#fill(this.httpstemplate, opts);
|
|
16355
|
-
}
|
|
16356
|
-
git(opts) {
|
|
16357
|
-
return this.#fill(this.gittemplate, opts);
|
|
16358
|
-
}
|
|
16359
|
-
shortcut(opts) {
|
|
16360
|
-
return this.#fill(this.shortcuttemplate, opts);
|
|
16361
|
-
}
|
|
16362
|
-
path(opts) {
|
|
16363
|
-
return this.#fill(this.pathtemplate, opts);
|
|
16364
|
-
}
|
|
16365
|
-
tarball(opts) {
|
|
16366
|
-
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
16367
|
-
}
|
|
16368
|
-
file(path24, opts) {
|
|
16369
|
-
return this.#fill(this.filetemplate, { ...opts, path: path24 });
|
|
16370
|
-
}
|
|
16371
|
-
edit(path24, opts) {
|
|
16372
|
-
return this.#fill(this.edittemplate, { ...opts, path: path24 });
|
|
16373
|
-
}
|
|
16374
|
-
getDefaultRepresentation() {
|
|
16375
|
-
return this.default;
|
|
16376
|
-
}
|
|
16377
|
-
toString(opts) {
|
|
16378
|
-
if (this.default && typeof this[this.default] === "function") {
|
|
16379
|
-
return this[this.default](opts);
|
|
16380
|
-
}
|
|
16381
|
-
return this.sshurl(opts);
|
|
16382
|
-
}
|
|
16383
|
-
};
|
|
16384
|
-
for (const [name, host] of Object.entries(hosts)) {
|
|
16385
|
-
GitHost.addHost(name, host);
|
|
16386
|
-
}
|
|
16387
|
-
module.exports = GitHost;
|
|
16388
|
-
}
|
|
16389
|
-
});
|
|
16390
|
-
|
|
16391
14494
|
// node_modules/read-package-up/node_modules/normalize-package-data/lib/extract_description.js
|
|
16392
14495
|
var require_extract_description = __commonJS({
|
|
16393
14496
|
"node_modules/read-package-up/node_modules/normalize-package-data/lib/extract_description.js"(exports, module) {
|
|
@@ -16452,7 +14555,7 @@ var require_fixer = __commonJS({
|
|
|
16452
14555
|
var isValidSemver = require_valid();
|
|
16453
14556
|
var cleanSemver = require_clean();
|
|
16454
14557
|
var validateLicense = require_validate_npm_package_license();
|
|
16455
|
-
var hostedGitInfo =
|
|
14558
|
+
var hostedGitInfo = require_lib();
|
|
16456
14559
|
var { isBuiltin } = __require("node:module");
|
|
16457
14560
|
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
16458
14561
|
var extractDescription = require_extract_description();
|
|
@@ -17000,7 +15103,7 @@ var require_normalize = __commonJS({
|
|
|
17000
15103
|
import { randomBytes } from "node:crypto";
|
|
17001
15104
|
import fs10, { realpathSync as realpathSync2 } from "node:fs";
|
|
17002
15105
|
import os3 from "node:os";
|
|
17003
|
-
import
|
|
15106
|
+
import path25 from "node:path";
|
|
17004
15107
|
|
|
17005
15108
|
// node_modules/indent-string/index.js
|
|
17006
15109
|
function indentString(string, count2 = 1, options = {}) {
|
|
@@ -17248,7 +15351,7 @@ async function get_pkg_default({ pkgRoot }, { cwd }) {
|
|
|
17248
15351
|
// src/prepare.js
|
|
17249
15352
|
import { existsSync as existsSync2 } from "node:fs";
|
|
17250
15353
|
import fs7 from "node:fs/promises";
|
|
17251
|
-
import
|
|
15354
|
+
import path15 from "node:path";
|
|
17252
15355
|
import { format as format3 } from "node:util";
|
|
17253
15356
|
|
|
17254
15357
|
// node_modules/is-plain-obj/index.js
|
|
@@ -21632,13 +19735,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
|
|
|
21632
19735
|
}
|
|
21633
19736
|
};
|
|
21634
19737
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
21635
|
-
for (const { path:
|
|
21636
|
-
const pathString = typeof
|
|
19738
|
+
for (const { path: path26, append } of stdioItems.filter(({ type: type2 }) => FILE_TYPES.has(type2))) {
|
|
19739
|
+
const pathString = typeof path26 === "string" ? path26 : path26.toString();
|
|
21637
19740
|
if (append || outputFiles.has(pathString)) {
|
|
21638
|
-
appendFileSync(
|
|
19741
|
+
appendFileSync(path26, serializedResult);
|
|
21639
19742
|
} else {
|
|
21640
19743
|
outputFiles.add(pathString);
|
|
21641
|
-
writeFileSync(
|
|
19744
|
+
writeFileSync(path26, serializedResult);
|
|
21642
19745
|
}
|
|
21643
19746
|
}
|
|
21644
19747
|
};
|
|
@@ -24156,7 +22259,7 @@ var PackageGraph = class extends Map {
|
|
|
24156
22259
|
// src/lerna/project.js
|
|
24157
22260
|
import fs6 from "node:fs";
|
|
24158
22261
|
import fsp from "node:fs/promises";
|
|
24159
|
-
import
|
|
22262
|
+
import path13 from "node:path";
|
|
24160
22263
|
import { cosmiconfigSync } from "cosmiconfig";
|
|
24161
22264
|
|
|
24162
22265
|
// node_modules/globby/index.js
|
|
@@ -24166,62 +22269,214 @@ import nodePath from "node:path";
|
|
|
24166
22269
|
import { Readable as Readable4 } from "node:stream";
|
|
24167
22270
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
24168
22271
|
|
|
24169
|
-
// node_modules/
|
|
24170
|
-
import
|
|
24171
|
-
import
|
|
24172
|
-
|
|
24173
|
-
|
|
24174
|
-
|
|
24175
|
-
|
|
24176
|
-
try {
|
|
24177
|
-
const stats = await fsPromises[fsStatType](filePath);
|
|
24178
|
-
return stats[statsMethodName]();
|
|
24179
|
-
} catch (error) {
|
|
24180
|
-
if (error.code === "ENOENT") {
|
|
24181
|
-
return false;
|
|
24182
|
-
}
|
|
24183
|
-
throw error;
|
|
24184
|
-
}
|
|
24185
|
-
}
|
|
24186
|
-
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
24187
|
-
if (typeof filePath !== "string") {
|
|
24188
|
-
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
24189
|
-
}
|
|
24190
|
-
try {
|
|
24191
|
-
return fs2[fsStatType](filePath)[statsMethodName]();
|
|
24192
|
-
} catch (error) {
|
|
24193
|
-
if (error.code === "ENOENT") {
|
|
24194
|
-
return false;
|
|
24195
|
-
}
|
|
24196
|
-
throw error;
|
|
24197
|
-
}
|
|
22272
|
+
// node_modules/globby/node_modules/unicorn-magic/node.js
|
|
22273
|
+
import { promisify as promisify3 } from "node:util";
|
|
22274
|
+
import { execFile as execFileCallback2, execFileSync as execFileSyncOriginal2 } from "node:child_process";
|
|
22275
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
22276
|
+
var execFileOriginal2 = promisify3(execFileCallback2);
|
|
22277
|
+
function toPath2(urlOrPath) {
|
|
22278
|
+
return urlOrPath instanceof URL ? fileURLToPath4(urlOrPath) : urlOrPath;
|
|
24198
22279
|
}
|
|
24199
|
-
var
|
|
24200
|
-
var isDirectory = isType.bind(void 0, "stat", "isDirectory");
|
|
24201
|
-
var isSymlink = isType.bind(void 0, "lstat", "isSymbolicLink");
|
|
24202
|
-
var isFileSync = isTypeSync.bind(void 0, "statSync", "isFile");
|
|
24203
|
-
var isDirectorySync = isTypeSync.bind(void 0, "statSync", "isDirectory");
|
|
24204
|
-
var isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
22280
|
+
var TEN_MEGABYTES_IN_BYTES2 = 10 * 1024 * 1024;
|
|
24205
22281
|
|
|
24206
22282
|
// node_modules/globby/ignore.js
|
|
24207
22283
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
24208
22284
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
24209
22285
|
import process10 from "node:process";
|
|
24210
22286
|
import fs3 from "node:fs";
|
|
24211
|
-
import
|
|
22287
|
+
import fsPromises from "node:fs/promises";
|
|
22288
|
+
import path9 from "node:path";
|
|
22289
|
+
|
|
22290
|
+
// node_modules/is-path-inside/index.js
|
|
24212
22291
|
import path7 from "node:path";
|
|
22292
|
+
function isPathInside(childPath, parentPath) {
|
|
22293
|
+
const relation = path7.relative(parentPath, childPath);
|
|
22294
|
+
return Boolean(
|
|
22295
|
+
relation && relation !== ".." && !relation.startsWith(`..${path7.sep}`) && relation !== path7.resolve(childPath)
|
|
22296
|
+
);
|
|
22297
|
+
}
|
|
24213
22298
|
|
|
24214
22299
|
// node_modules/slash/index.js
|
|
24215
|
-
function slash(
|
|
24216
|
-
const isExtendedLengthPath =
|
|
22300
|
+
function slash(path26) {
|
|
22301
|
+
const isExtendedLengthPath = path26.startsWith("\\\\?\\");
|
|
24217
22302
|
if (isExtendedLengthPath) {
|
|
24218
|
-
return
|
|
22303
|
+
return path26;
|
|
24219
22304
|
}
|
|
24220
|
-
return
|
|
22305
|
+
return path26.replace(/\\/g, "/");
|
|
24221
22306
|
}
|
|
24222
22307
|
|
|
24223
22308
|
// node_modules/globby/utilities.js
|
|
22309
|
+
import fs2 from "node:fs";
|
|
22310
|
+
import path8 from "node:path";
|
|
22311
|
+
import { promisify as promisify4 } from "node:util";
|
|
24224
22312
|
var isNegativePattern = (pattern) => pattern[0] === "!";
|
|
22313
|
+
var bindFsMethod = (object, methodName) => {
|
|
22314
|
+
const method = object?.[methodName];
|
|
22315
|
+
return typeof method === "function" ? method.bind(object) : void 0;
|
|
22316
|
+
};
|
|
22317
|
+
var promisifyFsMethod = (object, methodName) => {
|
|
22318
|
+
const method = object?.[methodName];
|
|
22319
|
+
if (typeof method !== "function") {
|
|
22320
|
+
return void 0;
|
|
22321
|
+
}
|
|
22322
|
+
return promisify4(method.bind(object));
|
|
22323
|
+
};
|
|
22324
|
+
var normalizeDirectoryPatternForFastGlob = (pattern) => {
|
|
22325
|
+
if (!pattern.endsWith("/")) {
|
|
22326
|
+
return pattern;
|
|
22327
|
+
}
|
|
22328
|
+
const trimmedPattern = pattern.replace(/\/+$/u, "");
|
|
22329
|
+
if (!trimmedPattern) {
|
|
22330
|
+
return "/**";
|
|
22331
|
+
}
|
|
22332
|
+
if (trimmedPattern === "**") {
|
|
22333
|
+
return "**/**";
|
|
22334
|
+
}
|
|
22335
|
+
const hasLeadingSlash = trimmedPattern.startsWith("/");
|
|
22336
|
+
const patternBody = hasLeadingSlash ? trimmedPattern.slice(1) : trimmedPattern;
|
|
22337
|
+
const hasInnerSlash = patternBody.includes("/");
|
|
22338
|
+
const needsRecursivePrefix = !hasLeadingSlash && !hasInnerSlash && !trimmedPattern.startsWith("**/");
|
|
22339
|
+
const recursivePrefix = needsRecursivePrefix ? "**/" : "";
|
|
22340
|
+
return `${recursivePrefix}${trimmedPattern}/**`;
|
|
22341
|
+
};
|
|
22342
|
+
var getParentDirectoryPrefix = (pattern) => {
|
|
22343
|
+
const normalizedPattern = isNegativePattern(pattern) ? pattern.slice(1) : pattern;
|
|
22344
|
+
const match2 = normalizedPattern.match(/^(\.\.\/)+/);
|
|
22345
|
+
return match2 ? match2[0] : "";
|
|
22346
|
+
};
|
|
22347
|
+
var adjustIgnorePatternsForParentDirectories = (patterns, ignorePatterns) => {
|
|
22348
|
+
if (patterns.length === 0 || ignorePatterns.length === 0) {
|
|
22349
|
+
return ignorePatterns;
|
|
22350
|
+
}
|
|
22351
|
+
const parentPrefixes = patterns.map((pattern) => getParentDirectoryPrefix(pattern));
|
|
22352
|
+
const firstPrefix = parentPrefixes[0];
|
|
22353
|
+
if (!firstPrefix) {
|
|
22354
|
+
return ignorePatterns;
|
|
22355
|
+
}
|
|
22356
|
+
const allSamePrefix = parentPrefixes.every((prefix) => prefix === firstPrefix);
|
|
22357
|
+
if (!allSamePrefix) {
|
|
22358
|
+
return ignorePatterns;
|
|
22359
|
+
}
|
|
22360
|
+
return ignorePatterns.map((pattern) => {
|
|
22361
|
+
if (pattern.startsWith("**/") && !pattern.startsWith("../")) {
|
|
22362
|
+
return firstPrefix + pattern;
|
|
22363
|
+
}
|
|
22364
|
+
return pattern;
|
|
22365
|
+
});
|
|
22366
|
+
};
|
|
22367
|
+
var getAsyncStatMethod = (fsImplementation) => bindFsMethod(fsImplementation?.promises, "stat") ?? bindFsMethod(fs2.promises, "stat");
|
|
22368
|
+
var getStatSyncMethod = (fsImplementation) => {
|
|
22369
|
+
if (fsImplementation) {
|
|
22370
|
+
return bindFsMethod(fsImplementation, "statSync");
|
|
22371
|
+
}
|
|
22372
|
+
return bindFsMethod(fs2, "statSync");
|
|
22373
|
+
};
|
|
22374
|
+
var pathHasGitDirectory = (stats) => Boolean(stats?.isDirectory?.() || stats?.isFile?.());
|
|
22375
|
+
var buildPathChain = (startPath, rootPath) => {
|
|
22376
|
+
const chain = [];
|
|
22377
|
+
let currentPath = startPath;
|
|
22378
|
+
chain.push(currentPath);
|
|
22379
|
+
while (currentPath !== rootPath) {
|
|
22380
|
+
const parentPath = path8.dirname(currentPath);
|
|
22381
|
+
if (parentPath === currentPath) {
|
|
22382
|
+
break;
|
|
22383
|
+
}
|
|
22384
|
+
currentPath = parentPath;
|
|
22385
|
+
chain.push(currentPath);
|
|
22386
|
+
}
|
|
22387
|
+
return chain;
|
|
22388
|
+
};
|
|
22389
|
+
var findGitRootInChain = async (paths, statMethod) => {
|
|
22390
|
+
for (const directory of paths) {
|
|
22391
|
+
const gitPath = path8.join(directory, ".git");
|
|
22392
|
+
try {
|
|
22393
|
+
const stats = await statMethod(gitPath);
|
|
22394
|
+
if (pathHasGitDirectory(stats)) {
|
|
22395
|
+
return directory;
|
|
22396
|
+
}
|
|
22397
|
+
} catch {
|
|
22398
|
+
}
|
|
22399
|
+
}
|
|
22400
|
+
return void 0;
|
|
22401
|
+
};
|
|
22402
|
+
var findGitRootSyncUncached = (cwd, fsImplementation) => {
|
|
22403
|
+
const statSyncMethod = getStatSyncMethod(fsImplementation);
|
|
22404
|
+
if (!statSyncMethod) {
|
|
22405
|
+
return void 0;
|
|
22406
|
+
}
|
|
22407
|
+
const currentPath = path8.resolve(cwd);
|
|
22408
|
+
const { root } = path8.parse(currentPath);
|
|
22409
|
+
const chain = buildPathChain(currentPath, root);
|
|
22410
|
+
for (const directory of chain) {
|
|
22411
|
+
const gitPath = path8.join(directory, ".git");
|
|
22412
|
+
try {
|
|
22413
|
+
const stats = statSyncMethod(gitPath);
|
|
22414
|
+
if (pathHasGitDirectory(stats)) {
|
|
22415
|
+
return directory;
|
|
22416
|
+
}
|
|
22417
|
+
} catch {
|
|
22418
|
+
}
|
|
22419
|
+
}
|
|
22420
|
+
return void 0;
|
|
22421
|
+
};
|
|
22422
|
+
var findGitRootSync = (cwd, fsImplementation) => {
|
|
22423
|
+
if (typeof cwd !== "string") {
|
|
22424
|
+
throw new TypeError("cwd must be a string");
|
|
22425
|
+
}
|
|
22426
|
+
return findGitRootSyncUncached(cwd, fsImplementation);
|
|
22427
|
+
};
|
|
22428
|
+
var findGitRootAsyncUncached = async (cwd, fsImplementation) => {
|
|
22429
|
+
const statMethod = getAsyncStatMethod(fsImplementation);
|
|
22430
|
+
if (!statMethod) {
|
|
22431
|
+
return findGitRootSync(cwd, fsImplementation);
|
|
22432
|
+
}
|
|
22433
|
+
const currentPath = path8.resolve(cwd);
|
|
22434
|
+
const { root } = path8.parse(currentPath);
|
|
22435
|
+
const chain = buildPathChain(currentPath, root);
|
|
22436
|
+
return findGitRootInChain(chain, statMethod);
|
|
22437
|
+
};
|
|
22438
|
+
var findGitRoot = async (cwd, fsImplementation) => {
|
|
22439
|
+
if (typeof cwd !== "string") {
|
|
22440
|
+
throw new TypeError("cwd must be a string");
|
|
22441
|
+
}
|
|
22442
|
+
return findGitRootAsyncUncached(cwd, fsImplementation);
|
|
22443
|
+
};
|
|
22444
|
+
var isWithinGitRoot = (gitRoot, cwd) => {
|
|
22445
|
+
const resolvedGitRoot = path8.resolve(gitRoot);
|
|
22446
|
+
const resolvedCwd = path8.resolve(cwd);
|
|
22447
|
+
return resolvedCwd === resolvedGitRoot || isPathInside(resolvedCwd, resolvedGitRoot);
|
|
22448
|
+
};
|
|
22449
|
+
var getParentGitignorePaths = (gitRoot, cwd) => {
|
|
22450
|
+
if (gitRoot && typeof gitRoot !== "string") {
|
|
22451
|
+
throw new TypeError("gitRoot must be a string or undefined");
|
|
22452
|
+
}
|
|
22453
|
+
if (typeof cwd !== "string") {
|
|
22454
|
+
throw new TypeError("cwd must be a string");
|
|
22455
|
+
}
|
|
22456
|
+
if (!gitRoot) {
|
|
22457
|
+
return [];
|
|
22458
|
+
}
|
|
22459
|
+
if (!isWithinGitRoot(gitRoot, cwd)) {
|
|
22460
|
+
return [];
|
|
22461
|
+
}
|
|
22462
|
+
const chain = buildPathChain(path8.resolve(cwd), path8.resolve(gitRoot));
|
|
22463
|
+
return [...chain].reverse().map((directory) => path8.join(directory, ".gitignore"));
|
|
22464
|
+
};
|
|
22465
|
+
var convertPatternsForFastGlob = (patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob2) => {
|
|
22466
|
+
if (usingGitRoot) {
|
|
22467
|
+
return [];
|
|
22468
|
+
}
|
|
22469
|
+
const result = [];
|
|
22470
|
+
let hasNegations = false;
|
|
22471
|
+
for (const pattern of patterns) {
|
|
22472
|
+
if (isNegativePattern(pattern)) {
|
|
22473
|
+
hasNegations = true;
|
|
22474
|
+
break;
|
|
22475
|
+
}
|
|
22476
|
+
result.push(normalizeDirectoryPatternForFastGlob2(pattern));
|
|
22477
|
+
}
|
|
22478
|
+
return hasNegations ? [] : result;
|
|
22479
|
+
};
|
|
24225
22480
|
|
|
24226
22481
|
// node_modules/globby/ignore.js
|
|
24227
22482
|
var defaultIgnoredDirectories = [
|
|
@@ -24235,6 +22490,79 @@ var ignoreFilesGlobOptions = {
|
|
|
24235
22490
|
dot: true
|
|
24236
22491
|
};
|
|
24237
22492
|
var GITIGNORE_FILES_PATTERN = "**/.gitignore";
|
|
22493
|
+
var getReadFileMethod = (fsImplementation) => bindFsMethod(fsImplementation?.promises, "readFile") ?? bindFsMethod(fsPromises, "readFile") ?? promisifyFsMethod(fsImplementation, "readFile");
|
|
22494
|
+
var getReadFileSyncMethod = (fsImplementation) => bindFsMethod(fsImplementation, "readFileSync") ?? bindFsMethod(fs3, "readFileSync");
|
|
22495
|
+
var shouldSkipIgnoreFileError = (error, suppressErrors) => {
|
|
22496
|
+
if (!error) {
|
|
22497
|
+
return Boolean(suppressErrors);
|
|
22498
|
+
}
|
|
22499
|
+
if (error.code === "ENOENT" || error.code === "ENOTDIR") {
|
|
22500
|
+
return true;
|
|
22501
|
+
}
|
|
22502
|
+
return Boolean(suppressErrors);
|
|
22503
|
+
};
|
|
22504
|
+
var createIgnoreFileReadError = (filePath, error) => {
|
|
22505
|
+
if (error instanceof Error) {
|
|
22506
|
+
error.message = `Failed to read ignore file at ${filePath}: ${error.message}`;
|
|
22507
|
+
return error;
|
|
22508
|
+
}
|
|
22509
|
+
return new Error(`Failed to read ignore file at ${filePath}: ${String(error)}`);
|
|
22510
|
+
};
|
|
22511
|
+
var processIgnoreFileCore = (filePath, readMethod, suppressErrors) => {
|
|
22512
|
+
try {
|
|
22513
|
+
const content = readMethod(filePath, "utf8");
|
|
22514
|
+
return { filePath, content };
|
|
22515
|
+
} catch (error) {
|
|
22516
|
+
if (shouldSkipIgnoreFileError(error, suppressErrors)) {
|
|
22517
|
+
return void 0;
|
|
22518
|
+
}
|
|
22519
|
+
throw createIgnoreFileReadError(filePath, error);
|
|
22520
|
+
}
|
|
22521
|
+
};
|
|
22522
|
+
var readIgnoreFilesSafely = async (paths, readFileMethod, suppressErrors) => {
|
|
22523
|
+
const fileResults = await Promise.all(paths.map(async (filePath) => {
|
|
22524
|
+
try {
|
|
22525
|
+
const content = await readFileMethod(filePath, "utf8");
|
|
22526
|
+
return { filePath, content };
|
|
22527
|
+
} catch (error) {
|
|
22528
|
+
if (shouldSkipIgnoreFileError(error, suppressErrors)) {
|
|
22529
|
+
return void 0;
|
|
22530
|
+
}
|
|
22531
|
+
throw createIgnoreFileReadError(filePath, error);
|
|
22532
|
+
}
|
|
22533
|
+
}));
|
|
22534
|
+
return fileResults.filter(Boolean);
|
|
22535
|
+
};
|
|
22536
|
+
var readIgnoreFilesSafelySync = (paths, readFileSyncMethod, suppressErrors) => paths.map((filePath) => processIgnoreFileCore(filePath, readFileSyncMethod, suppressErrors)).filter(Boolean);
|
|
22537
|
+
var dedupePaths = (paths) => {
|
|
22538
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22539
|
+
return paths.filter((filePath) => {
|
|
22540
|
+
if (seen.has(filePath)) {
|
|
22541
|
+
return false;
|
|
22542
|
+
}
|
|
22543
|
+
seen.add(filePath);
|
|
22544
|
+
return true;
|
|
22545
|
+
});
|
|
22546
|
+
};
|
|
22547
|
+
var globIgnoreFiles = (globFunction, patterns, normalizedOptions) => globFunction(patterns, {
|
|
22548
|
+
...normalizedOptions,
|
|
22549
|
+
...ignoreFilesGlobOptions
|
|
22550
|
+
// Must be last to ensure absolute/dot flags stick
|
|
22551
|
+
});
|
|
22552
|
+
var getParentIgnorePaths = (gitRoot, normalizedOptions) => gitRoot ? getParentGitignorePaths(gitRoot, normalizedOptions.cwd) : [];
|
|
22553
|
+
var combineIgnoreFilePaths = (gitRoot, normalizedOptions, childPaths) => dedupePaths([
|
|
22554
|
+
...getParentIgnorePaths(gitRoot, normalizedOptions),
|
|
22555
|
+
...childPaths
|
|
22556
|
+
]);
|
|
22557
|
+
var buildIgnoreResult = (files, normalizedOptions, gitRoot) => {
|
|
22558
|
+
const baseDir = gitRoot || normalizedOptions.cwd;
|
|
22559
|
+
const patterns = getPatternsFromIgnoreFiles(files, baseDir);
|
|
22560
|
+
return {
|
|
22561
|
+
patterns,
|
|
22562
|
+
predicate: createIgnorePredicate(patterns, normalizedOptions.cwd, baseDir),
|
|
22563
|
+
usingGitRoot: Boolean(gitRoot && gitRoot !== normalizedOptions.cwd)
|
|
22564
|
+
};
|
|
22565
|
+
};
|
|
24238
22566
|
var applyBaseToPattern = (pattern, base) => {
|
|
24239
22567
|
if (!base) {
|
|
24240
22568
|
return pattern;
|
|
@@ -24245,25 +22573,25 @@ var applyBaseToPattern = (pattern, base) => {
|
|
|
24245
22573
|
const hasNonTrailingSlash = slashIndex !== -1 && slashIndex !== cleanPattern.length - 1;
|
|
24246
22574
|
let result;
|
|
24247
22575
|
if (!hasNonTrailingSlash) {
|
|
24248
|
-
result =
|
|
22576
|
+
result = path9.posix.join(base, "**", cleanPattern);
|
|
24249
22577
|
} else if (cleanPattern.startsWith("/")) {
|
|
24250
|
-
result =
|
|
22578
|
+
result = path9.posix.join(base, cleanPattern.slice(1));
|
|
24251
22579
|
} else {
|
|
24252
|
-
result =
|
|
22580
|
+
result = path9.posix.join(base, cleanPattern);
|
|
24253
22581
|
}
|
|
24254
22582
|
return isNegative ? "!" + result : result;
|
|
24255
22583
|
};
|
|
24256
22584
|
var parseIgnoreFile = (file, cwd) => {
|
|
24257
|
-
const base = slash(
|
|
22585
|
+
const base = slash(path9.relative(cwd, path9.dirname(file.filePath)));
|
|
24258
22586
|
return file.content.split(/\r?\n/).filter((line) => line && !line.startsWith("#")).map((pattern) => applyBaseToPattern(pattern, base));
|
|
24259
22587
|
};
|
|
24260
22588
|
var toRelativePath = (fileOrDirectory, cwd) => {
|
|
24261
|
-
|
|
24262
|
-
|
|
24263
|
-
if (
|
|
24264
|
-
return
|
|
22589
|
+
if (path9.isAbsolute(fileOrDirectory)) {
|
|
22590
|
+
const relativePath = path9.relative(cwd, fileOrDirectory);
|
|
22591
|
+
if (relativePath && !isPathInside(fileOrDirectory, cwd)) {
|
|
22592
|
+
return void 0;
|
|
24265
22593
|
}
|
|
24266
|
-
|
|
22594
|
+
return relativePath;
|
|
24267
22595
|
}
|
|
24268
22596
|
if (fileOrDirectory.startsWith("./")) {
|
|
24269
22597
|
return fileOrDirectory.slice(2);
|
|
@@ -24273,53 +22601,72 @@ var toRelativePath = (fileOrDirectory, cwd) => {
|
|
|
24273
22601
|
}
|
|
24274
22602
|
return fileOrDirectory;
|
|
24275
22603
|
};
|
|
24276
|
-
var
|
|
24277
|
-
const patterns = files.flatMap((file) => parseIgnoreFile(file, cwd));
|
|
22604
|
+
var createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
24278
22605
|
const ignores = (0, import_ignore.default)().add(patterns);
|
|
22606
|
+
const resolvedCwd = path9.normalize(path9.resolve(cwd));
|
|
22607
|
+
const resolvedBaseDir = path9.normalize(path9.resolve(baseDir));
|
|
24279
22608
|
return (fileOrDirectory) => {
|
|
24280
|
-
fileOrDirectory =
|
|
24281
|
-
|
|
24282
|
-
if (
|
|
22609
|
+
fileOrDirectory = toPath2(fileOrDirectory);
|
|
22610
|
+
const normalizedPath = path9.normalize(path9.resolve(fileOrDirectory));
|
|
22611
|
+
if (normalizedPath === resolvedCwd) {
|
|
22612
|
+
return false;
|
|
22613
|
+
}
|
|
22614
|
+
const relativePath = toRelativePath(fileOrDirectory, resolvedBaseDir);
|
|
22615
|
+
if (relativePath === void 0) {
|
|
24283
22616
|
return false;
|
|
24284
22617
|
}
|
|
24285
|
-
return
|
|
22618
|
+
return relativePath ? ignores.ignores(slash(relativePath)) : false;
|
|
24286
22619
|
};
|
|
24287
22620
|
};
|
|
24288
|
-
var normalizeOptions2 = (options = {}) =>
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
deep
|
|
24292
|
-
|
|
24293
|
-
});
|
|
24294
|
-
var isIgnoredByIgnoreFiles = async (patterns, options) => {
|
|
24295
|
-
const { cwd, suppressErrors, deep, ignore } = normalizeOptions2(options);
|
|
24296
|
-
const paths = await (0, import_fast_glob.default)(patterns, {
|
|
24297
|
-
cwd,
|
|
24298
|
-
suppressErrors,
|
|
24299
|
-
deep,
|
|
24300
|
-
ignore,
|
|
24301
|
-
...ignoreFilesGlobOptions
|
|
24302
|
-
});
|
|
24303
|
-
const files = await Promise.all(paths.map(async (filePath) => ({
|
|
24304
|
-
filePath,
|
|
24305
|
-
content: await fsPromises2.readFile(filePath, "utf8")
|
|
24306
|
-
})));
|
|
24307
|
-
return getIsIgnoredPredicate(files, cwd);
|
|
24308
|
-
};
|
|
24309
|
-
var isIgnoredByIgnoreFilesSync = (patterns, options) => {
|
|
24310
|
-
const { cwd, suppressErrors, deep, ignore } = normalizeOptions2(options);
|
|
24311
|
-
const paths = import_fast_glob.default.sync(patterns, {
|
|
22621
|
+
var normalizeOptions2 = (options = {}) => {
|
|
22622
|
+
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
22623
|
+
const cwd = toPath2(options.cwd) ?? process10.cwd();
|
|
22624
|
+
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
22625
|
+
return {
|
|
24312
22626
|
cwd,
|
|
24313
|
-
suppressErrors,
|
|
22627
|
+
suppressErrors: options.suppressErrors ?? false,
|
|
24314
22628
|
deep,
|
|
24315
|
-
ignore,
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
22629
|
+
ignore: [...ignoreOption, ...defaultIgnoredDirectories],
|
|
22630
|
+
followSymbolicLinks: options.followSymbolicLinks ?? true,
|
|
22631
|
+
concurrency: options.concurrency,
|
|
22632
|
+
throwErrorOnBrokenSymbolicLink: options.throwErrorOnBrokenSymbolicLink ?? false,
|
|
22633
|
+
fs: options.fs
|
|
22634
|
+
};
|
|
22635
|
+
};
|
|
22636
|
+
var collectIgnoreFileArtifactsAsync = async (patterns, options, includeParentIgnoreFiles) => {
|
|
22637
|
+
const normalizedOptions = normalizeOptions2(options);
|
|
22638
|
+
const childPaths = await globIgnoreFiles(import_fast_glob.default, patterns, normalizedOptions);
|
|
22639
|
+
const gitRoot = includeParentIgnoreFiles ? await findGitRoot(normalizedOptions.cwd, normalizedOptions.fs) : void 0;
|
|
22640
|
+
const allPaths = combineIgnoreFilePaths(gitRoot, normalizedOptions, childPaths);
|
|
22641
|
+
const readFileMethod = getReadFileMethod(normalizedOptions.fs);
|
|
22642
|
+
const files = await readIgnoreFilesSafely(allPaths, readFileMethod, normalizedOptions.suppressErrors);
|
|
22643
|
+
return { files, normalizedOptions, gitRoot };
|
|
22644
|
+
};
|
|
22645
|
+
var collectIgnoreFileArtifactsSync = (patterns, options, includeParentIgnoreFiles) => {
|
|
22646
|
+
const normalizedOptions = normalizeOptions2(options);
|
|
22647
|
+
const childPaths = globIgnoreFiles(import_fast_glob.default.sync, patterns, normalizedOptions);
|
|
22648
|
+
const gitRoot = includeParentIgnoreFiles ? findGitRootSync(normalizedOptions.cwd, normalizedOptions.fs) : void 0;
|
|
22649
|
+
const allPaths = combineIgnoreFilePaths(gitRoot, normalizedOptions, childPaths);
|
|
22650
|
+
const readFileSyncMethod = getReadFileSyncMethod(normalizedOptions.fs);
|
|
22651
|
+
const files = readIgnoreFilesSafelySync(allPaths, readFileSyncMethod, normalizedOptions.suppressErrors);
|
|
22652
|
+
return { files, normalizedOptions, gitRoot };
|
|
22653
|
+
};
|
|
22654
|
+
var getPatternsFromIgnoreFiles = (files, baseDir) => files.flatMap((file) => parseIgnoreFile(file, baseDir));
|
|
22655
|
+
var getIgnorePatternsAndPredicate = async (patterns, options, includeParentIgnoreFiles = false) => {
|
|
22656
|
+
const { files, normalizedOptions, gitRoot } = await collectIgnoreFileArtifactsAsync(
|
|
22657
|
+
patterns,
|
|
22658
|
+
options,
|
|
22659
|
+
includeParentIgnoreFiles
|
|
22660
|
+
);
|
|
22661
|
+
return buildIgnoreResult(files, normalizedOptions, gitRoot);
|
|
22662
|
+
};
|
|
22663
|
+
var getIgnorePatternsAndPredicateSync = (patterns, options, includeParentIgnoreFiles = false) => {
|
|
22664
|
+
const { files, normalizedOptions, gitRoot } = collectIgnoreFileArtifactsSync(
|
|
22665
|
+
patterns,
|
|
22666
|
+
options,
|
|
22667
|
+
includeParentIgnoreFiles
|
|
22668
|
+
);
|
|
22669
|
+
return buildIgnoreResult(files, normalizedOptions, gitRoot);
|
|
24323
22670
|
};
|
|
24324
22671
|
|
|
24325
22672
|
// node_modules/globby/index.js
|
|
@@ -24328,9 +22675,27 @@ var assertPatternsInput = (patterns) => {
|
|
|
24328
22675
|
throw new TypeError("Patterns must be a string or an array of strings");
|
|
24329
22676
|
}
|
|
24330
22677
|
};
|
|
22678
|
+
var getStatMethod = (fsImplementation) => bindFsMethod(fsImplementation?.promises, "stat") ?? bindFsMethod(fs4.promises, "stat") ?? promisifyFsMethod(fsImplementation, "stat");
|
|
22679
|
+
var getStatSyncMethod2 = (fsImplementation) => bindFsMethod(fsImplementation, "statSync") ?? bindFsMethod(fs4, "statSync");
|
|
22680
|
+
var isDirectory = async (path26, fsImplementation) => {
|
|
22681
|
+
try {
|
|
22682
|
+
const stats = await getStatMethod(fsImplementation)(path26);
|
|
22683
|
+
return stats.isDirectory();
|
|
22684
|
+
} catch {
|
|
22685
|
+
return false;
|
|
22686
|
+
}
|
|
22687
|
+
};
|
|
22688
|
+
var isDirectorySync = (path26, fsImplementation) => {
|
|
22689
|
+
try {
|
|
22690
|
+
const stats = getStatSyncMethod2(fsImplementation)(path26);
|
|
22691
|
+
return stats.isDirectory();
|
|
22692
|
+
} catch {
|
|
22693
|
+
return false;
|
|
22694
|
+
}
|
|
22695
|
+
};
|
|
24331
22696
|
var normalizePathForDirectoryGlob = (filePath, cwd) => {
|
|
24332
|
-
const
|
|
24333
|
-
return nodePath.isAbsolute(
|
|
22697
|
+
const path26 = isNegativePattern(filePath) ? filePath.slice(1) : filePath;
|
|
22698
|
+
return nodePath.isAbsolute(path26) ? path26 : nodePath.join(cwd, path26);
|
|
24334
22699
|
};
|
|
24335
22700
|
var shouldExpandGlobstarDirectory = (pattern) => {
|
|
24336
22701
|
const match2 = pattern?.match(/\*\*\/([^/]+)$/);
|
|
@@ -24349,7 +22714,8 @@ var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
24349
22714
|
var directoryToGlob = async (directoryPaths, {
|
|
24350
22715
|
cwd = process11.cwd(),
|
|
24351
22716
|
files,
|
|
24352
|
-
extensions
|
|
22717
|
+
extensions,
|
|
22718
|
+
fs: fsImplementation
|
|
24353
22719
|
} = {}) => {
|
|
24354
22720
|
const globs = await Promise.all(directoryPaths.map(async (directoryPath) => {
|
|
24355
22721
|
const checkPattern = isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath;
|
|
@@ -24357,49 +22723,51 @@ var directoryToGlob = async (directoryPaths, {
|
|
|
24357
22723
|
return getDirectoryGlob({ directoryPath, files, extensions });
|
|
24358
22724
|
}
|
|
24359
22725
|
const pathToCheck = normalizePathForDirectoryGlob(directoryPath, cwd);
|
|
24360
|
-
return await isDirectory(pathToCheck) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;
|
|
22726
|
+
return await isDirectory(pathToCheck, fsImplementation) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;
|
|
24361
22727
|
}));
|
|
24362
22728
|
return globs.flat();
|
|
24363
22729
|
};
|
|
24364
22730
|
var directoryToGlobSync = (directoryPaths, {
|
|
24365
22731
|
cwd = process11.cwd(),
|
|
24366
22732
|
files,
|
|
24367
|
-
extensions
|
|
22733
|
+
extensions,
|
|
22734
|
+
fs: fsImplementation
|
|
24368
22735
|
} = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
24369
22736
|
const checkPattern = isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath;
|
|
24370
22737
|
if (shouldExpandGlobstarDirectory(checkPattern)) {
|
|
24371
22738
|
return getDirectoryGlob({ directoryPath, files, extensions });
|
|
24372
22739
|
}
|
|
24373
22740
|
const pathToCheck = normalizePathForDirectoryGlob(directoryPath, cwd);
|
|
24374
|
-
return isDirectorySync(pathToCheck) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;
|
|
22741
|
+
return isDirectorySync(pathToCheck, fsImplementation) ? getDirectoryGlob({ directoryPath, files, extensions }) : directoryPath;
|
|
24375
22742
|
});
|
|
24376
22743
|
var toPatternsArray = (patterns) => {
|
|
24377
22744
|
patterns = [...new Set([patterns].flat())];
|
|
24378
22745
|
assertPatternsInput(patterns);
|
|
24379
22746
|
return patterns;
|
|
24380
22747
|
};
|
|
24381
|
-
var checkCwdOption = (cwd) => {
|
|
24382
|
-
if (!cwd) {
|
|
22748
|
+
var checkCwdOption = (cwd, fsImplementation = fs4) => {
|
|
22749
|
+
if (!cwd || !fsImplementation.statSync) {
|
|
24383
22750
|
return;
|
|
24384
22751
|
}
|
|
24385
|
-
let
|
|
22752
|
+
let stats;
|
|
24386
22753
|
try {
|
|
24387
|
-
|
|
22754
|
+
stats = fsImplementation.statSync(cwd);
|
|
24388
22755
|
} catch {
|
|
24389
22756
|
return;
|
|
24390
22757
|
}
|
|
24391
|
-
if (!
|
|
24392
|
-
throw new Error(
|
|
22758
|
+
if (!stats.isDirectory()) {
|
|
22759
|
+
throw new Error(`The \`cwd\` option must be a path to a directory, got: ${cwd}`);
|
|
24393
22760
|
}
|
|
24394
22761
|
};
|
|
24395
22762
|
var normalizeOptions3 = (options = {}) => {
|
|
22763
|
+
const ignore = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
24396
22764
|
options = {
|
|
24397
22765
|
...options,
|
|
24398
|
-
ignore
|
|
22766
|
+
ignore,
|
|
24399
22767
|
expandDirectories: options.expandDirectories ?? true,
|
|
24400
|
-
cwd:
|
|
22768
|
+
cwd: toPath2(options.cwd)
|
|
24401
22769
|
};
|
|
24402
|
-
checkCwdOption(options.cwd);
|
|
22770
|
+
checkCwdOption(options.cwd, options.fs);
|
|
24403
22771
|
return options;
|
|
24404
22772
|
};
|
|
24405
22773
|
var normalizeArguments = (function_) => async (patterns, options) => function_(toPatternsArray(patterns), normalizeOptions3(options));
|
|
@@ -24412,27 +22780,77 @@ var getIgnoreFilesPatterns = (options) => {
|
|
|
24412
22780
|
}
|
|
24413
22781
|
return patterns;
|
|
24414
22782
|
};
|
|
24415
|
-
var
|
|
22783
|
+
var applyIgnoreFilesAndGetFilter = async (options) => {
|
|
24416
22784
|
const ignoreFilesPatterns = getIgnoreFilesPatterns(options);
|
|
24417
|
-
|
|
22785
|
+
if (ignoreFilesPatterns.length === 0) {
|
|
22786
|
+
return {
|
|
22787
|
+
options,
|
|
22788
|
+
filter: createFilterFunction(false, options.cwd)
|
|
22789
|
+
};
|
|
22790
|
+
}
|
|
22791
|
+
const includeParentIgnoreFiles = options.gitignore === true;
|
|
22792
|
+
const { patterns, predicate, usingGitRoot } = await getIgnorePatternsAndPredicate(ignoreFilesPatterns, options, includeParentIgnoreFiles);
|
|
22793
|
+
const patternsForFastGlob = convertPatternsForFastGlob(patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob);
|
|
22794
|
+
const modifiedOptions = {
|
|
22795
|
+
...options,
|
|
22796
|
+
ignore: [...options.ignore, ...patternsForFastGlob]
|
|
22797
|
+
};
|
|
22798
|
+
return {
|
|
22799
|
+
options: modifiedOptions,
|
|
22800
|
+
filter: createFilterFunction(predicate, options.cwd)
|
|
22801
|
+
};
|
|
24418
22802
|
};
|
|
24419
|
-
var
|
|
22803
|
+
var applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
24420
22804
|
const ignoreFilesPatterns = getIgnoreFilesPatterns(options);
|
|
24421
|
-
|
|
22805
|
+
if (ignoreFilesPatterns.length === 0) {
|
|
22806
|
+
return {
|
|
22807
|
+
options,
|
|
22808
|
+
filter: createFilterFunction(false, options.cwd)
|
|
22809
|
+
};
|
|
22810
|
+
}
|
|
22811
|
+
const includeParentIgnoreFiles = options.gitignore === true;
|
|
22812
|
+
const { patterns, predicate, usingGitRoot } = getIgnorePatternsAndPredicateSync(ignoreFilesPatterns, options, includeParentIgnoreFiles);
|
|
22813
|
+
const patternsForFastGlob = convertPatternsForFastGlob(patterns, usingGitRoot, normalizeDirectoryPatternForFastGlob);
|
|
22814
|
+
const modifiedOptions = {
|
|
22815
|
+
...options,
|
|
22816
|
+
ignore: [...options.ignore, ...patternsForFastGlob]
|
|
22817
|
+
};
|
|
22818
|
+
return {
|
|
22819
|
+
options: modifiedOptions,
|
|
22820
|
+
filter: createFilterFunction(predicate, options.cwd)
|
|
22821
|
+
};
|
|
24422
22822
|
};
|
|
24423
|
-
var createFilterFunction = (isIgnored) => {
|
|
22823
|
+
var createFilterFunction = (isIgnored, cwd) => {
|
|
24424
22824
|
const seen = /* @__PURE__ */ new Set();
|
|
22825
|
+
const basePath = cwd || process11.cwd();
|
|
22826
|
+
const pathCache = /* @__PURE__ */ new Map();
|
|
24425
22827
|
return (fastGlobResult) => {
|
|
24426
22828
|
const pathKey3 = nodePath.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
24427
|
-
if (seen.has(pathKey3)
|
|
22829
|
+
if (seen.has(pathKey3)) {
|
|
24428
22830
|
return false;
|
|
24429
22831
|
}
|
|
22832
|
+
if (isIgnored) {
|
|
22833
|
+
let absolutePath = pathCache.get(pathKey3);
|
|
22834
|
+
if (absolutePath === void 0) {
|
|
22835
|
+
absolutePath = nodePath.isAbsolute(pathKey3) ? pathKey3 : nodePath.resolve(basePath, pathKey3);
|
|
22836
|
+
pathCache.set(pathKey3, absolutePath);
|
|
22837
|
+
if (pathCache.size > 1e4) {
|
|
22838
|
+
pathCache.clear();
|
|
22839
|
+
}
|
|
22840
|
+
}
|
|
22841
|
+
if (isIgnored(absolutePath)) {
|
|
22842
|
+
return false;
|
|
22843
|
+
}
|
|
22844
|
+
}
|
|
24430
22845
|
seen.add(pathKey3);
|
|
24431
22846
|
return true;
|
|
24432
22847
|
};
|
|
24433
22848
|
};
|
|
24434
22849
|
var unionFastGlobResults = (results, filter2) => results.flat().filter((fastGlobResult) => filter2(fastGlobResult));
|
|
24435
22850
|
var convertNegativePatterns = (patterns, options) => {
|
|
22851
|
+
if (patterns.length > 0 && patterns.every((pattern) => isNegativePattern(pattern))) {
|
|
22852
|
+
patterns = ["**/*", ...patterns];
|
|
22853
|
+
}
|
|
24436
22854
|
const tasks = [];
|
|
24437
22855
|
while (patterns.length > 0) {
|
|
24438
22856
|
const index = patterns.findIndex((pattern) => isNegativePattern(pattern));
|
|
@@ -24460,17 +22878,27 @@ var convertNegativePatterns = (patterns, options) => {
|
|
|
24460
22878
|
}
|
|
24461
22879
|
return tasks;
|
|
24462
22880
|
};
|
|
22881
|
+
var applyParentDirectoryIgnoreAdjustments = (tasks) => tasks.map((task) => ({
|
|
22882
|
+
patterns: task.patterns,
|
|
22883
|
+
options: {
|
|
22884
|
+
...task.options,
|
|
22885
|
+
ignore: adjustIgnorePatternsForParentDirectories(task.patterns, task.options.ignore)
|
|
22886
|
+
}
|
|
22887
|
+
}));
|
|
24463
22888
|
var normalizeExpandDirectoriesOption = (options, cwd) => ({
|
|
24464
22889
|
...cwd ? { cwd } : {},
|
|
24465
22890
|
...Array.isArray(options) ? { files: options } : options
|
|
24466
22891
|
});
|
|
24467
22892
|
var generateTasks = async (patterns, options) => {
|
|
24468
22893
|
const globTasks = convertNegativePatterns(patterns, options);
|
|
24469
|
-
const { cwd, expandDirectories } = options;
|
|
22894
|
+
const { cwd, expandDirectories, fs: fsImplementation } = options;
|
|
24470
22895
|
if (!expandDirectories) {
|
|
24471
|
-
return globTasks;
|
|
22896
|
+
return applyParentDirectoryIgnoreAdjustments(globTasks);
|
|
24472
22897
|
}
|
|
24473
|
-
const directoryToGlobOptions =
|
|
22898
|
+
const directoryToGlobOptions = {
|
|
22899
|
+
...normalizeExpandDirectoriesOption(expandDirectories, cwd),
|
|
22900
|
+
fs: fsImplementation
|
|
22901
|
+
};
|
|
24474
22902
|
return Promise.all(globTasks.map(async (task) => {
|
|
24475
22903
|
let { patterns: patterns2, options: options2 } = task;
|
|
24476
22904
|
[
|
|
@@ -24478,45 +22906,45 @@ var generateTasks = async (patterns, options) => {
|
|
|
24478
22906
|
options2.ignore
|
|
24479
22907
|
] = await Promise.all([
|
|
24480
22908
|
directoryToGlob(patterns2, directoryToGlobOptions),
|
|
24481
|
-
directoryToGlob(options2.ignore, { cwd })
|
|
22909
|
+
directoryToGlob(options2.ignore, { cwd, fs: fsImplementation })
|
|
24482
22910
|
]);
|
|
22911
|
+
options2.ignore = adjustIgnorePatternsForParentDirectories(patterns2, options2.ignore);
|
|
24483
22912
|
return { patterns: patterns2, options: options2 };
|
|
24484
22913
|
}));
|
|
24485
22914
|
};
|
|
24486
22915
|
var generateTasksSync = (patterns, options) => {
|
|
24487
22916
|
const globTasks = convertNegativePatterns(patterns, options);
|
|
24488
|
-
const { cwd, expandDirectories } = options;
|
|
22917
|
+
const { cwd, expandDirectories, fs: fsImplementation } = options;
|
|
24489
22918
|
if (!expandDirectories) {
|
|
24490
|
-
return globTasks;
|
|
22919
|
+
return applyParentDirectoryIgnoreAdjustments(globTasks);
|
|
24491
22920
|
}
|
|
24492
|
-
const directoryToGlobSyncOptions =
|
|
22921
|
+
const directoryToGlobSyncOptions = {
|
|
22922
|
+
...normalizeExpandDirectoriesOption(expandDirectories, cwd),
|
|
22923
|
+
fs: fsImplementation
|
|
22924
|
+
};
|
|
24493
22925
|
return globTasks.map((task) => {
|
|
24494
22926
|
let { patterns: patterns2, options: options2 } = task;
|
|
24495
22927
|
patterns2 = directoryToGlobSync(patterns2, directoryToGlobSyncOptions);
|
|
24496
|
-
options2.ignore = directoryToGlobSync(options2.ignore, { cwd });
|
|
22928
|
+
options2.ignore = directoryToGlobSync(options2.ignore, { cwd, fs: fsImplementation });
|
|
22929
|
+
options2.ignore = adjustIgnorePatternsForParentDirectories(patterns2, options2.ignore);
|
|
24497
22930
|
return { patterns: patterns2, options: options2 };
|
|
24498
22931
|
});
|
|
24499
22932
|
};
|
|
24500
22933
|
var globby = normalizeArguments(async (patterns, options) => {
|
|
24501
|
-
const
|
|
24502
|
-
|
|
24503
|
-
filter2
|
|
24504
|
-
] = await Promise.all([
|
|
24505
|
-
generateTasks(patterns, options),
|
|
24506
|
-
getFilter(options)
|
|
24507
|
-
]);
|
|
22934
|
+
const { options: modifiedOptions, filter: filter2 } = await applyIgnoreFilesAndGetFilter(options);
|
|
22935
|
+
const tasks = await generateTasks(patterns, modifiedOptions);
|
|
24508
22936
|
const results = await Promise.all(tasks.map((task) => (0, import_fast_glob2.default)(task.patterns, task.options)));
|
|
24509
22937
|
return unionFastGlobResults(results, filter2);
|
|
24510
22938
|
});
|
|
24511
22939
|
var globbySync = normalizeArgumentsSync((patterns, options) => {
|
|
24512
|
-
const
|
|
24513
|
-
const
|
|
22940
|
+
const { options: modifiedOptions, filter: filter2 } = applyIgnoreFilesAndGetFilterSync(options);
|
|
22941
|
+
const tasks = generateTasksSync(patterns, modifiedOptions);
|
|
24514
22942
|
const results = tasks.map((task) => import_fast_glob2.default.sync(task.patterns, task.options));
|
|
24515
22943
|
return unionFastGlobResults(results, filter2);
|
|
24516
22944
|
});
|
|
24517
22945
|
var globbyStream = normalizeArgumentsSync((patterns, options) => {
|
|
24518
|
-
const
|
|
24519
|
-
const
|
|
22946
|
+
const { options: modifiedOptions, filter: filter2 } = applyIgnoreFilesAndGetFilterSync(options);
|
|
22947
|
+
const tasks = generateTasksSync(patterns, modifiedOptions);
|
|
24520
22948
|
const streams = tasks.map((task) => import_fast_glob2.default.stream(task.patterns, task.options));
|
|
24521
22949
|
if (streams.length === 0) {
|
|
24522
22950
|
return Readable4.from([]);
|
|
@@ -27302,7 +25730,7 @@ function hasTags(opts, logger) {
|
|
|
27302
25730
|
}
|
|
27303
25731
|
|
|
27304
25732
|
// src/utils/make-diff-predicate.js
|
|
27305
|
-
import
|
|
25733
|
+
import path11 from "node:path/posix";
|
|
27306
25734
|
|
|
27307
25735
|
// node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
27308
25736
|
var balanced = (a2, b, str2) => {
|
|
@@ -28186,11 +26614,11 @@ var qmarksTestNoExtDot = ([$0]) => {
|
|
|
28186
26614
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
28187
26615
|
};
|
|
28188
26616
|
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
28189
|
-
var
|
|
26617
|
+
var path10 = {
|
|
28190
26618
|
win32: { sep: "\\" },
|
|
28191
26619
|
posix: { sep: "/" }
|
|
28192
26620
|
};
|
|
28193
|
-
var sep = defaultPlatform === "win32" ?
|
|
26621
|
+
var sep = defaultPlatform === "win32" ? path10.win32.sep : path10.posix.sep;
|
|
28194
26622
|
minimatch.sep = sep;
|
|
28195
26623
|
var GLOBSTAR = Symbol("globstar **");
|
|
28196
26624
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -28892,7 +27320,7 @@ function makeDiffPredicate(committish, execOpts, context) {
|
|
|
28892
27320
|
}
|
|
28893
27321
|
function diffSinceIn(committish, location, opts) {
|
|
28894
27322
|
const args = ["diff", "--name-only", committish];
|
|
28895
|
-
const formattedLocation =
|
|
27323
|
+
const formattedLocation = path11.relative(opts.cwd, location);
|
|
28896
27324
|
if (formattedLocation) {
|
|
28897
27325
|
args.push("--", formattedLocation);
|
|
28898
27326
|
}
|
|
@@ -29022,7 +27450,7 @@ async function writeJsonFile(filePath, data) {
|
|
|
29022
27450
|
}
|
|
29023
27451
|
|
|
29024
27452
|
// src/lerna/package.js
|
|
29025
|
-
import
|
|
27453
|
+
import path12 from "node:path";
|
|
29026
27454
|
var PKG2 = Symbol("pkg");
|
|
29027
27455
|
var _location = Symbol("location");
|
|
29028
27456
|
var _rootPath = Symbol("rootPath");
|
|
@@ -29055,10 +27483,10 @@ var Package = class {
|
|
|
29055
27483
|
return this[_scripts];
|
|
29056
27484
|
}
|
|
29057
27485
|
get manifestLocation() {
|
|
29058
|
-
return
|
|
27486
|
+
return path12.join(this.location, "package.json");
|
|
29059
27487
|
}
|
|
29060
27488
|
get nodeModulesLocation() {
|
|
29061
|
-
return
|
|
27489
|
+
return path12.join(this.location, "node_modules");
|
|
29062
27490
|
}
|
|
29063
27491
|
// accessors
|
|
29064
27492
|
get version() {
|
|
@@ -29111,7 +27539,7 @@ function loadJsonFileSync(filePath) {
|
|
|
29111
27539
|
return JSON.parse(fs6.readFileSync(filePath, "utf-8"));
|
|
29112
27540
|
}
|
|
29113
27541
|
function normalize(results) {
|
|
29114
|
-
return results.map((fp) =>
|
|
27542
|
+
return results.map((fp) => path13.normalize(fp));
|
|
29115
27543
|
}
|
|
29116
27544
|
function getGlobOpts(rootPath, packageConfigs) {
|
|
29117
27545
|
const globOpts = {
|
|
@@ -29139,7 +27567,7 @@ function makeFileFinder(rootPath, packageConfigs) {
|
|
|
29139
27567
|
const promise = pMap(
|
|
29140
27568
|
Array.from(packageConfigs).sort(),
|
|
29141
27569
|
(globPath) => {
|
|
29142
|
-
let chain = globby(
|
|
27570
|
+
let chain = globby(path13.posix.join(globPath, fileName), options);
|
|
29143
27571
|
chain = chain.then((results) => results.sort());
|
|
29144
27572
|
chain = chain.then(normalize);
|
|
29145
27573
|
if (fileMapper) {
|
|
@@ -29168,7 +27596,7 @@ var Project = class {
|
|
|
29168
27596
|
config: {},
|
|
29169
27597
|
configNotFound: true,
|
|
29170
27598
|
// path.resolve(".", ...) starts from process.cwd()
|
|
29171
|
-
filepath:
|
|
27599
|
+
filepath: path13.resolve(cwd || ".", "lerna.json")
|
|
29172
27600
|
};
|
|
29173
27601
|
}
|
|
29174
27602
|
return obj;
|
|
@@ -29178,7 +27606,7 @@ var Project = class {
|
|
|
29178
27606
|
this.config = loaded.config;
|
|
29179
27607
|
this.configNotFound = loaded.configNotFound;
|
|
29180
27608
|
this.rootConfigLocation = loaded.filepath;
|
|
29181
|
-
this.rootPath =
|
|
27609
|
+
this.rootPath = path13.dirname(loaded.filepath);
|
|
29182
27610
|
this.logger.log(`lerna rootPath: ${this.rootPath}`);
|
|
29183
27611
|
}
|
|
29184
27612
|
get version() {
|
|
@@ -29188,7 +27616,7 @@ var Project = class {
|
|
|
29188
27616
|
this.config.version = val;
|
|
29189
27617
|
}
|
|
29190
27618
|
get packageConfigs() {
|
|
29191
|
-
const pnpmConfigLocation =
|
|
27619
|
+
const pnpmConfigLocation = path13.join(this.rootPath, "pnpm-workspace.yaml");
|
|
29192
27620
|
if (fs6.existsSync(pnpmConfigLocation)) {
|
|
29193
27621
|
this.logger.log(
|
|
29194
27622
|
"Package manager 'pnpm' detected. Resolving packages using 'pnpm-workspace.yaml'."
|
|
@@ -29202,7 +27630,7 @@ var Project = class {
|
|
|
29202
27630
|
}
|
|
29203
27631
|
return packages;
|
|
29204
27632
|
}
|
|
29205
|
-
const npmConfigLocation =
|
|
27633
|
+
const npmConfigLocation = path13.join(this.rootPath, "package.json");
|
|
29206
27634
|
if (fs6.existsSync(npmConfigLocation)) {
|
|
29207
27635
|
const { workspaces } = loadJsonFileSync(npmConfigLocation);
|
|
29208
27636
|
if (workspaces) {
|
|
@@ -29210,7 +27638,7 @@ var Project = class {
|
|
|
29210
27638
|
return workspaces;
|
|
29211
27639
|
}
|
|
29212
27640
|
}
|
|
29213
|
-
const lernaConfigLocation =
|
|
27641
|
+
const lernaConfigLocation = path13.join(this.rootPath, "lerna.json");
|
|
29214
27642
|
if (fs6.existsSync(lernaConfigLocation)) {
|
|
29215
27643
|
const { packages } = loadJsonFileSync(lernaConfigLocation);
|
|
29216
27644
|
if (packages) {
|
|
@@ -29227,7 +27655,7 @@ var Project = class {
|
|
|
29227
27655
|
getPackages() {
|
|
29228
27656
|
const fileFinder = makeFileFinder(this.rootPath, this.packageConfigs);
|
|
29229
27657
|
const mapper = (packageConfigPath) => loadJsonFile(packageConfigPath).then(
|
|
29230
|
-
(packageJson) => new Package(packageJson,
|
|
27658
|
+
(packageJson) => new Package(packageJson, path13.dirname(packageConfigPath), this.rootPath)
|
|
29231
27659
|
);
|
|
29232
27660
|
return fileFinder("package.json", (filePaths) => pMap(filePaths, mapper, { concurrency: 50 }));
|
|
29233
27661
|
}
|
|
@@ -29331,7 +27759,7 @@ async function getChangedPackages(latch, context) {
|
|
|
29331
27759
|
|
|
29332
27760
|
// src/utils/package-manager-commands.js
|
|
29333
27761
|
import { existsSync } from "node:fs";
|
|
29334
|
-
import
|
|
27762
|
+
import path14 from "node:path";
|
|
29335
27763
|
var packageManagerConfigurations = [
|
|
29336
27764
|
{
|
|
29337
27765
|
packageManager: "npm",
|
|
@@ -29356,7 +27784,7 @@ var packageManagerConfigurations = [
|
|
|
29356
27784
|
}
|
|
29357
27785
|
];
|
|
29358
27786
|
function getPackageManagerFromLockFile(location) {
|
|
29359
|
-
return packageManagerConfigurations.find(({ lockFile }) => existsSync(
|
|
27787
|
+
return packageManagerConfigurations.find(({ lockFile }) => existsSync(path14.join(location, lockFile)))?.packageManager ?? "npm";
|
|
29360
27788
|
}
|
|
29361
27789
|
function getLockFileFromPackageManager(packageManager) {
|
|
29362
27790
|
return packageManagerConfiguration(packageManager).lockFile;
|
|
@@ -29378,8 +27806,8 @@ function getUpdateLockFileCommand(packageManager, npmrc2) {
|
|
|
29378
27806
|
}
|
|
29379
27807
|
|
|
29380
27808
|
// src/prepare.js
|
|
29381
|
-
async function readJson(
|
|
29382
|
-
return JSON.parse(await fs7.readFile(
|
|
27809
|
+
async function readJson(path26) {
|
|
27810
|
+
return JSON.parse(await fs7.readFile(path26));
|
|
29383
27811
|
}
|
|
29384
27812
|
async function updateLernaJson(basePath, context) {
|
|
29385
27813
|
const {
|
|
@@ -29415,7 +27843,7 @@ async function updateLockfile(npmrc2, pkg, context) {
|
|
|
29415
27843
|
const { env, stdout, stderr, logger } = context;
|
|
29416
27844
|
const packageManager = getPackageManagerFromLockFile(pkg.location);
|
|
29417
27845
|
const packageFile = getLockFileFromPackageManager(packageManager);
|
|
29418
|
-
if (!existsSync2(
|
|
27846
|
+
if (!existsSync2(path15.join(pkg.location, packageFile))) {
|
|
29419
27847
|
return;
|
|
29420
27848
|
}
|
|
29421
27849
|
const [command, ...options] = getUpdateLockFileCommand(packageManager, npmrc2);
|
|
@@ -29487,8 +27915,8 @@ async function prepare_default(npmrc2, pluginConfig, context) {
|
|
|
29487
27915
|
nextRelease: { version },
|
|
29488
27916
|
logger
|
|
29489
27917
|
} = context;
|
|
29490
|
-
const basePath = pluginConfig.pkgRoot ?
|
|
29491
|
-
const rootPkg = new Package(readJson(
|
|
27918
|
+
const basePath = pluginConfig.pkgRoot ? path15.resolve(cwd, pluginConfig.pkgRoot) : cwd;
|
|
27919
|
+
const rootPkg = new Package(readJson(path15.join(basePath, "package.json")), basePath);
|
|
29492
27920
|
const { rootVersion = true } = pluginConfig;
|
|
29493
27921
|
const changed = await getChangedPackages(pluginConfig.latch, { cwd, logger, version });
|
|
29494
27922
|
if (changed.length === 0) {
|
|
@@ -29528,7 +27956,7 @@ function get_channel_default(channel) {
|
|
|
29528
27956
|
|
|
29529
27957
|
// src/get-registry.js
|
|
29530
27958
|
var import_rc = __toESM(require_rc(), 1);
|
|
29531
|
-
import
|
|
27959
|
+
import path16 from "node:path";
|
|
29532
27960
|
import getRegistryUrl from "registry-auth-token/registry-url.js";
|
|
29533
27961
|
|
|
29534
27962
|
// src/definitions/constants.js
|
|
@@ -29543,7 +27971,7 @@ function get_registry_default({ publishConfig: { registry } = {}, name }, { cwd,
|
|
|
29543
27971
|
(0, import_rc.default)(
|
|
29544
27972
|
"npm",
|
|
29545
27973
|
{ registry: OFFICIAL_REGISTRY },
|
|
29546
|
-
{ config: env.NPM_CONFIG_USERCONFIG ||
|
|
27974
|
+
{ config: env.NPM_CONFIG_USERCONFIG || path16.resolve(cwd, ".npmrc") }
|
|
29547
27975
|
)
|
|
29548
27976
|
);
|
|
29549
27977
|
}
|
|
@@ -29823,7 +28251,7 @@ async function publish_default(npmrc2, config, pkg, context) {
|
|
|
29823
28251
|
|
|
29824
28252
|
// src/set-npmrc-auth.js
|
|
29825
28253
|
import fs8 from "node:fs/promises";
|
|
29826
|
-
import
|
|
28254
|
+
import path17 from "node:path";
|
|
29827
28255
|
var import_nerf_dart = __toESM(require_nerf_dart(), 1);
|
|
29828
28256
|
var import_rc2 = __toESM(require_rc(), 1);
|
|
29829
28257
|
import getAuthToken from "registry-auth-token";
|
|
@@ -29832,14 +28260,14 @@ async function set_npmrc_auth_default(npmrc2, registry, { cwd, env: { NPM_TOKEN,
|
|
|
29832
28260
|
const { configs, config, ...rcConfig } = (0, import_rc2.default)(
|
|
29833
28261
|
"npm",
|
|
29834
28262
|
{ registry: OFFICIAL_REGISTRY },
|
|
29835
|
-
{ config: NPM_CONFIG_USERCONFIG ||
|
|
28263
|
+
{ config: NPM_CONFIG_USERCONFIG || path17.resolve(cwd, ".npmrc") }
|
|
29836
28264
|
);
|
|
29837
28265
|
if (configs) {
|
|
29838
28266
|
logger.log("Reading npm config from %s", configs.join(", "));
|
|
29839
28267
|
}
|
|
29840
28268
|
const currentConfig = configs ? (await Promise.all(configs.map((config2) => fs8.readFile(config2)))).join("\n") : "";
|
|
29841
28269
|
if (getAuthToken(registry, { npmrc: rcConfig })) {
|
|
29842
|
-
await fs8.mkdir(
|
|
28270
|
+
await fs8.mkdir(path17.dirname(npmrc2), { recursive: true });
|
|
29843
28271
|
await fs8.writeFile(npmrc2, currentConfig);
|
|
29844
28272
|
return;
|
|
29845
28273
|
}
|
|
@@ -29847,7 +28275,7 @@ async function set_npmrc_auth_default(npmrc2, registry, { cwd, env: { NPM_TOKEN,
|
|
|
29847
28275
|
const oldConfig = currentConfig ? `${currentConfig}
|
|
29848
28276
|
` : "";
|
|
29849
28277
|
const newConfig = `${(0, import_nerf_dart.default)(registry)}:_authToken = \${NPM_TOKEN}`;
|
|
29850
|
-
await fs8.mkdir(
|
|
28278
|
+
await fs8.mkdir(path17.dirname(npmrc2), { recursive: true });
|
|
29851
28279
|
await fs8.writeFile(npmrc2, `${oldConfig}${newConfig}`);
|
|
29852
28280
|
logger.log(`Wrote NPM_TOKEN to ${npmrc2}`);
|
|
29853
28281
|
} else {
|
|
@@ -30008,7 +28436,7 @@ var buddy_default = {
|
|
|
30008
28436
|
// node_modules/env-ci/node_modules/execa/index.js
|
|
30009
28437
|
var import_cross_spawn2 = __toESM(require_cross_spawn(), 1);
|
|
30010
28438
|
import { Buffer as Buffer6 } from "node:buffer";
|
|
30011
|
-
import
|
|
28439
|
+
import path19 from "node:path";
|
|
30012
28440
|
import childProcess from "node:child_process";
|
|
30013
28441
|
import process15 from "node:process";
|
|
30014
28442
|
|
|
@@ -30027,8 +28455,8 @@ function stripFinalNewline2(input) {
|
|
|
30027
28455
|
|
|
30028
28456
|
// node_modules/env-ci/node_modules/npm-run-path/index.js
|
|
30029
28457
|
import process12 from "node:process";
|
|
30030
|
-
import
|
|
30031
|
-
import { fileURLToPath as
|
|
28458
|
+
import path18 from "node:path";
|
|
28459
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
30032
28460
|
|
|
30033
28461
|
// node_modules/env-ci/node_modules/path-key/index.js
|
|
30034
28462
|
function pathKey2(options = {}) {
|
|
@@ -30050,8 +28478,8 @@ var npmRunPath2 = ({
|
|
|
30050
28478
|
execPath: execPath2 = process12.execPath,
|
|
30051
28479
|
addExecPath = true
|
|
30052
28480
|
} = {}) => {
|
|
30053
|
-
const cwdString = cwd instanceof URL ?
|
|
30054
|
-
const cwdPath =
|
|
28481
|
+
const cwdString = cwd instanceof URL ? fileURLToPath5(cwd) : cwd;
|
|
28482
|
+
const cwdPath = path18.resolve(cwdString);
|
|
30055
28483
|
const result = [];
|
|
30056
28484
|
if (preferLocal) {
|
|
30057
28485
|
applyPreferLocal2(result, cwdPath);
|
|
@@ -30059,19 +28487,19 @@ var npmRunPath2 = ({
|
|
|
30059
28487
|
if (addExecPath) {
|
|
30060
28488
|
applyExecPath2(result, execPath2, cwdPath);
|
|
30061
28489
|
}
|
|
30062
|
-
return [...result, pathOption].join(
|
|
28490
|
+
return [...result, pathOption].join(path18.delimiter);
|
|
30063
28491
|
};
|
|
30064
28492
|
var applyPreferLocal2 = (result, cwdPath) => {
|
|
30065
28493
|
let previous;
|
|
30066
28494
|
while (previous !== cwdPath) {
|
|
30067
|
-
result.push(
|
|
28495
|
+
result.push(path18.join(cwdPath, "node_modules/.bin"));
|
|
30068
28496
|
previous = cwdPath;
|
|
30069
|
-
cwdPath =
|
|
28497
|
+
cwdPath = path18.resolve(cwdPath, "..");
|
|
30070
28498
|
}
|
|
30071
28499
|
};
|
|
30072
28500
|
var applyExecPath2 = (result, execPath2, cwdPath) => {
|
|
30073
|
-
const execPathString = execPath2 instanceof URL ?
|
|
30074
|
-
result.push(
|
|
28501
|
+
const execPathString = execPath2 instanceof URL ? fileURLToPath5(execPath2) : execPath2;
|
|
28502
|
+
result.push(path18.resolve(cwdPath, execPathString, ".."));
|
|
30075
28503
|
};
|
|
30076
28504
|
var npmRunPathEnv2 = ({ env = process12.env, ...options } = {}) => {
|
|
30077
28505
|
env = { ...env };
|
|
@@ -31168,7 +29596,7 @@ var handleArguments = (file, args, options = {}) => {
|
|
|
31168
29596
|
};
|
|
31169
29597
|
options.env = getEnv2(options);
|
|
31170
29598
|
options.stdio = normalizeStdio(options);
|
|
31171
|
-
if (process15.platform === "win32" &&
|
|
29599
|
+
if (process15.platform === "win32" && path19.basename(file, ".exe") === "cmd") {
|
|
31172
29600
|
args.unshift("/q");
|
|
31173
29601
|
}
|
|
31174
29602
|
return { file, args, options, parsed };
|
|
@@ -32199,7 +30627,7 @@ async function verifyGit(context) {
|
|
|
32199
30627
|
|
|
32200
30628
|
// src/generate-notes.js
|
|
32201
30629
|
import { dirname } from "node:path";
|
|
32202
|
-
import { fileURLToPath as
|
|
30630
|
+
import { fileURLToPath as fileURLToPath11, format as format5 } from "node:url";
|
|
32203
30631
|
import conventionalChangelogAngular from "conventional-changelog-angular";
|
|
32204
30632
|
import * as writerModule from "conventional-changelog-writer";
|
|
32205
30633
|
|
|
@@ -32695,23 +31123,23 @@ var CommitParser = class {
|
|
|
32695
31123
|
var import_debug = __toESM(require_src(), 1);
|
|
32696
31124
|
import { createRequire } from "node:module";
|
|
32697
31125
|
import { extname as extname2, resolve } from "node:path";
|
|
32698
|
-
import { fileURLToPath as
|
|
31126
|
+
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
32699
31127
|
|
|
32700
31128
|
// node_modules/import-meta-resolve/lib/resolve.js
|
|
32701
31129
|
import assert2 from "node:assert";
|
|
32702
31130
|
import { statSync as statSync2, realpathSync } from "node:fs";
|
|
32703
31131
|
import process16 from "node:process";
|
|
32704
|
-
import { fileURLToPath as
|
|
32705
|
-
import
|
|
31132
|
+
import { fileURLToPath as fileURLToPath8, pathToFileURL } from "node:url";
|
|
31133
|
+
import path21 from "node:path";
|
|
32706
31134
|
import { builtinModules } from "node:module";
|
|
32707
31135
|
|
|
32708
31136
|
// node_modules/import-meta-resolve/lib/get-format.js
|
|
32709
|
-
import { fileURLToPath as
|
|
31137
|
+
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
32710
31138
|
|
|
32711
31139
|
// node_modules/import-meta-resolve/lib/package-json-reader.js
|
|
32712
31140
|
import fs9 from "node:fs";
|
|
32713
|
-
import
|
|
32714
|
-
import { fileURLToPath as
|
|
31141
|
+
import path20 from "node:path";
|
|
31142
|
+
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
32715
31143
|
|
|
32716
31144
|
// node_modules/import-meta-resolve/lib/errors.js
|
|
32717
31145
|
import v8 from "node:v8";
|
|
@@ -32828,8 +31256,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
|
|
|
32828
31256
|
* @param {string} [base]
|
|
32829
31257
|
* @param {string} [message]
|
|
32830
31258
|
*/
|
|
32831
|
-
(
|
|
32832
|
-
return `Invalid package config ${
|
|
31259
|
+
(path26, base, message) => {
|
|
31260
|
+
return `Invalid package config ${path26}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
32833
31261
|
},
|
|
32834
31262
|
Error
|
|
32835
31263
|
);
|
|
@@ -32861,8 +31289,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
|
|
|
32861
31289
|
* @param {string} base
|
|
32862
31290
|
* @param {boolean} [exactUrl]
|
|
32863
31291
|
*/
|
|
32864
|
-
(
|
|
32865
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${
|
|
31292
|
+
(path26, base, exactUrl = false) => {
|
|
31293
|
+
return `Cannot find ${exactUrl ? "module" : "package"} '${path26}' imported from ${base}`;
|
|
32866
31294
|
},
|
|
32867
31295
|
Error
|
|
32868
31296
|
);
|
|
@@ -32913,8 +31341,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
|
32913
31341
|
* @param {string} extension
|
|
32914
31342
|
* @param {string} path
|
|
32915
31343
|
*/
|
|
32916
|
-
(extension,
|
|
32917
|
-
return `Unknown file extension "${extension}" for ${
|
|
31344
|
+
(extension, path26) => {
|
|
31345
|
+
return `Unknown file extension "${extension}" for ${path26}`;
|
|
32918
31346
|
},
|
|
32919
31347
|
TypeError
|
|
32920
31348
|
);
|
|
@@ -33061,7 +31489,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
33061
31489
|
}
|
|
33062
31490
|
let string;
|
|
33063
31491
|
try {
|
|
33064
|
-
string = fs9.readFileSync(
|
|
31492
|
+
string = fs9.readFileSync(path20.toNamespacedPath(jsonPath), "utf8");
|
|
33065
31493
|
} catch (error) {
|
|
33066
31494
|
const exception2 = (
|
|
33067
31495
|
/** @type {ErrnoException} */
|
|
@@ -33092,7 +31520,7 @@ function read(jsonPath, { base, specifier }) {
|
|
|
33092
31520
|
);
|
|
33093
31521
|
const error = new ERR_INVALID_PACKAGE_CONFIG(
|
|
33094
31522
|
jsonPath,
|
|
33095
|
-
(base ? `"${specifier}" from ` : "") +
|
|
31523
|
+
(base ? `"${specifier}" from ` : "") + fileURLToPath6(base || specifier),
|
|
33096
31524
|
cause.message
|
|
33097
31525
|
);
|
|
33098
31526
|
error.cause = cause;
|
|
@@ -33125,7 +31553,7 @@ function getPackageScopeConfig(resolved) {
|
|
|
33125
31553
|
if (packageJSONPath2.endsWith("node_modules/package.json")) {
|
|
33126
31554
|
break;
|
|
33127
31555
|
}
|
|
33128
|
-
const packageConfig = read(
|
|
31556
|
+
const packageConfig = read(fileURLToPath6(packageJSONUrl), {
|
|
33129
31557
|
specifier: resolved
|
|
33130
31558
|
});
|
|
33131
31559
|
if (packageConfig.exists) {
|
|
@@ -33137,7 +31565,7 @@ function getPackageScopeConfig(resolved) {
|
|
|
33137
31565
|
break;
|
|
33138
31566
|
}
|
|
33139
31567
|
}
|
|
33140
|
-
const packageJSONPath =
|
|
31568
|
+
const packageJSONPath = fileURLToPath6(packageJSONUrl);
|
|
33141
31569
|
return {
|
|
33142
31570
|
pjsonPath: packageJSONPath,
|
|
33143
31571
|
exists: false,
|
|
@@ -33217,7 +31645,7 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
|
|
|
33217
31645
|
if (ignoreErrors) {
|
|
33218
31646
|
return void 0;
|
|
33219
31647
|
}
|
|
33220
|
-
const filepath =
|
|
31648
|
+
const filepath = fileURLToPath7(url);
|
|
33221
31649
|
throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
|
|
33222
31650
|
}
|
|
33223
31651
|
function getHttpProtocolModuleFormat() {
|
|
@@ -33279,10 +31707,10 @@ function emitInvalidSegmentDeprecation(target, request, match2, packageJsonUrl,
|
|
|
33279
31707
|
if (process16.noDeprecation) {
|
|
33280
31708
|
return;
|
|
33281
31709
|
}
|
|
33282
|
-
const pjsonPath =
|
|
31710
|
+
const pjsonPath = fileURLToPath8(packageJsonUrl);
|
|
33283
31711
|
const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
|
|
33284
31712
|
process16.emitWarning(
|
|
33285
|
-
`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match2 ? "" : `matched to "${match2}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${
|
|
31713
|
+
`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match2 ? "" : `matched to "${match2}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath8(base)}` : ""}.`,
|
|
33286
31714
|
"DeprecationWarning",
|
|
33287
31715
|
"DEP0166"
|
|
33288
31716
|
);
|
|
@@ -33293,9 +31721,9 @@ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
|
|
|
33293
31721
|
}
|
|
33294
31722
|
const format6 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
|
|
33295
31723
|
if (format6 !== "module") return;
|
|
33296
|
-
const urlPath =
|
|
33297
|
-
const packagePath =
|
|
33298
|
-
const basePath =
|
|
31724
|
+
const urlPath = fileURLToPath8(url.href);
|
|
31725
|
+
const packagePath = fileURLToPath8(new URL(".", packageJsonUrl));
|
|
31726
|
+
const basePath = fileURLToPath8(base);
|
|
33299
31727
|
if (!main) {
|
|
33300
31728
|
process16.emitWarning(
|
|
33301
31729
|
`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(
|
|
@@ -33305,7 +31733,7 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
|
33305
31733
|
"DeprecationWarning",
|
|
33306
31734
|
"DEP0151"
|
|
33307
31735
|
);
|
|
33308
|
-
} else if (
|
|
31736
|
+
} else if (path21.resolve(packagePath, main) !== urlPath) {
|
|
33309
31737
|
process16.emitWarning(
|
|
33310
31738
|
`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
|
|
33311
31739
|
packagePath.length
|
|
@@ -33316,16 +31744,16 @@ Default "index" lookups for the main are deprecated for ES modules.`,
|
|
|
33316
31744
|
);
|
|
33317
31745
|
}
|
|
33318
31746
|
}
|
|
33319
|
-
function tryStatSync(
|
|
31747
|
+
function tryStatSync(path26) {
|
|
33320
31748
|
try {
|
|
33321
|
-
return statSync2(
|
|
31749
|
+
return statSync2(path26);
|
|
33322
31750
|
} catch {
|
|
33323
31751
|
}
|
|
33324
31752
|
}
|
|
33325
31753
|
function fileExists(url) {
|
|
33326
31754
|
const stats = statSync2(url, { throwIfNoEntry: false });
|
|
33327
|
-
const
|
|
33328
|
-
return
|
|
31755
|
+
const isFile = stats ? stats.isFile() : void 0;
|
|
31756
|
+
return isFile === null || isFile === void 0 ? false : isFile;
|
|
33329
31757
|
}
|
|
33330
31758
|
function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
33331
31759
|
let guess;
|
|
@@ -33368,8 +31796,8 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
|
|
|
33368
31796
|
return guess;
|
|
33369
31797
|
}
|
|
33370
31798
|
throw new ERR_MODULE_NOT_FOUND(
|
|
33371
|
-
|
|
33372
|
-
|
|
31799
|
+
fileURLToPath8(new URL(".", packageJsonUrl)),
|
|
31800
|
+
fileURLToPath8(base)
|
|
33373
31801
|
);
|
|
33374
31802
|
}
|
|
33375
31803
|
function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
@@ -33377,12 +31805,12 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
33377
31805
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
33378
31806
|
resolved.pathname,
|
|
33379
31807
|
'must not include encoded "/" or "\\" characters',
|
|
33380
|
-
|
|
31808
|
+
fileURLToPath8(base)
|
|
33381
31809
|
);
|
|
33382
31810
|
}
|
|
33383
31811
|
let filePath;
|
|
33384
31812
|
try {
|
|
33385
|
-
filePath =
|
|
31813
|
+
filePath = fileURLToPath8(resolved);
|
|
33386
31814
|
} catch (error) {
|
|
33387
31815
|
const cause = (
|
|
33388
31816
|
/** @type {ErrnoException} */
|
|
@@ -33396,14 +31824,14 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
33396
31824
|
filePath.endsWith("/") ? filePath.slice(-1) : filePath
|
|
33397
31825
|
);
|
|
33398
31826
|
if (stats && stats.isDirectory()) {
|
|
33399
|
-
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath,
|
|
31827
|
+
const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath8(base));
|
|
33400
31828
|
error.url = String(resolved);
|
|
33401
31829
|
throw error;
|
|
33402
31830
|
}
|
|
33403
31831
|
if (!stats || !stats.isFile()) {
|
|
33404
31832
|
const error = new ERR_MODULE_NOT_FOUND(
|
|
33405
31833
|
filePath || resolved.pathname,
|
|
33406
|
-
base &&
|
|
31834
|
+
base && fileURLToPath8(base),
|
|
33407
31835
|
true
|
|
33408
31836
|
);
|
|
33409
31837
|
error.url = String(resolved);
|
|
@@ -33412,7 +31840,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
33412
31840
|
if (!preserveSymlinks) {
|
|
33413
31841
|
const real = realpathSync(filePath);
|
|
33414
31842
|
const { search, hash } = resolved;
|
|
33415
|
-
resolved = pathToFileURL(real + (filePath.endsWith(
|
|
31843
|
+
resolved = pathToFileURL(real + (filePath.endsWith(path21.sep) ? "/" : ""));
|
|
33416
31844
|
resolved.search = search;
|
|
33417
31845
|
resolved.hash = hash;
|
|
33418
31846
|
}
|
|
@@ -33421,33 +31849,33 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
33421
31849
|
function importNotDefined(specifier, packageJsonUrl, base) {
|
|
33422
31850
|
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
|
|
33423
31851
|
specifier,
|
|
33424
|
-
packageJsonUrl &&
|
|
33425
|
-
|
|
31852
|
+
packageJsonUrl && fileURLToPath8(new URL(".", packageJsonUrl)),
|
|
31853
|
+
fileURLToPath8(base)
|
|
33426
31854
|
);
|
|
33427
31855
|
}
|
|
33428
31856
|
function exportsNotFound(subpath, packageJsonUrl, base) {
|
|
33429
31857
|
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
|
|
33430
|
-
|
|
31858
|
+
fileURLToPath8(new URL(".", packageJsonUrl)),
|
|
33431
31859
|
subpath,
|
|
33432
|
-
base &&
|
|
31860
|
+
base && fileURLToPath8(base)
|
|
33433
31861
|
);
|
|
33434
31862
|
}
|
|
33435
31863
|
function throwInvalidSubpath(request, match2, packageJsonUrl, internal, base) {
|
|
33436
|
-
const reason = `request is not a valid match in pattern "${match2}" for the "${internal ? "imports" : "exports"}" resolution of ${
|
|
31864
|
+
const reason = `request is not a valid match in pattern "${match2}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath8(packageJsonUrl)}`;
|
|
33437
31865
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
33438
31866
|
request,
|
|
33439
31867
|
reason,
|
|
33440
|
-
base &&
|
|
31868
|
+
base && fileURLToPath8(base)
|
|
33441
31869
|
);
|
|
33442
31870
|
}
|
|
33443
31871
|
function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
33444
31872
|
target = typeof target === "object" && target !== null ? JSON.stringify(target, null, "") : `${target}`;
|
|
33445
31873
|
return new ERR_INVALID_PACKAGE_TARGET(
|
|
33446
|
-
|
|
31874
|
+
fileURLToPath8(new URL(".", packageJsonUrl)),
|
|
33447
31875
|
subpath,
|
|
33448
31876
|
target,
|
|
33449
31877
|
internal,
|
|
33450
|
-
base &&
|
|
31878
|
+
base && fileURLToPath8(base)
|
|
33451
31879
|
);
|
|
33452
31880
|
}
|
|
33453
31881
|
function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions) {
|
|
@@ -33602,7 +32030,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
33602
32030
|
const key = keys[i2];
|
|
33603
32031
|
if (isArrayIndex(key)) {
|
|
33604
32032
|
throw new ERR_INVALID_PACKAGE_CONFIG2(
|
|
33605
|
-
|
|
32033
|
+
fileURLToPath8(packageJsonUrl),
|
|
33606
32034
|
base,
|
|
33607
32035
|
'"exports" cannot contain numeric property keys.'
|
|
33608
32036
|
);
|
|
@@ -33658,7 +32086,7 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
|
33658
32086
|
isConditionalSugar = currentIsConditionalSugar;
|
|
33659
32087
|
} else if (isConditionalSugar !== currentIsConditionalSugar) {
|
|
33660
32088
|
throw new ERR_INVALID_PACKAGE_CONFIG2(
|
|
33661
|
-
|
|
32089
|
+
fileURLToPath8(packageJsonUrl),
|
|
33662
32090
|
base,
|
|
33663
32091
|
`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`
|
|
33664
32092
|
);
|
|
@@ -33670,11 +32098,11 @@ function emitTrailingSlashPatternDeprecation(match2, pjsonUrl, base) {
|
|
|
33670
32098
|
if (process16.noDeprecation) {
|
|
33671
32099
|
return;
|
|
33672
32100
|
}
|
|
33673
|
-
const pjsonPath =
|
|
32101
|
+
const pjsonPath = fileURLToPath8(pjsonUrl);
|
|
33674
32102
|
if (emittedPackageWarnings.has(pjsonPath + "|" + match2)) return;
|
|
33675
32103
|
emittedPackageWarnings.add(pjsonPath + "|" + match2);
|
|
33676
32104
|
process16.emitWarning(
|
|
33677
|
-
`Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${
|
|
32105
|
+
`Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath8(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`,
|
|
33678
32106
|
"DeprecationWarning",
|
|
33679
32107
|
"DEP0155"
|
|
33680
32108
|
);
|
|
@@ -33766,7 +32194,7 @@ function patternKeyCompare(a2, b) {
|
|
|
33766
32194
|
function packageImportsResolve(name, base, conditions) {
|
|
33767
32195
|
if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
|
|
33768
32196
|
const reason = "is not a valid internal imports specifier name";
|
|
33769
|
-
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason,
|
|
32197
|
+
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath8(base));
|
|
33770
32198
|
}
|
|
33771
32199
|
let packageJsonUrl;
|
|
33772
32200
|
const packageConfig = getPackageScopeConfig(base);
|
|
@@ -33850,7 +32278,7 @@ function parsePackageName(specifier, base) {
|
|
|
33850
32278
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
33851
32279
|
specifier,
|
|
33852
32280
|
"is not a valid package name",
|
|
33853
|
-
|
|
32281
|
+
fileURLToPath8(base)
|
|
33854
32282
|
);
|
|
33855
32283
|
}
|
|
33856
32284
|
const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
|
|
@@ -33881,7 +32309,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
33881
32309
|
"./node_modules/" + packageName + "/package.json",
|
|
33882
32310
|
base
|
|
33883
32311
|
);
|
|
33884
|
-
let packageJsonPath =
|
|
32312
|
+
let packageJsonPath = fileURLToPath8(packageJsonUrl);
|
|
33885
32313
|
let lastPath;
|
|
33886
32314
|
do {
|
|
33887
32315
|
const stat = tryStatSync(packageJsonPath.slice(0, -13));
|
|
@@ -33891,7 +32319,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
33891
32319
|
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
|
|
33892
32320
|
packageJsonUrl
|
|
33893
32321
|
);
|
|
33894
|
-
packageJsonPath =
|
|
32322
|
+
packageJsonPath = fileURLToPath8(packageJsonUrl);
|
|
33895
32323
|
continue;
|
|
33896
32324
|
}
|
|
33897
32325
|
const packageConfig2 = read(packageJsonPath, { base, specifier });
|
|
@@ -33909,7 +32337,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
33909
32337
|
}
|
|
33910
32338
|
return new URL(packageSubpath, packageJsonUrl);
|
|
33911
32339
|
} while (packageJsonPath.length !== lastPath.length);
|
|
33912
|
-
throw new ERR_MODULE_NOT_FOUND(packageName,
|
|
32340
|
+
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath8(base), false);
|
|
33913
32341
|
}
|
|
33914
32342
|
function isRelativeSpecifier(specifier) {
|
|
33915
32343
|
if (specifier[0] === ".") {
|
|
@@ -33983,7 +32411,7 @@ async function tryImport(fileURL) {
|
|
|
33983
32411
|
}
|
|
33984
32412
|
try {
|
|
33985
32413
|
debug(`Trying to determine file extension for '${fileURL.href}'`);
|
|
33986
|
-
const filePath =
|
|
32414
|
+
const filePath = fileURLToPath9(fileURL);
|
|
33987
32415
|
const asJSON = extname2(filePath) === ".json";
|
|
33988
32416
|
debug(`Trying to import '${fileURL.href}'${asJSON ? " as JSON" : ""}`);
|
|
33989
32417
|
return asJSON ? require2(filePath) : await import(fileURL);
|
|
@@ -34100,27 +32528,27 @@ var into_stream_default = intoStream;
|
|
|
34100
32528
|
intoStream.object = baseIntoStream.bind(void 0, true);
|
|
34101
32529
|
|
|
34102
32530
|
// node_modules/read-package-up/index.js
|
|
34103
|
-
import
|
|
32531
|
+
import path24 from "node:path";
|
|
34104
32532
|
|
|
34105
32533
|
// node_modules/find-up-simple/index.js
|
|
34106
32534
|
import process17 from "node:process";
|
|
34107
|
-
import
|
|
34108
|
-
import { fileURLToPath as
|
|
34109
|
-
import
|
|
34110
|
-
var
|
|
32535
|
+
import fsPromises2 from "node:fs/promises";
|
|
32536
|
+
import { fileURLToPath as fileURLToPath10 } from "node:url";
|
|
32537
|
+
import path22 from "node:path";
|
|
32538
|
+
var toPath3 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath10(urlOrPath) : urlOrPath;
|
|
34111
32539
|
async function findUp(name, {
|
|
34112
32540
|
cwd = process17.cwd(),
|
|
34113
32541
|
type: type2 = "file",
|
|
34114
32542
|
stopAt
|
|
34115
32543
|
} = {}) {
|
|
34116
|
-
let directory =
|
|
34117
|
-
const { root } =
|
|
34118
|
-
stopAt =
|
|
34119
|
-
const isAbsoluteName =
|
|
32544
|
+
let directory = path22.resolve(toPath3(cwd) ?? "");
|
|
32545
|
+
const { root } = path22.parse(directory);
|
|
32546
|
+
stopAt = path22.resolve(directory, toPath3(stopAt ?? root));
|
|
32547
|
+
const isAbsoluteName = path22.isAbsolute(name);
|
|
34120
32548
|
while (directory) {
|
|
34121
|
-
const filePath = isAbsoluteName ? name :
|
|
32549
|
+
const filePath = isAbsoluteName ? name : path22.join(directory, name);
|
|
34122
32550
|
try {
|
|
34123
|
-
const stats = await
|
|
32551
|
+
const stats = await fsPromises2.stat(filePath);
|
|
34124
32552
|
if (type2 === "file" && stats.isFile() || type2 === "directory" && stats.isDirectory()) {
|
|
34125
32553
|
return filePath;
|
|
34126
32554
|
}
|
|
@@ -34129,13 +32557,13 @@ async function findUp(name, {
|
|
|
34129
32557
|
if (directory === stopAt || directory === root) {
|
|
34130
32558
|
break;
|
|
34131
32559
|
}
|
|
34132
|
-
directory =
|
|
32560
|
+
directory = path22.dirname(directory);
|
|
34133
32561
|
}
|
|
34134
32562
|
}
|
|
34135
32563
|
|
|
34136
32564
|
// node_modules/read-package-up/node_modules/read-pkg/index.js
|
|
34137
|
-
import
|
|
34138
|
-
import
|
|
32565
|
+
import fsPromises3 from "node:fs/promises";
|
|
32566
|
+
import path23 from "node:path";
|
|
34139
32567
|
|
|
34140
32568
|
// node_modules/read-package-up/node_modules/parse-json/index.js
|
|
34141
32569
|
var import_code_frame = __toESM(require_lib5(), 1);
|
|
@@ -34261,7 +32689,7 @@ function parseJson(string, reviver, fileName) {
|
|
|
34261
32689
|
|
|
34262
32690
|
// node_modules/read-package-up/node_modules/read-pkg/index.js
|
|
34263
32691
|
var import_normalize_package_data = __toESM(require_normalize(), 1);
|
|
34264
|
-
var getPackagePath = (cwd) =>
|
|
32692
|
+
var getPackagePath = (cwd) => path23.resolve(toPath(cwd) ?? ".", "package.json");
|
|
34265
32693
|
var _readPackage = (file, normalize2) => {
|
|
34266
32694
|
const json2 = typeof file === "string" ? parseJson(file) : file;
|
|
34267
32695
|
if (normalize2) {
|
|
@@ -34270,7 +32698,7 @@ var _readPackage = (file, normalize2) => {
|
|
|
34270
32698
|
return json2;
|
|
34271
32699
|
};
|
|
34272
32700
|
async function readPackage({ cwd, normalize: normalize2 = true } = {}) {
|
|
34273
|
-
const packageFile = await
|
|
32701
|
+
const packageFile = await fsPromises3.readFile(getPackagePath(cwd), "utf8");
|
|
34274
32702
|
return _readPackage(packageFile, normalize2);
|
|
34275
32703
|
}
|
|
34276
32704
|
|
|
@@ -34281,7 +32709,7 @@ async function readPackageUp(options) {
|
|
|
34281
32709
|
return;
|
|
34282
32710
|
}
|
|
34283
32711
|
return {
|
|
34284
|
-
packageJson: await readPackage({ ...options, cwd:
|
|
32712
|
+
packageJson: await readPackage({ ...options, cwd: path24.dirname(filePath) }),
|
|
34285
32713
|
path: filePath
|
|
34286
32714
|
};
|
|
34287
32715
|
}
|
|
@@ -34366,7 +32794,7 @@ async function loadChangelogConfig(pluginConfig, context) {
|
|
|
34366
32794
|
const { preset, config, parserOpts, writerOpts, presetConfig } = pluginConfig;
|
|
34367
32795
|
const { cwd } = context;
|
|
34368
32796
|
let loadedConfig;
|
|
34369
|
-
const __dirname = dirname(
|
|
32797
|
+
const __dirname = dirname(fileURLToPath11(import.meta.url));
|
|
34370
32798
|
if (preset) {
|
|
34371
32799
|
const presetPackage = `conventional-changelog-${preset.toLowerCase()}`;
|
|
34372
32800
|
loadedConfig = await (await import_from_esm_default.silent(__dirname, presetPackage) || await import_from_esm_default(cwd, presetPackage))(presetConfig);
|
|
@@ -34406,12 +32834,12 @@ async function generateNotes(pluginConfig, context) {
|
|
|
34406
32834
|
}
|
|
34407
32835
|
return parsedCommit;
|
|
34408
32836
|
}
|
|
34409
|
-
const [match2, auth, host,
|
|
32837
|
+
const [match2, auth, host, path26] = (
|
|
34410
32838
|
/* eslint-disable-next-line security/detect-unsafe-regex, sonarjs/slow-regex -- technical debt */
|
|
34411
32839
|
/^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/.exec(repositoryUrl) || []
|
|
34412
32840
|
);
|
|
34413
32841
|
const authString = auth ? `${auth}@` : "";
|
|
34414
|
-
const url = new URL(match2 ? `ssh://${authString}${host}/${
|
|
32842
|
+
const url = new URL(match2 ? `ssh://${authString}${host}/${path26}` : repositoryUrl);
|
|
34415
32843
|
const { hostname, pathname } = url;
|
|
34416
32844
|
let { port, protocol } = url;
|
|
34417
32845
|
port = protocol.includes("ssh") ? "" : port;
|
|
@@ -34477,9 +32905,9 @@ var defaultConfig = {
|
|
|
34477
32905
|
};
|
|
34478
32906
|
function temporaryFile(options) {
|
|
34479
32907
|
const { name } = options;
|
|
34480
|
-
const directory =
|
|
32908
|
+
const directory = path25.join(tempdir, randomBytes(16).toString("hex"));
|
|
34481
32909
|
fs10.mkdirSync(directory);
|
|
34482
|
-
return
|
|
32910
|
+
return path25.join(directory, name);
|
|
34483
32911
|
}
|
|
34484
32912
|
function defaultTo(value, defaultValue) {
|
|
34485
32913
|
return value === null || value === void 0 ? defaultValue : value;
|