Skip to content

Commit 4027fb4

Browse files
committed
update dev workflow
1 parent b55760e commit 4027fb4

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
openapi/out/*
1+
openapi/out/*
2+
.vscode/*

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SHELL = /bin/bash
2-
DEV_IMG := openapitools/openapi-generator-cli:latest
2+
DEV_IMG := node:22-slim
33

44
.PHONY: help
55
help: ## this help
@@ -8,14 +8,15 @@ help: ## this help
88
.PHONY: clean
99
clean: ## Clean
1010
@echo "Clean"
11-
rm -rf openapi/out
11+
rm -rf output/*
1212

13-
.PHONY: build
14-
build-%: ## Build build-<generator> [typescript-node, kotlin, swift6, etc]
13+
.PHONY: build-typescript
14+
build-typescript: ## Build for TypeScript
1515
@echo "Build"
1616
docker run -it --rm \
17-
-v $(PWD)/openapi:/local \
18-
$(DEV_IMG) generate \
19-
-i /local/v1/ccn-coverage-api.yaml \
20-
-g "$*" \
21-
-o "/local/out/$*"
17+
-v $(PWD)/package.json:/root/package.json \
18+
-v $(PWD)/openapi:/root/openapi \
19+
-v $(PWD)/output:/root/output \
20+
-w /root \
21+
$(DEV_IMG) \
22+
bash -c "npm install && npm run generate"

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"dependencies": {
3+
"@hey-api/client-fetch": "^0.8.3"
4+
},
5+
"devDependencies": {
6+
"@hey-api/openapi-ts": "^0.64.10"
7+
},
8+
"scripts": {
9+
"generate": "openapi-ts -i ./openapi/v1/ccn-coverage-api.yaml -o ./output/ts -c @hey-api/client-fetch"
10+
}
11+
}

0 commit comments

Comments
 (0)