-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
69 lines (52 loc) · 1.89 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
59
60
61
62
63
64
65
66
67
68
69
# README.md is generated so edit template instead
.PHONY: docs test
SPEC_URL=/tmp/swagger.json
node_modules:
npm install
bin/openapi-generator-cli.jar:
mkdir -p bin
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar -O bin/openapi-generator-cli.jar
test: node_modules
API_KEY=$(API_KEY) npm run integration
spec:
aws s3 cp s3://api-spec.mailslurp.com/swagger.json $(SPEC_URL)
generate: spec bin/openapi-generator-cli.jar
sudo rm -rf src/generated
mkdir -p src/generated
java -jar ./bin/openapi-generator-cli.jar generate \
--input-spec $(SPEC_URL) \
--generator-name typescript-fetch \
--skip-validate-spec \
--output src/generated -p 'enumPropertyNaming=original,typescriptThreePlus=true,useSingleRequestParameter=true'
generate-local:
SPEC_URL="~/projects/ms2/ms2-api/build/swagger/swagger.json" $(MAKE) generate
fmt: node_modules
npm run fmt
build: node_modules
npm run build
docs: node_modules
npm run build
rm -rf docs
rm -rf docs-markdown
npm run docs
npm run docs:html
cp CNAME docs/CNAME
docs-lint: node_modules
# fix bad links in docs
# cd docs && find . -type f -name "*.md" -print0 | xargs -0 sed -i'' -e 's/#### Index signature//g' && cd -
# cd docs && find . -type f -name "*.md" -print0 | xargs -0 sed -i'' -e 's/\[key: `string`\]:/key/g' && cd -
#npm run docs:lint
docs-test:
# NODE_BIN=$(PWD)/node_modules/.bin OUTPUT_DIR=$(PWD)/docs $(PWD)/scripts/lint.sh
readme: node_modules
DEBUG=script* npm run readme
tag:
git tag v$$(node -e 'console.log(require("./package.json").version)') -a
git push origin --tags
# manually bump package version first
deploy: generate fmt build docs docs-lint docs-test readme test
npm publish
$(MAKE) tag
download-hyperlink:
curl --output scripts/hyperlink -L https://github.com/untitaker/hyperlink/releases/download/0.1.17/hyperlink-linux-x86_64
chmod +x scripts/hyperlink