- API 클라이언트·토큰 갱신·순수 함수를 shared/ (@nalssigak/shared) 로 옮김 - 토큰 저장소·API 주소는 configureApi 로 플랫폼에서 넣는다 (웹 localStorage) - 루트 package.json 에 frontend·mobile·shared workspaces, lock 파일 하나로 - 웹 Docker 빌드 대상을 저장소 루트로 (compose context ., 루트 .dockerignore)
23 lines
800 B
TypeScript
23 lines
800 B
TypeScript
import { defineConfig } from '@hey-api/openapi-ts'
|
|
|
|
export default defineConfig({
|
|
input: process.env.OPENAPI_INPUT ?? 'http://localhost:9810/openapi.json',
|
|
output: '../shared/api/client',
|
|
parser: {
|
|
patch: {
|
|
// FastAPI operationId("get_feed_v1_feed_get")에서 "_v1_" 앞만 camelCase로 → getFeed / getFeedOptions / addCommentMutation
|
|
operations: (_method, _path, operation) => {
|
|
const id = operation.operationId ?? ''
|
|
const base = id.split('_v1_')[0] || id
|
|
operation.operationId = base.replace(/_([a-z])/g, (_m, c: string) => c.toUpperCase())
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
{ name: '@hey-api/client-fetch', throwOnError: true },
|
|
{ name: '@hey-api/typescript', enums: 'javascript' },
|
|
'@hey-api/sdk',
|
|
'@tanstack/react-query',
|
|
],
|
|
})
|