@kubb/core
Advanced tools
Comparing version 0.0.0-canary-20250124174549 to 0.0.0-canary-20250204223927
@@ -63,4 +63,4 @@ import seedrandom from 'seedrandom'; | ||
function C(n2 = false) { | ||
let e = typeof process != "undefined" ? process : void 0, i2 = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || []; | ||
return !("NO_COLOR" in i2 || g.includes("--no-color")) && ("FORCE_COLOR" in i2 || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n2 && i2.TERM !== "dumb" || "CI" in i2) || typeof window != "undefined" && !!window.chrome; | ||
let e = typeof process != "undefined" ? process : undefined, i2 = (e == null ? undefined : e.env) || {}, g = (e == null ? undefined : e.argv) || []; | ||
return !("NO_COLOR" in i2 || g.includes("--no-color")) && ("FORCE_COLOR" in i2 || g.includes("--color") || (e == null ? undefined : e.platform) === "win32" || n2 && i2.TERM !== "dumb" || "CI" in i2) || typeof window != "undefined" && !!window.chrome; | ||
} | ||
@@ -206,3 +206,3 @@ function p(n2 = false) { | ||
const value = baseObject[key]; | ||
if (value === null || value === void 0) { | ||
if (value === null || value === undefined) { | ||
continue; | ||
@@ -593,3 +593,3 @@ } | ||
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) { | ||
if (input === void 0) { | ||
if (input === undefined) { | ||
return defaultLevel; | ||
@@ -600,3 +600,3 @@ } | ||
} | ||
if (types[input] && types[input].level !== void 0) { | ||
if (types[input] && types[input].level !== undefined) { | ||
return types[input].level; | ||
@@ -700,3 +700,3 @@ } | ||
function filterEmpty(open, close, replace = open, at = open.length + 1) { | ||
return (string) => string || !(string === "" || string === void 0) ? clearBleed( | ||
return (string) => string || !(string === "" || string === undefined) ? clearBleed( | ||
("" + string).indexOf(close, at), | ||
@@ -983,3 +983,3 @@ string, | ||
].join("|"); | ||
return new RegExp(pattern, onlyFirst ? void 0 : "g"); | ||
return new RegExp(pattern, onlyFirst ? undefined : "g"); | ||
} | ||
@@ -1133,3 +1133,3 @@ var regex = ansiRegex2(); | ||
{ | ||
title: logObj.title ? characterFormat(logObj.title) : void 0, | ||
title: logObj.title ? characterFormat(logObj.title) : undefined, | ||
style: logObj.style | ||
@@ -1136,0 +1136,0 @@ } |
@@ -46,3 +46,3 @@ import { merge } from 'remeda'; | ||
} | ||
if (chunkA.parsedNumber !== void 0 && chunkB.parsedNumber !== void 0) { | ||
if (chunkA.parsedNumber !== undefined && chunkB.parsedNumber !== undefined) { | ||
var result = compareNumbers(chunkA.parsedNumber, chunkB.parsedNumber); | ||
@@ -53,4 +53,4 @@ if (result === 0) { | ||
return result; | ||
} else if (chunkA.parsedNumber !== void 0 || chunkB.parsedNumber !== void 0) { | ||
return chunkA.parsedNumber !== void 0 ? -1 : 1; | ||
} else if (chunkA.parsedNumber !== undefined || chunkB.parsedNumber !== undefined) { | ||
return chunkA.parsedNumber !== undefined ? -1 : 1; | ||
} else if (RE_UNICODE_CHARACTERS.test(chunkA.normalizedString + chunkB.normalizedString)) { | ||
@@ -96,3 +96,3 @@ return compareUnicode(chunkA.normalizedString, chunkB.normalizedString, locale); | ||
} | ||
if (valueA.parsedNumber !== void 0 && valueB.parsedNumber !== void 0) { | ||
if (valueA.parsedNumber !== undefined && valueB.parsedNumber !== undefined) { | ||
return compareNumbers(valueA.parsedNumber, valueB.parsedNumber); | ||
@@ -115,3 +115,3 @@ } | ||
} | ||
return void 0; | ||
return undefined; | ||
}; | ||
@@ -124,3 +124,3 @@ var normalizeNumericChunk = function normalizeNumericChunk2(chunk, index, chunks) { | ||
} | ||
return void 0; | ||
return undefined; | ||
}; | ||
@@ -156,3 +156,3 @@ var createChunkMap = function createChunkMap2(chunk, index, chunks) { | ||
var isUndefined = function isUndefined2(value) { | ||
return value === void 0; | ||
return value === undefined; | ||
}; | ||
@@ -169,3 +169,3 @@ var parseDate = function parseDate2(value) { | ||
} catch (_unused) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -175,3 +175,3 @@ }; | ||
var parsedNumber = parseNumber(value); | ||
if (parsedNumber !== void 0) { | ||
if (parsedNumber !== undefined) { | ||
return parsedNumber; | ||
@@ -251,3 +251,3 @@ } | ||
var result = Object.getOwnPropertyDescriptor(value, identifier); | ||
return result == null ? void 0 : result.value; | ||
return result == null ? undefined : result.value; | ||
} | ||
@@ -424,3 +424,3 @@ return value; | ||
function stringify3(value) { | ||
if (value === void 0 || value === null) { | ||
if (value === undefined || value === null) { | ||
return '""'; | ||
@@ -446,3 +446,3 @@ } | ||
const isEndWithSlash = text.endsWith("/"); | ||
return new RegExp(text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : void 0)); | ||
return new RegExp(text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined)); | ||
} | ||
@@ -460,5 +460,5 @@ function toRegExp(text) { | ||
if (func === null) { | ||
return `/${text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : void 0).replaceAll("/", "\\/")}/`; | ||
return `/${text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined).replaceAll("/", "\\/")}/`; | ||
} | ||
const regexp = `new ${func}('${jsStringEscape(text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : void 0))}')`; | ||
const regexp = `new ${func}('${jsStringEscape(text.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined))}')`; | ||
return regexp; | ||
@@ -465,0 +465,0 @@ } |
@@ -34,3 +34,3 @@ import { orderBy, camelCase, isValidVarName } from './chunk-O5ASNFB7.js'; | ||
if (Array.isArray(v)) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -41,3 +41,3 @@ return !v.default; | ||
if (Array.isArray(v)) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -77,3 +77,3 @@ return v.required ?? true; | ||
items.forEach((item) => { | ||
name = _FunctionParams.#addParams(name, { ...item, type: void 0 }); | ||
name = _FunctionParams.#addParams(name, { ...item, type: undefined }); | ||
if (items.some((item2) => item2.type)) { | ||
@@ -85,3 +85,3 @@ type = _FunctionParams.#addParams(type, item); | ||
name: `{ ${name.join(", ")} }`, | ||
type: type.length ? `{ ${type.join("; ")} }` : void 0, | ||
type: type.length ? `{ ${type.join("; ")} }` : undefined, | ||
enabled, | ||
@@ -127,3 +127,3 @@ required | ||
// src/utils/renderTemplate.ts | ||
function renderTemplate(template, data = void 0) { | ||
function renderTemplate(template, data = undefined) { | ||
if (!data || !Object.keys(data).length) { | ||
@@ -135,7 +135,7 @@ return template.replace(/{{(.*?)}}/g, ""); | ||
const index = curr.split(/{{|}}/).filter(Boolean)[0]?.trim(); | ||
if (index === void 0) { | ||
if (index === undefined) { | ||
return prev; | ||
} | ||
const value = data[index]; | ||
if (value === void 0) { | ||
if (value === undefined) { | ||
return prev; | ||
@@ -265,3 +265,3 @@ } | ||
if (!found) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -294,3 +294,3 @@ const params = {}; | ||
children = []; | ||
#cachedLeaves = void 0; | ||
#cachedLeaves = undefined; | ||
constructor(data, parent) { | ||
@@ -457,3 +457,3 @@ this.data = data; | ||
if (!treeNode || !treeNode.children || !treeNode.parent?.data.path) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -470,3 +470,3 @@ const barrelFile = { | ||
if (!item.data.name) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -478,3 +478,3 @@ const sources = item.data.file?.sources || []; | ||
`No isIndexable source found(source should have a name and isIndexable): | ||
File: ${JSON.stringify(item.data.file, void 0, 2)}` | ||
File: ${JSON.stringify(item.data.file, undefined, 2)}` | ||
); | ||
@@ -484,7 +484,7 @@ } | ||
if (!item.data.file?.path || !source.isIndexable || !source.name) { | ||
return void 0; | ||
return undefined; | ||
} | ||
const alreadyContainInPreviousBarrelFile = previousBarrelFile?.sources.some((item2) => item2.name === source.name); | ||
if (alreadyContainInPreviousBarrelFile) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -626,3 +626,3 @@ if (!barrelFile.exports) { | ||
...exportItem, | ||
name: void 0 | ||
name: undefined | ||
}; | ||
@@ -802,3 +802,3 @@ }) | ||
const message = file ? `Writing ${relative(root, file.path)}` : ""; | ||
const extname2 = extension?.[file.extname] || void 0; | ||
const extname2 = extension?.[file.extname] || undefined; | ||
const source = await getSource(file, { logger, extname: extname2 }); | ||
@@ -805,0 +805,0 @@ await write(file.path, source, { sanity: false }); |
@@ -37,4 +37,3 @@ import { EventEmitter, createLogger } from './chunk-E2WLQU27.js'; | ||
} | ||
const calledFunc = func(state); | ||
return calledFunc; | ||
return func(state); | ||
}); | ||
@@ -189,3 +188,3 @@ } | ||
Paths: ${JSON.stringify(paths, void 0, 2)} | ||
Paths: ${JSON.stringify(paths, undefined, 2)} | ||
@@ -220,3 +219,3 @@ Falling back on the first item. | ||
Names: ${JSON.stringify(names, void 0, 2)} | ||
Names: ${JSON.stringify(names, undefined, 2)} | ||
@@ -410,3 +409,3 @@ Falling back on the first item. | ||
if (!isValid) { | ||
throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`); | ||
throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, undefined, 2)})`); | ||
} | ||
@@ -427,3 +426,3 @@ } | ||
const plugins = [...this.plugins]; | ||
const [searchPluginName, searchIdentifier] = pluginKey; | ||
const [searchPluginName] = pluginKey; | ||
return plugins.find((item) => { | ||
@@ -491,3 +490,3 @@ const [name] = item.key; | ||
const promise = new Promise((resolve2) => { | ||
resolve2(void 0); | ||
resolve2(undefined); | ||
}); | ||
@@ -800,3 +799,3 @@ const task = promise.then(() => { | ||
console.error(e); | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -809,3 +808,3 @@ } | ||
if (!pkgPath) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -820,3 +819,3 @@ const json = await read(pkgPath); | ||
if (!pkgPath) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -838,3 +837,3 @@ const json = readSync(pkgPath); | ||
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency)); | ||
return matchedDependency ? dependencies[matchedDependency] : void 0; | ||
return matchedDependency ? dependencies[matchedDependency] : undefined; | ||
} | ||
@@ -847,3 +846,3 @@ async getVersion(dependency) { | ||
if (!packageJSON) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -858,3 +857,3 @@ return this.#match(packageJSON, dependency); | ||
if (!packageJSON) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -861,0 +860,0 @@ return this.#match(packageJSON, dependency); |
@@ -6,5 +6,5 @@ import { getSource, createFile } from './chunk-YYMV5PIX.js'; | ||
var mockedLogger = { | ||
emit(type, message) { | ||
emit(_type, _message) { | ||
}, | ||
on(type, message) { | ||
on(_type, _message) { | ||
}, | ||
@@ -36,3 +36,3 @@ consola: {} | ||
}, | ||
on(eventName, args) { | ||
on(_eventName, _args) { | ||
}, | ||
@@ -42,3 +42,3 @@ logLevel: 3 | ||
getPluginByKey: (_pluginKey) => { | ||
return void 0; | ||
return undefined; | ||
}, | ||
@@ -59,3 +59,3 @@ getFile: ({ name: name2, extname, pluginKey }) => { | ||
if (!files) { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -62,0 +62,0 @@ for await (const file of files) { |
@@ -141,3 +141,3 @@ import p, { stdin, stdout } from 'node:process'; | ||
const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"); | ||
return new RegExp(F, t ? void 0 : "g"); | ||
return new RegExp(F, t ? undefined : "g"); | ||
} | ||
@@ -307,6 +307,6 @@ var Q = J(); | ||
const { groups: B2 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y$1}(?<uri>.*)${w})`).exec(o.slice(E2).join("")) || { groups: {} }; | ||
if (B2.code !== void 0) { | ||
if (B2.code !== undefined) { | ||
const p2 = Number.parseFloat(B2.code); | ||
s = p2 === CD ? void 0 : p2; | ||
} else B2.uri !== void 0 && (i = B2.uri.length === 0 ? void 0 : B2.uri); | ||
s = p2 === CD ? undefined : p2; | ||
} else B2.uri !== undefined && (i = B2.uri.length === 0 ? undefined : B2.uri); | ||
} | ||
@@ -330,3 +330,3 @@ const n = iD.codes.get(Number(s)); | ||
if (typeof t == "string") return c.aliases.get(t) === u2; | ||
for (const F of t) if (F !== void 0 && k$1(F, u2)) return true; | ||
for (const F of t) if (F !== undefined && k$1(F, u2)) return true; | ||
return false; | ||
@@ -386,3 +386,3 @@ } | ||
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D(); | ||
}, this.input.pipe(e2), this.rl = f.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => { | ||
}, this.input.pipe(e2), this.rl = f.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => { | ||
this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), d(this.input, false), u2(this.value); | ||
@@ -406,3 +406,3 @@ }), this.once("cancel", () => { | ||
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(` | ||
`), d(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe(); | ||
`), d(this.input, false), this.rl?.close(), this.rl = undefined, this.emit(`${this.state}`, this.value), this.unsubscribe(); | ||
} | ||
@@ -704,3 +704,3 @@ restoreCursor() { | ||
case "undefined": { | ||
return void 0; | ||
return undefined; | ||
} | ||
@@ -707,0 +707,0 @@ case "null": { |
{ | ||
"name": "@kubb/core", | ||
"version": "0.0.0-canary-20250124174549", | ||
"version": "0.0.0-canary-20250204223927", | ||
"description": "Generator core", | ||
@@ -83,8 +83,8 @@ "keywords": [ | ||
"p-queue": "^8.1.0", | ||
"remeda": "^2.20.0", | ||
"remeda": "^2.20.1", | ||
"seedrandom": "^3.0.5", | ||
"semver": "^7.6.3", | ||
"@kubb/fs": "0.0.0-canary-20250124174549", | ||
"@kubb/parser-ts": "0.0.0-canary-20250124174549", | ||
"@kubb/types": "0.0.0-canary-20250124174549" | ||
"semver": "^7.7.1", | ||
"@kubb/fs": "0.0.0-canary-20250204223927", | ||
"@kubb/parser-ts": "0.0.0-canary-20250204223927", | ||
"@kubb/types": "0.0.0-canary-20250204223927" | ||
}, | ||
@@ -98,6 +98,6 @@ "devDependencies": { | ||
"tinyrainbow": "^1.2.0", | ||
"tsup": "^8.3.5", | ||
"tsup": "^8.3.6", | ||
"typescript": "^5.7.3", | ||
"@kubb/config-ts": "0.0.0-canary-20250124174549", | ||
"@kubb/config-tsup": "0.0.0-canary-20250124174549" | ||
"@kubb/config-ts": "0.0.0-canary-20250204223927", | ||
"@kubb/config-tsup": "0.0.0-canary-20250204223927" | ||
}, | ||
@@ -104,0 +104,0 @@ "engines": { |
@@ -12,3 +12,3 @@ import { clean, read } from '@kubb/fs' | ||
import type { Logger } from './logger.ts' | ||
import type { Config, Output, PluginContext, UserConfig } from './types.ts' | ||
import type { Config, Output, UserConfig } from './types.ts' | ||
@@ -15,0 +15,0 @@ type BuildOptions = { |
import type { PossiblePromise } from '@kubb/types' | ||
import type { Config, InputPath, UserConfig } from './types.ts' | ||
import type { InputPath, UserConfig } from './types.ts' | ||
@@ -4,0 +4,0 @@ type Args = { |
@@ -68,5 +68,2 @@ import { FileManager } from './FileManager.ts' | ||
} | ||
type GetOptionsProps<TOptions = object> = { | ||
pluginKey: Plugin['key'] | ||
} | ||
@@ -456,3 +453,3 @@ export class PluginManager { | ||
const plugins = [...this.plugins] | ||
const [searchPluginName, searchIdentifier] = pluginKey | ||
const [searchPluginName] = pluginKey | ||
@@ -459,0 +456,0 @@ return plugins.find((item) => { |
@@ -45,8 +45,4 @@ import { hookFirst, hookParallel, hookSeq } from './utils/executeStrategies.ts' | ||
function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> { | ||
return result.status === 'fulfilled' | ||
} | ||
export function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } { | ||
return result.status === 'rejected' | ||
} |
@@ -5,4 +5,2 @@ type PromiseFunc<T = unknown, T2 = never> = (state?: T) => T2 extends never ? Promise<T> : Promise<T> | T2 | ||
function noReturn(): void {} | ||
type SeqOutput<TInput extends Array<PromiseFunc<TValue, null>>, TValue> = Promise<Array<Awaited<ValueOfPromiseFuncArray<TInput>>>> | ||
@@ -49,5 +47,3 @@ | ||
const calledFunc = func(state as TValue) | ||
return calledFunc | ||
return func(state as TValue) | ||
}) | ||
@@ -79,6 +75,1 @@ } | ||
: never | ||
// tests | ||
type test = ValueOfPromiseFuncArray<Array<PromiseFunc<number, null>>> | ||
// ^? |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1496492
14688
+ Added@kubb/fs@0.0.0-canary-20250204223927(transitive)
+ Added@kubb/parser-ts@0.0.0-canary-20250204223927(transitive)
+ Added@kubb/types@0.0.0-canary-20250204223927(transitive)
+ Addedprettier@3.5.0(transitive)
- Removed@kubb/fs@0.0.0-canary-20250124174549(transitive)
- Removed@kubb/parser-ts@0.0.0-canary-20250124174549(transitive)
- Removed@kubb/types@0.0.0-canary-20250124174549(transitive)
- Removedprettier@3.5.1(transitive)
Updatedremeda@^2.20.1
Updatedsemver@^7.7.1