feat: add automated TypeScript contract client package builder (#635) - #669
Merged
Sadeequ merged 1 commit intoJul 27, 2026
Conversation
…arFlow-Network#635) Implements scripts/generate-bindings.sh — a fully automated build-pipeline script that converts every workspace contract WASM into a typed TypeScript client package consumable by stellarflow-frontend. Key features ──────────── • Discovers all cdylib workspace members under contracts/ automatically; no manual configuration required when a new contract is added. • Invokes `stellar contract bindings typescript` per contract, writing each generated TS package into packages/<contract-name>/. • Scopes each generated package as @stellarflow/<name> and patches package.json with proper repository and keywords metadata. • Accepts --network, --rpc-url, --output, and --contracts CLI flags so the script works identically for local dev, CI, and multi-environment deploys. • Respects STELLAR_NETWORK, STELLAR_RPC_URL, and BINDINGS_OUTPUT_DIR env vars for CI/CD pipeline integration without flag changes. • Colour-coded console output with clear INFO / OK / WARN / ERROR prefixes and a summary table showing generated vs skipped contract count. • Performs preflight checks for stellar CLI and cargo before attempting a build, giving actionable install instructions on failure. • Adds packages/ output directory anchored by packages/.gitkeep; generated contents are gitignored so only the script is versioned. Usage ───── # Generate bindings for all workspace contracts (testnet, default output) ./scripts/generate-bindings.sh # Target a specific network and output directory ./scripts/generate-bindings.sh --network mainnet --output ../stellarflow-frontend/packages # Generate bindings for a subset of contracts only ./scripts/generate-bindings.sh --contracts price-oracle,liquidity-lock Closes StellarFlow-Network#635
|
@AbuJulaybeeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements scripts/generate-bindings.sh — a fully automated build-pipeline script that converts every workspace contract WASM into a typed TypeScript client package consumable by stellarflow-frontend.
Key features
────────────
• Discovers all cdylib workspace members under contracts/ automatically;
no manual configuration required when a new contract is added.
• Invokes
stellar contract bindings typescriptper contract, writing eachgenerated TS package into packages//.
• Scopes each generated package as @stellarflow/ and patches
package.json with proper repository and keywords metadata.
• Accepts --network, --rpc-url, --output, and --contracts CLI flags so the
script works identically for local dev, CI, and multi-environment deploys.
• Respects STELLAR_NETWORK, STELLAR_RPC_URL, and BINDINGS_OUTPUT_DIR env
vars for CI/CD pipeline integration without flag changes.
• Colour-coded console output with clear INFO / OK / WARN / ERROR prefixes
and a summary table showing generated vs skipped contract count.
• Performs preflight checks for stellar CLI and cargo before attempting a
build, giving actionable install instructions on failure.
• Adds packages/ output directory anchored by packages/.gitkeep; generated
contents are gitignored so only the script is versioned.
Usage
─────
Generate bindings for all workspace contracts (testnet, default output)
./scripts/generate-bindings.sh
Target a specific network and output directory
./scripts/generate-bindings.sh --network mainnet --output ../stellarflow-frontend/packages
Generate bindings for a subset of contracts only
./scripts/generate-bindings.sh --contracts price-oracle,liquidity-lock
Closes #635