@kubb/cli 5.15.1 → 5.15.2
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-C7Qwy2s7.js → Telemetry-BLRICCFj.js} +2 -2
- package/dist/{Telemetry-C7Qwy2s7.js.map → Telemetry-BLRICCFj.js.map} +1 -1
- package/dist/{Telemetry-B52pKz9i.cjs → Telemetry-CSjCG8WO.cjs} +2 -2
- package/dist/{Telemetry-B52pKz9i.cjs.map → Telemetry-CSjCG8WO.cjs.map} +1 -1
- package/dist/{background-BJCuXYuB.js → background-BeEZZNGc.js} +2 -2
- package/dist/{background-BJCuXYuB.js.map → background-BeEZZNGc.js.map} +1 -1
- package/dist/{background-CK2gQtTU.cjs → background-BiyfuZFp.cjs} +2 -2
- package/dist/{background-CK2gQtTU.cjs.map → background-BiyfuZFp.cjs.map} +1 -1
- package/dist/{background-D4mZCg-4.js → background-QEuTfHev.js} +1 -1
- package/dist/{configFile-CoEpHdXG.cjs → configFile-CVfWdtKh.cjs} +4 -40
- package/dist/configFile-CVfWdtKh.cjs.map +1 -0
- package/dist/{configFile-C0DIXNMD.js → configFile-IHj8fRIw.js} +3 -39
- package/dist/configFile-IHj8fRIw.js.map +1 -0
- package/dist/{spinner-BZaln7O8.js → fs-Cf1FSRh9.js} +20 -41
- package/dist/fs-Cf1FSRh9.js.map +1 -0
- package/dist/index.cjs +14 -14
- package/dist/index.js +14 -14
- package/dist/{installWithSpinner-DpnpxHq5.js → installWithSpinner-BAlTSQlE.js} +3 -3
- package/dist/{installWithSpinner-DpnpxHq5.js.map → installWithSpinner-BAlTSQlE.js.map} +1 -1
- package/dist/{installWithSpinner-ONGfIVUJ.cjs → installWithSpinner-X9J7yxiR.cjs} +3 -3
- package/dist/{installWithSpinner-ONGfIVUJ.cjs.map → installWithSpinner-X9J7yxiR.cjs.map} +1 -1
- package/dist/intro-DRl-pwVs.js +72 -0
- package/dist/intro-DRl-pwVs.js.map +1 -0
- package/dist/intro-DuyzJ3Rb.cjs +102 -0
- package/dist/intro-DuyzJ3Rb.cjs.map +1 -0
- package/dist/{intro-9PB8sE8z.js → log-B-1vLxF1.js} +2 -66
- package/dist/log-B-1vLxF1.js.map +1 -0
- package/dist/{intro-YPaf1Imr.cjs → log-wv1OxLiq.cjs} +1 -95
- package/dist/log-wv1OxLiq.cjs.map +1 -0
- package/dist/{mascot-JSA0j3Q_.cjs → mascot-CC-D4ON2.cjs} +2 -2
- package/dist/{mascot-JSA0j3Q_.cjs.map → mascot-CC-D4ON2.cjs.map} +1 -1
- package/dist/{mascot--q1xjKw1.js → mascot-CmUUHLlx.js} +2 -2
- package/dist/{mascot--q1xjKw1.js.map → mascot-CmUUHLlx.js.map} +1 -1
- package/dist/{mcp-CcseJJwh.cjs → mcp-Don4UqAB.cjs} +2 -2
- package/dist/{mcp-CcseJJwh.cjs.map → mcp-Don4UqAB.cjs.map} +1 -1
- package/dist/{mcp-DUTsS8tR.js → mcp-Spp8N-xs.js} +2 -2
- package/dist/{mcp-DUTsS8tR.js.map → mcp-Spp8N-xs.js.map} +1 -1
- package/dist/package-Bf2T71nz.js +5 -0
- package/dist/package-Bf2T71nz.js.map +1 -0
- package/dist/{package-B1hUUjio.cjs → package-CI_luotn.cjs} +2 -2
- package/dist/package-CI_luotn.cjs.map +1 -0
- package/dist/{registry-B3eYk4LN.js → registry-Cy48PGdh.js} +3 -2
- package/dist/registry-Cy48PGdh.js.map +1 -0
- package/dist/{registry-YE1pFWL-.cjs → registry-Q77p5TZp.cjs} +3 -2
- package/dist/registry-Q77p5TZp.cjs.map +1 -0
- package/dist/{reporters-BM430HdQ.js → reporters-D6w4huLl.js} +222 -11
- package/dist/reporters-D6w4huLl.js.map +1 -0
- package/dist/{reporters-2cgjvXwR.cjs → reporters-Dby6Kgdj.cjs} +255 -10
- package/dist/reporters-Dby6Kgdj.cjs.map +1 -0
- package/dist/reporters-GdWr95qd.js +1 -0
- package/dist/{run-CLiHI99L.js → run-BEwA7UDN.js} +4 -4
- package/dist/{run-CLiHI99L.js.map → run-BEwA7UDN.js.map} +1 -1
- package/dist/{run-BsrNfFIl.js → run-BGUSyeuP.js} +44 -38
- package/dist/run-BGUSyeuP.js.map +1 -0
- package/dist/{run-DTqMrPS9.js → run-BY4KZsE3.js} +2 -2
- package/dist/{run-DTqMrPS9.js.map → run-BY4KZsE3.js.map} +1 -1
- package/dist/{run-CXVhxFfC.js → run-B_XCebc9.js} +10 -10
- package/dist/{run-CXVhxFfC.js.map → run-B_XCebc9.js.map} +1 -1
- package/dist/{run-LY_UAYyM.cjs → run-CFw6-hm1.cjs} +48 -42
- package/dist/run-CFw6-hm1.cjs.map +1 -0
- package/dist/{run-dMTJfs4_.cjs → run-CGdXlXy-.cjs} +4 -4
- package/dist/{run-dMTJfs4_.cjs.map → run-CGdXlXy-.cjs.map} +1 -1
- package/dist/{run-Bq6gcfkS.js → run-CYynQJRk.js} +1 -1
- package/dist/{run-CrM4jsix.cjs → run-CfumUZCl.cjs} +7 -6
- package/dist/{run-CrM4jsix.cjs.map → run-CfumUZCl.cjs.map} +1 -1
- package/dist/{run-D-nn9-Wq.js → run-Cgy4_JPy.js} +14 -18
- package/dist/run-Cgy4_JPy.js.map +1 -0
- package/dist/{run-1H9TGT8v.js → run-Ch7Uuu-u.js} +4 -3
- package/dist/{run-1H9TGT8v.js.map → run-Ch7Uuu-u.js.map} +1 -1
- package/dist/{run-BYP_t9dR.cjs → run-DCggecSY.cjs} +19 -24
- package/dist/run-DCggecSY.cjs.map +1 -0
- package/dist/{run-CQORv7Gq.cjs → run-DFIaAIjC.cjs} +13 -12
- package/dist/{run-CQORv7Gq.cjs.map → run-DFIaAIjC.cjs.map} +1 -1
- package/dist/{run-BrM7-NSV.js → run-DHfFHNfG.js} +13 -17
- package/dist/run-DHfFHNfG.js.map +1 -0
- package/dist/{run-CvFakE3B.cjs → run-DT4hTOR2.cjs} +16 -21
- package/dist/run-DT4hTOR2.cjs.map +1 -0
- package/dist/{run-DBnSbwtU.cjs → run-DfCka9wW.cjs} +47 -61
- package/dist/run-DfCka9wW.cjs.map +1 -0
- package/dist/{run-DUwX6Icx.js → run-DiCSiwh8.js} +10 -9
- package/dist/{run-DUwX6Icx.js.map → run-DiCSiwh8.js.map} +1 -1
- package/dist/{run-CyzKy-0p.cjs → run-FGwhN0Pi.cjs} +20 -20
- package/dist/{run-CyzKy-0p.cjs.map → run-FGwhN0Pi.cjs.map} +1 -1
- package/dist/{run-uPA5s3rI.cjs → run-KePEAia2.cjs} +2 -2
- package/dist/{run-uPA5s3rI.cjs.map → run-KePEAia2.cjs.map} +1 -1
- package/dist/{run-FEiyv6_U.js → run-OHr93Akz.js} +40 -53
- package/dist/run-OHr93Akz.js.map +1 -0
- package/dist/shared-DcDHRtZx.js +58 -0
- package/dist/shared-DcDHRtZx.js.map +1 -0
- package/dist/shared-KKRMm1xX.cjs +87 -0
- package/dist/shared-KKRMm1xX.cjs.map +1 -0
- package/dist/{snapshot-CPF9zyZj.cjs → snapshot-ByWxzJIh.cjs} +7 -7
- package/dist/{snapshot-CPF9zyZj.cjs.map → snapshot-ByWxzJIh.cjs.map} +1 -1
- package/dist/{snapshot-CiV08NJr.js → snapshot-UAiT_UQa.js} +6 -6
- package/dist/{snapshot-CiV08NJr.js.map → snapshot-UAiT_UQa.js.map} +1 -1
- package/dist/spinner-DxsAllRI.js +48 -0
- package/dist/spinner-DxsAllRI.js.map +1 -0
- package/dist/{spinner-CfB0sIPy.cjs → spinner-RfMb7fd6.cjs} +50 -21
- package/dist/spinner-RfMb7fd6.cjs.map +1 -0
- package/dist/{status-Dj8tivag.js → status-CEZ3m06O.js} +3 -3
- package/dist/{status-Dj8tivag.js.map → status-CEZ3m06O.js.map} +1 -1
- package/dist/{status-C066YA-4.cjs → status-iE6UADco.cjs} +3 -3
- package/dist/{status-C066YA-4.cjs.map → status-iE6UADco.cjs.map} +1 -1
- package/dist/{studio-D9_-mKee.cjs → studio-BL3zpp5R.cjs} +12 -12
- package/dist/{studio-D9_-mKee.cjs.map → studio-BL3zpp5R.cjs.map} +1 -1
- package/dist/{studio-B4XsXgKj.js → studio-D9WQb5vH.js} +12 -12
- package/dist/{studio-B4XsXgKj.js.map → studio-D9WQb5vH.js.map} +1 -1
- package/dist/studioWorker.js +2 -2
- package/dist/{summary-Clvl5Hxs.cjs → summary-B2Apv5KO.cjs} +17 -2
- package/dist/summary-B2Apv5KO.cjs.map +1 -0
- package/dist/{summary-CbmQKA8l.js → summary-BQWHL_Ca.js} +12 -3
- package/dist/summary-BQWHL_Ca.js.map +1 -0
- package/dist/{text-Ep3AulAS.cjs → text-DMiX2dcG.cjs} +10 -1
- package/dist/text-DMiX2dcG.cjs.map +1 -0
- package/dist/{text-BmiI4s6N.js → text-EoYn04SX.js} +5 -2
- package/dist/text-EoYn04SX.js.map +1 -0
- package/dist/{utils-CbJ6hS_t.js → utils-CeMUE4P0.js} +90 -70
- package/dist/utils-CeMUE4P0.js.map +1 -0
- package/dist/{utils-CO89mxRU.cjs → utils-uSJAZuvP.cjs} +101 -69
- package/dist/utils-uSJAZuvP.cjs.map +1 -0
- package/dist/{validate-B3tLWYJU.cjs → validate-B9Ctya2v.cjs} +3 -3
- package/dist/{validate-B3tLWYJU.cjs.map → validate-B9Ctya2v.cjs.map} +1 -1
- package/dist/{validate-C5fyNF4v.js → validate-BGvFsCDL.js} +3 -3
- package/dist/{validate-C5fyNF4v.js.map → validate-BGvFsCDL.js.map} +1 -1
- package/package.json +8 -7
- package/dist/configFile-C0DIXNMD.js.map +0 -1
- package/dist/configFile-CoEpHdXG.cjs.map +0 -1
- package/dist/intro-9PB8sE8z.js.map +0 -1
- package/dist/intro-YPaf1Imr.cjs.map +0 -1
- package/dist/package-B1hUUjio.cjs.map +0 -1
- package/dist/package-MYPMnnTX.js +0 -5
- package/dist/package-MYPMnnTX.js.map +0 -1
- package/dist/registry-B3eYk4LN.js.map +0 -1
- package/dist/registry-YE1pFWL-.cjs.map +0 -1
- package/dist/reporters-2cgjvXwR.cjs.map +0 -1
- package/dist/reporters-BM430HdQ.js.map +0 -1
- package/dist/run-BYP_t9dR.cjs.map +0 -1
- package/dist/run-BrM7-NSV.js.map +0 -1
- package/dist/run-BsrNfFIl.js.map +0 -1
- package/dist/run-CvFakE3B.cjs.map +0 -1
- package/dist/run-D-nn9-Wq.js.map +0 -1
- package/dist/run-DBnSbwtU.cjs.map +0 -1
- package/dist/run-FEiyv6_U.js.map +0 -1
- package/dist/run-LY_UAYyM.cjs.map +0 -1
- package/dist/shared-C0EtrdUm.cjs +0 -123
- package/dist/shared-C0EtrdUm.cjs.map +0 -1
- package/dist/shared-Ct9stKpp.js +0 -94
- package/dist/shared-Ct9stKpp.js.map +0 -1
- package/dist/spinner-BZaln7O8.js.map +0 -1
- package/dist/spinner-CfB0sIPy.cjs.map +0 -1
- package/dist/summary-CbmQKA8l.js.map +0 -1
- package/dist/summary-Clvl5Hxs.cjs.map +0 -1
- package/dist/text-BmiI4s6N.js.map +0 -1
- package/dist/text-Ep3AulAS.cjs.map +0 -1
- package/dist/utils-BdibacYq.js +0 -244
- package/dist/utils-BdibacYq.js.map +0 -1
- package/dist/utils-CO89mxRU.cjs.map +0 -1
- package/dist/utils-CbJ6hS_t.js.map +0 -1
- package/dist/utils-CcARPB45.cjs +0 -286
- package/dist/utils-CcARPB45.cjs.map +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
|
+
import { n as isRichOutput } from "./env-rv-VgSGN.js";
|
|
3
|
+
import { o as writer } from "./log-B-1vLxF1.js";
|
|
4
|
+
import { styleText } from "node:util";
|
|
5
|
+
import * as prompts from "@clack/prompts";
|
|
6
|
+
// src/ui/intro.ts
|
|
7
|
+
const SPONSOR_TIPS = [
|
|
8
|
+
"Your sponsorship keeps Kubb codegen, plugins, and docs maintained",
|
|
9
|
+
"Sponsor faster generators and better Kubb Studio workflows",
|
|
10
|
+
"Help keep Kubb free for TypeScript teams building APIs",
|
|
11
|
+
"Support React Query, Zod, Faker, and MSW integrations",
|
|
12
|
+
"Back open-source tools that turn OpenAPI into TypeScript",
|
|
13
|
+
"Sponsor fixes, releases, and new plugins for your API workflow",
|
|
14
|
+
"Help Kubb stay independent and focused on developer tools"
|
|
15
|
+
];
|
|
16
|
+
const SPONSOR_LINKS = [
|
|
17
|
+
"https://github.com/sponsors/stijnvanhulle",
|
|
18
|
+
"https://opencollective.com/kubb",
|
|
19
|
+
"https://kubb.dev/sponsors"
|
|
20
|
+
];
|
|
21
|
+
function nextTip() {
|
|
22
|
+
return `${SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]}: ${SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]}`;
|
|
23
|
+
}
|
|
24
|
+
function formatTip(tip) {
|
|
25
|
+
return styleText("magenta", " Tip ") + styleText("yellow", tip);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Prints one random tip outside every group. Rich terminals get the styled variant;
|
|
29
|
+
* plain/CI output gets a stable text-only line so the tip is still visible as final output.
|
|
30
|
+
*/
|
|
31
|
+
function logTip() {
|
|
32
|
+
const tip = nextTip();
|
|
33
|
+
if (!isRichOutput()) {
|
|
34
|
+
console.log(`Tip: ${tip}`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
console.log(`${styleText("magenta", "✦")}${formatTip(tip)}`);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Opens a command's output. A command the banner already names passes no title.
|
|
41
|
+
*/
|
|
42
|
+
function logIntro({ title, warning, block = true }) {
|
|
43
|
+
if (block && isRichOutput()) {
|
|
44
|
+
if (title) prompts.intro(title);
|
|
45
|
+
if (warning) prompts.log.warn(warning);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (title) console.log(title);
|
|
49
|
+
if (warning) console.warn(warning);
|
|
50
|
+
if (title || warning) console.log();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain
|
|
54
|
+
* output prints the text on its own.
|
|
55
|
+
*/
|
|
56
|
+
function logOutro(text) {
|
|
57
|
+
writer().groupEnd(text);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a
|
|
61
|
+
* group and a spacer sits outside every one.
|
|
62
|
+
*/
|
|
63
|
+
function logSpacer() {
|
|
64
|
+
console.log("");
|
|
65
|
+
}
|
|
66
|
+
/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */
|
|
67
|
+
function isInteractiveRun({ yes, dryRun }) {
|
|
68
|
+
return !yes && !dryRun && process.stdin.isTTY === true;
|
|
69
|
+
}
|
|
70
|
+
export { logTip as a, logSpacer as i, logIntro as n, logOutro as r, isInteractiveRun as t };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=intro-DRl-pwVs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-DRl-pwVs.js","names":[],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveRun({ yes, dryRun }: { yes?: unknown; dryRun?: unknown }): boolean {\n return !yes && !dryRun && process.stdin.isTTY === true\n}\n"],"mappings":";;;;;;AAKA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CAAC;CAA6C;CAAmC;AAA2B;AAElI,SAAS,UAAkB;CAGzB,OAAO,GAFK,aAAa,KAAK,MAAM,KAAK,OAAO,IAAI,aAAa,MAAM,GAEzD,IADD,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,OAAO,UAAU,WAAW,QAAQ,IAAI,UAAU,UAAU,GAAG;AACjE;;;;;AAMA,SAAgB,SAAe;CAC7B,MAAM,MAAM,QAAQ;CACpB,IAAI,CAAC,aAAa,GAAG;EACnB,QAAQ,IAAI,QAAQ,KAAK;EACzB;CACF;CAEA,QAAQ,IAAI,GAAG,UAAU,WAAW,GAAG,IAAI,UAAU,GAAG,GAAG;AAC7D;;;;AAoBA,SAAgB,SAAS,EAAE,OAAO,SAAS,QAAQ,QAA4B;CAC7E,IAAI,SAAS,aAAa,GAAG;EAC3B,IAAI,OAAO,QAAQ,MAAM,KAAK;EAE9B,IAAI,SACF,QAAQ,IAAI,KAAK,OAAO;EAG1B;CACF;CAEA,IAAI,OACF,QAAQ,IAAI,KAAK;CAGnB,IAAI,SACF,QAAQ,KAAK,OAAO;CAGtB,IAAI,SAAS,SACX,QAAQ,IAAI;AAEhB;;;;;AAMA,SAAgB,SAAS,MAAoB;CAC3C,OAAO,CAAC,CAAC,SAAS,IAAI;AACxB;;;;;AAMA,SAAgB,YAAkB;CAChC,QAAQ,IAAI,EAAE;AAChB;;AAGA,SAAgB,iBAAiB,EAAE,KAAK,UAAwD;CAC9F,OAAO,CAAC,OAAO,CAAC,UAAU,QAAQ,MAAM,UAAU;AACpD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
|
|
2
|
+
const require_env = require("./env-eu3XyKqJ.cjs");
|
|
3
|
+
const require_log = require("./log-wv1OxLiq.cjs");
|
|
4
|
+
let node_util = require("node:util");
|
|
5
|
+
let _clack_prompts = require("@clack/prompts");
|
|
6
|
+
_clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
|
|
7
|
+
// src/ui/intro.ts
|
|
8
|
+
const SPONSOR_TIPS = [
|
|
9
|
+
"Your sponsorship keeps Kubb codegen, plugins, and docs maintained",
|
|
10
|
+
"Sponsor faster generators and better Kubb Studio workflows",
|
|
11
|
+
"Help keep Kubb free for TypeScript teams building APIs",
|
|
12
|
+
"Support React Query, Zod, Faker, and MSW integrations",
|
|
13
|
+
"Back open-source tools that turn OpenAPI into TypeScript",
|
|
14
|
+
"Sponsor fixes, releases, and new plugins for your API workflow",
|
|
15
|
+
"Help Kubb stay independent and focused on developer tools"
|
|
16
|
+
];
|
|
17
|
+
const SPONSOR_LINKS = [
|
|
18
|
+
"https://github.com/sponsors/stijnvanhulle",
|
|
19
|
+
"https://opencollective.com/kubb",
|
|
20
|
+
"https://kubb.dev/sponsors"
|
|
21
|
+
];
|
|
22
|
+
function nextTip() {
|
|
23
|
+
return `${SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]}: ${SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]}`;
|
|
24
|
+
}
|
|
25
|
+
function formatTip(tip) {
|
|
26
|
+
return (0, node_util.styleText)("magenta", " Tip ") + (0, node_util.styleText)("yellow", tip);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Prints one random tip outside every group. Rich terminals get the styled variant;
|
|
30
|
+
* plain/CI output gets a stable text-only line so the tip is still visible as final output.
|
|
31
|
+
*/
|
|
32
|
+
function logTip() {
|
|
33
|
+
const tip = nextTip();
|
|
34
|
+
if (!require_env.isRichOutput()) {
|
|
35
|
+
console.log(`Tip: ${tip}`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
console.log(`${(0, node_util.styleText)("magenta", "✦")}${formatTip(tip)}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Opens a command's output. A command the banner already names passes no title.
|
|
42
|
+
*/
|
|
43
|
+
function logIntro({ title, warning, block = true }) {
|
|
44
|
+
if (block && require_env.isRichOutput()) {
|
|
45
|
+
if (title) _clack_prompts.intro(title);
|
|
46
|
+
if (warning) _clack_prompts.log.warn(warning);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (title) console.log(title);
|
|
50
|
+
if (warning) console.warn(warning);
|
|
51
|
+
if (title || warning) console.log();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain
|
|
55
|
+
* output prints the text on its own.
|
|
56
|
+
*/
|
|
57
|
+
function logOutro(text) {
|
|
58
|
+
require_log.writer().groupEnd(text);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a
|
|
62
|
+
* group and a spacer sits outside every one.
|
|
63
|
+
*/
|
|
64
|
+
function logSpacer() {
|
|
65
|
+
console.log("");
|
|
66
|
+
}
|
|
67
|
+
/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */
|
|
68
|
+
function isInteractiveRun({ yes, dryRun }) {
|
|
69
|
+
return !yes && !dryRun && process.stdin.isTTY === true;
|
|
70
|
+
}
|
|
71
|
+
Object.defineProperty(exports, "isInteractiveRun", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function() {
|
|
74
|
+
return isInteractiveRun;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "logIntro", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return logIntro;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "logOutro", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return logOutro;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "logSpacer", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function() {
|
|
92
|
+
return logSpacer;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(exports, "logTip", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function() {
|
|
98
|
+
return logTip;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=intro-DuyzJ3Rb.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intro-DuyzJ3Rb.cjs","names":["styleText","isRichOutput"],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveRun({ yes, dryRun }: { yes?: unknown; dryRun?: unknown }): boolean {\n return !yes && !dryRun && process.stdin.isTTY === true\n}\n"],"mappings":";;;;;;;AAKA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CAAC;CAA6C;CAAmC;AAA2B;AAElI,SAAS,UAAkB;CAGzB,OAAO,GAFK,aAAa,KAAK,MAAM,KAAK,OAAO,IAAI,aAAa,MAAM,GAEzD,IADD,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,QAAA,GAAOA,UAAAA,UAAAA,CAAU,WAAW,QAAQ,KAAA,GAAIA,UAAAA,UAAAA,CAAU,UAAU,GAAG;AACjE;;;;;AAMA,SAAgB,SAAe;CAC7B,MAAM,MAAM,QAAQ;CACpB,IAAI,CAACC,YAAAA,aAAa,GAAG;EACnB,QAAQ,IAAI,QAAQ,KAAK;EACzB;CACF;CAEA,QAAQ,IAAI,IAAA,GAAGD,UAAAA,UAAAA,CAAU,WAAW,GAAG,IAAI,UAAU,GAAG,GAAG;AAC7D;;;;AAoBA,SAAgB,SAAS,EAAE,OAAO,SAAS,QAAQ,QAA4B;CAC7E,IAAI,SAASC,YAAAA,aAAa,GAAG;EAC3B,IAAI,OAAO,eAAQ,MAAM,KAAK;EAE9B,IAAI,SACF,eAAQ,IAAI,KAAK,OAAO;EAG1B;CACF;CAEA,IAAI,OACF,QAAQ,IAAI,KAAK;CAGnB,IAAI,SACF,QAAQ,KAAK,OAAO;CAGtB,IAAI,SAAS,SACX,QAAQ,IAAI;AAEhB;;;;;AAMA,SAAgB,SAAS,MAAoB;CAC3C,YAAA,OAAO,CAAC,CAAC,SAAS,IAAI;AACxB;;;;;AAMA,SAAgB,YAAkB;CAChC,QAAQ,IAAI,EAAE;AAChB;;AAGA,SAAgB,iBAAiB,EAAE,KAAK,UAAwD;CAC9F,OAAO,CAAC,OAAO,CAAC,UAAU,QAAQ,MAAM,UAAU;AACpD"}
|
|
@@ -126,70 +126,6 @@ function logError(message) {
|
|
|
126
126
|
function logStep(message) {
|
|
127
127
|
write("step", message);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
const SPONSOR_TIPS = [
|
|
131
|
-
"Your sponsorship keeps Kubb codegen, plugins, and docs maintained",
|
|
132
|
-
"Sponsor faster generators and better Kubb Studio workflows",
|
|
133
|
-
"Help keep Kubb free for TypeScript teams building APIs",
|
|
134
|
-
"Support React Query, Zod, Faker, and MSW integrations",
|
|
135
|
-
"Back open-source tools that turn OpenAPI into TypeScript",
|
|
136
|
-
"Sponsor fixes, releases, and new plugins for your API workflow",
|
|
137
|
-
"Help Kubb stay independent and focused on developer tools"
|
|
138
|
-
];
|
|
139
|
-
const SPONSOR_LINKS = [
|
|
140
|
-
"https://github.com/sponsors/stijnvanhulle",
|
|
141
|
-
"https://opencollective.com/kubb",
|
|
142
|
-
"https://kubb.dev/sponsors"
|
|
143
|
-
];
|
|
144
|
-
function nextTip() {
|
|
145
|
-
return `${SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]}: ${SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]}`;
|
|
146
|
-
}
|
|
147
|
-
function formatTip(tip) {
|
|
148
|
-
return styleText("magenta", " Tip ") + styleText("yellow", tip);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Prints one random tip outside every group. Rich terminals get the styled variant;
|
|
152
|
-
* plain/CI output gets a stable text-only line so the tip is still visible as final output.
|
|
153
|
-
*/
|
|
154
|
-
function logTip() {
|
|
155
|
-
const tip = nextTip();
|
|
156
|
-
if (!isRichOutput()) {
|
|
157
|
-
console.log(`Tip: ${tip}`);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
console.log(`${styleText("magenta", "✦")}${formatTip(tip)}`);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Opens a command's output. A command the banner already names passes no title.
|
|
164
|
-
*/
|
|
165
|
-
function logIntro({ title, warning, block = true }) {
|
|
166
|
-
if (block && isRichOutput()) {
|
|
167
|
-
if (title) clack.intro(title);
|
|
168
|
-
if (warning) clack.log.warn(warning);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (title) console.log(title);
|
|
172
|
-
if (warning) console.warn(warning);
|
|
173
|
-
if (title || warning) console.log();
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain
|
|
177
|
-
* output prints the text on its own.
|
|
178
|
-
*/
|
|
179
|
-
function logOutro(text) {
|
|
180
|
-
writer().groupEnd(text);
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a
|
|
184
|
-
* group and a spacer sits outside every one.
|
|
185
|
-
*/
|
|
186
|
-
function logSpacer() {
|
|
187
|
-
console.log("");
|
|
188
|
-
}
|
|
189
|
-
/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */
|
|
190
|
-
function isInteractiveRun({ yes, dryRun }) {
|
|
191
|
-
return !yes && !dryRun && process.stdin.isTTY === true;
|
|
192
|
-
}
|
|
193
|
-
export { logTip as a, logInfo as c, writer as d, createPlainWriter as f, logSpacer as i, logStep as l, logIntro as n, logBlock as o, plainWriter as p, logOutro as r, logError as s, isInteractiveRun as t, logWarn as u };
|
|
129
|
+
export { logWarn as a, plainWriter as c, logStep as i, logError as n, writer as o, logInfo as r, createPlainWriter as s, logBlock as t };
|
|
194
130
|
|
|
195
|
-
//# sourceMappingURL=
|
|
131
|
+
//# sourceMappingURL=log-B-1vLxF1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-B-1vLxF1.js","names":[],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something it found.\n */\nexport function logStep(message: string): void {\n write('step', message)\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,cAA4B;CACvC,UAAU;CACV,QAAQ,UAAU,MAAM,MAAM,KAAK;CACnC,WAAW,SAAS,MAAM,MAAM,IAAI;CACpC,OAAO,SAAS,MAAM,IAAI,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC;CACnD,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,UAAU,SAAS,MAAM,IAAI,QAAQ,IAAI;CACzC,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,QAAQ,SAAS,MAAM,IAAI,MAAM,IAAI;CACrC,QAAQ,UAAU,MAAM,IAAI,QAAQ,OAAO,EAAE,SAAS,EAAE,CAAC;CAGzD,MAAM,UAAU,QAAQ,IAAI,UAAU,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC;CAG9D,aAAa,UAAU,MAAM,IAAI,QAAQ,OAAO;EAAE,QAAQ;EAAI,iBAAiB;CAAG,CAAC;CACnF,SAAS,OAAO,UACd,MAAM,IAAI,MAAM,KAAK,IAAI,GAAG,OAAO;EACjC,OAAO;EACP,eAAe,WAAmB,UAAU,UAAU,MAAM;EAC5D,SAAS;EACT,WAAW;EACX,cAAc;EACd,YAAY;CACd,CAAC;CACH,eAAe,MAAM,QAAQ;CAC7B,SAAS,KAAK;EACZ,MAAM,MAAM,MAAM,SA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,GAAG,SAAS;AAC5C;;AAGA,SAAgB,SAAS,OAAqC;CAC5D,IAAI,aAAa,GAAG;EAClB,MAAQ,IAAI,QAAQ,KAAK;EAEzB;CACF;CAEA,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;AACvC;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,SAAS,SAAuB;CAC9C,MAAM,SAAS,OAAO;AACxB;;;;AAKA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB"}
|
|
@@ -127,82 +127,12 @@ function logError(message) {
|
|
|
127
127
|
function logStep(message) {
|
|
128
128
|
write("step", message);
|
|
129
129
|
}
|
|
130
|
-
// src/ui/intro.ts
|
|
131
|
-
const SPONSOR_TIPS = [
|
|
132
|
-
"Your sponsorship keeps Kubb codegen, plugins, and docs maintained",
|
|
133
|
-
"Sponsor faster generators and better Kubb Studio workflows",
|
|
134
|
-
"Help keep Kubb free for TypeScript teams building APIs",
|
|
135
|
-
"Support React Query, Zod, Faker, and MSW integrations",
|
|
136
|
-
"Back open-source tools that turn OpenAPI into TypeScript",
|
|
137
|
-
"Sponsor fixes, releases, and new plugins for your API workflow",
|
|
138
|
-
"Help Kubb stay independent and focused on developer tools"
|
|
139
|
-
];
|
|
140
|
-
const SPONSOR_LINKS = [
|
|
141
|
-
"https://github.com/sponsors/stijnvanhulle",
|
|
142
|
-
"https://opencollective.com/kubb",
|
|
143
|
-
"https://kubb.dev/sponsors"
|
|
144
|
-
];
|
|
145
|
-
function nextTip() {
|
|
146
|
-
return `${SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]}: ${SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]}`;
|
|
147
|
-
}
|
|
148
|
-
function formatTip(tip) {
|
|
149
|
-
return (0, node_util.styleText)("magenta", " Tip ") + (0, node_util.styleText)("yellow", tip);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Prints one random tip outside every group. Rich terminals get the styled variant;
|
|
153
|
-
* plain/CI output gets a stable text-only line so the tip is still visible as final output.
|
|
154
|
-
*/
|
|
155
|
-
function logTip() {
|
|
156
|
-
const tip = nextTip();
|
|
157
|
-
if (!require_env.isRichOutput()) {
|
|
158
|
-
console.log(`Tip: ${tip}`);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
console.log(`${(0, node_util.styleText)("magenta", "✦")}${formatTip(tip)}`);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Opens a command's output. A command the banner already names passes no title.
|
|
165
|
-
*/
|
|
166
|
-
function logIntro({ title, warning, block = true }) {
|
|
167
|
-
if (block && require_env.isRichOutput()) {
|
|
168
|
-
if (title) _clack_prompts.intro(title);
|
|
169
|
-
if (warning) _clack_prompts.log.warn(warning);
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (title) console.log(title);
|
|
173
|
-
if (warning) console.warn(warning);
|
|
174
|
-
if (title || warning) console.log();
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain
|
|
178
|
-
* output prints the text on its own.
|
|
179
|
-
*/
|
|
180
|
-
function logOutro(text) {
|
|
181
|
-
writer().groupEnd(text);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a
|
|
185
|
-
* group and a spacer sits outside every one.
|
|
186
|
-
*/
|
|
187
|
-
function logSpacer() {
|
|
188
|
-
console.log("");
|
|
189
|
-
}
|
|
190
|
-
/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */
|
|
191
|
-
function isInteractiveRun({ yes, dryRun }) {
|
|
192
|
-
return !yes && !dryRun && process.stdin.isTTY === true;
|
|
193
|
-
}
|
|
194
130
|
Object.defineProperty(exports, "createPlainWriter", {
|
|
195
131
|
enumerable: true,
|
|
196
132
|
get: function() {
|
|
197
133
|
return createPlainWriter;
|
|
198
134
|
}
|
|
199
135
|
});
|
|
200
|
-
Object.defineProperty(exports, "isInteractiveRun", {
|
|
201
|
-
enumerable: true,
|
|
202
|
-
get: function() {
|
|
203
|
-
return isInteractiveRun;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
136
|
Object.defineProperty(exports, "logBlock", {
|
|
207
137
|
enumerable: true,
|
|
208
138
|
get: function() {
|
|
@@ -221,36 +151,12 @@ Object.defineProperty(exports, "logInfo", {
|
|
|
221
151
|
return logInfo;
|
|
222
152
|
}
|
|
223
153
|
});
|
|
224
|
-
Object.defineProperty(exports, "logIntro", {
|
|
225
|
-
enumerable: true,
|
|
226
|
-
get: function() {
|
|
227
|
-
return logIntro;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
Object.defineProperty(exports, "logOutro", {
|
|
231
|
-
enumerable: true,
|
|
232
|
-
get: function() {
|
|
233
|
-
return logOutro;
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
Object.defineProperty(exports, "logSpacer", {
|
|
237
|
-
enumerable: true,
|
|
238
|
-
get: function() {
|
|
239
|
-
return logSpacer;
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
154
|
Object.defineProperty(exports, "logStep", {
|
|
243
155
|
enumerable: true,
|
|
244
156
|
get: function() {
|
|
245
157
|
return logStep;
|
|
246
158
|
}
|
|
247
159
|
});
|
|
248
|
-
Object.defineProperty(exports, "logTip", {
|
|
249
|
-
enumerable: true,
|
|
250
|
-
get: function() {
|
|
251
|
-
return logTip;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
160
|
Object.defineProperty(exports, "logWarn", {
|
|
255
161
|
enumerable: true,
|
|
256
162
|
get: function() {
|
|
@@ -270,4 +176,4 @@ Object.defineProperty(exports, "writer", {
|
|
|
270
176
|
}
|
|
271
177
|
});
|
|
272
178
|
|
|
273
|
-
//# sourceMappingURL=
|
|
179
|
+
//# sourceMappingURL=log-wv1OxLiq.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-wv1OxLiq.cjs","names":["clack","styleText","isRichOutput"],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something it found.\n */\nexport function logStep(message: string): void {\n write('step', message)\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAa,cAA4B;CACvC,UAAU;CACV,QAAQ,UAAUA,eAAM,MAAM,KAAK;CACnC,WAAW,SAASA,eAAM,MAAM,IAAI;CACpC,OAAO,SAASA,eAAM,IAAI,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC;CACnD,OAAO,SAASA,eAAM,IAAI,KAAK,IAAI;CACnC,UAAU,SAASA,eAAM,IAAI,QAAQ,IAAI;CACzC,OAAO,SAASA,eAAM,IAAI,KAAK,IAAI;CACnC,QAAQ,SAASA,eAAM,IAAI,MAAM,IAAI;CACrC,QAAQ,UAAUA,eAAM,IAAI,QAAQ,OAAO,EAAE,SAAS,EAAE,CAAC;CAGzD,MAAM,UAAU,QAAQ,KAAA,GAAIC,UAAAA,UAAAA,CAAU,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC;CAG9D,aAAa,UAAUD,eAAM,IAAI,QAAQ,OAAO;EAAE,QAAQ;EAAI,iBAAiB;CAAG,CAAC;CACnF,SAAS,OAAO,UACdA,eAAM,IAAI,MAAM,KAAK,IAAI,GAAG,OAAO;EACjC,OAAO;EACP,eAAe,YAAA,GAAmBC,UAAAA,UAAAA,CAAU,UAAU,MAAM;EAC5D,SAAS;EACT,WAAW;EACX,cAAc;EACd,YAAY;CACd,CAAC;CACH,eAAeD,eAAM,QAAQ;CAC7B,SAAS,KAAK;EACZ,MAAM,MAAMA,eAAM,SAAS;GAAE,OAAO;GAAS;GAAK,MAAM;EAAG,CAAC;EAE5D,OAAO;GACL,QAAQ,SAAS,IAAI,MAAM,IAAI;GAC/B,UAAU,SAAS,IAAI,QAAQ,GAAG,IAAI;GACtC,OAAO,SAAS,IAAI,KAAK,IAAI;EAC/B;CACF;AACF;;;;;ACtCA,MAAa,UAAU;CAA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C;AACvC;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,SAAS,SAAuB;CAC9C,MAAM,SAAS,OAAO;AACxB;;;;AAKA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require("./rolldown-runtime-C3-Zg-KD.cjs");
|
|
2
2
|
const require_env = require("./env-eu3XyKqJ.cjs");
|
|
3
3
|
const require_banner = require("./banner-wJFk-L-c.cjs");
|
|
4
|
-
const require_intro = require("./intro-
|
|
4
|
+
const require_intro = require("./intro-DuyzJ3Rb.cjs");
|
|
5
5
|
let node_util = require("node:util");
|
|
6
6
|
let node_timers_promises = require("node:timers/promises");
|
|
7
7
|
// src/ui/mascot.ts
|
|
@@ -77,4 +77,4 @@ Object.defineProperty(exports, "wantsMascot", {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=mascot-
|
|
80
|
+
//# sourceMappingURL=mascot-CC-D4ON2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mascot-
|
|
1
|
+
{"version":3,"file":"mascot-CC-D4ON2.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, which takes under a\n * second and overlaps the config load. Elsewhere the still {@link getBanner} is the header.\n */\nexport async function logBanner(version: string): Promise<void> {\n if (!canDrawMascot(version, 'generate')) {\n console.log(getBanner(version, 'generate'))\n\n return\n }\n\n console.log('')\n for (const [index, [expression, ms]] of wakeUp.entries()) {\n const frame = bannerIntro(version, expression, 'generate')\n if (index > 0) process.stdout.moveCursor(0, -frame.split('\\n').length)\n console.log(frame)\n await sleep(ms)\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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{ n as isRichOutput } from "./env-rv-VgSGN.js";
|
|
3
3
|
import { i as wakeUp, r as getIntro } from "./banner-BdTTDFkG.js";
|
|
4
|
-
import { t as isInteractiveRun } from "./intro-
|
|
4
|
+
import { t as isInteractiveRun } from "./intro-DRl-pwVs.js";
|
|
5
5
|
import { stripVTControlCharacters } from "node:util";
|
|
6
6
|
import { setTimeout } from "node:timers/promises";
|
|
7
7
|
// src/ui/mascot.ts
|
|
@@ -60,4 +60,4 @@ async function logBanner(version) {
|
|
|
60
60
|
}
|
|
61
61
|
export { logBanner as n, wantsMascot as r, getBanner as t };
|
|
62
62
|
|
|
63
|
-
//# sourceMappingURL=mascot
|
|
63
|
+
//# sourceMappingURL=mascot-CmUUHLlx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mascot
|
|
1
|
+
{"version":3,"file":"mascot-CmUUHLlx.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, which takes under a\n * second and overlaps the config load. Elsewhere the still {@link getBanner} is the header.\n */\nexport async function logBanner(version: string): Promise<void> {\n if (!canDrawMascot(version, 'generate')) {\n console.log(getBanner(version, 'generate'))\n\n return\n }\n\n console.log('')\n for (const [index, [expression, ms]] of wakeUp.entries()) {\n const frame = bannerIntro(version, expression, 'generate')\n if (index > 0) process.stdout.moveCursor(0, -frame.split('\\n').length)\n console.log(frame)\n await sleep(ms)\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;;;;;AAMA,eAAsB,UAAU,SAAgC;CAC9D,IAAI,CAAC,cAAc,SAAS,UAAU,GAAG;EACvC,QAAQ,IAAI,UAAU,SAAS,UAAU,CAAC;EAE1C;CACF;CAEA,QAAQ,IAAI,EAAE;CACd,KAAK,MAAM,CAAC,OAAO,CAAC,YAAY,QAAQ,OAAO,QAAQ,GAAG;EACxD,MAAM,QAAQ,YAAY,SAAS,YAAY,UAAU;EACzD,IAAI,QAAQ,GAAG,QAAQ,OAAO,WAAW,GAAG,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC,MAAM;EACrE,QAAQ,IAAI,KAAK;EACjB,MAAMA,WAAM,EAAE;CAChB;AACF"}
|
|
@@ -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-KePEAia2.cjs"));
|
|
15
15
|
await run();
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
exports.command = command;
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=mcp-
|
|
20
|
+
//# sourceMappingURL=mcp-Don4UqAB.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Don4UqAB.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"}
|
|
@@ -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-BY4KZsE3.js");
|
|
16
16
|
await run();
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
export { command };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=mcp-
|
|
21
|
+
//# sourceMappingURL=mcp-Spp8N-xs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-
|
|
1
|
+
{"version":3,"file":"mcp-Spp8N-xs.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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-Bf2T71nz.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "5.15.
|
|
2
|
+
var version = "5.15.2";
|
|
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-CI_luotn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-CI_luotn.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./rolldown-runtime-xo6NMXYd.js";
|
|
2
2
|
import { n as toError, t as getErrorMessage } from "./errors-wzqmMpMo.js";
|
|
3
|
+
import { t as isHttpUrl } from "./text-EoYn04SX.js";
|
|
3
4
|
import process from "node:process";
|
|
4
5
|
import { Diagnostics, checkCompatibility, isRegistryEntry } from "@kubb/core";
|
|
5
6
|
import { difference, isLessThan, isValid } from "verkit";
|
|
@@ -10,7 +11,7 @@ const ID = new RegExp(`^${SLUG}(\\/${SLUG})?$`);
|
|
|
10
11
|
/** The registry base URL: `KUBB_REGISTRY`, or kubb.dev. */
|
|
11
12
|
function registryUrl() {
|
|
12
13
|
const url = process.env.KUBB_REGISTRY || DEFAULT_REGISTRY;
|
|
13
|
-
if (
|
|
14
|
+
if (!isHttpUrl(url)) throw new Diagnostics.Error({
|
|
14
15
|
code: Diagnostics.code.unknown,
|
|
15
16
|
severity: "error",
|
|
16
17
|
message: `KUBB_REGISTRY must be an http(s) URL, got "${url}".`,
|
|
@@ -137,4 +138,4 @@ function closestIds({ input, ids }) {
|
|
|
137
138
|
}
|
|
138
139
|
export { installSpec as a, toRegistryId as c, incompatibility as i, toShortId as l, closestIds as n, isOutdated as o, fetchRegistryIndex as r, registryUrl as s, bumpOf as t };
|
|
139
140
|
|
|
140
|
-
//# sourceMappingURL=registry-
|
|
141
|
+
//# sourceMappingURL=registry-Cy48PGdh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-Cy48PGdh.js","names":[],"sources":["../src/utils/registry.ts"],"sourcesContent":["import process from 'node:process'\nimport { getErrorMessage, toError } from '@internals/utils'\nimport { checkCompatibility, Diagnostics, type ExtensionManifest, isRegistryEntry, type RegistryArtifact, type RegistryEntry } from '@kubb/core'\nimport { difference, isLessThan, isValid } from 'verkit'\nimport { isHttpUrl } from '../ui/text.ts'\n\nconst DEFAULT_REGISTRY = 'https://kubb.dev/registry'\n\nconst SLUG = '[a-z0-9]+(?:-[a-z0-9]+)*'\nconst ID = new RegExp(`^${SLUG}(\\\\/${SLUG})?$`)\n\n/** The registry base URL: `KUBB_REGISTRY`, or kubb.dev. */\nexport function registryUrl(): string {\n const url = process.env.KUBB_REGISTRY || DEFAULT_REGISTRY\n if (!isHttpUrl(url))\n throw new Diagnostics.Error({\n code: Diagnostics.code.unknown,\n severity: 'error',\n message: `KUBB_REGISTRY must be an http(s) URL, got \"${url}\".`,\n help: 'Set `KUBB_REGISTRY` to an http(s) URL, or unset it to use https://kubb.dev/registry.',\n })\n return url.replace(/\\/+$/, '')\n}\n\n/**\n * Turns `owner/slug`, or a bare `slug` meaning `kubb-labs/<slug>`, into a registry id.\n *\n * @throws when the id has another shape, so it never reaches a URL unchecked.\n */\nexport function toRegistryId(input: string): string {\n if (!ID.test(input))\n throw new Diagnostics.Error({\n code: Diagnostics.code.unknown,\n severity: 'error',\n message: `\"${input}\" is not a registry id. Use owner/slug, such as kubb-labs/plugin-zod, or a slug, such as plugin-zod.`,\n })\n return input.includes('/') ? input : `kubb-labs/${input}`\n}\n\n/** The shortest id `kubb add` and `kubb update` accept: the slug for an official extension, else `owner/slug`. */\nexport function toShortId(id: string): string {\n return id.startsWith('kubb-labs/') ? id.slice('kubb-labs/'.length) : id\n}\n\n/**\n * GETs `url` as JSON. A non-2xx answer or a body that is not JSON returns no `body`.\n * A network error throws with the URL.\n */\nasync function fetchJSON(url: string): Promise<{ status: number; body?: unknown }> {\n let response: Response\n try {\n response = await globalThis.fetch(url, { headers: { accept: 'application/json' } })\n } catch (cause) {\n throw new Diagnostics.Error({\n code: Diagnostics.code.inputUnreachable,\n severity: 'error',\n message: `Could not read ${url}: ${getErrorMessage(cause)}`,\n help: 'Check your network connection and that the registry is reachable.',\n cause: toError(cause),\n })\n }\n if (!response.ok) return { status: response.status }\n return { status: response.status, body: await response.json().catch(() => undefined) }\n}\n\n/** Fetches the registry index, leaving out entries that fail validation. */\nexport async function fetchRegistryIndex({ registry }: { registry: string }): Promise<Array<RegistryEntry>> {\n const { status, body } = await fetchJSON(`${registry}/index.json`)\n const index = body as { version?: unknown; extensions?: unknown } | null | undefined\n if (status !== 200 || index?.version !== 1 || !Array.isArray(index.extensions)) {\n throw new Diagnostics.Error({\n code: Diagnostics.code.inputRequestFailed,\n severity: 'error',\n message: `The registry at ${registry} sent an invalid index (HTTP ${status}).`,\n help: 'Try again later, or check that `KUBB_REGISTRY` points at a Kubb registry.',\n })\n }\n return index.extensions.filter(isRegistryEntry)\n}\n\n/** What the package manager installs: `<package>@<version>`, or a GitHub release's commit, so the install cannot move with the tag. */\nexport function installSpec(artifact: RegistryArtifact): string {\n return artifact.kind === 'github' ? `github:${artifact.owner}/${artifact.repo}#${artifact.commit}` : `${artifact.package}@${artifact.version}`\n}\n\n/** Why the running Kubb or Node.js version cannot use this extension, or `undefined` when it can. */\nexport function incompatibility(manifest: ExtensionManifest): string | undefined {\n try {\n checkCompatibility({ name: manifest.name, compatibility: manifest.compatibility })\n return undefined\n } catch (error) {\n return getErrorMessage(error)\n }\n}\n\n/**\n * Whether `latest` is newer than `installed`. An unknown installed version counts as outdated, and an\n * invalid `latest` never does.\n */\nexport function isOutdated({ installed, latest }: { installed: string | undefined; latest: string }): boolean {\n if (!isValid(latest)) return false\n return !installed || !isValid(installed) || isLessThan(installed, latest)\n}\n\n/** `major`, `minor`, or `patch` from `installed` to `latest`, or `undefined` when either is unknown or invalid. */\nexport function bumpOf({ installed, latest }: { installed: string | undefined; latest: string }): 'major' | 'minor' | 'patch' | undefined {\n if (!installed || !isValid(installed) || !isValid(latest)) return undefined\n const kind = difference(installed, latest)\n if (!kind) return undefined\n if (kind.endsWith('major')) return 'major'\n return kind.endsWith('minor') ? 'minor' : 'patch'\n}\n\nfunction editDistance(a: string, b: string): number {\n const row = Array.from({ length: b.length + 1 }, (_, index) => index)\n for (let i = 1; i <= a.length; i++) {\n let previous = row[0]!\n row[0] = i\n for (let j = 1; j <= b.length; j++) {\n const current = row[j]!\n row[j] = Math.min(row[j]! + 1, row[j - 1]! + 1, previous + (a[i - 1] === b[j - 1] ? 0 : 1))\n previous = current\n }\n }\n return row[b.length]!\n}\n\n/** Words every extension shares, so they never make two ids look alike. */\nconst COMMON_TOKENS = new Set(['kubb', 'plugin', 'adapter', 'parser'])\n\n/**\n * The ids closest to a mistyped `input`, best first, at most three: those within a few edits of it,\n * or sharing a word such as `zod` in any order. Compares slugs, so the owner may be left out.\n */\nexport function closestIds({ input, ids }: { input: string; ids: Array<string> }): Array<string> {\n const slug = (id: string) => id.slice(id.indexOf('/') + 1)\n const tokens = new Set(\n slug(input)\n .split('-')\n .filter((token) => !COMMON_TOKENS.has(token)),\n )\n return ids\n .map((id) => ({\n id,\n distance: editDistance(slug(input), slug(id)),\n shared: slug(id)\n .split('-')\n .some((token) => tokens.has(token)),\n }))\n .filter(({ distance, shared }) => shared || distance <= Math.max(2, Math.floor(slug(input).length / 4)))\n .sort((a, b) => Number(b.shared) - Number(a.shared) || a.distance - b.distance)\n .slice(0, 3)\n .map(({ id }) => id)\n}\n"],"mappings":";;;;;;;AAMA,MAAM,mBAAmB;AAEzB,MAAM,OAAO;AACb,MAAM,KAAK,IAAI,OAAO,IAAI,KAAK,MAAM,KAAK,IAAI;;AAG9C,SAAgB,cAAsB;CACpC,MAAM,MAAM,QAAQ,IAAI,iBAAiB;CACzC,IAAI,CAAC,UAAU,GAAG,GAChB,MAAM,IAAI,YAAY,MAAM;EAC1B,MAAM,YAAY,KAAK;EACvB,UAAU;EACV,SAAS,8CAA8C,IAAI;EAC3D,MAAM;CACR,CAAC;CACH,OAAO,IAAI,QAAQ,QAAQ,EAAE;AAC/B;;;;;;AAOA,SAAgB,aAAa,OAAuB;CAClD,IAAI,CAAC,GAAG,KAAK,KAAK,GAChB,MAAM,IAAI,YAAY,MAAM;EAC1B,MAAM,YAAY,KAAK;EACvB,UAAU;EACV,SAAS,IAAI,MAAM;CACrB,CAAC;CACH,OAAO,MAAM,SAAS,GAAG,IAAI,QAAQ,aAAa;AACpD;;AAGA,SAAgB,UAAU,IAAoB;CAC5C,OAAO,GAAG,WAAW,YAAY,IAAI,GAAG,MAAM,EAAmB,IAAI;AACvE;;;;;AAMA,eAAe,UAAU,KAA0D;CACjF,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,WAAW,MAAM,KAAK,EAAE,SAAS,EAAE,QAAQ,mBAAmB,EAAE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