Skip to content
Open
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
4 changes: 2 additions & 2 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Generate code client bindings for a contract
###### **Subcommands:**

- `rust` — Generate Rust bindings
- `typescript` — ⚠️ Deprecated, use the JavaScript Stellar SDK instead (https://github.com/stellar/js-stellar-sdk#cli). Generate a TypeScript / JavaScript package
- `typescript` — ⚠️ Deprecated, will be provided by the JavaScript Stellar SDK plugin in `@stellar/stellar-sdk` 17.2.0 or later (https://github.com/stellar/js-stellar-sdk#stellar-cli-plugin). Generate a TypeScript / JavaScript package
- `python` — Generate Python bindings (requires external plugin)
- `java` — Generate Java bindings (requires external plugin)
- `flutter` — Generate Flutter bindings (requires external plugin)
Expand All @@ -295,7 +295,7 @@ Generate Rust bindings

## `stellar contract bindings typescript`

⚠️ Deprecated, use the JavaScript Stellar SDK instead (https://github.com/stellar/js-stellar-sdk#cli). Generate a TypeScript / JavaScript package
⚠️ Deprecated, will be provided by the JavaScript Stellar SDK plugin in `@stellar/stellar-sdk` 17.2.0 or later (https://github.com/stellar/js-stellar-sdk#stellar-cli-plugin). Generate a TypeScript / JavaScript package

**Usage:** `stellar contract bindings typescript [OPTIONS] --output-dir <OUTPUT_DIR> <--wasm <WASM>|--wasm-hash <WASM_HASH>|--contract-id <CONTRACT_ID>>`

Expand Down
29 changes: 29 additions & 0 deletions cmd/crates/soroban-test/tests/it/bindings.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use predicates::prelude::predicate;
use soroban_test::TestEnv;

use crate::util::CUSTOM_TYPES;

// The deprecation warning has to say where the command is going and which SDK
// release provides the replacement, so users know what to install before the
// native command is removed.
#[test]
fn typescript_bindings_deprecation_warning_names_the_plugin() {
let sandbox = TestEnv::default();

sandbox
.new_assert_cmd("contract")
.args(["bindings", "typescript", "--wasm"])
.arg(CUSTOM_TYPES.path())
.args(["--output-dir", "bindings-output"])
.assert()
.success()
.stderr(predicate::str::contains(
"`stellar contract bindings typescript` is deprecated and will be removed",
))
.stderr(predicate::str::contains(
"`@stellar/stellar-sdk` 17.2.0 or later",
))
.stderr(predicate::str::contains(
"https://github.com/stellar/js-stellar-sdk#stellar-cli-plugin",
));
}
1 change: 1 addition & 0 deletions cmd/crates/soroban-test/tests/it/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod bindings;
mod build;
mod config;
#[cfg(unix)]
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub enum Cmd {
/// Generate Rust bindings
Rust(rust::Cmd),

/// ⚠️ Deprecated, use the JavaScript Stellar SDK instead (https://github.com/stellar/js-stellar-sdk#cli). Generate a TypeScript / JavaScript package
/// ⚠️ Deprecated, will be provided by the JavaScript Stellar SDK plugin in `@stellar/stellar-sdk` 17.2.0 or later (https://github.com/stellar/js-stellar-sdk#stellar-cli-plugin). Generate a TypeScript / JavaScript package
Typescript(Box<typescript::Cmd>),

/// Generate Python bindings (requires external plugin)
Expand Down
10 changes: 7 additions & 3 deletions cmd/soroban-cli/src/commands/contract/bindings/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use soroban_spec_typescript::boilerplate::Project;

use crate::commands::contract::info::shared as contract_spec;
use crate::print::Print;
use crate::utils::deprecate_message;
use soroban_spec_tools::contract::Spec;

#[derive(Parser, Debug, Clone)]
Expand Down Expand Up @@ -55,9 +56,12 @@ impl Cmd {
pub async fn execute(&self, quiet: bool) -> Result<(), Error> {
let print = Print::new(quiet);

print.warnln(
"`stellar contract bindings typescript` is deprecated. Use the JavaScript Stellar SDK \
instead: https://github.com/stellar/js-stellar-sdk#cli",
deprecate_message(
print.clone(),
"stellar contract bindings typescript",
"It will then be provided by the JavaScript Stellar SDK plugin: install \
`@stellar/stellar-sdk` 17.2.0 or later globally to keep using this command. See \
https://github.com/stellar/js-stellar-sdk#stellar-cli-plugin",
);

let contract_spec::Fetched { contract, source } =
Expand Down