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(scripts): Flexible TypeScript code generation command for smart contract types #85

Open
2 tasks
Unique-Divine opened this issue Oct 27, 2023 · 0 comments · May be fixed by #143
Open
2 tasks

feat(scripts): Flexible TypeScript code generation command for smart contract types #85

Unique-Divine opened this issue Oct 27, 2023 · 0 comments · May be fixed by #143
Assignees
Labels
scope: scripts Scope in the conventional commit sense is a noun describing the section of the codebase. type: enhancement New feature or request

Comments

@Unique-Divine
Copy link
Member

Unique-Divine commented Oct 27, 2023

Summary

Provide a simplified abstraction around CosmWasm/ts-codegen. This should be usable from the top-level justfile.

  • Make a command that runs ts-codegen for everything to an output dir like dist.
  • ci: Add a manually runnable workflow to publish TypeScript code intended for app.nibiru.fi.

Intent / Motivation

  • Dev X and Reduced Complexity: Simplifying the interactions with ts-codegen will help eliminate the need to remember or input intricate command specifics.

  • Unified Output Directory: Centralizing generated code into a directory like dist fosters organization and ensures uniformity across the repo.

  • Better Publishing: A publishing workflow for the TypeScript code will simplify the process of sharing or distributing the generated code, reducing manual steps and potential errors.

Basic Usage for Getting Started

Install

npm install -g @cosmwasm/ts-codegen

Generating a client

# Template: Using the "client" plugin
cosmwasm-ts-codegen generate \
          --plugin client \
          --schema [path-to-schema-dir] \
          --out [path-to-ts-out-dir] \
          --name [contract-crate-name] \
          --no-bundle

# Example: Using the "client" plugin
cosmwasm-ts-codegen generate \
          --plugin client \
          --schema ./schema \
          --out ./ts \
          --name SG721 \
          --no-bundle

Generally, everything we need is some variation on cosmwasm-ts-codegen generate

@Unique-Divine Unique-Divine added type: enhancement New feature or request scope: scripts Scope in the conventional commit sense is a noun describing the section of the codebase. labels Oct 27, 2023
@matthiasmatt matthiasmatt self-assigned this Mar 21, 2024
@matthiasmatt matthiasmatt linked a pull request Mar 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: scripts Scope in the conventional commit sense is a noun describing the section of the codebase. type: enhancement New feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants