@yamada-ui/cli 2.0.0-dev-20250815213232 → 2.0.0-dev-20250816063232

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.
Files changed (2) hide show
  1. package/dist/index.js +983 -1923
  2. 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$2 = __require("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$5;
83
- function patch$5(fs$9) {
84
- if (constants$2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$9);
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$2.O_WRONLY | constants$2.O_SYMLINK, mode, function(err, fd) {
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$2.O_WRONLY | constants$2.O_SYMLINK, mode);
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$2.hasOwnProperty("O_SYMLINK") && fs$10.futimes) {
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$2.O_SYMLINK, function(er, fd) {
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$2.O_SYMLINK);
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$6 = noop$1;
448
- if (util$2.debuglog) debug$6 = util$2.debuglog("gfs4");
449
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug$6 = function() {
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$6(fs$8[gracefulQueue$1]);
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$4(clone$2(fs$8));
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$4(fs$8);
490
+ module.exports = patch$2(fs$8);
484
491
  fs$8.__patched = true;
485
492
  }
486
- function patch$4(fs$9) {
493
+ function patch$2(fs$9) {
487
494
  polyfills$1(fs$9);
488
- fs$9.gracefulify = patch$4;
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$1, dest, flags, cb) {
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$1, dest, flags, cb);
567
- function go$copyFile(src$2, dest$1, flags$1, cb$1, startTime) {
568
- return fs$copyFile(src$2, dest$1, flags$1, function(err) {
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$2,
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$6("ENQUEUE", elem[0].name, elem[1]);
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$6("RETRY", fn.name, args);
769
+ debug$1("RETRY", fn.name, args);
763
770
  fn.apply(null, args);
764
771
  } else if (Date.now() - startTime >= 6e4) {
765
- debug$6("TIMEOUT", fn.name, args);
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$6("RETRY", fn.name, args);
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$5 = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
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$5);
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$6 = exports.parse = function(content) {
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$6(content) : null;
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$1;
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$1 = safeGetProperty(target, key);
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$1 !== "object" || src$1 === null || Array.isArray(src$1)) {
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$1, val);
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$9) {
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$9 = parse$9 || cc.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$9(fileConfig));
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$1 = __require("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$3;
3282
- function patch$3(fs$9) {
3283
- if (constants$1.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$9);
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$1.O_WRONLY | constants$1.O_SYMLINK, mode, function(err, fd) {
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$1.O_WRONLY | constants$1.O_SYMLINK, mode);
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$1.hasOwnProperty("O_SYMLINK") && fs$10.futimes) {
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$1.O_SYMLINK, function(er, fd) {
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$1.O_SYMLINK);
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$2 = noop;
3647
- if (util$1.debuglog) debug$2 = util$1.debuglog("gfs4");
3648
- else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) debug$2 = function() {
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$2(fs$5[gracefulQueue]);
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$2(clone(fs$5));
3302
+ module.exports = patch(clone(fs$5));
3681
3303
  if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$5.__patched) {
3682
- module.exports = patch$2(fs$5);
3304
+ module.exports = patch(fs$5);
3683
3305
  fs$5.__patched = true;
3684
3306
  }
3685
- function patch$2(fs$9) {
3307
+ function patch(fs$9) {
3686
3308
  polyfills(fs$9);
3687
- fs$9.gracefulify = patch$2;
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$1, dest, flags, cb) {
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$1, dest, flags, cb);
3766
- function go$copyFile(src$2, dest$1, flags$1, cb$1, startTime) {
3767
- return fs$copyFile(src$2, dest$1, flags$1, function(err) {
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$2,
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$2("ENQUEUE", elem[0].name, elem[1]);
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$2("RETRY", fn.name, args);
3583
+ debug("RETRY", fn.name, args);
3962
3584
  fn.apply(null, args);
3963
3585
  } else if (Date.now() - startTime >= 6e4) {
3964
- debug$2("TIMEOUT", fn.name, args);
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$2("RETRY", fn.name, args);
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$5 = exports$1.parse = function(content, file$1, type$1) {
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$5(content, file$1, "json");
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$1 = path$3.resolve(cacheRoot, cacheExtra);
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: cache$1,
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/semver@7.7.2/node_modules/semver/functions/valid.js
5098
- var require_valid$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js": ((exports, module) => {
5099
- const parse$4 = require_parse();
5100
- const valid$1 = (version$1, options) => {
5101
- const v = parse$4(version$1, options);
5102
- return v ? v.version : null;
5103
- };
5104
- module.exports = valid$1;
5105
- }) });
5106
-
5107
- //#endregion
5108
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
5109
- var require_clean = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js": ((exports, module) => {
5110
- const parse$3 = require_parse();
5111
- const clean$1 = (version$1, options) => {
5112
- const s = parse$3(version$1.trim().replace(/^[=v]+/, ""), options);
5113
- return s ? s.version : null;
5114
- };
5115
- module.exports = clean$1;
5116
- }) });
5117
-
5118
- //#endregion
5119
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js
5120
- var require_inc = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js": ((exports, module) => {
5121
- const SemVer$12 = require_semver$1();
5122
- const inc$1 = (version$1, release, options, identifier, identifierBase) => {
5123
- if (typeof options === "string") {
5124
- identifierBase = identifier;
5125
- identifier = options;
5126
- options = void 0;
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
- try {
5129
- return new SemVer$12(version$1 instanceof SemVer$12 ? version$1.version : version$1, options).inc(release, identifier, identifierBase).version;
5130
- } catch (er) {
5131
- return null;
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
- module.exports = inc$1;
5135
- }) });
5136
-
5137
- //#endregion
5138
- //#region ../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js
5139
- var require_major = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js": ((exports, module) => {
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/semver@7.7.2/node_modules/semver/functions/gte.js
5242
- var require_gte = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js": ((exports, module) => {
5243
- const compare$4 = require_compare();
5244
- const gte$3 = (a, b, loose) => compare$4(a, b, loose) >= 0;
5245
- module.exports = gte$3;
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/semver@7.7.2/node_modules/semver/functions/lte.js
5250
- var require_lte = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js": ((exports, module) => {
5251
- const compare$3 = require_compare();
5252
- const lte$3 = (a, b, loose) => compare$3(a, b, loose) <= 0;
5253
- module.exports = lte$3;
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/semver@7.7.2/node_modules/semver/functions/cmp.js
5258
- var require_cmp = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js": ((exports, module) => {
5259
- const eq$1 = require_eq();
5260
- const neq$1 = require_neq();
5261
- const gt$3 = require_gt();
5262
- const gte$2 = require_gte();
5263
- const lt$2 = require_lt();
5264
- const lte$2 = require_lte();
5265
- const cmp$2 = (a, op, b, loose) => {
5266
- switch (op) {
5267
- case "===":
5268
- if (typeof a === "object") a = a.version;
5269
- if (typeof b === "object") b = b.version;
5270
- return a === b;
5271
- case "!==":
5272
- if (typeof a === "object") a = a.version;
5273
- if (typeof b === "object") b = b.version;
5274
- return a !== b;
5275
- case "":
5276
- case "=":
5277
- case "==": return eq$1(a, b, loose);
5278
- case "!=": return neq$1(a, b, loose);
5279
- case ">": return gt$3(a, b, loose);
5280
- case ">=": return gte$2(a, b, loose);
5281
- case "<": return lt$2(a, b, loose);
5282
- case "<=": return lte$2(a, b, loose);
5283
- default: throw new TypeError(`Invalid operator: ${op}`);
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$5 = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
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$5);
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: (0, import_diff.default)(this.#packageVersion, latest) ?? distTag,
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 || !(0, import_gt.default)(this.update.latest, this.update.current)) return this;
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,202 @@ 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
+
6700
5448
  //#endregion
6701
5449
  //#region src/constant.ts
6702
5450
  const CONFIG_FILE_NAME = "ui.json";
6703
5451
  const DEFAULT_PACKAGE_NAME = "@workspaces/ui";
6704
5452
  const REGISTRY_URL = "https://v2.yamada-ui.com/registry/v2";
6705
- const PATH = {
6706
- COMPONENTS: "./components",
6707
- HOOKS: "./hooks",
6708
- MONOREPO: "./workspaces/ui",
6709
- POLYREPO: "./ui",
6710
- PROVIDERS: "./providers"
5453
+ const DEFAULT_PATH = {
5454
+ components: "./components",
5455
+ hooks: "./hooks",
5456
+ monorepo: "./workspaces/ui",
5457
+ polyrepo: "./ui",
5458
+ providers: "./providers"
6711
5459
  };
5460
+ const SECTION_NAMES = [
5461
+ "components",
5462
+ "hooks",
5463
+ "providers"
5464
+ ];
5465
+ const DEFAULT_SECTION_CONFIG = {
5466
+ components: { overwrite: true },
5467
+ hooks: { overwrite: true },
5468
+ providers: { overwrite: true }
5469
+ };
5470
+ const REQUIRED_DEPENDENCIES = [
5471
+ "react@^19",
5472
+ "react-dom@^19",
5473
+ "@yamada-ui/react@^2"
5474
+ ];
5475
+ const REQUIRED_DEV_DEPENDENCIES = ["@types/react@^19", "@types/react-dom@^19"];
6712
5476
  const DEFAULT_PACKAGE_JSON = {
6713
5477
  version: "1.0.0",
6714
5478
  type: "module",
@@ -6720,15 +5484,8 @@ const DEFAULT_PACKAGE_JSON = {
6720
5484
  "./hooks/*": "./src/hooks/*/index.ts",
6721
5485
  "./providers/*": "./src/providers/*/index.ts"
6722
5486
  },
6723
- dependencies: {
6724
- react: ">=19",
6725
- "react-dom": ">=19",
6726
- "@yamada-ui/react": ">=2"
6727
- },
6728
- devDependencies: {
6729
- "@types/react": ">=19",
6730
- "@types/react-dom": ">=19"
6731
- }
5487
+ dependencies: Object.fromEntries(REQUIRED_DEPENDENCIES.map((dependency) => splitVersion(dependency))),
5488
+ devDependencies: Object.fromEntries(REQUIRED_DEV_DEPENDENCIES.map((dependency) => splitVersion(dependency)))
6732
5489
  };
6733
5490
  const TSCONFIG_JSON = {
6734
5491
  compilerOptions: {
@@ -6762,45 +5519,65 @@ const TSCONFIG_JSON = {
6762
5519
  };
6763
5520
 
6764
5521
  //#endregion
6765
- //#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 }) {
6767
- const spinner = ora();
6768
- try {
6769
- const start = process.hrtime.bigint();
6770
- console.log(cwd$2);
6771
- const end = process.hrtime.bigint();
6772
- const duration = (Number(end - start) / 1e9).toFixed(2);
6773
- console.log("\n", c.green(`Done in ${duration}s`));
6774
- } catch (e) {
6775
- if (e instanceof Error) spinner.fail(e.message);
6776
- else spinner.fail("An unknown error occurred");
6777
- }
6778
- });
6779
-
6780
- //#endregion
6781
- //#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 }) {
6783
- const spinner = ora();
5522
+ //#region src/utils/config.ts
5523
+ async function getConfig(cwd$2, configPath) {
6784
5524
  try {
6785
- const start = process.hrtime.bigint();
6786
- console.log(cwd$2);
6787
- const end = process.hrtime.bigint();
6788
- const duration = (Number(end - start) / 1e9).toFixed(2);
6789
- console.log("\n", c.green(`Done in ${duration}s`));
6790
- } catch (e) {
6791
- if (e instanceof Error) spinner.fail(e.message);
6792
- else spinner.fail("An unknown error occurred");
6793
- }
6794
- });
6795
-
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 });
5525
+ const data = await readFile(path$1.resolve(cwd$2, configPath), "utf8");
5526
+ const userConfig = JSON.parse(data);
5527
+ const rootPath = path$1.resolve(cwd$2, userConfig.path ?? (userConfig.monorepo ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo));
5528
+ const src = existsSync(path$1.resolve(rootPath, "src"));
5529
+ const srcPath = src ? path$1.resolve(rootPath, "src") : rootPath;
5530
+ const sectionMap = Object.fromEntries(SECTION_NAMES.map((section) => {
5531
+ const path$9 = userConfig[section]?.path ?? DEFAULT_PATH[section];
5532
+ const replacedSection = path$9.replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
5533
+ return [section, replacedSection];
5534
+ }));
5535
+ function getSectionAbsolutePath(section) {
5536
+ return path$1.resolve(srcPath, userConfig[section]?.path ?? DEFAULT_PATH[section]);
5537
+ }
5538
+ function getSectionPath(section) {
5539
+ let path$9 = userConfig[section]?.path ?? DEFAULT_PATH[section];
5540
+ if (path$9.startsWith("/")) path$9 = `./${path$9}`;
5541
+ if (!path$9.startsWith("./")) path$9 = `./${path$9}`;
5542
+ return path$9;
5543
+ }
5544
+ function getSection(value) {
5545
+ if (!value) return;
5546
+ if (SECTION_NAMES.includes(value)) {
5547
+ const section = value;
5548
+ return {
5549
+ ...userConfig[section],
5550
+ absolutePath: getSectionAbsolutePath(section),
5551
+ path: getSectionPath(section),
5552
+ section
5553
+ };
5554
+ } else {
5555
+ const [result] = Object.entries(sectionMap).find(([section$1, replaceSection]) => replaceSection === value || section$1 === value) ?? [];
5556
+ if (!result) return;
5557
+ const section = result;
5558
+ return {
5559
+ ...userConfig[section],
5560
+ absolutePath: getSectionAbsolutePath(section),
5561
+ path: getSectionPath(section),
5562
+ section
5563
+ };
5564
+ }
5565
+ }
5566
+ return {
5567
+ ...userConfig,
5568
+ src,
5569
+ cwd: cwd$2,
5570
+ getSection,
5571
+ getSectionAbsolutePath,
5572
+ getSectionPath,
5573
+ rootPath,
5574
+ srcPath
5575
+ };
5576
+ } catch {
5577
+ const packageManager = getPackageManager();
5578
+ const command = packageExecuteCommand(packageManager);
5579
+ throw new Error(`No config found. Please run ${c.cyan(`${command} ${package_default.name}@latest init`)}.`);
6802
5580
  }
