@yamada-ui/cli 2.0.9-dev-20260303173438 → 2.0.9
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.mjs +209 -56
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -947,7 +947,7 @@ const FS = {
|
|
|
947
947
|
var dist_default = FS;
|
|
948
948
|
|
|
949
949
|
//#endregion
|
|
950
|
-
//#region ../../node_modules/.pnpm/atomically@2.1.
|
|
950
|
+
//#region ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/constants.js
|
|
951
951
|
const DEFAULT_ENCODING = "utf8";
|
|
952
952
|
const DEFAULT_FILE_MODE = 438;
|
|
953
953
|
const DEFAULT_FOLDER_MODE = 511;
|
|
@@ -960,7 +960,7 @@ const IS_USER_ROOT = process$1.getuid ? !process$1.getuid() : false;
|
|
|
960
960
|
const LIMIT_BASENAME_LENGTH = 128;
|
|
961
961
|
|
|
962
962
|
//#endregion
|
|
963
|
-
//#region ../../node_modules/.pnpm/atomically@2.1.
|
|
963
|
+
//#region ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/utils/lang.js
|
|
964
964
|
const isException = (value) => {
|
|
965
965
|
return value instanceof Error && "code" in value;
|
|
966
966
|
};
|
|
@@ -1023,7 +1023,7 @@ const whenExit = interceptor_default.register;
|
|
|
1023
1023
|
var node_default = whenExit;
|
|
1024
1024
|
|
|
1025
1025
|
//#endregion
|
|
1026
|
-
//#region ../../node_modules/.pnpm/atomically@2.1.
|
|
1026
|
+
//#region ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/utils/temp.js
|
|
1027
1027
|
const Temp = {
|
|
1028
1028
|
store: {},
|
|
1029
1029
|
create: (filePath) => {
|
|
@@ -1063,7 +1063,7 @@ node_default(Temp.purgeSyncAll);
|
|
|
1063
1063
|
var temp_default = Temp;
|
|
1064
1064
|
|
|
1065
1065
|
//#endregion
|
|
1066
|
-
//#region ../../node_modules/.pnpm/atomically@2.1.
|
|
1066
|
+
//#region ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/index.js
|
|
1067
1067
|
function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
1068
1068
|
if (isString$1(options)) return writeFileSync(filePath, data, { encoding: options });
|
|
1069
1069
|
const retryOptions = { timeout: options.timeout ?? DEFAULT_TIMEOUT_SYNC };
|
|
@@ -1762,7 +1762,7 @@ const chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
1762
1762
|
var source_default = chalk;
|
|
1763
1763
|
|
|
1764
1764
|
//#endregion
|
|
1765
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1765
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/errors/HTTPError.js
|
|
1766
1766
|
var HTTPError = class extends Error {
|
|
1767
1767
|
response;
|
|
1768
1768
|
request;
|
|
@@ -1779,7 +1779,7 @@ var HTTPError = class extends Error {
|
|
|
1779
1779
|
};
|
|
1780
1780
|
|
|
1781
1781
|
//#endregion
|
|
1782
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1782
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/errors/NonError.js
|
|
1783
1783
|
/**
|
|
1784
1784
|
Wrapper for non-Error values that were thrown.
|
|
1785
1785
|
|
|
@@ -1800,7 +1800,27 @@ var NonError = class extends Error {
|
|
|
1800
1800
|
};
|
|
1801
1801
|
|
|
1802
1802
|
//#endregion
|
|
1803
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1803
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/errors/ForceRetryError.js
|
|
1804
|
+
/**
|
|
1805
|
+
Internal error used to signal a forced retry from afterResponse hooks.
|
|
1806
|
+
This is thrown when a user returns ky.retry() from an afterResponse hook.
|
|
1807
|
+
*/
|
|
1808
|
+
var ForceRetryError = class extends Error {
|
|
1809
|
+
name = "ForceRetryError";
|
|
1810
|
+
customDelay;
|
|
1811
|
+
code;
|
|
1812
|
+
customRequest;
|
|
1813
|
+
constructor(options) {
|
|
1814
|
+
const cause = options?.cause ? options.cause instanceof Error ? options.cause : new NonError(options.cause) : void 0;
|
|
1815
|
+
super(options?.code ? `Forced retry: ${options.code}` : "Forced retry", cause ? { cause } : void 0);
|
|
1816
|
+
this.customDelay = options?.delay;
|
|
1817
|
+
this.code = options?.code;
|
|
1818
|
+
this.customRequest = options?.request;
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
|
|
1822
|
+
//#endregion
|
|
1823
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/core/constants.js
|
|
1804
1824
|
const supportsRequestStreams = (() => {
|
|
1805
1825
|
let duplexAccessed = false;
|
|
1806
1826
|
let hasContentType = false;
|
|
@@ -1846,6 +1866,99 @@ const responseTypes = {
|
|
|
1846
1866
|
const maxSafeTimeout = 2147483647;
|
|
1847
1867
|
const usualFormBoundarySize = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length;
|
|
1848
1868
|
const stop = Symbol("stop");
|
|
1869
|
+
/**
|
|
1870
|
+
Marker returned by ky.retry() to signal a forced retry from afterResponse hooks.
|
|
1871
|
+
*/
|
|
1872
|
+
var RetryMarker = class {
|
|
1873
|
+
options;
|
|
1874
|
+
constructor(options) {
|
|
1875
|
+
this.options = options;
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
/**
|
|
1879
|
+
Force a retry from an `afterResponse` hook.
|
|
1880
|
+
|
|
1881
|
+
This allows you to retry a request based on the response content, even if the response has a successful status code. The retry will respect the `retry.limit` option and skip the `shouldRetry` check. The forced retry is observable in `beforeRetry` hooks, where the error will be a `ForceRetryError`.
|
|
1882
|
+
|
|
1883
|
+
@param options - Optional configuration for the retry.
|
|
1884
|
+
|
|
1885
|
+
@example
|
|
1886
|
+
```
|
|
1887
|
+
import ky, {isForceRetryError} from 'ky';
|
|
1888
|
+
|
|
1889
|
+
const api = ky.extend({
|
|
1890
|
+
hooks: {
|
|
1891
|
+
afterResponse: [
|
|
1892
|
+
async (request, options, response) => {
|
|
1893
|
+
// Retry based on response body content
|
|
1894
|
+
if (response.status === 200) {
|
|
1895
|
+
const data = await response.clone().json();
|
|
1896
|
+
|
|
1897
|
+
// Simple retry with default delay
|
|
1898
|
+
if (data.error?.code === 'TEMPORARY_ERROR') {
|
|
1899
|
+
return ky.retry();
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
// Retry with custom delay from API response
|
|
1903
|
+
if (data.error?.code === 'RATE_LIMIT') {
|
|
1904
|
+
return ky.retry({
|
|
1905
|
+
delay: data.error.retryAfter * 1000,
|
|
1906
|
+
code: 'RATE_LIMIT'
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
// Retry with a modified request (e.g., fallback endpoint)
|
|
1911
|
+
if (data.error?.code === 'FALLBACK_TO_BACKUP') {
|
|
1912
|
+
return ky.retry({
|
|
1913
|
+
request: new Request('https://backup-api.com/endpoint', {
|
|
1914
|
+
method: request.method,
|
|
1915
|
+
headers: request.headers,
|
|
1916
|
+
}),
|
|
1917
|
+
code: 'BACKUP_ENDPOINT'
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
// Retry with refreshed authentication
|
|
1922
|
+
if (data.error?.code === 'TOKEN_REFRESH' && data.newToken) {
|
|
1923
|
+
return ky.retry({
|
|
1924
|
+
request: new Request(request, {
|
|
1925
|
+
headers: {
|
|
1926
|
+
...Object.fromEntries(request.headers),
|
|
1927
|
+
'Authorization': `Bearer ${data.newToken}`
|
|
1928
|
+
}
|
|
1929
|
+
}),
|
|
1930
|
+
code: 'TOKEN_REFRESHED'
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
// Retry with cause to preserve error chain
|
|
1935
|
+
try {
|
|
1936
|
+
validateResponse(data);
|
|
1937
|
+
} catch (error) {
|
|
1938
|
+
return ky.retry({
|
|
1939
|
+
code: 'VALIDATION_FAILED',
|
|
1940
|
+
cause: error
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
],
|
|
1946
|
+
beforeRetry: [
|
|
1947
|
+
({error, retryCount}) => {
|
|
1948
|
+
// Observable in beforeRetry hooks
|
|
1949
|
+
if (isForceRetryError(error)) {
|
|
1950
|
+
console.log(`Forced retry #${retryCount}: ${error.message}`);
|
|
1951
|
+
// Example output: "Forced retry #1: Forced retry: RATE_LIMIT"
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
]
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
const response = await api.get('https://example.com/api');
|
|
1959
|
+
```
|
|
1960
|
+
*/
|
|
1961
|
+
const retry = (options) => new RetryMarker(options);
|
|
1849
1962
|
const kyOptionKeys = {
|
|
1850
1963
|
json: true,
|
|
1851
1964
|
parseJson: true,
|
|
@@ -1880,7 +1993,7 @@ const requestOptionsRegistry = {
|
|
|
1880
1993
|
};
|
|
1881
1994
|
|
|
1882
1995
|
//#endregion
|
|
1883
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
1996
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/body.js
|
|
1884
1997
|
const getBodySize = (body) => {
|
|
1885
1998
|
if (!body) return 0;
|
|
1886
1999
|
if (body instanceof FormData) {
|
|
@@ -1959,11 +2072,11 @@ const streamRequest = (request, onUploadProgress, originalBody) => {
|
|
|
1959
2072
|
};
|
|
1960
2073
|
|
|
1961
2074
|
//#endregion
|
|
1962
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2075
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/is.js
|
|
1963
2076
|
const isObject$1 = (value) => value !== null && typeof value === "object";
|
|
1964
2077
|
|
|
1965
2078
|
//#endregion
|
|
1966
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2079
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/merge.js
|
|
1967
2080
|
const validateAndMerge = (...sources) => {
|
|
1968
2081
|
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");
|
|
1969
2082
|
return deepMerge({}, ...sources);
|
|
@@ -2053,12 +2166,11 @@ const deepMerge = (...sources) => {
|
|
|
2053
2166
|
if (signals.length > 0) if (signals.length === 1) returnValue.signal = signals[0];
|
|
2054
2167
|
else if (supportsAbortSignal) returnValue.signal = AbortSignal.any(signals);
|
|
2055
2168
|
else returnValue.signal = signals.at(-1);
|
|
2056
|
-
if (returnValue.context === void 0) returnValue.context = {};
|
|
2057
2169
|
return returnValue;
|
|
2058
2170
|
};
|
|
2059
2171
|
|
|
2060
2172
|
//#endregion
|
|
2061
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2173
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/normalize.js
|
|
2062
2174
|
const normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;
|
|
2063
2175
|
const defaultRetryOptions = {
|
|
2064
2176
|
limit: 2,
|
|
@@ -2090,21 +2202,23 @@ const defaultRetryOptions = {
|
|
|
2090
2202
|
jitter: void 0,
|
|
2091
2203
|
retryOnTimeout: false
|
|
2092
2204
|
};
|
|
2093
|
-
const normalizeRetryOptions = (retry = {}) => {
|
|
2094
|
-
if (typeof retry === "number") return {
|
|
2205
|
+
const normalizeRetryOptions = (retry$1 = {}) => {
|
|
2206
|
+
if (typeof retry$1 === "number") return {
|
|
2095
2207
|
...defaultRetryOptions,
|
|
2096
|
-
limit: retry
|
|
2208
|
+
limit: retry$1
|
|
2097
2209
|
};
|
|
2098
|
-
if (retry.methods && !Array.isArray(retry.methods)) throw new Error("retry.methods must be an array");
|
|
2099
|
-
|
|
2210
|
+
if (retry$1.methods && !Array.isArray(retry$1.methods)) throw new Error("retry.methods must be an array");
|
|
2211
|
+
retry$1.methods &&= retry$1.methods.map((method) => method.toLowerCase());
|
|
2212
|
+
if (retry$1.statusCodes && !Array.isArray(retry$1.statusCodes)) throw new Error("retry.statusCodes must be an array");
|
|
2213
|
+
const normalizedRetry = Object.fromEntries(Object.entries(retry$1).filter(([, value]) => value !== void 0));
|
|
2100
2214
|
return {
|
|
2101
2215
|
...defaultRetryOptions,
|
|
2102
|
-
...
|
|
2216
|
+
...normalizedRetry
|
|
2103
2217
|
};
|
|
2104
2218
|
};
|
|
2105
2219
|
|
|
2106
2220
|
//#endregion
|
|
2107
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2221
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/errors/TimeoutError.js
|
|
2108
2222
|
var TimeoutError = class extends Error {
|
|
2109
2223
|
request;
|
|
2110
2224
|
constructor(request) {
|
|
@@ -2115,7 +2229,7 @@ var TimeoutError = class extends Error {
|
|
|
2115
2229
|
};
|
|
2116
2230
|
|
|
2117
2231
|
//#endregion
|
|
2118
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2232
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/timeout.js
|
|
2119
2233
|
async function timeout(request, init$1, abortController, options) {
|
|
2120
2234
|
return new Promise((resolve, reject) => {
|
|
2121
2235
|
const timeoutId = setTimeout(() => {
|
|
@@ -2129,7 +2243,7 @@ async function timeout(request, init$1, abortController, options) {
|
|
|
2129
2243
|
}
|
|
2130
2244
|
|
|
2131
2245
|
//#endregion
|
|
2132
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2246
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/delay.js
|
|
2133
2247
|
async function delay(ms, { signal }) {
|
|
2134
2248
|
return new Promise((resolve, reject) => {
|
|
2135
2249
|
if (signal) {
|
|
@@ -2148,7 +2262,7 @@ async function delay(ms, { signal }) {
|
|
|
2148
2262
|
}
|
|
2149
2263
|
|
|
2150
2264
|
//#endregion
|
|
2151
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2265
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/options.js
|
|
2152
2266
|
const findUnknownOptions = (request, options) => {
|
|
2153
2267
|
const unknownOptions = {};
|
|
2154
2268
|
for (const key in options) {
|
|
@@ -2167,7 +2281,7 @@ const hasSearchParameters = (search) => {
|
|
|
2167
2281
|
};
|
|
2168
2282
|
|
|
2169
2283
|
//#endregion
|
|
2170
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2284
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/utils/type-guards.js
|
|
2171
2285
|
/**
|
|
2172
2286
|
Type guard to check if an error is an HTTPError.
|
|
2173
2287
|
|
|
@@ -2212,7 +2326,7 @@ function isTimeoutError(error) {
|
|
|
2212
2326
|
}
|
|
2213
2327
|
|
|
2214
2328
|
//#endregion
|
|
2215
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2329
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/core/Ky.js
|
|
2216
2330
|
var Ky = class Ky {
|
|
2217
2331
|
static create(input, options) {
|
|
2218
2332
|
const ky$1 = new Ky(input, options);
|
|
@@ -2221,11 +2335,27 @@ var Ky = class Ky {
|
|
|
2221
2335
|
await Promise.resolve();
|
|
2222
2336
|
let response = await ky$1.#fetch();
|
|
2223
2337
|
for (const hook of ky$1.#options.hooks.afterResponse) {
|
|
2224
|
-
const
|
|
2225
|
-
|
|
2338
|
+
const clonedResponse = ky$1.#decorateResponse(response.clone());
|
|
2339
|
+
let modifiedResponse;
|
|
2340
|
+
try {
|
|
2341
|
+
modifiedResponse = await hook(ky$1.request, ky$1.#getNormalizedOptions(), clonedResponse, { retryCount: ky$1.#retryCount });
|
|
2342
|
+
} catch (error) {
|
|
2343
|
+
ky$1.#cancelResponseBody(clonedResponse);
|
|
2344
|
+
ky$1.#cancelResponseBody(response);
|
|
2345
|
+
throw error;
|
|
2346
|
+
}
|
|
2347
|
+
if (modifiedResponse instanceof RetryMarker) {
|
|
2348
|
+
ky$1.#cancelResponseBody(clonedResponse);
|
|
2349
|
+
ky$1.#cancelResponseBody(response);
|
|
2350
|
+
throw new ForceRetryError(modifiedResponse.options);
|
|
2351
|
+
}
|
|
2352
|
+
const nextResponse = modifiedResponse instanceof globalThis.Response ? modifiedResponse : response;
|
|
2353
|
+
if (clonedResponse !== nextResponse) ky$1.#cancelResponseBody(clonedResponse);
|
|
2354
|
+
if (response !== nextResponse) ky$1.#cancelResponseBody(response);
|
|
2355
|
+
response = nextResponse;
|
|
2226
2356
|
}
|
|
2227
2357
|
ky$1.#decorateResponse(response);
|
|
2228
|
-
if (!response.ok && ky$1.#options.throwHttpErrors) {
|
|
2358
|
+
if (!response.ok && (typeof ky$1.#options.throwHttpErrors === "function" ? ky$1.#options.throwHttpErrors(response.status) : ky$1.#options.throwHttpErrors)) {
|
|
2229
2359
|
let error = new HTTPError(response, ky$1.request, ky$1.#getNormalizedOptions());
|
|
2230
2360
|
for (const hook of ky$1.#options.hooks.beforeError) error = await hook(error, { retryCount: ky$1.#retryCount });
|
|
2231
2361
|
throw error;
|
|
@@ -2233,16 +2363,16 @@ var Ky = class Ky {
|
|
|
2233
2363
|
if (ky$1.#options.onDownloadProgress) {
|
|
2234
2364
|
if (typeof ky$1.#options.onDownloadProgress !== "function") throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
2235
2365
|
if (!supportsResponseStreams) throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
2236
|
-
|
|
2366
|
+
const progressResponse = response.clone();
|
|
2367
|
+
ky$1.#cancelResponseBody(response);
|
|
2368
|
+
return streamResponse(progressResponse, ky$1.#options.onDownloadProgress);
|
|
2237
2369
|
}
|
|
2238
2370
|
return response;
|
|
2239
2371
|
};
|
|
2240
|
-
const result =
|
|
2372
|
+
const result = ky$1.#retry(function_).finally(() => {
|
|
2241
2373
|
const originalRequest = ky$1.#originalRequest;
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
if (!ky$1.request.bodyUsed) cleanupPromises.push(ky$1.request.body?.cancel());
|
|
2245
|
-
await Promise.all(cleanupPromises);
|
|
2374
|
+
ky$1.#cancelBody(originalRequest?.body ?? void 0);
|
|
2375
|
+
ky$1.#cancelBody(ky$1.request.body ?? void 0);
|
|
2246
2376
|
});
|
|
2247
2377
|
for (const [type$1, mimeType] of Object.entries(responseTypes)) {
|
|
2248
2378
|
if (type$1 === "bytes" && typeof globalThis.Response?.prototype?.bytes !== "function") continue;
|
|
@@ -2287,7 +2417,7 @@ var Ky = class Ky {
|
|
|
2287
2417
|
method: normalizeRequestMethod(options.method ?? this.#input.method ?? "GET"),
|
|
2288
2418
|
prefixUrl: String(options.prefixUrl || ""),
|
|
2289
2419
|
retry: normalizeRetryOptions(options.retry),
|
|
2290
|
-
throwHttpErrors: options.throwHttpErrors
|
|
2420
|
+
throwHttpErrors: options.throwHttpErrors ?? true,
|
|
2291
2421
|
timeout: options.timeout ?? 1e4,
|
|
2292
2422
|
fetch: options.fetch ?? globalThis.fetch.bind(globalThis),
|
|
2293
2423
|
context: options.context ?? {}
|
|
@@ -2314,12 +2444,12 @@ var Ky = class Ky {
|
|
|
2314
2444
|
if (hasSearchParameters(this.#options.searchParams)) {
|
|
2315
2445
|
const searchParams = "?" + (typeof this.#options.searchParams === "string" ? this.#options.searchParams.replace(/^\?/, "") : new URLSearchParams(Ky.#normalizeSearchParams(this.#options.searchParams)).toString());
|
|
2316
2446
|
const url$2 = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams);
|
|
2317
|
-
this.request = new globalThis.Request(
|
|
2447
|
+
this.request = new globalThis.Request(url$2, this.#options);
|
|
2318
2448
|
}
|
|
2319
2449
|
if (this.#options.onUploadProgress) {
|
|
2320
2450
|
if (typeof this.#options.onUploadProgress !== "function") throw new TypeError("The `onUploadProgress` option must be a function");
|
|
2321
2451
|
if (!supportsRequestStreams) throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
|
|
2322
|
-
|
|
2452
|
+
this.request = this.#wrapRequestWithUploadProgress(this.request, this.#options.body ?? void 0);
|
|
2323
2453
|
}
|
|
2324
2454
|
}
|
|
2325
2455
|
#calculateDelay() {
|
|
@@ -2330,12 +2460,15 @@ var Ky = class Ky {
|
|
|
2330
2460
|
jitteredDelay = this.#options.retry.jitter(retryDelay);
|
|
2331
2461
|
if (!Number.isFinite(jitteredDelay) || jitteredDelay < 0) jitteredDelay = retryDelay;
|
|
2332
2462
|
}
|
|
2333
|
-
|
|
2463
|
+
const backoffLimit = this.#options.retry.backoffLimit ?? Number.POSITIVE_INFINITY;
|
|
2464
|
+
return Math.min(backoffLimit, jitteredDelay);
|
|
2334
2465
|
}
|
|
2335
2466
|
async #calculateRetryDelay(error) {
|
|
2336
2467
|
this.#retryCount++;
|
|
2337
2468
|
if (this.#retryCount > this.#options.retry.limit) throw error;
|
|
2338
2469
|
const errorObject = error instanceof Error ? error : new NonError(error);
|
|
2470
|
+
if (errorObject instanceof ForceRetryError) return errorObject.customDelay ?? this.#calculateDelay();
|
|
2471
|
+
if (!this.#options.retry.methods.includes(this.request.method.toLowerCase())) throw error;
|
|
2339
2472
|
if (this.#options.retry.shouldRetry !== void 0) {
|
|
2340
2473
|
const result = await this.#options.retry.shouldRetry({
|
|
2341
2474
|
error: errorObject,
|
|
@@ -2363,6 +2496,13 @@ var Ky = class Ky {
|
|
|
2363
2496
|
if (this.#options.parseJson) response.json = async () => this.#options.parseJson(await response.text());
|
|
2364
2497
|
return response;
|
|
2365
2498
|
}
|
|
2499
|
+
#cancelBody(body) {
|
|
2500
|
+
if (!body) return;
|
|
2501
|
+
body.cancel().catch(() => void 0);
|
|
2502
|
+
}
|
|
2503
|
+
#cancelResponseBody(response) {
|
|
2504
|
+
this.#cancelBody(response.body ?? void 0);
|
|
2505
|
+
}
|
|
2366
2506
|
async #retry(function_) {
|
|
2367
2507
|
try {
|
|
2368
2508
|
return await function_();
|
|
@@ -2370,6 +2510,10 @@ var Ky = class Ky {
|
|
|
2370
2510
|
const ms = Math.min(await this.#calculateRetryDelay(error), maxSafeTimeout);
|
|
2371
2511
|
if (this.#retryCount < 1) throw error;
|
|
2372
2512
|
await delay(ms, this.#userProvidedAbortSignal ? { signal: this.#userProvidedAbortSignal } : {});
|
|
2513
|
+
if (error instanceof ForceRetryError && error.customRequest) {
|
|
2514
|
+
const managedRequest = this.#options.signal ? new globalThis.Request(error.customRequest, { signal: this.#options.signal }) : new globalThis.Request(error.customRequest);
|
|
2515
|
+
this.#assignRequest(managedRequest);
|
|
2516
|
+
}
|
|
2373
2517
|
for (const hook of this.#options.hooks.beforeRetry) {
|
|
2374
2518
|
const hookResult = await hook({
|
|
2375
2519
|
request: this.request,
|
|
@@ -2378,7 +2522,7 @@ var Ky = class Ky {
|
|
|
2378
2522
|
retryCount: this.#retryCount
|
|
2379
2523
|
});
|
|
2380
2524
|
if (hookResult instanceof globalThis.Request) {
|
|
2381
|
-
this
|
|
2525
|
+
this.#assignRequest(hookResult);
|
|
2382
2526
|
break;
|
|
2383
2527
|
}
|
|
2384
2528
|
if (hookResult instanceof globalThis.Response) return hookResult;
|
|
@@ -2395,11 +2539,11 @@ var Ky = class Ky {
|
|
|
2395
2539
|
}
|
|
2396
2540
|
for (const hook of this.#options.hooks.beforeRequest) {
|
|
2397
2541
|
const result = await hook(this.request, this.#getNormalizedOptions(), { retryCount: this.#retryCount });
|
|
2398
|
-
if (result instanceof
|
|
2399
|
-
|
|
2542
|
+
if (result instanceof Response) return result;
|
|
2543
|
+
if (result instanceof globalThis.Request) {
|
|
2544
|
+
this.#assignRequest(result);
|
|
2400
2545
|
break;
|
|
2401
2546
|
}
|
|
2402
|
-
if (result instanceof Response) return result;
|
|
2403
2547
|
}
|
|
2404
2548
|
const nonRequestOptions = findUnknownOptions(this.request, this.#options);
|
|
2405
2549
|
this.#originalRequest = this.request;
|
|
@@ -2414,10 +2558,18 @@ var Ky = class Ky {
|
|
|
2414
2558
|
}
|
|
2415
2559
|
return this.#cachedNormalizedOptions;
|
|
2416
2560
|
}
|
|
2561
|
+
#assignRequest(request) {
|
|
2562
|
+
this.#cachedNormalizedOptions = void 0;
|
|
2563
|
+
this.request = this.#wrapRequestWithUploadProgress(request);
|
|
2564
|
+
}
|
|
2565
|
+
#wrapRequestWithUploadProgress(request, originalBody) {
|
|
2566
|
+
if (!this.#options.onUploadProgress || !request.body) return request;
|
|
2567
|
+
return streamRequest(request, this.#options.onUploadProgress, originalBody ?? this.#options.body ?? void 0);
|
|
2568
|
+
}
|
|
2417
2569
|
};
|
|
2418
2570
|
|
|
2419
2571
|
//#endregion
|
|
2420
|
-
//#region ../../node_modules/.pnpm/ky@1.
|
|
2572
|
+
//#region ../../node_modules/.pnpm/ky@1.14.3/node_modules/ky/distribution/index.js
|
|
2421
2573
|
/*! MIT License © Sindre Sorhus */
|
|
2422
2574
|
const createInstance = (defaults) => {
|
|
2423
2575
|
const ky$1 = (input, options) => Ky.create(input, validateAndMerge(defaults, options));
|
|
@@ -2428,6 +2580,7 @@ const createInstance = (defaults) => {
|
|
|
2428
2580
|
return createInstance(validateAndMerge(defaults, newDefaults));
|
|
2429
2581
|
};
|
|
2430
2582
|
ky$1.stop = stop;
|
|
2583
|
+
ky$1.retry = retry;
|
|
2431
2584
|
return ky$1;
|
|
2432
2585
|
};
|
|
2433
2586
|
const ky = createInstance();
|
|
@@ -4082,14 +4235,12 @@ var require_config_chain = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4082
4235
|
}));
|
|
4083
4236
|
|
|
4084
4237
|
//#endregion
|
|
4085
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4238
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js
|
|
4086
4239
|
var require_envKeyToSetting = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4087
4240
|
module.exports = function(x) {
|
|
4088
4241
|
const colonIndex = x.indexOf(":");
|
|
4089
4242
|
if (colonIndex === -1) return normalize(x);
|
|
4090
|
-
|
|
4091
|
-
const secondPart = x.substr(colonIndex + 1);
|
|
4092
|
-
return `${normalize(firstPart)}:${normalize(secondPart)}`;
|
|
4243
|
+
return `${x.substr(0, colonIndex)}:${normalize(x.substr(colonIndex + 1))}`;
|
|
4093
4244
|
};
|
|
4094
4245
|
function normalize(s) {
|
|
4095
4246
|
s = s.toLowerCase();
|
|
@@ -4141,7 +4292,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4141
4292
|
}));
|
|
4142
4293
|
|
|
4143
4294
|
//#endregion
|
|
4144
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4295
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/util.js
|
|
4145
4296
|
var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4146
4297
|
const fs$3 = __require("fs");
|
|
4147
4298
|
const path$6 = __require("path");
|
|
@@ -4170,7 +4321,9 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4170
4321
|
case "null": return null;
|
|
4171
4322
|
case "undefined": return;
|
|
4172
4323
|
}
|
|
4173
|
-
|
|
4324
|
+
const processedField = envReplace(field, process.env);
|
|
4325
|
+
if ((key.endsWith(":tokenHelper") || key === "tokenHelper") && processedField !== field) throw new Error(`It is not allowed to use environment variables in the value of the ${key} setting.`);
|
|
4326
|
+
else field = processedField;
|
|
4174
4327
|
if (isPath) {
|
|
4175
4328
|
if ((process.platform === "win32" ? /^~(\/|\\)/ : /^~\//).test(field) && process.env.HOME) field = path$6.resolve(process.env.HOME, field.substr(2));
|
|
4176
4329
|
field = path$6.resolve(field);
|
|
@@ -4211,7 +4364,7 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4211
4364
|
}));
|
|
4212
4365
|
|
|
4213
4366
|
//#endregion
|
|
4214
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4367
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/types.js
|
|
4215
4368
|
var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4216
4369
|
const path$5 = __require("path");
|
|
4217
4370
|
const Stream = __require("stream").Stream;
|
|
@@ -4397,7 +4550,7 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4397
4550
|
}));
|
|
4398
4551
|
|
|
4399
4552
|
//#endregion
|
|
4400
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4553
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/conf.js
|
|
4401
4554
|
var require_conf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4402
4555
|
const { readCAFileSync } = require_dist$1();
|
|
4403
4556
|
const fs$2 = __require("fs");
|
|
@@ -4527,7 +4680,7 @@ var require_conf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4527
4680
|
}));
|
|
4528
4681
|
|
|
4529
4682
|
//#endregion
|
|
4530
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4683
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/lib/defaults.js
|
|
4531
4684
|
var require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4532
4685
|
const os$2 = __require("os");
|
|
4533
4686
|
const path$3 = __require("path");
|
|
@@ -4629,7 +4782,7 @@ var require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4629
4782
|
"prefer-offline": false,
|
|
4630
4783
|
"prefer-online": false,
|
|
4631
4784
|
prefix: globalPrefix,
|
|
4632
|
-
production:
|
|
4785
|
+
production: false,
|
|
4633
4786
|
"progress": !process.env.TRAVIS && !process.env.CI,
|
|
4634
4787
|
provenance: false,
|
|
4635
4788
|
proxy: null,
|
|
@@ -4681,7 +4834,7 @@ var require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4681
4834
|
}));
|
|
4682
4835
|
|
|
4683
4836
|
//#endregion
|
|
4684
|
-
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@
|
|
4837
|
+
//#region ../../node_modules/.pnpm/@pnpm+npm-conf@3.0.2/node_modules/@pnpm/npm-conf/index.js
|
|
4685
4838
|
var require_npm_conf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4686
4839
|
const path$2 = __require("path");
|
|
4687
4840
|
const Conf = require_conf();
|
|
@@ -4741,7 +4894,7 @@ var require_npm_conf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4741
4894
|
}));
|
|
4742
4895
|
|
|
4743
4896
|
//#endregion
|
|
4744
|
-
//#region ../../node_modules/.pnpm/registry-auth-token@5.1.
|
|
4897
|
+
//#region ../../node_modules/.pnpm/registry-auth-token@5.1.1/node_modules/registry-auth-token/index.js
|
|
4745
4898
|
var require_registry_auth_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4746
4899
|
const npmConf = require_npm_conf();
|
|
4747
4900
|
const tokenKey = ":_authToken";
|
|
@@ -5341,7 +5494,7 @@ function updateNotifier(options) {
|
|
|
5341
5494
|
//#endregion
|
|
5342
5495
|
//#region package.json
|
|
5343
5496
|
var name = "@yamada-ui/cli";
|
|
5344
|
-
var version = "2.0.
|
|
5497
|
+
var version = "2.0.9";
|
|
5345
5498
|
var description = "The official CLI for Yamada UI projects";
|
|
5346
5499
|
var package_default = {
|
|
5347
5500
|
name,
|
|
@@ -5394,7 +5547,7 @@ var package_default = {
|
|
|
5394
5547
|
"execa": "9.3.1",
|
|
5395
5548
|
"glob": "^13.0.6",
|
|
5396
5549
|
"https-proxy-agent": "^7.0.6",
|
|
5397
|
-
"listr2": "^10.
|
|
5550
|
+
"listr2": "^10.2.1",
|
|
5398
5551
|
"node-eval": "^2.0.0",
|
|
5399
5552
|
"node-fetch": "^3.3.2",
|
|
5400
5553
|
"ora": "^9.3.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.9
|
|
4
|
+
"version": "2.0.9",
|
|
5
5
|
"description": "The official CLI for Yamada UI projects",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"theme",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"execa": "9.3.1",
|
|
43
43
|
"glob": "^13.0.6",
|
|
44
44
|
"https-proxy-agent": "^7.0.6",
|
|
45
|
-
"listr2": "^10.
|
|
45
|
+
"listr2": "^10.2.1",
|
|
46
46
|
"node-eval": "^2.0.0",
|
|
47
47
|
"node-fetch": "^3.3.2",
|
|
48
48
|
"ora": "^9.3.0",
|