Skip to content

Commit

Permalink
Use script pre hooks to install and migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
rupurt committed Aug 19, 2019
1 parent c8a7045 commit 4ede71c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions explorer/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"scripts": {
"start": "cross-env PORT=3001 craco start",
"build:clean": "rm -rf build",
"prebuild": "yarn install",
"build": "craco build",
"lint": "eslint . --color",
"test": "react-scripts test",
"test-ci": "CI=true react-scripts test",
"test-ci:silent": "yarn test-ci --silent",
"autoinstall": "md5sum -c .yarn.lock.md5 || yarn install && md5sum yarn.lock > .yarn.lock.md5"
"test-ci:silent": "yarn test-ci --silent"
},
"main": "app.js",
"proxy": "http://localhost:8080",
Expand Down
21 changes: 15 additions & 6 deletions explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,31 @@
"license": "MIT",
"keywords": [],
"scripts": {
"dev": "yarn automigrate && concurrently \"cd client && yarn start\" \"ts-node-dev --respawn --transpileOnly ./src/index.ts\"",
"dev:client": "cd client && yarn start",
"predev": "yarn autosetup",
"dev": "concurrently \"cd client && yarn start\" \"ts-node-dev --respawn --transpileOnly ./src/index.ts\"",
"dev:client": "yarn workspace @chainlink/explorer-client run start",
"dev:server": "ts-node-dev --respawn --transpileOnly ./src/index.ts",
"build": "cd client && yarn build",
"prebuild": "yarn install",
"build": "yarn workspace @chainlink/explorer-client run build",
"prod": "yarn migration:run && ts-node ./src/index.ts",
"pretest": "yarn autosetup",
"test": "cross-env TYPEORM_NAME=test yarn automigrate && yarn jest --runInBand --detectOpenHandles",
"test-ci": "yarn automigrate && yarn jest src/__tests__ --runInBand --detectOpenHandles",
"test-ci:e2e": "yarn automigrate && yarn build && yarn test-ci:e2e:no-build",
"test-ci:e2e:no-build": "yarn automigrate && yarn jest e2e/ --runInBand --detectOpenHandles",
"pretest-ci": "yarn autosetup",
"test-ci": "yarn jest src/__tests__ --runInBand --detectOpenHandles",
"pretest-ci:e2e": "yarn autosetup",
"test-ci:e2e": "yarn build && yarn test-ci:e2e:no-build",
"pretest-ci:e2e:no-build": "yarn autosetup",
"test-ci:e2e:no-build": "yarn jest e2e/ --runInBand --detectOpenHandles",
"pretest-ci:silent": "yarn autosetup",
"test-ci:silent": "yarn test-ci --silent",
"pretest-ci:e2e:silent": "yarn autosetup",
"test-ci:e2e:silent": "yarn test-ci:e2e --silent",
"lint": "eslint --color --ext .js --ext .jsx --ext .ts --ext .tsx .",
"lint:fix": "eslint --fix --color --ext .js --ext .jsx --ext .ts --ext .tsx .",
"migration:run": "ts-node ./src/bin/migrator.ts migrate",
"migration:revert": "ts-node ./src/bin/migrator.ts revert",
"test:migration:run": "cross-env TYPEORM_NAME=test ts-node ./src/bin/migrator.ts migrate",
"autosetup": "yarn install && yarn automigrate",
"automigrate": "md5sum -c .migrations.${TYPEORM_NAME:-dev}.md5 2>/dev/null || yarn migration:run && md5sum src/bin/migrator.ts src/migration/* > .migrations.${TYPEORM_NAME:-dev}.md5",
"addclnode": "ts-node src/bin/clnodes.ts add"
},
Expand Down

0 comments on commit 4ede71c

Please sign in to comment.