Skip to content

feat: add automated TypeScript contract client package builder (#635) - #669

Merged
Sadeequ merged 1 commit into
StellarFlow-Network:mainfrom
AbuJulaybeeb:feat/635-automated-typescript-bindings-generator
Jul 27, 2026
Merged

Sadeequ merged 1 commit into
StellarFlow-Network:mainfrom
AbuJulaybeeb:feat/635-automated-typescript-bindings-generator

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

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//.
• 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

…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
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Sadeequ
Sadeequ merged commit 8886111 into StellarFlow-Network:main Jul 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💻 Binding-Generation | Automated TypeScript Contract Client Package Builder

2 participants