Skip to content

Commit

Permalink
Merge pull request #1 from confio/centralise-build
Browse files Browse the repository at this point in the history
Move generation into root
  • Loading branch information
willclarktech authored Jun 2, 2021
2 parents 77e7f5d + a15de62 commit a50627a
Show file tree
Hide file tree
Showing 119 changed files with 23,728 additions and 162 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@
# Documentation here: https://yarnpkg.com/features/zero-installs
!/.yarn/cache
#/.pnp.*

/build/
/confio/
/cosmos/
/cosmos_proto/
/cosmwasm/
/gogoproto/
/google/
/ibc/
/tendermint/
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "cosmos-sdk"]
path = cosmos-sdk
url = https://github.com/cosmos/cosmos-sdk
[submodule "wasmd"]
path = wasmd-0.16
url = https://github.com/cosmwasm/wasmd
33 changes: 16 additions & 17 deletions .pnp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip
Git LFS file not shown
1 change: 0 additions & 1 deletion cosmos-sdk
Submodule cosmos-sdk deleted from f999b1
29 changes: 25 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "cosmjs-types",
"description": "JS and TS types relating to Protocol Buffers used by Cosmos-SDK and other related projects",
"private": true,
"contributors": [
"Will Clark <willclarktech@users.noreply.github.com>"
],
Expand All @@ -13,10 +12,32 @@
"publishConfig": {
"access": "public"
},
"workspaces": [
"packages/*"
"files": [
"confio/",
"cosmos/",
"cosmos_proto/",
"cosmwasm/",
"gogoproto/",
"google/",
"ibc/",
"tendermint/",
"*.md"
],
"scripts": {
"format": "prettier --write --loglevel warn \"./src/**/*.ts\"",
"define-proto": "./scripts/define-proto.sh && yarn format",
"prepare": "./scripts/prepare.sh",
"build": "rm -rf ./build && tsc && yarn prepare"
},
"devDependencies": {
"ts-proto": "^1.81.1"
"@types/long": "^4.0.1",
"@types/node": "^15.6.2",
"prettier": "^2.3.0",
"ts-proto": "^1.81.1",
"typescript": "~4.0"
},
"dependencies": {
"long": "^4.0.0",
"protobufjs": "~6.10.2"
}
}
1 change: 0 additions & 1 deletion packages/cosmos/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/cosmos/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions packages/cosmos/package.json

This file was deleted.

75 changes: 0 additions & 75 deletions packages/cosmos/scripts/define-proto.sh

This file was deleted.

10 changes: 0 additions & 10 deletions packages/cosmos/tsconfig.json

This file was deleted.

106 changes: 106 additions & 0 deletions scripts/define-proto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

OUT_DIR="./src"
WASMD_DIR="./wasmd-0.16/proto"
WASMD_THIRD_PARTY_DIR="./wasmd-0.16/third_party/proto"
CONFIO_DIR="$WASMD_THIRD_PARTY_DIR/confio/"
COSMOS_DIR="$WASMD_THIRD_PARTY_DIR/cosmos/"
IBC_DIR="$WASMD_THIRD_PARTY_DIR/ibc"

PLUGIN_PATH="$(realpath ./bin)/protoc-gen-ts_proto_yarn_2"

mkdir -p "$OUT_DIR"

