forked from thirdweb-dev/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·68 lines (67 loc) · 1.57 KB
/
update.sh
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
typedoc() {
pnpm typedoc
rm ./typedoc/index.html
mv ./typedoc/modules.html ./typedoc/index.html
cd ./typedoc
# add 'package/' to all href and src to make them relative. Avoid href="http://..." and src="http://..."
find . -type f -name "index.html" -exec sed -i '' -e "s/href=\"\([a-gi-zA-GI-Z][a-zA-Z]\)/href=\"$1\/\1/g" -e "s/src=\"\([a-gi-zA-GI-Z][a-zA-Z]\)/src=\"$1\/\1/g" -e "s/data-base=\"\.\{1,2\}\"/data-base=\"$1\"/g" {} \;
# replace href="modules.html" with href="index.html"
find . -type f -name "*.html" -exec sed -i '' -e "s/modules.html/index.html/g" {} \;
cd ..
rm -rf "../../../../static/reference/$1/"
mkdir "../../../../static/reference/$1/"
mv ./typedoc/* "../../../../static/reference/$1/"
}
git submodule init
git submodule update --remote
git submodule foreach git checkout main
git submodule foreach git pull origin main
yarn
# go into js package and build
cd ./submodules/js
pnpm install
pnpm build
# SDK
cd ./packages/sdk
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
pnpm generate-docs
typedoc sdk
# React
cd ../react
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
pnpm generate-docs
typedoc react
# React-Native
cd ../react-native
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
typedoc react-native
# React Core
cd ../react-core
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
pnpm generate-docs
# Storage
cd ../storage
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
pnpm generate-docs
typedoc storage
# Wallets
cd ../wallets
if [ ! -d "./etc" ]; then
mkdir ./etc
fi
typedoc wallets
cd ../../../..
yarn make-docs
yarn generate-snippets
yarn generate-github-examples
yarn prettier