Skip to content

Commit

Permalink
unplugin-kubb package (#790)
Browse files Browse the repository at this point in the history
* feat: unplugin package

* chore: format

* chore: fix ts

* chore: prepare unplugin setup

* chore: rename Kubb types

* chore: cleanup

* chore: cleanup

* chore: update lock file
  • Loading branch information
stijnvanhulle authored Jan 21, 2024
1 parent e682c44 commit e8a2a32
Show file tree
Hide file tree
Showing 110 changed files with 1,827 additions and 373 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-rocks-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"unplugin-kubb": minor
---

creation of unplugin package for Kubb
1 change: 0 additions & 1 deletion docs/plugins/swagger-zod/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export default defineConfig({
})
```


:::

### transformers
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "e2e",
"version": "0.0.1",
"private": true,
"description": "",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"clean": "npx rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "client-pet-store",
"version": "0.0.1",
"private": true,
"description": "Client PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"scripts": {
"build": "tsup",
"clean": "npx rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/faker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "faker-pet-store",
"version": "0.0.1",
"private": true,
"description": "Faker PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/msw-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "msw-v2-pet-store",
"version": "0.0.1",
"private": true,
"description": "MSW PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/msw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "msw-pet-store",
"version": "0.0.1",
"private": true,
"description": "MSW PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
6 changes: 6 additions & 0 deletions examples/react-query-v5/kubb-log.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
swagger-tanstack-query Executing writeFile
Parameters swagger-tanstack-query writeFile
[
"export * from \"./models/index\";\nexport * from \"./hooks/index\";\n\n",
"/Users/stijnvanhulle/GitHub/kubb/examples/react-query-v5/src/gen/index.ts"
]
7 changes: 5 additions & 2 deletions examples/react-query-v5/kubb.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import createSwagger from '@kubb/swagger'
import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query'
import createSwaggerTS from '@kubb/swagger-ts'

export default defineConfig({
/** @type {import('@kubb/core').UserConfig} */
export const config = {
root: '.',
input: {
path: './petStore.yaml',
Expand Down Expand Up @@ -50,4 +51,6 @@ export default defineConfig({
}],
}),
],
})
}

export default defineConfig(config)
6 changes: 4 additions & 2 deletions examples/react-query-v5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "react-query-v5-pet-store",
"version": "0.0.1",
"private": true,
"description": "ReactQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,10 +11,10 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup && vite build",
"build": "tsup && build:vite",
"build:vite": "vite build",
"clean": "npx rimraf ./dist",
"dev": "vite",
"generate": "kubb generate",
Expand All @@ -39,6 +40,7 @@
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"unplugin-kubb": "workspace:*",
"msw": "^1.3.2",
"typescript": "~5.2.2",
"vite": "^4.5.1"
Expand Down
6 changes: 5 additions & 1 deletion examples/react-query-v5/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"allowImportingTsExtensions": true,
"noEmit": true,
"strict": true,
"noUncheckedIndexedAccess": true
"noUncheckedIndexedAccess": true,
"paths": {
"unplugin-kubb": ["../../packages/unplugin/src/index.ts"],
"unplugin-kubb/vite": ["../../packages/unplugin/src/vite.ts"]
}
},
"include": [
"./src/**/*"
Expand Down
9 changes: 8 additions & 1 deletion examples/react-query-v5/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import react from '@vitejs/plugin-react'
import kubb from 'unplugin-kubb/vite'
import { defineConfig } from 'vite'
import { config } from './kubb.config.js'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [
react(),
kubb({
config,
}),
],
})
2 changes: 1 addition & 1 deletion examples/react-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "react-query-pet-store",
"version": "0.0.1",
"private": true,
"description": "ReactQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup && vite build",
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-single/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "simple-single-pet-store",
"version": "0.0.1",
"private": true,
"description": "Simple single PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "solid-query-pet-store",
"version": "0.0.1",
"private": true,
"description": "SolidQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "svelte-query-pet-store",
"version": "0.0.1",
"private": true,
"description": "SvelteQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/swr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "swr-pet-store",
"version": "0.0.1",
"private": true,
"description": "SWR PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "typescript-pet-store",
"version": "0.0.1",
"private": true,
"description": "TypeScript PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"scripts": {
"build": "tsup",
"clean": "npx rimraf ./dist",
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query-v5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vue-query-v5-pet-store",
"version": "0.0.1",
"private": true,
"description": "VueQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup && vite build",
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-query/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vue-query-pet-store",
"version": "0.0.1",
"private": true,
"description": "VueQuery PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup && vite build",
Expand Down
2 changes: 1 addition & 1 deletion examples/zod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "zod-pet-store",
"version": "0.0.1",
"private": true,
"description": "Zod PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion examples/zodios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "zodios-pet-store",
"version": "0.0.1",
"private": true,
"description": "zodios PetStore example",
"repository": {
"type": "git",
Expand All @@ -10,7 +11,6 @@
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"private": true,
"type": "module",
"scripts": {
"build": "tsup",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
]
},
"scripts": {
"//changeset:beta:enter": "changeset pre enter beta",
"//changeset:beta:exit": "changeset pre exit",
"build": "turbo run build --filter=./packages/*",
"build:examples": "turbo run build --filter=./examples/*",
"changeset": "changeset",
"clean": "turbo run clean",
"format": "bun run format:dprint",
"format:dprint": "dprint fmt",
Expand All @@ -39,9 +42,7 @@
"lint:ci": "ESLINT_USE_FLAT_CONFIG=true eslint --max-warnings 10 --format pretty ./packages/*",
"lint:fix": "ESLINT_USE_FLAT_CONFIG=true eslint --fix --format pretty ./packages/* && bun run lint:case",
"lint:turbo": "turbo run lint",
"version": "changeset version",
"release": "changeset publish",
"version:canary": "changeset version --snapshot canary",
"release:canary": "changeset publish --no-git-tag",
"start": "turbo run start --filter=./packages/*",
"test": "vitest run --config ./configs/vitest.config.ts --coverage",
Expand All @@ -51,9 +52,8 @@
"typecheck": "turbo run typecheck --continue --filter='./packages/*'",
"typecheck:examples": "turbo run typecheck --continue --filter='./examples/*'",
"upgrade": "npx taze -r -w --exclude pnpm",
"changeset": "changeset",
"//changeset:beta:enter": "changeset pre enter beta",
"//changeset:beta:exit": "changeset pre exit"
"version": "changeset version",
"version:canary": "changeset version --snapshot canary"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
Expand All @@ -74,12 +74,12 @@
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.2.1"
},
"namespace": "@kubb",
"packageManager": "[email protected]",
"engines": {
"node": ">=18",
"pnpm": ">=8.3.0"
},
"namespace": "@kubb",
"pnpm": {
"patchedDependencies": {
"@changesets/[email protected]": "patches/@[email protected]"
Expand Down
Loading

1 comment on commit e8a2a32

@vercel
Copy link

@vercel vercel bot commented on e8a2a32 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kubb – ./

kubb-kubb.vercel.app
kubb-git-main-kubb.vercel.app
www.kubb.dev
kubb.dev

Please sign in to comment.