forked from authgear/authgear-sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (57 loc) · 1.93 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
REF := $(shell git describe --all --exact-match | sed -e "s|^heads/||")
GIT_HASH ?= git-$(shell git rev-parse --short=12 HEAD)
IMAGE ?= quay.io/theauthgear/authgear-demo-webapp:$(GIT_HASH)
# The documentation build pipeline works in the following way.
#
# 1. Generate individual .d.ts with tsc.
# 2. Generate rollup .d.ts with api-extractor.
# 3. Generate markdown files with typedoc and typedoc-plugin-markdown
# 4. Rewrite document ID.
# 5. Generate sidebars.js
.PHONY: docs
docs:
rm -rf ./temp/
mkdir -p ./temp/docs
npm run dts
npx typedoc \
--options typedoc/typedoc.json \
--tsconfig typedoc/tsconfig.web.json \
--name @authgear/web \
--entryPoints packages/authgear-web/index.d.ts \
--out ./temp/docs/web \
--namedAnchors \
--entryDocument index.md
npx typedoc \
--options typedoc/typedoc.json \
--tsconfig typedoc/tsconfig.react-native.json \
--name @authgear/react-native \
--entryPoints packages/authgear-react-native/index.d.ts \
--out ./temp/docs/react-native \
--namedAnchors \
--entryDocument index.md
npx typedoc \
--options typedoc/typedoc.json \
--tsconfig typedoc/tsconfig.capacitor.json \
--name @authgear/capacitor \
--entryPoints packages/authgear-capacitor/index.d.ts \
--out ./temp/docs/capacitor \
--namedAnchors \
--entryDocument index.md
cp ./typedoc/index.md ./temp/docs/index.md
cp ./typedoc/web_index.md ./temp/docs/web/index.md
cp ./typedoc/react_native_index.md ./temp/docs/react-native/index.md
cp ./typedoc/capacitor_index.md ./temp/docs/capacitor/index.md
node ./scripts/generate_sidebars_js.js ./temp/docs >./temp/sidebars.js
rm -rf ./website/docs
cp -R ./temp/docs/. ./website/docs
cp ./temp/sidebars.js ./website
(cd website && yarn build)
.PHONY: deploy-docs
deploy-docs: docs
./scripts/deploy_docs.sh
.PHONY: build-image
build-image:
docker build --platform linux/x86-64 --tag $(IMAGE) --file ./example/reactweb/Dockerfile .
.PHONY: push-image
push-image:
docker push $(IMAGE)