-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
58 lines (47 loc) · 1.31 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
PACKAGE_NAME := unstructured-js-client
CURRENT_DIR := $(shell pwd)
ARCH := $(shell uname -m)
DOCKER_IMAGE ?= quay.io/unstructured-io/unstructured-api:latest
OPENAPI_DOCS_URL ?= https://api.unstructured.io/general/openapi.json
###########
# Install #
###########
## install: installs all modules
.PHONY: install
install:
npm install
###########
# Build #
###########
## build: build client
.PHONY: build
build:
npm run build
## check: lint the client
.PHONY: check
check:
npx eslint src/
#############
# Test #
#############
## test-unit: run unit tests
.PHONY: test-unit
test-unit:
npx vitest --dir test/unit --run --reporter verbose --config vitest.config.mjs
## test-integration: run integration tests
.PHONY: test-integration
test-integration:
npx vitest --dir test/integration --run --reporter verbose --config vitest.config.mjs
## test: run all tests
.PHONY: test
test: test-unit test-integration
#############
# Speakeasy #
#############
## client-generate: generate speakeasy client locally
.PHONY: client-generate
client-generate:
wget -nv -q -O openapi.json ${OPENAPI_DOCS_URL}
speakeasy overlay validate -o ./overlay_client.yaml
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
speakeasy generate sdk -s ./openapi_client.json -o ./ -l typescript