-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added telescope download proto with cli docs #693
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,20 +126,76 @@ cca --boilerplate telescope | |
|
||
Then, you'll navigate into `./your-project/packages/telescope` package for the next steps. | ||
|
||
### Add Protobufs | ||
### Download with CLI | ||
|
||
If you have `.proto` files, simply add them to a `./proto` folder. | ||
The old ` telescope install ` command has been deprecated | ||
|
||
However, if you want to get started quickly using existing protos from our registry, simply use the `install` command. | ||
You can use our CLI for download. To download the proto files, `download` command. | ||
|
||
```sh | ||
telescope install | ||
telescope download | ||
``` | ||
|
||
It's not necessary, but you may also specify specific packages, e.g. | ||
You should now see some repos cloned in `./git-modules` and proto files generated in `./protos`. These are the proto files downloaded according to your config. | ||
|
||
Examples: | ||
|
||
```sh | ||
# Telescope will do the download according to .json file of --config | ||
# Telescope will put proto into location specified by --out | ||
telescope download --config ./protod.config.json --out ./git-modules | ||
``` | ||
|
||
```sh | ||
telescope install @protobufs/osmosis | ||
# Telescope download from target repo according to --git-repo | ||
# in format of (i.e. <owner>/<repository> or <owner>/<repository>/<branch>) | ||
# <branch> can be empty, it will use main as default | ||
# Also --targets is required to specify the targets to download | ||
# in format like cosmos/auth/v1beta1/auth.proto | ||
telescope download --git-repo target-repo --targets target-proto | ||
``` | ||
|
||
```sh | ||
# ssh arg is optional, default is false | ||
telescope download --config ./protod.config.json --out ./git-modules --ssh true | ||
``` | ||
|
||
|
||
```js | ||
// .protod.config.json example | ||
// | ||
// `repos` are the repository it's going to clone | ||
// in format of (i.e. { "owner": <owner>, "repo": <repo> } or { "owner": <owner>, "repo": <repo>, "branch": <branch> }) | ||
// <branch> can be empty, it will use main as default | ||
// | ||
// `protoDirMapping` is the directory of repo specified if the proto is not under repo's root directory ./protos | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description is not clear. Please be more specified. Thanks! |
||
// in format of (i.e. <owner>/<repository> or <owner>/<repository>/<branch>) | ||
// <branch> can be empty, it will use main as default | ||
// | ||
// `outDir` is where the output proto will be put | ||
// | ||
// `targets` are the target proto to download | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part can also be patterns, please mention that. |
||
// `targets` can be patterns like: | ||
// "cosmos/bank/v1beta1/tx.proto", | ||
// "cosmos/gov/**/*.proto", | ||
// "cosmos/authz/**/*.proto", | ||
{ | ||
"repos": [ | ||
{ "owner": "cosmos", "repo": "cosmos-sdk" }, | ||
... | ||
], | ||
"protoDirMapping": { | ||
"gogo/protobuf/master": ".", | ||
... | ||
}, | ||
"outDir": "protos", | ||
"ssh": true, | ||
"tempRepoDir": "git-modules", | ||
"targets": [ | ||
"cosmos/auth/v1beta1/auth.proto", | ||
... | ||
] | ||
} | ||
``` | ||
|
||
### Transpile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there're three parts: owner, repo and branch. branch can be empty and it will use main as default.