From 2e2838c604d9ef8be241d9cc5f33aeeacfa0e22a Mon Sep 17 00:00:00 2001 From: Shane O'Brien Date: Tue, 23 Apr 2024 09:09:27 -0400 Subject: [PATCH] Add gen-clean to package.json --- package.json | 3 ++- scripts/generate-client.sh | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7c3b4cf..43be268 100644 --- a/package.json +++ b/package.json @@ -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/*/*'", diff --git a/scripts/generate-client.sh b/scripts/generate-client.sh index 1ac0cbb..3753912 100755 --- a/scripts/generate-client.sh +++ b/scripts/generate-client.sh @@ -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' {} \;