@kubb/cli 5.0.0-beta.75 → 5.0.0-beta.77
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/LICENSE +17 -10
- package/README.md +171 -51
- package/bin/kubb.js +9 -3
- package/dist/Telemetry-CxzkLSdD.js +284 -0
- package/dist/Telemetry-CxzkLSdD.js.map +1 -0
- package/dist/Telemetry-D8jhC5Bc.cjs +315 -0
- package/dist/Telemetry-D8jhC5Bc.cjs.map +1 -0
- package/dist/{define-Bdn8j5VM.cjs → defineCommand-Bo3yZTWI.cjs} +3 -21
- package/dist/defineCommand-Bo3yZTWI.cjs.map +1 -0
- package/dist/{define-Ctii4bel.js → defineCommand-DMEeqliP.js} +4 -16
- package/dist/defineCommand-DMEeqliP.js.map +1 -0
- package/dist/{errors-CjPmyZHy.js → errors-Dc_d7BfX.js} +2 -2
- package/dist/{errors-CjPmyZHy.js.map → errors-Dc_d7BfX.js.map} +1 -1
- package/dist/{errors-CLCjoSg0.cjs → errors-gxFK0vrp.cjs} +2 -2
- package/dist/{errors-CLCjoSg0.cjs.map → errors-gxFK0vrp.cjs.map} +1 -1
- package/dist/generate-DvnQaawe.js +77 -0
- package/dist/generate-DvnQaawe.js.map +1 -0
- package/dist/generate-Dw107fw0.cjs +76 -0
- package/dist/generate-Dw107fw0.cjs.map +1 -0
- package/dist/index.cjs +93 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +93 -149
- package/dist/index.js.map +1 -1
- package/dist/init-CTY6arQX.cjs +53 -0
- package/dist/init-CTY6arQX.cjs.map +1 -0
- package/dist/init-DfWdONdA.js +53 -0
- package/dist/init-DfWdONdA.js.map +1 -0
- package/dist/mcp-Cn_LAuui.js +21 -0
- package/dist/mcp-Cn_LAuui.js.map +1 -0
- package/dist/mcp-D5bAmwu0.cjs +21 -0
- package/dist/mcp-D5bAmwu0.cjs.map +1 -0
- package/dist/{package-D5arPDnh.cjs → package-RNhs4w6c.cjs} +2 -2
- package/dist/package-RNhs4w6c.cjs.map +1 -0
- package/dist/package-pmOGZlq-.js +6 -0
- package/dist/package-pmOGZlq-.js.map +1 -0
- package/dist/run-44Zxh8Ec.js +289 -0
- package/dist/run-44Zxh8Ec.js.map +1 -0
- package/dist/run-BPLW8mrc.cjs +52 -0
- package/dist/run-BPLW8mrc.cjs.map +1 -0
- package/dist/run-DXEMoDFa.cjs +293 -0
- package/dist/run-DXEMoDFa.cjs.map +1 -0
- package/dist/run-Dv-1NGl-.js +32 -0
- package/dist/run-Dv-1NGl-.js.map +1 -0
- package/dist/run-Dzqgies_.js +1327 -0
- package/dist/run-Dzqgies_.js.map +1 -0
- package/dist/run-GFI-E4ua.cjs +33 -0
- package/dist/run-GFI-E4ua.cjs.map +1 -0
- package/dist/run-WfvBLKQY.js +51 -0
- package/dist/run-WfvBLKQY.js.map +1 -0
- package/dist/run-qhJgyKZX.cjs +1330 -0
- package/dist/run-qhJgyKZX.cjs.map +1 -0
- package/dist/tools-CZT9wSA6.cjs +175 -0
- package/dist/tools-CZT9wSA6.cjs.map +1 -0
- package/dist/tools-D0UogMU3.js +152 -0
- package/dist/tools-D0UogMU3.js.map +1 -0
- package/dist/validate-DRRJJptl.js +26 -0
- package/dist/validate-DRRJJptl.js.map +1 -0
- package/dist/validate-DYJrCiw5.cjs +26 -0
- package/dist/validate-DYJrCiw5.cjs.map +1 -0
- package/package.json +24 -28
- package/dist/agent-BEgI2HXH.cjs +0 -58
- package/dist/agent-BEgI2HXH.cjs.map +0 -1
- package/dist/agent-B_pirbeB.cjs +0 -116
- package/dist/agent-B_pirbeB.cjs.map +0 -1
- package/dist/agent-CTdJEHEs.js +0 -56
- package/dist/agent-CTdJEHEs.js.map +0 -1
- package/dist/agent-Ev5hU5hH.js +0 -112
- package/dist/agent-Ev5hU5hH.js.map +0 -1
- package/dist/constants-CnDXa1R6.cjs +0 -148
- package/dist/constants-CnDXa1R6.cjs.map +0 -1
- package/dist/constants-aL3CP_Wq.js +0 -95
- package/dist/constants-aL3CP_Wq.js.map +0 -1
- package/dist/define-Bdn8j5VM.cjs.map +0 -1
- package/dist/define-Ctii4bel.js.map +0 -1
- package/dist/generate-Cg8yufrw.js +0 -1753
- package/dist/generate-Cg8yufrw.js.map +0 -1
- package/dist/generate-DDCwNQNo.cjs +0 -65
- package/dist/generate-DDCwNQNo.cjs.map +0 -1
- package/dist/generate-K8MJ9aQF.cjs +0 -1756
- package/dist/generate-K8MJ9aQF.cjs.map +0 -1
- package/dist/generate-YPtfjsg4.js +0 -66
- package/dist/generate-YPtfjsg4.js.map +0 -1
- package/dist/init-Bu95ML_u.cjs +0 -25
- package/dist/init-Bu95ML_u.cjs.map +0 -1
- package/dist/init-CZ5Xq2Hd.cjs +0 -293
- package/dist/init-CZ5Xq2Hd.cjs.map +0 -1
- package/dist/init-eNRlotJK.js +0 -289
- package/dist/init-eNRlotJK.js.map +0 -1
- package/dist/init-ooJeOBGt.js +0 -25
- package/dist/init-ooJeOBGt.js.map +0 -1
- package/dist/mcp-C-d5N1wZ.js +0 -16
- package/dist/mcp-C-d5N1wZ.js.map +0 -1
- package/dist/mcp-CLcDV4Jm.cjs +0 -41
- package/dist/mcp-CLcDV4Jm.cjs.map +0 -1
- package/dist/mcp-D7EIR9fR.js +0 -40
- package/dist/mcp-D7EIR9fR.js.map +0 -1
- package/dist/mcp-Dpu8vzzj.cjs +0 -16
- package/dist/mcp-Dpu8vzzj.cjs.map +0 -1
- package/dist/package-D5arPDnh.cjs.map +0 -1
- package/dist/package-DqZsMLZ9.js +0 -6
- package/dist/package-DqZsMLZ9.js.map +0 -1
- package/dist/shell-475fQKaX.cjs +0 -62
- package/dist/shell-475fQKaX.cjs.map +0 -1
- package/dist/shell-DLzN4fRo.js +0 -51
- package/dist/shell-DLzN4fRo.js.map +0 -1
- package/dist/telemetry-DN95_2pF.cjs +0 -282
- package/dist/telemetry-DN95_2pF.cjs.map +0 -1
- package/dist/telemetry-LgT_sdPe.js +0 -245
- package/dist/telemetry-LgT_sdPe.js.map +0 -1
- package/dist/validate-CIR3_lZI.js +0 -25
- package/dist/validate-CIR3_lZI.js.map +0 -1
- package/dist/validate-DcqUb4DM.cjs +0 -25
- package/dist/validate-DcqUb4DM.cjs.map +0 -1
- package/dist/validate-kLJoT_hi.js +0 -33
- package/dist/validate-kLJoT_hi.js.map +0 -1
- package/dist/validate-yKKzqEZ5.cjs +0 -34
- package/dist/validate-yKKzqEZ5.cjs.map +0 -1
- package/src/commands/agent/start.ts +0 -47
- package/src/commands/agent.ts +0 -8
- package/src/commands/generate.ts +0 -57
- package/src/commands/init.ts +0 -20
- package/src/commands/mcp.ts +0 -12
- package/src/commands/validate.ts +0 -20
- package/src/constants.ts +0 -104
- package/src/index.ts +0 -43
- package/src/loggers/clackLogger.ts +0 -458
- package/src/loggers/fileSystemLogger.ts +0 -138
- package/src/loggers/githubActionsLogger.ts +0 -379
- package/src/loggers/plainLogger.ts +0 -254
- package/src/loggers/types.ts +0 -1
- package/src/loggers/utils.ts +0 -106
- package/src/runners/agent.ts +0 -149
- package/src/runners/generate.ts +0 -333
- package/src/runners/init.ts +0 -296
- package/src/runners/mcp.ts +0 -45
- package/src/runners/validate.ts +0 -39
- package/src/types.ts +0 -11
- package/src/utils/Writables.ts +0 -17
- package/src/utils/executeHooks.ts +0 -45
- package/src/utils/flags.ts +0 -9
- package/src/utils/getConfig.ts +0 -10
- package/src/utils/getCosmiConfig.ts +0 -80
- package/src/utils/getSummary.ts +0 -68
- package/src/utils/packageManager.ts +0 -23
- package/src/utils/runHook.ts +0 -91
- package/src/utils/telemetry.ts +0 -273
- package/src/utils/watcher.ts +0 -19
- /package/dist/{chunk-ByKO4r7w.cjs → rolldown-runtime-Bx3C2hgW.cjs} +0 -0
- /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
//#region src/constants.ts
|
|
2
|
-
/**
|
|
3
|
-
* Default filename for the Kubb configuration file.
|
|
4
|
-
*
|
|
5
|
-
* Used by the `init` command when scaffolding new projects and by the `agent` default config.
|
|
6
|
-
*/
|
|
7
|
-
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
8
|
-
/**
|
|
9
|
-
* NPM registry endpoint used to check for @kubb/cli updates.
|
|
10
|
-
*/
|
|
11
|
-
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
12
|
-
/**
|
|
13
|
-
* OpenTelemetry ingestion endpoint for anonymous usage telemetry.
|
|
14
|
-
*/
|
|
15
|
-
const OTLP_ENDPOINT = "https://otlp.kubb.dev";
|
|
16
|
-
/**
|
|
17
|
-
* Horizontal rule rendered above/below the plain-logger generation summary.
|
|
18
|
-
*/
|
|
19
|
-
const SUMMARY_SEPARATOR = "─".repeat(27);
|
|
20
|
-
/**
|
|
21
|
-
* Glob pattern for paths the file watcher ignores.
|
|
22
|
-
*/
|
|
23
|
-
const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
|
|
24
|
-
/**
|
|
25
|
-
* Flags that short-circuit execution (help/version) — no telemetry notice is shown.
|
|
26
|
-
*/
|
|
27
|
-
const QUIET_FLAGS = new Set([
|
|
28
|
-
"--help",
|
|
29
|
-
"-h",
|
|
30
|
-
"--version",
|
|
31
|
-
"-v"
|
|
32
|
-
]);
|
|
33
|
-
const agentDefaults = {
|
|
34
|
-
port: "3000",
|
|
35
|
-
host: "localhost",
|
|
36
|
-
configFile: KUBB_CONFIG_FILENAME,
|
|
37
|
-
retryTimeout: "30000",
|
|
38
|
-
studioUrl: "https://studio.kubb.dev",
|
|
39
|
-
/**
|
|
40
|
-
* Relative path from the @kubb/agent package root to the server entry.
|
|
41
|
-
*/
|
|
42
|
-
serverEntryPath: ".output/server/index.mjs"
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Default values used during interactive `init` scaffolding.
|
|
46
|
-
*/
|
|
47
|
-
const initDefaults = {
|
|
48
|
-
inputPath: "./openapi.yaml",
|
|
49
|
-
outputPath: "./src/gen",
|
|
50
|
-
plugins: ["plugin-ts"]
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Maps each plugin value to the default config snippet inserted by `init`.
|
|
54
|
-
* The `satisfies` constraint ensures all values remain plain strings while
|
|
55
|
-
* `as const` keeps the object deeply immutable.
|
|
56
|
-
*/
|
|
57
|
-
const pluginDefaultConfigs = {
|
|
58
|
-
"plugin-ts": `pluginTs({
|
|
59
|
-
output: { path: 'models' },
|
|
60
|
-
})`,
|
|
61
|
-
"plugin-client": `pluginClient({
|
|
62
|
-
output: { path: 'clients' },
|
|
63
|
-
})`,
|
|
64
|
-
"plugin-react-query": `pluginReactQuery({
|
|
65
|
-
output: { path: 'hooks' },
|
|
66
|
-
})`,
|
|
67
|
-
"plugin-vue-query": `pluginVueQuery({
|
|
68
|
-
output: { path: 'hooks' },
|
|
69
|
-
})`,
|
|
70
|
-
"plugin-zod": `pluginZod({
|
|
71
|
-
output: { path: 'zod' },
|
|
72
|
-
})`,
|
|
73
|
-
"plugin-faker": `pluginFaker({
|
|
74
|
-
output: { path: 'mocks' },
|
|
75
|
-
})`,
|
|
76
|
-
"plugin-msw": `pluginMsw({
|
|
77
|
-
output: { path: 'msw' },
|
|
78
|
-
})`,
|
|
79
|
-
"plugin-cypress": `pluginCypress({
|
|
80
|
-
output: { path: 'cypress' },
|
|
81
|
-
})`,
|
|
82
|
-
"plugin-mcp": `pluginMcp({
|
|
83
|
-
output: { path: 'mcp' },
|
|
84
|
-
})`,
|
|
85
|
-
"plugin-redoc": `pluginRedoc({
|
|
86
|
-
output: { path: 'redoc' },
|
|
87
|
-
})`
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Color palette used by randomCliColor() for deterministic plugin name coloring.
|
|
91
|
-
*/
|
|
92
|
-
//#endregion
|
|
93
|
-
Object.defineProperty(exports, "KUBB_CONFIG_FILENAME", {
|
|
94
|
-
enumerable: true,
|
|
95
|
-
get: function() {
|
|
96
|
-
return KUBB_CONFIG_FILENAME;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(exports, "KUBB_NPM_PACKAGE_URL", {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function() {
|
|
102
|
-
return KUBB_NPM_PACKAGE_URL;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
Object.defineProperty(exports, "OTLP_ENDPOINT", {
|
|
106
|
-
enumerable: true,
|
|
107
|
-
get: function() {
|
|
108
|
-
return OTLP_ENDPOINT;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
Object.defineProperty(exports, "QUIET_FLAGS", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
get: function() {
|
|
114
|
-
return QUIET_FLAGS;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
Object.defineProperty(exports, "SUMMARY_SEPARATOR", {
|
|
118
|
-
enumerable: true,
|
|
119
|
-
get: function() {
|
|
120
|
-
return SUMMARY_SEPARATOR;
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
Object.defineProperty(exports, "WATCHER_IGNORED_PATHS", {
|
|
124
|
-
enumerable: true,
|
|
125
|
-
get: function() {
|
|
126
|
-
return WATCHER_IGNORED_PATHS;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(exports, "agentDefaults", {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
get: function() {
|
|
132
|
-
return agentDefaults;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
Object.defineProperty(exports, "initDefaults", {
|
|
136
|
-
enumerable: true,
|
|
137
|
-
get: function() {
|
|
138
|
-
return initDefaults;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
Object.defineProperty(exports, "pluginDefaultConfigs", {
|
|
142
|
-
enumerable: true,
|
|
143
|
-
get: function() {
|
|
144
|
-
return pluginDefaultConfigs;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
//# sourceMappingURL=constants-CnDXa1R6.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-CnDXa1R6.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Default filename for the Kubb configuration file.\n *\n * Used by the `init` command when scaffolding new projects and by the `agent` default config.\n */\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/**\n * NPM registry endpoint used to check for @kubb/cli updates.\n */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/**\n * OpenTelemetry ingestion endpoint for anonymous usage telemetry.\n */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/**\n * Horizontal rule rendered above/below the plain-logger generation summary.\n */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/**\n * Maximum number of █ characters in a plugin timing bar.\n */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/**\n * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).\n */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/**\n * Glob pattern for paths the file watcher ignores.\n */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/**\n * Flags that short-circuit execution (help/version) — no telemetry notice is shown.\n */\nexport const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: KUBB_CONFIG_FILENAME,\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /**\n * Relative path from the @kubb/agent package root to the server entry.\n */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/**\n * Default values used during interactive `init` scaffolding.\n */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n 'plugin-cypress': `pluginCypress({\n output: { path: 'cypress' },\n })`,\n 'plugin-mcp': `pluginMcp({\n output: { path: 'mcp' },\n })`,\n 'plugin-redoc': `pluginRedoc({\n output: { path: 'redoc' },\n })`,\n} as const satisfies Record<string, string>\n\n/**\n * Color palette used by randomCliColor() for deterministic plugin name coloring.\n */\n"],"mappings":";;;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;;;;AAK7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;;;AAe/C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;CAAK,CAAU;AAEhF,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;CAClB;;;;AAKD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,YAAY;CACvB;;;;;;AAOD,MAAa,uBAAuB;CAClC,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,oBAAoB;;;CAGpB,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGd,kBAAkB;;;CAGlB,cAAc;;;CAGd,gBAAgB;;;CAGjB"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
//#region src/constants.ts
|
|
2
|
-
/**
|
|
3
|
-
* Default filename for the Kubb configuration file.
|
|
4
|
-
*
|
|
5
|
-
* Used by the `init` command when scaffolding new projects and by the `agent` default config.
|
|
6
|
-
*/
|
|
7
|
-
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
8
|
-
/**
|
|
9
|
-
* NPM registry endpoint used to check for @kubb/cli updates.
|
|
10
|
-
*/
|
|
11
|
-
const KUBB_NPM_PACKAGE_URL = "https://registry.npmjs.org/@kubb/cli/latest";
|
|
12
|
-
/**
|
|
13
|
-
* OpenTelemetry ingestion endpoint for anonymous usage telemetry.
|
|
14
|
-
*/
|
|
15
|
-
const OTLP_ENDPOINT = "https://otlp.kubb.dev";
|
|
16
|
-
/**
|
|
17
|
-
* Horizontal rule rendered above/below the plain-logger generation summary.
|
|
18
|
-
*/
|
|
19
|
-
const SUMMARY_SEPARATOR = "─".repeat(27);
|
|
20
|
-
/**
|
|
21
|
-
* Glob pattern for paths the file watcher ignores.
|
|
22
|
-
*/
|
|
23
|
-
const WATCHER_IGNORED_PATHS = "**/{.git,node_modules}/**";
|
|
24
|
-
/**
|
|
25
|
-
* Flags that short-circuit execution (help/version) — no telemetry notice is shown.
|
|
26
|
-
*/
|
|
27
|
-
const QUIET_FLAGS = new Set([
|
|
28
|
-
"--help",
|
|
29
|
-
"-h",
|
|
30
|
-
"--version",
|
|
31
|
-
"-v"
|
|
32
|
-
]);
|
|
33
|
-
const agentDefaults = {
|
|
34
|
-
port: "3000",
|
|
35
|
-
host: "localhost",
|
|
36
|
-
configFile: KUBB_CONFIG_FILENAME,
|
|
37
|
-
retryTimeout: "30000",
|
|
38
|
-
studioUrl: "https://studio.kubb.dev",
|
|
39
|
-
/**
|
|
40
|
-
* Relative path from the @kubb/agent package root to the server entry.
|
|
41
|
-
*/
|
|
42
|
-
serverEntryPath: ".output/server/index.mjs"
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Default values used during interactive `init` scaffolding.
|
|
46
|
-
*/
|
|
47
|
-
const initDefaults = {
|
|
48
|
-
inputPath: "./openapi.yaml",
|
|
49
|
-
outputPath: "./src/gen",
|
|
50
|
-
plugins: ["plugin-ts"]
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Maps each plugin value to the default config snippet inserted by `init`.
|
|
54
|
-
* The `satisfies` constraint ensures all values remain plain strings while
|
|
55
|
-
* `as const` keeps the object deeply immutable.
|
|
56
|
-
*/
|
|
57
|
-
const pluginDefaultConfigs = {
|
|
58
|
-
"plugin-ts": `pluginTs({
|
|
59
|
-
output: { path: 'models' },
|
|
60
|
-
})`,
|
|
61
|
-
"plugin-client": `pluginClient({
|
|
62
|
-
output: { path: 'clients' },
|
|
63
|
-
})`,
|
|
64
|
-
"plugin-react-query": `pluginReactQuery({
|
|
65
|
-
output: { path: 'hooks' },
|
|
66
|
-
})`,
|
|
67
|
-
"plugin-vue-query": `pluginVueQuery({
|
|
68
|
-
output: { path: 'hooks' },
|
|
69
|
-
})`,
|
|
70
|
-
"plugin-zod": `pluginZod({
|
|
71
|
-
output: { path: 'zod' },
|
|
72
|
-
})`,
|
|
73
|
-
"plugin-faker": `pluginFaker({
|
|
74
|
-
output: { path: 'mocks' },
|
|
75
|
-
})`,
|
|
76
|
-
"plugin-msw": `pluginMsw({
|
|
77
|
-
output: { path: 'msw' },
|
|
78
|
-
})`,
|
|
79
|
-
"plugin-cypress": `pluginCypress({
|
|
80
|
-
output: { path: 'cypress' },
|
|
81
|
-
})`,
|
|
82
|
-
"plugin-mcp": `pluginMcp({
|
|
83
|
-
output: { path: 'mcp' },
|
|
84
|
-
})`,
|
|
85
|
-
"plugin-redoc": `pluginRedoc({
|
|
86
|
-
output: { path: 'redoc' },
|
|
87
|
-
})`
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Color palette used by randomCliColor() for deterministic plugin name coloring.
|
|
91
|
-
*/
|
|
92
|
-
//#endregion
|
|
93
|
-
export { SUMMARY_SEPARATOR as a, initDefaults as c, QUIET_FLAGS as i, pluginDefaultConfigs as l, KUBB_NPM_PACKAGE_URL as n, WATCHER_IGNORED_PATHS as o, OTLP_ENDPOINT as r, agentDefaults as s, KUBB_CONFIG_FILENAME as t };
|
|
94
|
-
|
|
95
|
-
//# sourceMappingURL=constants-aL3CP_Wq.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants-aL3CP_Wq.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Default filename for the Kubb configuration file.\n *\n * Used by the `init` command when scaffolding new projects and by the `agent` default config.\n */\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\n/**\n * NPM registry endpoint used to check for @kubb/cli updates.\n */\nexport const KUBB_NPM_PACKAGE_URL = 'https://registry.npmjs.org/@kubb/cli/latest' as const\n\n/**\n * OpenTelemetry ingestion endpoint for anonymous usage telemetry.\n */\nexport const OTLP_ENDPOINT = 'https://otlp.kubb.dev' as const\n\n/**\n * Horizontal rule rendered above/below the plain-logger generation summary.\n */\nexport const SUMMARY_SEPARATOR = '─'.repeat(27)\n\n/**\n * Maximum number of █ characters in a plugin timing bar.\n */\nexport const SUMMARY_MAX_BAR_LENGTH = 10 as const\n\n/**\n * Divides elapsed milliseconds into bar-length units (1 block per 100 ms).\n */\nexport const SUMMARY_TIME_SCALE_DIVISOR = 100 as const\n\n/**\n * Glob pattern for paths the file watcher ignores.\n */\nexport const WATCHER_IGNORED_PATHS = '**/{.git,node_modules}/**' as const\n\n/**\n * Flags that short-circuit execution (help/version) — no telemetry notice is shown.\n */\nexport const QUIET_FLAGS = new Set(['--help', '-h', '--version', '-v'] as const)\n\nexport const agentDefaults = {\n port: '3000',\n host: 'localhost',\n configFile: KUBB_CONFIG_FILENAME,\n retryTimeout: '30000',\n studioUrl: 'https://studio.kubb.dev',\n /**\n * Relative path from the @kubb/agent package root to the server entry.\n */\n serverEntryPath: '.output/server/index.mjs',\n} as const\n\n/**\n * Default values used during interactive `init` scaffolding.\n */\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\n/**\n * Maps each plugin value to the default config snippet inserted by `init`.\n * The `satisfies` constraint ensures all values remain plain strings while\n * `as const` keeps the object deeply immutable.\n */\nexport const pluginDefaultConfigs = {\n 'plugin-ts': `pluginTs({\n output: { path: 'models' },\n })`,\n 'plugin-client': `pluginClient({\n output: { path: 'clients' },\n })`,\n 'plugin-react-query': `pluginReactQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-vue-query': `pluginVueQuery({\n output: { path: 'hooks' },\n })`,\n 'plugin-zod': `pluginZod({\n output: { path: 'zod' },\n })`,\n 'plugin-faker': `pluginFaker({\n output: { path: 'mocks' },\n })`,\n 'plugin-msw': `pluginMsw({\n output: { path: 'msw' },\n })`,\n 'plugin-cypress': `pluginCypress({\n output: { path: 'cypress' },\n })`,\n 'plugin-mcp': `pluginMcp({\n output: { path: 'mcp' },\n })`,\n 'plugin-redoc': `pluginRedoc({\n output: { path: 'redoc' },\n })`,\n} as const satisfies Record<string, string>\n\n/**\n * Color palette used by randomCliColor() for deterministic plugin name coloring.\n */\n"],"mappings":";;;;;;AAKA,MAAa,uBAAuB;;;;AAKpC,MAAa,uBAAuB;;;;AAKpC,MAAa,gBAAgB;;;;AAK7B,MAAa,oBAAoB,IAAI,OAAO,GAAG;;;;AAe/C,MAAa,wBAAwB;;;;AAKrC,MAAa,cAAc,IAAI,IAAI;CAAC;CAAU;CAAM;CAAa;CAAK,CAAU;AAEhF,MAAa,gBAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY;CACZ,cAAc;CACd,WAAW;;;;CAIX,iBAAiB;CAClB;;;;AAKD,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,YAAY;CACvB;;;;;;AAOD,MAAa,uBAAuB;CAClC,aAAa;;;CAGb,iBAAiB;;;CAGjB,sBAAsB;;;CAGtB,oBAAoB;;;CAGpB,cAAc;;;CAGd,gBAAgB;;;CAGhB,cAAc;;;CAGd,kBAAkB;;;CAGlB,cAAc;;;CAGd,gBAAgB;;;CAGjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-Bdn8j5VM.cjs","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-Ctii4bel.js","names":[],"sources":["../../../internals/utils/src/cli/define.ts"],"sourcesContent":["import type { CLIAdapter, CommandDefinition, OptionDefinition } from './types.ts'\n\ntype OptionTypeMap = { string: string; boolean: boolean }\n\ntype IsRequired<O extends OptionDefinition> = O['default'] extends string | boolean ? true : O['required'] extends true ? true : false\n\n/**\n * Infers typed values from an options record. Options with a `default` or `required: true` are always defined.\n */\ntype InferValues<O extends Record<string, OptionDefinition>> = {\n [K in keyof O as IsRequired<O[K]> extends true ? K : never]: OptionTypeMap[O[K]['type']]\n} & {\n [K in keyof O as IsRequired<O[K]> extends true ? never : K]?: OptionTypeMap[O[K]['type']]\n}\n\n/**\n * Returns a `CLIAdapter` as-is with full type inference. Pass a custom adapter to `createCLI` to swap the CLI engine.\n *\n * @example\n * ```ts\n * const adapter = defineCLIAdapter({ run: myRun, renderHelp: myHelp })\n * createCLI({ adapter }).run(commands, argv, opts)\n * ```\n */\nexport function defineCLIAdapter(adapter: CLIAdapter): CLIAdapter {\n return adapter\n}\n\n/**\n * Returns a `CommandDefinition` with typed `values` in `run()`.\n * The callback receives `values` inferred from the declared options — no casts needed.\n *\n * @example\n * ```ts\n * const generate = defineCommand({\n * name: 'generate',\n * description: 'Generate client code',\n * options: { config: { type: 'string', description: 'Config path' } },\n * async run({ values }) { console.log(values.config) },\n * })\n * ```\n */\nexport function defineCommand<O extends Record<string, OptionDefinition>>(def: {\n name: string\n description: string\n arguments?: string[]\n options?: O\n subCommands?: CommandDefinition[]\n run?: (args: { values: InferValues<O>; positionals: string[] }) => Promise<void>\n}): CommandDefinition {\n const { run, ...rest } = def\n if (!run) return rest\n return {\n ...rest,\n run: (args) =>\n run({\n values: args.values as InferValues<O>,\n positionals: args.positionals,\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,iBAAiB,SAAiC;AAChE,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,cAA0D,KAOpD;CACpB,MAAM,EAAE,KAAK,GAAG,SAAS;AACzB,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO;EACL,GAAG;EACH,MAAM,SACJ,IAAI;GACF,QAAQ,KAAK;GACb,aAAa,KAAK;GACnB,CAAC;EACL"}
|