Skip to content

Commit

Permalink
Add gen-clean to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfMoo committed Apr 23, 2024
1 parent 9aaa195 commit 2e2838c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf ./dist",
"gen": "./scripts/generate-client.sh",
"gen": "npm run clean-gen && ./scripts/generate-client.sh",
"clean-gen": "rm -rf src/gen/* && rm -rf docs/openapi/*",
"build": "npm run clean && tsc",
"prepare": "npm run build",
"lint": "eslint . --ext .ts --ignore-pattern '/dist/*/*'",
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate-client.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

buf generate --template protos/buf.gen.orchestration.yaml buf.cbhq.net/cloud/staking --path coinbase/staking/orchestration/v1 --include-imports --include-wkt
buf generate --template protos/buf.gen.rewards.yaml buf.cbhq.net/cloud/rewards-reporting-protos-rewards --path coinbase/staking/rewards/v1 --include-imports --include-wkt
buf generate --template protos/buf.gen.orchestration.yaml buf.build/cdp/orchestration --path coinbase/staking/orchestration/v1 --include-imports --include-wkt
buf generate --template protos/buf.gen.rewards.yaml buf.build/cdp/rewards --path coinbase/staking/rewards/v1 --include-imports --include-wkt
# TODO: Remove this once the generation issue is fixed.
find ./src/gen -type f -exec sed -I '' -e 's/parentprotocols/parent/g' -e 's/parentprotocolsnetworks/parents/g' -e 's/parentnetworks/parent/g' -e 's/nameprojectsworkflows/name/g' -e 's/parentprojects/parent/g' {} \;

0 comments on commit 2e2838c

Please sign in to comment.