@yamada-ui/cli 2.0.0-dev-20250815213232 → 2.0.0-dev-20250816072830
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 +1018 -1961
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -9,23 +9,30 @@ import { fileURLToPath } from "node:url";
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { format, promisify } from "node:util";
|
|
11
11
|
import os from "node:os";
|
|
12
|
-
import { existsSync, realpathSync } from "fs";
|
|
12
|
+
import fs, { existsSync, realpathSync, statSync } from "fs";
|
|
13
13
|
import os$1 from "os";
|
|
14
14
|
import path$1 from "path";
|
|
15
|
-
import fs from "node:fs";
|
|
15
|
+
import fs$1 from "node:fs";
|
|
16
16
|
import tty from "node:tty";
|
|
17
|
+
import semverDiff from "semver/functions/diff.js";
|
|
18
|
+
import semverGt from "semver/functions/gt.js";
|
|
19
|
+
import semver from "semver";
|
|
17
20
|
import boxen from "boxen";
|
|
21
|
+
import { getObject, isArray, isObject, isString, isUndefined, omitObject } from "@yamada-ui/utils";
|
|
22
|
+
import { mkdir, readFile, readdir, writeFile } from "fs/promises";
|
|
23
|
+
import { Listr } from "listr2";
|
|
18
24
|
import ora from "ora";
|
|
19
25
|
import prompts from "prompts";
|
|
20
|
-
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
21
26
|
import { execSync } from "child_process";
|
|
22
|
-
import { getObject, isArray, isObject, isString, omitObject } from "@yamada-ui/utils";
|
|
23
|
-
import { build } from "esbuild";
|
|
24
|
-
import nodeEval from "node-eval";
|
|
25
|
-
import { Script } from "vm";
|
|
26
27
|
import "validate-npm-package-name";
|
|
27
28
|
import YAML from "yamljs";
|
|
28
29
|
import { format as format$1, resolveConfig, resolveConfigFile } from "prettier";
|
|
30
|
+
import { build } from "esbuild";
|
|
31
|
+
import nodeEval from "node-eval";
|
|
32
|
+
import { Script } from "vm";
|
|
33
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
34
|
+
import fetch from "node-fetch";
|
|
35
|
+
import { rimraf } from "rimraf";
|
|
29
36
|
import { ESLint } from "eslint";
|
|
30
37
|
|
|
31
38
|
//#region rolldown:runtime
|
|
@@ -60,7 +67,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
60
67
|
//#endregion
|
|
61
68
|
//#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
62
69
|
var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js": ((exports, module) => {
|
|
63
|
-
var constants$
|
|
70
|
+
var constants$1 = __require("constants");
|
|
64
71
|
var origCwd$1 = process.cwd;
|
|
65
72
|
var cwd$1 = null;
|
|
66
73
|
var platform$1 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
@@ -79,9 +86,9 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
79
86
|
};
|
|
80
87
|
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir$1);
|
|
81
88
|
}
|
|
82
|
-
module.exports = patch$
|
|
83
|
-
function patch$
|
|
84
|
-
if (constants$
|
|
89
|
+
module.exports = patch$3;
|
|
90
|
+
function patch$3(fs$9) {
|
|
91
|
+
if (constants$1.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$9);
|
|
85
92
|
if (!fs$9.lutimes) patchLutimes(fs$9);
|
|
86
93
|
fs$9.chown = chownFix(fs$9.chown);
|
|
87
94
|
fs$9.fchown = chownFix(fs$9.fchown);
|
|
@@ -168,7 +175,7 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
168
175
|
})(fs$9.readSync);
|
|
169
176
|
function patchLchmod(fs$10) {
|
|
170
177
|
fs$10.lchmod = function(path$9, mode, callback) {
|
|
171
|
-
fs$10.open(path$9, constants$
|
|
178
|
+
fs$10.open(path$9, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode, function(err, fd) {
|
|
172
179
|
if (err) {
|
|
173
180
|
if (callback) callback(err);
|
|
174
181
|
return;
|
|
@@ -181,7 +188,7 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
181
188
|
});
|
|
182
189
|
};
|
|
183
190
|
fs$10.lchmodSync = function(path$9, mode) {
|
|
184
|
-
var fd = fs$10.openSync(path$9, constants$
|
|
191
|
+
var fd = fs$10.openSync(path$9, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode);
|
|
185
192
|
var threw = true;
|
|
186
193
|
var ret;
|
|
187
194
|
try {
|
|
@@ -197,9 +204,9 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
197
204
|
};
|
|
198
205
|
}
|
|
199
206
|
function patchLutimes(fs$10) {
|
|
200
|
-
if (constants$
|
|
207
|
+
if (constants$1.hasOwnProperty("O_SYMLINK") && fs$10.futimes) {
|
|
201
208
|
fs$10.lutimes = function(path$9, at, mt, cb) {
|
|
202
|
-
fs$10.open(path$9, constants$
|
|
209
|
+
fs$10.open(path$9, constants$1.O_SYMLINK, function(er, fd) {
|
|
203
210
|
if (er) {
|
|
204
211
|
if (cb) cb(er);
|
|
205
212
|
return;
|
|
@@ -212,7 +219,7 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
212
219
|
});
|
|
213
220
|
};
|
|
214
221
|
fs$10.lutimesSync = function(path$9, at, mt) {
|
|
215
|
-
var fd = fs$10.openSync(path$9, constants$
|
|
222
|
+
var fd = fs$10.openSync(path$9, constants$1.O_SYMLINK);
|
|
216
223
|
var ret;
|
|
217
224
|
var threw = true;
|
|
218
225
|
try {
|
|
@@ -444,9 +451,9 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
444
451
|
return queue$2;
|
|
445
452
|
} });
|
|
446
453
|
}
|
|
447
|
-
var debug$
|
|
448
|
-
if (util$2.debuglog) debug$
|
|
449
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug$
|
|
454
|
+
var debug$1 = noop$1;
|
|
455
|
+
if (util$2.debuglog) debug$1 = util$2.debuglog("gfs4");
|
|
456
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug$1 = function() {
|
|
450
457
|
var m = util$2.format.apply(util$2, arguments);
|
|
451
458
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
452
459
|
console.error(m);
|
|
@@ -473,19 +480,19 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
473
480
|
return closeSync;
|
|
474
481
|
})(fs$8.closeSync);
|
|
475
482
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
476
|
-
debug$
|
|
483
|
+
debug$1(fs$8[gracefulQueue$1]);
|
|
477
484
|
__require("assert").equal(fs$8[gracefulQueue$1].length, 0);
|
|
478
485
|
});
|
|
479
486
|
}
|
|
480
487
|
if (!global[gracefulQueue$1]) publishQueue$1(global, fs$8[gracefulQueue$1]);
|
|
481
|
-
module.exports = patch$
|
|
488
|
+
module.exports = patch$2(clone$2(fs$8));
|
|
482
489
|
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$8.__patched) {
|
|
483
|
-
module.exports = patch$
|
|
490
|
+
module.exports = patch$2(fs$8);
|
|
484
491
|
fs$8.__patched = true;
|
|
485
492
|
}
|
|
486
|
-
function patch$
|
|
493
|
+
function patch$2(fs$9) {
|
|
487
494
|
polyfills$1(fs$9);
|
|
488
|
-
fs$9.gracefulify = patch$
|
|
495
|
+
fs$9.gracefulify = patch$2;
|
|
489
496
|
fs$9.createReadStream = createReadStream;
|
|
490
497
|
fs$9.createWriteStream = createWriteStream;
|
|
491
498
|
var fs$readFile = fs$9.readFile;
|
|
@@ -558,18 +565,18 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
558
565
|
}
|
|
559
566
|
var fs$copyFile = fs$9.copyFile;
|
|
560
567
|
if (fs$copyFile) fs$9.copyFile = copyFile;
|
|
561
|
-
function copyFile(src
|
|
568
|
+
function copyFile(src, dest, flags, cb) {
|
|
562
569
|
if (typeof flags === "function") {
|
|
563
570
|
cb = flags;
|
|
564
571
|
flags = 0;
|
|
565
572
|
}
|
|
566
|
-
return go$copyFile(src
|
|
567
|
-
function go$copyFile(src$
|
|
568
|
-
return fs$copyFile(src$
|
|
573
|
+
return go$copyFile(src, dest, flags, cb);
|
|
574
|
+
function go$copyFile(src$1, dest$1, flags$1, cb$1, startTime) {
|
|
575
|
+
return fs$copyFile(src$1, dest$1, flags$1, function(err) {
|
|
569
576
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue$1([
|
|
570
577
|
go$copyFile,
|
|
571
578
|
[
|
|
572
|
-
src$
|
|
579
|
+
src$1,
|
|
573
580
|
dest$1,
|
|
574
581
|
flags$1,
|
|
575
582
|
cb$1
|
|
@@ -583,9 +590,9 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
583
590
|
}
|
|
584
591
|
}
|
|
585
592
|
var fs$readdir = fs$9.readdir;
|
|
586
|
-
fs$9.readdir = readdir;
|
|
593
|
+
fs$9.readdir = readdir$1;
|
|
587
594
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
588
|
-
function readdir(path$9, options, cb) {
|
|
595
|
+
function readdir$1(path$9, options, cb) {
|
|
589
596
|
if (typeof options === "function") cb = options, options = null;
|
|
590
597
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$10, options$1, cb$1, startTime) {
|
|
591
598
|
return fs$readdir(path$10, fs$readdirCallback(path$10, options$1, cb$1, startTime));
|
|
@@ -735,7 +742,7 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
735
742
|
return fs$9;
|
|
736
743
|
}
|
|
737
744
|
function enqueue$1(elem) {
|
|
738
|
-
debug$
|
|
745
|
+
debug$1("ENQUEUE", elem[0].name, elem[1]);
|
|
739
746
|
fs$8[gracefulQueue$1].push(elem);
|
|
740
747
|
retry$1();
|
|
741
748
|
}
|
|
@@ -759,10 +766,10 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
759
766
|
var startTime = elem[3];
|
|
760
767
|
var lastTime = elem[4];
|
|
761
768
|
if (startTime === void 0) {
|
|
762
|
-
debug$
|
|
769
|
+
debug$1("RETRY", fn.name, args);
|
|
763
770
|
fn.apply(null, args);
|
|
764
771
|
} else if (Date.now() - startTime >= 6e4) {
|
|
765
|
-
debug$
|
|
772
|
+
debug$1("TIMEOUT", fn.name, args);
|
|
766
773
|
var cb = args.pop();
|
|
767
774
|
if (typeof cb === "function") cb.call(null, err);
|
|
768
775
|
} else {
|
|
@@ -770,7 +777,7 @@ var require_graceful_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pn
|
|
|
770
777
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
771
778
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
772
779
|
if (sinceAttempt >= desiredDelay) {
|
|
773
|
-
debug$
|
|
780
|
+
debug$1("RETRY", fn.name, args);
|
|
774
781
|
fn.apply(null, args.concat([startTime]));
|
|
775
782
|
} else fs$8[gracefulQueue$1].push(elem);
|
|
776
783
|
}
|
|
@@ -933,41 +940,41 @@ const retryifySync = (fn, isRetriableError) => {
|
|
|
933
940
|
//#region ../../node_modules/.pnpm/stubborn-fs@1.2.5/node_modules/stubborn-fs/dist/index.js
|
|
934
941
|
const FS = {
|
|
935
942
|
attempt: {
|
|
936
|
-
chmod: attemptifyAsync(promisify(fs.chmod), handlers_default.onChangeError),
|
|
937
|
-
chown: attemptifyAsync(promisify(fs.chown), handlers_default.onChangeError),
|
|
938
|
-
close: attemptifyAsync(promisify(fs.close), NOOP),
|
|
939
|
-
fsync: attemptifyAsync(promisify(fs.fsync), NOOP),
|
|
940
|
-
mkdir: attemptifyAsync(promisify(fs.mkdir), NOOP),
|
|
941
|
-
realpath: attemptifyAsync(promisify(fs.realpath), NOOP),
|
|
942
|
-
stat: attemptifyAsync(promisify(fs.stat), NOOP),
|
|
943
|
-
unlink: attemptifyAsync(promisify(fs.unlink), NOOP),
|
|
944
|
-
chmodSync: attemptifySync(fs.chmodSync, handlers_default.onChangeError),
|
|
945
|
-
chownSync: attemptifySync(fs.chownSync, handlers_default.onChangeError),
|
|
946
|
-
closeSync: attemptifySync(fs.closeSync, NOOP),
|
|
947
|
-
existsSync: attemptifySync(fs.existsSync, NOOP),
|
|
948
|
-
fsyncSync: attemptifySync(fs.fsync, NOOP),
|
|
949
|
-
mkdirSync: attemptifySync(fs.mkdirSync, NOOP),
|
|
950
|
-
realpathSync: attemptifySync(fs.realpathSync, NOOP),
|
|
951
|
-
statSync: attemptifySync(fs.statSync, NOOP),
|
|
952
|
-
unlinkSync: attemptifySync(fs.unlinkSync, NOOP)
|
|
943
|
+
chmod: attemptifyAsync(promisify(fs$1.chmod), handlers_default.onChangeError),
|
|
944
|
+
chown: attemptifyAsync(promisify(fs$1.chown), handlers_default.onChangeError),
|
|
945
|
+
close: attemptifyAsync(promisify(fs$1.close), NOOP),
|
|
946
|
+
fsync: attemptifyAsync(promisify(fs$1.fsync), NOOP),
|
|
947
|
+
mkdir: attemptifyAsync(promisify(fs$1.mkdir), NOOP),
|
|
948
|
+
realpath: attemptifyAsync(promisify(fs$1.realpath), NOOP),
|
|
949
|
+
stat: attemptifyAsync(promisify(fs$1.stat), NOOP),
|
|
950
|
+
unlink: attemptifyAsync(promisify(fs$1.unlink), NOOP),
|
|
951
|
+
chmodSync: attemptifySync(fs$1.chmodSync, handlers_default.onChangeError),
|
|
952
|
+
chownSync: attemptifySync(fs$1.chownSync, handlers_default.onChangeError),
|
|
953
|
+
closeSync: attemptifySync(fs$1.closeSync, NOOP),
|
|
954
|
+
existsSync: attemptifySync(fs$1.existsSync, NOOP),
|
|
955
|
+
fsyncSync: attemptifySync(fs$1.fsync, NOOP),
|
|
956
|
+
mkdirSync: attemptifySync(fs$1.mkdirSync, NOOP),
|
|
957
|
+
realpathSync: attemptifySync(fs$1.realpathSync, NOOP),
|
|
958
|
+
statSync: attemptifySync(fs$1.statSync, NOOP),
|
|
959
|
+
unlinkSync: attemptifySync(fs$1.unlinkSync, NOOP)
|
|
953
960
|
},
|
|
954
961
|
retry: {
|
|
955
|
-
close: retryifyAsync(promisify(fs.close), handlers_default.isRetriableError),
|
|
956
|
-
fsync: retryifyAsync(promisify(fs.fsync), handlers_default.isRetriableError),
|
|
957
|
-
open: retryifyAsync(promisify(fs.open), handlers_default.isRetriableError),
|
|
958
|
-
readFile: retryifyAsync(promisify(fs.readFile), handlers_default.isRetriableError),
|
|
959
|
-
rename: retryifyAsync(promisify(fs.rename), handlers_default.isRetriableError),
|
|
960
|
-
stat: retryifyAsync(promisify(fs.stat), handlers_default.isRetriableError),
|
|
961
|
-
write: retryifyAsync(promisify(fs.write), handlers_default.isRetriableError),
|
|
962
|
-
writeFile: retryifyAsync(promisify(fs.writeFile), handlers_default.isRetriableError),
|
|
963
|
-
closeSync: retryifySync(fs.closeSync, handlers_default.isRetriableError),
|
|
964
|
-
fsyncSync: retryifySync(fs.fsyncSync, handlers_default.isRetriableError),
|
|
965
|
-
openSync: retryifySync(fs.openSync, handlers_default.isRetriableError),
|
|
966
|
-
readFileSync: retryifySync(fs.readFileSync, handlers_default.isRetriableError),
|
|
967
|
-
renameSync: retryifySync(fs.renameSync, handlers_default.isRetriableError),
|
|
968
|
-
statSync: retryifySync(fs.statSync, handlers_default.isRetriableError),
|
|
969
|
-
writeSync: retryifySync(fs.writeSync, handlers_default.isRetriableError),
|
|
970
|
-
writeFileSync: retryifySync(fs.writeFileSync, handlers_default.isRetriableError)
|
|
962
|
+
close: retryifyAsync(promisify(fs$1.close), handlers_default.isRetriableError),
|
|
963
|
+
fsync: retryifyAsync(promisify(fs$1.fsync), handlers_default.isRetriableError),
|
|
964
|
+
open: retryifyAsync(promisify(fs$1.open), handlers_default.isRetriableError),
|
|
965
|
+
readFile: retryifyAsync(promisify(fs$1.readFile), handlers_default.isRetriableError),
|
|
966
|
+
rename: retryifyAsync(promisify(fs$1.rename), handlers_default.isRetriableError),
|
|
967
|
+
stat: retryifyAsync(promisify(fs$1.stat), handlers_default.isRetriableError),
|
|
968
|
+
write: retryifyAsync(promisify(fs$1.write), handlers_default.isRetriableError),
|
|
969
|
+
writeFile: retryifyAsync(promisify(fs$1.writeFile), handlers_default.isRetriableError),
|
|
970
|
+
closeSync: retryifySync(fs$1.closeSync, handlers_default.isRetriableError),
|
|
971
|
+
fsyncSync: retryifySync(fs$1.fsyncSync, handlers_default.isRetriableError),
|
|
972
|
+
openSync: retryifySync(fs$1.openSync, handlers_default.isRetriableError),
|
|
973
|
+
readFileSync: retryifySync(fs$1.readFileSync, handlers_default.isRetriableError),
|
|
974
|
+
renameSync: retryifySync(fs$1.renameSync, handlers_default.isRetriableError),
|
|
975
|
+
statSync: retryifySync(fs$1.statSync, handlers_default.isRetriableError),
|
|
976
|
+
writeSync: retryifySync(fs$1.writeSync, handlers_default.isRetriableError),
|
|
977
|
+
writeFileSync: retryifySync(fs$1.writeFileSync, handlers_default.isRetriableError)
|
|
971
978
|
}
|
|
972
979
|
};
|
|
973
980
|
var dist_default = FS;
|
|
@@ -993,7 +1000,7 @@ const isException = (value) => {
|
|
|
993
1000
|
const isString$1 = (value) => {
|
|
994
1001
|
return typeof value === "string";
|
|
995
1002
|
};
|
|
996
|
-
const isUndefined = (value) => {
|
|
1003
|
+
const isUndefined$1 = (value) => {
|
|
997
1004
|
return value === void 0;
|
|
998
1005
|
};
|
|
999
1006
|
|
|
@@ -1107,8 +1114,8 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
|
1107
1114
|
const filePathExists = !!filePathReal;
|
|
1108
1115
|
filePath = filePathReal || filePath;
|
|
1109
1116
|
[tempPath, tempDisposer] = temp_default.get(filePath, options.tmpCreate || temp_default.create, !(options.tmpPurge === false));
|
|
1110
|
-
const useStatChown = IS_POSIX && isUndefined(options.chown);
|
|
1111
|
-
const useStatMode = isUndefined(options.mode);
|
|
1117
|
+
const useStatChown = IS_POSIX && isUndefined$1(options.chown);
|
|
1118
|
+
const useStatMode = isUndefined$1(options.mode);
|
|
1112
1119
|
if (filePathExists && (useStatChown || useStatMode)) {
|
|
1113
1120
|
const stats = dist_default.attempt.statSync(filePath);
|
|
1114
1121
|
if (stats) {
|
|
@@ -1130,7 +1137,7 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
|
1130
1137
|
fd = dist_default.retry.openSync(timeout$1)(tempPath, "w", options.mode || DEFAULT_FILE_MODE);
|
|
1131
1138
|
if (options.tmpCreated) options.tmpCreated(tempPath);
|
|
1132
1139
|
if (isString$1(data)) dist_default.retry.writeSync(timeout$1)(fd, data, 0, options.encoding || DEFAULT_ENCODING);
|
|
1133
|
-
else if (!isUndefined(data)) dist_default.retry.writeSync(timeout$1)(fd, data, 0, data.length, 0);
|
|
1140
|
+
else if (!isUndefined$1(data)) dist_default.retry.writeSync(timeout$1)(fd, data, 0, data.length, 0);
|
|
1134
1141
|
if (options.fsync !== false) if (options.fsyncWait !== false) dist_default.retry.fsyncSync(timeout$1)(fd);
|
|
1135
1142
|
else dist_default.attempt.fsync(fd);
|
|
1136
1143
|
dist_default.retry.closeSync(timeout$1)(fd);
|
|
@@ -1786,391 +1793,6 @@ const chalk = createChalk();
|
|
|
1786
1793
|
const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1787
1794
|
var source_default = chalk;
|
|
1788
1795
|
|
|
1789
|
-
//#endregion
|
|
1790
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
|
|
1791
|
-
var require_debug = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js": ((exports, module) => {
|
|
1792
|
-
const debug$5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
1793
|
-
module.exports = debug$5;
|
|
1794
|
-
}) });
|
|
1795
|
-
|
|
1796
|
-
//#endregion
|
|
1797
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
|
|
1798
|
-
var require_constants = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js": ((exports, module) => {
|
|
1799
|
-
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
1800
|
-
const MAX_LENGTH$2 = 256;
|
|
1801
|
-
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
1802
|
-
const MAX_SAFE_COMPONENT_LENGTH$1 = 16;
|
|
1803
|
-
const MAX_SAFE_BUILD_LENGTH$1 = MAX_LENGTH$2 - 6;
|
|
1804
|
-
const RELEASE_TYPES = [
|
|
1805
|
-
"major",
|
|
1806
|
-
"premajor",
|
|
1807
|
-
"minor",
|
|
1808
|
-
"preminor",
|
|
1809
|
-
"patch",
|
|
1810
|
-
"prepatch",
|
|
1811
|
-
"prerelease"
|
|
1812
|
-
];
|
|
1813
|
-
module.exports = {
|
|
1814
|
-
MAX_LENGTH: MAX_LENGTH$2,
|
|
1815
|
-
MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH$1,
|
|
1816
|
-
MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH$1,
|
|
1817
|
-
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
1818
|
-
RELEASE_TYPES,
|
|
1819
|
-
SEMVER_SPEC_VERSION,
|
|
1820
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
1821
|
-
FLAG_LOOSE: 2
|
|
1822
|
-
};
|
|
1823
|
-
}) });
|
|
1824
|
-
|
|
1825
|
-
//#endregion
|
|
1826
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
|
|
1827
|
-
var require_re = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js": ((exports, module) => {
|
|
1828
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
1829
|
-
const debug$4 = require_debug();
|
|
1830
|
-
exports = module.exports = {};
|
|
1831
|
-
const re$4 = exports.re = [];
|
|
1832
|
-
const safeRe = exports.safeRe = [];
|
|
1833
|
-
const src = exports.src = [];
|
|
1834
|
-
const safeSrc = exports.safeSrc = [];
|
|
1835
|
-
const t$4 = exports.t = {};
|
|
1836
|
-
let R = 0;
|
|
1837
|
-
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
1838
|
-
const safeRegexReplacements = [
|
|
1839
|
-
["\\s", 1],
|
|
1840
|
-
["\\d", MAX_LENGTH$1],
|
|
1841
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
1842
|
-
];
|
|
1843
|
-
const makeSafeRegex = (value) => {
|
|
1844
|
-
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
1845
|
-
return value;
|
|
1846
|
-
};
|
|
1847
|
-
const createToken = (name$1, value, isGlobal) => {
|
|
1848
|
-
const safe$2 = makeSafeRegex(value);
|
|
1849
|
-
const index = R++;
|
|
1850
|
-
debug$4(name$1, index, value);
|
|
1851
|
-
t$4[name$1] = index;
|
|
1852
|
-
src[index] = value;
|
|
1853
|
-
safeSrc[index] = safe$2;
|
|
1854
|
-
re$4[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
1855
|
-
safeRe[index] = new RegExp(safe$2, isGlobal ? "g" : void 0);
|
|
1856
|
-
};
|
|
1857
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
1858
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
1859
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
1860
|
-
createToken("MAINVERSION", `(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})\\.(${src[t$4.NUMERICIDENTIFIER]})`);
|
|
1861
|
-
createToken("MAINVERSIONLOOSE", `(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
1862
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIER]})`);
|
|
1863
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t$4.NONNUMERICIDENTIFIER]}|${src[t$4.NUMERICIDENTIFIERLOOSE]})`);
|
|
1864
|
-
createToken("PRERELEASE", `(?:-(${src[t$4.PRERELEASEIDENTIFIER]}(?:\\.${src[t$4.PRERELEASEIDENTIFIER]})*))`);
|
|
1865
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t$4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t$4.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
1866
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
1867
|
-
createToken("BUILD", `(?:\\+(${src[t$4.BUILDIDENTIFIER]}(?:\\.${src[t$4.BUILDIDENTIFIER]})*))`);
|
|
1868
|
-
createToken("FULLPLAIN", `v?${src[t$4.MAINVERSION]}${src[t$4.PRERELEASE]}?${src[t$4.BUILD]}?`);
|
|
1869
|
-
createToken("FULL", `^${src[t$4.FULLPLAIN]}$`);
|
|
1870
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t$4.MAINVERSIONLOOSE]}${src[t$4.PRERELEASELOOSE]}?${src[t$4.BUILD]}?`);
|
|
1871
|
-
createToken("LOOSE", `^${src[t$4.LOOSEPLAIN]}$`);
|
|
1872
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
1873
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t$4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
1874
|
-
createToken("XRANGEIDENTIFIER", `${src[t$4.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
1875
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:\\.(${src[t$4.XRANGEIDENTIFIER]})(?:${src[t$4.PRERELEASE]})?${src[t$4.BUILD]}?)?)?`);
|
|
1876
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t$4.XRANGEIDENTIFIERLOOSE]})(?:${src[t$4.PRERELEASELOOSE]})?${src[t$4.BUILD]}?)?)?`);
|
|
1877
|
-
createToken("XRANGE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAIN]}$`);
|
|
1878
|
-
createToken("XRANGELOOSE", `^${src[t$4.GTLT]}\\s*${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1879
|
-
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
1880
|
-
createToken("COERCE", `${src[t$4.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
1881
|
-
createToken("COERCEFULL", src[t$4.COERCEPLAIN] + `(?:${src[t$4.PRERELEASE]})?(?:${src[t$4.BUILD]})?(?:$|[^\\d])`);
|
|
1882
|
-
createToken("COERCERTL", src[t$4.COERCE], true);
|
|
1883
|
-
createToken("COERCERTLFULL", src[t$4.COERCEFULL], true);
|
|
1884
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
1885
|
-
createToken("TILDETRIM", `(\\s*)${src[t$4.LONETILDE]}\\s+`, true);
|
|
1886
|
-
exports.tildeTrimReplace = "$1~";
|
|
1887
|
-
createToken("TILDE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAIN]}$`);
|
|
1888
|
-
createToken("TILDELOOSE", `^${src[t$4.LONETILDE]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1889
|
-
createToken("LONECARET", "(?:\\^)");
|
|
1890
|
-
createToken("CARETTRIM", `(\\s*)${src[t$4.LONECARET]}\\s+`, true);
|
|
1891
|
-
exports.caretTrimReplace = "$1^";
|
|
1892
|
-
createToken("CARET", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAIN]}$`);
|
|
1893
|
-
createToken("CARETLOOSE", `^${src[t$4.LONECARET]}${src[t$4.XRANGEPLAINLOOSE]}$`);
|
|
1894
|
-
createToken("COMPARATORLOOSE", `^${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]})$|^$`);
|
|
1895
|
-
createToken("COMPARATOR", `^${src[t$4.GTLT]}\\s*(${src[t$4.FULLPLAIN]})$|^$`);
|
|
1896
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t$4.GTLT]}\\s*(${src[t$4.LOOSEPLAIN]}|${src[t$4.XRANGEPLAIN]})`, true);
|
|
1897
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
1898
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t$4.XRANGEPLAIN]})\\s+-\\s+(${src[t$4.XRANGEPLAIN]})\\s*$`);
|
|
1899
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t$4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t$4.XRANGEPLAINLOOSE]})\\s*$`);
|
|
1900
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
1901
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
1902
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1903
|
-
}) });
|
|
1904
|
-
|
|
1905
|
-
//#endregion
|
|
1906
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
|
|
1907
|
-
var require_parse_options = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js": ((exports, module) => {
|
|
1908
|
-
const looseOption = Object.freeze({ loose: true });
|
|
1909
|
-
const emptyOpts = Object.freeze({});
|
|
1910
|
-
const parseOptions$3 = (options) => {
|
|
1911
|
-
if (!options) return emptyOpts;
|
|
1912
|
-
if (typeof options !== "object") return looseOption;
|
|
1913
|
-
return options;
|
|
1914
|
-
};
|
|
1915
|
-
module.exports = parseOptions$3;
|
|
1916
|
-
}) });
|
|
1917
|
-
|
|
1918
|
-
//#endregion
|
|
1919
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
|
|
1920
|
-
var require_identifiers = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js": ((exports, module) => {
|
|
1921
|
-
const numeric = /^[0-9]+$/;
|
|
1922
|
-
const compareIdentifiers$1 = (a, b) => {
|
|
1923
|
-
const anum = numeric.test(a);
|
|
1924
|
-
const bnum = numeric.test(b);
|
|
1925
|
-
if (anum && bnum) {
|
|
1926
|
-
a = +a;
|
|
1927
|
-
b = +b;
|
|
1928
|
-
}
|
|
1929
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
1930
|
-
};
|
|
1931
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
|
|
1932
|
-
module.exports = {
|
|
1933
|
-
compareIdentifiers: compareIdentifiers$1,
|
|
1934
|
-
rcompareIdentifiers
|
|
1935
|
-
};
|
|
1936
|
-
}) });
|
|
1937
|
-
|
|
1938
|
-
//#endregion
|
|
1939
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
|
|
1940
|
-
var require_semver$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js": ((exports, module) => {
|
|
1941
|
-
const debug$3 = require_debug();
|
|
1942
|
-
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
1943
|
-
const { safeRe: re$3, t: t$3 } = require_re();
|
|
1944
|
-
const parseOptions$2 = require_parse_options();
|
|
1945
|
-
const { compareIdentifiers } = require_identifiers();
|
|
1946
|
-
var SemVer$15 = class SemVer$15 {
|
|
1947
|
-
constructor(version$1, options) {
|
|
1948
|
-
options = parseOptions$2(options);
|
|
1949
|
-
if (version$1 instanceof SemVer$15) if (version$1.loose === !!options.loose && version$1.includePrerelease === !!options.includePrerelease) return version$1;
|
|
1950
|
-
else version$1 = version$1.version;
|
|
1951
|
-
else if (typeof version$1 !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version$1}".`);
|
|
1952
|
-
if (version$1.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
1953
|
-
debug$3("SemVer", version$1, options);
|
|
1954
|
-
this.options = options;
|
|
1955
|
-
this.loose = !!options.loose;
|
|
1956
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
1957
|
-
const m = version$1.trim().match(options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL]);
|
|
1958
|
-
if (!m) throw new TypeError(`Invalid Version: ${version$1}`);
|
|
1959
|
-
this.raw = version$1;
|
|
1960
|
-
this.major = +m[1];
|
|
1961
|
-
this.minor = +m[2];
|
|
1962
|
-
this.patch = +m[3];
|
|
1963
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
1964
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
1965
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
1966
|
-
if (!m[4]) this.prerelease = [];
|
|
1967
|
-
else this.prerelease = m[4].split(".").map((id) => {
|
|
1968
|
-
if (/^[0-9]+$/.test(id)) {
|
|
1969
|
-
const num = +id;
|
|
1970
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
1971
|
-
}
|
|
1972
|
-
return id;
|
|
1973
|
-
});
|
|
1974
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
1975
|
-
this.format();
|
|
1976
|
-
}
|
|
1977
|
-
format() {
|
|
1978
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
1979
|
-
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
1980
|
-
return this.version;
|
|
1981
|
-
}
|
|
1982
|
-
toString() {
|
|
1983
|
-
return this.version;
|
|
1984
|
-
}
|
|
1985
|
-
compare(other) {
|
|
1986
|
-
debug$3("SemVer.compare", this.version, this.options, other);
|
|
1987
|
-
if (!(other instanceof SemVer$15)) {
|
|
1988
|
-
if (typeof other === "string" && other === this.version) return 0;
|
|
1989
|
-
other = new SemVer$15(other, this.options);
|
|
1990
|
-
}
|
|
1991
|
-
if (other.version === this.version) return 0;
|
|
1992
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
1993
|
-
}
|
|
1994
|
-
compareMain(other) {
|
|
1995
|
-
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
1996
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
1997
|
-
}
|
|
1998
|
-
comparePre(other) {
|
|
1999
|
-
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
2000
|
-
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
2001
|
-
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
2002
|
-
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
2003
|
-
let i = 0;
|
|
2004
|
-
do {
|
|
2005
|
-
const a = this.prerelease[i];
|
|
2006
|
-
const b = other.prerelease[i];
|
|
2007
|
-
debug$3("prerelease compare", i, a, b);
|
|
2008
|
-
if (a === void 0 && b === void 0) return 0;
|
|
2009
|
-
else if (b === void 0) return 1;
|
|
2010
|
-
else if (a === void 0) return -1;
|
|
2011
|
-
else if (a === b) continue;
|
|
2012
|
-
else return compareIdentifiers(a, b);
|
|
2013
|
-
} while (++i);
|
|
2014
|
-
}
|
|
2015
|
-
compareBuild(other) {
|
|
2016
|
-
if (!(other instanceof SemVer$15)) other = new SemVer$15(other, this.options);
|
|
2017
|
-
let i = 0;
|
|
2018
|
-
do {
|
|
2019
|
-
const a = this.build[i];
|
|
2020
|
-
const b = other.build[i];
|
|
2021
|
-
debug$3("build compare", i, a, b);
|
|
2022
|
-
if (a === void 0 && b === void 0) return 0;
|
|
2023
|
-
else if (b === void 0) return 1;
|
|
2024
|
-
else if (a === void 0) return -1;
|
|
2025
|
-
else if (a === b) continue;
|
|
2026
|
-
else return compareIdentifiers(a, b);
|
|
2027
|
-
} while (++i);
|
|
2028
|
-
}
|
|
2029
|
-
inc(release, identifier, identifierBase) {
|
|
2030
|
-
if (release.startsWith("pre")) {
|
|
2031
|
-
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
2032
|
-
if (identifier) {
|
|
2033
|
-
const match = `-${identifier}`.match(this.options.loose ? re$3[t$3.PRERELEASELOOSE] : re$3[t$3.PRERELEASE]);
|
|
2034
|
-
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
switch (release) {
|
|
2038
|
-
case "premajor":
|
|
2039
|
-
this.prerelease.length = 0;
|
|
2040
|
-
this.patch = 0;
|
|
2041
|
-
this.minor = 0;
|
|
2042
|
-
this.major++;
|
|
2043
|
-
this.inc("pre", identifier, identifierBase);
|
|
2044
|
-
break;
|
|
2045
|
-
case "preminor":
|
|
2046
|
-
this.prerelease.length = 0;
|
|
2047
|
-
this.patch = 0;
|
|
2048
|
-
this.minor++;
|
|
2049
|
-
this.inc("pre", identifier, identifierBase);
|
|
2050
|
-
break;
|
|
2051
|
-
case "prepatch":
|
|
2052
|
-
this.prerelease.length = 0;
|
|
2053
|
-
this.inc("patch", identifier, identifierBase);
|
|
2054
|
-
this.inc("pre", identifier, identifierBase);
|
|
2055
|
-
break;
|
|
2056
|
-
case "prerelease":
|
|
2057
|
-
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
2058
|
-
this.inc("pre", identifier, identifierBase);
|
|
2059
|
-
break;
|
|
2060
|
-
case "release":
|
|
2061
|
-
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
2062
|
-
this.prerelease.length = 0;
|
|
2063
|
-
break;
|
|
2064
|
-
case "major":
|
|
2065
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
2066
|
-
this.minor = 0;
|
|
2067
|
-
this.patch = 0;
|
|
2068
|
-
this.prerelease = [];
|
|
2069
|
-
break;
|
|
2070
|
-
case "minor":
|
|
2071
|
-
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
2072
|
-
this.patch = 0;
|
|
2073
|
-
this.prerelease = [];
|
|
2074
|
-
break;
|
|
2075
|
-
case "patch":
|
|
2076
|
-
if (this.prerelease.length === 0) this.patch++;
|
|
2077
|
-
this.prerelease = [];
|
|
2078
|
-
break;
|
|
2079
|
-
case "pre": {
|
|
2080
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
2081
|
-
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
2082
|
-
else {
|
|
2083
|
-
let i = this.prerelease.length;
|
|
2084
|
-
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
2085
|
-
this.prerelease[i]++;
|
|
2086
|
-
i = -2;
|
|
2087
|
-
}
|
|
2088
|
-
if (i === -1) {
|
|
2089
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
2090
|
-
this.prerelease.push(base);
|
|
2091
|
-
}
|
|
2092
|
-
}
|
|
2093
|
-
if (identifier) {
|
|
2094
|
-
let prerelease$2 = [identifier, base];
|
|
2095
|
-
if (identifierBase === false) prerelease$2 = [identifier];
|
|
2096
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
2097
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease$2;
|
|
2098
|
-
} else this.prerelease = prerelease$2;
|
|
2099
|
-
}
|
|
2100
|
-
break;
|
|
2101
|
-
}
|
|
2102
|
-
default: throw new Error(`invalid increment argument: ${release}`);
|
|
2103
|
-
}
|
|
2104
|
-
this.raw = this.format();
|
|
2105
|
-
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
2106
|
-
return this;
|
|
2107
|
-
}
|
|
2108
|
-
};
|
|
2109
|
-
module.exports = SemVer$15;
|
|
2110
|
-
}) });
|
|
2111
|
-
|
|
2112
|
-
//#endregion
|
|
2113
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
|
|
2114
|
-
var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js": ((exports, module) => {
|
|
2115
|
-
const SemVer$14 = require_semver$1();
|
|
2116
|
-
const parse$8 = (version$1, options, throwErrors = false) => {
|
|
2117
|
-
if (version$1 instanceof SemVer$14) return version$1;
|
|
2118
|
-
try {
|
|
2119
|
-
return new SemVer$14(version$1, options);
|
|
2120
|
-
} catch (er) {
|
|
2121
|
-
if (!throwErrors) return null;
|
|
2122
|
-
throw er;
|
|
2123
|
-
}
|
|
2124
|
-
};
|
|
2125
|
-
module.exports = parse$8;
|
|
2126
|
-
}) });
|
|
2127
|
-
|
|
2128
|
-
//#endregion
|
|
2129
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js
|
|
2130
|
-
var require_diff = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js": ((exports, module) => {
|
|
2131
|
-
const parse$7 = require_parse();
|
|
2132
|
-
const diff$2 = (version1, version2) => {
|
|
2133
|
-
const v1 = parse$7(version1, null, true);
|
|
2134
|
-
const v2 = parse$7(version2, null, true);
|
|
2135
|
-
const comparison = v1.compare(v2);
|
|
2136
|
-
if (comparison === 0) return null;
|
|
2137
|
-
const v1Higher = comparison > 0;
|
|
2138
|
-
const highVersion = v1Higher ? v1 : v2;
|
|
2139
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
2140
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
2141
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
2142
|
-
if (lowHasPre && !highHasPre) {
|
|
2143
|
-
if (!lowVersion.patch && !lowVersion.minor) return "major";
|
|
2144
|
-
if (lowVersion.compareMain(highVersion) === 0) {
|
|
2145
|
-
if (lowVersion.minor && !lowVersion.patch) return "minor";
|
|
2146
|
-
return "patch";
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
const prefix = highHasPre ? "pre" : "";
|
|
2150
|
-
if (v1.major !== v2.major) return prefix + "major";
|
|
2151
|
-
if (v1.minor !== v2.minor) return prefix + "minor";
|
|
2152
|
-
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
2153
|
-
return "prerelease";
|
|
2154
|
-
};
|
|
2155
|
-
module.exports = diff$2;
|
|
2156
|
-
}) });
|
|
2157
|
-
|
|
2158
|
-
//#endregion
|
|
2159
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
|
|
2160
|
-
var require_compare = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js": ((exports, module) => {
|
|
2161
|
-
const SemVer$13 = require_semver$1();
|
|
2162
|
-
const compare$11 = (a, b, loose) => new SemVer$13(a, loose).compare(new SemVer$13(b, loose));
|
|
2163
|
-
module.exports = compare$11;
|
|
2164
|
-
}) });
|
|
2165
|
-
|
|
2166
|
-
//#endregion
|
|
2167
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
|
|
2168
|
-
var require_gt = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js": ((exports, module) => {
|
|
2169
|
-
const compare$10 = require_compare();
|
|
2170
|
-
const gt$4 = (a, b, loose) => compare$10(a, b, loose) > 0;
|
|
2171
|
-
module.exports = gt$4;
|
|
2172
|
-
}) });
|
|
2173
|
-
|
|
2174
1796
|
//#endregion
|
|
2175
1797
|
//#region ../../node_modules/.pnpm/ky@1.8.2/node_modules/ky/distribution/errors/HTTPError.js
|
|
2176
1798
|
var HTTPError = class extends Error {
|
|
@@ -2751,11 +2373,11 @@ var require_ini$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ini@1
|
|
|
2751
2373
|
var out = {};
|
|
2752
2374
|
var p = out;
|
|
2753
2375
|
var section = null;
|
|
2754
|
-
var re
|
|
2376
|
+
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
|
|
2755
2377
|
var lines = str.split(/[\r\n]+/g);
|
|
2756
2378
|
lines.forEach(function(line, _, __) {
|
|
2757
2379
|
if (!line || line.match(/^\s*[;#]/)) return;
|
|
2758
|
-
var match = line.match(re
|
|
2380
|
+
var match = line.match(re);
|
|
2759
2381
|
if (!match) return;
|
|
2760
2382
|
if (match[1] !== void 0) {
|
|
2761
2383
|
section = unsafe$1(match[1]);
|
|
@@ -2903,7 +2525,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/rc@1.
|
|
|
2903
2525
|
var ini$2 = require_ini$1();
|
|
2904
2526
|
var path$8 = __require("path");
|
|
2905
2527
|
var stripJsonComments = require_strip_json_comments();
|
|
2906
|
-
var parse$
|
|
2528
|
+
var parse$1 = exports.parse = function(content) {
|
|
2907
2529
|
if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
|
|
2908
2530
|
return ini$2.parse(content);
|
|
2909
2531
|
};
|
|
@@ -2921,7 +2543,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/rc@1.
|
|
|
2921
2543
|
};
|
|
2922
2544
|
exports.json = function() {
|
|
2923
2545
|
var content = file.apply(null, arguments);
|
|
2924
|
-
return content ? parse$
|
|
2546
|
+
return content ? parse$1(content) : null;
|
|
2925
2547
|
};
|
|
2926
2548
|
exports.env = function(prefix, env$3) {
|
|
2927
2549
|
env$3 = env$3 || process.env;
|
|
@@ -3000,11 +2622,11 @@ var require_deep_extend = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3000
2622
|
if (arguments.length < 1 || typeof arguments[0] !== "object") return false;
|
|
3001
2623
|
if (arguments.length < 2) return arguments[0];
|
|
3002
2624
|
var target = arguments[0];
|
|
3003
|
-
var args = Array.prototype.slice.call(arguments, 1), val, src
|
|
2625
|
+
var args = Array.prototype.slice.call(arguments, 1), val, src;
|
|
3004
2626
|
args.forEach(function(obj) {
|
|
3005
2627
|
if (typeof obj !== "object" || obj === null || Array.isArray(obj)) return;
|
|
3006
2628
|
Object.keys(obj).forEach(function(key) {
|
|
3007
|
-
src
|
|
2629
|
+
src = safeGetProperty(target, key);
|
|
3008
2630
|
val = safeGetProperty(obj, key);
|
|
3009
2631
|
if (val === target) return;
|
|
3010
2632
|
else if (typeof val !== "object" || val === null) {
|
|
@@ -3016,11 +2638,11 @@ var require_deep_extend = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3016
2638
|
} else if (isSpecificValue(val)) {
|
|
3017
2639
|
target[key] = cloneSpecificValue(val);
|
|
3018
2640
|
return;
|
|
3019
|
-
} else if (typeof src
|
|
2641
|
+
} else if (typeof src !== "object" || src === null || Array.isArray(src)) {
|
|
3020
2642
|
target[key] = deepExtend$1({}, val);
|
|
3021
2643
|
return;
|
|
3022
2644
|
} else {
|
|
3023
|
-
target[key] = deepExtend$1(src
|
|
2645
|
+
target[key] = deepExtend$1(src, val);
|
|
3024
2646
|
return;
|
|
3025
2647
|
}
|
|
3026
2648
|
});
|
|
@@ -3210,11 +2832,11 @@ var require_rc = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/rc@1.2.8
|
|
|
3210
2832
|
var etc = "/etc";
|
|
3211
2833
|
var win = process.platform === "win32";
|
|
3212
2834
|
var home$1 = win ? process.env.USERPROFILE : process.env.HOME;
|
|
3213
|
-
module.exports = function(name$1, defaults$1, argv, parse$
|
|
2835
|
+
module.exports = function(name$1, defaults$1, argv, parse$2) {
|
|
3214
2836
|
if ("string" !== typeof name$1) throw new Error("rc(name): name *must* be string");
|
|
3215
2837
|
if (!argv) argv = require_minimist()(process.argv.slice(2));
|
|
3216
2838
|
defaults$1 = ("string" === typeof defaults$1 ? cc.json(defaults$1) : defaults$1) || {};
|
|
3217
|
-
parse$
|
|
2839
|
+
parse$2 = parse$2 || cc.parse;
|
|
3218
2840
|
var env$3 = cc.env(name$1 + "_");
|
|
3219
2841
|
var configs = [defaults$1];
|
|
3220
2842
|
var configFiles = [];
|
|
@@ -3222,7 +2844,7 @@ var require_rc = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/rc@1.2.8
|
|
|
3222
2844
|
if (configFiles.indexOf(file$1) >= 0) return;
|
|
3223
2845
|
var fileConfig = cc.file(file$1);
|
|
3224
2846
|
if (fileConfig) {
|
|
3225
|
-
configs.push(parse$
|
|
2847
|
+
configs.push(parse$2(fileConfig));
|
|
3226
2848
|
configFiles.push(file$1);
|
|
3227
2849
|
}
|
|
3228
2850
|
}
|
|
@@ -3259,7 +2881,7 @@ function registryUrl(scope) {
|
|
|
3259
2881
|
//#endregion
|
|
3260
2882
|
//#region ../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js
|
|
3261
2883
|
var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js": ((exports, module) => {
|
|
3262
|
-
var constants
|
|
2884
|
+
var constants = __require("constants");
|
|
3263
2885
|
var origCwd = process.cwd;
|
|
3264
2886
|
var cwd = null;
|
|
3265
2887
|
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
@@ -3278,9 +2900,9 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3278
2900
|
};
|
|
3279
2901
|
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
3280
2902
|
}
|
|
3281
|
-
module.exports = patch$
|
|
3282
|
-
function patch$
|
|
3283
|
-
if (constants
|
|
2903
|
+
module.exports = patch$1;
|
|
2904
|
+
function patch$1(fs$9) {
|
|
2905
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$9);
|
|
3284
2906
|
if (!fs$9.lutimes) patchLutimes(fs$9);
|
|
3285
2907
|
fs$9.chown = chownFix(fs$9.chown);
|
|
3286
2908
|
fs$9.fchown = chownFix(fs$9.fchown);
|
|
@@ -3367,7 +2989,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3367
2989
|
})(fs$9.readSync);
|
|
3368
2990
|
function patchLchmod(fs$10) {
|
|
3369
2991
|
fs$10.lchmod = function(path$9, mode, callback) {
|
|
3370
|
-
fs$10.open(path$9, constants
|
|
2992
|
+
fs$10.open(path$9, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
3371
2993
|
if (err) {
|
|
3372
2994
|
if (callback) callback(err);
|
|
3373
2995
|
return;
|
|
@@ -3380,7 +3002,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3380
3002
|
});
|
|
3381
3003
|
};
|
|
3382
3004
|
fs$10.lchmodSync = function(path$9, mode) {
|
|
3383
|
-
var fd = fs$10.openSync(path$9, constants
|
|
3005
|
+
var fd = fs$10.openSync(path$9, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
3384
3006
|
var threw = true;
|
|
3385
3007
|
var ret;
|
|
3386
3008
|
try {
|
|
@@ -3396,9 +3018,9 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3396
3018
|
};
|
|
3397
3019
|
}
|
|
3398
3020
|
function patchLutimes(fs$10) {
|
|
3399
|
-
if (constants
|
|
3021
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs$10.futimes) {
|
|
3400
3022
|
fs$10.lutimes = function(path$9, at, mt, cb) {
|
|
3401
|
-
fs$10.open(path$9, constants
|
|
3023
|
+
fs$10.open(path$9, constants.O_SYMLINK, function(er, fd) {
|
|
3402
3024
|
if (er) {
|
|
3403
3025
|
if (cb) cb(er);
|
|
3404
3026
|
return;
|
|
@@ -3411,7 +3033,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
|
|
|
3411
3033
|
});
|
|
3412
3034
|
};
|
|
3413
3035
|
fs$10.lutimesSync = function(path$9, at, mt) {
|
|
3414
|
-
var fd = fs$10.openSync(path$9, constants
|
|
3036
|
+
var fd = fs$10.openSync(path$9, constants.O_SYMLINK);
|
|
3415
3037
|
var ret;
|
|
3416
3038
|
var threw = true;
|
|
3417
3039
|
try {
|
|
@@ -3643,9 +3265,9 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3643
3265
|
return queue$2;
|
|
3644
3266
|
} });
|
|
3645
3267
|
}
|
|
3646
|
-
var debug
|
|
3647
|
-
if (util$1.debuglog) debug
|
|
3648
|
-
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug
|
|
3268
|
+
var debug = noop;
|
|
3269
|
+
if (util$1.debuglog) debug = util$1.debuglog("gfs4");
|
|
3270
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug = function() {
|
|
3649
3271
|
var m = util$1.format.apply(util$1, arguments);
|
|
3650
3272
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
3651
3273
|
console.error(m);
|
|
@@ -3672,19 +3294,19 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3672
3294
|
return closeSync;
|
|
3673
3295
|
})(fs$5.closeSync);
|
|
3674
3296
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
|
|
3675
|
-
debug
|
|
3297
|
+
debug(fs$5[gracefulQueue]);
|
|
3676
3298
|
__require("assert").equal(fs$5[gracefulQueue].length, 0);
|
|
3677
3299
|
});
|
|
3678
3300
|
}
|
|
3679
3301
|
if (!global[gracefulQueue]) publishQueue(global, fs$5[gracefulQueue]);
|
|
3680
|
-
module.exports = patch
|
|
3302
|
+
module.exports = patch(clone(fs$5));
|
|
3681
3303
|
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$5.__patched) {
|
|
3682
|
-
module.exports = patch
|
|
3304
|
+
module.exports = patch(fs$5);
|
|
3683
3305
|
fs$5.__patched = true;
|
|
3684
3306
|
}
|
|
3685
|
-
function patch
|
|
3307
|
+
function patch(fs$9) {
|
|
3686
3308
|
polyfills(fs$9);
|
|
3687
|
-
fs$9.gracefulify = patch
|
|
3309
|
+
fs$9.gracefulify = patch;
|
|
3688
3310
|
fs$9.createReadStream = createReadStream;
|
|
3689
3311
|
fs$9.createWriteStream = createWriteStream;
|
|
3690
3312
|
var fs$readFile = fs$9.readFile;
|
|
@@ -3757,18 +3379,18 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3757
3379
|
}
|
|
3758
3380
|
var fs$copyFile = fs$9.copyFile;
|
|
3759
3381
|
if (fs$copyFile) fs$9.copyFile = copyFile;
|
|
3760
|
-
function copyFile(src
|
|
3382
|
+
function copyFile(src, dest, flags, cb) {
|
|
3761
3383
|
if (typeof flags === "function") {
|
|
3762
3384
|
cb = flags;
|
|
3763
3385
|
flags = 0;
|
|
3764
3386
|
}
|
|
3765
|
-
return go$copyFile(src
|
|
3766
|
-
function go$copyFile(src$
|
|
3767
|
-
return fs$copyFile(src$
|
|
3387
|
+
return go$copyFile(src, dest, flags, cb);
|
|
3388
|
+
function go$copyFile(src$1, dest$1, flags$1, cb$1, startTime) {
|
|
3389
|
+
return fs$copyFile(src$1, dest$1, flags$1, function(err) {
|
|
3768
3390
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
3769
3391
|
go$copyFile,
|
|
3770
3392
|
[
|
|
3771
|
-
src$
|
|
3393
|
+
src$1,
|
|
3772
3394
|
dest$1,
|
|
3773
3395
|
flags$1,
|
|
3774
3396
|
cb$1
|
|
@@ -3782,9 +3404,9 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3782
3404
|
}
|
|
3783
3405
|
}
|
|
3784
3406
|
var fs$readdir = fs$9.readdir;
|
|
3785
|
-
fs$9.readdir = readdir;
|
|
3407
|
+
fs$9.readdir = readdir$1;
|
|
3786
3408
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
3787
|
-
function readdir(path$9, options, cb) {
|
|
3409
|
+
function readdir$1(path$9, options, cb) {
|
|
3788
3410
|
if (typeof options === "function") cb = options, options = null;
|
|
3789
3411
|
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$10, options$1, cb$1, startTime) {
|
|
3790
3412
|
return fs$readdir(path$10, fs$readdirCallback(path$10, options$1, cb$1, startTime));
|
|
@@ -3934,7 +3556,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3934
3556
|
return fs$9;
|
|
3935
3557
|
}
|
|
3936
3558
|
function enqueue(elem) {
|
|
3937
|
-
debug
|
|
3559
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
3938
3560
|
fs$5[gracefulQueue].push(elem);
|
|
3939
3561
|
retry();
|
|
3940
3562
|
}
|
|
@@ -3958,10 +3580,10 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3958
3580
|
var startTime = elem[3];
|
|
3959
3581
|
var lastTime = elem[4];
|
|
3960
3582
|
if (startTime === void 0) {
|
|
3961
|
-
debug
|
|
3583
|
+
debug("RETRY", fn.name, args);
|
|
3962
3584
|
fn.apply(null, args);
|
|
3963
3585
|
} else if (Date.now() - startTime >= 6e4) {
|
|
3964
|
-
debug
|
|
3586
|
+
debug("TIMEOUT", fn.name, args);
|
|
3965
3587
|
var cb = args.pop();
|
|
3966
3588
|
if (typeof cb === "function") cb.call(null, err);
|
|
3967
3589
|
} else {
|
|
@@ -3969,7 +3591,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
3969
3591
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
3970
3592
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
3971
3593
|
if (sinceAttempt >= desiredDelay) {
|
|
3972
|
-
debug
|
|
3594
|
+
debug("RETRY", fn.name, args);
|
|
3973
3595
|
fn.apply(null, args.concat([startTime]));
|
|
3974
3596
|
} else fs$5[gracefulQueue].push(elem);
|
|
3975
3597
|
}
|
|
@@ -4141,7 +3763,7 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
4141
3763
|
}
|
|
4142
3764
|
return find(__dirname$2, rel);
|
|
4143
3765
|
};
|
|
4144
|
-
var parse
|
|
3766
|
+
var parse = exports$1.parse = function(content, file$1, type$1) {
|
|
4145
3767
|
content = "" + content;
|
|
4146
3768
|
if (!type$1) try {
|
|
4147
3769
|
return JSON.parse(content);
|
|
@@ -4167,7 +3789,7 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
|
|
|
4167
3789
|
} catch (err) {
|
|
4168
3790
|
return;
|
|
4169
3791
|
}
|
|
4170
|
-
return parse
|
|
3792
|
+
return parse(content, file$1, "json");
|
|
4171
3793
|
};
|
|
4172
3794
|
exports$1.env = function(prefix, env$3) {
|
|
4173
3795
|
env$3 = env$3 || process.env;
|
|
@@ -4799,7 +4421,7 @@ var require_defaults = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@p
|
|
|
4799
4421
|
else home = path$3.resolve(temp, "npm-" + uidOrPid);
|
|
4800
4422
|
const cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm";
|
|
4801
4423
|
const cacheRoot = process.platform === "win32" && process.env.APPDATA || home;
|
|
4802
|
-
const cache
|
|
4424
|
+
const cache = path$3.resolve(cacheRoot, cacheExtra);
|
|
4803
4425
|
let defaults;
|
|
4804
4426
|
let globalPrefix;
|
|
4805
4427
|
Object.defineProperty(exports, "defaults", { get: function() {
|
|
@@ -4821,7 +4443,7 @@ var require_defaults = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@p
|
|
|
4821
4443
|
browser: null,
|
|
4822
4444
|
ca: null,
|
|
4823
4445
|
cafile: null,
|
|
4824
|
-
cache
|
|
4446
|
+
cache,
|
|
4825
4447
|
"cache-lock-stale": 6e4,
|
|
4826
4448
|
"cache-lock-retries": 10,
|
|
4827
4449
|
"cache-lock-wait": 1e4,
|
|
@@ -5094,1166 +4716,121 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
|
|
|
5094
4716
|
}) });
|
|
5095
4717
|
|
|
5096
4718
|
//#endregion
|
|
5097
|
-
//#region ../../node_modules/.pnpm/
|
|
5098
|
-
var
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
}
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
4719
|
+
//#region ../../node_modules/.pnpm/package-json@10.0.1/node_modules/package-json/index.js
|
|
4720
|
+
var import_registry_auth_token = /* @__PURE__ */ __toESM(require_registry_auth_token(), 1);
|
|
4721
|
+
var PackageNotFoundError = class extends Error {
|
|
4722
|
+
constructor(packageName) {
|
|
4723
|
+
super(`Package \`${packageName}\` could not be found`);
|
|
4724
|
+
this.name = "PackageNotFoundError";
|
|
4725
|
+
}
|
|
4726
|
+
};
|
|
4727
|
+
var VersionNotFoundError = class extends Error {
|
|
4728
|
+
constructor(packageName, version$1) {
|
|
4729
|
+
super(`Version \`${version$1}\` for package \`${packageName}\` could not be found`);
|
|
4730
|
+
this.name = "VersionNotFoundError";
|
|
4731
|
+
}
|
|
4732
|
+
};
|
|
4733
|
+
async function packageJson$1(packageName, options = {}) {
|
|
4734
|
+
let { version: version$1 = "latest" } = options;
|
|
4735
|
+
const { omitDeprecated = true } = options;
|
|
4736
|
+
const scope = packageName.split("/")[0];
|
|
4737
|
+
const registryUrl_ = options.registryUrl ?? registryUrl(scope);
|
|
4738
|
+
const packageUrl = new URL(encodeURIComponent(packageName).replace(/^%40/, "@"), registryUrl_);
|
|
4739
|
+
const authInfo = (0, import_registry_auth_token.default)(registryUrl_.toString(), { recursive: true });
|
|
4740
|
+
const headers = { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" };
|
|
4741
|
+
if (options.fullMetadata) delete headers.accept;
|
|
4742
|
+
if (authInfo) headers.authorization = `${authInfo.type} ${authInfo.token}`;
|
|
4743
|
+
let data;
|
|
4744
|
+
try {
|
|
4745
|
+
data = await distribution_default(packageUrl, {
|
|
4746
|
+
headers,
|
|
4747
|
+
keepalive: true
|
|
4748
|
+
}).json();
|
|
4749
|
+
} catch (error) {
|
|
4750
|
+
if (error?.response?.status === 404) throw new PackageNotFoundError(packageName);
|
|
4751
|
+
throw error;
|
|
4752
|
+
}
|
|
4753
|
+
if (options.allVersions) return data;
|
|
4754
|
+
const versionError = new VersionNotFoundError(packageName, version$1);
|
|
4755
|
+
if (data["dist-tags"][version$1]) {
|
|
4756
|
+
const { time } = data;
|
|
4757
|
+
data = data.versions[data["dist-tags"][version$1]];
|
|
4758
|
+
data.time = time;
|
|
4759
|
+
} else if (version$1) {
|
|
4760
|
+
const versionExists = Boolean(data.versions[version$1]);
|
|
4761
|
+
if (omitDeprecated && !versionExists) {
|
|
4762
|
+
for (const [metadataVersion, metadata] of Object.entries(data.versions)) if (metadata.deprecated) delete data.versions[metadataVersion];
|
|
5127
4763
|
}
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
4764
|
+
if (!versionExists) {
|
|
4765
|
+
const versions = Object.keys(data.versions);
|
|
4766
|
+
version$1 = semver.maxSatisfying(versions, version$1);
|
|
4767
|
+
if (!version$1) throw versionError;
|
|
5132
4768
|
}
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
const SemVer$11 = require_semver$1();
|
|
5141
|
-
const major$1 = (a, loose) => new SemVer$11(a, loose).major;
|
|
5142
|
-
module.exports = major$1;
|
|
5143
|
-
}) });
|
|
5144
|
-
|
|
5145
|
-
//#endregion
|
|
5146
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js
|
|
5147
|
-
var require_minor = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js": ((exports, module) => {
|
|
5148
|
-
const SemVer$10 = require_semver$1();
|
|
5149
|
-
const minor$1 = (a, loose) => new SemVer$10(a, loose).minor;
|
|
5150
|
-
module.exports = minor$1;
|
|
5151
|
-
}) });
|
|
5152
|
-
|
|
5153
|
-
//#endregion
|
|
5154
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js
|
|
5155
|
-
var require_patch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js": ((exports, module) => {
|
|
5156
|
-
const SemVer$9 = require_semver$1();
|
|
5157
|
-
const patch$1 = (a, loose) => new SemVer$9(a, loose).patch;
|
|
5158
|
-
module.exports = patch$1;
|
|
5159
|
-
}) });
|
|
5160
|
-
|
|
5161
|
-
//#endregion
|
|
5162
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js
|
|
5163
|
-
var require_prerelease = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js": ((exports, module) => {
|
|
5164
|
-
const parse$2 = require_parse();
|
|
5165
|
-
const prerelease$1 = (version$1, options) => {
|
|
5166
|
-
const parsed = parse$2(version$1, options);
|
|
5167
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
5168
|
-
};
|
|
5169
|
-
module.exports = prerelease$1;
|
|
5170
|
-
}) });
|
|
5171
|
-
|
|
5172
|
-
//#endregion
|
|
5173
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js
|
|
5174
|
-
var require_rcompare = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js": ((exports, module) => {
|
|
5175
|
-
const compare$9 = require_compare();
|
|
5176
|
-
const rcompare$1 = (a, b, loose) => compare$9(b, a, loose);
|
|
5177
|
-
module.exports = rcompare$1;
|
|
5178
|
-
}) });
|
|
5179
|
-
|
|
5180
|
-
//#endregion
|
|
5181
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js
|
|
5182
|
-
var require_compare_loose = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js": ((exports, module) => {
|
|
5183
|
-
const compare$8 = require_compare();
|
|
5184
|
-
const compareLoose$1 = (a, b) => compare$8(a, b, true);
|
|
5185
|
-
module.exports = compareLoose$1;
|
|
5186
|
-
}) });
|
|
5187
|
-
|
|
5188
|
-
//#endregion
|
|
5189
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js
|
|
5190
|
-
var require_compare_build = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js": ((exports, module) => {
|
|
5191
|
-
const SemVer$8 = require_semver$1();
|
|
5192
|
-
const compareBuild$3 = (a, b, loose) => {
|
|
5193
|
-
const versionA = new SemVer$8(a, loose);
|
|
5194
|
-
const versionB = new SemVer$8(b, loose);
|
|
5195
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
5196
|
-
};
|
|
5197
|
-
module.exports = compareBuild$3;
|
|
5198
|
-
}) });
|
|
5199
|
-
|
|
5200
|
-
//#endregion
|
|
5201
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js
|
|
5202
|
-
var require_sort = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js": ((exports, module) => {
|
|
5203
|
-
const compareBuild$2 = require_compare_build();
|
|
5204
|
-
const sort$1 = (list, loose) => list.sort((a, b) => compareBuild$2(a, b, loose));
|
|
5205
|
-
module.exports = sort$1;
|
|
5206
|
-
}) });
|
|
5207
|
-
|
|
5208
|
-
//#endregion
|
|
5209
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js
|
|
5210
|
-
var require_rsort = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js": ((exports, module) => {
|
|
5211
|
-
const compareBuild$1 = require_compare_build();
|
|
5212
|
-
const rsort$1 = (list, loose) => list.sort((a, b) => compareBuild$1(b, a, loose));
|
|
5213
|
-
module.exports = rsort$1;
|
|
5214
|
-
}) });
|
|
5215
|
-
|
|
5216
|
-
//#endregion
|
|
5217
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
|
|
5218
|
-
var require_lt = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js": ((exports, module) => {
|
|
5219
|
-
const compare$7 = require_compare();
|
|
5220
|
-
const lt$3 = (a, b, loose) => compare$7(a, b, loose) < 0;
|
|
5221
|
-
module.exports = lt$3;
|
|
5222
|
-
}) });
|
|
5223
|
-
|
|
5224
|
-
//#endregion
|
|
5225
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
|
|
5226
|
-
var require_eq = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js": ((exports, module) => {
|
|
5227
|
-
const compare$6 = require_compare();
|
|
5228
|
-
const eq$2 = (a, b, loose) => compare$6(a, b, loose) === 0;
|
|
5229
|
-
module.exports = eq$2;
|
|
5230
|
-
}) });
|
|
5231
|
-
|
|
5232
|
-
//#endregion
|
|
5233
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
|
|
5234
|
-
var require_neq = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js": ((exports, module) => {
|
|
5235
|
-
const compare$5 = require_compare();
|
|
5236
|
-
const neq$2 = (a, b, loose) => compare$5(a, b, loose) !== 0;
|
|
5237
|
-
module.exports = neq$2;
|
|
5238
|
-
}) });
|
|
4769
|
+
const { time } = data;
|
|
4770
|
+
data = data.versions[version$1];
|
|
4771
|
+
data.time = time;
|
|
4772
|
+
if (!data) throw versionError;
|
|
4773
|
+
}
|
|
4774
|
+
return data;
|
|
4775
|
+
}
|
|
5239
4776
|
|
|
5240
4777
|
//#endregion
|
|
5241
|
-
//#region ../../node_modules/.pnpm/
|
|
5242
|
-
|
|
5243
|
-
const
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
}) });
|
|
4778
|
+
//#region ../../node_modules/.pnpm/latest-version@9.0.0/node_modules/latest-version/index.js
|
|
4779
|
+
async function latestVersion(packageName, options) {
|
|
4780
|
+
const { version: version$1 } = await packageJson$1(packageName.toLowerCase(), options);
|
|
4781
|
+
return version$1;
|
|
4782
|
+
}
|
|
5247
4783
|
|
|
5248
4784
|
//#endregion
|
|
5249
|
-
//#region ../../node_modules/.pnpm/
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
4785
|
+
//#region ../../node_modules/.pnpm/is-npm@6.0.0/node_modules/is-npm/index.js
|
|
4786
|
+
const packageJson = process$1.env.npm_package_json;
|
|
4787
|
+
const userAgent = process$1.env.npm_config_user_agent;
|
|
4788
|
+
const isNpm6 = Boolean(userAgent && userAgent.startsWith("npm"));
|
|
4789
|
+
const isNpm7 = Boolean(packageJson && packageJson.endsWith("package.json"));
|
|
4790
|
+
const isNpm = isNpm6 || isNpm7;
|
|
4791
|
+
const isYarn = Boolean(userAgent && userAgent.startsWith("yarn"));
|
|
4792
|
+
const isNpmOrYarn = isNpm || isYarn;
|
|
5255
4793
|
|
|
5256
4794
|
//#endregion
|
|
5257
|
-
//#region ../../node_modules/.pnpm/
|
|
5258
|
-
var
|
|
5259
|
-
const
|
|
5260
|
-
const
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
4795
|
+
//#region ../../node_modules/.pnpm/ini@4.1.1/node_modules/ini/lib/ini.js
|
|
4796
|
+
var require_ini = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ini@4.1.1/node_modules/ini/lib/ini.js": ((exports, module) => {
|
|
4797
|
+
const { hasOwnProperty } = Object.prototype;
|
|
4798
|
+
const encode = (obj, opt = {}) => {
|
|
4799
|
+
if (typeof opt === "string") opt = { section: opt };
|
|
4800
|
+
opt.align = opt.align === true;
|
|
4801
|
+
opt.newline = opt.newline === true;
|
|
4802
|
+
opt.sort = opt.sort === true;
|
|
4803
|
+
opt.whitespace = opt.whitespace === true || opt.align === true;
|
|
4804
|
+
/* istanbul ignore next */
|
|
4805
|
+
opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
|
|
4806
|
+
opt.bracketedArray = opt.bracketedArray !== false;
|
|
4807
|
+
/* istanbul ignore next */
|
|
4808
|
+
const eol$1 = opt.platform === "win32" ? "\r\n" : "\n";
|
|
4809
|
+
const separator = opt.whitespace ? " = " : "=";
|
|
4810
|
+
const children = [];
|
|
4811
|
+
const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
|
|
4812
|
+
let padToChars = 0;
|
|
4813
|
+
if (opt.align) padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)).length;
|
|
4814
|
+
let out = "";
|
|
4815
|
+
const arraySuffix = opt.bracketedArray ? "[]" : "";
|
|
4816
|
+
for (const k of keys) {
|
|
4817
|
+
const val = obj[k];
|
|
4818
|
+
if (val && Array.isArray(val)) for (const item of val) out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol$1;
|
|
4819
|
+
else if (val && typeof val === "object") children.push(k);
|
|
4820
|
+
else out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol$1;
|
|
4821
|
+
}
|
|
4822
|
+
if (opt.section && out.length) out = "[" + safe(opt.section) + "]" + (opt.newline ? eol$1 + eol$1 : eol$1) + out;
|
|
4823
|
+
for (const k of children) {
|
|
4824
|
+
const nk = splitSections(k, ".").join("\\.");
|
|
4825
|
+
const section = (opt.section ? opt.section + "." : "") + nk;
|
|
4826
|
+
const child = encode(obj[k], {
|
|
4827
|
+
...opt,
|
|
4828
|
+
section
|
|
4829
|
+
});
|
|
4830
|
+
if (out.length && child.length) out += eol$1;
|
|
4831
|
+
out += child;
|
|
5284
4832
|
}
|
|
5285
|
-
|
|
5286
|
-
module.exports = cmp$2;
|
|
5287
|
-
}) });
|
|
5288
|
-
|
|
5289
|
-
//#endregion
|
|
5290
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js
|
|
5291
|
-
var require_coerce = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js": ((exports, module) => {
|
|
5292
|
-
const SemVer$7 = require_semver$1();
|
|
5293
|
-
const parse$1 = require_parse();
|
|
5294
|
-
const { safeRe: re$2, t: t$2 } = require_re();
|
|
5295
|
-
const coerce$1 = (version$1, options) => {
|
|
5296
|
-
if (version$1 instanceof SemVer$7) return version$1;
|
|
5297
|
-
if (typeof version$1 === "number") version$1 = String(version$1);
|
|
5298
|
-
if (typeof version$1 !== "string") return null;
|
|
5299
|
-
options = options || {};
|
|
5300
|
-
let match = null;
|
|
5301
|
-
if (!options.rtl) match = version$1.match(options.includePrerelease ? re$2[t$2.COERCEFULL] : re$2[t$2.COERCE]);
|
|
5302
|
-
else {
|
|
5303
|
-
const coerceRtlRegex = options.includePrerelease ? re$2[t$2.COERCERTLFULL] : re$2[t$2.COERCERTL];
|
|
5304
|
-
let next;
|
|
5305
|
-
while ((next = coerceRtlRegex.exec(version$1)) && (!match || match.index + match[0].length !== version$1.length)) {
|
|
5306
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
5307
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
5308
|
-
}
|
|
5309
|
-
coerceRtlRegex.lastIndex = -1;
|
|
5310
|
-
}
|
|
5311
|
-
if (match === null) return null;
|
|
5312
|
-
const major$2 = match[2];
|
|
5313
|
-
const minor$2 = match[3] || "0";
|
|
5314
|
-
const patch$6 = match[4] || "0";
|
|
5315
|
-
const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
5316
|
-
const build$1 = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
5317
|
-
return parse$1(`${major$2}.${minor$2}.${patch$6}${prerelease$2}${build$1}`, options);
|
|
5318
|
-
};
|
|
5319
|
-
module.exports = coerce$1;
|
|
5320
|
-
}) });
|
|
5321
|
-
|
|
5322
|
-
//#endregion
|
|
5323
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
|
|
5324
|
-
var require_lrucache = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js": ((exports, module) => {
|
|
5325
|
-
var LRUCache = class {
|
|
5326
|
-
constructor() {
|
|
5327
|
-
this.max = 1e3;
|
|
5328
|
-
this.map = /* @__PURE__ */ new Map();
|
|
5329
|
-
}
|
|
5330
|
-
get(key) {
|
|
5331
|
-
const value = this.map.get(key);
|
|
5332
|
-
if (value === void 0) return void 0;
|
|
5333
|
-
else {
|
|
5334
|
-
this.map.delete(key);
|
|
5335
|
-
this.map.set(key, value);
|
|
5336
|
-
return value;
|
|
5337
|
-
}
|
|
5338
|
-
}
|
|
5339
|
-
delete(key) {
|
|
5340
|
-
return this.map.delete(key);
|
|
5341
|
-
}
|
|
5342
|
-
set(key, value) {
|
|
5343
|
-
const deleted = this.delete(key);
|
|
5344
|
-
if (!deleted && value !== void 0) {
|
|
5345
|
-
if (this.map.size >= this.max) {
|
|
5346
|
-
const firstKey = this.map.keys().next().value;
|
|
5347
|
-
this.delete(firstKey);
|
|
5348
|
-
}
|
|
5349
|
-
this.map.set(key, value);
|
|
5350
|
-
}
|
|
5351
|
-
return this;
|
|
5352
|
-
}
|
|
5353
|
-
};
|
|
5354
|
-
module.exports = LRUCache;
|
|
5355
|
-
}) });
|
|
5356
|
-
|
|
5357
|
-
//#endregion
|
|
5358
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
|
|
5359
|
-
var require_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js": ((exports, module) => {
|
|
5360
|
-
const SPACE_CHARACTERS = /\s+/g;
|
|
5361
|
-
var Range$11 = class Range$11 {
|
|
5362
|
-
constructor(range, options) {
|
|
5363
|
-
options = parseOptions$1(options);
|
|
5364
|
-
if (range instanceof Range$11) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
5365
|
-
else return new Range$11(range.raw, options);
|
|
5366
|
-
if (range instanceof Comparator$4) {
|
|
5367
|
-
this.raw = range.value;
|
|
5368
|
-
this.set = [[range]];
|
|
5369
|
-
this.formatted = void 0;
|
|
5370
|
-
return this;
|
|
5371
|
-
}
|
|
5372
|
-
this.options = options;
|
|
5373
|
-
this.loose = !!options.loose;
|
|
5374
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
5375
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
5376
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c$1) => c$1.length);
|
|
5377
|
-
if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
5378
|
-
if (this.set.length > 1) {
|
|
5379
|
-
const first = this.set[0];
|
|
5380
|
-
this.set = this.set.filter((c$1) => !isNullSet(c$1[0]));
|
|
5381
|
-
if (this.set.length === 0) this.set = [first];
|
|
5382
|
-
else if (this.set.length > 1) {
|
|
5383
|
-
for (const c$1 of this.set) if (c$1.length === 1 && isAny(c$1[0])) {
|
|
5384
|
-
this.set = [c$1];
|
|
5385
|
-
break;
|
|
5386
|
-
}
|
|
5387
|
-
}
|
|
5388
|
-
}
|
|
5389
|
-
this.formatted = void 0;
|
|
5390
|
-
}
|
|
5391
|
-
get range() {
|
|
5392
|
-
if (this.formatted === void 0) {
|
|
5393
|
-
this.formatted = "";
|
|
5394
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
5395
|
-
if (i > 0) this.formatted += "||";
|
|
5396
|
-
const comps = this.set[i];
|
|
5397
|
-
for (let k = 0; k < comps.length; k++) {
|
|
5398
|
-
if (k > 0) this.formatted += " ";
|
|
5399
|
-
this.formatted += comps[k].toString().trim();
|
|
5400
|
-
}
|
|
5401
|
-
}
|
|
5402
|
-
}
|
|
5403
|
-
return this.formatted;
|
|
5404
|
-
}
|
|
5405
|
-
format() {
|
|
5406
|
-
return this.range;
|
|
5407
|
-
}
|
|
5408
|
-
toString() {
|
|
5409
|
-
return this.range;
|
|
5410
|
-
}
|
|
5411
|
-
parseRange(range) {
|
|
5412
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
5413
|
-
const memoKey = memoOpts + ":" + range;
|
|
5414
|
-
const cached = cache.get(memoKey);
|
|
5415
|
-
if (cached) return cached;
|
|
5416
|
-
const loose = this.options.loose;
|
|
5417
|
-
const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
|
|
5418
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
5419
|
-
debug$1("hyphen replace", range);
|
|
5420
|
-
range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
|
|
5421
|
-
debug$1("comparator trim", range);
|
|
5422
|
-
range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
|
|
5423
|
-
debug$1("tilde trim", range);
|
|
5424
|
-
range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
|
|
5425
|
-
debug$1("caret trim", range);
|
|
5426
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
5427
|
-
if (loose) rangeList = rangeList.filter((comp) => {
|
|
5428
|
-
debug$1("loose invalid filter", comp, this.options);
|
|
5429
|
-
return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
|
|
5430
|
-
});
|
|
5431
|
-
debug$1("range list", rangeList);
|
|
5432
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
|
5433
|
-
const comparators = rangeList.map((comp) => new Comparator$4(comp, this.options));
|
|
5434
|
-
for (const comp of comparators) {
|
|
5435
|
-
if (isNullSet(comp)) return [comp];
|
|
5436
|
-
rangeMap.set(comp.value, comp);
|
|
5437
|
-
}
|
|
5438
|
-
if (rangeMap.size > 1 && rangeMap.has("")) rangeMap.delete("");
|
|
5439
|
-
const result = [...rangeMap.values()];
|
|
5440
|
-
cache.set(memoKey, result);
|
|
5441
|
-
return result;
|
|
5442
|
-
}
|
|
5443
|
-
intersects(range, options) {
|
|
5444
|
-
if (!(range instanceof Range$11)) throw new TypeError("a Range is required");
|
|
5445
|
-
return this.set.some((thisComparators) => {
|
|
5446
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
5447
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
5448
|
-
return rangeComparators.every((rangeComparator) => {
|
|
5449
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
5450
|
-
});
|
|
5451
|
-
});
|
|
5452
|
-
});
|
|
5453
|
-
});
|
|
5454
|
-
}
|
|
5455
|
-
test(version$1) {
|
|
5456
|
-
if (!version$1) return false;
|
|
5457
|
-
if (typeof version$1 === "string") try {
|
|
5458
|
-
version$1 = new SemVer$6(version$1, this.options);
|
|
5459
|
-
} catch (er) {
|
|
5460
|
-
return false;
|
|
5461
|
-
}
|
|
5462
|
-
for (let i = 0; i < this.set.length; i++) if (testSet(this.set[i], version$1, this.options)) return true;
|
|
5463
|
-
return false;
|
|
5464
|
-
}
|
|
5465
|
-
};
|
|
5466
|
-
module.exports = Range$11;
|
|
5467
|
-
const LRU = require_lrucache();
|
|
5468
|
-
const cache = new LRU();
|
|
5469
|
-
const parseOptions$1 = require_parse_options();
|
|
5470
|
-
const Comparator$4 = require_comparator();
|
|
5471
|
-
const debug$1 = require_debug();
|
|
5472
|
-
const SemVer$6 = require_semver$1();
|
|
5473
|
-
const { safeRe: re$1, t: t$1, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
5474
|
-
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
5475
|
-
const isNullSet = (c$1) => c$1.value === "<0.0.0-0";
|
|
5476
|
-
const isAny = (c$1) => c$1.value === "";
|
|
5477
|
-
const isSatisfiable = (comparators, options) => {
|
|
5478
|
-
let result = true;
|
|
5479
|
-
const remainingComparators = comparators.slice();
|
|
5480
|
-
let testComparator = remainingComparators.pop();
|
|
5481
|
-
while (result && remainingComparators.length) {
|
|
5482
|
-
result = remainingComparators.every((otherComparator) => {
|
|
5483
|
-
return testComparator.intersects(otherComparator, options);
|
|
5484
|
-
});
|
|
5485
|
-
testComparator = remainingComparators.pop();
|
|
5486
|
-
}
|
|
5487
|
-
return result;
|
|
5488
|
-
};
|
|
5489
|
-
const parseComparator = (comp, options) => {
|
|
5490
|
-
debug$1("comp", comp, options);
|
|
5491
|
-
comp = replaceCarets(comp, options);
|
|
5492
|
-
debug$1("caret", comp);
|
|
5493
|
-
comp = replaceTildes(comp, options);
|
|
5494
|
-
debug$1("tildes", comp);
|
|
5495
|
-
comp = replaceXRanges(comp, options);
|
|
5496
|
-
debug$1("xrange", comp);
|
|
5497
|
-
comp = replaceStars(comp, options);
|
|
5498
|
-
debug$1("stars", comp);
|
|
5499
|
-
return comp;
|
|
5500
|
-
};
|
|
5501
|
-
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
5502
|
-
const replaceTildes = (comp, options) => {
|
|
5503
|
-
return comp.trim().split(/\s+/).map((c$1) => replaceTilde(c$1, options)).join(" ");
|
|
5504
|
-
};
|
|
5505
|
-
const replaceTilde = (comp, options) => {
|
|
5506
|
-
const r = options.loose ? re$1[t$1.TILDELOOSE] : re$1[t$1.TILDE];
|
|
5507
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
5508
|
-
debug$1("tilde", comp, _, M, m, p, pr);
|
|
5509
|
-
let ret;
|
|
5510
|
-
if (isX(M)) ret = "";
|
|
5511
|
-
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
5512
|
-
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
5513
|
-
else if (pr) {
|
|
5514
|
-
debug$1("replaceTilde pr", pr);
|
|
5515
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
5516
|
-
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
5517
|
-
debug$1("tilde return", ret);
|
|
5518
|
-
return ret;
|
|
5519
|
-
});
|
|
5520
|
-
};
|
|
5521
|
-
const replaceCarets = (comp, options) => {
|
|
5522
|
-
return comp.trim().split(/\s+/).map((c$1) => replaceCaret(c$1, options)).join(" ");
|
|
5523
|
-
};
|
|
5524
|
-
const replaceCaret = (comp, options) => {
|
|
5525
|
-
debug$1("caret", comp, options);
|
|
5526
|
-
const r = options.loose ? re$1[t$1.CARETLOOSE] : re$1[t$1.CARET];
|
|
5527
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
5528
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
5529
|
-
debug$1("caret", comp, _, M, m, p, pr);
|
|
5530
|
-
let ret;
|
|
5531
|
-
if (isX(M)) ret = "";
|
|
5532
|
-
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
5533
|
-
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
5534
|
-
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
5535
|
-
else if (pr) {
|
|
5536
|
-
debug$1("replaceCaret pr", pr);
|
|
5537
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
5538
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
5539
|
-
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
5540
|
-
} else {
|
|
5541
|
-
debug$1("no pr");
|
|
5542
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
5543
|
-
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
5544
|
-
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
5545
|
-
}
|
|
5546
|
-
debug$1("caret return", ret);
|
|
5547
|
-
return ret;
|
|
5548
|
-
});
|
|
5549
|
-
};
|
|
5550
|
-
const replaceXRanges = (comp, options) => {
|
|
5551
|
-
debug$1("replaceXRanges", comp, options);
|
|
5552
|
-
return comp.split(/\s+/).map((c$1) => replaceXRange(c$1, options)).join(" ");
|
|
5553
|
-
};
|
|
5554
|
-
const replaceXRange = (comp, options) => {
|
|
5555
|
-
comp = comp.trim();
|
|
5556
|
-
const r = options.loose ? re$1[t$1.XRANGELOOSE] : re$1[t$1.XRANGE];
|
|
5557
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
5558
|
-
debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
5559
|
-
const xM = isX(M);
|
|
5560
|
-
const xm = xM || isX(m);
|
|
5561
|
-
const xp = xm || isX(p);
|
|
5562
|
-
const anyX = xp;
|
|
5563
|
-
if (gtlt === "=" && anyX) gtlt = "";
|
|
5564
|
-
pr = options.includePrerelease ? "-0" : "";
|
|
5565
|
-
if (xM) if (gtlt === ">" || gtlt === "<") ret = "<0.0.0-0";
|
|
5566
|
-
else ret = "*";
|
|
5567
|
-
else if (gtlt && anyX) {
|
|
5568
|
-
if (xm) m = 0;
|
|
5569
|
-
p = 0;
|
|
5570
|
-
if (gtlt === ">") {
|
|
5571
|
-
gtlt = ">=";
|
|
5572
|
-
if (xm) {
|
|
5573
|
-
M = +M + 1;
|
|
5574
|
-
m = 0;
|
|
5575
|
-
p = 0;
|
|
5576
|
-
} else {
|
|
5577
|
-
m = +m + 1;
|
|
5578
|
-
p = 0;
|
|
5579
|
-
}
|
|
5580
|
-
} else if (gtlt === "<=") {
|
|
5581
|
-
gtlt = "<";
|
|
5582
|
-
if (xm) M = +M + 1;
|
|
5583
|
-
else m = +m + 1;
|
|
5584
|
-
}
|
|
5585
|
-
if (gtlt === "<") pr = "-0";
|
|
5586
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
5587
|
-
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
5588
|
-
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
5589
|
-
debug$1("xRange return", ret);
|
|
5590
|
-
return ret;
|
|
5591
|
-
});
|
|
5592
|
-
};
|
|
5593
|
-
const replaceStars = (comp, options) => {
|
|
5594
|
-
debug$1("replaceStars", comp, options);
|
|
5595
|
-
return comp.trim().replace(re$1[t$1.STAR], "");
|
|
5596
|
-
};
|
|
5597
|
-
const replaceGTE0 = (comp, options) => {
|
|
5598
|
-
debug$1("replaceGTE0", comp, options);
|
|
5599
|
-
return comp.trim().replace(re$1[options.includePrerelease ? t$1.GTE0PRE : t$1.GTE0], "");
|
|
5600
|
-
};
|
|
5601
|
-
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
5602
|
-
if (isX(fM)) from = "";
|
|
5603
|
-
else if (isX(fm)) from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
5604
|
-
else if (isX(fp)) from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
5605
|
-
else if (fpr) from = `>=${from}`;
|
|
5606
|
-
else from = `>=${from}${incPr ? "-0" : ""}`;
|
|
5607
|
-
if (isX(tM)) to = "";
|
|
5608
|
-
else if (isX(tm)) to = `<${+tM + 1}.0.0-0`;
|
|
5609
|
-
else if (isX(tp)) to = `<${tM}.${+tm + 1}.0-0`;
|
|
5610
|
-
else if (tpr) to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
5611
|
-
else if (incPr) to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
5612
|
-
else to = `<=${to}`;
|
|
5613
|
-
return `${from} ${to}`.trim();
|
|
5614
|
-
};
|
|
5615
|
-
const testSet = (set, version$1, options) => {
|
|
5616
|
-
for (let i = 0; i < set.length; i++) if (!set[i].test(version$1)) return false;
|
|
5617
|
-
if (version$1.prerelease.length && !options.includePrerelease) {
|
|
5618
|
-
for (let i = 0; i < set.length; i++) {
|
|
5619
|
-
debug$1(set[i].semver);
|
|
5620
|
-
if (set[i].semver === Comparator$4.ANY) continue;
|
|
5621
|
-
if (set[i].semver.prerelease.length > 0) {
|
|
5622
|
-
const allowed = set[i].semver;
|
|
5623
|
-
if (allowed.major === version$1.major && allowed.minor === version$1.minor && allowed.patch === version$1.patch) return true;
|
|
5624
|
-
}
|
|
5625
|
-
}
|
|
5626
|
-
return false;
|
|
5627
|
-
}
|
|
5628
|
-
return true;
|
|
5629
|
-
};
|
|
5630
|
-
}) });
|
|
5631
|
-
|
|
5632
|
-
//#endregion
|
|
5633
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
|
|
5634
|
-
var require_comparator = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js": ((exports, module) => {
|
|
5635
|
-
const ANY$2 = Symbol("SemVer ANY");
|
|
5636
|
-
var Comparator$3 = class Comparator$3 {
|
|
5637
|
-
static get ANY() {
|
|
5638
|
-
return ANY$2;
|
|
5639
|
-
}
|
|
5640
|
-
constructor(comp, options) {
|
|
5641
|
-
options = parseOptions(options);
|
|
5642
|
-
if (comp instanceof Comparator$3) if (comp.loose === !!options.loose) return comp;
|
|
5643
|
-
else comp = comp.value;
|
|
5644
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
|
5645
|
-
debug("comparator", comp, options);
|
|
5646
|
-
this.options = options;
|
|
5647
|
-
this.loose = !!options.loose;
|
|
5648
|
-
this.parse(comp);
|
|
5649
|
-
if (this.semver === ANY$2) this.value = "";
|
|
5650
|
-
else this.value = this.operator + this.semver.version;
|
|
5651
|
-
debug("comp", this);
|
|
5652
|
-
}
|
|
5653
|
-
parse(comp) {
|
|
5654
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
5655
|
-
const m = comp.match(r);
|
|
5656
|
-
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
5657
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
5658
|
-
if (this.operator === "=") this.operator = "";
|
|
5659
|
-
if (!m[2]) this.semver = ANY$2;
|
|
5660
|
-
else this.semver = new SemVer$5(m[2], this.options.loose);
|
|
5661
|
-
}
|
|
5662
|
-
toString() {
|
|
5663
|
-
return this.value;
|
|
5664
|
-
}
|
|
5665
|
-
test(version$1) {
|
|
5666
|
-
debug("Comparator.test", version$1, this.options.loose);
|
|
5667
|
-
if (this.semver === ANY$2 || version$1 === ANY$2) return true;
|
|
5668
|
-
if (typeof version$1 === "string") try {
|
|
5669
|
-
version$1 = new SemVer$5(version$1, this.options);
|
|
5670
|
-
} catch (er) {
|
|
5671
|
-
return false;
|
|
5672
|
-
}
|
|
5673
|
-
return cmp$1(version$1, this.operator, this.semver, this.options);
|
|
5674
|
-
}
|
|
5675
|
-
intersects(comp, options) {
|
|
5676
|
-
if (!(comp instanceof Comparator$3)) throw new TypeError("a Comparator is required");
|
|
5677
|
-
if (this.operator === "") {
|
|
5678
|
-
if (this.value === "") return true;
|
|
5679
|
-
return new Range$10(comp.value, options).test(this.value);
|
|
5680
|
-
} else if (comp.operator === "") {
|
|
5681
|
-
if (comp.value === "") return true;
|
|
5682
|
-
return new Range$10(this.value, options).test(comp.semver);
|
|
5683
|
-
}
|
|
5684
|
-
options = parseOptions(options);
|
|
5685
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
5686
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) return false;
|
|
5687
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
5688
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
5689
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
5690
|
-
if (cmp$1(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
5691
|
-
if (cmp$1(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
5692
|
-
return false;
|
|
5693
|
-
}
|
|
5694
|
-
};
|
|
5695
|
-
module.exports = Comparator$3;
|
|
5696
|
-
const parseOptions = require_parse_options();
|
|
5697
|
-
const { safeRe: re, t } = require_re();
|
|
5698
|
-
const cmp$1 = require_cmp();
|
|
5699
|
-
const debug = require_debug();
|
|
5700
|
-
const SemVer$5 = require_semver$1();
|
|
5701
|
-
const Range$10 = require_range();
|
|
5702
|
-
}) });
|
|
5703
|
-
|
|
5704
|
-
//#endregion
|
|
5705
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
|
|
5706
|
-
var require_satisfies = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js": ((exports, module) => {
|
|
5707
|
-
const Range$9 = require_range();
|
|
5708
|
-
const satisfies$4 = (version$1, range, options) => {
|
|
5709
|
-
try {
|
|
5710
|
-
range = new Range$9(range, options);
|
|
5711
|
-
} catch (er) {
|
|
5712
|
-
return false;
|
|
5713
|
-
}
|
|
5714
|
-
return range.test(version$1);
|
|
5715
|
-
};
|
|
5716
|
-
module.exports = satisfies$4;
|
|
5717
|
-
}) });
|
|
5718
|
-
|
|
5719
|
-
//#endregion
|
|
5720
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js
|
|
5721
|
-
var require_to_comparators = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js": ((exports, module) => {
|
|
5722
|
-
const Range$8 = require_range();
|
|
5723
|
-
const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c$1) => c$1.value).join(" ").trim().split(" "));
|
|
5724
|
-
module.exports = toComparators$1;
|
|
5725
|
-
}) });
|
|
5726
|
-
|
|
5727
|
-
//#endregion
|
|
5728
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js
|
|
5729
|
-
var require_max_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js": ((exports, module) => {
|
|
5730
|
-
const SemVer$4 = require_semver$1();
|
|
5731
|
-
const Range$7 = require_range();
|
|
5732
|
-
const maxSatisfying$1 = (versions, range, options) => {
|
|
5733
|
-
let max = null;
|
|
5734
|
-
let maxSV = null;
|
|
5735
|
-
let rangeObj = null;
|
|
5736
|
-
try {
|
|
5737
|
-
rangeObj = new Range$7(range, options);
|
|
5738
|
-
} catch (er) {
|
|
5739
|
-
return null;
|
|
5740
|
-
}
|
|
5741
|
-
versions.forEach((v) => {
|
|
5742
|
-
if (rangeObj.test(v)) {
|
|
5743
|
-
if (!max || maxSV.compare(v) === -1) {
|
|
5744
|
-
max = v;
|
|
5745
|
-
maxSV = new SemVer$4(max, options);
|
|
5746
|
-
}
|
|
5747
|
-
}
|
|
5748
|
-
});
|
|
5749
|
-
return max;
|
|
5750
|
-
};
|
|
5751
|
-
module.exports = maxSatisfying$1;
|
|
5752
|
-
}) });
|
|
5753
|
-
|
|
5754
|
-
//#endregion
|
|
5755
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js
|
|
5756
|
-
var require_min_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js": ((exports, module) => {
|
|
5757
|
-
const SemVer$3 = require_semver$1();
|
|
5758
|
-
const Range$6 = require_range();
|
|
5759
|
-
const minSatisfying$1 = (versions, range, options) => {
|
|
5760
|
-
let min = null;
|
|
5761
|
-
let minSV = null;
|
|
5762
|
-
let rangeObj = null;
|
|
5763
|
-
try {
|
|
5764
|
-
rangeObj = new Range$6(range, options);
|
|
5765
|
-
} catch (er) {
|
|
5766
|
-
return null;
|
|
5767
|
-
}
|
|
5768
|
-
versions.forEach((v) => {
|
|
5769
|
-
if (rangeObj.test(v)) {
|
|
5770
|
-
if (!min || minSV.compare(v) === 1) {
|
|
5771
|
-
min = v;
|
|
5772
|
-
minSV = new SemVer$3(min, options);
|
|
5773
|
-
}
|
|
5774
|
-
}
|
|
5775
|
-
});
|
|
5776
|
-
return min;
|
|
5777
|
-
};
|
|
5778
|
-
module.exports = minSatisfying$1;
|
|
5779
|
-
}) });
|
|
5780
|
-
|
|
5781
|
-
//#endregion
|
|
5782
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
|
|
5783
|
-
var require_min_version = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js": ((exports, module) => {
|
|
5784
|
-
const SemVer$2 = require_semver$1();
|
|
5785
|
-
const Range$5 = require_range();
|
|
5786
|
-
const gt$2 = require_gt();
|
|
5787
|
-
const minVersion$1 = (range, loose) => {
|
|
5788
|
-
range = new Range$5(range, loose);
|
|
5789
|
-
let minver = new SemVer$2("0.0.0");
|
|
5790
|
-
if (range.test(minver)) return minver;
|
|
5791
|
-
minver = new SemVer$2("0.0.0-0");
|
|
5792
|
-
if (range.test(minver)) return minver;
|
|
5793
|
-
minver = null;
|
|
5794
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
5795
|
-
const comparators = range.set[i];
|
|
5796
|
-
let setMin = null;
|
|
5797
|
-
comparators.forEach((comparator) => {
|
|
5798
|
-
const compver = new SemVer$2(comparator.semver.version);
|
|
5799
|
-
switch (comparator.operator) {
|
|
5800
|
-
case ">":
|
|
5801
|
-
if (compver.prerelease.length === 0) compver.patch++;
|
|
5802
|
-
else compver.prerelease.push(0);
|
|
5803
|
-
compver.raw = compver.format();
|
|
5804
|
-
case "":
|
|
5805
|
-
case ">=":
|
|
5806
|
-
if (!setMin || gt$2(compver, setMin)) setMin = compver;
|
|
5807
|
-
break;
|
|
5808
|
-
case "<":
|
|
5809
|
-
case "<=": break;
|
|
5810
|
-
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
5811
|
-
}
|
|
5812
|
-
});
|
|
5813
|
-
if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
|
|
5814
|
-
}
|
|
5815
|
-
if (minver && range.test(minver)) return minver;
|
|
5816
|
-
return null;
|
|
5817
|
-
};
|
|
5818
|
-
module.exports = minVersion$1;
|
|
5819
|
-
}) });
|
|
5820
|
-
|
|
5821
|
-
//#endregion
|
|
5822
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js
|
|
5823
|
-
var require_valid = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js": ((exports, module) => {
|
|
5824
|
-
const Range$4 = require_range();
|
|
5825
|
-
const validRange$1 = (range, options) => {
|
|
5826
|
-
try {
|
|
5827
|
-
return new Range$4(range, options).range || "*";
|
|
5828
|
-
} catch (er) {
|
|
5829
|
-
return null;
|
|
5830
|
-
}
|
|
5831
|
-
};
|
|
5832
|
-
module.exports = validRange$1;
|
|
5833
|
-
}) });
|
|
5834
|
-
|
|
5835
|
-
//#endregion
|
|
5836
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
|
|
5837
|
-
var require_outside = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js": ((exports, module) => {
|
|
5838
|
-
const SemVer$1 = require_semver$1();
|
|
5839
|
-
const Comparator$2 = require_comparator();
|
|
5840
|
-
const { ANY: ANY$1 } = Comparator$2;
|
|
5841
|
-
const Range$3 = require_range();
|
|
5842
|
-
const satisfies$3 = require_satisfies();
|
|
5843
|
-
const gt$1 = require_gt();
|
|
5844
|
-
const lt$1 = require_lt();
|
|
5845
|
-
const lte$1 = require_lte();
|
|
5846
|
-
const gte$1 = require_gte();
|
|
5847
|
-
const outside$3 = (version$1, range, hilo, options) => {
|
|
5848
|
-
version$1 = new SemVer$1(version$1, options);
|
|
5849
|
-
range = new Range$3(range, options);
|
|
5850
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
5851
|
-
switch (hilo) {
|
|
5852
|
-
case ">":
|
|
5853
|
-
gtfn = gt$1;
|
|
5854
|
-
ltefn = lte$1;
|
|
5855
|
-
ltfn = lt$1;
|
|
5856
|
-
comp = ">";
|
|
5857
|
-
ecomp = ">=";
|
|
5858
|
-
break;
|
|
5859
|
-
case "<":
|
|
5860
|
-
gtfn = lt$1;
|
|
5861
|
-
ltefn = gte$1;
|
|
5862
|
-
ltfn = gt$1;
|
|
5863
|
-
comp = "<";
|
|
5864
|
-
ecomp = "<=";
|
|
5865
|
-
break;
|
|
5866
|
-
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
5867
|
-
}
|
|
5868
|
-
if (satisfies$3(version$1, range, options)) return false;
|
|
5869
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
5870
|
-
const comparators = range.set[i];
|
|
5871
|
-
let high = null;
|
|
5872
|
-
let low = null;
|
|
5873
|
-
comparators.forEach((comparator) => {
|
|
5874
|
-
if (comparator.semver === ANY$1) comparator = new Comparator$2(">=0.0.0");
|
|
5875
|
-
high = high || comparator;
|
|
5876
|
-
low = low || comparator;
|
|
5877
|
-
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
5878
|
-
else if (ltfn(comparator.semver, low.semver, options)) low = comparator;
|
|
5879
|
-
});
|
|
5880
|
-
if (high.operator === comp || high.operator === ecomp) return false;
|
|
5881
|
-
if ((!low.operator || low.operator === comp) && ltefn(version$1, low.semver)) return false;
|
|
5882
|
-
else if (low.operator === ecomp && ltfn(version$1, low.semver)) return false;
|
|
5883
|
-
}
|
|
5884
|
-
return true;
|
|
5885
|
-
};
|
|
5886
|
-
module.exports = outside$3;
|
|
5887
|
-
}) });
|
|
5888
|
-
|
|
5889
|
-
//#endregion
|
|
5890
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
|
|
5891
|
-
var require_gtr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js": ((exports, module) => {
|
|
5892
|
-
const outside$2 = require_outside();
|
|
5893
|
-
const gtr$1 = (version$1, range, options) => outside$2(version$1, range, ">", options);
|
|
5894
|
-
module.exports = gtr$1;
|
|
5895
|
-
}) });
|
|
5896
|
-
|
|
5897
|
-
//#endregion
|
|
5898
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
|
|
5899
|
-
var require_ltr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js": ((exports, module) => {
|
|
5900
|
-
const outside$1 = require_outside();
|
|
5901
|
-
const ltr$1 = (version$1, range, options) => outside$1(version$1, range, "<", options);
|
|
5902
|
-
module.exports = ltr$1;
|
|
5903
|
-
}) });
|
|
5904
|
-
|
|
5905
|
-
//#endregion
|
|
5906
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js
|
|
5907
|
-
var require_intersects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js": ((exports, module) => {
|
|
5908
|
-
const Range$2 = require_range();
|
|
5909
|
-
const intersects$1 = (r1, r2, options) => {
|
|
5910
|
-
r1 = new Range$2(r1, options);
|
|
5911
|
-
r2 = new Range$2(r2, options);
|
|
5912
|
-
return r1.intersects(r2, options);
|
|
5913
|
-
};
|
|
5914
|
-
module.exports = intersects$1;
|
|
5915
|
-
}) });
|
|
5916
|
-
|
|
5917
|
-
//#endregion
|
|
5918
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js
|
|
5919
|
-
var require_simplify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js": ((exports, module) => {
|
|
5920
|
-
const satisfies$2 = require_satisfies();
|
|
5921
|
-
const compare$2 = require_compare();
|
|
5922
|
-
module.exports = (versions, range, options) => {
|
|
5923
|
-
const set = [];
|
|
5924
|
-
let first = null;
|
|
5925
|
-
let prev = null;
|
|
5926
|
-
const v = versions.sort((a, b) => compare$2(a, b, options));
|
|
5927
|
-
for (const version$1 of v) {
|
|
5928
|
-
const included = satisfies$2(version$1, range, options);
|
|
5929
|
-
if (included) {
|
|
5930
|
-
prev = version$1;
|
|
5931
|
-
if (!first) first = version$1;
|
|
5932
|
-
} else {
|
|
5933
|
-
if (prev) set.push([first, prev]);
|
|
5934
|
-
prev = null;
|
|
5935
|
-
first = null;
|
|
5936
|
-
}
|
|
5937
|
-
}
|
|
5938
|
-
if (first) set.push([first, null]);
|
|
5939
|
-
const ranges = [];
|
|
5940
|
-
for (const [min, max] of set) if (min === max) ranges.push(min);
|
|
5941
|
-
else if (!max && min === v[0]) ranges.push("*");
|
|
5942
|
-
else if (!max) ranges.push(`>=${min}`);
|
|
5943
|
-
else if (min === v[0]) ranges.push(`<=${max}`);
|
|
5944
|
-
else ranges.push(`${min} - ${max}`);
|
|
5945
|
-
const simplified = ranges.join(" || ");
|
|
5946
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
5947
|
-
return simplified.length < original.length ? simplified : range;
|
|
5948
|
-
};
|
|
5949
|
-
}) });
|
|
5950
|
-
|
|
5951
|
-
//#endregion
|
|
5952
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js
|
|
5953
|
-
var require_subset = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js": ((exports, module) => {
|
|
5954
|
-
const Range$1 = require_range();
|
|
5955
|
-
const Comparator$1 = require_comparator();
|
|
5956
|
-
const { ANY } = Comparator$1;
|
|
5957
|
-
const satisfies$1 = require_satisfies();
|
|
5958
|
-
const compare$1 = require_compare();
|
|
5959
|
-
const subset$1 = (sub, dom, options = {}) => {
|
|
5960
|
-
if (sub === dom) return true;
|
|
5961
|
-
sub = new Range$1(sub, options);
|
|
5962
|
-
dom = new Range$1(dom, options);
|
|
5963
|
-
let sawNonNull = false;
|
|
5964
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
5965
|
-
for (const simpleDom of dom.set) {
|
|
5966
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
5967
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
5968
|
-
if (isSub) continue OUTER;
|
|
5969
|
-
}
|
|
5970
|
-
if (sawNonNull) return false;
|
|
5971
|
-
}
|
|
5972
|
-
return true;
|
|
5973
|
-
};
|
|
5974
|
-
const minimumVersionWithPreRelease = [new Comparator$1(">=0.0.0-0")];
|
|
5975
|
-
const minimumVersion = [new Comparator$1(">=0.0.0")];
|
|
5976
|
-
const simpleSubset = (sub, dom, options) => {
|
|
5977
|
-
if (sub === dom) return true;
|
|
5978
|
-
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
5979
|
-
else if (options.includePrerelease) sub = minimumVersionWithPreRelease;
|
|
5980
|
-
else sub = minimumVersion;
|
|
5981
|
-
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
5982
|
-
else dom = minimumVersion;
|
|
5983
|
-
const eqSet = /* @__PURE__ */ new Set();
|
|
5984
|
-
let gt$5, lt$4;
|
|
5985
|
-
for (const c$1 of sub) if (c$1.operator === ">" || c$1.operator === ">=") gt$5 = higherGT(gt$5, c$1, options);
|
|
5986
|
-
else if (c$1.operator === "<" || c$1.operator === "<=") lt$4 = lowerLT(lt$4, c$1, options);
|
|
5987
|
-
else eqSet.add(c$1.semver);
|
|
5988
|
-
if (eqSet.size > 1) return null;
|
|
5989
|
-
let gtltComp;
|
|
5990
|
-
if (gt$5 && lt$4) {
|
|
5991
|
-
gtltComp = compare$1(gt$5.semver, lt$4.semver, options);
|
|
5992
|
-
if (gtltComp > 0) return null;
|
|
5993
|
-
else if (gtltComp === 0 && (gt$5.operator !== ">=" || lt$4.operator !== "<=")) return null;
|
|
5994
|
-
}
|
|
5995
|
-
for (const eq$3 of eqSet) {
|
|
5996
|
-
if (gt$5 && !satisfies$1(eq$3, String(gt$5), options)) return null;
|
|
5997
|
-
if (lt$4 && !satisfies$1(eq$3, String(lt$4), options)) return null;
|
|
5998
|
-
for (const c$1 of dom) if (!satisfies$1(eq$3, String(c$1), options)) return false;
|
|
5999
|
-
return true;
|
|
6000
|
-
}
|
|
6001
|
-
let higher, lower;
|
|
6002
|
-
let hasDomLT, hasDomGT;
|
|
6003
|
-
let needDomLTPre = lt$4 && !options.includePrerelease && lt$4.semver.prerelease.length ? lt$4.semver : false;
|
|
6004
|
-
let needDomGTPre = gt$5 && !options.includePrerelease && gt$5.semver.prerelease.length ? gt$5.semver : false;
|
|
6005
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt$4.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
6006
|
-
for (const c$1 of dom) {
|
|
6007
|
-
hasDomGT = hasDomGT || c$1.operator === ">" || c$1.operator === ">=";
|
|
6008
|
-
hasDomLT = hasDomLT || c$1.operator === "<" || c$1.operator === "<=";
|
|
6009
|
-
if (gt$5) {
|
|
6010
|
-
if (needDomGTPre) {
|
|
6011
|
-
if (c$1.semver.prerelease && c$1.semver.prerelease.length && c$1.semver.major === needDomGTPre.major && c$1.semver.minor === needDomGTPre.minor && c$1.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
6012
|
-
}
|
|
6013
|
-
if (c$1.operator === ">" || c$1.operator === ">=") {
|
|
6014
|
-
higher = higherGT(gt$5, c$1, options);
|
|
6015
|
-
if (higher === c$1 && higher !== gt$5) return false;
|
|
6016
|
-
} else if (gt$5.operator === ">=" && !satisfies$1(gt$5.semver, String(c$1), options)) return false;
|
|
6017
|
-
}
|
|
6018
|
-
if (lt$4) {
|
|
6019
|
-
if (needDomLTPre) {
|
|
6020
|
-
if (c$1.semver.prerelease && c$1.semver.prerelease.length && c$1.semver.major === needDomLTPre.major && c$1.semver.minor === needDomLTPre.minor && c$1.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
6021
|
-
}
|
|
6022
|
-
if (c$1.operator === "<" || c$1.operator === "<=") {
|
|
6023
|
-
lower = lowerLT(lt$4, c$1, options);
|
|
6024
|
-
if (lower === c$1 && lower !== lt$4) return false;
|
|
6025
|
-
} else if (lt$4.operator === "<=" && !satisfies$1(lt$4.semver, String(c$1), options)) return false;
|
|
6026
|
-
}
|
|
6027
|
-
if (!c$1.operator && (lt$4 || gt$5) && gtltComp !== 0) return false;
|
|
6028
|
-
}
|
|
6029
|
-
if (gt$5 && hasDomLT && !lt$4 && gtltComp !== 0) return false;
|
|
6030
|
-
if (lt$4 && hasDomGT && !gt$5 && gtltComp !== 0) return false;
|
|
6031
|
-
if (needDomGTPre || needDomLTPre) return false;
|
|
6032
|
-
return true;
|
|
6033
|
-
};
|
|
6034
|
-
const higherGT = (a, b, options) => {
|
|
6035
|
-
if (!a) return b;
|
|
6036
|
-
const comp = compare$1(a.semver, b.semver, options);
|
|
6037
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
6038
|
-
};
|
|
6039
|
-
const lowerLT = (a, b, options) => {
|
|
6040
|
-
if (!a) return b;
|
|
6041
|
-
const comp = compare$1(a.semver, b.semver, options);
|
|
6042
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
6043
|
-
};
|
|
6044
|
-
module.exports = subset$1;
|
|
6045
|
-
}) });
|
|
6046
|
-
|
|
6047
|
-
//#endregion
|
|
6048
|
-
//#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js
|
|
6049
|
-
var require_semver = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js": ((exports, module) => {
|
|
6050
|
-
const internalRe = require_re();
|
|
6051
|
-
const constants = require_constants();
|
|
6052
|
-
const SemVer = require_semver$1();
|
|
6053
|
-
const identifiers = require_identifiers();
|
|
6054
|
-
const parse = require_parse();
|
|
6055
|
-
const valid = require_valid$1();
|
|
6056
|
-
const clean = require_clean();
|
|
6057
|
-
const inc = require_inc();
|
|
6058
|
-
const diff$1 = require_diff();
|
|
6059
|
-
const major = require_major();
|
|
6060
|
-
const minor = require_minor();
|
|
6061
|
-
const patch = require_patch();
|
|
6062
|
-
const prerelease = require_prerelease();
|
|
6063
|
-
const compare = require_compare();
|
|
6064
|
-
const rcompare = require_rcompare();
|
|
6065
|
-
const compareLoose = require_compare_loose();
|
|
6066
|
-
const compareBuild = require_compare_build();
|
|
6067
|
-
const sort = require_sort();
|
|
6068
|
-
const rsort = require_rsort();
|
|
6069
|
-
const gt = require_gt();
|
|
6070
|
-
const lt = require_lt();
|
|
6071
|
-
const eq = require_eq();
|
|
6072
|
-
const neq = require_neq();
|
|
6073
|
-
const gte = require_gte();
|
|
6074
|
-
const lte = require_lte();
|
|
6075
|
-
const cmp = require_cmp();
|
|
6076
|
-
const coerce = require_coerce();
|
|
6077
|
-
const Comparator = require_comparator();
|
|
6078
|
-
const Range = require_range();
|
|
6079
|
-
const satisfies = require_satisfies();
|
|
6080
|
-
const toComparators = require_to_comparators();
|
|
6081
|
-
const maxSatisfying = require_max_satisfying();
|
|
6082
|
-
const minSatisfying = require_min_satisfying();
|
|
6083
|
-
const minVersion = require_min_version();
|
|
6084
|
-
const validRange = require_valid();
|
|
6085
|
-
const outside = require_outside();
|
|
6086
|
-
const gtr = require_gtr();
|
|
6087
|
-
const ltr = require_ltr();
|
|
6088
|
-
const intersects = require_intersects();
|
|
6089
|
-
const simplifyRange = require_simplify();
|
|
6090
|
-
const subset = require_subset();
|
|
6091
|
-
module.exports = {
|
|
6092
|
-
parse,
|
|
6093
|
-
valid,
|
|
6094
|
-
clean,
|
|
6095
|
-
inc,
|
|
6096
|
-
diff: diff$1,
|
|
6097
|
-
major,
|
|
6098
|
-
minor,
|
|
6099
|
-
patch,
|
|
6100
|
-
prerelease,
|
|
6101
|
-
compare,
|
|
6102
|
-
rcompare,
|
|
6103
|
-
compareLoose,
|
|
6104
|
-
compareBuild,
|
|
6105
|
-
sort,
|
|
6106
|
-
rsort,
|
|
6107
|
-
gt,
|
|
6108
|
-
lt,
|
|
6109
|
-
eq,
|
|
6110
|
-
neq,
|
|
6111
|
-
gte,
|
|
6112
|
-
lte,
|
|
6113
|
-
cmp,
|
|
6114
|
-
coerce,
|
|
6115
|
-
Comparator,
|
|
6116
|
-
Range,
|
|
6117
|
-
satisfies,
|
|
6118
|
-
toComparators,
|
|
6119
|
-
maxSatisfying,
|
|
6120
|
-
minSatisfying,
|
|
6121
|
-
minVersion,
|
|
6122
|
-
validRange,
|
|
6123
|
-
outside,
|
|
6124
|
-
gtr,
|
|
6125
|
-
ltr,
|
|
6126
|
-
intersects,
|
|
6127
|
-
simplifyRange,
|
|
6128
|
-
subset,
|
|
6129
|
-
SemVer,
|
|
6130
|
-
re: internalRe.re,
|
|
6131
|
-
src: internalRe.src,
|
|
6132
|
-
tokens: internalRe.t,
|
|
6133
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
6134
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
6135
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
6136
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
6137
|
-
};
|
|
6138
|
-
}) });
|
|
6139
|
-
|
|
6140
|
-
//#endregion
|
|
6141
|
-
//#region ../../node_modules/.pnpm/package-json@10.0.1/node_modules/package-json/index.js
|
|
6142
|
-
var import_registry_auth_token = /* @__PURE__ */ __toESM(require_registry_auth_token(), 1);
|
|
6143
|
-
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
6144
|
-
var PackageNotFoundError = class extends Error {
|
|
6145
|
-
constructor(packageName) {
|
|
6146
|
-
super(`Package \`${packageName}\` could not be found`);
|
|
6147
|
-
this.name = "PackageNotFoundError";
|
|
6148
|
-
}
|
|
6149
|
-
};
|
|
6150
|
-
var VersionNotFoundError = class extends Error {
|
|
6151
|
-
constructor(packageName, version$1) {
|
|
6152
|
-
super(`Version \`${version$1}\` for package \`${packageName}\` could not be found`);
|
|
6153
|
-
this.name = "VersionNotFoundError";
|
|
6154
|
-
}
|
|
6155
|
-
};
|
|
6156
|
-
async function packageJson$1(packageName, options = {}) {
|
|
6157
|
-
let { version: version$1 = "latest" } = options;
|
|
6158
|
-
const { omitDeprecated = true } = options;
|
|
6159
|
-
const scope = packageName.split("/")[0];
|
|
6160
|
-
const registryUrl_ = options.registryUrl ?? registryUrl(scope);
|
|
6161
|
-
const packageUrl = new URL(encodeURIComponent(packageName).replace(/^%40/, "@"), registryUrl_);
|
|
6162
|
-
const authInfo = (0, import_registry_auth_token.default)(registryUrl_.toString(), { recursive: true });
|
|
6163
|
-
const headers = { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" };
|
|
6164
|
-
if (options.fullMetadata) delete headers.accept;
|
|
6165
|
-
if (authInfo) headers.authorization = `${authInfo.type} ${authInfo.token}`;
|
|
6166
|
-
let data;
|
|
6167
|
-
try {
|
|
6168
|
-
data = await distribution_default(packageUrl, {
|
|
6169
|
-
headers,
|
|
6170
|
-
keepalive: true
|
|
6171
|
-
}).json();
|
|
6172
|
-
} catch (error) {
|
|
6173
|
-
if (error?.response?.status === 404) throw new PackageNotFoundError(packageName);
|
|
6174
|
-
throw error;
|
|
6175
|
-
}
|
|
6176
|
-
if (options.allVersions) return data;
|
|
6177
|
-
const versionError = new VersionNotFoundError(packageName, version$1);
|
|
6178
|
-
if (data["dist-tags"][version$1]) {
|
|
6179
|
-
const { time } = data;
|
|
6180
|
-
data = data.versions[data["dist-tags"][version$1]];
|
|
6181
|
-
data.time = time;
|
|
6182
|
-
} else if (version$1) {
|
|
6183
|
-
const versionExists = Boolean(data.versions[version$1]);
|
|
6184
|
-
if (omitDeprecated && !versionExists) {
|
|
6185
|
-
for (const [metadataVersion, metadata] of Object.entries(data.versions)) if (metadata.deprecated) delete data.versions[metadataVersion];
|
|
6186
|
-
}
|
|
6187
|
-
if (!versionExists) {
|
|
6188
|
-
const versions = Object.keys(data.versions);
|
|
6189
|
-
version$1 = import_semver.default.maxSatisfying(versions, version$1);
|
|
6190
|
-
if (!version$1) throw versionError;
|
|
6191
|
-
}
|
|
6192
|
-
const { time } = data;
|
|
6193
|
-
data = data.versions[version$1];
|
|
6194
|
-
data.time = time;
|
|
6195
|
-
if (!data) throw versionError;
|
|
6196
|
-
}
|
|
6197
|
-
return data;
|
|
6198
|
-
}
|
|
6199
|
-
|
|
6200
|
-
//#endregion
|
|
6201
|
-
//#region ../../node_modules/.pnpm/latest-version@9.0.0/node_modules/latest-version/index.js
|
|
6202
|
-
async function latestVersion(packageName, options) {
|
|
6203
|
-
const { version: version$1 } = await packageJson$1(packageName.toLowerCase(), options);
|
|
6204
|
-
return version$1;
|
|
6205
|
-
}
|
|
6206
|
-
|
|
6207
|
-
//#endregion
|
|
6208
|
-
//#region ../../node_modules/.pnpm/is-npm@6.0.0/node_modules/is-npm/index.js
|
|
6209
|
-
const packageJson = process$1.env.npm_package_json;
|
|
6210
|
-
const userAgent = process$1.env.npm_config_user_agent;
|
|
6211
|
-
const isNpm6 = Boolean(userAgent && userAgent.startsWith("npm"));
|
|
6212
|
-
const isNpm7 = Boolean(packageJson && packageJson.endsWith("package.json"));
|
|
6213
|
-
const isNpm = isNpm6 || isNpm7;
|
|
6214
|
-
const isYarn = Boolean(userAgent && userAgent.startsWith("yarn"));
|
|
6215
|
-
const isNpmOrYarn = isNpm || isYarn;
|
|
6216
|
-
|
|
6217
|
-
//#endregion
|
|
6218
|
-
//#region ../../node_modules/.pnpm/ini@4.1.1/node_modules/ini/lib/ini.js
|
|
6219
|
-
var require_ini = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ini@4.1.1/node_modules/ini/lib/ini.js": ((exports, module) => {
|
|
6220
|
-
const { hasOwnProperty } = Object.prototype;
|
|
6221
|
-
const encode = (obj, opt = {}) => {
|
|
6222
|
-
if (typeof opt === "string") opt = { section: opt };
|
|
6223
|
-
opt.align = opt.align === true;
|
|
6224
|
-
opt.newline = opt.newline === true;
|
|
6225
|
-
opt.sort = opt.sort === true;
|
|
6226
|
-
opt.whitespace = opt.whitespace === true || opt.align === true;
|
|
6227
|
-
/* istanbul ignore next */
|
|
6228
|
-
opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
|
|
6229
|
-
opt.bracketedArray = opt.bracketedArray !== false;
|
|
6230
|
-
/* istanbul ignore next */
|
|
6231
|
-
const eol$1 = opt.platform === "win32" ? "\r\n" : "\n";
|
|
6232
|
-
const separator = opt.whitespace ? " = " : "=";
|
|
6233
|
-
const children = [];
|
|
6234
|
-
const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
|
|
6235
|
-
let padToChars = 0;
|
|
6236
|
-
if (opt.align) padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)).length;
|
|
6237
|
-
let out = "";
|
|
6238
|
-
const arraySuffix = opt.bracketedArray ? "[]" : "";
|
|
6239
|
-
for (const k of keys) {
|
|
6240
|
-
const val = obj[k];
|
|
6241
|
-
if (val && Array.isArray(val)) for (const item of val) out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol$1;
|
|
6242
|
-
else if (val && typeof val === "object") children.push(k);
|
|
6243
|
-
else out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol$1;
|
|
6244
|
-
}
|
|
6245
|
-
if (opt.section && out.length) out = "[" + safe(opt.section) + "]" + (opt.newline ? eol$1 + eol$1 : eol$1) + out;
|
|
6246
|
-
for (const k of children) {
|
|
6247
|
-
const nk = splitSections(k, ".").join("\\.");
|
|
6248
|
-
const section = (opt.section ? opt.section + "." : "") + nk;
|
|
6249
|
-
const child = encode(obj[k], {
|
|
6250
|
-
...opt,
|
|
6251
|
-
section
|
|
6252
|
-
});
|
|
6253
|
-
if (out.length && child.length) out += eol$1;
|
|
6254
|
-
out += child;
|
|
6255
|
-
}
|
|
6256
|
-
return out;
|
|
4833
|
+
return out;
|
|
6257
4834
|
};
|
|
6258
4835
|
function splitSections(str, separator) {
|
|
6259
4836
|
var lastMatchIndex = 0;
|
|
@@ -6277,12 +4854,12 @@ var require_ini = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ini@4.1
|
|
|
6277
4854
|
const out = Object.create(null);
|
|
6278
4855
|
let p = out;
|
|
6279
4856
|
let section = null;
|
|
6280
|
-
const re
|
|
4857
|
+
const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
|
|
6281
4858
|
const lines = str.split(/[\r\n]+/g);
|
|
6282
4859
|
const duplicates = {};
|
|
6283
4860
|
for (const line of lines) {
|
|
6284
4861
|
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) continue;
|
|
6285
|
-
const match = line.match(re
|
|
4862
|
+
const match = line.match(re);
|
|
6286
4863
|
if (!match) continue;
|
|
6287
4864
|
if (match[1] !== void 0) {
|
|
6288
4865
|
section = unsafe(match[1]);
|
|
@@ -6378,7 +4955,7 @@ var import_ini = /* @__PURE__ */ __toESM(require_ini(), 1);
|
|
|
6378
4955
|
const isWindows = process$1.platform === "win32";
|
|
6379
4956
|
const readRc = (filePath) => {
|
|
6380
4957
|
try {
|
|
6381
|
-
return import_ini.default.parse(fs.readFileSync(filePath, "utf8")).prefix;
|
|
4958
|
+
return import_ini.default.parse(fs$1.readFileSync(filePath, "utf8")).prefix;
|
|
6382
4959
|
} catch {}
|
|
6383
4960
|
};
|
|
6384
4961
|
const getEnvNpmPrefix = () => Object.keys(process$1.env).reduce((prefix, name$1) => /^npm_config_prefix$/i.test(name$1) ? process$1.env[name$1] : prefix, void 0);
|
|
@@ -6414,7 +4991,7 @@ const npmPrefix = path.resolve(getNpmPrefix());
|
|
|
6414
4991
|
const getYarnWindowsDirectory = () => {
|
|
6415
4992
|
if (isWindows && process$1.env.LOCALAPPDATA) {
|
|
6416
4993
|
const dir = path.join(process$1.env.LOCALAPPDATA, "Yarn");
|
|
6417
|
-
if (fs.existsSync(dir)) return dir;
|
|
4994
|
+
if (fs$1.existsSync(dir)) return dir;
|
|
6418
4995
|
}
|
|
6419
4996
|
return false;
|
|
6420
4997
|
};
|
|
@@ -6423,9 +5000,9 @@ const getYarnPrefix = () => {
|
|
|
6423
5000
|
const windowsPrefix = getYarnWindowsDirectory();
|
|
6424
5001
|
if (windowsPrefix) return windowsPrefix;
|
|
6425
5002
|
const configPrefix = path.join(os.homedir(), ".config/yarn");
|
|
6426
|
-
if (fs.existsSync(configPrefix)) return configPrefix;
|
|
5003
|
+
if (fs$1.existsSync(configPrefix)) return configPrefix;
|
|
6427
5004
|
const homePrefix = path.join(os.homedir(), ".yarn-config");
|
|
6428
|
-
if (fs.existsSync(homePrefix)) return homePrefix;
|
|
5005
|
+
if (fs$1.existsSync(homePrefix)) return homePrefix;
|
|
6429
5006
|
return npmPrefix;
|
|
6430
5007
|
};
|
|
6431
5008
|
const globalDirectory = {};
|
|
@@ -6452,7 +5029,7 @@ function isPathInside(childPath, parentPath) {
|
|
|
6452
5029
|
const __dirname$1 = path.dirname(fileURLToPath(import.meta.url));
|
|
6453
5030
|
const isInstalledGlobally = (() => {
|
|
6454
5031
|
try {
|
|
6455
|
-
return isPathInside(__dirname$1, global_directory_default.yarn.packages) || isPathInside(__dirname$1, fs.realpathSync(global_directory_default.npm.packages));
|
|
5032
|
+
return isPathInside(__dirname$1, global_directory_default.yarn.packages) || isPathInside(__dirname$1, fs$1.realpathSync(global_directory_default.npm.packages));
|
|
6456
5033
|
} catch {
|
|
6457
5034
|
return false;
|
|
6458
5035
|
}
|
|
@@ -6508,8 +5085,6 @@ function pupa(template, data, { ignoreMissing = false, transform = ({ value }) =
|
|
|
6508
5085
|
|
|
6509
5086
|
//#endregion
|
|
6510
5087
|
//#region ../../node_modules/.pnpm/update-notifier@7.3.1/node_modules/update-notifier/update-notifier.js
|
|
6511
|
-
var import_diff = /* @__PURE__ */ __toESM(require_diff(), 1);
|
|
6512
|
-
var import_gt = /* @__PURE__ */ __toESM(require_gt(), 1);
|
|
6513
5088
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6514
5089
|
const ONE_DAY = 1e3 * 60 * 60 * 24;
|
|
6515
5090
|
var UpdateNotifier = class {
|
|
@@ -6566,13 +5141,13 @@ var UpdateNotifier = class {
|
|
|
6566
5141
|
return {
|
|
6567
5142
|
latest,
|
|
6568
5143
|
current: this.#packageVersion,
|
|
6569
|
-
type: (
|
|
5144
|
+
type: semverDiff(this.#packageVersion, latest) ?? distTag,
|
|
6570
5145
|
name: this._packageName
|
|
6571
5146
|
};
|
|
6572
5147
|
}
|
|
6573
5148
|
notify(options) {
|
|
6574
5149
|
const suppressForNpm = !this._shouldNotifyInNpmScript && isNpmOrYarn;
|
|
6575
|
-
if (!process$1.stdout.isTTY || suppressForNpm || !this.update || !(
|
|
5150
|
+
if (!process$1.stdout.isTTY || suppressForNpm || !this.update || !semverGt(this.update.latest, this.update.current)) return this;
|
|
6576
5151
|
options = {
|
|
6577
5152
|
isGlobal: is_installed_globally_default,
|
|
6578
5153
|
...options
|
|
@@ -6657,18 +5232,23 @@ var dependencies = {
|
|
|
6657
5232
|
"commander": "^14.0.0",
|
|
6658
5233
|
"esbuild": "^0.25.8",
|
|
6659
5234
|
"eslint": "^9.32.0",
|
|
6660
|
-
"execa": "9.3.1",
|
|
6661
5235
|
"glob": "^11.0.3",
|
|
5236
|
+
"https-proxy-agent": "^7.0.6",
|
|
5237
|
+
"listr2": "^9.0.1",
|
|
6662
5238
|
"node-eval": "^2.0.0",
|
|
5239
|
+
"node-fetch": "^3.3.2",
|
|
6663
5240
|
"ora": "^8.2.0",
|
|
6664
5241
|
"picocolors": "^1.1.1",
|
|
6665
5242
|
"prettier": "^3.6.2",
|
|
6666
5243
|
"prompts": "^2.4.2",
|
|
5244
|
+
"rimraf": "^6.0.1",
|
|
5245
|
+
"semver": "^7.7.2",
|
|
6667
5246
|
"validate-npm-package-name": "^6.0.2",
|
|
6668
5247
|
"yamljs": "^0.3.0"
|
|
6669
5248
|
};
|
|
6670
5249
|
var devDependencies = {
|
|
6671
5250
|
"@types/prompts": "^2.4.9",
|
|
5251
|
+
"@types/semver": "^7.7.0",
|
|
6672
5252
|
"@types/update-notifier": "6.0.8",
|
|
6673
5253
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
6674
5254
|
"@types/yamljs": "^0.2.34",
|
|
@@ -6697,18 +5277,472 @@ var package_default = {
|
|
|
6697
5277
|
devDependencies
|
|
6698
5278
|
};
|
|
6699
5279
|
|
|
5280
|
+
//#endregion
|
|
5281
|
+
//#region src/utils/fs.ts
|
|
5282
|
+
async function isWriteable(directory) {
|
|
5283
|
+
try {
|
|
5284
|
+
await fs.promises.access(directory, ("constants" in fs ? fs.constants : fs).W_OK);
|
|
5285
|
+
return true;
|
|
5286
|
+
} catch {
|
|
5287
|
+
return false;
|
|
5288
|
+
}
|
|
5289
|
+
}
|
|
5290
|
+
async function writeFileSafe(path$9, content, options) {
|
|
5291
|
+
if (path$9.includes("/")) {
|
|
5292
|
+
const dirPath = path$9.split("/").slice(0, -1).join("/");
|
|
5293
|
+
if (!existsSync(dirPath)) await mkdir(dirPath, { recursive: true });
|
|
5294
|
+
}
|
|
5295
|
+
await writeFile(path$9, content, options);
|
|
5296
|
+
}
|
|
5297
|
+
async function validateDir(path$9) {
|
|
5298
|
+
const writeable = await isWriteable(path$9);
|
|
5299
|
+
if (!writeable) throw new Error(`The path ${path$9} does not writeable. Please check the permissions.`);
|
|
5300
|
+
if (!existsSync(path$9)) throw new Error(`The path ${path$9} does not exist. Please try again.`);
|
|
5301
|
+
if (!statSync(path$9).isDirectory()) throw new Error(`The path ${path$9} is not a directory. Please try again.`);
|
|
5302
|
+
return true;
|
|
5303
|
+
}
|
|
5304
|
+
function timer() {
|
|
5305
|
+
const start = process.hrtime.bigint();
|
|
5306
|
+
const end = () => {
|
|
5307
|
+
const end$1 = process.hrtime.bigint();
|
|
5308
|
+
const duration = (Number(end$1 - start) / 1e9).toFixed(2);
|
|
5309
|
+
console.log("\n", c.green(`Done in ${duration}s`));
|
|
5310
|
+
};
|
|
5311
|
+
return {
|
|
5312
|
+
end,
|
|
5313
|
+
start
|
|
5314
|
+
};
|
|
5315
|
+
}
|
|
5316
|
+
|
|
5317
|
+
//#endregion
|
|
5318
|
+
//#region src/utils/prettier.ts
|
|
5319
|
+
async function format$2(content, options) {
|
|
5320
|
+
const path$9 = await resolveConfigFile();
|
|
5321
|
+
const config$1 = path$9 ? await resolveConfig(path$9) : {};
|
|
5322
|
+
try {
|
|
5323
|
+
return format$1(content, {
|
|
5324
|
+
...config$1,
|
|
5325
|
+
parser: "typescript",
|
|
5326
|
+
...options
|
|
5327
|
+
});
|
|
5328
|
+
} catch {
|
|
5329
|
+
return content;
|
|
5330
|
+
}
|
|
5331
|
+
}
|
|
5332
|
+
|
|
5333
|
+
//#endregion
|
|
5334
|
+
//#region src/utils/package.ts
|
|
5335
|
+
function getPackageManager() {
|
|
5336
|
+
const userAgent$1 = process.env.npm_config_user_agent || "";
|
|
5337
|
+
if (userAgent$1.startsWith("yarn")) return "yarn";
|
|
5338
|
+
if (userAgent$1.startsWith("pnpm")) return "pnpm";
|
|
5339
|
+
if (userAgent$1.startsWith("bun")) return "bun";
|
|
5340
|
+
return "npm";
|
|
5341
|
+
}
|
|
5342
|
+
async function getPackageJson(cwd$2) {
|
|
5343
|
+
try {
|
|
5344
|
+
const packageJson$2 = await readFile(path$1.resolve(cwd$2, "package.json"), "utf8");
|
|
5345
|
+
return JSON.parse(packageJson$2);
|
|
5346
|
+
} catch {
|
|
5347
|
+
throw new Error(`No package.json found. Please run ${c.cyan(`${getPackageManager()} init`)}.`);
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
function getVersion({ dependencies: dependencies$1, devDependencies: devDependencies$1 }, nameWithVersion) {
|
|
5351
|
+
const [name$1, version$1] = splitVersion(nameWithVersion);
|
|
5352
|
+
if (!name$1) return;
|
|
5353
|
+
let currentVersion;
|
|
5354
|
+
if (isObject(dependencies$1) && name$1 in dependencies$1) currentVersion = dependencies$1[name$1];
|
|
5355
|
+
else if (isObject(devDependencies$1) && name$1 in devDependencies$1) currentVersion = devDependencies$1[name$1];
|
|
5356
|
+
if (!version$1) return currentVersion;
|
|
5357
|
+
if (!currentVersion) return { wanted: version$1 };
|
|
5358
|
+
if (currentVersion === version$1 || semver.satisfies(currentVersion, version$1)) return currentVersion;
|
|
5359
|
+
else return {
|
|
5360
|
+
current: currentVersion,
|
|
5361
|
+
wanted: version$1
|
|
5362
|
+
};
|
|
5363
|
+
}
|
|
5364
|
+
function findDependencies(packageJson$2, dependencies$1) {
|
|
5365
|
+
return Object.fromEntries(dependencies$1.map((dependency) => [splitVersion(dependency)[0], getVersion(packageJson$2, dependency)]));
|
|
5366
|
+
}
|
|
5367
|
+
function getNotInstalledDependencies(packageJson$2, dependencies$1) {
|
|
5368
|
+
const installedDependencies = findDependencies(packageJson$2, dependencies$1);
|
|
5369
|
+
return Object.entries(installedDependencies).filter(([_, version$1]) => !version$1 || isObject(version$1)).map(([name$1, version$1]) => isObject(version$1) ? {
|
|
5370
|
+
name: name$1,
|
|
5371
|
+
...version$1
|
|
5372
|
+
} : name$1);
|
|
5373
|
+
}
|
|
5374
|
+
function splitVersion(value) {
|
|
5375
|
+
if (value.startsWith("@")) {
|
|
5376
|
+
const [, name$1, version$1] = value.split("@");
|
|
5377
|
+
return [`@${name$1}`, version$1];
|
|
5378
|
+
} else return value.split("@");
|
|
5379
|
+
}
|
|
5380
|
+
function getPackageName(value) {
|
|
5381
|
+
return isObject(value) ? `${value.name}@${value.wanted}` : value;
|
|
5382
|
+
}
|
|
5383
|
+
function packageAddCommand(packageManager, { dev = false, exact = false } = {}) {
|
|
5384
|
+
const command = [packageManager];
|
|
5385
|
+
if (packageManager === "npm") command.push("install");
|
|
5386
|
+
else command.push("add");
|
|
5387
|
+
if (dev) if (packageManager === "npm") command.push("--save-dev");
|
|
5388
|
+
else command.push("--dev");
|
|
5389
|
+
if (exact) command.push("--save-exact");
|
|
5390
|
+
return command.join(" ");
|
|
5391
|
+
}
|
|
5392
|
+
function packageExecuteCommand(packageManager) {
|
|
5393
|
+
switch (packageManager) {
|
|
5394
|
+
case "npm": return "npx";
|
|
5395
|
+
case "pnpm": return "pnpm dlx";
|
|
5396
|
+
case "yarn": return "yarn dlx";
|
|
5397
|
+
case "bun": return "bunx --bun";
|
|
5398
|
+
}
|
|
5399
|
+
}
|
|
5400
|
+
function installDependencies(dependencies$1, { cwd: cwd$2, dev, exact = true } = {}) {
|
|
5401
|
+
const packageManager = getPackageManager();
|
|
5402
|
+
if (dependencies$1?.length) {
|
|
5403
|
+
const command = packageAddCommand(packageManager, {
|
|
5404
|
+
dev,
|
|
5405
|
+
exact
|
|
5406
|
+
});
|
|
5407
|
+
execSync(`${command} ${dependencies$1.join(" ")}`, {
|
|
5408
|
+
cwd: cwd$2,
|
|
5409
|
+
stdio: "ignore"
|
|
5410
|
+
});
|
|
5411
|
+
} else execSync(`${packageManager} install`, {
|
|
5412
|
+
cwd: cwd$2,
|
|
5413
|
+
stdio: "ignore"
|
|
5414
|
+
});
|
|
5415
|
+
}
|
|
5416
|
+
async function addWorkspace(cwd$2, workspacePath) {
|
|
5417
|
+
const packageManager = getPackageManager();
|
|
5418
|
+
switch (packageManager) {
|
|
5419
|
+
case "pnpm":
|
|
5420
|
+
if (existsSync(path$1.resolve(cwd$2, "pnpm-workspace.yaml"))) {
|
|
5421
|
+
const content = await readFile(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), "utf8");
|
|
5422
|
+
const json$1 = YAML.parse(content);
|
|
5423
|
+
json$1.packages ??= [];
|
|
5424
|
+
if (!json$1.packages.includes(workspacePath)) {
|
|
5425
|
+
json$1.packages.push(workspacePath);
|
|
5426
|
+
const content$1 = await format$2(YAML.stringify(json$1), { parser: "yaml" });
|
|
5427
|
+
await writeFileSafe(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), content$1);
|
|
5428
|
+
}
|
|
5429
|
+
} else {
|
|
5430
|
+
const data = YAML.stringify({ packages: [workspacePath] });
|
|
5431
|
+
const content = await format$2(data, { parser: "yaml" });
|
|
5432
|
+
await writeFileSafe(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), content);
|
|
5433
|
+
}
|
|
5434
|
+
break;
|
|
5435
|
+
default: {
|
|
5436
|
+
const packageJson$2 = await getPackageJson(cwd$2);
|
|
5437
|
+
packageJson$2.workspaces ??= [];
|
|
5438
|
+
if (!packageJson$2.workspaces.includes(workspacePath)) {
|
|
5439
|
+
packageJson$2.workspaces.push(workspacePath);
|
|
5440
|
+
const content = await format$2(JSON.stringify(packageJson$2), { parser: "json" });
|
|
5441
|
+
await writeFileSafe(path$1.resolve(cwd$2, "package.json"), content);
|
|
5442
|
+
}
|
|
5443
|
+
break;
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
}
|
|
5447
|
+
|
|
5448
|
+
//#endregion
|
|
5449
|
+
//#region src/utils/config.ts
|
|
5450
|
+
async function getConfig(cwd$2, configPath) {
|
|
5451
|
+
try {
|
|
5452
|
+
const data = await readFile(path$1.resolve(cwd$2, configPath), "utf8");
|
|
5453
|
+
const userConfig = JSON.parse(data);
|
|
5454
|
+
const rootPath = path$1.resolve(cwd$2, userConfig.path ?? (userConfig.monorepo ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo));
|
|
5455
|
+
const src = existsSync(path$1.resolve(rootPath, "src"));
|
|
5456
|
+
const srcPath = src ? path$1.resolve(rootPath, "src") : rootPath;
|
|
5457
|
+
const sectionMap = Object.fromEntries(SECTION_NAMES.map((section) => {
|
|
5458
|
+
const path$9 = userConfig[section]?.path ?? DEFAULT_PATH[section];
|
|
5459
|
+
const replacedSection = path$9.replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
|
|
5460
|
+
return [section, replacedSection];
|
|
5461
|
+
}));
|
|
5462
|
+
function getSectionAbsolutePath(section) {
|
|
5463
|
+
return path$1.resolve(srcPath, userConfig[section]?.path ?? DEFAULT_PATH[section]);
|
|
5464
|
+
}
|
|
5465
|
+
function getSectionPath(section) {
|
|
5466
|
+
let path$9 = userConfig[section]?.path ?? DEFAULT_PATH[section];
|
|
5467
|
+
if (path$9.startsWith("/")) path$9 = `./${path$9}`;
|
|
5468
|
+
if (!path$9.startsWith("./")) path$9 = `./${path$9}`;
|
|
5469
|
+
return path$9;
|
|
5470
|
+
}
|
|
5471
|
+
function getSection(value) {
|
|
5472
|
+
if (!value) return;
|
|
5473
|
+
if (SECTION_NAMES.includes(value)) {
|
|
5474
|
+
const section = value;
|
|
5475
|
+
return {
|
|
5476
|
+
...userConfig[section],
|
|
5477
|
+
absolutePath: getSectionAbsolutePath(section),
|
|
5478
|
+
path: getSectionPath(section),
|
|
5479
|
+
section
|
|
5480
|
+
};
|
|
5481
|
+
} else {
|
|
5482
|
+
const [result] = Object.entries(sectionMap).find(([section$1, replaceSection]) => replaceSection === value || section$1 === value) ?? [];
|
|
5483
|
+
if (!result) return;
|
|
5484
|
+
const section = result;
|
|
5485
|
+
return {
|
|
5486
|
+
...userConfig[section],
|
|
5487
|
+
absolutePath: getSectionAbsolutePath(section),
|
|
5488
|
+
path: getSectionPath(section),
|
|
5489
|
+
section
|
|
5490
|
+
};
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
return {
|
|
5494
|
+
...userConfig,
|
|
5495
|
+
src,
|
|
5496
|
+
cwd: cwd$2,
|
|
5497
|
+
getSection,
|
|
5498
|
+
getSectionAbsolutePath,
|
|
5499
|
+
getSectionPath,
|
|
5500
|
+
rootPath,
|
|
5501
|
+
srcPath
|
|
5502
|
+
};
|
|
5503
|
+
} catch {
|
|
5504
|
+
const packageManager = getPackageManager();
|
|
5505
|
+
const command = packageExecuteCommand(packageManager);
|
|
5506
|
+
throw new Error(`No config found. Please run ${c.cyan(`${command} ${package_default.name}@latest init`)}.`);
|
|
5507
|
+
}
|
|
5508
|
+
}
|
|
5509
|
+
|
|
5510
|
+
//#endregion
|
|
5511
|
+
//#region src/utils/module.ts
|
|
5512
|
+
async function getModule(file$1, cwd$2) {
|
|
5513
|
+
const result = await build({
|
|
5514
|
+
absWorkingDir: cwd$2,
|
|
5515
|
+
bundle: true,
|
|
5516
|
+
entryPoints: [file$1],
|
|
5517
|
+
format: "cjs",
|
|
5518
|
+
mainFields: ["module", "main"],
|
|
5519
|
+
metafile: true,
|
|
5520
|
+
outfile: "out.js",
|
|
5521
|
+
platform: "node",
|
|
5522
|
+
sourcemap: false,
|
|
5523
|
+
write: false
|
|
5524
|
+
});
|
|
5525
|
+
const { text: code } = result.outputFiles[0] ?? {};
|
|
5526
|
+
const dependencies$1 = isObject(result.metafile) ? Object.keys(result.metafile.inputs) : [];
|
|
5527
|
+
try {
|
|
5528
|
+
const realFileName = realpathSync.native(file$1);
|
|
5529
|
+
if (!code) throw new Error("code is undefined");
|
|
5530
|
+
const script = new Script(code, { filename: realFileName });
|
|
5531
|
+
const mod = { exports: {} };
|
|
5532
|
+
const require$1 = (id) => id === realFileName ? mod.exports : require$1(id);
|
|
5533
|
+
script.runInThisContext()(mod.exports, require$1, mod);
|
|
5534
|
+
return {
|
|
5535
|
+
code,
|
|
5536
|
+
dependencies: dependencies$1,
|
|
5537
|
+
mod
|
|
5538
|
+
};
|
|
5539
|
+
} catch {
|
|
5540
|
+
const mod = nodeEval(code);
|
|
5541
|
+
return {
|
|
5542
|
+
code,
|
|
5543
|
+
dependencies: dependencies$1,
|
|
5544
|
+
mod
|
|
5545
|
+
};
|
|
5546
|
+
}
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
//#endregion
|
|
5550
|
+
//#region src/utils/registry.ts
|
|
5551
|
+
const agent = process.env.https_proxy ? new HttpsProxyAgent(process.env.https_proxy) : void 0;
|
|
5552
|
+
const registryStore = /* @__PURE__ */ new Map();
|
|
5553
|
+
function getRegistryUrl(name$1) {
|
|
5554
|
+
if (name$1 === "index") return path$1.join(REGISTRY_URL, "index.json");
|
|
5555
|
+
else if (name$1 === "theme") return path$1.join(REGISTRY_URL, "theme.json");
|
|
5556
|
+
else if (name$1.startsWith("use-")) return path$1.join(REGISTRY_URL, "hooks", `${name$1}.json`);
|
|
5557
|
+
else if (name$1.endsWith("-provider")) return path$1.join(REGISTRY_URL, "providers", `${name$1}.json`);
|
|
5558
|
+
else return path$1.join(REGISTRY_URL, "components", `${name$1}.json`);
|
|
5559
|
+
}
|
|
5560
|
+
async function fetchRegistryNames() {
|
|
5561
|
+
const { sources } = await fetchRegistry("index");
|
|
5562
|
+
const content = sources[0].content;
|
|
5563
|
+
const regex = /"@yamada-ui\/react\/([^"/]+)(?:\/([^"/]+))?"/g;
|
|
5564
|
+
const registryNames = [];
|
|
5565
|
+
let match = regex.exec(content);
|
|
5566
|
+
while (match !== null) {
|
|
5567
|
+
if (match[2]) registryNames.push(match[2]);
|
|
5568
|
+
match = regex.exec(content);
|
|
5569
|
+
}
|
|
5570
|
+
return registryNames;
|
|
5571
|
+
}
|
|
5572
|
+
async function fetchRegistry(name$1, { cache: cache$1 = true } = {}) {
|
|
5573
|
+
const url$2 = getRegistryUrl(name$1);
|
|
5574
|
+
if (cache$1 && registryStore.has(url$2)) return registryStore.get(url$2);
|
|
5575
|
+
const res = await fetch(url$2, { agent });
|
|
5576
|
+
if (res.ok) {
|
|
5577
|
+
const registry = await res.json();
|
|
5578
|
+
if (cache$1) registryStore.set(url$2, registry);
|
|
5579
|
+
return registry;
|
|
5580
|
+
} else switch (res.status) {
|
|
5581
|
+
case 400:
|
|
5582
|
+
case 401:
|
|
5583
|
+
case 403: throw new Error(`You do not have access to the registry at ${c.red(name$1)}.`);
|
|
5584
|
+
case 404: throw new Error(`The registry at ${c.red(name$1)} was not found. Please make sure the registry is available.`);
|
|
5585
|
+
case 500:
|
|
5586
|
+
case 501:
|
|
5587
|
+
case 502:
|
|
5588
|
+
case 503: throw new Error(`Service unavailable. Please try again later.`);
|
|
5589
|
+
default: throw new Error(`An error occurred while fetching the registry at ${c.red(name$1)}. Please try again later.`);
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
async function fetchRegistries(names, config$1, { cache: cache$1 = true, dependencies: withDependencies = true, dependents: withDependents = true, omit = [] } = {}) {
|
|
5593
|
+
const results = {};
|
|
5594
|
+
async function fetch$1(names$1) {
|
|
5595
|
+
await Promise.all(names$1.map(async (name$1) => {
|
|
5596
|
+
if (results[name$1] || omit.includes(name$1)) return;
|
|
5597
|
+
results[name$1] = fetchRegistry(name$1, { cache: cache$1 });
|
|
5598
|
+
results[name$1] = await results[name$1];
|
|
5599
|
+
const { dependencies: dependencies$1, dependents, section } = results[name$1];
|
|
5600
|
+
const target = [];
|
|
5601
|
+
if (section === "root" || section === "theme") return;
|
|
5602
|
+
withDependencies = withDependencies && (config$1[section]?.dependents ?? true);
|
|
5603
|
+
withDependents = withDependents && (config$1[section]?.dependencies ?? false);
|
|
5604
|
+
if (withDependencies && dependents) {
|
|
5605
|
+
target.push(...dependents.components);
|
|
5606
|
+
target.push(...dependents.hooks);
|
|
5607
|
+
target.push(...dependents.providers);
|
|
5608
|
+
}
|
|
5609
|
+
if (withDependents && dependencies$1) {
|
|
5610
|
+
target.push(...dependencies$1.components);
|
|
5611
|
+
target.push(...dependencies$1.hooks);
|
|
5612
|
+
target.push(...dependencies$1.providers);
|
|
5613
|
+
}
|
|
5614
|
+
const names$2 = [...new Set(target)].filter((name$2) => !results[name$2]);
|
|
5615
|
+
if (names$2.length) await fetch$1(names$2);
|
|
5616
|
+
}));
|
|
5617
|
+
}
|
|
5618
|
+
await fetch$1(names);
|
|
5619
|
+
return results;
|
|
5620
|
+
}
|
|
5621
|
+
async function getGeneratedNameMap(config$1) {
|
|
5622
|
+
const results = await Promise.all(SECTION_NAMES.map(async (section) => {
|
|
5623
|
+
try {
|
|
5624
|
+
const sectionPath = config$1.getSectionAbsolutePath(section);
|
|
5625
|
+
const dirents = await readdir(sectionPath, { withFileTypes: true });
|
|
5626
|
+
return [section, dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)];
|
|
5627
|
+
} catch {
|
|
5628
|
+
return [section, []];
|
|
5629
|
+
}
|
|
5630
|
+
}));
|
|
5631
|
+
return Object.fromEntries(results);
|
|
5632
|
+
}
|
|
5633
|
+
function transformTemplate(targetSection, content, { getSection }, generatedNames) {
|
|
5634
|
+
const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
|
|
5635
|
+
matches.forEach((match) => {
|
|
5636
|
+
const [searchValue, value] = match;
|
|
5637
|
+
if (!value) return;
|
|
5638
|
+
const relative = value.includes("..");
|
|
5639
|
+
const module$1 = (/* @__PURE__ */ new RegExp(`^@yamada-ui\/react\/(${SECTION_NAMES.join("|")})`)).test(value);
|
|
5640
|
+
const name$1 = value.split("/").at(-1);
|
|
5641
|
+
if (!relative && !module$1 || !name$1) return;
|
|
5642
|
+
const generated = generatedNames.includes(name$1);
|
|
5643
|
+
let replaceValue;
|
|
5644
|
+
if (module$1) {
|
|
5645
|
+
const [section] = value.split("/").slice(-2);
|
|
5646
|
+
if (!generated || !section) return;
|
|
5647
|
+
if (section === targetSection) replaceValue = `from "${path$1.join("..", name$1)}"`;
|
|
5648
|
+
else {
|
|
5649
|
+
const { path: relativePath } = getSection(section) ?? {};
|
|
5650
|
+
if (!relativePath) return;
|
|
5651
|
+
replaceValue = `from "${path$1.join("..", "..", relativePath, name$1)}"`;
|
|
5652
|
+
}
|
|
5653
|
+
} else {
|
|
5654
|
+
const depth = (value.match(/\.\.\//g) || []).length;
|
|
5655
|
+
if (!depth) return;
|
|
5656
|
+
if (depth === 1) if (generated) replaceValue = `from "${path$1.join("..", name$1)}"`;
|
|
5657
|
+
else replaceValue = `from "@yamada-ui/react/${targetSection}/${name$1}"`;
|
|
5658
|
+
else {
|
|
5659
|
+
const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
|
|
5660
|
+
const query = omittedValue.split("/").slice(0, -1).join("/");
|
|
5661
|
+
const { path: sectionPath, section } = getSection(query) ?? {};
|
|
5662
|
+
if (!section || !sectionPath) return;
|
|
5663
|
+
if (generated) {
|
|
5664
|
+
const targetDepth = (sectionPath.match(/\.\.\//g) || []).length;
|
|
5665
|
+
const neededDepth = depth + targetDepth;
|
|
5666
|
+
const omittedTargetPath = sectionPath.replace(/(\.\.\/|\.\/)/g, "");
|
|
5667
|
+
const position = "../".repeat(neededDepth);
|
|
5668
|
+
replaceValue = `from "${position}${omittedTargetPath}/${name$1}"`;
|
|
5669
|
+
} else replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
5670
|
+
}
|
|
5671
|
+
}
|
|
5672
|
+
content = content.replace(searchValue, replaceValue);
|
|
5673
|
+
});
|
|
5674
|
+
return content;
|
|
5675
|
+
}
|
|
5676
|
+
function transformTemplateContent(template, data) {
|
|
5677
|
+
let content = template;
|
|
5678
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
5679
|
+
content = content.replace(new RegExp(`{{${key}}}`, "g"), value);
|
|
5680
|
+
});
|
|
5681
|
+
return content;
|
|
5682
|
+
}
|
|
5683
|
+
async function generateSources(dirPath, { section, sources }, config$1, generatedNames = []) {
|
|
5684
|
+
await Promise.all(sources.map(async ({ name: fileName, content, data, template }) => {
|
|
5685
|
+
const targetPath = path$1.resolve(dirPath, fileName);
|
|
5686
|
+
if (content) {
|
|
5687
|
+
content = transformTemplate(section, content, config$1, generatedNames);
|
|
5688
|
+
await writeFileSafe(targetPath, await format$2(content));
|
|
5689
|
+
} else if (template && data) await Promise.all(data.map(async ({ name: fileName$1,...rest }) => {
|
|
5690
|
+
content = transformTemplateContent(template, rest);
|
|
5691
|
+
content = transformTemplate(section, content, config$1, generatedNames);
|
|
5692
|
+
await writeFileSafe(path$1.resolve(targetPath, fileName$1), await format$2(content));
|
|
5693
|
+
}));
|
|
5694
|
+
}));
|
|
5695
|
+
}
|
|
5696
|
+
function replaceIndex(generatedNames, content, { getSection }) {
|
|
5697
|
+
const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
|
|
5698
|
+
matches.forEach((match) => {
|
|
5699
|
+
const [searchValue, value] = match;
|
|
5700
|
+
if (!value) return;
|
|
5701
|
+
const name$1 = value.split("/").at(-1);
|
|
5702
|
+
if (!name$1) return;
|
|
5703
|
+
const generated = generatedNames.includes(name$1);
|
|
5704
|
+
let replaceValue;
|
|
5705
|
+
if (generated) {
|
|
5706
|
+
const [section] = value.split("/").slice(-2);
|
|
5707
|
+
const { path: path$9 } = getSection(section) ?? {};
|
|
5708
|
+
if (!path$9) return;
|
|
5709
|
+
replaceValue = `from "${path$9}/${name$1}"`;
|
|
5710
|
+
} else {
|
|
5711
|
+
const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
|
|
5712
|
+
const query = omittedValue.split("/").slice(0, -1).join("/");
|
|
5713
|
+
const { section } = getSection(query) ?? {};
|
|
5714
|
+
if (!section) return;
|
|
5715
|
+
replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
5716
|
+
}
|
|
5717
|
+
content = content.replace(searchValue, replaceValue);
|
|
5718
|
+
});
|
|
5719
|
+
return content;
|
|
5720
|
+
}
|
|
5721
|
+
|
|
6700
5722
|
//#endregion
|
|
6701
5723
|
//#region src/constant.ts
|
|
6702
5724
|
const CONFIG_FILE_NAME = "ui.json";
|
|
6703
5725
|
const DEFAULT_PACKAGE_NAME = "@workspaces/ui";
|
|
6704
5726
|
const REGISTRY_URL = "https://v2.yamada-ui.com/registry/v2";
|
|
6705
|
-
const
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
5727
|
+
const DEFAULT_PATH = {
|
|
5728
|
+
components: "./components",
|
|
5729
|
+
hooks: "./hooks",
|
|
5730
|
+
monorepo: "./workspaces/ui",
|
|
5731
|
+
polyrepo: "./ui",
|
|
5732
|
+
providers: "./providers"
|
|
5733
|
+
};
|
|
5734
|
+
const SECTION_NAMES = [
|
|
5735
|
+
"components",
|
|
5736
|
+
"hooks",
|
|
5737
|
+
"providers"
|
|
5738
|
+
];
|
|
5739
|
+
const DEFAULT_SECTION_CONFIG = {
|
|
5740
|
+
components: { overwrite: true },
|
|
5741
|
+
hooks: { overwrite: true },
|
|
5742
|
+
providers: { overwrite: true }
|
|
6711
5743
|
};
|
|
5744
|
+
const REQUIRED_DEPENDENCIES = ["react@^19", "react-dom@^19"];
|
|
5745
|
+
const REQUIRED_DEV_DEPENDENCIES = ["@types/react@^19", "@types/react-dom@^19"];
|
|
6712
5746
|
const DEFAULT_PACKAGE_JSON = {
|
|
6713
5747
|
version: "1.0.0",
|
|
6714
5748
|
type: "module",
|
|
@@ -6720,15 +5754,8 @@ const DEFAULT_PACKAGE_JSON = {
|
|
|
6720
5754
|
"./hooks/*": "./src/hooks/*/index.ts",
|
|
6721
5755
|
"./providers/*": "./src/providers/*/index.ts"
|
|
6722
5756
|
},
|
|
6723
|
-
dependencies:
|
|
6724
|
-
|
|
6725
|
-
"react-dom": ">=19",
|
|
6726
|
-
"@yamada-ui/react": ">=2"
|
|
6727
|
-
},
|
|
6728
|
-
devDependencies: {
|
|
6729
|
-
"@types/react": ">=19",
|
|
6730
|
-
"@types/react-dom": ">=19"
|
|
6731
|
-
}
|
|
5757
|
+
dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.map((dependency) => splitVersion(dependency))),
|
|
5758
|
+
devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.map((dependency) => splitVersion(dependency)))
|
|
6732
5759
|
};
|
|
6733
5760
|
const TSCONFIG_JSON = {
|
|
6734
5761
|
compilerOptions: {
|
|
@@ -6763,14 +5790,162 @@ const TSCONFIG_JSON = {
|
|
|
6763
5790
|
|
|
6764
5791
|
//#endregion
|
|
6765
5792
|
//#region src/commands/add/index.ts
|
|
6766
|
-
const add = new Command("add").description("Add a component to your project").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).action(function({ cwd: cwd$2 }) {
|
|
5793
|
+
const add = new Command("add").description("Add a component to your project").argument("[components...]", "Components to add").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).option("-o, --overwrite", "overwrite existing files.", false).option("-a, --all", "Add all available components").option("-i, --install", "Install dependencies", false).action(async function(componentNames, { all = !componentNames.length, config: configPath, cwd: cwd$2, install, overwrite }) {
|
|
6767
5794
|
const spinner = ora();
|
|
6768
5795
|
try {
|
|
6769
|
-
const
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
5796
|
+
const { end } = timer();
|
|
5797
|
+
spinner.start("Validating directory");
|
|
5798
|
+
await validateDir(cwd$2);
|
|
5799
|
+
spinner.succeed("Validated directory");
|
|
5800
|
+
spinner.start("Fetching config");
|
|
5801
|
+
const config$1 = await getConfig(cwd$2, configPath);
|
|
5802
|
+
spinner.succeed("Fetched config");
|
|
5803
|
+
let generatedNameMap;
|
|
5804
|
+
const omittedGeneratedNames = [];
|
|
5805
|
+
if (all) {
|
|
5806
|
+
const { proceed } = await prompts({
|
|
5807
|
+
type: "confirm",
|
|
5808
|
+
name: "proceed",
|
|
5809
|
+
initial: true,
|
|
5810
|
+
message: c.reset(`Add all available components?`)
|
|
5811
|
+
});
|
|
5812
|
+
if (!proceed) process.exit(0);
|
|
5813
|
+
if (!overwrite && existsSync(config$1.srcPath)) {
|
|
5814
|
+
const { overwrite: overwrite$1 } = await prompts({
|
|
5815
|
+
type: "confirm",
|
|
5816
|
+
name: "overwrite",
|
|
5817
|
+
initial: false,
|
|
5818
|
+
message: c.reset(`The directory already exists. Do you want to overwrite it?`)
|
|
5819
|
+
});
|
|
5820
|
+
if (!overwrite$1) process.exit(0);
|
|
5821
|
+
}
|
|
5822
|
+
spinner.start("Fetching all available components");
|
|
5823
|
+
componentNames = await fetchRegistryNames();
|
|
5824
|
+
spinner.succeed("Fetched all available components");
|
|
5825
|
+
} else {
|
|
5826
|
+
spinner.start("Getting generated data");
|
|
5827
|
+
generatedNameMap = await getGeneratedNameMap(config$1);
|
|
5828
|
+
const generatedNames = Object.values(generatedNameMap).flat();
|
|
5829
|
+
const existsNames = componentNames.filter((name$1) => generatedNames.includes(name$1));
|
|
5830
|
+
spinner.succeed("Got generated data");
|
|
5831
|
+
if (!overwrite && existsNames.length) {
|
|
5832
|
+
const colorizedNames = existsNames.map((name$1) => c.yellow(name$1));
|
|
5833
|
+
const { overwrite: overwrite$1 } = await prompts({
|
|
5834
|
+
type: "confirm",
|
|
5835
|
+
name: "overwrite",
|
|
5836
|
+
initial: false,
|
|
5837
|
+
message: c.reset(`The ${colorizedNames.join(", ")} components already exist. Do you want to overwrite them?`)
|
|
5838
|
+
});
|
|
5839
|
+
if (!overwrite$1) process.exit(0);
|
|
5840
|
+
}
|
|
5841
|
+
omittedGeneratedNames.push(...generatedNames.filter((name$1) => !componentNames.includes(name$1)));
|
|
5842
|
+
}
|
|
5843
|
+
spinner.start("Fetching registries");
|
|
5844
|
+
const registries = await fetchRegistries(componentNames, config$1, {
|
|
5845
|
+
dependencies: !all,
|
|
5846
|
+
dependents: !all,
|
|
5847
|
+
omit: omittedGeneratedNames
|
|
5848
|
+
});
|
|
5849
|
+
const registryNames = Object.keys(registries);
|
|
5850
|
+
const dependencies$1 = [...new Set(Object.values(registries).map(({ dependencies: dependencies$2 }) => dependencies$2?.externals).filter((dependencies$2) => !isUndefined(dependencies$2)).flat())];
|
|
5851
|
+
const affectedNames = [...new Set(Object.values(registries).map(({ dependents }) => [
|
|
5852
|
+
...dependents?.components ?? [],
|
|
5853
|
+
...dependents?.hooks ?? [],
|
|
5854
|
+
...dependents?.providers ?? []
|
|
5855
|
+
]).flat().filter((dependent) => omittedGeneratedNames.includes(dependent)))];
|
|
5856
|
+
spinner.succeed("Fetched registries");
|
|
5857
|
+
const targetNames = [...new Set([...omittedGeneratedNames, ...registryNames])];
|
|
5858
|
+
const tasks = new Listr(Object.entries(registries).map(([name$1, registry]) => {
|
|
5859
|
+
if (registry.section === "root" || registry.section === "theme") return;
|
|
5860
|
+
const sectionPath = config$1.getSectionAbsolutePath(registry.section);
|
|
5861
|
+
const dirPath = path$1.join(sectionPath, name$1);
|
|
5862
|
+
return {
|
|
5863
|
+
task: async (_, task) => {
|
|
5864
|
+
await generateSources(dirPath, registry, config$1, targetNames);
|
|
5865
|
+
task.title = `Generated ${c.cyan(name$1)}`;
|
|
5866
|
+
},
|
|
5867
|
+
title: `Generating ${c.cyan(name$1)}`
|
|
5868
|
+
};
|
|
5869
|
+
}).filter((task) => !isUndefined(task)), { concurrent: true });
|
|
5870
|
+
if (existsSync(path$1.resolve(config$1.srcPath, "index.ts"))) tasks.add({
|
|
5871
|
+
task: async (_, task) => {
|
|
5872
|
+
const targetPath = path$1.resolve(config$1.srcPath, "index.ts");
|
|
5873
|
+
const data = replaceIndex(targetNames, await readFile(targetPath, "utf-8"), config$1);
|
|
5874
|
+
const content = await format$2(data);
|
|
5875
|
+
await writeFileSafe(targetPath, content);
|
|
5876
|
+
task.title = `Updated ${c.cyan("index.ts")}`;
|
|
5877
|
+
},
|
|
5878
|
+
title: `Updating ${c.cyan("index.ts")}`
|
|
5879
|
+
});
|
|
5880
|
+
else tasks.add({
|
|
5881
|
+
task: async (_, task) => {
|
|
5882
|
+
const { sources } = await fetchRegistry("index");
|
|
5883
|
+
const targetPath = path$1.resolve(config$1.srcPath, "index.ts");
|
|
5884
|
+
const data = replaceIndex(targetNames, sources[0].content, config$1);
|
|
5885
|
+
const content = await format$2(data);
|
|
5886
|
+
await writeFileSafe(targetPath, content);
|
|
5887
|
+
task.title = `Generated ${c.cyan("index.ts")}`;
|
|
5888
|
+
},
|
|
5889
|
+
title: `Generating ${c.cyan("index.ts")}`
|
|
5890
|
+
});
|
|
5891
|
+
if (affectedNames.length && generatedNameMap) {
|
|
5892
|
+
if (!overwrite) {
|
|
5893
|
+
const colorizedNames = affectedNames.map((name$1) => c.yellow(name$1));
|
|
5894
|
+
const { update } = await prompts({
|
|
5895
|
+
type: "confirm",
|
|
5896
|
+
name: "update",
|
|
5897
|
+
initial: true,
|
|
5898
|
+
message: c.reset(`The following generated files will be updated: ${colorizedNames.join(", ")}. Do you want to update them?`)
|
|
5899
|
+
});
|
|
5900
|
+
if (update) overwrite = update;
|
|
5901
|
+
}
|
|
5902
|
+
if (overwrite) Object.entries(generatedNameMap).forEach(([section, names]) => {
|
|
5903
|
+
names.forEach((name$1) => {
|
|
5904
|
+
if (!affectedNames.includes(name$1)) return;
|
|
5905
|
+
tasks.add({
|
|
5906
|
+
task: async (_, task) => {
|
|
5907
|
+
const sectionPath = config$1.getSectionAbsolutePath(section);
|
|
5908
|
+
const dirPath = path$1.join(sectionPath, name$1);
|
|
5909
|
+
const dirents = await readdir(dirPath, { withFileTypes: true });
|
|
5910
|
+
await Promise.all(dirents.map(async (dirent) => {
|
|
5911
|
+
if (dirent.isDirectory()) return;
|
|
5912
|
+
const targetPath = path$1.join(dirent.parentPath, dirent.name);
|
|
5913
|
+
const content = transformTemplate(section, await readFile(targetPath, "utf-8"), config$1, targetNames);
|
|
5914
|
+
await writeFileSafe(targetPath, await format$2(content));
|
|
5915
|
+
}));
|
|
5916
|
+
task.title = `Updated ${c.cyan(name$1)}`;
|
|
5917
|
+
},
|
|
5918
|
+
title: `Updating ${c.cyan(name$1)}`
|
|
5919
|
+
});
|
|
5920
|
+
});
|
|
5921
|
+
});
|
|
5922
|
+
}
|
|
5923
|
+
if (dependencies$1.length) {
|
|
5924
|
+
const targetPath = config$1.monorepo ? config$1.rootPath : cwd$2;
|
|
5925
|
+
spinner.start(`Checking ${c.cyan("package.json")} dependencies`);
|
|
5926
|
+
const packageJson$2 = await getPackageJson(targetPath);
|
|
5927
|
+
const notInstalledDependencies = getNotInstalledDependencies(packageJson$2, dependencies$1);
|
|
5928
|
+
spinner.succeed(`Checked ${c.cyan("package.json")} dependencies`);
|
|
5929
|
+
if (!install && notInstalledDependencies.length) {
|
|
5930
|
+
const colorizedNames = notInstalledDependencies.map((value) => c.yellow(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
|
|
5931
|
+
const { proceed } = await prompts({
|
|
5932
|
+
type: "confirm",
|
|
5933
|
+
name: "proceed",
|
|
5934
|
+
initial: true,
|
|
5935
|
+
message: c.reset(`The following dependencies are not installed: ${colorizedNames.join(", ")}. Do you want to install them?`)
|
|
5936
|
+
});
|
|
5937
|
+
install = proceed;
|
|
5938
|
+
}
|
|
5939
|
+
if (install) tasks.add({
|
|
5940
|
+
task: (_, task) => {
|
|
5941
|
+
installDependencies(notInstalledDependencies.map(getPackageName), { cwd: targetPath });
|
|
5942
|
+
task.title = "Installed dependencies";
|
|
5943
|
+
},
|
|
5944
|
+
title: "Installing dependencies"
|
|
5945
|
+
});
|
|
5946
|
+
}
|
|
5947
|
+
await tasks.run();
|
|
5948
|
+
end();
|
|
6774
5949
|
} catch (e) {
|
|
6775
5950
|
if (e instanceof Error) spinner.fail(e.message);
|
|
6776
5951
|
else spinner.fail("An unknown error occurred");
|
|
@@ -6779,233 +5954,68 @@ const add = new Command("add").description("Add a component to your project").op
|
|
|
6779
5954
|
|
|
6780
5955
|
//#endregion
|
|
6781
5956
|
//#region src/commands/diff/index.ts
|
|
6782
|
-
const diff = new Command("diff").description("Check for updates against the registry").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).action(function({ cwd: cwd$2 }) {
|
|
5957
|
+
const diff = new Command("diff").description("Check for updates against the registry").argument("[component]", "Component to check").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).action(async function(componentName, { config: configPath, cwd: cwd$2 }) {
|
|
6783
5958
|
const spinner = ora();
|
|
6784
5959
|
try {
|
|
6785
|
-
const
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
5960
|
+
const { end } = timer();
|
|
5961
|
+
spinner.start("Validating directory");
|
|
5962
|
+
await validateDir(cwd$2);
|
|
5963
|
+
spinner.succeed("Validated directory");
|
|
5964
|
+
spinner.start("Fetching config");
|
|
5965
|
+
const config$1 = await getConfig(cwd$2, configPath);
|
|
5966
|
+
console.log(config$1);
|
|
5967
|
+
spinner.succeed("Fetched config");
|
|
5968
|
+
end();
|
|
6790
5969
|
} catch (e) {
|
|
6791
5970
|
if (e instanceof Error) spinner.fail(e.message);
|
|
6792
5971
|
else spinner.fail("An unknown error occurred");
|
|
6793
5972
|
}
|
|
6794
5973
|
});
|
|
6795
5974
|
|
|
6796
|
-
//#endregion
|
|
6797
|
-
//#region src/utils/fs.ts
|
|
6798
|
-
async function writeFileSafe(path$9, content, options) {
|
|
6799
|
-
if (path$9.includes("/")) {
|
|
6800
|
-
const dirPath = path$9.split("/").slice(0, -1).join("/");
|
|
6801
|
-
if (!existsSync(dirPath)) await mkdir(dirPath, { recursive: true });
|
|
6802
|
-
}
|
|
6803
|
-
await writeFile(path$9, content, options);
|
|
6804
|
-
}
|
|
6805
|
-
|
|
6806
|
-
//#endregion
|
|
6807
|
-
//#region src/utils/module.ts
|
|
6808
|
-
async function getModule(file$1, cwd$2) {
|
|
6809
|
-
const result = await build({
|
|
6810
|
-
absWorkingDir: cwd$2,
|
|
6811
|
-
bundle: true,
|
|
6812
|
-
entryPoints: [file$1],
|
|
6813
|
-
format: "cjs",
|
|
6814
|
-
mainFields: ["module", "main"],
|
|
6815
|
-
metafile: true,
|
|
6816
|
-
outfile: "out.js",
|
|
6817
|
-
platform: "node",
|
|
6818
|
-
sourcemap: false,
|
|
6819
|
-
write: false
|
|
6820
|
-
});
|
|
6821
|
-
const { text: code } = result.outputFiles[0] ?? {};
|
|
6822
|
-
const dependencies$1 = isObject(result.metafile) ? Object.keys(result.metafile.inputs) : [];
|
|
6823
|
-
try {
|
|
6824
|
-
const realFileName = realpathSync.native(file$1);
|
|
6825
|
-
if (!code) throw new Error("code is undefined");
|
|
6826
|
-
const script = new Script(code, { filename: realFileName });
|
|
6827
|
-
const mod = { exports: {} };
|
|
6828
|
-
const require$1 = (id) => id === realFileName ? mod.exports : require$1(id);
|
|
6829
|
-
script.runInThisContext()(mod.exports, require$1, mod);
|
|
6830
|
-
return {
|
|
6831
|
-
code,
|
|
6832
|
-
dependencies: dependencies$1,
|
|
6833
|
-
mod
|
|
6834
|
-
};
|
|
6835
|
-
} catch {
|
|
6836
|
-
const mod = nodeEval(code);
|
|
6837
|
-
return {
|
|
6838
|
-
code,
|
|
6839
|
-
dependencies: dependencies$1,
|
|
6840
|
-
mod
|
|
6841
|
-
};
|
|
6842
|
-
}
|
|
6843
|
-
}
|
|
6844
|
-
|
|
6845
|
-
//#endregion
|
|
6846
|
-
//#region src/utils/prettier.ts
|
|
6847
|
-
async function format$2(content, options) {
|
|
6848
|
-
const path$9 = await resolveConfigFile();
|
|
6849
|
-
const config$1 = path$9 ? await resolveConfig(path$9) : {};
|
|
6850
|
-
try {
|
|
6851
|
-
return format$1(content, {
|
|
6852
|
-
...config$1,
|
|
6853
|
-
parser: "typescript",
|
|
6854
|
-
...options
|
|
6855
|
-
});
|
|
6856
|
-
} catch {
|
|
6857
|
-
return content;
|
|
6858
|
-
}
|
|
6859
|
-
}
|
|
6860
|
-
|
|
6861
|
-
//#endregion
|
|
6862
|
-
//#region src/utils/package.ts
|
|
6863
|
-
function getPackageManager() {
|
|
6864
|
-
const userAgent$1 = process.env.npm_config_user_agent || "";
|
|
6865
|
-
if (userAgent$1.startsWith("yarn")) return "yarn";
|
|
6866
|
-
if (userAgent$1.startsWith("pnpm")) return "pnpm";
|
|
6867
|
-
if (userAgent$1.startsWith("bun")) return "bun";
|
|
6868
|
-
return "npm";
|
|
6869
|
-
}
|
|
6870
|
-
async function getPackageJson(cwd$2) {
|
|
6871
|
-
try {
|
|
6872
|
-
const packageJson$2 = await readFile(path$1.resolve(cwd$2, "package.json"), "utf8");
|
|
6873
|
-
return JSON.parse(packageJson$2);
|
|
6874
|
-
} catch {
|
|
6875
|
-
throw new Error(`No package.json found. Please run ${c.cyan(`${getPackageManager()} init`)}.`);
|
|
6876
|
-
}
|
|
6877
|
-
}
|
|
6878
|
-
function hasDependencies({ dependencies: dependencies$1, devDependencies: devDependencies$1 }, name$1) {
|
|
6879
|
-
if (isObject(dependencies$1) && name$1 in dependencies$1) return dependencies$1[name$1];
|
|
6880
|
-
if (isObject(devDependencies$1) && name$1 in devDependencies$1) return devDependencies$1[name$1];
|
|
6881
|
-
}
|
|
6882
|
-
function requireDependencies(packageJson$2, dependencies$1) {
|
|
6883
|
-
return Object.fromEntries(dependencies$1.map((dependency) => [dependency, hasDependencies(packageJson$2, dependency)]));
|
|
6884
|
-
}
|
|
6885
|
-
function installDependencies(cwd$2, dependencies$1) {
|
|
6886
|
-
const packageManager = getPackageManager();
|
|
6887
|
-
switch (packageManager) {
|
|
6888
|
-
case "bun":
|
|
6889
|
-
if (dependencies$1?.length) execSync(`bun add ${dependencies$1.join(" ")}`, {
|
|
6890
|
-
cwd: cwd$2,
|
|
6891
|
-
stdio: "ignore"
|
|
6892
|
-
});
|
|
6893
|
-
else execSync(`bun install`, {
|
|
6894
|
-
cwd: cwd$2,
|
|
6895
|
-
stdio: "ignore"
|
|
6896
|
-
});
|
|
6897
|
-
break;
|
|
6898
|
-
case "pnpm":
|
|
6899
|
-
if (dependencies$1?.length) execSync(`pnpm add ${dependencies$1.join(" ")}`, {
|
|
6900
|
-
cwd: cwd$2,
|
|
6901
|
-
stdio: "ignore"
|
|
6902
|
-
});
|
|
6903
|
-
else execSync(`pnpm install`, {
|
|
6904
|
-
cwd: cwd$2,
|
|
6905
|
-
stdio: "ignore"
|
|
6906
|
-
});
|
|
6907
|
-
break;
|
|
6908
|
-
case "yarn":
|
|
6909
|
-
if (dependencies$1?.length) execSync(`yarn add ${dependencies$1.join(" ")}`, {
|
|
6910
|
-
cwd: cwd$2,
|
|
6911
|
-
stdio: "ignore"
|
|
6912
|
-
});
|
|
6913
|
-
else execSync(`yarn install`, {
|
|
6914
|
-
cwd: cwd$2,
|
|
6915
|
-
stdio: "ignore"
|
|
6916
|
-
});
|
|
6917
|
-
break;
|
|
6918
|
-
default:
|
|
6919
|
-
if (dependencies$1?.length) execSync(`npm install ${dependencies$1.join(" ")}`, {
|
|
6920
|
-
cwd: cwd$2,
|
|
6921
|
-
stdio: "ignore"
|
|
6922
|
-
});
|
|
6923
|
-
else execSync(`npm install`, {
|
|
6924
|
-
cwd: cwd$2,
|
|
6925
|
-
stdio: "ignore"
|
|
6926
|
-
});
|
|
6927
|
-
break;
|
|
6928
|
-
}
|
|
6929
|
-
}
|
|
6930
|
-
async function addWorkspace(cwd$2, workspacePath) {
|
|
6931
|
-
const packageManager = getPackageManager();
|
|
6932
|
-
switch (packageManager) {
|
|
6933
|
-
case "pnpm":
|
|
6934
|
-
if (existsSync(path$1.resolve(cwd$2, "pnpm-workspace.yaml"))) {
|
|
6935
|
-
const content = await readFile(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), "utf8");
|
|
6936
|
-
const json$1 = YAML.parse(content);
|
|
6937
|
-
json$1.packages ??= [];
|
|
6938
|
-
if (!json$1.packages.includes(workspacePath)) {
|
|
6939
|
-
json$1.packages.push(workspacePath);
|
|
6940
|
-
const content$1 = await format$2(YAML.stringify(json$1), { parser: "yaml" });
|
|
6941
|
-
await writeFileSafe(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), content$1);
|
|
6942
|
-
}
|
|
6943
|
-
} else {
|
|
6944
|
-
const data = YAML.stringify({ packages: [workspacePath] });
|
|
6945
|
-
const content = await format$2(data, { parser: "yaml" });
|
|
6946
|
-
await writeFileSafe(path$1.resolve(cwd$2, "pnpm-workspace.yaml"), content);
|
|
6947
|
-
}
|
|
6948
|
-
break;
|
|
6949
|
-
default: {
|
|
6950
|
-
const packageJson$2 = await getPackageJson(cwd$2);
|
|
6951
|
-
packageJson$2.workspaces ??= [];
|
|
6952
|
-
if (!packageJson$2.workspaces.includes(workspacePath)) {
|
|
6953
|
-
packageJson$2.workspaces.push(workspacePath);
|
|
6954
|
-
const content = await format$2(JSON.stringify(packageJson$2), { parser: "json" });
|
|
6955
|
-
await writeFileSafe(path$1.resolve(cwd$2, "package.json"), content);
|
|
6956
|
-
}
|
|
6957
|
-
break;
|
|
6958
|
-
}
|
|
6959
|
-
}
|
|
6960
|
-
}
|
|
6961
|
-
|
|
6962
5975
|
//#endregion
|
|
6963
5976
|
//#region src/commands/init/index.ts
|
|
6964
|
-
const init = new Command("init").description("Initialize your project and install dependencies").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).action(async function({ config: configPath, cwd: cwd$2 }) {
|
|
5977
|
+
const init = new Command("init").description("Initialize your project and install dependencies").option("--cwd <path>", "Current working directory", process.cwd()).option("-c, --config <path>", "Path to the config file", CONFIG_FILE_NAME).option("-o, --overwrite", "Overwrite existing files.", false).action(async function({ config: configPath, cwd: cwd$2, overwrite }) {
|
|
6965
5978
|
const spinner = ora();
|
|
6966
5979
|
try {
|
|
6967
|
-
const
|
|
5980
|
+
const { end } = timer();
|
|
5981
|
+
await validateDir(cwd$2);
|
|
6968
5982
|
const configFileName = configPath.includes("/") ? configPath.split("/").at(-1) : configPath;
|
|
6969
|
-
const config$1 = {
|
|
6970
|
-
components: {
|
|
6971
|
-
ignore: [],
|
|
6972
|
-
path: "./components"
|
|
6973
|
-
},
|
|
6974
|
-
hooks: {
|
|
6975
|
-
ignore: [],
|
|
6976
|
-
path: "./hooks"
|
|
6977
|
-
},
|
|
6978
|
-
providers: {
|
|
6979
|
-
ignore: [],
|
|
6980
|
-
path: "./providers"
|
|
6981
|
-
}
|
|
6982
|
-
};
|
|
5983
|
+
const config$1 = { ...DEFAULT_SECTION_CONFIG };
|
|
6983
5984
|
configPath = path$1.resolve(cwd$2, configPath);
|
|
6984
5985
|
let dependencies$1;
|
|
6985
|
-
let
|
|
5986
|
+
let devDependencies$1;
|
|
5987
|
+
let { src = true, monorepo = true, outdir = "", packageName = "" } = await prompts([
|
|
6986
5988
|
{
|
|
6987
5989
|
type: "toggle",
|
|
6988
5990
|
name: "monorepo",
|
|
6989
5991
|
active: "Yes",
|
|
6990
5992
|
inactive: "No",
|
|
6991
5993
|
initial: true,
|
|
6992
|
-
message: `Would you like to use monorepo? (recommended)`
|
|
5994
|
+
message: c.reset(`Would you like to use monorepo? (recommended)`)
|
|
6993
5995
|
},
|
|
6994
5996
|
{
|
|
6995
5997
|
type: "text",
|
|
6996
5998
|
name: "outdir",
|
|
6997
|
-
initial: (_, { monorepo: monorepo$1 }) => monorepo$1 ?
|
|
6998
|
-
message: (_, { monorepo: monorepo$1 }) => monorepo$1 ? `What is the path to the monorepo?` : `What is the path to the directory?`
|
|
5999
|
+
initial: (_, { monorepo: monorepo$1 }) => monorepo$1 ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo,
|
|
6000
|
+
message: (_, { monorepo: monorepo$1 }) => monorepo$1 ? c.reset(`What is the path to the monorepo?`) : c.reset(`What is the path to the directory?`)
|
|
6999
6001
|
},
|
|
7000
6002
|
{
|
|
7001
6003
|
type: (_, { monorepo: monorepo$1 }) => monorepo$1 ? "text" : null,
|
|
7002
6004
|
name: "packageName",
|
|
7003
6005
|
initial: DEFAULT_PACKAGE_NAME,
|
|
7004
|
-
message: "What is the package name?"
|
|
6006
|
+
message: c.reset("What is the package name?")
|
|
6007
|
+
},
|
|
6008
|
+
{
|
|
6009
|
+
type: (_, { monorepo: monorepo$1 }) => monorepo$1 ? "toggle" : null,
|
|
6010
|
+
name: "src",
|
|
6011
|
+
active: "Yes",
|
|
6012
|
+
inactive: "No",
|
|
6013
|
+
initial: true,
|
|
6014
|
+
message: c.reset("Would you like your code inside a `src/` directory?")
|
|
7005
6015
|
}
|
|
7006
6016
|
]);
|
|
7007
6017
|
outdir = outdir.replace(/\x17/g, "").trim();
|
|
7008
|
-
outdir ||= monorepo ?
|
|
6018
|
+
outdir ||= monorepo ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo;
|
|
7009
6019
|
packageName = packageName.replace(/\x17/g, "").trim();
|
|
7010
6020
|
packageName ||= DEFAULT_PACKAGE_NAME;
|
|
7011
6021
|
config$1.monorepo = monorepo;
|
|
@@ -7014,99 +6024,145 @@ const init = new Command("init").description("Initialize your project and instal
|
|
|
7014
6024
|
type: "confirm",
|
|
7015
6025
|
name: "generate",
|
|
7016
6026
|
initial: true,
|
|
7017
|
-
message: `Generate ${c.cyan(configFileName)}. Proceed?`
|
|
6027
|
+
message: c.reset(`Generate ${c.cyan(configFileName)}. Proceed?`)
|
|
7018
6028
|
});
|
|
7019
6029
|
if (!generate) process.exit(0);
|
|
7020
|
-
if (existsSync(configPath)) {
|
|
7021
|
-
const { overwrite } = await prompts({
|
|
6030
|
+
if (!overwrite && existsSync(configPath)) {
|
|
6031
|
+
const { overwrite: overwrite$1 } = await prompts({
|
|
7022
6032
|
type: "confirm",
|
|
7023
6033
|
name: "overwrite",
|
|
7024
6034
|
initial: false,
|
|
7025
|
-
message: `The config file already exists. Do you want to overwrite it?`
|
|
6035
|
+
message: c.reset(`The config file already exists. Do you want to overwrite it?`)
|
|
7026
6036
|
});
|
|
7027
|
-
if (!overwrite) process.exit(0);
|
|
6037
|
+
if (!overwrite$1) process.exit(0);
|
|
7028
6038
|
}
|
|
7029
6039
|
spinner.start(`Generating ${c.cyan(configFileName)}`);
|
|
7030
6040
|
await writeFileSafe(configPath, await format$2(JSON.stringify(config$1), { parser: "json" }));
|
|
7031
6041
|
spinner.succeed(`Generated ${c.cyan(configFileName)}`);
|
|
6042
|
+
const outdirPath = path$1.resolve(cwd$2, outdir);
|
|
6043
|
+
if (!overwrite && existsSync(outdirPath)) {
|
|
6044
|
+
const { overwrite: overwrite$1 } = await prompts({
|
|
6045
|
+
type: "confirm",
|
|
6046
|
+
name: "overwrite",
|
|
6047
|
+
initial: false,
|
|
6048
|
+
message: c.reset(`The ${c.yellow(outdir)} directory already exists. Do you want to overwrite it?`)
|
|
6049
|
+
});
|
|
6050
|
+
if (!overwrite$1) process.exit(0);
|
|
6051
|
+
spinner.start("Clearing directory");
|
|
6052
|
+
await rimraf(outdirPath);
|
|
6053
|
+
spinner.succeed("Cleared directory");
|
|
6054
|
+
}
|
|
7032
6055
|
if (monorepo) {
|
|
7033
|
-
const outdirPath = path$1.resolve(cwd$2, outdir);
|
|
7034
|
-
if (existsSync(outdirPath)) throw new Error(`${outdir} already exists`);
|
|
7035
|
-
const packageJson$2 = {
|
|
7036
|
-
name: packageName,
|
|
7037
|
-
...DEFAULT_PACKAGE_JSON
|
|
7038
|
-
};
|
|
7039
|
-
const tsconfigJson = { ...TSCONFIG_JSON };
|
|
7040
|
-
spinner.start("Fetching data");
|
|
7041
|
-
const data = await fetch(path$1.join(REGISTRY_URL, "index.json"));
|
|
7042
|
-
const { sources } = await data.json();
|
|
7043
|
-
spinner.succeed("Fetched data");
|
|
7044
6056
|
const { generate: generate$1 } = await prompts({
|
|
7045
6057
|
type: "confirm",
|
|
7046
6058
|
name: "generate",
|
|
7047
6059
|
initial: true,
|
|
7048
|
-
message: `Generate ${c.cyan(packageName)}. Proceed?`
|
|
6060
|
+
message: c.reset(`Generate ${c.cyan(packageName)}. Proceed?`)
|
|
7049
6061
|
});
|
|
7050
6062
|
if (!generate$1) process.exit(0);
|
|
7051
|
-
|
|
7052
|
-
|
|
6063
|
+
const tasks = new Listr([
|
|
6064
|
+
{
|
|
6065
|
+
task: async (_, task) => {
|
|
6066
|
+
const targetPath = path$1.resolve(outdirPath, "package.json");
|
|
6067
|
+
const data = JSON.stringify({
|
|
6068
|
+
name: packageName,
|
|
6069
|
+
...DEFAULT_PACKAGE_JSON
|
|
6070
|
+
});
|
|
6071
|
+
const content = await format$2(data, { parser: "json" });
|
|
6072
|
+
await writeFileSafe(targetPath, content);
|
|
6073
|
+
task.title = `Generated ${c.cyan("package.json")}`;
|
|
6074
|
+
},
|
|
6075
|
+
title: `Generating ${c.cyan("package.json")}`
|
|
6076
|
+
},
|
|
7053
6077
|
{
|
|
7054
|
-
|
|
7055
|
-
|
|
6078
|
+
task: async (_, task) => {
|
|
6079
|
+
const targetPath = path$1.resolve(outdirPath, "tsconfig.json");
|
|
6080
|
+
const data = JSON.stringify({ ...TSCONFIG_JSON });
|
|
6081
|
+
const content = await format$2(data, { parser: "json" });
|
|
6082
|
+
await writeFileSafe(targetPath, content);
|
|
6083
|
+
task.title = `Generated ${c.cyan("tsconfig.json")}`;
|
|
6084
|
+
},
|
|
6085
|
+
title: `Generating ${c.cyan("tsconfig.json")}`
|
|
7056
6086
|
},
|
|
7057
6087
|
{
|
|
7058
|
-
|
|
7059
|
-
|
|
6088
|
+
task: async (_, task) => {
|
|
6089
|
+
const targetPath = path$1.resolve(outdirPath, src ? "src" : "", "index.ts");
|
|
6090
|
+
const { sources } = await fetchRegistry("index");
|
|
6091
|
+
const content = await format$2(sources[0].content);
|
|
6092
|
+
await writeFileSafe(targetPath, content);
|
|
6093
|
+
task.title = `Generated ${c.cyan("index.ts")}`;
|
|
6094
|
+
},
|
|
6095
|
+
title: `Generating ${c.cyan("index.ts")}`
|
|
7060
6096
|
},
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
6097
|
+
{
|
|
6098
|
+
task: async (_, task) => {
|
|
6099
|
+
if (outdir.includes("/")) {
|
|
6100
|
+
const path$9 = `${outdir.replace(/^\.\//, "").split("/")[0]}/**`;
|
|
6101
|
+
await addWorkspace(cwd$2, path$9);
|
|
6102
|
+
} else await addWorkspace(cwd$2, outdir);
|
|
6103
|
+
task.title = "Added workspace";
|
|
6104
|
+
},
|
|
6105
|
+
title: "Adding workspace"
|
|
6106
|
+
}
|
|
6107
|
+
], { concurrent: true });
|
|
6108
|
+
await tasks.run();
|
|
7073
6109
|
const { install } = await prompts({
|
|
7074
6110
|
type: "confirm",
|
|
7075
6111
|
name: "install",
|
|
7076
6112
|
initial: true,
|
|
7077
|
-
message: `The workspace is generated. Do you want to install dependencies?`
|
|
6113
|
+
message: c.reset(`The workspace is generated. Do you want to install dependencies?`)
|
|
7078
6114
|
});
|
|
7079
6115
|
if (install) dependencies$1 = [];
|
|
7080
6116
|
} else {
|
|
7081
|
-
|
|
7082
|
-
const
|
|
7083
|
-
const
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
6117
|
+
const notInstalledDependencies = [];
|
|
6118
|
+
const notInstalledDevDependencies = [];
|
|
6119
|
+
const tasks = new Listr([{
|
|
6120
|
+
task: async (_, task) => {
|
|
6121
|
+
const packageJson$2 = await getPackageJson(cwd$2);
|
|
6122
|
+
notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, [...REQUIRED_DEPENDENCIES, "@yamada-ui/react@dev"]));
|
|
6123
|
+
notInstalledDevDependencies.push(...getNotInstalledDependencies(packageJson$2, REQUIRED_DEV_DEPENDENCIES));
|
|
6124
|
+
task.title = `Checked ${c.cyan("package.json")} dependencies`;
|
|
6125
|
+
},
|
|
6126
|
+
title: `Checking ${c.cyan("package.json")} dependencies`
|
|
6127
|
+
}, {
|
|
6128
|
+
task: async (_, task) => {
|
|
6129
|
+
const { sources } = await fetchRegistry("index");
|
|
6130
|
+
const targetPath = path$1.resolve(outdirPath, "index.ts");
|
|
6131
|
+
const content = await format$2(sources[0].content);
|
|
6132
|
+
await writeFileSafe(targetPath, content);
|
|
6133
|
+
task.title = `Generated ${c.cyan("index.ts")}`;
|
|
6134
|
+
},
|
|
6135
|
+
title: `Generating ${c.cyan("index.ts")}`
|
|
6136
|
+
}], { concurrent: true });
|
|
6137
|
+
await tasks.run();
|
|
6138
|
+
if (notInstalledDependencies.length || notInstalledDevDependencies.length) {
|
|
6139
|
+
const colorizedNames = [...notInstalledDependencies, ...notInstalledDevDependencies].map((value) => c.cyan(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
|
|
7092
6140
|
const { install } = await prompts({
|
|
7093
6141
|
type: "confirm",
|
|
7094
6142
|
name: "install",
|
|
7095
6143
|
initial: true,
|
|
7096
|
-
message: `The following dependencies are not installed: ${
|
|
6144
|
+
message: c.reset(`The following dependencies are not installed: ${colorizedNames.join(", ")}. Do you want to install them?`)
|
|
7097
6145
|
});
|
|
7098
|
-
if (install)
|
|
6146
|
+
if (install) {
|
|
6147
|
+
dependencies$1 = notInstalledDependencies.map(getPackageName);
|
|
6148
|
+
devDependencies$1 = notInstalledDevDependencies.map(getPackageName);
|
|
6149
|
+
}
|
|
7099
6150
|
}
|
|
7100
6151
|
}
|
|
7101
|
-
if (dependencies$1) {
|
|
6152
|
+
if (dependencies$1 || devDependencies$1) {
|
|
7102
6153
|
spinner.start("Installing dependencies");
|
|
7103
|
-
installDependencies(cwd$2
|
|
6154
|
+
if (dependencies$1) installDependencies(dependencies$1, { cwd: cwd$2 });
|
|
6155
|
+
if (devDependencies$1) installDependencies(devDependencies$1, {
|
|
6156
|
+
cwd: cwd$2,
|
|
6157
|
+
dev: true
|
|
6158
|
+
});
|
|
6159
|
+
if (monorepo) installDependencies(["@yamada-ui/react@dev"], { cwd: outdirPath });
|
|
7104
6160
|
spinner.succeed("Installed dependencies");
|
|
7105
6161
|
}
|
|
7106
|
-
if (
|
|
6162
|
+
if (monorepo) {
|
|
7107
6163
|
const packageManager = getPackageManager();
|
|
7108
|
-
const command = packageManager
|
|
7109
|
-
console.log(boxen(`Run ${c.cyan(`${
|
|
6164
|
+
const command = packageAddCommand(packageManager);
|
|
6165
|
+
console.log(boxen(`Run ${c.cyan(`${command} "${packageName}@workspace:*"`)} in your application.`, {
|
|
7110
6166
|
borderColor: "yellow",
|
|
7111
6167
|
borderStyle: "round",
|
|
7112
6168
|
margin: 1,
|
|
@@ -7114,9 +6170,7 @@ const init = new Command("init").description("Initialize your project and instal
|
|
|
7114
6170
|
textAlignment: "center"
|
|
7115
6171
|
}));
|
|
7116
6172
|
}
|
|
7117
|
-
|
|
7118
|
-
const duration = (Number(end - start) / 1e9).toFixed(2);
|
|
7119
|
-
console.log("\n", c.green(`Done in ${duration}s`));
|
|
6173
|
+
end();
|
|
7120
6174
|
} catch (e) {
|
|
7121
6175
|
if (e instanceof Error) spinner.fail(e.message);
|
|
7122
6176
|
else spinner.fail("An unknown error occurred");
|
|
@@ -7315,32 +6369,35 @@ async function getTheme(path$9, cwd$2) {
|
|
|
7315
6369
|
}
|
|
7316
6370
|
const tokens = new Command("tokens").description("Generate theme typings").argument("<path>", "Path to the theme file").option("--cwd <path>", "Current working directory", process.cwd()).option("-o, --out <path>", `Output path`).option("-l, --lint", "Lint the output file", false).option("--internal", "Generate internal tokens", false).action(async function(inputPath, { cwd: cwd$2, internal, lint, out: outPath }) {
|
|
7317
6371
|
const spinner = ora();
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
6372
|
+
try {
|
|
6373
|
+
const eslint = new ESLint({ fix: true });
|
|
6374
|
+
const { end } = timer();
|
|
6375
|
+
spinner.start(`Getting theme`);
|
|
6376
|
+
cwd$2 = path$1.resolve(cwd$2);
|
|
6377
|
+
inputPath = path$1.resolve(cwd$2, inputPath);
|
|
6378
|
+
if (outPath) outPath = path$1.resolve(cwd$2, outPath);
|
|
6379
|
+
else if (inputPath.includes("/")) {
|
|
6380
|
+
const dirPath = inputPath.split("/").slice(0, -1).join("/");
|
|
6381
|
+
outPath = path$1.join(dirPath, "index.types.ts");
|
|
6382
|
+
} else outPath = path$1.join(cwd$2, "index.types.ts");
|
|
6383
|
+
const { config: config$1, theme } = await getTheme(inputPath, cwd$2);
|
|
6384
|
+
spinner.succeed(`Got theme`);
|
|
6385
|
+
spinner.start(`Generating theme typings`);
|
|
6386
|
+
let content = await generateThemeTokens(theme, {
|
|
6387
|
+
...config$1,
|
|
6388
|
+
internal
|
|
6389
|
+
});
|
|
6390
|
+
if (lint) {
|
|
6391
|
+
const [result] = await eslint.lintText(content, { filePath: inputPath });
|
|
6392
|
+
if (result?.output) content = result.output;
|
|
6393
|
+
}
|
|
6394
|
+
await writeFile(outPath, content, "utf8");
|
|
6395
|
+
spinner.succeed(`Generated theme typings`);
|
|
6396
|
+
end();
|
|
6397
|
+
} catch (e) {
|
|
6398
|
+
if (e instanceof Error) spinner.fail(e.message);
|
|
6399
|
+
else spinner.fail("An unknown error occurred");
|
|
6400
|
+
}
|
|
7344
6401
|
});
|
|
7345
6402
|
|
|
7346
6403
|
//#endregion
|