@kubb/cli 5.0.0-beta.7 → 5.0.0-beta.71
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 +45 -77
- package/bin/kubb.js +9 -3
- package/dist/Telemetry-CfPP7MYq.cjs +321 -0
- package/dist/Telemetry-CfPP7MYq.cjs.map +1 -0
- package/dist/Telemetry-uAr3lK_-.js +284 -0
- package/dist/Telemetry-uAr3lK_-.js.map +1 -0
- package/dist/{define-Bdn8j5VM.cjs → defineCommand-Bo3yZTWI.cjs} +3 -21
- package/dist/defineCommand-Bo3yZTWI.cjs.map +1 -0
- package/dist/{define-m_fp-Aqm.js → defineCommand-DMEeqliP.js} +4 -16
- package/dist/defineCommand-DMEeqliP.js.map +1 -0
- package/dist/{errors-CINO1EIv.js → errors-Dc_d7BfX.js} +2 -2
- package/dist/{errors-CINO1EIv.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-Bod9YCbF.cjs → generate-Dj_ztXAk.cjs} +21 -16
- package/dist/generate-Dj_ztXAk.cjs.map +1 -0
- package/dist/{generate-BY-juRdH.js → generate-DqE96-AW.js} +21 -16
- package/dist/generate-DqE96-AW.js.map +1 -0
- package/dist/index.cjs +34 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +34 -81
- package/dist/index.js.map +1 -1
- package/dist/{init-BIkZU6mB.cjs → init-CT0QBOJR.cjs} +6 -6
- package/dist/{init-BIkZU6mB.cjs.map → init-CT0QBOJR.cjs.map} +1 -1
- package/dist/{init-Cs3Fp6nN.js → init-Dj-yuBT4.js} +5 -5
- package/dist/{init-Cs3Fp6nN.js.map → init-Dj-yuBT4.js.map} +1 -1
- package/dist/mcp-Bx5bWdkI.cjs +21 -0
- package/dist/mcp-Bx5bWdkI.cjs.map +1 -0
- package/dist/mcp-Dgf2OtCy.js +21 -0
- package/dist/mcp-Dgf2OtCy.js.map +1 -0
- package/dist/{package-DrUndPET.cjs → package-CK8o-iEe.cjs} +2 -2
- package/dist/package-CK8o-iEe.cjs.map +1 -0
- package/dist/package-DC0ALWof.js +6 -0
- package/dist/package-DC0ALWof.js.map +1 -0
- package/dist/{chunk-BvFE5Tac.js → rolldown-runtime-C0LytTxp.js} +0 -1
- package/dist/{run-YsoCk5we.cjs → run-AYlRjIX5.cjs} +136 -98
- package/dist/run-AYlRjIX5.cjs.map +1 -0
- package/dist/run-B9R0rCqJ.cjs +1380 -0
- package/dist/run-B9R0rCqJ.cjs.map +1 -0
- package/dist/run-BM1t8CSM.cjs +33 -0
- package/dist/run-BM1t8CSM.cjs.map +1 -0
- package/dist/run-BlFVmIJl.js +32 -0
- package/dist/run-BlFVmIJl.js.map +1 -0
- package/dist/{run-CQbj3ley.cjs → run-CBc896in.cjs} +6 -6
- package/dist/run-CBc896in.cjs.map +1 -0
- package/dist/run-CxPZ9S4b.js +1377 -0
- package/dist/run-CxPZ9S4b.js.map +1 -0
- package/dist/{run-CF97BWVa.js → run-D9mQoQHA.js} +123 -85
- package/dist/run-D9mQoQHA.js.map +1 -0
- package/dist/{run-CCZ24VKk.js → run-D_dWNFhX.js} +5 -5
- package/dist/run-D_dWNFhX.js.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-lbUkWQ5o.js → validate-CRXa_v3l.js} +5 -5
- package/dist/{validate-lbUkWQ5o.js.map → validate-CRXa_v3l.js.map} +1 -1
- package/dist/{validate-Bfpf_UIh.cjs → validate-CVqbA1lL.cjs} +6 -6
- package/dist/{validate-Bfpf_UIh.cjs.map → validate-CVqbA1lL.cjs.map} +1 -1
- package/package.json +13 -25
- package/dist/agent-DN7o8nlE.js +0 -68
- package/dist/agent-DN7o8nlE.js.map +0 -1
- package/dist/agent-Fm9_8BBH.cjs +0 -70
- package/dist/agent-Fm9_8BBH.cjs.map +0 -1
- package/dist/constants-B2JTeRBb.js +0 -42
- package/dist/constants-B2JTeRBb.js.map +0 -1
- package/dist/constants-BINTA5VZ.cjs +0 -77
- package/dist/constants-BINTA5VZ.cjs.map +0 -1
- package/dist/constants-BYGmiFs0.cjs +0 -139
- package/dist/constants-BYGmiFs0.cjs.map +0 -1
- package/dist/constants-DSJ-Xrbv.js +0 -116
- package/dist/constants-DSJ-Xrbv.js.map +0 -1
- package/dist/define-Bdn8j5VM.cjs.map +0 -1
- package/dist/define-m_fp-Aqm.js.map +0 -1
- package/dist/generate-BY-juRdH.js.map +0 -1
- package/dist/generate-Bod9YCbF.cjs.map +0 -1
- package/dist/mcp-BSNulBcC.js +0 -39
- package/dist/mcp-BSNulBcC.js.map +0 -1
- package/dist/mcp-DcSrFhhP.cjs +0 -39
- package/dist/mcp-DcSrFhhP.cjs.map +0 -1
- package/dist/package-D5wmvFl4.js +0 -6
- package/dist/package-D5wmvFl4.js.map +0 -1
- package/dist/package-DrUndPET.cjs.map +0 -1
- package/dist/run-BAJubgdA.js +0 -1735
- package/dist/run-BAJubgdA.js.map +0 -1
- package/dist/run-BzpYYOQs.js +0 -121
- package/dist/run-BzpYYOQs.js.map +0 -1
- package/dist/run-CCZ24VKk.js.map +0 -1
- package/dist/run-CF97BWVa.js.map +0 -1
- package/dist/run-CQbj3ley.cjs.map +0 -1
- package/dist/run-CqKd6JNc.cjs +0 -1738
- package/dist/run-CqKd6JNc.cjs.map +0 -1
- package/dist/run-D0hmRpHy.js +0 -49
- package/dist/run-D0hmRpHy.js.map +0 -1
- package/dist/run-DwdAwnLG.cjs +0 -125
- package/dist/run-DwdAwnLG.cjs.map +0 -1
- package/dist/run-Lr0Ctnu0.cjs +0 -50
- package/dist/run-Lr0Ctnu0.cjs.map +0 -1
- package/dist/run-YsoCk5we.cjs.map +0 -1
- package/dist/shell-475fQKaX.cjs +0 -62
- package/dist/shell-475fQKaX.cjs.map +0 -1
- package/dist/shell-CN6DNqeC.js +0 -51
- package/dist/shell-CN6DNqeC.js.map +0 -1
- package/dist/telemetry-B2iWkY5e.cjs +0 -280
- package/dist/telemetry-B2iWkY5e.cjs.map +0 -1
- package/dist/telemetry-BkektVz6.js +0 -243
- package/dist/telemetry-BkektVz6.js.map +0 -1
- package/src/commands/agent/start.ts +0 -50
- package/src/commands/agent.ts +0 -10
- package/src/commands/generate.ts +0 -59
- package/src/commands/init.ts +0 -51
- package/src/commands/mcp.ts +0 -36
- package/src/commands/validate.ts +0 -22
- package/src/constants.ts +0 -48
- package/src/index.ts +0 -45
- package/src/loggers/clackLogger.ts +0 -460
- package/src/loggers/fileSystemLogger.ts +0 -148
- package/src/loggers/githubActionsLogger.ts +0 -367
- package/src/loggers/plainLogger.ts +0 -243
- package/src/loggers/types.ts +0 -7
- package/src/loggers/utils.ts +0 -252
- package/src/runners/agent/run.ts +0 -113
- package/src/runners/agent/utils.ts +0 -98
- package/src/runners/generate/run.ts +0 -276
- package/src/runners/generate/utils.ts +0 -209
- package/src/runners/init/run.ts +0 -211
- package/src/runners/init/utils.ts +0 -33
- package/src/runners/mcp/run.ts +0 -55
- package/src/runners/validate/run.ts +0 -63
- package/src/telemetry.ts +0 -280
- /package/dist/{chunk-ByKO4r7w.cjs → rolldown-runtime-Bx3C2hgW.cjs} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require("./rolldown-runtime-Bx3C2hgW.cjs");
|
|
2
|
+
const require_defineCommand = require("./defineCommand-Bo3yZTWI.cjs");
|
|
3
|
+
const require_package = require("./package-CK8o-iEe.cjs");
|
|
4
|
+
//#region src/commands/mcp.ts
|
|
5
|
+
const command = require_defineCommand.defineCommand({
|
|
6
|
+
name: "mcp",
|
|
7
|
+
description: "Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.",
|
|
8
|
+
examples: [
|
|
9
|
+
"kubb mcp",
|
|
10
|
+
"# Then add to your MCP client config:",
|
|
11
|
+
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
12
|
+
],
|
|
13
|
+
async run() {
|
|
14
|
+
const { run } = await Promise.resolve().then(() => require("./run-BM1t8CSM.cjs"));
|
|
15
|
+
await run({ version: require_package.version });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.command = command;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=mcp-Bx5bWdkI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-Bx5bWdkI.cjs","names":["defineCommand"],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'],\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAUA,sBAAAA,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E;CAC/I,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oBAAA,CAAA;EAEtB,MAAM,IAAI,EAAE,SAAA,gBAAA,QAAQ,CAAC;CACvB;AACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
+
import { t as defineCommand } from "./defineCommand-DMEeqliP.js";
|
|
3
|
+
import { t as version } from "./package-DC0ALWof.js";
|
|
4
|
+
//#region src/commands/mcp.ts
|
|
5
|
+
const command = defineCommand({
|
|
6
|
+
name: "mcp",
|
|
7
|
+
description: "Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.",
|
|
8
|
+
examples: [
|
|
9
|
+
"kubb mcp",
|
|
10
|
+
"# Then add to your MCP client config:",
|
|
11
|
+
"# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }"
|
|
12
|
+
],
|
|
13
|
+
async run() {
|
|
14
|
+
const { run } = await import("./run-BlFVmIJl.js");
|
|
15
|
+
await run({ version });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { command };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=mcp-Dgf2OtCy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-Dgf2OtCy.js","names":[],"sources":["../src/commands/mcp.ts"],"sourcesContent":["import { defineCommand } from '@internals/utils'\nimport { version } from '../../package.json'\n\nexport const command = defineCommand({\n name: 'mcp',\n description:\n 'Start a Model Context Protocol (MCP) server that exposes Kubb code generation as tools for AI assistants. Once running, configure your AI client (Claude, Cursor, Windsurf, etc.) to connect to it — the assistant can then call kubb generate directly without leaving the chat.',\n examples: ['kubb mcp', '# Then add to your MCP client config:', '# { \"mcpServers\": { \"kubb\": { \"command\": \"npx\", \"args\": [\"kubb\", \"mcp\"] } } }'],\n async run() {\n const { run } = await import('../runners/mcp/run.ts')\n\n await run({ version })\n },\n})\n"],"mappings":";;;;AAGA,MAAa,UAAU,cAAc;CACnC,MAAM;CACN,aACE;CACF,UAAU;EAAC;EAAY;EAAyC;CAA+E;CAC/I,MAAM,MAAM;EACV,MAAM,EAAE,QAAQ,MAAM,OAAO;EAE7B,MAAM,IAAI,EAAE,QAAQ,CAAC;CACvB;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "5.0.0-beta.
|
|
2
|
+
var version = "5.0.0-beta.71";
|
|
3
3
|
//#endregion
|
|
4
4
|
Object.defineProperty(exports, "version", {
|
|
5
5
|
enumerable: true,
|
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "version", {
|
|
|
8
8
|
}
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=package-
|
|
11
|
+
//# sourceMappingURL=package-CK8o-iEe.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-CK8o-iEe.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-DC0ALWof.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,70 +1,95 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_constants = require("./constants-BYGmiFs0.cjs");
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-Bx3C2hgW.cjs");
|
|
2
|
+
const require_tools = require("./tools-CZT9wSA6.cjs");
|
|
4
3
|
let node_util = require("node:util");
|
|
5
4
|
let node_fs = require("node:fs");
|
|
6
|
-
node_fs =
|
|
5
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
7
6
|
let node_path = require("node:path");
|
|
8
|
-
node_path =
|
|
7
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
9
8
|
let node_process = require("node:process");
|
|
10
|
-
node_process =
|
|
9
|
+
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
11
10
|
let _clack_prompts = require("@clack/prompts");
|
|
12
|
-
_clack_prompts =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
_clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
|
|
12
|
+
let tinyexec = require("tinyexec");
|
|
13
|
+
//#region ../../internals/shared/src/constants.ts
|
|
14
|
+
const KUBB_CONFIG_FILENAME = "kubb.config.ts";
|
|
15
|
+
const initDefaults = {
|
|
16
|
+
inputPath: "./openapi.yaml",
|
|
17
|
+
outputPath: "./src/gen",
|
|
18
|
+
plugins: ["plugin-ts"]
|
|
19
|
+
};
|
|
20
|
+
const availablePlugins = [
|
|
21
|
+
{
|
|
22
|
+
value: "plugin-ts",
|
|
23
|
+
label: "TypeScript",
|
|
24
|
+
hint: "Recommended",
|
|
25
|
+
packageName: "@kubb/plugin-ts",
|
|
26
|
+
importName: "pluginTs",
|
|
27
|
+
category: "types"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "plugin-client",
|
|
31
|
+
label: "Client (Fetch/Axios)",
|
|
32
|
+
packageName: "@kubb/plugin-client",
|
|
33
|
+
importName: "pluginClient",
|
|
34
|
+
category: "client"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "plugin-react-query",
|
|
38
|
+
label: "React Query / TanStack Query",
|
|
39
|
+
packageName: "@kubb/plugin-react-query",
|
|
40
|
+
importName: "pluginReactQuery",
|
|
41
|
+
category: "framework"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: "plugin-vue-query",
|
|
45
|
+
label: "Vue Query",
|
|
46
|
+
packageName: "@kubb/plugin-vue-query",
|
|
47
|
+
importName: "pluginVueQuery",
|
|
48
|
+
category: "framework"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "plugin-zod",
|
|
52
|
+
label: "Zod Schemas",
|
|
53
|
+
packageName: "@kubb/plugin-zod",
|
|
54
|
+
importName: "pluginZod",
|
|
55
|
+
category: "validation"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "plugin-faker",
|
|
59
|
+
label: "Faker.js Mocks",
|
|
60
|
+
packageName: "@kubb/plugin-faker",
|
|
61
|
+
importName: "pluginFaker",
|
|
62
|
+
category: "mocks"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "plugin-msw",
|
|
66
|
+
label: "MSW Handlers",
|
|
67
|
+
packageName: "@kubb/plugin-msw",
|
|
68
|
+
importName: "pluginMsw",
|
|
69
|
+
category: "mocks"
|
|
28
70
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
71
|
+
{
|
|
72
|
+
value: "plugin-cypress",
|
|
73
|
+
label: "Cypress Tests",
|
|
74
|
+
packageName: "@kubb/plugin-cypress",
|
|
75
|
+
importName: "pluginCypress",
|
|
76
|
+
category: "testing"
|
|
33
77
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
78
|
+
{
|
|
79
|
+
value: "plugin-mcp",
|
|
80
|
+
label: "MCP Server (AI / Model Context Protocol)",
|
|
81
|
+
packageName: "@kubb/plugin-mcp",
|
|
82
|
+
importName: "pluginMcp",
|
|
83
|
+
category: "ai"
|
|
38
84
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
{
|
|
86
|
+
value: "plugin-redoc",
|
|
87
|
+
label: "ReDoc Documentation",
|
|
88
|
+
packageName: "@kubb/plugin-redoc",
|
|
89
|
+
importName: "pluginRedoc",
|
|
90
|
+
category: "documentation"
|
|
43
91
|
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Detects the active package manager for the given directory.
|
|
47
|
-
* Resolution order: `packageManager` field in `package.json`, then presence of a lock file.
|
|
48
|
-
* Falls back to `npm` when no signal is found.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* detectPackageManager('/my/project') // { name: 'pnpm', lockFile: 'pnpm-lock.yaml', ... }
|
|
53
|
-
* detectPackageManager() // falls back to npm when no lock file is found
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
function detectPackageManager(cwd = process.cwd()) {
|
|
57
|
-
const packageJsonPath = (0, node_path.join)(cwd, "package.json");
|
|
58
|
-
if ((0, node_fs.existsSync)(packageJsonPath)) try {
|
|
59
|
-
const pmField = JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf-8")).packageManager;
|
|
60
|
-
if (typeof pmField === "string") {
|
|
61
|
-
const name = pmField.split("@")[0];
|
|
62
|
-
if (name && name in packageManagers) return packageManagers[name];
|
|
63
|
-
}
|
|
64
|
-
} catch {}
|
|
65
|
-
for (const pm of Object.values(packageManagers)) if ((0, node_fs.existsSync)((0, node_path.join)(cwd, pm.lockFile))) return pm;
|
|
66
|
-
return packageManagers.npm;
|
|
67
|
-
}
|
|
92
|
+
];
|
|
68
93
|
//#endregion
|
|
69
94
|
//#region ../../internals/shared/src/init.ts
|
|
70
95
|
function generateConfigFile({ selectedPlugins, inputPath, outputPath }) {
|
|
@@ -81,9 +106,7 @@ export default defineConfig({
|
|
|
81
106
|
clean: true,
|
|
82
107
|
},
|
|
83
108
|
plugins: [
|
|
84
|
-
${selectedPlugins.map((plugin) => {
|
|
85
|
-
return ` ${require_constants.pluginDefaultConfigs[plugin.value] ?? `${plugin.importName}()`},`;
|
|
86
|
-
}).join("\n")}
|
|
109
|
+
${selectedPlugins.map((plugin) => ` ${plugin.importName}(),`).join("\n")}
|
|
87
110
|
],
|
|
88
111
|
})
|
|
89
112
|
`;
|
|
@@ -100,22 +123,34 @@ function hasPackageJson(cwd = node_process.default.cwd()) {
|
|
|
100
123
|
* Initializes a new `package.json` at `cwd` using the detected package manager.
|
|
101
124
|
*/
|
|
102
125
|
async function initPackageJson(cwd, packageManager) {
|
|
103
|
-
await
|
|
126
|
+
await (0, tinyexec.x)(packageManager.name, {
|
|
104
127
|
npm: ["init", "-y"],
|
|
105
128
|
pnpm: ["init"],
|
|
106
129
|
yarn: ["init", "-y"],
|
|
107
130
|
bun: ["init", "-y"]
|
|
108
|
-
}[packageManager.name], {
|
|
131
|
+
}[packageManager.name], {
|
|
132
|
+
nodeOptions: {
|
|
133
|
+
cwd,
|
|
134
|
+
stdio: "inherit"
|
|
135
|
+
},
|
|
136
|
+
throwOnError: true
|
|
137
|
+
});
|
|
109
138
|
}
|
|
110
139
|
/**
|
|
111
140
|
* Installs the given packages at `cwd` using the detected package manager.
|
|
112
141
|
*/
|
|
113
142
|
async function installPackages(packages, packageManager, cwd = node_process.default.cwd()) {
|
|
114
|
-
await
|
|
143
|
+
await (0, tinyexec.x)(packageManager.name, [...packageManager.installCommand, ...packages], {
|
|
144
|
+
nodeOptions: {
|
|
145
|
+
cwd,
|
|
146
|
+
stdio: "inherit"
|
|
147
|
+
},
|
|
148
|
+
throwOnError: true
|
|
149
|
+
});
|
|
115
150
|
}
|
|
116
151
|
//#endregion
|
|
117
152
|
//#region src/runners/init/run.ts
|
|
118
|
-
function cancelAndExit(message = "Operation
|
|
153
|
+
function cancelAndExit(message = "Operation canceled.") {
|
|
119
154
|
_clack_prompts.cancel(message);
|
|
120
155
|
node_process.default.exit(0);
|
|
121
156
|
}
|
|
@@ -153,57 +188,60 @@ async function run({ yes, version, input: inputFlag, output: outputFlag, plugins
|
|
|
153
188
|
});
|
|
154
189
|
if (_clack_prompts.isCancel(shouldInit) || !shouldInit) cancelAndExit();
|
|
155
190
|
}
|
|
156
|
-
const packageManager = detectPackageManager(cwd);
|
|
191
|
+
const packageManager = require_tools.detectPackageManager(cwd);
|
|
157
192
|
const spinner = _clack_prompts.spinner();
|
|
158
193
|
spinner.start(`Initializing package.json with ${packageManager.name}`);
|
|
159
194
|
await initPackageJson(cwd, packageManager);
|
|
160
195
|
spinner.stop(`Created package.json with ${packageManager.name}`);
|
|
161
196
|
}
|
|
162
|
-
const packageManager = detectPackageManager(cwd);
|
|
197
|
+
const packageManager = require_tools.detectPackageManager(cwd);
|
|
163
198
|
if (hasPackageJson(cwd)) _clack_prompts.log.info(`Detected package manager: ${(0, node_util.styleText)("cyan", packageManager.name)}`);
|
|
164
|
-
const inputPath = await resolveOrPrompt(inputFlag,
|
|
199
|
+
const inputPath = await resolveOrPrompt(inputFlag, initDefaults.inputPath, "Using input path", () => _clack_prompts.text({
|
|
165
200
|
message: "Where is your OpenAPI specification located?",
|
|
166
|
-
placeholder:
|
|
167
|
-
defaultValue:
|
|
201
|
+
placeholder: initDefaults.inputPath,
|
|
202
|
+
defaultValue: initDefaults.inputPath,
|
|
168
203
|
validate: (value) => {
|
|
169
204
|
if (!value) return "Input path is required";
|
|
170
205
|
}
|
|
171
206
|
}));
|
|
172
|
-
const outputPath = await resolveOrPrompt(outputFlag,
|
|
207
|
+
const outputPath = await resolveOrPrompt(outputFlag, initDefaults.outputPath, "Using output path", () => _clack_prompts.text({
|
|
173
208
|
message: "Where should the generated files be output?",
|
|
174
|
-
placeholder:
|
|
175
|
-
defaultValue:
|
|
209
|
+
placeholder: initDefaults.outputPath,
|
|
210
|
+
defaultValue: initDefaults.outputPath,
|
|
176
211
|
validate: (value) => {
|
|
177
212
|
if (!value) return "Output path is required";
|
|
178
213
|
}
|
|
179
214
|
}));
|
|
180
|
-
const defaultPlugins =
|
|
215
|
+
const defaultPlugins = availablePlugins.filter((p) => initDefaults.plugins.includes(p.value));
|
|
181
216
|
const pluginLabel = (plugins) => (0, node_util.styleText)("cyan", plugins.map((p) => p.label).join(", "));
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
217
|
+
const selectedPlugins = await (async () => {
|
|
218
|
+
if (pluginsFlag) {
|
|
219
|
+
const requested = pluginsFlag.split(",").map((v) => v.trim()).filter(Boolean);
|
|
220
|
+
const plugins = availablePlugins.filter((p) => requested.includes(p.value));
|
|
221
|
+
if (plugins.length === 0) {
|
|
222
|
+
_clack_prompts.log.warn(`No valid plugins found in --plugins value; falling back to default: ${pluginLabel(defaultPlugins)}`);
|
|
223
|
+
return defaultPlugins;
|
|
224
|
+
}
|
|
225
|
+
_clack_prompts.log.info(`Using plugins: ${pluginLabel(plugins)}`);
|
|
226
|
+
return plugins;
|
|
227
|
+
}
|
|
228
|
+
if (yes) {
|
|
229
|
+
_clack_prompts.log.info(`Using plugins: ${pluginLabel(defaultPlugins)}`);
|
|
230
|
+
return defaultPlugins;
|
|
231
|
+
}
|
|
194
232
|
const values = await _clack_prompts.multiselect({
|
|
195
233
|
message: "Select plugins to use:",
|
|
196
|
-
options:
|
|
234
|
+
options: availablePlugins.map(({ value, label, hint }) => ({
|
|
197
235
|
value,
|
|
198
236
|
label,
|
|
199
237
|
hint
|
|
200
238
|
})),
|
|
201
|
-
initialValues: [...
|
|
239
|
+
initialValues: [...initDefaults.plugins],
|
|
202
240
|
required: true
|
|
203
241
|
});
|
|
204
242
|
if (_clack_prompts.isCancel(values)) cancelAndExit();
|
|
205
|
-
|
|
206
|
-
}
|
|
243
|
+
return availablePlugins.filter((p) => values.includes(p.value));
|
|
244
|
+
})();
|
|
207
245
|
const packagesToInstall = ["kubb", ...selectedPlugins.map((p) => p.packageName)];
|
|
208
246
|
const spinner = _clack_prompts.spinner();
|
|
209
247
|
spinner.start(`Installing ${packagesToInstall.length} packages with ${packageManager.name}`);
|
|
@@ -215,27 +253,27 @@ async function run({ yes, version, input: inputFlag, output: outputFlag, plugins
|
|
|
215
253
|
throw error;
|
|
216
254
|
}
|
|
217
255
|
const configSpinner = _clack_prompts.spinner();
|
|
218
|
-
configSpinner.start(`Creating ${
|
|
256
|
+
configSpinner.start(`Creating ${KUBB_CONFIG_FILENAME}`);
|
|
219
257
|
const configContent = generateConfigFile({
|
|
220
258
|
selectedPlugins,
|
|
221
259
|
inputPath,
|
|
222
260
|
outputPath
|
|
223
261
|
});
|
|
224
|
-
const configPath = node_path.default.join(cwd,
|
|
262
|
+
const configPath = node_path.default.join(cwd, KUBB_CONFIG_FILENAME);
|
|
225
263
|
if (node_fs.default.existsSync(configPath)) {
|
|
226
|
-
configSpinner.stop(`${
|
|
264
|
+
configSpinner.stop(`${KUBB_CONFIG_FILENAME} already exists`);
|
|
227
265
|
if (!yes) {
|
|
228
266
|
const shouldOverwrite = await _clack_prompts.confirm({
|
|
229
|
-
message: `${
|
|
267
|
+
message: `${KUBB_CONFIG_FILENAME} already exists. Overwrite?`,
|
|
230
268
|
initialValue: false
|
|
231
269
|
});
|
|
232
270
|
if (_clack_prompts.isCancel(shouldOverwrite) || !shouldOverwrite) cancelAndExit("Keeping existing configuration. Packages have been installed.");
|
|
233
271
|
}
|
|
234
|
-
configSpinner.start(`Overwriting ${
|
|
272
|
+
configSpinner.start(`Overwriting ${KUBB_CONFIG_FILENAME}`);
|
|
235
273
|
}
|
|
236
274
|
await node_fs.default.promises.writeFile(configPath, configContent, "utf-8");
|
|
237
|
-
configSpinner.stop(`Created ${
|
|
238
|
-
_clack_prompts.outro((0, node_util.styleText)("green", "✓ All set!") + "\n\n" + (0, node_util.styleText)("dim", "Next steps:") + "\n" + (0, node_util.styleText)("cyan", ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) + "\n" + (0, node_util.styleText)("cyan", " 2. Generate code with: npx kubb generate") + "\n" + (0, node_util.styleText)("cyan",
|
|
275
|
+
configSpinner.stop(`Created ${KUBB_CONFIG_FILENAME}`);
|
|
276
|
+
_clack_prompts.outro((0, node_util.styleText)("green", "✓ All set!") + "\n\n" + (0, node_util.styleText)("dim", "Next steps:") + "\n" + (0, node_util.styleText)("cyan", ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) + "\n" + (0, node_util.styleText)("cyan", " 2. Generate code with: npx kubb generate") + "\n" + (0, node_util.styleText)("cyan", ` 3. Find generated files in: ${outputPath}`) + "\n\n" + (0, node_util.styleText)("dim", `Using ${packageManager.name} • Kubb v${version}`));
|
|
239
277
|
} catch (error) {
|
|
240
278
|
_clack_prompts.log.error((0, node_util.styleText)("red", "An error occurred during initialization"));
|
|
241
279
|
if (error instanceof Error) _clack_prompts.log.error(error.message);
|
|
@@ -245,4 +283,4 @@ async function run({ yes, version, input: inputFlag, output: outputFlag, plugins
|
|
|
245
283
|
//#endregion
|
|
246
284
|
exports.run = run;
|
|
247
285
|
|
|
248
|
-
//# sourceMappingURL=run-
|
|
286
|
+
//# sourceMappingURL=run-AYlRjIX5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-AYlRjIX5.cjs","names":["process","fs","path","process","clack","detectPackageManager","path","fs"],"sources":["../../../internals/shared/src/constants.ts","../../../internals/shared/src/init.ts","../src/runners/init/utils.ts","../src/runners/init/run.ts"],"sourcesContent":["import type { PluginOption } from './types.ts'\n\nexport const KUBB_CONFIG_FILENAME = 'kubb.config.ts' as const\n\nexport const initDefaults = {\n inputPath: './openapi.yaml',\n outputPath: './src/gen',\n plugins: ['plugin-ts'],\n} as const\n\nexport const availablePlugins: Array<PluginOption> = [\n {\n value: 'plugin-ts',\n label: 'TypeScript',\n hint: 'Recommended',\n packageName: '@kubb/plugin-ts',\n importName: 'pluginTs',\n category: 'types',\n },\n {\n value: 'plugin-client',\n label: 'Client (Fetch/Axios)',\n packageName: '@kubb/plugin-client',\n importName: 'pluginClient',\n category: 'client',\n },\n {\n value: 'plugin-react-query',\n label: 'React Query / TanStack Query',\n packageName: '@kubb/plugin-react-query',\n importName: 'pluginReactQuery',\n category: 'framework',\n },\n {\n value: 'plugin-vue-query',\n label: 'Vue Query',\n packageName: '@kubb/plugin-vue-query',\n importName: 'pluginVueQuery',\n category: 'framework',\n },\n {\n value: 'plugin-zod',\n label: 'Zod Schemas',\n packageName: '@kubb/plugin-zod',\n importName: 'pluginZod',\n category: 'validation',\n },\n {\n value: 'plugin-faker',\n label: 'Faker.js Mocks',\n packageName: '@kubb/plugin-faker',\n importName: 'pluginFaker',\n category: 'mocks',\n },\n {\n value: 'plugin-msw',\n label: 'MSW Handlers',\n packageName: '@kubb/plugin-msw',\n importName: 'pluginMsw',\n category: 'mocks',\n },\n {\n value: 'plugin-cypress',\n label: 'Cypress Tests',\n packageName: '@kubb/plugin-cypress',\n importName: 'pluginCypress',\n category: 'testing',\n },\n {\n value: 'plugin-mcp',\n label: 'MCP Server (AI / Model Context Protocol)',\n packageName: '@kubb/plugin-mcp',\n importName: 'pluginMcp',\n category: 'ai',\n },\n {\n value: 'plugin-redoc',\n label: 'ReDoc Documentation',\n packageName: '@kubb/plugin-redoc',\n importName: 'pluginRedoc',\n category: 'documentation',\n },\n]\n","import type { PluginOption } from './types.ts'\n\nexport function generateConfigFile({\n selectedPlugins,\n inputPath,\n outputPath,\n}: {\n selectedPlugins: Array<PluginOption>\n inputPath: string\n outputPath: string\n}): string {\n const imports = selectedPlugins.map((plugin) => `import { ${plugin.importName} } from '${plugin.packageName}'`).join('\\n')\n\n const pluginConfigs = selectedPlugins.map((plugin) => ` ${plugin.importName}(),`).join('\\n')\n\n return `import { defineConfig } from 'kubb'\n${imports}\n\nexport default defineConfig({\n root: '.',\n input: {\n path: '${inputPath}',\n },\n output: {\n path: '${outputPath}',\n clean: true,\n },\n plugins: [\n${pluginConfigs}\n ],\n})\n`\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport type { PackageManagerInfo, PackageManagerName } from '@internals/utils'\nimport { x } from 'tinyexec'\n\n/**\n * Returns `true` when a `package.json` exists at `cwd`.\n */\nexport function hasPackageJson(cwd: string = process.cwd()): boolean {\n return fs.existsSync(path.join(cwd, 'package.json'))\n}\n\n/**\n * Initializes a new `package.json` at `cwd` using the detected package manager.\n */\nexport async function initPackageJson(cwd: string, packageManager: PackageManagerInfo): Promise<void> {\n const commands: Record<PackageManagerName, Array<string>> = {\n npm: ['init', '-y'],\n pnpm: ['init'],\n yarn: ['init', '-y'],\n bun: ['init', '-y'],\n }\n\n await x(packageManager.name, commands[packageManager.name], {\n nodeOptions: { cwd, stdio: 'inherit' },\n throwOnError: true,\n })\n}\n\n/**\n * Installs the given packages at `cwd` using the detected package manager.\n */\nexport async function installPackages(packages: Array<string>, packageManager: PackageManagerInfo, cwd: string = process.cwd()): Promise<void> {\n await x(packageManager.name, [...packageManager.installCommand, ...packages], {\n nodeOptions: { cwd, stdio: 'inherit' },\n throwOnError: true,\n })\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport process from 'node:process'\nimport { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport { detectPackageManager } from '@internals/utils'\nimport { availablePlugins, generateConfigFile, initDefaults, KUBB_CONFIG_FILENAME, type PluginOption } from '@internals/shared'\nimport { hasPackageJson, initPackageJson, installPackages } from './utils.ts'\n\nfunction cancelAndExit(message = 'Operation canceled.'): never {\n clack.cancel(message)\n process.exit(0)\n}\n\ntype InitOptions = {\n /**\n * When `true`, skips all interactive prompts and uses default values.\n */\n yes: boolean\n /**\n * Current `@kubb/cli` version string, shown in the closing outro.\n */\n version: string\n /**\n * Input path flag value from `--input`. When provided, skips the input prompt.\n */\n input?: string\n /**\n * Output directory flag value from `--output`. When provided, skips the output prompt.\n */\n output?: string\n /**\n * Comma-separated plugin list from `--plugins`, e.g. `'plugin-ts,plugin-zod'`. When provided, skips the plugin selection prompt.\n */\n plugins?: string\n}\n\n/**\n * Runs the interactive Kubb scaffolding wizard.\n * Detects the package manager, prompts for input/output paths and plugins, installs packages, and writes `kubb.config.ts`.\n * Pass `yes: true` to skip all prompts and use defaults.\n */\nexport async function run({ yes, version, input: inputFlag, output: outputFlag, plugins: pluginsFlag }: InitOptions): Promise<void> {\n const cwd = process.cwd()\n\n clack.intro(styleText('bgCyan', styleText('black', ' Kubb Init ')))\n\n /**\n * Returns `flag` when provided, the `defaultValue` when `yes` is set,\n * or calls `prompt()` for interactive input. Exits on cancellation.\n */\n async function resolveOrPrompt<T>(flag: T | undefined, defaultValue: T, logLabel: string, prompt: () => Promise<T | symbol>): Promise<T> {\n if (flag !== undefined) {\n clack.log.info(`${logLabel}: ${styleText('cyan', String(flag))}`)\n return flag\n }\n if (yes) {\n clack.log.info(`${logLabel}: ${styleText('cyan', String(defaultValue))}`)\n return defaultValue\n }\n const result = await prompt()\n if (clack.isCancel(result)) cancelAndExit()\n return result as T\n }\n\n try {\n // Check/create package.json, detect package manager once after the block\n if (!hasPackageJson(cwd)) {\n if (!yes) {\n const shouldInit = await clack.confirm({\n message: 'No package.json found. Would you like to create one?',\n initialValue: true,\n })\n\n if (clack.isCancel(shouldInit) || !shouldInit) {\n cancelAndExit()\n }\n }\n\n const packageManager = detectPackageManager(cwd)\n const spinner = clack.spinner()\n spinner.start(`Initializing package.json with ${packageManager.name}`)\n await initPackageJson(cwd, packageManager)\n spinner.stop(`Created package.json with ${packageManager.name}`)\n }\n\n const packageManager = detectPackageManager(cwd)\n if (hasPackageJson(cwd)) {\n clack.log.info(`Detected package manager: ${styleText('cyan', packageManager.name)}`)\n }\n\n // Prompt for OpenAPI spec path\n const inputPath = await resolveOrPrompt(inputFlag, initDefaults.inputPath, 'Using input path', () =>\n clack.text({\n message: 'Where is your OpenAPI specification located?',\n placeholder: initDefaults.inputPath,\n defaultValue: initDefaults.inputPath,\n validate: (value) => {\n if (!value) return 'Input path is required'\n },\n }),\n )\n\n // Prompt for output directory\n const outputPath = await resolveOrPrompt(outputFlag, initDefaults.outputPath, 'Using output path', () =>\n clack.text({\n message: 'Where should the generated files be output?',\n placeholder: initDefaults.outputPath,\n defaultValue: initDefaults.outputPath,\n validate: (value) => {\n if (!value) return 'Output path is required'\n },\n }),\n )\n\n // Plugin selection\n const defaultPlugins = availablePlugins.filter((p) => (initDefaults.plugins as ReadonlyArray<string>).includes(p.value))\n const pluginLabel = (plugins: Array<PluginOption>) => styleText('cyan', plugins.map((p) => p.label).join(', '))\n\n const selectedPlugins: Array<PluginOption> = await (async () => {\n if (pluginsFlag) {\n const requested = pluginsFlag\n .split(',')\n .map((v) => v.trim())\n .filter(Boolean)\n const plugins = availablePlugins.filter((p) => requested.includes(p.value))\n if (plugins.length === 0) {\n clack.log.warn(`No valid plugins found in --plugins value; falling back to default: ${pluginLabel(defaultPlugins)}`)\n return defaultPlugins\n }\n clack.log.info(`Using plugins: ${pluginLabel(plugins)}`)\n return plugins\n }\n if (yes) {\n clack.log.info(`Using plugins: ${pluginLabel(defaultPlugins)}`)\n return defaultPlugins\n }\n const values = await clack.multiselect({\n message: 'Select plugins to use:',\n options: availablePlugins.map(({ value, label, hint }) => ({ value, label, hint })),\n initialValues: [...initDefaults.plugins],\n required: true,\n })\n if (clack.isCancel(values)) cancelAndExit()\n return availablePlugins.filter((p) => (values as Array<string>).includes(p.value))\n })()\n\n // Install packages\n const packagesToInstall = ['kubb', ...selectedPlugins.map((p) => p.packageName)]\n\n const spinner = clack.spinner()\n spinner.start(`Installing ${packagesToInstall.length} packages with ${packageManager.name}`)\n\n try {\n await installPackages(packagesToInstall, packageManager, cwd)\n spinner.stop(`Installed ${packagesToInstall.length} packages`)\n } catch (error) {\n spinner.stop('Installation failed')\n throw error\n }\n\n // Generate config file\n const configSpinner = clack.spinner()\n configSpinner.start(`Creating ${KUBB_CONFIG_FILENAME}`)\n\n const configContent = generateConfigFile({ selectedPlugins, inputPath, outputPath })\n const configPath = path.join(cwd, KUBB_CONFIG_FILENAME)\n\n if (fs.existsSync(configPath)) {\n configSpinner.stop(`${KUBB_CONFIG_FILENAME} already exists`)\n\n if (!yes) {\n const shouldOverwrite = await clack.confirm({\n message: `${KUBB_CONFIG_FILENAME} already exists. Overwrite?`,\n initialValue: false,\n })\n\n if (clack.isCancel(shouldOverwrite) || !shouldOverwrite) {\n cancelAndExit('Keeping existing configuration. Packages have been installed.')\n }\n }\n\n configSpinner.start(`Overwriting ${KUBB_CONFIG_FILENAME}`)\n }\n\n await fs.promises.writeFile(configPath, configContent, 'utf-8')\n\n configSpinner.stop(`Created ${KUBB_CONFIG_FILENAME}`)\n\n clack.outro(\n styleText('green', '✓ All set!') +\n '\\n\\n' +\n styleText('dim', 'Next steps:') +\n '\\n' +\n styleText('cyan', ` 1. Make sure your OpenAPI spec is at: ${inputPath}`) +\n '\\n' +\n styleText('cyan', ' 2. Generate code with: npx kubb generate') +\n '\\n' +\n styleText('cyan', ` 3. Find generated files in: ${outputPath}`) +\n '\\n\\n' +\n styleText('dim', `Using ${packageManager.name} • Kubb v${version}`),\n )\n } catch (error) {\n clack.log.error(styleText('red', 'An error occurred during initialization'))\n if (error instanceof Error) {\n clack.log.error(error.message)\n }\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,uBAAuB;AAEpC,MAAa,eAAe;CAC1B,WAAW;CACX,YAAY;CACZ,SAAS,CAAC,WAAW;AACvB;AAEA,MAAa,mBAAwC;CACnD;EACE,OAAO;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;CACA;EACE,OAAO;EACP,OAAO;EACP,aAAa;EACb,YAAY;EACZ,UAAU;CACZ;C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