feat: initial project structure and generate API types

Initialized `package.json`, add tsup build config (CJS/ESM/DTS), wire up
full Makefile targets (lint/test/check/build), add missing BadRequest
response component to OpenAPI spec, generate TypeScript types from spec,
configure biome to exclude generated files, and add `@types/ws`
This commit is contained in:
Tasnim Kabir Sadik
2026-05-09 14:51:48 +06:00
parent 81b525f23f
commit db7fccbaed
11 changed files with 9981 additions and 1 deletions

29
Makefile Normal file
View File

@ -0,0 +1,29 @@
# Makefile
.PHONY: generate lint test test-integration check build
SPEC_URL = "https://raw.githubusercontent.com/wrennhq/wrenn/refs/heads/main/internal/api/openapi.yaml"
SPEC_PATH = "api/openapi.yaml"
generate:
@echo "Fetching latest OpenAPI spec from Git repo..."
mkdir -p api
curl -fsSL $(SPEC_URL) -o $(SPEC_PATH)
@echo "Generating TypeScript types..."
mkdir -p src/models
pnpm generate
lint:
pnpm exec biome check .
test:
pnpm vitest run --exclude tests/integration
test-integration:
pnpm test:integration
check:
$(MAKE) lint
$(MAKE) test
build:
pnpm build