Skip to content
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

feat(cli): add CLI command idl to generate IDL from source crate #589

Merged
merged 15 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ jobs:

- name: Generate MyDemo via CLI
run: |
SAILS_CLI_TEMPLATES_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} ./target/debug/cargo-sails sails new-program ~/tmp --name my-demo
SAILS_CLI_TEMPLATES_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} ./target/debug/cargo-sails sails program ~/tmp --name my-demo

- name: Run Tests on MyDemo
run: |
cd ~/tmp/my-demo
cargo test -p my-demo

- name: Generate IDL from MyDemo via CLI
run: |
./target/debug/cargo-sails sails idl --manifest-path ~/tmp/my-demo/Cargo.toml
vobradovich marked this conversation as resolved.
Show resolved Hide resolved
diff ~/tmp/my-demo/target/my-demo-app.idl ~/tmp/my-demo/target/wasm32-unknown-unknown/debug/my_demo.idl
13 changes: 13 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ gwasm-builder = { version = "=1.6.2", package = "gear-wasm-builder" }
# Other deps in alphabetical order
anyhow = "1"
cargo-generate = "0.21"
cargo_metadata = "0.18"
clap = "4.5"
convert-case = { package = "convert_case", version = "0.6" }
futures = { version = "0.3", default-features = false }
Expand All @@ -70,6 +71,7 @@ parity-scale-codec = { version = "3.6", default-features = false }
prettyplease = "0.2"
proc-macro-error = "1.0"
proc-macro2 = { version = "1", default-features = false }
rustdoc-types = "=0.29.1"
quote = "1.0"
scale-info = { version = "2.11", default-features = false }
serde = "1.0"
Expand All @@ -78,5 +80,6 @@ spin = { version = "0.9", default-features = false, features = ["spin_mutex"] }
syn = "2.0"
thiserror = "1.0"
thiserror-no-std = "2.0"
toml_edit = "0.22"
tokio = "1.40"
trybuild = "1"
4 changes: 4 additions & 0 deletions rs/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ path = "src/main.rs"
[dependencies]
anyhow.workspace = true
cargo-generate.workspace = true
cargo_metadata.workspace = true
clap = { workspace = true, features = ["derive"] }
rustdoc-types.workspace = true
sails-client-gen.workspace = true
serde-json.workspace = true
toml_edit.workspace = true
Loading