@kubb/mcp 5.0.0-beta.99 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -155,18 +155,17 @@ Example `kubb.config.ts`:
155
155
 
156
156
  ```typescript
157
157
  import { defineConfig } from 'kubb'
158
- import { pluginOas } from '@kubb/plugin-oas'
158
+ import { adapterOas } from '@kubb/adapter-oas'
159
159
  import { pluginTs } from '@kubb/plugin-ts'
160
160
  import { pluginAxios } from '@kubb/plugin-axios'
161
161
 
162
162
  export default defineConfig({
163
- input: {
164
- path: './petstore.yaml',
165
- },
163
+ input: './petstore.yaml',
166
164
  output: {
167
165
  path: './src/generated',
168
166
  },
169
- plugins: [pluginOas(), pluginTs(), pluginAxios()],
167
+ adapter: adapterOas(),
168
+ plugins: [pluginTs(), pluginAxios()],
170
169
  })
171
170
  ```
172
171
 
package/dist/index.cjs CHANGED
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
21
21
  value: mod,
22
22
  enumerable: true
23
23
  }) : target, mod));
@@ -38,7 +38,7 @@ let node_module = require("node:module");
38
38
  let node_process = require("node:process");
39
39
  node_process = __toESM(node_process, 1);
40
40
  //#region package.json
41
- var version = "5.0.0-beta.99";
41
+ var version = "5.0.0";
42
42
  //#endregion
43
43
  //#region src/schemas/generateSchema.ts
44
44
  const generateSchema = valibot.object({
@@ -6202,6 +6202,13 @@ const generateTool = (0, tmcp_tool.defineTool)({
6202
6202
  hooks.hook("kubb:generation:start", async () => {
6203
6203
  await notify("GENERATION_START", "Generation started");
6204
6204
  });
6205
+ hooks.hook("kubb:setup:start", async () => {
6206
+ await notify("SETUP_START", "Setting up Kubb");
6207
+ });
6208
+ hooks.hook("kubb:setup:end", async () => {
6209
+ await notify("SETUP_END", "Kubb setup complete");
6210
+ await notify("BUILD_START", "Starting build");
6211
+ });
6205
6212
  hooks.hook("kubb:generation:end", async () => {
6206
6213
  await notify("GENERATION_END", "Generation ended");
6207
6214
  });
@@ -6230,22 +6237,17 @@ const generateTool = (0, tmcp_tool.defineTool)({
6230
6237
  } : userConfig.output
6231
6238
  };
6232
6239
  await notify("CONFIG_READY", "Configuration ready");
6233
- await notify("SETUP_START", "Setting up Kubb");
6234
- const kubb = (0, _kubb_core.createKubb)(config, { hooks });
6235
- await kubb.setup();
6236
- await notify("SETUP_END", "Kubb setup complete");
6237
- await notify("BUILD_START", "Starting build");
6238
- const { files, diagnostics } = await kubb.safeBuild();
6239
- await notify("BUILD_END", `Build complete - Generated ${files.length} files`);
6240
- const problems = diagnostics.filter(_kubb_core.Diagnostics.isProblem);
6240
+ const result = await (0, _kubb_core.createKubb)(config, { hooks }).generate();
6241
+ await notify("BUILD_END", `Build complete - Generated ${result.files.length} files`);
6242
+ const problems = result.diagnostics.filter(_kubb_core.Diagnostics.isProblem);
6241
6243
  const errors = problems.filter((diagnostic) => diagnostic.severity === "error");
6242
6244
  if (errors.length > 0) {
6243
6245
  await notify("BUILD_FAILED", `Build failed with ${errors.length} diagnostic(s)`);
6244
6246
  const serialized = problems.map((diagnostic) => _kubb_core.Diagnostics.serialize(diagnostic));
6245
6247
  return tmcp_utils.tool.error(`Build failed:\n${formatDiagnostics(serialized)}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);
6246
6248
  }
6247
- await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${files.length} files`);
6248
- return tmcp_utils.tool.text(`Build completed successfully!\n\nGenerated ${files.length} files\n\n${messages.join("\n")}`);
6249
+ await notify("BUILD_SUCCESS", `Build completed successfully - Generated ${result.files.length} files`);
6250
+ return tmcp_utils.tool.text(`Build completed successfully!\n\nGenerated ${result.files.length} files\n\n${messages.join("\n")}`);
6249
6251
  } catch (caughtError) {
6250
6252
  const serialized = _kubb_core.Diagnostics.serialize(_kubb_core.Diagnostics.from(caughtError));
6251
6253
  return tmcp_utils.tool.error(`Build error:\n${formatDiagnostics([serialized])}\n\n\`\`\`json\n${JSON.stringify(serialized, null, 2)}\n\`\`\``);