Contributing
There are two places to contribute:
- Kubb core: the runtime, AST, adapter, parsers, and built-in plugins in
kubb-labs/kubb. - Kubb plugins: community and official plugins in the registry at
kubb-labs/plugins.
First, check the open issues and pull requests so you don't duplicate work. Say hello on Discord.
Prerequisites
- Node.js 22 or later.
- pnpm 11 or later.
- Git and, optionally, the GitHub CLI.
Kubb core
The monorepo at kubb-labs/kubb holds everything in the kubb and @kubb/* packages.
1. Fork and clone
gh repo fork kubb-labs/kubb --clone
cd kubb2. Install dependencies
pnpm install3. Create a branch
git checkout -b feat/your-feature-name4. Iterate
Run a single package in watch mode:
pnpm -F @kubb/core devRun the test suite:
pnpm run testWhat lives where
| Path | What lives there |
|---|---|
packages/core/ | Plugin runtime, build loop, definePlugin/createKubb API. |
packages/ast/ | Universal AST and visitor utilities. |
packages/adapter-oas/ | OpenAPI adapter that parses an OAS 2.0/3.x spec into the AST. |
packages/parser-ts/ | Parser that turns the AST into TypeScript and TSX source. |
packages/parser-md/ | Parser that turns the AST into Markdown source. |
packages/plugin-barrel/ | Barrel file plugin (enforce: 'post'). |
packages/renderer-jsx/ | JSX renderer used by plugins that emit components. |
packages/cli/ | The kubb CLI entry point. |
packages/mcp/ | MCP server runtime. |
packages/unplugin-kubb/ | Bundler integrations (Vite, webpack, Rollup, Rspack, esbuild, Nuxt, Astro). |
packages/kubb/ | The meta package that re-exports defineConfig with sensible defaults. |
Quality gates
Run these locally before pushing. CI runs the same commands.
pnpm run typecheck
pnpm run lint
pnpm run testKubb plugins
Contribute a plugin in two ways. Build a community plugin in your own repository, or propose an official one in the core monorepo.
Build a community plugin
- Follow the Creating Your First Plugin guide.
- Use
@kubb/plugin-axiosas the layout to copy. - Publish to npm under the
kubb-plugin-*or@scope/plugin-*naming convention. - Submit it to the community registry. Add a YAML entry under
plugins/.
Propose an official plugin
Official plugins ship under @kubb/plugin-*. First, open an issue on the kubb-labs/plugins repo to discuss scope and naming. Once approved, scaffold the package under packages/plugin-<name>/. Follow the structure of an existing plugin.
Testing
Kubb uses Vitest. Place each test file next to the source file it tests.
import { describe, expect, it } from 'vitest'
import { resolverExample } from './resolverExample.ts'
describe('resolverExample', () => {
it('returns a default resolver name', () => {
const resolver = resolverExample({})
expect(resolver.name).toBe('default')
})
})Run tests for a single package:
pnpm -F @kubb/core testCommits and changesets
Follow Conventional Commits: feat:, fix:, docs:, chore:.
Add a changeset for any change that ships in a published package:
pnpm run changesetSkip the changeset only when the change does not affect published code, such as CI, internal tests, or docs.
Opening a pull request
- Push your branch to your fork.
- Open a pull request against
main. - Fill in the PR template and link the related issue.
- Make sure CI is green and re-request review after each round of changes.