@yamada-ui/cli 2.0.0-dev-20250908163631 → 2.0.0-dev-20250911064237

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 +112 -160
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -311,8 +311,7 @@ var require_polyfills$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
311
311
  function chownErOk(er) {
312
312
  if (!er) return true;
313
313
  if (er.code === "ENOSYS") return true;
314
- var nonroot = !process.getuid || process.getuid() !== 0;
315
- if (nonroot) {
314
+ if (!process.getuid || process.getuid() !== 0) {
316
315
  if (er.code === "EINVAL" || er.code === "EPERM") return true;
317
316
  }
318
317
  return false;
@@ -915,8 +914,7 @@ const retryifyAsync = (fn, isRetriableError) => {
915
914
  if (Date.now() >= timestamp) throw error;
916
915
  if (isRetriableError(error)) {
917
916
  const delay$1 = Math.round(100 * Math.random());
918
- const delayPromise = new Promise((resolve) => setTimeout(resolve, delay$1));
919
- return delayPromise.then(() => attempt.apply(void 0, args));
917
+ return new Promise((resolve) => setTimeout(resolve, delay$1)).then(() => attempt.apply(void 0, args));
920
918
  }
921
919
  throw error;
922
920
  };
@@ -1066,11 +1064,8 @@ const Temp = {
1066
1064
  store: {},
1067
1065
  create: (filePath) => {
1068
1066
  const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6);
1069
- const timestamp = Date.now().toString().slice(-10);
1070
- const prefix = "tmp-";
1071
- const suffix = `.${prefix}${timestamp}${randomness}`;
1072
- const tempPath = `${filePath}${suffix}`;
1073
- return tempPath;
1067
+ const suffix = `.tmp-${Date.now().toString().slice(-10)}${randomness}`;
1068
+ return `${filePath}${suffix}`;
1074
1069
  },
1075
1070
  get: (filePath, creator, purge = true) => {
1076
1071
  const tempPath = Temp.truncate(creator(filePath));
@@ -1387,7 +1382,7 @@ var Configstore = class {
1387
1382
  };
1388
1383
 
1389
1384
  //#endregion
1390
- //#region ../../node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/vendor/ansi-styles/index.js
1385
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
1391
1386
  const ANSI_BACKGROUND_OFFSET = 10;
1392
1387
  const wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
1393
1388
  const wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
@@ -1553,7 +1548,7 @@ const ansiStyles = assembleStyles();
1553
1548
  var ansi_styles_default = ansiStyles;
1554
1549
 
1555
1550
  //#endregion
1556
- //#region ../../node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/vendor/supports-color/index.js
1551
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
1557
1552
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
1558
1553
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1559
1554
  const position = argv.indexOf(prefix + flag);
@@ -1644,7 +1639,7 @@ const supportsColor = {
1644
1639
  var supports_color_default = supportsColor;
1645
1640
 
1646
1641
  //#endregion
1647
- //#region ../../node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/utilities.js
1642
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
1648
1643
  function stringReplaceAll(string, substring, replacer) {
1649
1644
  let index = string.indexOf(substring);
1650
1645
  if (index === -1) return string;
@@ -1673,7 +1668,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
1673
1668
  }
1674
1669
 
1675
1670
  //#endregion
1676
- //#region ../../node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/index.js
1671
+ //#region ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
1677
1672
  const { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
1678
1673
  const GENERATOR = Symbol("GENERATOR");
1679
1674
  const STYLER = Symbol("STYLER");
@@ -1798,7 +1793,7 @@ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1798
1793
  var source_default = chalk;
1799
1794
 
1800
1795
  //#endregion
1801
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/errors/HTTPError.js
1796
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/errors/HTTPError.js
1802
1797
  var HTTPError = class extends Error {
1803
1798
  response;
1804
1799
  request;
@@ -1817,7 +1812,7 @@ var HTTPError = class extends Error {
1817
1812
  };
1818
1813
 
1819
1814
  //#endregion
1820
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/errors/TimeoutError.js
1815
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/errors/TimeoutError.js
1821
1816
  var TimeoutError = class extends Error {
1822
1817
  request;
1823
1818
  constructor(request) {
@@ -1828,7 +1823,7 @@ var TimeoutError = class extends Error {
1828
1823
  };
1829
1824
 
1830
1825
  //#endregion
1831
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/core/constants.js
1826
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/core/constants.js
1832
1827
  const supportsRequestStreams = (() => {
1833
1828
  let duplexAccessed = false;
1834
1829
  let hasContentType = false;
@@ -1908,7 +1903,7 @@ const requestOptionsRegistry = {
1908
1903
  };
1909
1904
 
1910
1905
  //#endregion
1911
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/body.js
1906
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/body.js
1912
1907
  const getBodySize = (body) => {
1913
1908
  if (!body) return 0;
1914
1909
  if (body instanceof FormData) {
@@ -2015,11 +2010,11 @@ const streamRequest = (request, onUploadProgress, originalBody) => {
2015
2010
  };
2016
2011
 
2017
2012
  //#endregion
2018
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/is.js
2013
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/is.js
2019
2014
  const isObject$1 = (value) => value !== null && typeof value === "object";
2020
2015
 
2021
2016
  //#endregion
2022
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/merge.js
2017
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/merge.js
2023
2018
  const validateAndMerge = (...sources) => {
2024
2019
  for (const source of sources) if ((!isObject$1(source) || Array.isArray(source)) && source !== void 0) throw new TypeError("The `options` argument must be an object");
2025
2020
  return deepMerge({}, ...sources);
@@ -2069,35 +2064,32 @@ const deepMerge = (...sources) => {
2069
2064
  };
2070
2065
 
2071
2066
  //#endregion
2072
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/normalize.js
2067
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/normalize.js
2073
2068
  const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;
2074
- const retryMethods = [
2075
- "get",
2076
- "put",
2077
- "head",
2078
- "delete",
2079
- "options",
2080
- "trace"
2081
- ];
2082
- const retryStatusCodes = [
2083
- 408,
2084
- 413,
2085
- 429,
2086
- 500,
2087
- 502,
2088
- 503,
2089
- 504
2090
- ];
2091
- const retryAfterStatusCodes = [
2092
- 413,
2093
- 429,
2094
- 503
2095
- ];
2096
2069
  const defaultRetryOptions = {
2097
2070
  limit: 2,
2098
- methods: retryMethods,
2099
- statusCodes: retryStatusCodes,
2100
- afterStatusCodes: retryAfterStatusCodes,
2071
+ methods: [
2072
+ "get",
2073
+ "put",
2074
+ "head",
2075
+ "delete",
2076
+ "options",
2077
+ "trace"
2078
+ ],
2079
+ statusCodes: [
2080
+ 408,
2081
+ 413,
2082
+ 429,
2083
+ 500,
2084
+ 502,
2085
+ 503,
2086
+ 504
2087
+ ],
2088
+ afterStatusCodes: [
2089
+ 413,
2090
+ 429,
2091
+ 503
2092
+ ],
2101
2093
  maxRetryAfter: Number.POSITIVE_INFINITY,
2102
2094
  backoffLimit: Number.POSITIVE_INFINITY,
2103
2095
  delay: (attemptCount) => .3 * 2 ** (attemptCount - 1) * 1e3
@@ -2116,7 +2108,7 @@ const normalizeRetryOptions = (retry$2 = {}) => {
2116
2108
  };
2117
2109
 
2118
2110
  //#endregion
2119
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/timeout.js
2111
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/timeout.js
2120
2112
  async function timeout(request, init$1, abortController, options) {
2121
2113
  return new Promise((resolve, reject) => {
2122
2114
  const timeoutId = setTimeout(() => {
@@ -2130,7 +2122,7 @@ async function timeout(request, init$1, abortController, options) {
2130
2122
  }
2131
2123
 
2132
2124
  //#endregion
2133
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/delay.js
2125
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/delay.js
2134
2126
  async function delay(ms, { signal }) {
2135
2127
  return new Promise((resolve, reject) => {
2136
2128
  if (signal) {
@@ -2149,7 +2141,7 @@ async function delay(ms, { signal }) {
2149
2141
  }
2150
2142
 
2151
2143
  //#endregion
2152
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/utils/options.js
2144
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/utils/options.js
2153
2145
  const findUnknownOptions = (request, options) => {
2154
2146
  const unknownOptions = {};
2155
2147
  for (const key in options) if (!(key in requestOptionsRegistry) && !(key in kyOptionKeys) && !(key in request)) unknownOptions[key] = options[key];
@@ -2165,7 +2157,7 @@ const hasSearchParameters = (search) => {
2165
2157
  };
2166
2158
 
2167
2159
  //#endregion
2168
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/core/Ky.js
2160
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/core/Ky.js
2169
2161
  var Ky = class Ky {
2170
2162
  static create(input, options) {
2171
2163
  const ky$1 = new Ky(input, options);
@@ -2190,8 +2182,7 @@ var Ky = class Ky {
2190
2182
  }
2191
2183
  return response;
2192
2184
  };
2193
- const isRetriableMethod = ky$1._options.retry.methods.includes(ky$1.request.method.toLowerCase());
2194
- const result = (isRetriableMethod ? ky$1._retry(function_) : function_()).finally(async () => {
2185
+ const result = (ky$1._options.retry.methods.includes(ky$1.request.method.toLowerCase()) ? ky$1._retry(function_) : function_()).finally(async () => {
2195
2186
  if (!ky$1.request.bodyUsed) await ky$1.request.body?.cancel();
2196
2187
  });
2197
2188
  for (const [type$1, mimeType] of Object.entries(responseTypes)) {
@@ -2201,16 +2192,20 @@ var Ky = class Ky {
2201
2192
  const response = await result;
2202
2193
  if (type$1 === "json") {
2203
2194
  if (response.status === 204) return "";
2204
- const arrayBuffer = await response.clone().arrayBuffer();
2205
- const responseSize = arrayBuffer.byteLength;
2206
- if (responseSize === 0) return "";
2207
- if (options.parseJson) return options.parseJson(await response.text());
2195
+ const text = await response.text();
2196
+ if (text === "") return "";
2197
+ if (options.parseJson) return options.parseJson(text);
2198
+ return JSON.parse(text);
2208
2199
  }
2209
2200
  return response[type$1]();
2210
2201
  };
2211
2202
  }
2212
2203
  return result;
2213
2204
  }
2205
+ static #normalizeSearchParams(searchParams) {
2206
+ if (searchParams && typeof searchParams === "object" && !Array.isArray(searchParams) && !(searchParams instanceof URLSearchParams)) return Object.fromEntries(Object.entries(searchParams).filter(([, value]) => value !== void 0));
2207
+ return searchParams;
2208
+ }
2214
2209
  request;
2215
2210
  abortController;
2216
2211
  _retryCount = 0;
@@ -2252,8 +2247,7 @@ var Ky = class Ky {
2252
2247
  }
2253
2248
  this.request = new globalThis.Request(this._input, this._options);
2254
2249
  if (hasSearchParameters(this._options.searchParams)) {
2255
- const textSearchParams = typeof this._options.searchParams === "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(this._options.searchParams).toString();
2256
- const searchParams = "?" + textSearchParams;
2250
+ const searchParams = "?" + (typeof this._options.searchParams === "string" ? this._options.searchParams.replace(/^\?/, "") : new URLSearchParams(Ky.#normalizeSearchParams(this._options.searchParams)).toString());
2257
2251
  const url$2 = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams);
2258
2252
  if ((supportsFormData && this._options.body instanceof globalThis.FormData || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers["content-type"])) this.request.headers.delete("content-type");
2259
2253
  this.request = new globalThis.Request(new globalThis.Request(url$2, { ...this.request }), this._options);
@@ -2261,8 +2255,7 @@ var Ky = class Ky {
2261
2255
  if (this._options.onUploadProgress) {
2262
2256
  if (typeof this._options.onUploadProgress !== "function") throw new TypeError("The `onUploadProgress` option must be a function");
2263
2257
  if (!supportsRequestStreams) throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
2264
- const originalBody = this.request.body;
2265
- if (originalBody) this.request = streamRequest(this.request, this._options.onUploadProgress, this._options.body);
2258
+ if (this.request.body) this.request = streamRequest(this.request, this._options.onUploadProgress, this._options.body);
2266
2259
  }
2267
2260
  }
2268
2261
  _calculateRetryDelay(error) {
@@ -2294,15 +2287,12 @@ var Ky = class Ky {
2294
2287
  const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);
2295
2288
  if (this._retryCount < 1) throw error;
2296
2289
  await delay(ms, { signal: this._options.signal });
2297
- for (const hook of this._options.hooks.beforeRetry) {
2298
- const hookResult = await hook({
2299
- request: this.request,
2300
- options: this._options,
2301
- error,
2302
- retryCount: this._retryCount
2303
- });
2304
- if (hookResult === stop) return;
2305
- }
2290
+ for (const hook of this._options.hooks.beforeRetry) if (await hook({
2291
+ request: this.request,
2292
+ options: this._options,
2293
+ error,
2294
+ retryCount: this._retryCount
2295
+ }) === stop) return;
2306
2296
  return this._retry(function_);
2307
2297
  }
2308
2298
  }
@@ -2324,7 +2314,7 @@ var Ky = class Ky {
2324
2314
  };
2325
2315
 
2326
2316
  //#endregion
2327
- //#region ../../node_modules/.pnpm/ky@1.9.1/node_modules/ky/distribution/index.js
2317
+ //#region ../../node_modules/.pnpm/ky@1.10.0/node_modules/ky/distribution/index.js
2328
2318
  const createInstance = (defaults$1) => {
2329
2319
  const ky$1 = (input, options) => Ky.create(input, validateAndMerge(defaults$1, options));
2330
2320
  for (const method of requestMethods) ky$1[method] = (input, options) => Ky.create(input, validateAndMerge(defaults$1, options, { method }));
@@ -2390,8 +2380,7 @@ var require_ini$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ini@1
2390
2380
  var p = out;
2391
2381
  var section = null;
2392
2382
  var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
2393
- var lines = str.split(/[\r\n]+/g);
2394
- lines.forEach(function(line, _, __) {
2383
+ str.split(/[\r\n]+/g).forEach(function(line, _, __) {
2395
2384
  if (!line || line.match(/^\s*[;#]/)) return;
2396
2385
  var match = line.match(re);
2397
2386
  if (!match) return;
@@ -2497,8 +2486,7 @@ var require_strip_json_comments = /* @__PURE__ */ __commonJS({ "../../node_modul
2497
2486
  currentChar = str[i];
2498
2487
  nextChar = str[i + 1];
2499
2488
  if (!insideComment && currentChar === "\"") {
2500
- var escaped = str[i - 1] === "\\" && str[i - 2] !== "\\";
2501
- if (!escaped) insideString = !insideString;
2489
+ if (!(str[i - 1] === "\\" && str[i - 2] !== "\\")) insideString = !insideString;
2502
2490
  }
2503
2491
  if (insideString) continue;
2504
2492
  if (!insideComment && currentChar + nextChar === "//") {
@@ -2672,11 +2660,10 @@ var require_deep_extend = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
2672
2660
  var require_minimist = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js": ((exports, module) => {
2673
2661
  function hasKey(obj, keys) {
2674
2662
  var o = obj;
2675
- keys.slice(0, -1).forEach(function(key$1) {
2676
- o = o[key$1] || {};
2663
+ keys.slice(0, -1).forEach(function(key) {
2664
+ o = o[key] || {};
2677
2665
  });
2678
- var key = keys[keys.length - 1];
2679
- return key in o;
2666
+ return keys[keys.length - 1] in o;
2680
2667
  }
2681
2668
  function isNumber(x) {
2682
2669
  if (typeof x === "number") return true;
@@ -3139,8 +3126,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/g
3139
3126
  function chownErOk(er) {
3140
3127
  if (!er) return true;
3141
3128
  if (er.code === "ENOSYS") return true;
3142
- var nonroot = !process.getuid || process.getuid() !== 0;
3143
- if (nonroot) {
3129
+ if (!process.getuid || process.getuid() !== 0) {
3144
3130
  if (er.code === "EINVAL" || er.code === "EPERM") return true;
3145
3131
  }
3146
3132
  return false;
@@ -3628,8 +3614,7 @@ var require_ca_file = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pn
3628
3614
  try {
3629
3615
  const contents = graceful_fs_1.default.readFileSync(filePath, "utf8");
3630
3616
  const delim = "-----END CERTIFICATE-----";
3631
- const output = contents.split(delim).filter((ca) => Boolean(ca.trim())).map((ca) => `${ca.trimLeft()}${delim}`);
3632
- return output;
3617
+ return contents.split(delim).filter((ca) => Boolean(ca.trim())).map((ca) => `${ca.trimLeft()}${delim}`);
3633
3618
  } catch (err) {
3634
3619
  if (err.code === "ENOENT") return void 0;
3635
3620
  throw err;
@@ -3854,7 +3839,7 @@ var require_config_chain = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnp
3854
3839
  where = this.sources[where];
3855
3840
  if (where) where = where.data;
3856
3841
  if (where && Object.hasOwnProperty.call(where, key)) return where[key];
3857
- return void 0;
3842
+ return;
3858
3843
  }
3859
3844
  return this.list[0][key];
3860
3845
  };
@@ -4055,12 +4040,11 @@ var require_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnpm+
4055
4040
  case "true": return true;
4056
4041
  case "false": return false;
4057
4042
  case "null": return null;
4058
- case "undefined": return void 0;
4043
+ case "undefined": return;
4059
4044
  }
4060
4045
  field = envReplace(field, process.env);
4061
4046
  if (isPath) {
4062
- const regex = process.platform === "win32" ? /^~(\/|\\)/ : /^~\//;
4063
- if (regex.test(field) && process.env.HOME) field = path$6.resolve(process.env.HOME, field.substr(2));
4047
+ if ((process.platform === "win32" ? /^~(\/|\\)/ : /^~\//).test(field) && process.env.HOME) field = path$6.resolve(process.env.HOME, field.substr(2));
4064
4048
  field = path$6.resolve(field);
4065
4049
  }
4066
4050
  if (isNumber$1 && !isNaN(field)) field = Number(field);
@@ -4075,8 +4059,7 @@ var require_util = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnpm+
4075
4059
  }
4076
4060
  if (walkedUp) return name$1;
4077
4061
  const find = (name$2, original) => {
4078
- const regex = /^[a-zA-Z]:(\\|\/)?$/;
4079
- if (name$2 === "/" || process.platform === "win32" && regex.test(name$2)) return original;
4062
+ if (name$2 === "/" || process.platform === "win32" && /^[a-zA-Z]:(\\|\/)?$/.test(name$2)) return original;
4080
4063
  try {
4081
4064
  const files$1 = fs$3.readdirSync(name$2);
4082
4065
  if (files$1.includes("node_modules") || files$1.includes("package.json") || files$1.includes("package.json5") || files$1.includes("package.yaml") || files$1.includes("pnpm-workspace.yaml")) return name$2;
@@ -4349,8 +4332,7 @@ var require_conf = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnpm+
4349
4332
  this[g ? "globalPrefix" : "localPrefix"] = prefix;
4350
4333
  },
4351
4334
  get: () => {
4352
- const g = this.get("global");
4353
- return g ? this.globalPrefix : this.localPrefix;
4335
+ return this.get("global") ? this.globalPrefix : this.localPrefix;
4354
4336
  }
4355
4337
  });
4356
4338
  Object.defineProperty(this, "globalPrefix", {
@@ -4374,8 +4356,7 @@ var require_conf = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnpm+
4374
4356
  });
4375
4357
  if (Object.prototype.hasOwnProperty.call(cli, "prefix")) p = path$4.resolve(cli.prefix);
4376
4358
  else try {
4377
- const prefix = util.findPrefix(process.cwd());
4378
- p = prefix;
4359
+ p = util.findPrefix(process.cwd());
4379
4360
  } catch (error) {
4380
4361
  throw error;
4381
4362
  }
@@ -4395,8 +4376,7 @@ var require_conf = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnpm+
4395
4376
  }
4396
4377
  const prefix = path$4.resolve(this.get("prefix"));
4397
4378
  try {
4398
- const stats = fs$2.statSync(prefix);
4399
- defConf.user = stats.uid;
4379
+ defConf.user = fs$2.statSync(prefix).uid;
4400
4380
  } catch (error) {
4401
4381
  if (error.code === "ENOENT") return;
4402
4382
  throw error;
@@ -4673,13 +4653,11 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
4673
4653
  if (!options.recursive) return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(new URL("./", parsed), options);
4674
4654
  parsed.pathname = urlResolve(normalizePath(pathname), "..") || "/";
4675
4655
  }
4676
- return void 0;
4677
4656
  }
4678
4657
  function getLegacyAuthInfo(npmrc) {
4679
- if (!npmrc.get("_auth")) return void 0;
4680
- const token = replaceEnvironmentVariable(npmrc.get("_auth"));
4658
+ if (!npmrc.get("_auth")) return;
4681
4659
  return {
4682
- token,
4660
+ token: replaceEnvironmentVariable(npmrc.get("_auth")),
4683
4661
  type: "Basic"
4684
4662
  };
4685
4663
  }
@@ -4695,7 +4673,6 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
4695
4673
  if (basicAuth) return basicAuth;
4696
4674
  const basicAuthWithToken = getLegacyAuthToken(npmrc.get(regUrl + legacyTokenKey) || npmrc.get(regUrl + "/:_auth"));
4697
4675
  if (basicAuthWithToken) return basicAuthWithToken;
4698
- return void 0;
4699
4676
  }
4700
4677
  function replaceEnvironmentVariable(token) {
4701
4678
  return token.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) {
@@ -4703,29 +4680,26 @@ var require_registry_auth_token = /* @__PURE__ */ __commonJS({ "../../node_modul
4703
4680
  });
4704
4681
  }
4705
4682
  function getBearerToken(tok) {
4706
- if (!tok) return void 0;
4707
- const token = replaceEnvironmentVariable(tok);
4683
+ if (!tok) return;
4708
4684
  return {
4709
- token,
4685
+ token: replaceEnvironmentVariable(tok),
4710
4686
  type: "Bearer"
4711
4687
  };
4712
4688
  }
4713
4689
  function getTokenForUsernameAndPassword(username, password) {
4714
- if (!username || !password) return void 0;
4690
+ if (!username || !password) return;
4715
4691
  const pass = Buffer.from(replaceEnvironmentVariable(password), "base64").toString("utf8");
4716
- const token = Buffer.from(username + ":" + pass, "utf8").toString("base64");
4717
4692
  return {
4718
- token,
4693
+ token: Buffer.from(username + ":" + pass, "utf8").toString("base64"),
4719
4694
  type: "Basic",
4720
4695
  password: pass,
4721
4696
  username
4722
4697
  };
4723
4698
  }
4724
4699
  function getLegacyAuthToken(tok) {
4725
- if (!tok) return void 0;
4726
- const token = replaceEnvironmentVariable(tok);
4700
+ if (!tok) return;
4727
4701
  return {
4728
- token,
4702
+ token: replaceEnvironmentVariable(tok),
4729
4703
  type: "Basic"
4730
4704
  };
4731
4705
  }
@@ -5095,8 +5069,7 @@ function pupa(template, data, { ignoreMissing = false, transform: transform$1 =
5095
5069
  const composeHtmlEscape = (replacer) => (...args) => htmlEscape(replacer(...args));
5096
5070
  const doubleBraceRegex = /{{(\d+|[a-z$_][\w\-$]*?(?:\.[\w\-$]*?)*?)}}/gi;
5097
5071
  if (doubleBraceRegex.test(template)) template = template.replace(doubleBraceRegex, composeHtmlEscape(replace));
5098
- const braceRegex = /{(\d+|[a-z$_][\w\-$]*?(?:\.[\w\-$]*?)*?)}/gi;
5099
- return template.replace(braceRegex, replace);
5072
+ return template.replace(/{(\d+|[a-z$_][\w\-$]*?(?:\.[\w\-$]*?)*?)}/gi, replace);
5100
5073
  }
5101
5074
 
5102
5075
  //#endregion
@@ -5247,7 +5220,7 @@ var dependencies = {
5247
5220
  "commander": "^14.0.0",
5248
5221
  "diff": "^8.0.2",
5249
5222
  "esbuild": "^0.25.9",
5250
- "eslint": "^9.34.0",
5223
+ "eslint": "^9.35.0",
5251
5224
  "execa": "9.3.1",
5252
5225
  "glob": "^11.0.3",
5253
5226
  "https-proxy-agent": "^7.0.6",
@@ -5266,7 +5239,7 @@ var dependencies = {
5266
5239
  };
5267
5240
  var devDependencies = {
5268
5241
  "@types/prompts": "^2.4.9",
5269
- "@types/semver": "^7.7.0",
5242
+ "@types/semver": "^7.7.1",
5270
5243
  "@types/update-notifier": "6.0.8",
5271
5244
  "@types/validate-npm-package-name": "^4.0.2",
5272
5245
  "@types/yamljs": "^0.2.34",
@@ -5300,11 +5273,10 @@ var package_default = {
5300
5273
  async function lintText(content, { cwd: cwd$3, enabled = true, filePath } = {}) {
5301
5274
  if (!enabled) return content;
5302
5275
  try {
5303
- const eslint = new ESLint({
5276
+ const [result] = await new ESLint({
5304
5277
  cwd: cwd$3,
5305
5278
  fix: true
5306
- });
5307
- const [result] = await eslint.lintText(content, { filePath });
5279
+ }).lintText(content, { filePath });
5308
5280
  if (result?.output) content = result.output;
5309
5281
  return content;
5310
5282
  } catch {
@@ -5314,11 +5286,10 @@ async function lintText(content, { cwd: cwd$3, enabled = true, filePath } = {})
5314
5286
  async function lintFiles(patterns, { cwd: cwd$3, enabled = true } = {}) {
5315
5287
  if (!enabled) return;
5316
5288
  try {
5317
- const eslint = new ESLint({
5289
+ const results = await new ESLint({
5318
5290
  cwd: cwd$3,
5319
5291
  fix: true
5320
- });
5321
- const results = await eslint.lintFiles(patterns);
5292
+ }).lintFiles(patterns);
5322
5293
  await ESLint.outputFixes(results);
5323
5294
  } catch {}
5324
5295
  }
@@ -5374,8 +5345,7 @@ async function writeFileSafe(targetPath, content, options) {
5374
5345
  await writeFile$1(targetPath, content, options);
5375
5346
  }
5376
5347
  async function validateDir(path$9) {
5377
- const writeable = await isWriteable(path$9);
5378
- if (!writeable) throw new Error(`The path ${c.yellow(path$9)} does not writeable. Please check the permissions.`);
5348
+ if (!await isWriteable(path$9)) throw new Error(`The path ${c.yellow(path$9)} does not writeable. Please check the permissions.`);
5379
5349
  if (!existsSync(path$9)) throw new Error(`The path ${c.yellow(path$9)} does not exist. Please try again.`);
5380
5350
  if (!statSync(path$9).isDirectory()) throw new Error(`The path ${c.yellow(path$9)} is not a directory. Please try again.`);
5381
5351
  return true;
@@ -5410,8 +5380,7 @@ async function getFiles(pattern) {
5410
5380
  }));
5411
5381
  } else if (name$1 !== REGISTRY_FILE_NAME) {
5412
5382
  const targetPath = path$1.join(dirent.parentPath, dirent.name);
5413
- const data = await readFile(targetPath, "utf-8");
5414
- files$1[name$1] = data;
5383
+ files$1[name$1] = await readFile(targetPath, "utf-8");
5415
5384
  }
5416
5385
  }));
5417
5386
  return {
@@ -5519,17 +5488,13 @@ async function installDependencies(dependencies$1, { cwd: cwd$3, dev, exact = tr
5519
5488
  }
5520
5489
  async function uninstallDependencies(dependencies$1, { cwd: cwd$3 } = {}) {
5521
5490
  const packageManager = getPackageManager();
5522
- if (dependencies$1.length) {
5523
- const command = packageManager === "npm" ? "uninstall" : "remove";
5524
- await execa(packageManager, [command, ...dependencies$1], {
5525
- cwd: cwd$3,
5526
- stdout: "ignore"
5527
- });
5528
- }
5491
+ if (dependencies$1.length) await execa(packageManager, [packageManager === "npm" ? "uninstall" : "remove", ...dependencies$1], {
5492
+ cwd: cwd$3,
5493
+ stdout: "ignore"
5494
+ });
5529
5495
  }
5530
5496
  async function addWorkspace(cwd$3, workspacePath, config$1) {
5531
- const packageManager = getPackageManager();
5532
- switch (packageManager) {
5497
+ switch (getPackageManager()) {
5533
5498
  case "pnpm": {
5534
5499
  const targetPath = path$1.resolve(cwd$3, "pnpm-workspace.yaml");
5535
5500
  if (existsSync(targetPath)) {
@@ -5598,8 +5563,7 @@ async function getConfig(cwd$3, configPath, { format: format$2, jsx, lint } = {}
5598
5563
  const src = existsSync(path$1.resolve(rootPath, "src"));
5599
5564
  const srcPath = src ? path$1.resolve(rootPath, "src") : rootPath;
5600
5565
  const sectionMap = Object.fromEntries(SECTION_NAMES.map((section) => {
5601
- const path$9 = userConfig[section]?.path ?? DEFAULT_PATH[section];
5602
- const replacedSection = path$9.replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
5566
+ const replacedSection = (userConfig[section]?.path ?? DEFAULT_PATH[section]).replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
5603
5567
  return [section, replacedSection];
5604
5568
  }));
5605
5569
  const indexPath = path$1.resolve(srcPath, transformExtension("index.ts", userConfig.jsx));
@@ -5787,8 +5751,7 @@ async function getGeneratedNameMap(config$1) {
5787
5751
  return Object.fromEntries(results);
5788
5752
  }
5789
5753
  function transformContent(targetSection, content, { getSection }, generatedNames) {
5790
- const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
5791
- matches.forEach((match) => {
5754
+ content.matchAll(/from\s+["']([^"']+)["']/g).forEach((match) => {
5792
5755
  const [searchValue, value] = match;
5793
5756
  if (!value) return;
5794
5757
  const relative = value.includes("..");
@@ -5812,16 +5775,14 @@ function transformContent(targetSection, content, { getSection }, generatedNames
5812
5775
  if (depth === 1) if (generated) replaceValue = `from "${path$1.join("..", name$1)}"`;
5813
5776
  else replaceValue = `from "@yamada-ui/react/${targetSection}/${name$1}"`;
5814
5777
  else {
5815
- const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
5816
- const query = omittedValue.split("/").slice(0, -1).join("/");
5778
+ const query = value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/");
5817
5779
  const { path: sectionPath, section } = getSection(query) ?? {};
5818
5780
  if (!section || !sectionPath) return;
5819
5781
  if (generated) {
5820
5782
  const targetDepth = (sectionPath.match(/\.\.\//g) || []).length;
5821
5783
  const neededDepth = depth + targetDepth;
5822
5784
  const omittedTargetPath = sectionPath.replace(/(\.\.\/|\.\/)/g, "");
5823
- const position = "../".repeat(neededDepth);
5824
- replaceValue = `from "${position}${omittedTargetPath}/${name$1}"`;
5785
+ replaceValue = `from "${"../".repeat(neededDepth)}${omittedTargetPath}/${name$1}"`;
5825
5786
  } else replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
5826
5787
  }
5827
5788
  }
@@ -5849,8 +5810,7 @@ function transformTemplateContent(template, data) {
5849
5810
  return content;
5850
5811
  }
5851
5812
  function transformIndex(generatedNames, content, { getSection }) {
5852
- const matches = content.matchAll(/from\s+["']([^"']+)["']/g);
5853
- matches.forEach((match) => {
5813
+ content.matchAll(/from\s+["']([^"']+)["']/g).forEach((match) => {
5854
5814
  const [searchValue, value] = match;
5855
5815
  if (!value) return;
5856
5816
  const name$1 = value.split("/").at(-1);
@@ -5863,8 +5823,7 @@ function transformIndex(generatedNames, content, { getSection }) {
5863
5823
  if (!path$9) return;
5864
5824
  replaceValue = `from "${path$9}/${name$1}"`;
5865
5825
  } else {
5866
- const omittedValue = value.replace(/(\.\.\/|\.\/)/g, "");
5867
- const query = omittedValue.split("/").slice(0, -1).join("/");
5826
+ const query = value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/");
5868
5827
  const { section } = getSection(query) ?? {};
5869
5828
  if (!section) return;
5870
5829
  replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
@@ -6198,7 +6157,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
6198
6157
  remove: [],
6199
6158
  update: []
6200
6159
  };
6201
- const tasks = new Listr(Object.entries(remote).map(([componentName, { dependencies: dependencies$1, section, sources }]) => ({
6160
+ await new Listr(Object.entries(remote).map(([componentName, { dependencies: dependencies$1, section, sources }]) => ({
6202
6161
  task: async (_, task) => {
6203
6162
  const localeRegistry = locale[componentName];
6204
6163
  if (componentName === "index") {
@@ -6299,8 +6258,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
6299
6258
  }
6300
6259
  }));
6301
6260
  }));
6302
- const removeSources = localeRegistry.sources.filter(({ name: name$1 }) => !sources.some((source) => source.name === name$1));
6303
- removeSources.forEach(({ name: name$1, content, data, template }) => {
6261
+ localeRegistry.sources.filter(({ name: name$1 }) => !sources.some((source) => source.name === name$1)).forEach(({ name: name$1, content, data, template }) => {
6304
6262
  if (content) {
6305
6263
  let locale$1 = transformContent(section, content, config$1, generatedNames);
6306
6264
  if (config$1.jsx) locale$1 = isJsx(name$1) ? transformTsxToJsx(locale$1) : transformTsToJs(locale$1);
@@ -6335,8 +6293,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
6335
6293
  task.title = `Checked ${c.cyan(componentName)}`;
6336
6294
  },
6337
6295
  title: `Checking ${c.cyan(componentName)}`
6338
- })), { concurrent });
6339
- await tasks.run();
6296
+ })), { concurrent }).run();
6340
6297
  return {
6341
6298
  changeMap,
6342
6299
  dependencyMap
@@ -6377,7 +6334,7 @@ async function updateFiles(changeMap, { add: add$1, remove, update: update$1 },
6377
6334
  format: { enabled: false },
6378
6335
  lint: { enabled: false }
6379
6336
  };
6380
- const tasks = new Listr(Object.entries(changeMap).map(([componentName, changes]) => ({
6337
+ await new Listr(Object.entries(changeMap).map(([componentName, changes]) => ({
6381
6338
  task: async (_, task) => {
6382
6339
  const tempDirPath = await mkdtemp(path$1.join(tmpdir(), `yamada-ui-${componentName}-`));
6383
6340
  const registry = remote[componentName];
@@ -6418,8 +6375,7 @@ async function updateFiles(changeMap, { add: add$1, remove, update: update$1 },
6418
6375
  task.title = `Changed ${c.cyan(componentName)}`;
6419
6376
  },
6420
6377
  title: `Changing ${c.cyan(componentName)}`
6421
- })), { concurrent });
6422
- await tasks.run();
6378
+ })), { concurrent }).run();
6423
6379
  if (!install && (add$1.length || remove.length || update$1.length)) {
6424
6380
  const { install: install$1 } = await prompts({
6425
6381
  type: "confirm",
@@ -6459,8 +6415,7 @@ async function getRegistriesAndFiles(componentNames, config$1, { concurrent = tr
6459
6415
  const tasks = new Listr([], { concurrent });
6460
6416
  if (index) tasks.add([{
6461
6417
  task: async (_, task) => {
6462
- const indexFileName = transformExtension("index.ts", config$1.jsx);
6463
- fileMap.index = { [indexFileName]: await readFile(config$1.indexPath, "utf-8") };
6418
+ fileMap.index = { [transformExtension("index.ts", config$1.jsx)]: await readFile(config$1.indexPath, "utf-8") };
6464
6419
  registryMap.locale.index = await fetchLocaleRegistry(config$1.registryPath);
6465
6420
  task.title = `Got ${c.cyan("index")} file`;
6466
6421
  },
@@ -6817,7 +6772,7 @@ const init = new Command("init").description("initialize your project and instal
6817
6772
  } else {
6818
6773
  const notInstalledDependencies = [];
6819
6774
  const notInstalledDevDependencies = [];
6820
- const tasks = new Listr([{
6775
+ await new Listr([{
6821
6776
  task: async (_, task) => {
6822
6777
  const packageJson$2 = await getPackageJson(cwd$3);
6823
6778
  notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, [...REQUIRED_DEPENDENCIES, "@yamada-ui/react@dev"]));
@@ -6834,8 +6789,7 @@ const init = new Command("init").description("initialize your project and instal
6834
6789
  task.title = `Generated ${c.cyan(indexFileName)}`;
6835
6790
  },
6836
6791
  title: `Generating ${c.cyan(indexFileName)}`
6837
- }], { concurrent: true });
6838
- await tasks.run();
6792
+ }], { concurrent: true }).run();
6839
6793
  if (notInstalledDependencies.length || notInstalledDevDependencies.length) {
6840
6794
  const colorizedNames = [...notInstalledDependencies, ...notInstalledDevDependencies].map((value) => c.cyan(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
6841
6795
  const { install } = await prompts({
@@ -6914,7 +6868,7 @@ const theme = new Command("theme").description("generate theme to your project")
6914
6868
  spinner.start("Fetching registry");
6915
6869
  const registry = await fetchRegistry("theme");
6916
6870
  spinner.succeed("Fetched registry");
6917
- const tasks = new Listr([{
6871
+ await new Listr([{
6918
6872
  task: async (_, task) => {
6919
6873
  await Promise.all([...registry.sources.map(async ({ name: name$1, content }) => {
6920
6874
  if (!content) return;
@@ -6937,8 +6891,7 @@ const theme = new Command("theme").description("generate theme to your project")
6937
6891
  task.title = `Updated config`;
6938
6892
  },
6939
6893
  title: `Updating config`
6940
- }], { concurrent: true });
6941
- await tasks.run();
6894
+ }], { concurrent: true }).run();
6942
6895
  end();
6943
6896
  } catch (e) {
6944
6897
  if (e instanceof Error) spinner.fail(e.message);
@@ -7129,9 +7082,8 @@ function generateThemeTokens(theme$1, { internal = false, theme: { responsive =
7129
7082
  async function getTheme(path$9, cwd$3) {
7130
7083
  const { dependencies: dependencies$1, mod } = await getModule(path$9, cwd$3);
7131
7084
  const theme$1 = mod?.default ?? mod?.theme ?? mod?.customTheme ?? mod?.defaultTheme ?? {};
7132
- const config$1 = mod?.config ?? mod?.customConfig ?? mod?.defaultConfig ?? {};
7133
7085
  return {
7134
- config: config$1,
7086
+ config: mod?.config ?? mod?.customConfig ?? mod?.defaultConfig ?? {},
7135
7087
  dependencies: dependencies$1,
7136
7088
  theme: theme$1
7137
7089
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yamada-ui/cli",
3
3
  "type": "module",
4
- "version": "2.0.0-dev-20250908163631",
4
+ "version": "2.0.0-dev-20250911064237",
5
5
  "description": "The official CLI for Yamada UI projects",
6
6
  "keywords": [
7
7
  "theme",
@@ -41,7 +41,7 @@
41
41
  "commander": "^14.0.0",
42
42
  "diff": "^8.0.2",
43
43
  "esbuild": "^0.25.9",
44
- "eslint": "^9.34.0",
44
+ "eslint": "^9.35.0",
45
45
  "execa": "9.3.1",
46
46
  "glob": "^11.0.3",
47
47
  "https-proxy-agent": "^7.0.6",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/prompts": "^2.4.9",
64
- "@types/semver": "^7.7.0",
64
+ "@types/semver": "^7.7.1",
65
65
  "@types/update-notifier": "6.0.8",
66
66
  "@types/validate-npm-package-name": "^4.0.2",
67
67
  "@types/yamljs": "^0.2.34",