@yamada-ui/cli 2.0.0-dev-20250908131135 → 2.0.0-dev-20250908165653
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +121 -171
- 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
|
-
|
|
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
|
-
|
|
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
|
|
1070
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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:
|
|
2099
|
-
|
|
2100
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
2205
|
-
|
|
2206
|
-
if (
|
|
2207
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2676
|
-
o = o[key
|
|
2663
|
+
keys.slice(0, -1).forEach(function(key) {
|
|
2664
|
+
o = o[key] || {};
|
|
2677
2665
|
});
|
|
2678
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
4043
|
+
case "undefined": return;
|
|
4059
4044
|
}
|
|
4060
4045
|
field = envReplace(field, process.env);
|
|
4061
4046
|
if (isPath) {
|
|
4062
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -5368,16 +5339,13 @@ async function writeFile$1(path$9, content, options = {}) {
|
|
|
5368
5339
|
});
|
|
5369
5340
|
await formatFiles(path$9, options.format);
|
|
5370
5341
|
}
|
|
5371
|
-
async function writeFileSafe(
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
}
|
|
5376
|
-
await writeFile$1(path$9, content, options);
|
|
5342
|
+
async function writeFileSafe(targetPath, content, options) {
|
|
5343
|
+
const dirPath = path$1.dirname(targetPath);
|
|
5344
|
+
if (!existsSync(dirPath)) await mkdir(dirPath, { recursive: true });
|
|
5345
|
+
await writeFile$1(targetPath, content, options);
|
|
5377
5346
|
}
|
|
5378
5347
|
async function validateDir(path$9) {
|
|
5379
|
-
|
|
5380
|
-
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.`);
|
|
5381
5349
|
if (!existsSync(path$9)) throw new Error(`The path ${c.yellow(path$9)} does not exist. Please try again.`);
|
|
5382
5350
|
if (!statSync(path$9).isDirectory()) throw new Error(`The path ${c.yellow(path$9)} is not a directory. Please try again.`);
|
|
5383
5351
|
return true;
|
|
@@ -5412,8 +5380,7 @@ async function getFiles(pattern) {
|
|
|
5412
5380
|
}));
|
|
5413
5381
|
} else if (name$1 !== REGISTRY_FILE_NAME) {
|
|
5414
5382
|
const targetPath = path$1.join(dirent.parentPath, dirent.name);
|
|
5415
|
-
|
|
5416
|
-
files$1[name$1] = data;
|
|
5383
|
+
files$1[name$1] = await readFile(targetPath, "utf-8");
|
|
5417
5384
|
}
|
|
5418
5385
|
}));
|
|
5419
5386
|
return {
|
|
@@ -5521,17 +5488,13 @@ async function installDependencies(dependencies$1, { cwd: cwd$3, dev, exact = tr
|
|
|
5521
5488
|
}
|
|
5522
5489
|
async function uninstallDependencies(dependencies$1, { cwd: cwd$3 } = {}) {
|
|
5523
5490
|
const packageManager = getPackageManager();
|
|
5524
|
-
if (dependencies$1.length) {
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
stdout: "ignore"
|
|
5529
|
-
});
|
|
5530
|
-
}
|
|
5491
|
+
if (dependencies$1.length) await execa(packageManager, [packageManager === "npm" ? "uninstall" : "remove", ...dependencies$1], {
|
|
5492
|
+
cwd: cwd$3,
|
|
5493
|
+
stdout: "ignore"
|
|
5494
|
+
});
|
|
5531
5495
|
}
|
|
5532
5496
|
async function addWorkspace(cwd$3, workspacePath, config$1) {
|
|
5533
|
-
|
|
5534
|
-
switch (packageManager) {
|
|
5497
|
+
switch (getPackageManager()) {
|
|
5535
5498
|
case "pnpm": {
|
|
5536
5499
|
const targetPath = path$1.resolve(cwd$3, "pnpm-workspace.yaml");
|
|
5537
5500
|
if (existsSync(targetPath)) {
|
|
@@ -5600,8 +5563,7 @@ async function getConfig(cwd$3, configPath, { format: format$2, jsx, lint } = {}
|
|
|
5600
5563
|
const src = existsSync(path$1.resolve(rootPath, "src"));
|
|
5601
5564
|
const srcPath = src ? path$1.resolve(rootPath, "src") : rootPath;
|
|
5602
5565
|
const sectionMap = Object.fromEntries(SECTION_NAMES.map((section) => {
|
|
5603
|
-
const
|
|
5604
|
-
const replacedSection = path$9.replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
|
|
5566
|
+
const replacedSection = (userConfig[section]?.path ?? DEFAULT_PATH[section]).replace(/(\.\.\/|\.\/)/g, "").replace(/(^\/|\/$)/g, "");
|
|
5605
5567
|
return [section, replacedSection];
|
|
5606
5568
|
}));
|
|
5607
5569
|
const indexPath = path$1.resolve(srcPath, transformExtension("index.ts", userConfig.jsx));
|
|
@@ -5706,11 +5668,11 @@ async function getModule(file$1, cwd$3) {
|
|
|
5706
5668
|
const agent = process.env.https_proxy ? new HttpsProxyAgent(process.env.https_proxy) : void 0;
|
|
5707
5669
|
const registryStore = /* @__PURE__ */ new Map();
|
|
5708
5670
|
function getRegistryUrl(name$1) {
|
|
5709
|
-
if (name$1 === "index") return path$1.join(REGISTRY_URL, "index.json");
|
|
5710
|
-
else if (name$1 === "theme") return path$1.join(REGISTRY_URL, "theme.json");
|
|
5711
|
-
else if (name$1.startsWith("use-")) return path$1.join(REGISTRY_URL, "hooks", `${name$1}.json`);
|
|
5712
|
-
else if (name$1.endsWith("-provider")) return path$1.join(REGISTRY_URL, "providers", `${name$1}.json`);
|
|
5713
|
-
else return path$1.join(REGISTRY_URL, "components", `${name$1}.json`);
|
|
5671
|
+
if (name$1 === "index") return path$1.posix.join(REGISTRY_URL, "index.json");
|
|
5672
|
+
else if (name$1 === "theme") return path$1.posix.join(REGISTRY_URL, "theme.json");
|
|
5673
|
+
else if (name$1.startsWith("use-")) return path$1.posix.join(REGISTRY_URL, "hooks", `${name$1}.json`);
|
|
5674
|
+
else if (name$1.endsWith("-provider")) return path$1.posix.join(REGISTRY_URL, "providers", `${name$1}.json`);
|
|
5675
|
+
else return path$1.posix.join(REGISTRY_URL, "components", `${name$1}.json`);
|
|
5714
5676
|
}
|
|
5715
5677
|
async function fetchRegistryNames() {
|
|
5716
5678
|
const { sources } = await fetchRegistry("index");
|
|
@@ -5789,8 +5751,7 @@ async function getGeneratedNameMap(config$1) {
|
|
|
5789
5751
|
return Object.fromEntries(results);
|
|
5790
5752
|
}
|
|
5791
5753
|
function transformContent(targetSection, content, { getSection }, generatedNames) {
|
|
5792
|
-
|
|
5793
|
-
matches.forEach((match) => {
|
|
5754
|
+
content.matchAll(/from\s+["']([^"']+)["']/g).forEach((match) => {
|
|
5794
5755
|
const [searchValue, value] = match;
|
|
5795
5756
|
if (!value) return;
|
|
5796
5757
|
const relative = value.includes("..");
|
|
@@ -5814,16 +5775,14 @@ function transformContent(targetSection, content, { getSection }, generatedNames
|
|
|
5814
5775
|
if (depth === 1) if (generated) replaceValue = `from "${path$1.join("..", name$1)}"`;
|
|
5815
5776
|
else replaceValue = `from "@yamada-ui/react/${targetSection}/${name$1}"`;
|
|
5816
5777
|
else {
|
|
5817
|
-
const
|
|
5818
|
-
const query = omittedValue.split("/").slice(0, -1).join("/");
|
|
5778
|
+
const query = value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/");
|
|
5819
5779
|
const { path: sectionPath, section } = getSection(query) ?? {};
|
|
5820
5780
|
if (!section || !sectionPath) return;
|
|
5821
5781
|
if (generated) {
|
|
5822
5782
|
const targetDepth = (sectionPath.match(/\.\.\//g) || []).length;
|
|
5823
5783
|
const neededDepth = depth + targetDepth;
|
|
5824
5784
|
const omittedTargetPath = sectionPath.replace(/(\.\.\/|\.\/)/g, "");
|
|
5825
|
-
|
|
5826
|
-
replaceValue = `from "${position}${omittedTargetPath}/${name$1}"`;
|
|
5785
|
+
replaceValue = `from "${"../".repeat(neededDepth)}${omittedTargetPath}/${name$1}"`;
|
|
5827
5786
|
} else replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
5828
5787
|
}
|
|
5829
5788
|
}
|
|
@@ -5851,8 +5810,7 @@ function transformTemplateContent(template, data) {
|
|
|
5851
5810
|
return content;
|
|
5852
5811
|
}
|
|
5853
5812
|
function transformIndex(generatedNames, content, { getSection }) {
|
|
5854
|
-
|
|
5855
|
-
matches.forEach((match) => {
|
|
5813
|
+
content.matchAll(/from\s+["']([^"']+)["']/g).forEach((match) => {
|
|
5856
5814
|
const [searchValue, value] = match;
|
|
5857
5815
|
if (!value) return;
|
|
5858
5816
|
const name$1 = value.split("/").at(-1);
|
|
@@ -5865,8 +5823,7 @@ function transformIndex(generatedNames, content, { getSection }) {
|
|
|
5865
5823
|
if (!path$9) return;
|
|
5866
5824
|
replaceValue = `from "${path$9}/${name$1}"`;
|
|
5867
5825
|
} else {
|
|
5868
|
-
const
|
|
5869
|
-
const query = omittedValue.split("/").slice(0, -1).join("/");
|
|
5826
|
+
const query = value.replace(/(\.\.\/|\.\/)/g, "").split("/").slice(0, -1).join("/");
|
|
5870
5827
|
const { section } = getSection(query) ?? {};
|
|
5871
5828
|
if (!section) return;
|
|
5872
5829
|
replaceValue = `from "@yamada-ui/react/${section}/${name$1}"`;
|
|
@@ -6200,7 +6157,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
|
|
|
6200
6157
|
remove: [],
|
|
6201
6158
|
update: []
|
|
6202
6159
|
};
|
|
6203
|
-
|
|
6160
|
+
await new Listr(Object.entries(remote).map(([componentName, { dependencies: dependencies$1, section, sources }]) => ({
|
|
6204
6161
|
task: async (_, task) => {
|
|
6205
6162
|
const localeRegistry = locale[componentName];
|
|
6206
6163
|
if (componentName === "index") {
|
|
@@ -6301,8 +6258,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
|
|
|
6301
6258
|
}
|
|
6302
6259
|
}));
|
|
6303
6260
|
}));
|
|
6304
|
-
|
|
6305
|
-
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 }) => {
|
|
6306
6262
|
if (content) {
|
|
6307
6263
|
let locale$1 = transformContent(section, content, config$1, generatedNames);
|
|
6308
6264
|
if (config$1.jsx) locale$1 = isJsx(name$1) ? transformTsxToJsx(locale$1) : transformTsToJs(locale$1);
|
|
@@ -6337,8 +6293,7 @@ async function getDiff(generatedNames, { locale, remote }, config$1, concurrent
|
|
|
6337
6293
|
task.title = `Checked ${c.cyan(componentName)}`;
|
|
6338
6294
|
},
|
|
6339
6295
|
title: `Checking ${c.cyan(componentName)}`
|
|
6340
|
-
})), { concurrent });
|
|
6341
|
-
await tasks.run();
|
|
6296
|
+
})), { concurrent }).run();
|
|
6342
6297
|
return {
|
|
6343
6298
|
changeMap,
|
|
6344
6299
|
dependencyMap
|
|
@@ -6379,7 +6334,7 @@ async function updateFiles(changeMap, { add: add$1, remove, update: update$1 },
|
|
|
6379
6334
|
format: { enabled: false },
|
|
6380
6335
|
lint: { enabled: false }
|
|
6381
6336
|
};
|
|
6382
|
-
|
|
6337
|
+
await new Listr(Object.entries(changeMap).map(([componentName, changes]) => ({
|
|
6383
6338
|
task: async (_, task) => {
|
|
6384
6339
|
const tempDirPath = await mkdtemp(path$1.join(tmpdir(), `yamada-ui-${componentName}-`));
|
|
6385
6340
|
const registry = remote[componentName];
|
|
@@ -6420,8 +6375,7 @@ async function updateFiles(changeMap, { add: add$1, remove, update: update$1 },
|
|
|
6420
6375
|
task.title = `Changed ${c.cyan(componentName)}`;
|
|
6421
6376
|
},
|
|
6422
6377
|
title: `Changing ${c.cyan(componentName)}`
|
|
6423
|
-
})), { concurrent });
|
|
6424
|
-
await tasks.run();
|
|
6378
|
+
})), { concurrent }).run();
|
|
6425
6379
|
if (!install && (add$1.length || remove.length || update$1.length)) {
|
|
6426
6380
|
const { install: install$1 } = await prompts({
|
|
6427
6381
|
type: "confirm",
|
|
@@ -6461,8 +6415,7 @@ async function getRegistriesAndFiles(componentNames, config$1, { concurrent = tr
|
|
|
6461
6415
|
const tasks = new Listr([], { concurrent });
|
|
6462
6416
|
if (index) tasks.add([{
|
|
6463
6417
|
task: async (_, task) => {
|
|
6464
|
-
|
|
6465
|
-
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") };
|
|
6466
6419
|
registryMap.locale.index = await fetchLocaleRegistry(config$1.registryPath);
|
|
6467
6420
|
task.title = `Got ${c.cyan("index")} file`;
|
|
6468
6421
|
},
|
|
@@ -6819,7 +6772,7 @@ const init = new Command("init").description("initialize your project and instal
|
|
|
6819
6772
|
} else {
|
|
6820
6773
|
const notInstalledDependencies = [];
|
|
6821
6774
|
const notInstalledDevDependencies = [];
|
|
6822
|
-
|
|
6775
|
+
await new Listr([{
|
|
6823
6776
|
task: async (_, task) => {
|
|
6824
6777
|
const packageJson$2 = await getPackageJson(cwd$3);
|
|
6825
6778
|
notInstalledDependencies.push(...getNotInstalledDependencies(packageJson$2, [...REQUIRED_DEPENDENCIES, "@yamada-ui/react@dev"]));
|
|
@@ -6836,8 +6789,7 @@ const init = new Command("init").description("initialize your project and instal
|
|
|
6836
6789
|
task.title = `Generated ${c.cyan(indexFileName)}`;
|
|
6837
6790
|
},
|
|
6838
6791
|
title: `Generating ${c.cyan(indexFileName)}`
|
|
6839
|
-
}], { concurrent: true });
|
|
6840
|
-
await tasks.run();
|
|
6792
|
+
}], { concurrent: true }).run();
|
|
6841
6793
|
if (notInstalledDependencies.length || notInstalledDevDependencies.length) {
|
|
6842
6794
|
const colorizedNames = [...notInstalledDependencies, ...notInstalledDevDependencies].map((value) => c.cyan(isObject(value) ? value.current ? `${value.name}@${value.current}->${c.red(value.wanted)}` : value.name : value));
|
|
6843
6795
|
const { install } = await prompts({
|
|
@@ -6916,7 +6868,7 @@ const theme = new Command("theme").description("generate theme to your project")
|
|
|
6916
6868
|
spinner.start("Fetching registry");
|
|
6917
6869
|
const registry = await fetchRegistry("theme");
|
|
6918
6870
|
spinner.succeed("Fetched registry");
|
|
6919
|
-
|
|
6871
|
+
await new Listr([{
|
|
6920
6872
|
task: async (_, task) => {
|
|
6921
6873
|
await Promise.all([...registry.sources.map(async ({ name: name$1, content }) => {
|
|
6922
6874
|
if (!content) return;
|
|
@@ -6939,8 +6891,7 @@ const theme = new Command("theme").description("generate theme to your project")
|
|
|
6939
6891
|
task.title = `Updated config`;
|
|
6940
6892
|
},
|
|
6941
6893
|
title: `Updating config`
|
|
6942
|
-
}], { concurrent: true });
|
|
6943
|
-
await tasks.run();
|
|
6894
|
+
}], { concurrent: true }).run();
|
|
6944
6895
|
end();
|
|
6945
6896
|
} catch (e) {
|
|
6946
6897
|
if (e instanceof Error) spinner.fail(e.message);
|
|
@@ -7131,9 +7082,8 @@ function generateThemeTokens(theme$1, { internal = false, theme: { responsive =
|
|
|
7131
7082
|
async function getTheme(path$9, cwd$3) {
|
|
7132
7083
|
const { dependencies: dependencies$1, mod } = await getModule(path$9, cwd$3);
|
|
7133
7084
|
const theme$1 = mod?.default ?? mod?.theme ?? mod?.customTheme ?? mod?.defaultTheme ?? {};
|
|
7134
|
-
const config$1 = mod?.config ?? mod?.customConfig ?? mod?.defaultConfig ?? {};
|
|
7135
7085
|
return {
|
|
7136
|
-
config: config
|
|
7086
|
+
config: mod?.config ?? mod?.customConfig ?? mod?.defaultConfig ?? {},
|
|
7137
7087
|
dependencies: dependencies$1,
|
|
7138
7088
|
theme: theme$1
|
|
7139
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-
|
|
4
|
+
"version": "2.0.0-dev-20250908165653",
|
|
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.
|
|
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.
|
|
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",
|