build.sh 916 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. set -e
  3. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  4. cd $SCRIPT_PATH
  5. # Load and export variables from root .env file into shell environment
  6. set -a
  7. . ../.env
  8. set +a
  9. # Install codegen tools (outside of workspaces to avoid @polkadot/api conflicts)
  10. yarn --cwd codegen install
  11. yarn clean
  12. yarn codegen:noinstall
  13. yarn typegen # if this fails try to run this command outside of yarn workspaces
  14. # Post-codegen - fixes in autogenerated files
  15. yarn ts-node --project ./mappings/tsconfig.json ./mappings/scripts/postCodegen.ts
  16. # We run yarn again to ensure graphql-server dependencies are installed
  17. # and are inline with root workspace resolutions
  18. yarn
  19. # Add missing typeorm binary symlink
  20. ln -s ../../../../../node_modules/typeorm/cli.js ./generated/graphql-server/node_modules/.bin/typeorm
  21. yarn workspace query-node codegen
  22. yarn workspace query-node build
  23. yarn workspace query-node-mappings build