Skip to content

TypeScript improvements#42

Merged
jasonpaulos merged 4 commits into
masterfrom
typescript-improvements
Oct 12, 2022
Merged

TypeScript improvements#42
jasonpaulos merged 4 commits into
masterfrom
typescript-improvements

Conversation

@jasonpaulos
Copy link
Copy Markdown
Contributor

@jasonpaulos jasonpaulos commented Sep 29, 2022

This PR improves TypeScript generation in a few ways:

  • Indexer types are now generated. These types are treated as completely separate from algod types and they live in a different file.
  • A static method fromParsedJSON has been added to each generated model class. This method allows JSON responses to be turned into our generated class types.
  • Small bugfix: arrays of integer types used to be incorrectly built as number | bigint[], but they are now correctly built as (number | bigint)[].
  • Quality of life: the JS SDK formatter is now ran automatically after code generation.

The changes here were used to generate the code in algorand/js-algorand-sdk#663 and algorand/js-algorand-sdk#662

Comment thread typescript_templates/model.vm Outdated
Copy link
Copy Markdown
Contributor

@winder winder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look fine to me. Presumably you're happy with the generated code, so I don't see any reason not to merge this.

@michaeldiamant
Copy link
Copy Markdown
Contributor

Since @jasonpaulos is OOO for the week, leaving a note to broadcast sequencing suggestion:

Copy link
Copy Markdown
Contributor

@michaeldiamant michaeldiamant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My approval is primarily driven by review of generated changes in algorand/js-algorand-sdk#663.

@jasonpaulos jasonpaulos merged commit ba06b52 into master Oct 12, 2022
@jasonpaulos jasonpaulos deleted the typescript-improvements branch October 12, 2022 21:14
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.

3 participants