6803
- await writeFile(path$9, content, options);
6804
5581
  }
6805
5582
 
6806
5583
  //#endregion
@@ -6843,169 +5620,406 @@ async function getModule(file$1, cwd$2) {
6843
5620
  }
6844
5621
 
6845
5622
  //#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
- }
5623
+ //#region src/utils/registry.ts
5624
+ const agent = process.env.https_proxy ? new HttpsProxyAgent(process.env.https_proxy) : void 0;
5625
+ const registryStore = /* @__PURE__ */ new Map();
5626
+ function getRegistryUrl(name$1) {
5627
+ if (name$1 === "index") return path$1.join(REGISTRY_URL, "index.json");
5628
+ else if (name$1 === "theme") return path$1.join(REGISTRY_URL, "theme.json");
5629
+ else if (name$1.startsWith("use-")) return path$1.join(REGISTRY_URL, "hooks", `${name$1}.json`);
5630
+ else if (name$1.endsWith("-provider")) return path$1.join(REGISTRY_URL, "providers", `${name$1}.json`);
5631
+ else return path$1.join(REGISTRY_URL, "components", `${name$1}.json`);
6859
5632
  }
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";
5633
+ async function fetchRegistryNames() {
5634
+ const { sources } = await fetchRegistry("index");
5635
+ const content = sources[0].content;
5636
+ const regex = /"@yamada-ui\/react\/([^"/]+)(?:\/([^"/]+))?"/g;
5637
+ const registryNames = [];
5638
+ let match = regex.exec(content);
5639
+ while (match !== null) {
5640
+ if (match[2]) registryNames.push(match[2]);
5641
+ match = regex.exec(content);
5642
+ }
5643
+ return registryNames;
6869
5644
  }
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`)}.`);
5645
+ async function fetchRegistry(name$1, { cache: cache$1 = true } = {}) {
5646
+ const url$2 = getRegistryUrl(name$1);
5647
+ if (cache$1 && registryStore.has(url$2)) return registryStore.get(url$2);
5648
+ const res = await fetch(url$2, { agent });
5649
+ if (res.ok) {
5650
+ const registry = await res.json();
5651
+ if (cache$1) registryStore.set(url$2, registry);
5652
+ return registry;
5653
+ } else switch (res.status) {
5654
+ case 400:
5655
+ case 401:
5656
+ case 403: throw new Error(`You do not have access to the registry at ${c.red(name$1)}.`);
5657
+ case 404: throw new Error(`The registry at ${c.red(name$1)} was not found. Please make sure the registry is available.`);
5658
+ case 500:
5659
+ case 501:
5660
+ case 502:
5661
+ case 503: throw new Error(`Service unavailable. Please try again later.`);
5662
+ default: throw new Error(`An error occurred while fetching the registry at ${c.red(name$1)}. Please try again later.`);
6876
5663
  }
6877
5664
  }
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;
5665
+ async function fetchRegistries(names, config$1, { cache: cache$1 = true, dependencies: withDependencies = true, dependents: withDependents = true, omit = [] } = {}) {
5666
+ const results = {};
5667
+ async function fetch$1(names$1) {
5668
+ await Promise.all(names$1.map(async (name$1) => {
5669
+ if (results[name$1] || omit.includes(name$1)) return;
5670
+ results[name$1] = fetchRegistry(name$1, { cache: cache$1 });
5671
+ results[name$1] = await results[name$1];
5672
+ const { dependencies: dependencies$1, dependents, section } = results[name$1];
5673
+ const target = [];
5674
+ if (section === "root" || section === "theme") return;
5675
+ withDependencies = withDependencies && (config$1[section]?.dependents ?? true);
5676
+ withDependents = withDependents && (config$1[section]?.dependencies ?? false);
5677
+ if (withDependencies && dependents) {
5678
+ target.push(...dependents.components);
5679
+ target.push(...dependents.hooks);
5680
+ target.push(...dependents.providers);
5681
+ }
5682
+ if (withDependents && dependencies$1) {
5683
+ target.push(...dependencies$1.components);
5684
+ target.push(...dependencies$1.hooks);
5685
+ target.push(...dependencies$1.providers);
5686
+ }
5687
+ const names$2 = [...new Set(target)].filter((name$2) => !results[name$2]);
5688
+ if (names$2.length) await fetch$1(names$2);
5689
+ }));
6928
5690
  }
5691
+ await fetch$1(names);
5692
+ return results;
6929
5693
  }
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);
5694
+ async function getGeneratedNameMap(config$1) {
5695
+ const results = await Promise.all(SECTION_NAMES.map(async (section) => {
5696
+ try {
5697
+ const sectionPath = config$1.getSectionAbsolutePath(section);
5698
+ const dirents = await readdir(sectionPath, { withFileTypes: true });
5699
+ return [section, dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)];
5700
+ } catch {
5701
+ return [section, []];
5702
+ }
5703
+ }));
5704
+ return Object.fromEntries(results);
5705
+ }
5706
+ function transformTemplate(targetSection, content, { getSection }, generatedNames) {
5707
+ const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
5708
+ matches.forEach((match) => {
5709
+ const [searchValue, value] = match;
5710
+ if (!value) return;
5711
+ const relative = value.includes("..");
5712
+ const module$1 = (/* @__PURE__ */ new RegExp(`^@yamada-ui\/react\/(${SECTION_NAMES.join("|")})`)).test(value);
5713
+ const name$1 = value.split("/").at(-1);
5714
+ if (!relative && !module$1 || !name$1) return;
5715
+ const generated = generatedNames.includes(name$1);
5716
+ let replaceValue;
5717
+ if (module$1) {
5718
+ const [section] = value.split("/").slice(-2);
5719
+ if (!generated || !section) return;
5720
+ if (section === targetSection) replaceValue = `from "${path$1.join("..", name$1)}"`;
5721
+ else {
5722
+ const { path: relativePath } = getSection(section) ?? {};
5723
+ if (!relativePath) return;
5724
+ replaceValue = `from "${path$1.join("..", "..", relativePath, name$1)}"`;
6947
5725
  }
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);
5726
+ } else {
5727
+ const depth = (value.match(/\.\.\//g) || []).length;
5728
+ if (!depth) return;
5729
+ if (depth === 1) if (generated) replaceValue = `from "${path$1.join("..", name$1)}"`;
5730
+ else replaceValue = `from "@yamada-ui/react/${targetSection}/${name$1}"`;
5731
+ else {
5732
+ const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
5733
+ const query = omittedValue.split("/").slice(0, -1).join("/");
5734
+ const { path: sectionPath, section } = getSection(query) ?? {};
5735
+ if (!section || !sectionPath) return;
5736
+ if (generated) {
5737
+ const targetDepth = (sectionPath.match(/\.\.\//g) || []).length;
5738
+ const neededDepth = depth + targetDepth;
5739
+ const omittedTargetPath = sectionPath.replace(/(\.\.\/|\.\/)/g, "");
5740
+ const position = "../".repeat(neededDepth);
5741
+ replaceValue = `from "${position}${omittedTargetPath}/${name$1}"`;
5742
+ } else replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
6956
5743
  }
6957
- break;
6958
5744
  }
6959
- }
5745
+ content = content.replace(searchValue, replaceValue);
5746
+ });
5747
+ return content;
5748
+ }
5749
+ function transformTemplateContent(template, data) {
5750
+ let content = template;
5751
+ Object.entries(data).forEach(([key, value]) => {
5752
+ content = content.replace(new RegExp(`{{${key}}}`, "g"), value);
5753
+ });
5754
+ return content;
5755
+ }
5756
+ async function generateSources(dirPath, { section, sources }, config$1, generatedNames = []) {
5757
+ await Promise.all(sources.map(async ({ name: fileName, content, data, template }) => {
5758
+ const targetPath = path$1.resolve(dirPath, fileName);
5759
+ if (content) {
5760
+ content = transformTemplate(section, content, config$1, generatedNames);
5761
+ await writeFileSafe(targetPath, await format$2(content));
5762
+ } else if (template && data) await Promise.all(data.map(async ({ name: fileName$1,...rest }) => {
5763
+ content = transformTemplateContent(template, rest);
5764
+ content = transformTemplate(section, content, config$1, generatedNames);
5765
+ await writeFileSafe(path$1.resolve(targetPath, fileName$1), await format$2(content));
5766
+ }));
5767
+ }));
5768
+ }
5769
+ function replaceIndex(generatedNames, content, { getSection }) {
5770
+ const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
5771
+ matches.forEach((match) => {
5772
+ const [searchValue, value] = match;
5773
+ if (!value) return;
5774
+ const name$1 = value.split("/").at(-1);
5775
+ if (!name$1) return;
5776
+ const generated = generatedNames.includes(name$1);
5777
+ let replaceValue;
5778
+ if (generated) {
5779
+ const [section] = value.split("/").slice(-2);
5780
+ const { path: path$9 } = getSection(section) ?? {};
5781
+ if (!path$9) return;
5782
+ replaceValue = `from "${path$9}/${name$1}"`;
5783
+ } else {
5784
+ const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
5785
+ const query = omittedValue.split("/").slice(0, -1).join("/");
5786
+ const { section } = getSection(query) ?? {};
5787
+ if (!section) return;
5788
+ replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
5789
+ }
5790
+ content = content.replace(searchValue, replaceValue);
5791
+ });
5792
+ return content;
6960
5793
  }
6961
5794
 
6962
5795
  //#endregion
6963
- //#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 }) {
5796
+ //#region src/commands/add/index.ts
5797
+ 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 }) {
6965
5798
  const spinner = ora();
6966
5799
  try {
6967
- const start = process.hrtime.bigint();
6968
- const configFileName = configPath.includes("/") ? configPath.split("/").at(-1) : configPath;
6969
- const config$1 = {
6970
- components: {
6971
- ignore: [],
6972
- path: "./components"
5800
+ const { end } = timer();
5801
+ spinner.start("Validating directory");
5802
+ await validateDir(cwd$2);
5803
+ spinner.succeed("Validated directory");
5804
+ spinner.start("Fetching config");
5805
+ const config$1 = await getConfig(cwd$2, configPath);
5806
+ spinner.succeed("Fetched config");
5807
+ let generatedNameMap;
5808
+ const omittedGeneratedNames = [];
5809
+ if (all) {
5810
+ const { proceed } = await prompts({
5811
+ type: "confirm",
5812
+ name: "proceed",
5813
+ initial: true,
5814
+ message: c.reset(`Add all available components?`)
5815
+ });
5816
+ if (!proceed) process.exit(0);
5817
+ if (!overwrite && existsSync(config$1.srcPath)) {
5818
+ const { overwrite: overwrite$1 } = await prompts({
5819
+ type: "confirm",
5820
+ name: "overwrite",
5821
+ initial: false,
5822
+ message: c.reset(`The directory already exists. Do you want to overwrite it?`)
5823
+ });
5824
+ if (!overwrite$1) process.exit(0);
5825
+ }
5826
+ spinner.start("Fetching all available components");
5827
+ componentNames = await fetchRegistryNames();
5828
+ spinner.succeed("Fetched all available components");
5829
+ } else {
5830
+ spinner.start("Getting generated data");
5831
+ generatedNameMap = await getGeneratedNameMap(config$1);
5832
+ const generatedNames = Object.values(generatedNameMap).flat();
5833
+ const existsNames = componentNames.filter((name$1) => generatedNames.includes(name$1));
5834
+ spinner.succeed("Got generated data");
5835
+ if (!overwrite && existsNames.length) {
5836
+ const colorizedNames = existsNames.map((name$1) => c.yellow(name$1));
5837
+ const { overwrite: overwrite$1 } = await prompts({
5838
+ type: "confirm",
5839
+ name: "overwrite",
5840
+ initial: false,
5841
+ message: c.reset(`The ${colorizedNames.join(", ")} components already exist. Do you want to overwrite them?`)
5842
+ });
5843
+ if (!overwrite$1) process.exit(0);
5844
+ }
5845
+ omittedGeneratedNames.push(...generatedNames.filter((name$1) => !componentNames.includes(name$1)));
5846
+ }
5847
+ spinner.start("Fetching registries");
5848
+ const registries = await fetchRegistries(componentNames, config$1, {
5849
+ dependencies: !all,
5850
+ dependents: !all,
5851
+ omit: omittedGeneratedNames
5852
+ });
5853
+ const registryNames = Object.keys(registries);
5854
+ const dependencies$1 = [...new Set(Object.values(registries).map(({ dependencies: dependencies$2 }) => dependencies$2?.externals).filter((dependencies$2) => !isUndefined(dependencies$2)).flat())];
5855
+ const affectedNames = [...new Set(Object.values(registries).map(({ dependents }) => [
5856
+ ...dependents?.components ?? [],
5857
+ ...dependents?.hooks ?? [],
5858
+ ...dependents?.providers ?? []
5859
+ ]).flat().filter((dependent) => omittedGeneratedNames.includes(dependent)))];
5860
+ spinner.succeed("Fetched registries");
5861
+ const targetNames = [...new Set([...omittedGeneratedNames, ...registryNames])];
5862
+ const tasks = new Listr(Object.entries(registries).map(([name$1, registry]) => {
5863
+ if (registry.section === "root" || registry.section === "theme") return;
5864
+ const sectionPath = config$1.getSectionAbsolutePath(registry.section);
5865
+ const dirPath = path$1.join(sectionPath, name$1);
5866
+ return {
5867
+ task: async (_, task) => {
5868
+ await generateSources(dirPath, registry, config$1, targetNames);
5869
+ task.title = `Generated ${c.cyan(name$1)}`;
5870
+ },
5871
+ title: `Generating ${c.cyan(name$1)}`
5872
+ };
5873
+ }).filter((task) => !isUndefined(task)), { concurrent: true });
5874
+ if (existsSync(path$1.resolve(config$1.srcPath, "index.ts"))) tasks.add({
5875
+ task: async (_, task) => {
5876
+ const targetPath = path$1.resolve(config$1.srcPath, "index.ts");
5877
+ const data = replaceIndex(targetNames, await readFile(targetPath, "utf-8"), config$1);
5878
+ const content = await format$2(data);
5879
+ await writeFileSafe(targetPath, content);
5880
+ task.title = `Updated ${c.cyan("index.ts")}`;
6973
5881
  },
6974
- hooks: {
6975
- ignore: [],
6976
- path: "./hooks"
5882
+ title: `Updating ${c.cyan("index.ts")}`
5883
+ });
5884
+ else tasks.add({
5885
+ task: async (_, task) => {
5886
+ const { sources } = await fetchRegistry("index");
5887
+ const targetPath = path$1.resolve(config$1.srcPath, "index.ts");
5888
+ const data = replaceIndex(targetNames, sources[0].content, config$1);
5889
+ const content = await format$2(data);
5890
+ await writeFileSafe(targetPath, content);
5891
+ task.title = `Generated ${c.cyan("index.ts")}`;
6977
5892
  },
6978
- providers: {
6979
- ignore: [],
6980
- path: "./providers"
5893
+ title: `Generating ${c.cyan("index.ts")}`
5894
+ });
5895
+ if (affectedNames.length && generatedNameMap) {
5896
+ if (!overwrite) {
5897
+ const colorizedNames = affectedNames.map((name$1) => c.yellow(name$1));
5898
+ const { update } = await prompts({
5899
+ type: "confirm",
5900
+ name: "update",
5901
+ initial: true,
5902
+ message: c.reset(`The following generated files will be updated: ${colorizedNames.join(", ")}. Do you want to update them?`)
5903
+ });
5904
+ if (update) overwrite = update;
6981
5905
  }
6982
- };
5906
+ if (overwrite) Object.entries(generatedNameMap).forEach(([section, names]) => {
5907
+ names.forEach((name$1) => {
5908
+ if (!affectedNames.includes(name$1)) return;
5909
+ tasks.add({
5910
+ task: async (_, task) => {
5911
+ const sectionPath = config$1.getSectionAbsolutePath(section);
5912
+ const dirPath = path$1.join(sectionPath, name$1);
5913
+ const dirents = await readdir(dirPath, { withFileTypes: true });
5914
+ await Promise.all(dirents.map(async (dirent) => {
5915
+ if (dirent.isDirectory()) return;
5916
+ const targetPath = path$1.join(dirent.parentPath, dirent.name);
5917
+ const content = transformTemplate(section, await readFile(targetPath, "utf-8"), config$1, targetNames);
5918
+ await writeFileSafe(targetPath, await format$2(content));
5919
+ }));
5920
+ task.title = `Updated ${c.cyan(name$1)}`;
5921
+ },
5922
+ title: `Updating ${c.cyan(name$1)}`
5923
+ });
5924
+ });
5925
+ });
5926
+ }
5927
+ if (dependencies$1.length) {
5928
+ const targetPath = config$1.monorepo ? config$1.rootPath : cwd$2;
5929
+ spinner.start(`Checking ${c.cyan("package.json")} dependencies`);
5930
+ const packageJson$2 = await getPackageJson(targetPath);
5931
+ const notInstalledDependencies = getNotInstalledDependencies(packageJson$2, dependencies$1);
5932
+ spinner.succeed(`Checked ${c.cyan("package.json")} dependencies`);
5933
+ if (!install && notInstalledDependencies.length) {
5934
+ const colorizedNames = notInstalledDependencies.map((value) => c.yellow(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
5935
+ const { proceed } = await prompts({
5936
+ type: "confirm",
5937
+ name: "proceed",
5938
+ initial: true,
5939
+ message: c.reset(`The following dependencies are not installed: ${colorizedNames.join(", ")}. Do you want to install them?`)
5940
+ });
5941
+ install = proceed;
5942
+ }
5943
+ if (install) tasks.add({
5944
+ task: (_, task) => {
5945
+ installDependencies(notInstalledDependencies.map(getPackageName), { cwd: targetPath });
5946
+ task.title = "Installed dependencies";
5947
+ },
5948
+ title: "Installing dependencies"
5949
+ });
5950
+ }
5951
+ await tasks.run();
5952
+ end();
5953
+ } catch (e) {
5954
+ if (e instanceof Error) spinner.fail(e.message);
5955
+ else spinner.fail("An unknown error occurred");
5956
+ }
5957
+ });
5958
+
5959
+ //#endregion
5960
+ //#region src/commands/diff/index.ts
5961
+ 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 }) {
5962
+ const spinner = ora();
5963
+ try {
5964
+ const { end } = timer();
5965
+ spinner.start("Validating directory");
5966
+ await validateDir(cwd$2);
5967
+ spinner.succeed("Validated directory");
5968
+ spinner.start("Fetching config");
5969
+ const config$1 = await getConfig(cwd$2, configPath);
5970
+ console.log(config$1);
5971
+ spinner.succeed("Fetched config");
5972
+ end();
5973
+ } catch (e) {
5974
+ if (e instanceof Error) spinner.fail(e.message);
5975
+ else spinner.fail("An unknown error occurred");
5976
+ }
5977
+ });
5978
+
5979
+ //#endregion
5980
+ //#region src/commands/init/index.ts
5981
+ 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 }) {
5982
+ const spinner = ora();
5983
+ try {
5984
+ const { end } = timer();
5985
+ await validateDir(cwd$2);
5986
+ const configFileName = configPath.includes("/") ? configPath.split("/").at(-1) : configPath;
5987
+ const config$1 = { ...DEFAULT_SECTION_CONFIG };
6983
5988
  configPath = path$1.resolve(cwd$2, configPath);
6984
5989
  let dependencies$1;
6985
- let { monorepo = true, outdir, packageName } = await prompts([
5990
+ let devDependencies$1;
5991
+ let { src = true, monorepo = true, outdir = "", packageName = "" } = await prompts([
6986
5992
  {
6987
5993
  type: "toggle",
6988
5994
  name: "monorepo",
6989
5995
  active: "Yes",
6990
5996
  inactive: "No",
6991
5997
  initial: true,
6992
- message: `Would you like to use monorepo? (recommended)`
5998
+ message: c.reset(`Would you like to use monorepo? (recommended)`)
6993
5999
  },
6994
6000
  {
6995
6001
  type: "text",
6996
6002
  name: "outdir",
6997
- initial: (_, { monorepo: monorepo$1 }) => monorepo$1 ? PATH.MONOREPO : PATH.POLYREPO,
6998
- message: (_, { monorepo: monorepo$1 }) => monorepo$1 ? `What is the path to the monorepo?` : `What is the path to the directory?`
6003
+ initial: (_, { monorepo: monorepo$1 }) => monorepo$1 ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo,
6004
+ 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
6005
  },
7000
6006
  {
7001
6007
  type: (_, { monorepo: monorepo$1 }) => monorepo$1 ? "text" : null,
7002
6008
  name: "packageName",
7003
6009
  initial: DEFAULT_PACKAGE_NAME,
7004
- message: "What is the package name?"
6010
+ message: c.reset("What is the package name?")
6011
+ },
6012
+ {
6013
+ type: (_, { monorepo: monorepo$1 }) => monorepo$1 ? "toggle" : null,
6014
+ name: "src",
6015
+ active: "Yes",
6016
+ inactive: "No",
6017
+ initial: true,
6018
+ message: c.reset("Would you like your code inside a `src/` directory?")
7005
6019
  }
7006
6020
  ]);
7007
6021
  outdir = outdir.replace(/\x17/g, "").trim();
7008
- outdir ||= monorepo ? PATH.MONOREPO : PATH.POLYREPO;
6022
+ outdir ||= monorepo ? DEFAULT_PATH.monorepo : DEFAULT_PATH.polyrepo;
7009
6023
  packageName = packageName.replace(/\x17/g, "").trim();
7010
6024
  packageName ||= DEFAULT_PACKAGE_NAME;
7011
6025
  config$1.monorepo = monorepo;
@@ -7014,99 +6028,144 @@ const init = new Command("init").description("Initialize your project and instal
7014
6028
  type: "confirm",
7015
6029
  name: "generate",
7016
6030
  initial: true,
7017
- message: `Generate ${c.cyan(configFileName)}. Proceed?`
6031
+ message: c.reset(`Generate ${c.cyan(configFileName)}. Proceed?`)
7018
6032
  });
7019
6033
  if (!generate) process.exit(0);
7020
- if (existsSync(configPath)) {
7021
- const { overwrite } = await prompts({
6034
+ if (!overwrite && existsSync(configPath)) {
6035
+ const { overwrite: overwrite$1 } = await prompts({
7022
6036
  type: "confirm",
7023
6037
  name: "overwrite",
7024
6038
  initial: false,
7025
- message: `The config file already exists. Do you want to overwrite it?`
6039
+ message: c.reset(`The config file already exists. Do you want to overwrite it?`)
7026
6040
  });
7027
- if (!overwrite) process.exit(0);
6041
+ if (!overwrite$1) process.exit(0);
7028
6042
  }
7029
6043
  spinner.start(`Generating ${c.cyan(configFileName)}`);
7030
6044
  await writeFileSafe(configPath, await format$2(JSON.stringify(config$1), { parser: "json" }));
7031
6045
  spinner.succeed(`Generated ${c.cyan(configFileName)}`);
6046
+ const outdirPath = path$1.resolve(cwd$2, outdir);
6047
+ if (!overwrite && existsSync(outdirPath)) {
6048
+ const { overwrite: overwrite$1 } = await prompts({
6049
+ type: "confirm",
6050
+ name: "overwrite",
6051
+ initial: false,
6052
+ message: c.reset(`The ${c.yellow(outdir)} directory already exists. Do you want to overwrite it?`)
6053
+ });
6054
+ if (!overwrite$1) process.exit(0);
6055
+ spinner.start("Clearing directory");
6056
+ await rimraf(outdirPath);
6057
+ spinner.succeed("Cleared directory");
6058
+ }
7032
6059
  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
6060
  const { generate: generate$1 } = await prompts({
7045
6061
  type: "confirm",
7046
6062
  name: "generate",
7047
6063
  initial: true,
7048
- message: `Generate ${c.cyan(packageName)}. Proceed?`
6064
+ message: c.reset(`Generate ${c.cyan(packageName)}. Proceed?`)
7049
6065
  });
7050
6066
  if (!generate$1) process.exit(0);
7051
- spinner.start(`Generating ${c.cyan(packageName)}`);
7052
- await Promise.all([
6067
+ const tasks = new Listr([
6068
+ {
6069
+ task: async (_, task) => {
6070
+ const targetPath = path$1.resolve(outdirPath, "package.json");
6071
+ const data = JSON.stringify({
6072
+ name: packageName,
6073
+ ...DEFAULT_PACKAGE_JSON
6074
+ });
6075
+ const content = await format$2(data, { parser: "json" });
6076
+ await writeFileSafe(targetPath, content);
6077
+ task.title = `Generated ${c.cyan("package.json")}`;
6078
+ },
6079
+ title: `Generating ${c.cyan("package.json")}`
6080
+ },
7053
6081
  {
7054
- content: await format$2(JSON.stringify(packageJson$2), { parser: "json" }),
7055
- path: path$1.resolve(outdirPath, "package.json")
6082
+ task: async (_, task) => {
6083
+ const targetPath = path$1.resolve(outdirPath, "tsconfig.json");
6084
+ const data = JSON.stringify({ ...TSCONFIG_JSON });
6085
+ const content = await format$2(data, { parser: "json" });
6086
+ await writeFileSafe(targetPath, content);
6087
+ task.title = `Generated ${c.cyan("tsconfig.json")}`;
6088
+ },
6089
+ title: `Generating ${c.cyan("tsconfig.json")}`
7056
6090
  },
7057
6091
  {
7058
- content: await format$2(JSON.stringify(tsconfigJson), { parser: "json" }),
7059
- path: path$1.resolve(outdirPath, "tsconfig.json")
6092
+ task: async (_, task) => {
6093
+ const targetPath = path$1.resolve(outdirPath, src ? "src" : "", "index.ts");
6094
+ const { sources } = await fetchRegistry("index");
6095
+ const content = await format$2(sources[0].content);
6096
+ await writeFileSafe(targetPath, content);
6097
+ task.title = `Generated ${c.cyan("index.ts")}`;
6098
+ },
6099
+ title: `Generating ${c.cyan("index.ts")}`
7060
6100
  },
7061
- ...await Promise.all(sources.map(async ({ name: name$1, content }) => ({
7062
- content: await format$2(content),
7063
- path: path$1.resolve(outdirPath, "src", name$1)
7064
- })))
7065
- ].map(({ content, path: path$9 }) => writeFileSafe(path$9, content)));
7066
- spinner.succeed(`Generated ${c.cyan(packageName)}`);
7067
- spinner.start("Adding workspace");
7068
- if (outdir.includes("/")) {
7069
- const path$9 = `${outdir.replace(/^\.\//, "").split("/")[0]}/**`;
7070
- await addWorkspace(cwd$2, path$9);
7071
- } else await addWorkspace(cwd$2, outdir);
7072
- spinner.succeed("Added workspace");
6101
+ {
6102
+ task: async (_, task) => {
6103
+ if (outdir.includes("/")) {
6104
+ const path$9 = `${outdir.replace(/^\.\//, "").split("/")[0]}/**`;
6105
+ await addWorkspace(cwd$2, path$9);
6106
+ } else await addWorkspace(cwd$2, outdir);
6107
+ task.title = "Added workspace";
6108
+ },
6109
+ title: "Adding workspace"
6110
+ }
6111
+ ], { concurrent: true });
6112
+ await tasks.run();
7073
6113
  const { install } = await prompts({
7074
6114
  type: "confirm",
7075
6115
  name: "install",
7076
6116
  initial: true,
7077
- message: `The workspace is generated. Do you want to install dependencies?`
6117
+ message: c.reset(`The workspace is generated. Do you want to install dependencies?`)
7078
6118
  });
7079
6119
  if (install) dependencies$1 = [];
7080
6120
  } else {
7081
- spinner.start("Getting package.json");
7082
- const packageJson$2 = await getPackageJson(cwd$2);
7083
- const requiredDependencies = requireDependencies(packageJson$2, [
7084
- "react",
7085
- "react-dom",
7086
- "@yamada-ui/react"
7087
- ]);
7088
- const notInstalledDependencies = Object.entries(requiredDependencies).filter(([_, version$1]) => !version$1);
7089
- spinner.succeed("Got package.json");
7090
- if (notInstalledDependencies.length) {
7091
- const dependencyNames = notInstalledDependencies.map(([name$1]) => c.cyan(name$1));
6121
+ const notInstalledDependencies = [];
6122
+ const notInstalledDevDependencies = [];
6123
+ const tasks = new Listr([{
6124
+ task: async (_, task) => {
6125
+ const packageJson$2 = await getPackageJson(cwd$2);
6126
+ notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, REQUIRED_DEPENDENCIES));
6127
+ notInstalledDevDependencies.push(...getNotInstalledDependencies(packageJson$2, REQUIRED_DEV_DEPENDENCIES));
6128
+ task.title = `Checked ${c.cyan("package.json")} dependencies`;
6129
+ },
6130
+ title: `Checking ${c.cyan("package.json")} dependencies`
6131
+ }, {
6132
+ task: async (_, task) => {
6133
+ const { sources } = await fetchRegistry("index");
6134
+ const targetPath = path$1.resolve(outdirPath, "index.ts");
6135
+ const content = await format$2(sources[0].content);
6136
+ await writeFileSafe(targetPath, content);
6137
+ task.title = `Generated ${c.cyan("index.ts")}`;
6138
+ },
6139
+ title: `Generating ${c.cyan("index.ts")}`
6140
+ }], { concurrent: true });
6141
+ await tasks.run();
6142
+ if (notInstalledDependencies.length || notInstalledDevDependencies.length) {
6143
+ const colorizedNames = [...notInstalledDependencies, ...notInstalledDevDependencies].map((value) => c.cyan(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
7092
6144
  const { install } = await prompts({
7093
6145
  type: "confirm",
7094
6146
  name: "install",
7095
6147
  initial: true,
7096
- message: `The following dependencies are not installed: ${dependencyNames.join(", ")}. Do you want to install them?`
6148
+ message: c.reset(`The following dependencies are not installed: ${colorizedNames.join(", ")}. Do you want to install them?`)
7097
6149
  });
7098
- if (install) dependencies$1 = dependencyNames;
6150
+ if (install) {
6151
+ dependencies$1 = notInstalledDependencies.map(getPackageName);
6152
+ devDependencies$1 = notInstalledDevDependencies.map(getPackageName);
6153
+ }
7099
6154
  }
7100
6155
  }
7101
- if (dependencies$1) {
6156
+ if (dependencies$1 || devDependencies$1) {
7102
6157
  spinner.start("Installing dependencies");
7103
- installDependencies(cwd$2, dependencies$1);
6158
+ if (dependencies$1) installDependencies(dependencies$1, { cwd: cwd$2 });
6159
+ if (devDependencies$1) installDependencies(devDependencies$1, {
6160
+ cwd: cwd$2,
6161
+ dev: true
6162
+ });
7104
6163
  spinner.succeed("Installed dependencies");
7105
6164
  }
7106
6165
  if (packageName) {
7107
6166
  const packageManager = getPackageManager();
7108
- const command = packageManager === "npm" ? "install" : "add";
7109
- console.log(boxen(`Run ${c.cyan(`${packageManager} ${command} "${packageName}@workspace:*"`)} in your application.`, {
6167
+ const command = packageAddCommand(packageManager);
6168
+ console.log(boxen(`Run ${c.cyan(`${command} "${packageName}@workspace:*"`)} in your application.`, {
7110
6169
  borderColor: "yellow",
7111
6170
  borderStyle: "round",
7112
6171
  margin: 1,
@@ -7114,9 +6173,7 @@ const init = new Command("init").description("Initialize your project and instal
7114
6173
  textAlignment: "center"
7115
6174
  }));
7116
6175
  }
7117
- const end = process.hrtime.bigint();
7118
- const duration = (Number(end - start) / 1e9).toFixed(2);
7119
- console.log("\n", c.green(`Done in ${duration}s`));
6176
+ end();
7120
6177
  } catch (e) {
7121
6178
  if (e instanceof Error) spinner.fail(e.message);
7122
6179
  else spinner.fail("An unknown error occurred");
@@ -7315,32 +6372,35 @@ async function getTheme(path$9, cwd$2) {
7315
6372
  }
7316
6373
  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
6374
  const spinner = ora();
7318
- const eslint = new ESLint({ fix: true });
7319
- const start = process.hrtime.bigint();
7320
- spinner.start(`Getting theme`);
7321
- cwd$2 = path$1.resolve(cwd$2);
7322
- inputPath = path$1.resolve(cwd$2, inputPath);
7323
- if (outPath) outPath = path$1.resolve(cwd$2, outPath);
7324
- else if (inputPath.includes("/")) {
7325
- const dirPath = inputPath.split("/").slice(0, -1).join("/");
7326
- outPath = path$1.join(dirPath, "index.types.ts");
7327
- } else outPath = path$1.join(cwd$2, "index.types.ts");
7328
- const { config: config$1, theme } = await getTheme(inputPath, cwd$2);
7329
- spinner.succeed(`Got theme`);
7330
- spinner.start(`Generating theme typings`);
7331
- let content = await generateThemeTokens(theme, {
7332
- ...config$1,
7333
- internal
7334
- });
7335
- if (lint) {
7336
- const [result] = await eslint.lintText(content, { filePath: inputPath });
7337
- if (result?.output) content = result.output;
7338
- }
7339
- await writeFile(outPath, content, "utf8");
7340
- spinner.succeed(`Generated theme typings`);
7341
- const end = process.hrtime.bigint();
7342
- const duration = (Number(end - start) / 1e9).toFixed(2);
7343
- console.log("\n", c.green(`Done in ${duration}s`));
6375
+ try {
6376
+ const eslint = new ESLint({ fix: true });
6377
+ const { end } = timer();
6378
+ spinner.start(`Getting theme`);
6379
+ cwd$2 = path$1.resolve(cwd$2);
6380
+ inputPath = path$1.resolve(cwd$2, inputPath);
6381
+ if (outPath) outPath = path$1.resolve(cwd$2, outPath);
6382
+ else if (inputPath.includes("/")) {
6383
+ const dirPath = inputPath.split("/").slice(0, -1).join("/");
6384
+ outPath = path$1.join(dirPath, "index.types.ts");
6385
+ } else outPath = path$1.join(cwd$2, "index.types.ts");
6386
+ const { config: config$1, theme } = await getTheme(inputPath, cwd$2);
6387
+ spinner.succeed(`Got theme`);
6388
+ spinner.start(`Generating theme typings`);
6389
+ let content = await generateThemeTokens(theme, {
6390
+ ...config$1,
6391
+ internal
6392
+ });
6393
+ if (lint) {
6394
+ const [result] = await eslint.lintText(content, { filePath: inputPath });
6395
+ if (result?.output) content = result.output;
6396
+ }
6397
+ await writeFile(outPath, content, "utf8");
6398
+ spinner.succeed(`Generated theme typings`);
6399
+ end();
6400
+ } catch (e) {
6401
+ if (e instanceof Error) spinner.fail(e.message);
6402
+ else spinner.fail("An unknown error occurred");
6403
+ }
7344
6404
  });
7345
6405
 
7346
6406
  //#endregion