@kubb/cli 5.18.7 → 5.19.0
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/{Telemetry-Cbt_dJE6.cjs → Telemetry-B2TeLVo4.cjs} +2 -2
- package/dist/{Telemetry-Cbt_dJE6.cjs.map → Telemetry-B2TeLVo4.cjs.map} +1 -1
- package/dist/{Telemetry-Bf16psPO.js → Telemetry-Ctyp_EFO.js} +2 -2
- package/dist/{Telemetry-Bf16psPO.js.map → Telemetry-Ctyp_EFO.js.map} +1 -1
- package/dist/{background-Cvoxk_DQ.js → background-CByahHYn.js} +2 -2
- package/dist/{background-Cvoxk_DQ.js.map → background-CByahHYn.js.map} +1 -1
- package/dist/{background-JyYJdws1.js → background-D60rO2Lz.js} +1 -1
- package/dist/{background-3TB5Cgkv.cjs → background-D6dQxXt6.cjs} +2 -2
- package/dist/{background-3TB5Cgkv.cjs.map → background-D6dQxXt6.cjs.map} +1 -1
- package/dist/config-BKi_vTvh.js +1 -0
- package/dist/{config-DJtqFNG2.cjs → config-BU9xeaGq.cjs} +2 -2
- package/dist/{config-DJtqFNG2.cjs.map → config-BU9xeaGq.cjs.map} +1 -1
- package/dist/{config-BL4UlCHs.js → config-CGcQTdZV.js} +2 -2
- package/dist/{config-BL4UlCHs.js.map → config-CGcQTdZV.js.map} +1 -1
- package/dist/{config-BIv45u1Z.cjs → config-CkTrJD0E.cjs} +2 -2
- package/dist/{config-BIv45u1Z.cjs.map → config-CkTrJD0E.cjs.map} +1 -1
- package/dist/{config-BqDpLCPu.js → config-re864UnO.js} +4 -4
- package/dist/config-re864UnO.js.map +1 -0
- package/dist/{configFile-C_7uzuGV.cjs → configFile-B_xrd2yx.cjs} +5 -5
- package/dist/configFile-B_xrd2yx.cjs.map +1 -0
- package/dist/{configFile-B2EIouxg.js → configFile-Bh_5k4pf.js} +5 -5
- package/dist/configFile-Bh_5k4pf.js.map +1 -0
- package/dist/{fs-j84Tqpbx.js → fs-CWRKTIst.js} +83 -7
- package/dist/fs-CWRKTIst.js.map +1 -0
- package/dist/index.cjs +12 -12
- package/dist/index.js +12 -12
- package/dist/{installWithSpinner-C4gKZ7r5.js → installWithSpinner-RJhWCsgh.js} +2 -2
- package/dist/{installWithSpinner-C4gKZ7r5.js.map → installWithSpinner-RJhWCsgh.js.map} +1 -1
- package/dist/{installWithSpinner-YEtb8cNf.cjs → installWithSpinner-qjIqjyiW.cjs} +3 -3
- package/dist/{installWithSpinner-YEtb8cNf.cjs.map → installWithSpinner-qjIqjyiW.cjs.map} +1 -1
- package/dist/{mascot-ZEiXQ_LT.cjs → mascot-CLw0Qmln.cjs} +10 -6
- package/dist/{mascot-ZEiXQ_LT.cjs.map → mascot-CLw0Qmln.cjs.map} +1 -1
- package/dist/{mascot-kx6WDntR.js → mascot-b4yXsKwl.js} +10 -6
- package/dist/mascot-b4yXsKwl.js.map +1 -0
- package/dist/{mcp-DFPXRd6M.js → mcp-BrB7TJZU.js} +2 -2
- package/dist/{mcp-DFPXRd6M.js.map → mcp-BrB7TJZU.js.map} +1 -1
- package/dist/{mcp-CIMQ8g_J.cjs → mcp-D2gcpCcx.cjs} +2 -2
- package/dist/{mcp-CIMQ8g_J.cjs.map → mcp-D2gcpCcx.cjs.map} +1 -1
- package/dist/package-CcsdQpSf.js +5 -0
- package/dist/package-CcsdQpSf.js.map +1 -0
- package/dist/{package-C482iN7Y.cjs → package-DM5mr0Yc.cjs} +2 -2
- package/dist/package-DM5mr0Yc.cjs.map +1 -0
- package/dist/{reporters-De3ynr5a.js → reporters-B6p0n7s3.js} +226 -132
- package/dist/reporters-B6p0n7s3.js.map +1 -0
- package/dist/{reporters-DJPMb1-j.js → reporters-BDzKLpyo.js} +1 -1
- package/dist/{reporters-yVmLpEoU.cjs → reporters-DLK4D0js.cjs} +226 -132
- package/dist/reporters-DLK4D0js.cjs.map +1 -0
- package/dist/{run-D7AQwBWZ.cjs → run-3OxB7Zxn.cjs} +6 -6
- package/dist/{run-D7AQwBWZ.cjs.map → run-3OxB7Zxn.cjs.map} +1 -1
- package/dist/{run-D-3F2mhJ.cjs → run-4MUhIiPj.cjs} +4 -4
- package/dist/{run-D-3F2mhJ.cjs.map → run-4MUhIiPj.cjs.map} +1 -1
- package/dist/{run-w0kr76jl.cjs → run-6qjg9Twy.cjs} +9 -9
- package/dist/{run-w0kr76jl.cjs.map → run-6qjg9Twy.cjs.map} +1 -1
- package/dist/{run-BVz9vmbt.js → run-B3TuKUr4.js} +6 -6
- package/dist/{run-BVz9vmbt.js.map → run-B3TuKUr4.js.map} +1 -1
- package/dist/{run-DYr--XFw.js → run-BJiP4ib3.js} +1 -1
- package/dist/{run-B-PAQSVx.js → run-BSsTBfse.js} +7 -7
- package/dist/{run-B-PAQSVx.js.map → run-BSsTBfse.js.map} +1 -1
- package/dist/{run-puNdxNuf.cjs → run-C2lQXYrF.cjs} +74 -23
- package/dist/run-C2lQXYrF.cjs.map +1 -0
- package/dist/{run-DD1VdcpX.cjs → run-C6tE9zTS.cjs} +8 -8
- package/dist/{run-DD1VdcpX.cjs.map → run-C6tE9zTS.cjs.map} +1 -1
- package/dist/{run-jGpJxxmr.js → run-CC9TBCph.js} +5 -5
- package/dist/{run-jGpJxxmr.js.map → run-CC9TBCph.js.map} +1 -1
- package/dist/{run-D1hHaTDJ.js → run-CcWmws1R.js} +4 -4
- package/dist/{run-D1hHaTDJ.js.map → run-CcWmws1R.js.map} +1 -1
- package/dist/{run-DVbHd7qm.js → run-Cxfs1SLQ.js} +74 -23
- package/dist/run-Cxfs1SLQ.js.map +1 -0
- package/dist/{run-DwPkySke.cjs → run-D0HO6_Yr.cjs} +5 -5
- package/dist/{run-DwPkySke.cjs.map → run-D0HO6_Yr.cjs.map} +1 -1
- package/dist/{run-BjWqOCAj.js → run-D2tJP_b8.js} +2 -2
- package/dist/{run-BjWqOCAj.js.map → run-D2tJP_b8.js.map} +1 -1
- package/dist/{run-Bc34cwzh.js → run-DFOjQVMO.js} +8 -8
- package/dist/{run-Bc34cwzh.js.map → run-DFOjQVMO.js.map} +1 -1
- package/dist/{run-nSTiS72Z.js → run-Dyzva1xB.js} +8 -8
- package/dist/{run-nSTiS72Z.js.map → run-Dyzva1xB.js.map} +1 -1
- package/dist/{run-BGkdpZwR.cjs → run-ejmyJI37.cjs} +2 -2
- package/dist/{run-BGkdpZwR.cjs.map → run-ejmyJI37.cjs.map} +1 -1
- package/dist/{run-hqWFyi0N.cjs → run-lH8k2FY7.cjs} +8 -8
- package/dist/{run-hqWFyi0N.cjs.map → run-lH8k2FY7.cjs.map} +1 -1
- package/dist/{snapshot-DRyGykFq.cjs → snapshot-DdRni_x5.cjs} +5 -5
- package/dist/{snapshot-DRyGykFq.cjs.map → snapshot-DdRni_x5.cjs.map} +1 -1
- package/dist/{snapshot-eO0_VdUy.js → snapshot-DnqAAzKE.js} +5 -5
- package/dist/{snapshot-eO0_VdUy.js.map → snapshot-DnqAAzKE.js.map} +1 -1
- package/dist/{spinner-CdX9Noe9.cjs → spinner-BQgUoe7F.cjs} +93 -6
- package/dist/spinner-BQgUoe7F.cjs.map +1 -0
- package/dist/{status-NqYVjTY8.js → status-X9BNNp9F.js} +3 -3
- package/dist/{status-NqYVjTY8.js.map → status-X9BNNp9F.js.map} +1 -1
- package/dist/{status-DICY3TJQ.cjs → status-wHJjD3Fs.cjs} +3 -3
- package/dist/{status-DICY3TJQ.cjs.map → status-wHJjD3Fs.cjs.map} +1 -1
- package/dist/{studio-BfR2KY0b.cjs → studio-j4As00N6.cjs} +12 -12
- package/dist/{studio-BfR2KY0b.cjs.map → studio-j4As00N6.cjs.map} +1 -1
- package/dist/{studio-gu56JqH0.js → studio-rRSg33RE.js} +12 -12
- package/dist/{studio-gu56JqH0.js.map → studio-rRSg33RE.js.map} +1 -1
- package/dist/studioWorker.js +2 -2
- package/dist/{utils-DGopc0Bo.js → utils-DnmjcKb0.js} +5 -11
- package/dist/utils-DnmjcKb0.js.map +1 -0
- package/dist/{utils-D19HX-lE.cjs → utils-_hY0r-7x.cjs} +6 -12
- package/dist/utils-_hY0r-7x.cjs.map +1 -0
- package/dist/{validate-DoSQad-i.js → validate-CSbYneXo.js} +2 -2
- package/dist/{validate-DoSQad-i.js.map → validate-CSbYneXo.js.map} +1 -1
- package/dist/{validate-BXSS6BSO.cjs → validate-CyxoAzEK.cjs} +2 -2
- package/dist/{validate-BXSS6BSO.cjs.map → validate-CyxoAzEK.cjs.map} +1 -1
- package/package.json +7 -7
- package/dist/config-BqDpLCPu.js.map +0 -1
- package/dist/config-CGpzjjPV.js +0 -1
- package/dist/configFile-B2EIouxg.js.map +0 -1
- package/dist/configFile-C_7uzuGV.cjs.map +0 -1
- package/dist/fs-j84Tqpbx.js.map +0 -1
- package/dist/mascot-kx6WDntR.js.map +0 -1
- package/dist/package-C482iN7Y.cjs.map +0 -1
- package/dist/package-DqSfSjr4.js +0 -5
- package/dist/package-DqSfSjr4.js.map +0 -1
- package/dist/reporters-De3ynr5a.js.map +0 -1
- package/dist/reporters-yVmLpEoU.cjs.map +0 -1
- package/dist/run-DVbHd7qm.js.map +0 -1
- package/dist/run-puNdxNuf.cjs.map +0 -1
- package/dist/spinner-CdX9Noe9.cjs.map +0 -1
- package/dist/utils-D19HX-lE.cjs.map +0 -1
- package/dist/utils-DGopc0Bo.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs-CWRKTIst.js","names":[],"sources":["../../../internals/utils/src/promise.ts","../../../internals/utils/src/fs.ts"],"sourcesContent":["/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\ntype Store<TKey, TValue> = {\n has(key: TKey): boolean\n get(key: TKey): TValue | undefined\n set(key: TKey, value: TValue): unknown\n}\n\n/**\n * Returns the value cached under `key` in `store`, computing and storing it on the first call.\n * Pass a `WeakMap` for object keys, so an entry goes away with its key, or a `Map` for primitive\n * keys. A cached `null` or `undefined` counts as a hit, so `compute` runs once per key.\n *\n * @example\n * `const refs = memo(refCache, node, () => collectRefs(node))`\n */\nexport function memo<TKey, TValue>(store: Store<TKey, TValue>, key: TKey, compute: () => TValue): TValue {\n const cached = store.get(key)\n if (cached !== undefined || store.has(key)) return cached as TValue\n const value = compute()\n store.set(key, value)\n return value\n}\n\n/**\n * Creates a store for `memo`. With no options it is a `Map`. Each option changes one thing:\n *\n * - `weak` holds the keys weakly, in a `WeakMap`, so an entry goes away with its key.\n * - `max` bounds the store: it empties itself before the entry that would pass `max`, which keeps a\n * cache in a long-running process from growing without end. `max: 1` keeps only the last entry.\n *\n * @example\n * `const patterns = memo.create<string, RegExp>()`\n *\n * @example Freed with its key\n * `const refs = memo.create<SchemaNode, Array<string>>({ weak: true })`\n *\n * @example Bounded\n * `const names = memo.create<string, string>({ max: 100_000 })`\n *\n * @example Many values per key\n * ```ts\n * const filesByPlugin = memo.create<string, Array<string>>()\n * memo(filesByPlugin, 'plugin-ts', () => []).push('models.ts')\n * ```\n */\nfunction createStore<TKey, TValue>(options?: { weak?: false; max?: undefined }): Map<TKey, TValue>\nfunction createStore<TKey extends WeakKey, TValue>(options: { weak: true; max?: undefined }): WeakMap<TKey, TValue>\nfunction createStore<TKey, TValue>(options: { max: number; weak?: false }): Store<TKey, TValue>\nfunction createStore<TKey, TValue>({ weak, max }: { weak?: boolean; max?: number } = {}): Store<TKey, TValue> {\n if (weak) return new WeakMap<WeakKey, TValue>() as Store<TKey, TValue>\n const entry = new Map<TKey, TValue>()\n if (max === undefined) return entry\n const set = (key: TKey, value: TValue) => {\n if (entry.size >= max) entry.clear()\n entry.set(key, value)\n }\n if (max !== 1) return { has: (key) => entry.has(key), get: (key) => entry.get(key), set }\n // A key equal to the stored one but a different object, such as a copy of a string, replaces the\n // stored key, so the next lookup is an identity hit instead of a full comparison.\n const touch = (key: TKey) => {\n if (!entry.has(key)) return false\n set(key, entry.get(key) as TValue)\n return true\n }\n return { has: touch, get: (key) => (touch(key) ? entry.get(key) : undefined), set }\n}\n\nmemo.create = createStore\n\ntype ParallelOptions<TItem> = {\n /**\n * Items to work through, handed out in order.\n */\n items: ReadonlyArray<TItem>\n /**\n * How many items may be in flight at once.\n */\n limit: number\n /**\n * Runs once per item, with the item's position so a caller can report progress.\n */\n run(item: TItem, index: number): Promise<void>\n}\n\n/**\n * Runs `run` over every item with at most `limit` in flight. Workers share one iterator, so each\n * takes the next item the moment it frees up instead of waiting for a batch to drain.\n *\n * @example\n * ```ts\n * await inParallel({ items: files, limit: 50, run: (file) => storage.writeItem(file.path, file.source) })\n * ```\n */\nexport async function inParallel<TItem>({ items, limit, run }: ParallelOptions<TItem>): Promise<void> {\n const queue = items.entries()\n\n const worker = async (): Promise<void> => {\n for (const [index, item] of queue) await run(item, index)\n }\n\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()))\n}\n","import { existsSync, readFile, readFileSync, writeFile } from 'node:fs'\nimport { access, glob as globNode, mkdir } from 'node:fs/promises'\nimport { dirname, isAbsolute, join, relative, resolve } from 'node:path'\nimport { runtime } from './runtime.ts'\n\nexport { existsSync } from 'node:fs'\nexport { mkdir, mkdtemp, rm } from 'node:fs/promises'\n\n/**\n * Resolves to `true` when the file or directory at `path` exists.\n * Uses `Bun.file().exists()` when running under Bun, `fs.access` otherwise.\n *\n * @example\n * ```ts\n * if (await exists('./kubb.config.ts')) {\n * const content = await read('./kubb.config.ts')\n * }\n * ```\n */\nexport async function exists(path: string): Promise<boolean> {\n if (runtime.isBun) {\n return Bun.file(path).exists()\n }\n return access(path).then(\n () => true,\n () => false,\n )\n}\n\n/**\n * Reads the file at `path` as a UTF-8 string.\n * Uses `Bun.file().text()` when running under Bun, `fs.readFile` otherwise.\n *\n * @example\n * ```ts\n * const source = await read('./src/Pet.ts')\n * ```\n */\nexport async function read(path: string): Promise<string> {\n if (runtime.isBun) {\n return Bun.file(path).text()\n }\n // The callback API skips the `FileHandle` every `fs/promises` call opens.\n return new Promise((resolvePromise, reject) => readFile(path, { encoding: 'utf8' }, (error, data) => (error ? reject(error) : resolvePromise(data))))\n}\n\n/**\n * Reads the file at `path` as a UTF-8 string, or `null` when it does not exist or cannot be read.\n * Uses `Bun.file().text()` when running under Bun, `fs.readFileSync` otherwise.\n *\n * @example\n * ```ts\n * const stored = await readIfExists('./src/gen/Pet.ts') // null on a first run\n * ```\n */\nexport async function readIfExists(path: string): Promise<string | null> {\n if (runtime.isBun) {\n return Bun.file(path)\n .text()\n .catch(() => null)\n }\n // A small read is faster on the main thread than a thread-pool round trip, and `existsSync`\n // answers a missing file without building an error.\n if (!existsSync(path)) return null\n try {\n return readFileSync(path, 'utf8')\n } catch (_error) {\n return null\n }\n}\n\ntype WriteOptions = {\n /**\n * Previously read content, or `null` when the file does not exist.\n * Omitting this value reads the file before writing.\n */\n stored?: string | null\n /**\n * When `true`, re-reads the file immediately after writing and throws if the\n * content does not match — useful for catching write failures on unreliable file systems.\n */\n sanity?: boolean\n}\n\n/**\n * Whether `stored` already holds `source`, comparing on the trimmed text rather than the exact\n * bytes. Surrounding whitespace is what a formatter adds and what editors strip, and neither is a\n * reason to rewrite the file.\n *\n * Both sides are trimmed, so a storage that keeps bytes verbatim settles on the same answer as one\n * that normalizes what it stores. Trimming only `stored` would leave a source with leading\n * whitespace rewritten on every build, since the stored copy keeps the whitespace the comparison\n * has already dropped.\n */\nexport function matchesStored({ stored, source }: { stored: string; source: string }): boolean {\n return stored.trim() === source.trim()\n}\n\n/**\n * Writes `data` to `path`, trimming surrounding whitespace and ending the file with a single newline\n * the way prettier, biome, and oxfmt all do.\n * Skips the write when the trimmed content is empty, or when the file already holds that content.\n * Creates any missing parent directories automatically.\n * When `sanity` is `true`, re-reads the file after writing and throws if the content does not match.\n *\n * @example\n * ```ts\n * await write('./src/Pet.ts', source) // writes and returns the trimmed content plus a newline\n * await write('./src/Pet.ts', source) // null — file unchanged\n * await write('./src/Pet.ts', ' ') // null — empty content skipped\n * ```\n */\nexport async function write(path: string, data: string, options: WriteOptions = {}): Promise<string | null> {\n const trimmed = data.trim()\n if (trimmed === '') return null\n\n const content = `${trimmed}\\n`\n const resolved = resolve(path)\n const stored = options.stored === undefined ? await readIfExists(resolved) : options.stored\n if (matchesStored({ stored: stored ?? '', source: trimmed })) return null\n\n await writeRaw(resolved, content)\n\n if (options.sanity) {\n const savedData = await read(resolved)\n if (savedData !== content) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n return savedData\n }\n\n return content\n}\n\n/**\n * Writes UTF-8 content verbatim, including empty files and surrounding whitespace.\n * Uses Bun.write under Bun and creates missing parent directories under either runtime.\n *\n * @example\n * await writeRaw('./cache/output.ts', ' // keep these bytes\\n\\n')\n */\nexport async function writeRaw(path: string, content: string): Promise<void> {\n const resolved = resolve(path)\n if (runtime.isBun) {\n await Bun.write(resolved, content)\n return\n }\n try {\n await new Promise<void>((resolvePromise, reject) =>\n writeFile(resolved, content, { encoding: 'utf-8' }, (error) => (error ? reject(error) : resolvePromise())),\n )\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n await mkdir(dirname(resolved), { recursive: true })\n await new Promise<void>((resolvePromise, reject) =>\n writeFile(resolved, content, { encoding: 'utf-8' }, (error) => (error ? reject(error) : resolvePromise())),\n )\n }\n}\n\n/**\n * Lists non-hidden regular files below `directory` as relative POSIX paths, excluding directories and symlinks.\n * Uses Bun.Glob under Bun because its Node glob compatibility API lacks directory-entry support.\n *\n * @example\n * for await (const path of listFiles('./src')) console.log(path)\n */\nexport async function* listFiles(directory: string): AsyncGenerator<string> {\n const cwd = resolve(directory)\n if (runtime.isBun) {\n yield* new Bun.Glob('**/*').scan({ cwd, dot: false, onlyFiles: true, followSymlinks: false })\n return\n }\n for await (const entry of globNode('**/*', { cwd, withFileTypes: true })) {\n if (entry.isFile()) yield toPosixPath(relative(cwd, join(entry.parentPath, entry.name)))\n }\n}\n\n/**\n * Converts a filesystem path to use POSIX (`/`) separators.\n *\n * Most of the codebase compares and composes paths as strings (prefix matching, joining for\n * import specifiers, splitting on `/`). On POSIX `path.resolve` already returns `/`-separated\n * paths, but on Windows it returns `\\`-separated paths, which breaks every such comparison.\n *\n * Routing every path that crosses a module boundary through `toPosixPath` keeps the rest of the\n * code platform-agnostic. The conversion runs unconditionally so Windows-specific behavior is\n * exercisable from POSIX CI.\n *\n * @example\n * toPosixPath('C:\\\\repo\\\\src\\\\pet.ts') // 'C:/repo/src/pet.ts'\n */\nexport function toPosixPath(filePath: string): string {\n return filePath.replaceAll('\\\\', '/')\n}\n\n/**\n * Resolves to `true` when `path` is `parent` itself or nested inside it. Both sides are resolved\n * to absolute paths first, so relative and `..`-containing inputs compare correctly.\n *\n * Guards a destructive or an out-of-tree operation: before wiping an output directory, check that\n * it does not contain the project root, and before loading a path a caller supplied, check that it\n * did not escape the directory it is allowed to read from.\n *\n * @example\n * isPathInside('./src/gen', '.') // true — nested inside the root\n * isPathInside('.', '.') // true — the same directory counts as inside\n * isPathInside('.', './src/gen') // false — the root is not inside its own output\n * isPathInside('../other', '.') // false — escapes the root\n */\nexport function isPathInside(path: string, parent: string): boolean {\n const resolvedPath = resolve(path)\n const resolvedParent = resolve(parent)\n if (resolvedPath === resolvedParent) {\n return true\n }\n\n const rel = relative(resolvedParent, resolvedPath)\n\n return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel)\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAgB,KAAmB,OAA4B,KAAW,SAA+B;CACvG,MAAM,SAAS,MAAM,IAAI,GAAG;CAC5B,IAAI,WAAW,KAAA,KAAa,MAAM,IAAI,GAAG,GAAG,OAAO;CACnD,MAAM,QAAQ,QAAQ;CACtB,MAAM,IAAI,KAAK,KAAK;CACpB,OAAO;AACT;AA2BA,SAAS,YAA0B,EAAE,MAAM,QAA0C,CAAC,GAAwB;CAC5G,IAAI,MAAM,uBAAO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,IAAI,UAAW,QAAQ,OAAO,KAAK,IAAI,eAAe,CAAE,CAC3G;CACF,SAAS,OAAO;EACd,IAAK,MAAgC,SAAS,UAAU,MAAM;EAC9D,MAAM,MAAM,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EAClD,MAAM,IAAI,SAAe,gBAAgB,WACvC,UAAU,UAAU,SAAS,EAAE,UAAU,QAAQ,IAAI,UAAW,QAAQ,OAAO,KAAK,IAAI,eAAe,CAAE,CAC3G;CACF;AACF;;;;;;;;;;;;;;;AAkCA,SAAgB,YAAY,UAA0B;CACpD,OAAO,SAAS,WAAW,MAAM,GAAG;AACtC;;;;;;;;;;;;;;;AAgBA,SAAgB,aAAa,MAAc,QAAyB;CAClE,MAAM,eAAe,QAAQ,IAAI;CACjC,MAAM,iBAAiB,QAAQ,MAAM;CACrC,IAAI,iBAAiB,gBACnB,OAAO;CAGT,MAAM,MAAM,SAAS,gBAAgB,YAAY;CAEjD,OAAO,QAAQ,MAAM,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,WAAW,GAAG;AAC/D"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
3
|
-
const require_Telemetry = require("./Telemetry-
|
|
4
|
-
const require_package = require("./package-
|
|
5
|
-
const require_mascot = require("./mascot-
|
|
3
|
+
const require_Telemetry = require("./Telemetry-B2TeLVo4.cjs");
|
|
4
|
+
const require_package = require("./package-DM5mr0Yc.cjs");
|
|
5
|
+
const require_mascot = require("./mascot-CLw0Qmln.cjs");
|
|
6
6
|
const require_shared = require("./shared-DoD3p_X8.cjs");
|
|
7
7
|
let node_util = require("node:util");
|
|
8
8
|
let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
|
|
@@ -88,7 +88,7 @@ const command = (0, gunshi.defineWithTypes)()({
|
|
|
88
88
|
async run(ctx) {
|
|
89
89
|
const { values } = ctx;
|
|
90
90
|
const logLevel = resolveLogLevel(values);
|
|
91
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
91
|
+
const { run } = await Promise.resolve().then(() => require("./run-C2lQXYrF.cjs"));
|
|
92
92
|
await run({
|
|
93
93
|
input: values.input,
|
|
94
94
|
configPath: values.config,
|
|
@@ -134,13 +134,13 @@ function resolveDeprecatedFlags(args) {
|
|
|
134
134
|
// src/index.ts
|
|
135
135
|
/** The subcommands besides `generate`, imported only when the run needs them, so `kubb generate` never loads their code. */
|
|
136
136
|
const commandLoaders = {
|
|
137
|
-
init: () => Promise.resolve().then(() => require("./run-
|
|
138
|
-
validate: () => Promise.resolve().then(() => require("./validate-
|
|
139
|
-
mcp: () => Promise.resolve().then(() => require("./mcp-
|
|
140
|
-
studio: () => Promise.resolve().then(() => require("./studio-
|
|
141
|
-
add: () => Promise.resolve().then(() => require("./run-
|
|
142
|
-
update: () => Promise.resolve().then(() => require("./run-
|
|
143
|
-
remove: () => Promise.resolve().then(() => require("./run-
|
|
137
|
+
init: () => Promise.resolve().then(() => require("./run-lH8k2FY7.cjs")),
|
|
138
|
+
validate: () => Promise.resolve().then(() => require("./validate-CyxoAzEK.cjs")),
|
|
139
|
+
mcp: () => Promise.resolve().then(() => require("./mcp-D2gcpCcx.cjs")),
|
|
140
|
+
studio: () => Promise.resolve().then(() => require("./studio-j4As00N6.cjs")),
|
|
141
|
+
add: () => Promise.resolve().then(() => require("./run-3OxB7Zxn.cjs")),
|
|
142
|
+
update: () => Promise.resolve().then(() => require("./run-C6tE9zTS.cjs")),
|
|
143
|
+
remove: () => Promise.resolve().then(() => require("./run-D0HO6_Yr.cjs")),
|
|
144
144
|
list: () => Promise.resolve().then(() => require("./run-D15oxCOd.cjs"))
|
|
145
145
|
};
|
|
146
146
|
/** Flags that print the root help, which lists every subcommand. */
|
|
@@ -164,7 +164,7 @@ async function run(argv = process.argv.slice(2)) {
|
|
|
164
164
|
if (Object.hasOwn(commandLoaders, name)) names = [name];
|
|
165
165
|
if (!names.length && resolvedArgs.some((arg) => HELP_FLAGS.has(arg))) names = Object.keys(commandLoaders);
|
|
166
166
|
const modules = Object.fromEntries(await Promise.all(names.map(async (key) => [key, await commandLoaders[key]()])));
|
|
167
|
-
const args = name === "studio" ? (await Promise.resolve().then(() => require("./studio-
|
|
167
|
+
const args = name === "studio" ? (await Promise.resolve().then(() => require("./studio-j4As00N6.cjs"))).routeStudioFlags(resolvedArgs) : resolvedArgs;
|
|
168
168
|
const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg));
|
|
169
169
|
const isJsonOutput = args.includes("--json") || args.some((arg, index) => /^--reporter=.*\bjson\b/.test(arg) || arg === "--reporter" && /\bjson\b/.test(args[index + 1] ?? ""));
|
|
170
170
|
if (!require_Telemetry.isDisabled() && !isQuietFlag) console.error(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./rolldown-runtime-BowF1xt-.js";
|
|
2
|
-
import { t as isDisabled } from "./Telemetry-
|
|
3
|
-
import { t as version } from "./package-
|
|
4
|
-
import { r as wantsMascot, t as getBanner } from "./mascot-
|
|
2
|
+
import { t as isDisabled } from "./Telemetry-Ctyp_EFO.js";
|
|
3
|
+
import { t as version } from "./package-CcsdQpSf.js";
|
|
4
|
+
import { r as wantsMascot, t as getBanner } from "./mascot-b4yXsKwl.js";
|
|
5
5
|
import { n as dryRunId, r as logLevelArg, t as configArg } from "./shared-SrKde4x4.js";
|
|
6
6
|
import { styleText } from "node:util";
|
|
7
7
|
import dryrun from "@gunshi/plugin-dryrun";
|
|
@@ -86,7 +86,7 @@ const command = defineWithTypes()({
|
|
|
86
86
|
async run(ctx) {
|
|
87
87
|
const { values } = ctx;
|
|
88
88
|
const logLevel = resolveLogLevel(values);
|
|
89
|
-
const { run } = await import("./run-
|
|
89
|
+
const { run } = await import("./run-Cxfs1SLQ.js");
|
|
90
90
|
await run({
|
|
91
91
|
input: values.input,
|
|
92
92
|
configPath: values.config,
|
|
@@ -132,13 +132,13 @@ function resolveDeprecatedFlags(args) {
|
|
|
132
132
|
// src/index.ts
|
|
133
133
|
/** The subcommands besides `generate`, imported only when the run needs them, so `kubb generate` never loads their code. */
|
|
134
134
|
const commandLoaders = {
|
|
135
|
-
init: () => import("./run-
|
|
136
|
-
validate: () => import("./validate-
|
|
137
|
-
mcp: () => import("./mcp-
|
|
138
|
-
studio: () => import("./studio-
|
|
139
|
-
add: () => import("./run-
|
|
140
|
-
update: () => import("./run-
|
|
141
|
-
remove: () => import("./run-
|
|
135
|
+
init: () => import("./run-Dyzva1xB.js"),
|
|
136
|
+
validate: () => import("./validate-CSbYneXo.js"),
|
|
137
|
+
mcp: () => import("./mcp-BrB7TJZU.js"),
|
|
138
|
+
studio: () => import("./studio-rRSg33RE.js"),
|
|
139
|
+
add: () => import("./run-B3TuKUr4.js"),
|
|
140
|
+
update: () => import("./run-BSsTBfse.js"),
|
|
141
|
+
remove: () => import("./run-CC9TBCph.js"),
|
|
142
142
|
list: () => import("./run-C4fd98gp.js")
|
|
143
143
|
};
|
|
144
144
|
/** Flags that print the root help, which lists every subcommand. */
|
|
@@ -162,7 +162,7 @@ async function run(argv = process.argv.slice(2)) {
|
|
|
162
162
|
if (Object.hasOwn(commandLoaders, name)) names = [name];
|
|
163
163
|
if (!names.length && resolvedArgs.some((arg) => HELP_FLAGS.has(arg))) names = Object.keys(commandLoaders);
|
|
164
164
|
const modules = Object.fromEntries(await Promise.all(names.map(async (key) => [key, await commandLoaders[key]()])));
|
|
165
|
-
const args = name === "studio" ? (await import("./studio-
|
|
165
|
+
const args = name === "studio" ? (await import("./studio-rRSg33RE.js")).routeStudioFlags(resolvedArgs) : resolvedArgs;
|
|
166
166
|
const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg));
|
|
167
167
|
const isJsonOutput = args.includes("--json") || args.some((arg, index) => /^--reporter=.*\bjson\b/.test(arg) || arg === "--reporter" && /\bjson\b/.test(args[index + 1] ?? ""));
|
|
168
168
|
if (!isDisabled() && !isQuietFlag) console.error(`${styleText("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
|
|
@@ -2,7 +2,7 @@ import "./rolldown-runtime-BowF1xt-.js";
|
|
|
2
2
|
import { n as getElapsedMs, t as formatMs } from "./time-D7ONPPZf.js";
|
|
3
3
|
import { n as isRichOutput } from "./env-BYZIPHqz.js";
|
|
4
4
|
import { t as createSpinner } from "./spinner-D5DgYSS5.js";
|
|
5
|
-
import { s as installPackages } from "./utils-
|
|
5
|
+
import { s as installPackages } from "./utils-DnmjcKb0.js";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import * as clack from "@clack/prompts";
|
|
8
8
|
// src/runners/installWithSpinner.ts
|
|
@@ -46,4 +46,4 @@ function createTask(title) {
|
|
|
46
46
|
}
|
|
47
47
|
export { installWithSpinner as t };
|
|
48
48
|
|
|
49
|
-
//# sourceMappingURL=installWithSpinner-
|
|
49
|
+
//# sourceMappingURL=installWithSpinner-RJhWCsgh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installWithSpinner-
|
|
1
|
+
{"version":3,"file":"installWithSpinner-RJhWCsgh.js","names":[],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAU,mBAQM;CAChB,MAAM,QAAQ,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAM,SAAS,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAI,aAAa,GAAG;EAClB,MAAM,MAAM,MAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAU,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
|
|
2
2
|
const require_time = require("./time-D4xUq6tx.cjs");
|
|
3
3
|
const require_env = require("./env-Bi4GXVdd.cjs");
|
|
4
|
-
const require_spinner = require("./spinner-
|
|
5
|
-
const require_utils = require("./utils-
|
|
4
|
+
const require_spinner = require("./spinner-BQgUoe7F.cjs");
|
|
5
|
+
const require_utils = require("./utils-_hY0r-7x.cjs");
|
|
6
6
|
let node_process = require("node:process");
|
|
7
7
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
8
8
|
let _clack_prompts = require("@clack/prompts");
|
|
@@ -53,4 +53,4 @@ Object.defineProperty(exports, "installWithSpinner", {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
//# sourceMappingURL=installWithSpinner-
|
|
56
|
+
//# sourceMappingURL=installWithSpinner-qjIqjyiW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installWithSpinner-
|
|
1
|
+
{"version":3,"file":"installWithSpinner-qjIqjyiW.cjs","names":["installPackages","process","formatMs","getElapsedMs","isRichOutput","clack","createSpinner"],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAUA,cAAAA,mBAQM;CAChB,MAAM,QAAQC,aAAAA,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAMC,aAAAA,SAASC,aAAAA,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAIC,YAAAA,aAAa,GAAG;EAClB,MAAM,MAAMC,eAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAUC,gBAAAA,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
|
|
@@ -42,20 +42,24 @@ function getBanner(version, command) {
|
|
|
42
42
|
return canDrawMascot(version, command) ? `\n${bannerIntro(version, "open", command)}` : `Kubb CLI v${version}`;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Opens `kubb generate` with the mascot playing its wake-up frames in place
|
|
46
|
-
*
|
|
45
|
+
* Opens `kubb generate` with the mascot playing its wake-up frames in place. Once `signal` aborts,
|
|
46
|
+
* it jumps to the last frame, so the animation never holds up work that is already done.
|
|
47
|
+
* Elsewhere the still {@link getBanner} is the header.
|
|
47
48
|
*/
|
|
48
|
-
async function logBanner(version) {
|
|
49
|
+
async function logBanner({ version, signal }) {
|
|
49
50
|
if (!canDrawMascot(version, "generate")) {
|
|
50
51
|
console.log(getBanner(version, "generate"));
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
54
|
+
const [lastExpression] = require_banner.wakeUp.at(-1);
|
|
53
55
|
console.log("");
|
|
54
56
|
for (const [index, [expression, ms]] of require_banner.wakeUp.entries()) {
|
|
55
|
-
const
|
|
57
|
+
const cut = signal?.aborted ?? false;
|
|
58
|
+
const frame = bannerIntro(version, cut ? lastExpression : expression, "generate");
|
|
56
59
|
if (index > 0) process.stdout.moveCursor(0, -frame.split("\n").length);
|
|
57
60
|
console.log(frame);
|
|
58
|
-
|
|
61
|
+
if (cut) return;
|
|
62
|
+
await (0, node_timers_promises.setTimeout)(ms, void 0, { signal }).catch(() => void 0);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
Object.defineProperty(exports, "getBanner", {
|
|
@@ -77,4 +81,4 @@ Object.defineProperty(exports, "wantsMascot", {
|
|
|
77
81
|
}
|
|
78
82
|
});
|
|
79
83
|
|
|
80
|
-
//# sourceMappingURL=mascot-
|
|
84
|
+
//# sourceMappingURL=mascot-CLw0Qmln.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mascot-
|
|
1
|
+
{"version":3,"file":"mascot-CLw0Qmln.cjs","names":["getIntro","isRichOutput","stripVTControlCharacters","isInteractiveRun","wakeUp","sleep"],"sources":["../src/ui/mascot.ts"],"sourcesContent":["import { setTimeout as sleep } from 'node:timers/promises'\nimport { stripVTControlCharacters } from 'node:util'\nimport { isRichOutput } from '../utils/env.ts'\nimport { type Expression, getIntro, wakeUp } from '../loggers/banner.ts'\nimport { isInteractiveRun } from './intro.ts'\n\nfunction bannerIntro(version: string, expression: Expression, command: string): string {\n return getIntro({ title: 'Turn your API spec into type-safe code', description: `kubb ${command}`, version, expression })\n}\n\n/** Whether the mascot can be drawn: a rich, 256-color terminal wide enough that no line wraps and throws off a redraw. */\nfunction canDrawMascot(version: string, command: string): boolean {\n if (!isRichOutput() || !process.stdout.hasColors(256)) return false\n\n return stripVTControlCharacters(bannerIntro(version, 'open', command))\n .split('\\n')\n .every((line) => line.length <= process.stdout.columns)\n}\n\n/**\n * Whether a command opens with the mascot. Only the long-running ones do: `generate`, a Studio\n * session or pairing, and `add` or `update` while they ask questions. Quick commands print only\n * their result.\n */\nexport function wantsMascot({ commandPath, values }: { commandPath: ReadonlyArray<string>; values: Record<string, unknown> }): boolean {\n const [command, subCommand] = commandPath\n if (values.help || values.version) return false\n if (command === 'studio') return subCommand === undefined || subCommand === 'connect' || subCommand === 'login'\n if (command === 'add' || command === 'update' || command === 'init') return isInteractiveRun({ yes: values.yes, dryRun: values.dryRun ?? values['dry-run'] })\n\n return command === undefined || command === 'generate'\n}\n\n/**\n * The still Kubb mascot with the version and the running command, such as `studio connect`, or a\n * single version line where the terminal cannot draw it. Commands print it as their header; it\n * draws at once, with no wake-up frames.\n */\nexport function getBanner(version: string, command: string): string {\n return canDrawMascot(version, command) ? `\\n${bannerIntro(version, 'open', command)}` : `Kubb CLI v${version}`\n}\n\n/**\n * Opens `kubb generate` with the mascot playing its wake-up frames in place. Once `signal` aborts,\n * it jumps to the last frame, so the animation never holds up work that is already done.\n * Elsewhere the still {@link getBanner} is the header.\n */\nexport async function logBanner({ version, signal }: { version: string; signal?: AbortSignal }): Promise<void> {\n if (!canDrawMascot(version, 'generate')) {\n console.log(getBanner(version, 'generate'))\n\n return\n }\n\n const [lastExpression] = wakeUp.at(-1)!\n console.log('')\n for (const [index, [expression, ms]] of wakeUp.entries()) {\n const cut = signal?.aborted ?? false\n const frame = bannerIntro(version, cut ? lastExpression : expression, 'generate')\n if (index > 0) process.stdout.moveCursor(0, -frame.split('\\n').length)\n console.log(frame)\n if (cut) return\n // An abort rejects the sleep, and the next frame jumps to the last one.\n await sleep(ms, undefined, { signal }).catch(() => undefined)\n }\n}\n"],"mappings":";;;;;;;AAMA,SAAS,YAAY,SAAiB,YAAwB,SAAyB;CACrF,OAAOA,eAAAA,SAAS;EAAE,OAAO;EAA0C,aAAa,QAAQ;EAAW;EAAS;CAAW,CAAC;AAC1H;;AAGA,SAAS,cAAc,SAAiB,SAA0B;CAChE,IAAI,CAACC,YAAAA,aAAa,KAAK,C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qBAAAA,WAAAA,CAAM,IAAI,KAAA,GAAW,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,KAAA,CAAS;CAC9D;AACF"}
|
|
@@ -42,22 +42,26 @@ function getBanner(version, command) {
|
|
|
42
42
|
return canDrawMascot(version, command) ? `\n${bannerIntro(version, "open", command)}` : `Kubb CLI v${version}`;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Opens `kubb generate` with the mascot playing its wake-up frames in place
|
|
46
|
-
*
|
|
45
|
+
* Opens `kubb generate` with the mascot playing its wake-up frames in place. Once `signal` aborts,
|
|
46
|
+
* it jumps to the last frame, so the animation never holds up work that is already done.
|
|
47
|
+
* Elsewhere the still {@link getBanner} is the header.
|
|
47
48
|
*/
|
|
48
|
-
async function logBanner(version) {
|
|
49
|
+
async function logBanner({ version, signal }) {
|
|
49
50
|
if (!canDrawMascot(version, "generate")) {
|
|
50
51
|
console.log(getBanner(version, "generate"));
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
54
|
+
const [lastExpression] = wakeUp.at(-1);
|
|
53
55
|
console.log("");
|
|
54
56
|
for (const [index, [expression, ms]] of wakeUp.entries()) {
|
|
55
|
-
const
|
|
57
|
+
const cut = signal?.aborted ?? false;
|
|
58
|
+
const frame = bannerIntro(version, cut ? lastExpression : expression, "generate");
|
|
56
59
|
if (index > 0) process.stdout.moveCursor(0, -frame.split("\n").length);
|
|
57
60
|
console.log(frame);
|
|
58
|
-
|
|
61
|
+
if (cut) return;
|
|
62
|
+
await setTimeout(ms, void 0, { signal }).catch(() => void 0);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
export { logBanner as n, wantsMascot as r, getBanner as t };
|
|
62
66
|
|
|
63
|
-
//# sourceMappingURL=mascot-
|
|
67
|
+
//# sourceMappingURL=mascot-b4yXsKwl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mascot-b4yXsKwl.js","names":["sleep"],"sources":["../src/ui/mascot.ts"],"sourcesContent":["import { setTimeout as sleep } from 'node:timers/promises'\nimport { stripVTControlCharacters } from 'node:util'\nimport { isRichOutput } from '../utils/env.ts'\nimport { type Expression, getIntro, wakeUp } from '../loggers/banner.ts'\nimport { isInteractiveRun } from './intro.ts'\n\nfunction bannerIntro(version: string, expression: Expression, command: string): string {\n return getIntro({ title: 'Turn your API spec into type-safe code', description: `kubb ${command}`, version, expression })\n}\n\n/** Whether the mascot can be drawn: a rich, 256-color terminal wide enough that no line wraps and throws off a redraw. */\nfunction canDrawMascot(version: string, command: string): boolean {\n if (!isRichOutput() || !process.stdout.hasColors(256)) return false\n\n return stripVTControlCharacters(bannerIntro(version, 'open', command))\n .split('\\n')\n .every((line) => line.length <= process.stdout.columns)\n}\n\n/**\n * Whether a command opens with the mascot. Only the long-running ones do: `generate`, a Studio\n * session or pairing, and `add` or `update` while they ask questions. Quick commands print only\n * their result.\n */\nexport function wantsMascot({ commandPath, values }: { commandPath: ReadonlyArray<string>; values: Record<string, unknown> }): boolean {\n const [command, subCommand] = commandPath\n if (values.help || values.version) return false\n if (command === 'studio') return subCommand === undefined || subCommand === 'connect' || subCommand === 'login'\n if (command === 'add' || command === 'update' || command === 'init') return isInteractiveRun({ yes: values.yes, dryRun: values.dryRun ?? values['dry-run'] })\n\n return command === undefined || command === 'generate'\n}\n\n/**\n * The still Kubb mascot with the version and the running command, such as `studio connect`, or a\n * single version line where the terminal cannot draw it. Commands print it as their header; it\n * draws at once, with no wake-up frames.\n */\nexport function getBanner(version: string, command: string): string {\n return canDrawMascot(version, command) ? `\\n${bannerIntro(version, 'open', command)}` : `Kubb CLI v${version}`\n}\n\n/**\n * Opens `kubb generate` with the mascot playing its wake-up frames in place. Once `signal` aborts,\n * it jumps to the last frame, so the animation never holds up work that is already done.\n * Elsewhere the still {@link getBanner} is the header.\n */\nexport async function logBanner({ version, signal }: { version: string; signal?: AbortSignal }): Promise<void> {\n if (!canDrawMascot(version, 'generate')) {\n console.log(getBanner(version, 'generate'))\n\n return\n }\n\n const [lastExpression] = wakeUp.at(-1)!\n console.log('')\n for (const [index, [expression, ms]] of wakeUp.entries()) {\n const cut = signal?.aborted ?? false\n const frame = bannerIntro(version, cut ? lastExpression : expression, 'generate')\n if (index > 0) process.stdout.moveCursor(0, -frame.split('\\n').length)\n console.log(frame)\n if (cut) return\n // An abort rejects the sleep, and the next frame jumps to the last one.\n await sleep(ms, undefined, { signal }).catch(() => undefined)\n }\n}\n"],"mappings":";;;;;;;AAMA,SAAS,YAAY,SAAiB,YAAwB,SAAyB;CACrF,OAAO,SAAS;EAAE,OAAO;EAA0C,aAAa,QAAQ;EAAW;EAAS;CAAW,CAAC;AAC1H;;AAGA,SAAS,cAAc,SAAiB,SAA0B;CAChE,IAAI,CAAC,aAAa,KAAK,CAAC,QAAQ,OAAO,UAAU,GAAG,GAAG,OAAO;CAE9D,OAAO,yBAAyB,YAAY,SAAS,QAAQ,OAAO,CAAC,CAAC,CACnE,MAAM,IAAI,CAAC,CACX,OAAO,SAAS,KAAK,UAAU,QAAQ,OAAO,OAAO;AAC1D;;;;;;AAOA,SAAgB,YAAY,EAAE,aAAa,UAA4F;CACrI,MAAM,CAAC,SAAS,cAAc;CAC9B,IAAI,OAAO,QAAQ,OAAO,SAAS,OAAO;CAC1C,IAAI,YAAY,UAAU,OAAO,eAAe,KAAA,KAAa,eAAe,aAAa,eAAe;CACxG,IAAI,YAAY,SAAS,YAAY,YAAY,YAAY,QAAQ,OAAO,iBAAiB;EAAE,KAAK,OAAO;EAAK,QAAQ,OAAO,UAAU,OAAO;CAAW,CAAC;CAE5J,OAAO,YAAY,KAAA,KAAa,YAAY;AAC9C;;;;;;AAOA,SAAgB,UAAU,SAAiB,SAAyB;CAClE,OAAO,cAAc,SAAS,OAAO,IAAI,KAAK,YAAY,SAAS,QAAQ,OAAO,MAAM,aAAa;AACvG;;;;;;AAOA,eAAsB,UAAU,EAAE,SAAS,UAAoE;CAC7G,IAAI,CAAC,cAAc,SAAS,UAAU,GAAG;EACvC,QAAQ,IAAI,UAAU,SAAS,UAAU,CAAC;EAE1C;CACF;CAEA,MAAM,CAAC,kBAAkB,OAAO,GAAG,EAAE;CACrC,QAAQ,IAAI,EAAE;CACd,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,QAAQ,OAAO,QAAQ,GAAG;EACxD,MAAM,MAAM,QAAQ,WAAW;EAC/B,MAAM,QAAQ,YAAY,SAAS,MAAM,iBAAiB,YAAY,UAAU;EAChF,IAAI,QAAQ,GAAG,QAAQ,OAAO,WAAW,GAAG,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC,MAAM;EACrE,QAAQ,IAAI,KAAK;EACjB,IAAI,KAAK;EAET,MAAMA,WAAM,IAAI,KAAA,GAAW,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,KAAA,CAAS;CAC9D;AACF"}
|
|
@@ -12,10 +12,10 @@ const command = define({
|
|
|
12
12
|
].join("\n"),
|
|
13
13
|
rendering: { header: null },
|
|
14
14
|
async run() {
|
|
15
|
-
const { run } = await import("./run-
|
|
15
|
+
const { run } = await import("./run-D2tJP_b8.js");
|
|
16
16
|
await run();
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
export { command };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=mcp-
|
|
21
|
+
//# sourceMappingURL=mcp-BrB7TJZU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-BrB7TJZU.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/mcp`. */\nexport const command = define({\n name: 'mcp',\n description: 'Start an MCP server for code generation from an AI assistant.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n // gunshi prints the header to stdout, which the MCP stdio transport owns.\n rendering: { header: null },\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n await run()\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,OAAO;CAC5B,MAAM;CACN,aAAa;CACb,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;CAE1J,WAAW,EAAE,QAAQ,KAAK;CAC1B,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAM,OAAO;EAC7B,MAAM,IAAI;CACZ;AACF,CAAC"}
|
|
@@ -11,10 +11,10 @@ const command = (0, require("gunshi").define)({
|
|
|
11
11
|
].join("\n"),
|
|
12
12
|
rendering: { header: null },
|
|
13
13
|
async run() {
|
|
14
|
-
const { run } = await Promise.resolve().then(() => require("./run-
|
|
14
|
+
const { run } = await Promise.resolve().then(() => require("./run-ejmyJI37.cjs"));
|
|
15
15
|
await run();
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
exports.command = command;
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=mcp-
|
|
20
|
+
//# sourceMappingURL=mcp-D2gcpCcx.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-D2gcpCcx.cjs","names":["define"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { define } from 'gunshi'\n\n/** The runner is imported when the command runs, so listing `kubb --help` never loads `@kubb/mcp`. */\nexport const command = define({\n name: 'mcp',\n description: 'Start an MCP server for code generation from an AI assistant.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'].join('\\n'),\n // gunshi prints the header to stdout, which the MCP stdio transport owns.\n rendering: { header: null },\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n await run()\n },\n})\n"],"mappings":";;;AAGA,MAAa,WAAA,G,gBAAUA,CAAAA,CAAAA,OAAAA,CAAO;CAC5B,MAAM;CACN,aAAa;CACb,UAAU;EAAC;EAAY;EAAyC;CAA+E,CAAC,CAAC,KAAK,IAAI;CAE1J,WAAW,EAAE,QAAQ,KAAK;CAC1B,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EACtB,MAAM,IAAI;CACZ;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-CcsdQpSf.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "5.
|
|
2
|
+
var version = "5.19.0";
|
|
3
3
|
Object.defineProperty(exports, "version", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
get: function() {
|
|
@@ -7,4 +7,4 @@ Object.defineProperty(exports, "version", {
|
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
//# sourceMappingURL=package-
|
|
10
|
+
//# sourceMappingURL=package-DM5mr0Yc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-DM5mr0Yc.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|