Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 0 additions & 440 deletions app/schema/index.d.ts

This file was deleted.

999 changes: 976 additions & 23 deletions bun.lock

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions kubb.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from '@kubb/core'
import { pluginOas } from '@kubb/plugin-oas'
import { pluginTs } from '@kubb/plugin-ts'
import { pluginZod } from '@kubb/plugin-zod'

export default defineConfig({
root: '.',
input: {
path: 'https://raw.githubusercontent.com/CtrlAltElite-Devs/faculytics-contracts/main/develop/openapi.yaml',
},
output: {
path: './types/kubb/gen',
clean: true,
},
plugins: [
pluginOas(),
pluginTs({
output: {
path: 'models',
},
}),
pluginZod({
output: {
path: 'zod',
},
}),
],
})
2 changes: 1 addition & 1 deletion lib/api-client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createFetchClient from "openapi-fetch";
import createClient from "openapi-react-query";
import type { paths } from "@/app/schema/index";
import type { paths } from "../schema/index.d.ts";

export const fetchClient = createFetchClient<paths>({
baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL,
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"generate:api": "openapi-typescript https://raw.githubusercontent.com/CtrlAltElite-Devs/faculytics-contracts/refs/heads/main/develop/openapi.json -o ./app/schema/index.d.ts"
"generate:api": "openapi-typescript https://raw.githubusercontent.com/CtrlAltElite-Devs/faculytics-contracts/refs/heads/main/develop/openapi.json -o ./schema/index.d.ts"
},
"dependencies": {
"@tanstack/react-query": "^5.90.21",
Expand All @@ -23,13 +23,20 @@
"tailwind-merge": "^3.4.1"
},
"devDependencies": {
"@kubb/agent": "^4.27.1",
"@kubb/cli": "^4.27.1",
"@kubb/core": "^4.27.1",
"@kubb/plugin-oas": "^4.27.1",
"@kubb/plugin-ts": "^4.27.1",
"@kubb/plugin-zod": "^4.27.1",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "16.1.6",
"openapi-typescript": "^7.13.0",
"prettier": "^3.8.1",
"shadcn": "^3.8.5",
"tailwindcss": "^4",
"tw-animate-css": "^1.4.0",
Expand Down
Loading