-
Notifications
You must be signed in to change notification settings - Fork 115
/
build.sh
executable file
·40 lines (26 loc) · 1.07 KB
/
build.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
#!/usr/bin/env bash
set -e
SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
cd $SCRIPT_PATH
# Load and export variables from root .env file into shell environment
set -a
. ../.env
set +a
# Install codegen tools (outside of workspaces to avoid @polkadot/api conflicts)
yarn --cwd codegen install
yarn clean
yarn codegen:noinstall
cp mappings/src/queryTemplates.ts generated/graphql-server/src/
yarn typegen # if this fails try to run this command outside of yarn workspaces
################################################
# temporary patches TODO: create proper solution
sed -i -e "s#new TypeRegistry();#new TypeRegistry() as any;#" ./mappings/generated/types/index.ts
################################################
# We run yarn again to ensure graphql-server dependencies are installed
# and are inline with root workspace resolutions
yarn
# Add missing typeorm binary symlink
ln -s ../../../../../node_modules/typeorm/cli.js ./generated/graphql-server/node_modules/.bin/typeorm
yarn workspace query-node codegen
yarn workspace query-node build
yarn workspace query-node-mappings build