-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (26 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BUILD_DIR=./build/
LOCAL_SPEC_FILE=${BUILD_DIR}public-api.yaml
install:
npm install
install-ci:
npm ci
lint:
npm run lint
test:
./node_modules/.bin/mocha --import=tsx --extensions ts src 'test/**/*.ts'
check: lint test
speakeasy-install: # dev task, locally install the speakeasy CLI
brew install speakeasy-api/homebrew-tap/speakeasy
speakeasy auth login
download-public-spec: # dev task, download the current public spec, in preparation for modifying and running speakeasy-generate
mkdir -p ${BUILD_DIR}
curl https://docs.goshippo.com/spec/shippoapi/public-api.yaml > ${LOCAL_SPEC_FILE}
speakeasy-generate: # dev task, run the generator on a local spec. useful for testing out changes to the spec or gen.yaml - but DO NOT commit the results of manual generation
if [ ! -f "${LOCAL_SPEC_FILE}" ]; then \
echo "Error: The file '${LOCAL_SPEC_FILE}' does not exist, have you run 'make download-public-spec'?"; \
exit 1; \
fi
SPEAKEASY_FORCE_GENERATION=true speakeasy generate sdk -s ${LOCAL_SPEC_FILE} -o . -l typescript
speakeasy-run: # dev task, locally run the complete speakeasy workflow. useful if the generator workflow ever fails, to replicate locally
speakeasy run
.PHONY: test