protoc \
--plugin="$PLUGIN_PATH" \
--ts_proto_yarn_2_out="$OUT_DIR" \
--proto_path="$WASMD_DIR" \
--proto_path="$WASMD_THIRD_PARTY_DIR" \
--ts_proto_yarn_2_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
"$CONFIO_DIR/proofs.proto" \
"$COSMOS_DIR/auth/v1beta1/auth.proto" \
"$COSMOS_DIR/auth/v1beta1/genesis.proto" \
"$COSMOS_DIR/auth/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/bank.proto" \
"$COSMOS_DIR/bank/v1beta1/genesis.proto" \
"$COSMOS_DIR/bank/v1beta1/query.proto" \
"$COSMOS_DIR/bank/v1beta1/tx.proto" \
"$COSMOS_DIR/base/abci/v1beta1/abci.proto" \
"$COSMOS_DIR/base/kv/v1beta1/kv.proto" \
"$COSMOS_DIR/base/query/v1beta1/pagination.proto" \
"$COSMOS_DIR/base/reflection/v1beta1/reflection.proto" \
"$COSMOS_DIR/base/snapshots/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/store/v1beta1/commit_info.proto" \
"$COSMOS_DIR/base/store/v1beta1/snapshot.proto" \
"$COSMOS_DIR/base/tendermint/v1beta1/query.proto" \
"$COSMOS_DIR/base/v1beta1/coin.proto" \
"$COSMOS_DIR/capability/v1beta1/capability.proto" \
"$COSMOS_DIR/capability/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/genesis.proto" \
"$COSMOS_DIR/crisis/v1beta1/tx.proto" \
"$COSMOS_DIR/crypto/ed25519/keys.proto" \
"$COSMOS_DIR/crypto/multisig/keys.proto" \
"$COSMOS_DIR/crypto/multisig/v1beta1/multisig.proto" \
"$COSMOS_DIR/crypto/secp256k1/keys.proto" \
"$COSMOS_DIR/distribution/v1beta1/distribution.proto" \
"$COSMOS_DIR/distribution/v1beta1/genesis.proto" \
"$COSMOS_DIR/distribution/v1beta1/query.proto" \
"$COSMOS_DIR/distribution/v1beta1/tx.proto" \
"$COSMOS_DIR/evidence/v1beta1/evidence.proto" \
"$COSMOS_DIR/evidence/v1beta1/genesis.proto" \
"$COSMOS_DIR/evidence/v1beta1/query.proto" \
"$COSMOS_DIR/evidence/v1beta1/tx.proto" \
"$COSMOS_DIR/genutil/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/genesis.proto" \
"$COSMOS_DIR/gov/v1beta1/gov.proto" \
"$COSMOS_DIR/gov/v1beta1/query.proto" \
"$COSMOS_DIR/gov/v1beta1/tx.proto" \
"$COSMOS_DIR/mint/v1beta1/genesis.proto" \
"$COSMOS_DIR/mint/v1beta1/mint.proto" \
"$COSMOS_DIR/mint/v1beta1/query.proto" \
"$COSMOS_DIR/params/v1beta1/params.proto" \
"$COSMOS_DIR/params/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/genesis.proto" \
"$COSMOS_DIR/slashing/v1beta1/query.proto" \
"$COSMOS_DIR/slashing/v1beta1/slashing.proto" \
"$COSMOS_DIR/slashing/v1beta1/tx.proto" \
"$COSMOS_DIR/staking/v1beta1/genesis.proto" \
"$COSMOS_DIR/staking/v1beta1/query.proto" \
"$COSMOS_DIR/staking/v1beta1/staking.proto" \
"$COSMOS_DIR/staking/v1beta1/tx.proto" \
"$COSMOS_DIR/tx/signing/v1beta1/signing.proto" \
"$COSMOS_DIR/tx/v1beta1/service.proto" \
"$COSMOS_DIR/tx/v1beta1/tx.proto" \
"$COSMOS_DIR/upgrade/v1beta1/query.proto" \
"$COSMOS_DIR/upgrade/v1beta1/upgrade.proto" \
"$COSMOS_DIR/vesting/v1beta1/tx.proto" \
"$COSMOS_DIR/vesting/v1beta1/vesting.proto" \
"$IBC_DIR/applications/transfer/v1/genesis.proto" \
"$IBC_DIR/applications/transfer/v1/query.proto" \
"$IBC_DIR/applications/transfer/v1/transfer.proto" \
"$IBC_DIR/applications/transfer/v1/tx.proto" \
"$IBC_DIR/core/channel/v1/channel.proto" \
"$IBC_DIR/core/channel/v1/genesis.proto" \
"$IBC_DIR/core/channel/v1/query.proto" \
"$IBC_DIR/core/channel/v1/tx.proto" \
"$IBC_DIR/core/client/v1/client.proto" \
"$IBC_DIR/core/client/v1/genesis.proto" \
"$IBC_DIR/core/client/v1/query.proto" \
"$IBC_DIR/core/client/v1/tx.proto" \
"$IBC_DIR/lightclients/localhost/v1/localhost.proto" \
"$IBC_DIR/lightclients/solomachine/v1/solomachine.proto" \
"$IBC_DIR/lightclients/tendermint/v1/tendermint.proto" \
"$IBC_DIR/core/commitment/v1/commitment.proto" \
"$IBC_DIR/core/connection/v1/connection.proto" \
"$IBC_DIR/core/connection/v1/genesis.proto" \
"$IBC_DIR/core/connection/v1/query.proto" \
"$IBC_DIR/core/connection/v1/tx.proto" \
"$IBC_DIR/core/types/v1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/genesis.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/ibc.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/proposal.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/query.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/tx.proto" \
"$WASMD_DIR/cosmwasm/wasm/v1beta1/types.proto"
10 changes: 10 additions & 0 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

DIRS="confio cosmos cosmos_proto cosmwasm gogoproto google ibc tendermint"

for dir in $DIRS; do
rm -rf "$dir"
cp -R "./build/$dir" ./
done
Loading

0 comments on commit a50627a

Please sign in to comment.