Skip to content

Commit 3eba370

Browse files
committed
Implement base
1 parent 9ca63fd commit 3eba370

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2253
-6
lines changed

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
bun run lint
3+
bun test --coverage

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Devup API
1+
# devup API
22

33
**A fully typed API client generator powered by OpenAPI.
44
Fetch-compatible, auto-generated types, zero generics required.**
55

6-
Devup API reads your `openapi.json` file and automatically generates a fully typed client that behaves like an ergonomic, type-safe version of `fetch()`.
6+
devup API reads your `openapi.json` file and automatically generates a fully typed client that behaves like an ergonomic, type-safe version of `fetch()`.
77
No manual type declarations. No generics. No SDK boilerplate.
88
Just write API calls — the types are already there.
99

@@ -17,7 +17,7 @@ Just write API calls — the types are already there.
1717
- No need to write or maintain separate TypeScript definitions.
1818

1919
### **🪝 Fetch-compatible design**
20-
Devup API feels like using `fetch`, but with superpowers:
20+
devup API feels like using `fetch`, but with superpowers:
2121

2222
- Path params automatically replaced
2323
- Query/body/header types enforced
@@ -112,7 +112,7 @@ await api.get("/posts/{id}", {
112112

113113
---
114114

115-
## 🎯 Why Devup API?
115+
## 🎯 Why devup API?
116116

117117
- No code generators
118118
- No build steps

biome.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": ["**", "!**/dist"]
10+
},
11+
"javascript": {
12+
"formatter": {
13+
"semicolons": "asNeeded",
14+
"quoteStyle": "single",
15+
"indentStyle": "space",
16+
"indentWidth": 2
17+
}
18+
},
19+
"json": {
20+
"formatter": {
21+
"indentStyle": "space",
22+
"indentWidth": 2
23+
}
24+
}
25+
}

bun.lock

Lines changed: 521 additions & 0 deletions
Large diffs are not rendered by default.

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
console.log("Hello via Bun!");
1+
console.log('Hello via Bun!')

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
"type": "module",
55
"private": true,
66
"devDependencies": {
7-
"@types/bun": "latest"
7+
"@types/bun": "latest",
8+
"@biomejs/biome": "^2.3",
9+
"husky": "^9"
10+
},
11+
"author": "JeongMin Oh",
12+
"license": "Apache-2.0",
13+
"scripts": {
14+
"lint": "biome check",
15+
"lint:fix": "biome check --write",
16+
"prepare": "husky",
17+
"build": "bun run --workspaces build"
818
},
919
"workspaces": [
1020
"packages/*"

packages/core/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# @devup-api/core
2+
3+
Core package for devup API
4+
5+
## Installation
6+
7+
```bash
8+
npm install @devup-api/core
9+
```
10+
11+
## Usage
12+
13+
```typescript
14+
import { devupApiCore } from '@devup-api/core';
15+
16+
const core = new devupApiCore({
17+
// options
18+
});
19+
```
20+

packages/core/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@devup-api/core",
3+
"version": "0.1.0",
4+
"type": "module",
5+
"exports": {
6+
".": {
7+
"import": "./dist/index.js",
8+
"require": "./dist/index.cjs",
9+
"types": "./dist/index.d.ts"
10+
}
11+
},
12+
"scripts": {
13+
"build": "tsc && bun build --target node --outfile=dist/index.js src/index.ts --production && bun build --target node --outfile=dist/index.cjs --format=cjs src/index.ts --production"
14+
},
15+
"devDependencies": {
16+
"@types/node": "^24.10",
17+
"typescript": "^5.9"
18+
}
19+
}

packages/core/src/additional.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type Additional<
2+
T extends string,
3+
Target extends object,
4+
> = T extends keyof Target ? Target[T] : object

packages/core/src/api-struct.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { Conditional } from './utils'
2+
3+
// biome-ignore lint/suspicious/noEmptyInterface: empty interface
4+
export interface DevupGetApiStruct {}
5+
6+
// biome-ignore lint/suspicious/noEmptyInterface: empty interface
7+
export interface DevupPostApiStruct {}
8+
9+
// biome-ignore lint/suspicious/noEmptyInterface: empty interface
10+
export interface DevupPutApiStruct {}
11+
12+
// biome-ignore lint/suspicious/noEmptyInterface: empty interface
13+
export interface DevupDeleteApiStruct {}
14+
15+
// biome-ignore lint/suspicious/noEmptyInterface: empty interface
16+
export interface DevupPatchApiStruct {}
17+
18+
export type DevupApiStruct = DevupGetApiStruct &
19+
DevupPostApiStruct &
20+
DevupPutApiStruct &
21+
DevupDeleteApiStruct &
22+
DevupPatchApiStruct
23+
24+
export type DevupGetApiStructKey = Conditional<DevupGetApiStruct>
25+
export type DevupPostApiStructKey = Conditional<DevupPostApiStruct>
26+
export type DevupPutApiStructKey = Conditional<DevupPutApiStruct>
27+
export type DevupDeleteApiStructKey = Conditional<DevupDeleteApiStruct>
28+
export type DevupPatchApiStructKey = Conditional<DevupPatchApiStruct>
29+
30+
export type DevupApiStructKey = Conditional<DevupApiStruct>

0 commit comments

Comments
 (0)