onflow / onflow/flixkit-go

Generate FLIX using Cadence comment header block

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
0
Forks
7
Avg merge
2d 5h
Merged PRs (30d)
2

Description

Given a cadence file generate flix json, generate version 1.1.0

Cadence comment block and language support

  • Support Cadence doc FLIP
    • Support "@..." properties - Inside a Cadence transaction or script in comment
    • Support additional language json description file - As a separate JSON file, optional file
    • Error handling, @message title is required to generate template from Cadence
      • If only @message title is available, generate template.
      • Only one tx or script in one .cdc file

1.1.0 considerations

Generation considerations

  • Support passing in destination folder to generate method in flix-kit, default destination is template directory from exe dir.
  • Support user passing in flow.json for contract addresses for tx and scripts dependences.
  • Support emulator network for local development

Template naming

  • Name template file based on @message title property using all lower case and _ for spaces. If title is not given then use hash of cadence. (not a hard requirement, a place to start)

Note: The two FLIPS identified in this task are still in development, they can change based on development.

Future Plans:
watch process to auto generate templates as cadence developer changes their cadence files them templates would get auto-generated

flixkit folder structure for binding generation
├── main.go
├── binding/
│ ├── generator.go
│ └── javascript/
│ └── generator.go
│ └── templates/
│ └── js_template.tpl
└── ...

typescript would get it's own folder as well.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with main.go and the generators under binding/, including binding/generator.go and binding/javascript/generator.go. Read the linked Cadence and FLIX FLIPs first, then trace how flixkit currently generates bindings and templates. Done would require agreeing on the changing FLIX 1.1.0 and Cadence comment requirements, generation options, naming, and error handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.