{"id":26674691,"url":"https://github.com/switchupcb/fyneform","last_synced_at":"2025-03-26T02:38:48.872Z","repository":{"id":283780711,"uuid":"952899498","full_name":"switchupcb/fyneform","owner":"switchupcb","description":"Fyneform is a code generator which generates Fyne GUI Forms based on Go types.","archived":false,"fork":false,"pushed_at":"2025-03-22T05:30:31.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T06:24:32.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/switchupcb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T05:24:29.000Z","updated_at":"2025-03-22T05:29:10.000Z","dependencies_parsed_at":"2025-03-22T06:35:23.860Z","dependency_job_id":null,"html_url":"https://github.com/switchupcb/fyneform","commit_stats":null,"previous_names":["switchupcb/fyneform"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Ffyneform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Ffyneform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Ffyneform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/switchupcb%2Ffyneform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/switchupcb","download_url":"https://codeload.github.com/switchupcb/fyneform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245578079,"owners_count":20638434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T02:38:48.187Z","updated_at":"2025-03-26T02:38:48.864Z","avatar_url":"https://github.com/switchupcb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate a Fyne GUI Form based on Go types\n\n[![License](https://img.shields.io/github/license/switchupcb/fyneform.svg?style=for-the-badge)](https://github.com/switchupcb/fyneform/blob/main/LICENSE)\n\nUse Fyneform to stop wasting time developing [Fyne GUI Forms](https://docs.fyne.io/widget/form) based on Go types.\n\n## What is Fyneform?\n\nFyneform is a code generator which generates [Fyne GUI](https://github.com/fyne-io/fyne) form code based on Go types without adding a dependency to your project.\n\n## Table of Contents\n\n| Topic                                      | Category                                                                                                                                                        |\n| :----------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [Using Fyneform](#how-do-you-use-fyneform) | [1. Define Go types](#step-1-define-go-types) \u003cbr\u003e [2. Configure Copygen](#step-2-configure-copygen) \u003cbr\u003e [3. Generate Fyne Forms](#step-3-generate-fyne-forms) |\n| [View Output](#output)                     |\n\n## How do you use Fyneform?\n\nThis demonstration (at [`example`](/example/)) generates a Fyneform for an `Account` Go type.\n\n### Step 1. Define Go types\n\nGo types are defined in a file.\n\n`./domain/domain.go`\n\n```go\n// Account represents a user's account.\ntype Account struct {\n    ID int\n    Username string\n    Password string\n    Name string\n}\n```\n\n### Step 2. Configure Copygen\n\n[Copygen](https://github.com/switchupcb/copygen) is used to generate code based on Go types.\n\n**1\\)** [`example/setup/copygen/setup.yml`](/example/setup/copygen/setup.yml)\n\nConfigure the `setup.yml` file.\n\n```yml\n# Define where the code is generated.\ngenerated:\n  setup: ./setup.go\n  output: ../../app/fyneform/fyneform.go\n  template: ../fyneform/generate.go\n\nmatcher:\n    skip: true\n```\n\n**2\\)** [`example/setup/copygen/setup.go`](/example/setup/copygen/setup.go)\n\nConfigure the `setup.go` file.\n\n```go\npackage fyneform\n\nimport (\n\t\"github.com/fyneform/example/app/domain\"\n)\n\n// Copygen defines the functions that are generated.\ntype Copygen interface {\n\t// AccountForm represents the generated functions name which returns a \u0026widget.Form.\n\t//\n\t// You can include multiple Go types (e.g., `domain.Account`) in a single form.\n\t//\n\t// WARNING: Do not define Go types with a pointer.\n\tAccountForm(domain.Account)\n}\n```\n\n**3\\)** [`example/setup/fyneform/generate.go`](/example/setup/fyneform/generate.go)\n\nConfigure the generator template _(e.g., copy the file)_.\n\n_You can modify this file to customize how a form is generated._\n\n### Step 3. Generate Fyne Forms\n\nInstall Copygen.\n\n```\ngo install github.com/switchupcb/copygen@latest\n```\n\nRun the executable in a command line.\n\n```\ncd example/app\ncopygen -yml ../setup/copygen/setup.yml\n```\n\n_You must execute this demonstration from the `example/app` directory so the Go types defined in the example's Go module (i.e., `github.com/fyneform/example/app`) are resolved correctly by the Go module system._\n\n### Output\n\n[![Fyneform Example Application Output](/example/app/output-min.png)](https://github.com/switchupcb/fyneform/blob/main/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchupcb%2Ffyneform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswitchupcb%2Ffyneform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswitchupcb%2Ffyneform/lists"}