Skip to content

Commit

Permalink
chore: improve scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslavirha committed Oct 29, 2023
1 parent 67ed62f commit 75feefa
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
6 changes: 2 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run cleanup:all
pnpm install
pnpm run test
pnpm run build
pnpm run build
pnpm run test
8 changes: 4 additions & 4 deletions api/authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "radoslav.irha@gmail.com",
"license": "MIT",
"scripts": {
"bootstrap": "pnpm run config:all && pnpm run keys",
"bootstrap": "pnpm run config:api && pnpm run keys",
"build": "pnpm run barrels && tsc --project tsconfig.compile.json",
"barrels": "barrelsby --config .barrelsby.json",
"start": "pnpm run barrels && NODE_ENV=localhost tsnd --inspect --exit-child --cls --ignore-watch node_modules --respawn --transpile-only -r tsconfig-paths/register src/index.ts",
Expand All @@ -14,12 +14,12 @@
"lint": "eslint --ext .ts src",
"test": "pnpm run config:test && cross-env NODE_ENV=test jest",
"test:watch": "pnpm run test --watchAll",
"config": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.authentication.json -t config/localhost.json -f json || true",
"config:localhost": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.authentication.json -t config/localhost.json -f json || true",
"config:test": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.authentication.template.json -t config/test.json -f json || true",
"config:env": "hikers-book-config-cli -s node_modules/@hikers-book/config/environment-variables/api.authentication.json -t config/custom-environment-variables.json -f json || true",
"config:clear": "find ./config -name '*.json' -type f -delete",
"config:all": "pnpm run config:env && pnpm run config && pnpm run config:test",
"postinstall": "pnpm run config:all",
"config:api": "pnpm run config:env && pnpm run config:localhost",
"postinstall": "pnpm run config:api",
"cleanup": "rm -rf coverage dist",
"cleanup:modules": "rm -rf node_modules",
"keys": "openssl genrsa -out keys/jwt.pem 2048 && openssl rsa -in keys/jwt.pem -outform PEM -pubout -out keys/jwt.pem.pub"
Expand Down
6 changes: 3 additions & 3 deletions api/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"lint": "eslint --ext .ts src",
"test": "pnpm run config:test && cross-env NODE_ENV=test jest",
"test:watch": "pnpm run test --watchAll",
"config": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.graphql.json -t config/localhost.json -f json || true",
"config:localhost": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.graphql.json -t config/localhost.json -f json || true",
"config:test": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.graphql.template.json -t config/test.json -f json || true",
"config:env": "hikers-book-config-cli -s node_modules/@hikers-book/config/environment-variables/api.graphql.json -t config/custom-environment-variables.json -f json || true",
"config:clear": "find ./config -name '*.json' -type f -delete",
"config:all": "pnpm run config:env && pnpm run config && pnpm run config:test",
"postinstall": "pnpm run config:all",
"config:api": "pnpm run config:env && pnpm run config:localhost",
"postinstall": "pnpm run config:api",
"cleanup": "rm -rf coverage dist",
"cleanup:modules": "rm -rf node_modules"
},
Expand Down
6 changes: 3 additions & 3 deletions api/stages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"lint": "eslint --ext .ts src",
"test": "pnpm run config:test && cross-env NODE_ENV=test jest",
"test:watch": "pnpm run test --watchAll",
"config": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.stages.json -t config/localhost.json -f json || true",
"config:localhost": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.stages.json -t config/localhost.json -f json || true",
"config:test": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.stages.template.json -t config/test.json -f json || true",
"config:env": "hikers-book-config-cli -s node_modules/@hikers-book/config/environment-variables/api.stages.json -t config/custom-environment-variables.json -f json || true",
"config:clear": "find ./config -name '*.json' -type f -delete",
"config:all": "pnpm run config:env && pnpm run config && pnpm run config:test",
"postinstall": "pnpm run config:all",
"config:api": "pnpm run config:env && pnpm run config:localhost",
"postinstall": "pnpm run config:api",
"cleanup": "rm -rf coverage dist",
"cleanup:modules": "rm -rf node_modules"
},
Expand Down
6 changes: 3 additions & 3 deletions api/trips/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"lint": "eslint --ext .ts src",
"test": "pnpm run config:test && cross-env NODE_ENV=test jest",
"test:watch": "pnpm run test --watchAll",
"config": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.trips.json -t config/localhost.json -f json || true",
"config:localhost": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.trips.json -t config/localhost.json -f json || true",
"config:test": "hikers-book-config-cli -s node_modules/@hikers-book/config/config/api.trips.template.json -t config/test.json -f json || true",
"config:env": "hikers-book-config-cli -s node_modules/@hikers-book/config/environment-variables/api.trips.json -t config/custom-environment-variables.json -f json || true",
"config:clear": "find ./config -name '*.json' -type f -delete",
"config:all": "pnpm run config:env && pnpm run config && pnpm run config:test",
"postinstall": "pnpm run config:all",
"config:api": "pnpm run config:env && pnpm run config:localhost",
"postinstall": "pnpm run config:api",
"cleanup": "rm -rf coverage dist",
"cleanup:modules": "rm -rf node_modules"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build": "pnpm --stream --recursive run build",
"clean": "rm -rf .parcel-cache && pnpm --recursive run clean",
"config": "pnpm --filter '@hikers-book/config' run config && pnpm --filter=!'@hikers-book/config' run config:all",
"config": "pnpm --filter '@hikers-book/config' run config && pnpm --filter '@hikers-book/hikers-book-ui' run config && pnpm --filter=!'@hikers-book/config' run config:api",
"config:clear": "pnpm --stream --recursive run config:clear",
"lint": "pnpm --stream --recursive run lint",
"format": "pnpm --stream --recursive run format",
Expand Down

0 comments on commit 75feefa

Please sign in to comment.