@yamada-ui/cli 2.0.0-dev-20251006130455 → 2.0.0-dev-20251007020753
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 +133 -108
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1311,7 +1311,7 @@ function hasProperty(object, path$9) {
|
|
|
1311
1311
|
}
|
|
1312
1312
|
|
|
1313
1313
|
//#endregion
|
|
1314
|
-
//#region ../../node_modules/.pnpm/configstore@7.
|
|
1314
|
+
//#region ../../node_modules/.pnpm/configstore@7.1.0/node_modules/configstore/index.js
|
|
1315
1315
|
function getConfigDirectory(id, globalConfigPath) {
|
|
1316
1316
|
const pathPrefix = globalConfigPath ? path.join(id, "config.json") : path.join("configstore", `${id}.json`);
|
|
1317
1317
|
const configDirectory = xdgConfig ?? import_graceful_fs.default.mkdtempSync(import_graceful_fs.default.realpathSync(os.tmpdir()) + path.sep);
|
|
@@ -1323,9 +1323,14 @@ const mkdirOptions = {
|
|
|
1323
1323
|
recursive: true
|
|
1324
1324
|
};
|
|
1325
1325
|
const writeFileOptions = { mode: 384 };
|
|
1326
|
+
function handlePermissionError(error) {
|
|
1327
|
+
if (error.code === "EACCES") error.message = `${error.message}\n${permissionError}\n`;
|
|
1328
|
+
throw error;
|
|
1329
|
+
}
|
|
1326
1330
|
var Configstore = class {
|
|
1327
1331
|
constructor(id, defaults$1, options = {}) {
|
|
1328
1332
|
this._path = options.configPath ?? getConfigDirectory(id, options.globalConfigPath);
|
|
1333
|
+
this._clearInvalidConfig = options.clearInvalidConfig ?? true;
|
|
1329
1334
|
if (defaults$1) this.all = {
|
|
1330
1335
|
...defaults$1,
|
|
1331
1336
|
...this.all
|
|
@@ -1336,12 +1341,16 @@ var Configstore = class {
|
|
|
1336
1341
|
return JSON.parse(import_graceful_fs.default.readFileSync(this._path, "utf8"));
|
|
1337
1342
|
} catch (error) {
|
|
1338
1343
|
if (error.code === "ENOENT") return {};
|
|
1339
|
-
if (error.code === "EACCES") error.message = `${error.message}\n${permissionError}\n`;
|
|
1340
1344
|
if (error.name === "SyntaxError") {
|
|
1341
|
-
|
|
1342
|
-
|
|
1345
|
+
if (this._clearInvalidConfig) {
|
|
1346
|
+
writeFileSync(this._path, "", writeFileOptions);
|
|
1347
|
+
return {};
|
|
1348
|
+
}
|
|
1349
|
+
throw error;
|
|
1343
1350
|
}
|
|
1344
|
-
|
|
1351
|
+
handlePermissionError(error);
|
|
1352
|
+
/* c8 ignore next */
|
|
1353
|
+
return {};
|
|
1345
1354
|
}
|
|
1346
1355
|
}
|
|
1347
1356
|
set all(value) {
|
|
@@ -1349,8 +1358,7 @@ var Configstore = class {
|
|
|
1349
1358
|
import_graceful_fs.default.mkdirSync(path.dirname(this._path), mkdirOptions);
|
|
1350
1359
|
writeFileSync(this._path, JSON.stringify(value, void 0, " "), writeFileOptions);
|
|
1351
1360
|
} catch (error) {
|
|
1352
|
-
|
|
1353
|
-
throw error;
|
|
1361
|
+
handlePermissionError(error);
|
|
1354
1362
|
}
|
|
1355
1363
|
}
|
|
1356
1364
|
get size() {
|
|
@@ -1361,7 +1369,7 @@ var Configstore = class {
|
|
|
1361
1369
|
}
|
|
1362
1370
|
set(key, value) {
|
|
1363
1371
|
const config$1 = this.all;
|
|
1364
|
-
if (arguments.length === 1) for (const k of Object.keys(key)) setProperty(config$1, k, key[k]);
|
|
1372
|
+
if (typeof key === "object" && arguments.length === 1) for (const k of Object.keys(key)) setProperty(config$1, k, key[k]);
|
|
1365
1373
|
else setProperty(config$1, key, value);
|
|
1366
1374
|
this.all = config$1;
|
|
1367
1375
|
}
|
|
@@ -1792,14 +1800,14 @@ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
1792
1800
|
var source_default = chalk;
|
|
1793
1801
|
|
|
1794
1802
|
//#endregion
|
|
1795
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1803
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/errors/HTTPError.js
|
|
1796
1804
|
var HTTPError = class extends Error {
|
|
1797
1805
|
response;
|
|
1798
1806
|
request;
|
|
1799
1807
|
options;
|
|
1800
1808
|
constructor(response, request, options) {
|
|
1801
1809
|
const code = response.status || response.status === 0 ? response.status : "";
|
|
1802
|
-
const title = response.statusText
|
|
1810
|
+
const title = response.statusText ?? "";
|
|
1803
1811
|
const status = `${code} ${title}`.trim();
|
|
1804
1812
|
const reason = status ? `status code ${status}` : "an unknown error";
|
|
1805
1813
|
super(`Request failed with ${reason}: ${request.method} ${request.url}`);
|
|
@@ -1811,7 +1819,7 @@ var HTTPError = class extends Error {
|
|
|
1811
1819
|
};
|
|
1812
1820
|
|
|
1813
1821
|
//#endregion
|
|
1814
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1822
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/errors/TimeoutError.js
|
|
1815
1823
|
var TimeoutError = class extends Error {
|
|
1816
1824
|
request;
|
|
1817
1825
|
constructor(request) {
|
|
@@ -1822,7 +1830,7 @@ var TimeoutError = class extends Error {
|
|
|
1822
1830
|
};
|
|
1823
1831
|
|
|
1824
1832
|
//#endregion
|
|
1825
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1833
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/core/constants.js
|
|
1826
1834
|
const supportsRequestStreams = (() => {
|
|
1827
1835
|
let duplexAccessed = false;
|
|
1828
1836
|
let hasContentType = false;
|
|
@@ -1902,7 +1910,7 @@ const requestOptionsRegistry = {
|
|
|
1902
1910
|
};
|
|
1903
1911
|
|
|
1904
1912
|
//#endregion
|
|
1905
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1913
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/body.js
|
|
1906
1914
|
const getBodySize = (body) => {
|
|
1907
1915
|
if (!body) return 0;
|
|
1908
1916
|
if (body instanceof FormData) {
|
|
@@ -1927,93 +1935,65 @@ const getBodySize = (body) => {
|
|
|
1927
1935
|
}
|
|
1928
1936
|
return 0;
|
|
1929
1937
|
};
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1938
|
+
const withProgress = (stream, totalBytes, onProgress) => {
|
|
1939
|
+
let previousChunk;
|
|
1932
1940
|
let transferredBytes = 0;
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
statusText: response.statusText,
|
|
1942
|
-
headers: response.headers
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
return new Response(new ReadableStream({ async start(controller) {
|
|
1946
|
-
const reader = response.body.getReader();
|
|
1947
|
-
if (onDownloadProgress) onDownloadProgress({
|
|
1948
|
-
percent: 0,
|
|
1949
|
-
transferredBytes: 0,
|
|
1950
|
-
totalBytes
|
|
1951
|
-
}, new Uint8Array());
|
|
1952
|
-
async function read() {
|
|
1953
|
-
const { done, value } = await reader.read();
|
|
1954
|
-
if (done) {
|
|
1955
|
-
controller.close();
|
|
1956
|
-
return;
|
|
1957
|
-
}
|
|
1958
|
-
if (onDownloadProgress) {
|
|
1959
|
-
transferredBytes += value.byteLength;
|
|
1960
|
-
const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
|
|
1961
|
-
onDownloadProgress({
|
|
1941
|
+
return stream.pipeThrough(new TransformStream({
|
|
1942
|
+
transform(currentChunk, controller) {
|
|
1943
|
+
controller.enqueue(currentChunk);
|
|
1944
|
+
if (previousChunk) {
|
|
1945
|
+
transferredBytes += previousChunk.byteLength;
|
|
1946
|
+
let percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
|
|
1947
|
+
if (percent >= 1) percent = 1 - Number.EPSILON;
|
|
1948
|
+
onProgress?.({
|
|
1962
1949
|
percent,
|
|
1963
|
-
transferredBytes,
|
|
1964
|
-
|
|
1965
|
-
},
|
|
1950
|
+
totalBytes: Math.max(totalBytes, transferredBytes),
|
|
1951
|
+
transferredBytes
|
|
1952
|
+
}, previousChunk);
|
|
1953
|
+
}
|
|
1954
|
+
previousChunk = currentChunk;
|
|
1955
|
+
},
|
|
1956
|
+
flush() {
|
|
1957
|
+
if (previousChunk) {
|
|
1958
|
+
transferredBytes += previousChunk.byteLength;
|
|
1959
|
+
onProgress?.({
|
|
1960
|
+
percent: 1,
|
|
1961
|
+
totalBytes: Math.max(totalBytes, transferredBytes),
|
|
1962
|
+
transferredBytes
|
|
1963
|
+
}, previousChunk);
|
|
1966
1964
|
}
|
|
1967
|
-
controller.enqueue(value);
|
|
1968
|
-
await read();
|
|
1969
1965
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1966
|
+
}));
|
|
1967
|
+
};
|
|
1968
|
+
const streamResponse = (response, onDownloadProgress) => {
|
|
1969
|
+
if (!response.body) return response;
|
|
1970
|
+
if (response.status === 204) return new Response(null, {
|
|
1971
|
+
status: response.status,
|
|
1972
|
+
statusText: response.statusText,
|
|
1973
|
+
headers: response.headers
|
|
1974
|
+
});
|
|
1975
|
+
const totalBytes = Number(response.headers.get("content-length")) || 0;
|
|
1976
|
+
return new Response(withProgress(response.body, totalBytes, onDownloadProgress), {
|
|
1972
1977
|
status: response.status,
|
|
1973
1978
|
statusText: response.statusText,
|
|
1974
1979
|
headers: response.headers
|
|
1975
1980
|
});
|
|
1976
1981
|
};
|
|
1977
1982
|
const streamRequest = (request, onUploadProgress, originalBody) => {
|
|
1983
|
+
if (!request.body) return request;
|
|
1978
1984
|
const totalBytes = getBodySize(originalBody ?? request.body);
|
|
1979
|
-
let transferredBytes = 0;
|
|
1980
1985
|
return new Request(request, {
|
|
1981
1986
|
duplex: "half",
|
|
1982
|
-
body:
|
|
1983
|
-
const reader = request.body instanceof ReadableStream ? request.body.getReader() : new Response("").body.getReader();
|
|
1984
|
-
async function read() {
|
|
1985
|
-
const { done, value } = await reader.read();
|
|
1986
|
-
if (done) {
|
|
1987
|
-
if (onUploadProgress) onUploadProgress({
|
|
1988
|
-
percent: 1,
|
|
1989
|
-
transferredBytes,
|
|
1990
|
-
totalBytes: Math.max(totalBytes, transferredBytes)
|
|
1991
|
-
}, new Uint8Array());
|
|
1992
|
-
controller.close();
|
|
1993
|
-
return;
|
|
1994
|
-
}
|
|
1995
|
-
transferredBytes += value.byteLength;
|
|
1996
|
-
let percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;
|
|
1997
|
-
if (totalBytes < transferredBytes || percent === 1) percent = .99;
|
|
1998
|
-
if (onUploadProgress) onUploadProgress({
|
|
1999
|
-
percent: Number(percent.toFixed(2)),
|
|
2000
|
-
transferredBytes,
|
|
2001
|
-
totalBytes
|
|
2002
|
-
}, value);
|
|
2003
|
-
controller.enqueue(value);
|
|
2004
|
-
await read();
|
|
2005
|
-
}
|
|
2006
|
-
await read();
|
|
2007
|
-
} })
|
|
1987
|
+
body: withProgress(request.body, totalBytes, onUploadProgress)
|
|
2008
1988
|
});
|
|
2009
1989
|
};
|
|
2010
1990
|
|
|
2011
1991
|
//#endregion
|
|
2012
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1992
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/is.js
|
|
2013
1993
|
const isObject$1 = (value) => value !== null && typeof value === "object";
|
|
2014
1994
|
|
|
2015
1995
|
//#endregion
|
|
2016
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1996
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/merge.js
|
|
2017
1997
|
const validateAndMerge = (...sources) => {
|
|
2018
1998
|
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");
|
|
2019
1999
|
return deepMerge({}, ...sources);
|
|
@@ -2063,7 +2043,7 @@ const deepMerge = (...sources) => {
|
|
|
2063
2043
|
};
|
|
2064
2044
|
|
|
2065
2045
|
//#endregion
|
|
2066
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2046
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/normalize.js
|
|
2067
2047
|
const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;
|
|
2068
2048
|
const defaultRetryOptions = {
|
|
2069
2049
|
limit: 2,
|
|
@@ -2107,7 +2087,7 @@ const normalizeRetryOptions = (retry$2 = {}) => {
|
|
|
2107
2087
|
};
|
|
2108
2088
|
|
|
2109
2089
|
//#endregion
|
|
2110
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2090
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/timeout.js
|
|
2111
2091
|
async function timeout(request, init$1, abortController, options) {
|
|
2112
2092
|
return new Promise((resolve, reject) => {
|
|
2113
2093
|
const timeoutId = setTimeout(() => {
|
|
@@ -2121,7 +2101,7 @@ async function timeout(request, init$1, abortController, options) {
|
|
|
2121
2101
|
}
|
|
2122
2102
|
|
|
2123
2103
|
//#endregion
|
|
2124
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2104
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/delay.js
|
|
2125
2105
|
async function delay(ms, { signal }) {
|
|
2126
2106
|
return new Promise((resolve, reject) => {
|
|
2127
2107
|
if (signal) {
|
|
@@ -2140,7 +2120,7 @@ async function delay(ms, { signal }) {
|
|
|
2140
2120
|
}
|
|
2141
2121
|
|
|
2142
2122
|
//#endregion
|
|
2143
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2123
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/utils/options.js
|
|
2144
2124
|
const findUnknownOptions = (request, options) => {
|
|
2145
2125
|
const unknownOptions = {};
|
|
2146
2126
|
for (const key in options) if (!(key in requestOptionsRegistry) && !(key in kyOptionKeys) && !(key in request)) unknownOptions[key] = options[key];
|
|
@@ -2156,7 +2136,7 @@ const hasSearchParameters = (search) => {
|
|
|
2156
2136
|
};
|
|
2157
2137
|
|
|
2158
2138
|
//#endregion
|
|
2159
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2139
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/core/Ky.js
|
|
2160
2140
|
var Ky = class Ky {
|
|
2161
2141
|
static create(input, options) {
|
|
2162
2142
|
const ky$1 = new Ky(input, options);
|
|
@@ -2182,7 +2162,11 @@ var Ky = class Ky {
|
|
|
2182
2162
|
return response;
|
|
2183
2163
|
};
|
|
2184
2164
|
const result = (ky$1._options.retry.methods.includes(ky$1.request.method.toLowerCase()) ? ky$1._retry(function_) : function_()).finally(async () => {
|
|
2185
|
-
|
|
2165
|
+
const originalRequest = ky$1._originalRequest;
|
|
2166
|
+
const cleanupPromises = [];
|
|
2167
|
+
if (originalRequest && !originalRequest.bodyUsed) cleanupPromises.push(originalRequest.body?.cancel());
|
|
2168
|
+
if (!ky$1.request.bodyUsed) cleanupPromises.push(ky$1.request.body?.cancel());
|
|
2169
|
+
await Promise.all(cleanupPromises);
|
|
2186
2170
|
});
|
|
2187
2171
|
for (const [type$1, mimeType] of Object.entries(responseTypes)) {
|
|
2188
2172
|
if (type$1 === "bytes" && typeof globalThis.Response?.prototype?.bytes !== "function") continue;
|
|
@@ -2210,6 +2194,7 @@ var Ky = class Ky {
|
|
|
2210
2194
|
_retryCount = 0;
|
|
2211
2195
|
_input;
|
|
2212
2196
|
_options;
|
|
2197
|
+
_originalRequest;
|
|
2213
2198
|
constructor(input, options = {}) {
|
|
2214
2199
|
this._input = input;
|
|
2215
2200
|
this._options = {
|
|
@@ -2305,15 +2290,15 @@ var Ky = class Ky {
|
|
|
2305
2290
|
if (result instanceof Response) return result;
|
|
2306
2291
|
}
|
|
2307
2292
|
const nonRequestOptions = findUnknownOptions(this.request, this._options);
|
|
2308
|
-
|
|
2309
|
-
this.request =
|
|
2310
|
-
if (this._options.timeout === false) return this._options.fetch(
|
|
2311
|
-
return timeout(
|
|
2293
|
+
this._originalRequest = this.request;
|
|
2294
|
+
this.request = this._originalRequest.clone();
|
|
2295
|
+
if (this._options.timeout === false) return this._options.fetch(this._originalRequest, nonRequestOptions);
|
|
2296
|
+
return timeout(this._originalRequest, nonRequestOptions, this.abortController, this._options);
|
|
2312
2297
|
}
|
|
2313
2298
|
};
|
|
2314
2299
|
|
|
2315
2300
|
//#endregion
|
|
2316
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2301
|
+
//#region ../../node_modules/.pnpm/ky@1.11.0/node_modules/ky/distribution/index.js
|
|
2317
2302
|
const createInstance = (defaults$1) => {
|
|
2318
2303
|
const ky$1 = (input, options) => Ky.create(input, validateAndMerge(defaults$1, options));
|
|
2319
2304
|
for (const method of requestMethods) ky$1[method] = (input, options) => Ky.create(input, validateAndMerge(defaults$1, options, { method }));
|
|
@@ -3646,9 +3631,9 @@ var require_dist$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@pnp
|
|
|
3646
3631
|
}) });
|
|
3647
3632
|
|
|
3648
3633
|
//#endregion
|
|
3649
|
-
//#region ../../node_modules/.pnpm/tsdown@0.15.
|
|
3634
|
+
//#region ../../node_modules/.pnpm/tsdown@0.15.6_typescript@5.9.3/node_modules/tsdown/esm-shims.js
|
|
3650
3635
|
var getFilename, getDirname, __dirname$2;
|
|
3651
|
-
var init_esm_shims = __esm({ "../../node_modules/.pnpm/tsdown@0.15.
|
|
3636
|
+
var init_esm_shims = __esm({ "../../node_modules/.pnpm/tsdown@0.15.6_typescript@5.9.3/node_modules/tsdown/esm-shims.js": (() => {
|
|
3652
3637
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
3653
3638
|
getDirname = () => path.dirname(getFilename());
|
|
3654
3639
|
__dirname$2 = /* @__PURE__ */ getDirname();
|
|
@@ -5039,7 +5024,7 @@ function htmlEscape(strings, ...values) {
|
|
|
5039
5024
|
}
|
|
5040
5025
|
|
|
5041
5026
|
//#endregion
|
|
5042
|
-
//#region ../../node_modules/.pnpm/pupa@3.
|
|
5027
|
+
//#region ../../node_modules/.pnpm/pupa@3.3.0/node_modules/pupa/index.js
|
|
5043
5028
|
var MissingValueError = class extends Error {
|
|
5044
5029
|
constructor(key) {
|
|
5045
5030
|
super(`Missing a value for ${key ? `the placeholder: ${key}` : "a placeholder"}`, key);
|
|
@@ -5047,12 +5032,48 @@ var MissingValueError = class extends Error {
|
|
|
5047
5032
|
this.key = key;
|
|
5048
5033
|
}
|
|
5049
5034
|
};
|
|
5050
|
-
|
|
5035
|
+
var MissingFilterError = class extends Error {
|
|
5036
|
+
constructor(filterName) {
|
|
5037
|
+
super(`Missing filter: ${filterName}`);
|
|
5038
|
+
this.name = "MissingFilterError";
|
|
5039
|
+
this.filterName = filterName;
|
|
5040
|
+
}
|
|
5041
|
+
};
|
|
5042
|
+
function pupa(template, data, { ignoreMissing = false, transform: transform$1 = ({ value }) => value, filters = {} } = {}) {
|
|
5051
5043
|
if (typeof template !== "string") throw new TypeError(`Expected a \`string\` in the first argument, got \`${typeof template}\``);
|
|
5052
5044
|
if (typeof data !== "object") throw new TypeError(`Expected an \`object\` or \`Array\` in the second argument, got \`${typeof data}\``);
|
|
5053
|
-
const
|
|
5045
|
+
const escapedLeftBrace = "";
|
|
5046
|
+
const escapedRightBrace = "";
|
|
5047
|
+
template = template.replace(/\\{/g, escapedLeftBrace);
|
|
5048
|
+
template = template.replace(/\\}/g, escapedRightBrace);
|
|
5049
|
+
const parseKeyPath = (key) => {
|
|
5050
|
+
const segments = [];
|
|
5051
|
+
let segment = "";
|
|
5052
|
+
for (let index = 0; index < key.length; index++) if (key[index] === "\\" && key[index + 1] === ".") {
|
|
5053
|
+
segment += ".";
|
|
5054
|
+
index++;
|
|
5055
|
+
} else if (key[index] === ".") {
|
|
5056
|
+
segments.push(segment);
|
|
5057
|
+
segment = "";
|
|
5058
|
+
} else segment += key[index];
|
|
5059
|
+
segments.push(segment);
|
|
5060
|
+
return segments;
|
|
5061
|
+
};
|
|
5062
|
+
const replace = (placeholder, keyWithFilters) => {
|
|
5063
|
+
const parts = keyWithFilters.split("|").map((part) => part.trim());
|
|
5064
|
+
const key = parts[0];
|
|
5065
|
+
const filterChain = parts.slice(1);
|
|
5066
|
+
const segments = parseKeyPath(key);
|
|
5054
5067
|
let value = data;
|
|
5055
|
-
for (const property of
|
|
5068
|
+
for (const property of segments) if (value) value = value[property];
|
|
5069
|
+
for (const filterName of filterChain) {
|
|
5070
|
+
const filter = filters[filterName];
|
|
5071
|
+
if (!filter) {
|
|
5072
|
+
if (ignoreMissing) return placeholder;
|
|
5073
|
+
throw new MissingFilterError(filterName);
|
|
5074
|
+
}
|
|
5075
|
+
if (value !== void 0) value = filter(value);
|
|
5076
|
+
}
|
|
5056
5077
|
const transformedValue = transform$1({
|
|
5057
5078
|
value,
|
|
5058
5079
|
key
|
|
@@ -5063,10 +5084,14 @@ function pupa(template, data, { ignoreMissing = false, transform: transform$1 =
|
|
|
5063
5084
|
}
|
|
5064
5085
|
return String(transformedValue);
|
|
5065
5086
|
};
|
|
5066
|
-
const
|
|
5067
|
-
const doubleBraceRegex =
|
|
5068
|
-
|
|
5069
|
-
|
|
5087
|
+
const keyWithFiltersPattern = `((\\d+|[a-z\$_][\\w\\-.\$\\\\]*)\\s*(?:\\|\\s*[a-z\$_][\\w\$]*\\s*)*)`;
|
|
5088
|
+
const doubleBraceRegex = new RegExp(`{{${keyWithFiltersPattern}}}`, "gi");
|
|
5089
|
+
const singleBraceRegex = new RegExp(`{${keyWithFiltersPattern}}`, "gi");
|
|
5090
|
+
template = template.replace(doubleBraceRegex, (...arguments_) => htmlEscape(replace(...arguments_)));
|
|
5091
|
+
template = template.replace(singleBraceRegex, replace);
|
|
5092
|
+
template = template.replace(new RegExp(escapedLeftBrace, "g"), "{");
|
|
5093
|
+
template = template.replace(new RegExp(escapedRightBrace, "g"), "}");
|
|
5094
|
+
return template;
|
|
5070
5095
|
}
|
|
5071
5096
|
|
|
5072
5097
|
//#endregion
|
|
@@ -5214,17 +5239,17 @@ var dependencies = {
|
|
|
5214
5239
|
"@yamada-ui/utils": "workspace:*",
|
|
5215
5240
|
"boxen": "^8.0.1",
|
|
5216
5241
|
"cli-check-node": "^1.3.4",
|
|
5217
|
-
"commander": "^14.0.
|
|
5242
|
+
"commander": "^14.0.1",
|
|
5218
5243
|
"diff": "^8.0.2",
|
|
5219
|
-
"esbuild": "^0.25.
|
|
5220
|
-
"eslint": "^9.
|
|
5244
|
+
"esbuild": "^0.25.10",
|
|
5245
|
+
"eslint": "^9.37.0",
|
|
5221
5246
|
"execa": "9.3.1",
|
|
5222
5247
|
"glob": "^11.0.3",
|
|
5223
5248
|
"https-proxy-agent": "^7.0.6",
|
|
5224
|
-
"listr2": "^9.0.
|
|
5249
|
+
"listr2": "^9.0.4",
|
|
5225
5250
|
"node-eval": "^2.0.0",
|
|
5226
5251
|
"node-fetch": "^3.3.2",
|
|
5227
|
-
"ora": "^
|
|
5252
|
+
"ora": "^9.0.0",
|
|
5228
5253
|
"picocolors": "^1.1.1",
|
|
5229
5254
|
"prettier": "^3.6.2",
|
|
5230
5255
|
"prompts": "^2.4.2",
|
|
@@ -5240,8 +5265,8 @@ var devDependencies = {
|
|
|
5240
5265
|
"@types/update-notifier": "6.0.8",
|
|
5241
5266
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
5242
5267
|
"@types/yamljs": "^0.2.34",
|
|
5243
|
-
"tsx": "^4.20.
|
|
5244
|
-
"typescript": "^5.9.
|
|
5268
|
+
"tsx": "^4.20.6",
|
|
5269
|
+
"typescript": "^5.9.3",
|
|
5245
5270
|
"update-notifier": "^7.3.1"
|
|
5246
5271
|
};
|
|
5247
5272
|
var package_default = {
|
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-20251007020753",
|
|
5
5
|
"description": "The official CLI for Yamada UI projects",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"theme",
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"boxen": "^8.0.1",
|
|
40
40
|
"cli-check-node": "^1.3.4",
|
|
41
|
-
"commander": "^14.0.
|
|
41
|
+
"commander": "^14.0.1",
|
|
42
42
|
"diff": "^8.0.2",
|
|
43
|
-
"esbuild": "^0.25.
|
|
44
|
-
"eslint": "^9.
|
|
43
|
+
"esbuild": "^0.25.10",
|
|
44
|
+
"eslint": "^9.37.0",
|
|
45
45
|
"execa": "9.3.1",
|
|
46
46
|
"glob": "^11.0.3",
|
|
47
47
|
"https-proxy-agent": "^7.0.6",
|
|
48
|
-
"listr2": "^9.0.
|
|
48
|
+
"listr2": "^9.0.4",
|
|
49
49
|
"node-eval": "^2.0.0",
|
|
50
50
|
"node-fetch": "^3.3.2",
|
|
51
|
-
"ora": "^
|
|
51
|
+
"ora": "^9.0.0",
|
|
52
52
|
"picocolors": "^1.1.1",
|
|
53
53
|
"prettier": "^3.6.2",
|
|
54
54
|
"prompts": "^2.4.2",
|
|
@@ -65,8 +65,8 @@
|
|
|
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",
|
|
68
|
-
"tsx": "^4.20.
|
|
69
|
-
"typescript": "^5.9.
|
|
68
|
+
"tsx": "^4.20.6",
|
|
69
|
+
"typescript": "^5.9.3",
|
|
70
70
|
"update-notifier": "^7.3.1"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|