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!: code generation for Go, Rust, TypeScript (WIP) #135

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jul 17, 2024

  • Very basic initial version, only structs are supported, basic sub-type support
  • Introduces parsing and representation of comments - before types and on the same line as struct fields (to be expanded to other fields)
  • Introduces annotations, appearing in comments just prior to a type or a struct field (to be expanded to other fields) of the form @annotation(value) where the parens and value is optional and all content on the same line is ignored. Annotations are arbitrary but can be used by the code generation engine.

Most interesting part of this change can be seen in the test fixtures, schema -> Go, Rust, TypeScript in https://github.com/ipld/js-ipld-schema/blob/rvagg/codegen/test/fixtures/gen/filecoin_miner_types.md

* Very basic initial version, only structs are supported, basic sub-type support
* Introduces parsing and representation of comments - before types and on the
  same line as struct fields (to be expanded to other fields)
* Introduces annotations, appearing in comments just prior to a type or a
  struct field (to be expanded to other fields) of the form
	`@annotation(value)` where the parens and value is optional and all content
	on the same line is ignored. Annotations are arbitrary but can be used by
	the code generation engine.
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.

1 participant