{"id":28978340,"url":"https://github.com/rive-app/rive-code-generator-wip","last_synced_at":"2025-09-08T07:42:26.457Z","repository":{"id":298933173,"uuid":"871245537","full_name":"rive-app/rive-code-generator-wip","owner":"rive-app","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-15T13:49:16.000Z","size":356,"stargazers_count":11,"open_issues_count":4,"forks_count":5,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-13T21:23:27.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/rive-app.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.MD","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,"zenodo":null}},"created_at":"2024-10-11T14:56:07.000Z","updated_at":"2025-06-15T22:26:03.000Z","dependencies_parsed_at":"2025-07-13T21:20:45.107Z","dependency_job_id":"5d730d72-32ba-42c6-8672-3eb76336e273","html_url":"https://github.com/rive-app/rive-code-generator-wip","commit_stats":null,"previous_names":["rive-app/rive-code-generator-wip"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rive-app/rive-code-generator-wip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rive-app%2Frive-code-generator-wip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rive-app%2Frive-code-generator-wip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rive-app%2Frive-code-generator-wip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rive-app%2Frive-code-generator-wip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rive-app","download_url":"https://codeload.github.com/rive-app/rive-code-generator-wip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rive-app%2Frive-code-generator-wip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274152757,"owners_count":25231293,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-06-24T15:42:05.274Z","updated_at":"2025-09-08T07:42:26.426Z","avatar_url":"https://github.com/rive-app.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/rive-app/rive-code-generator-wip\"\u003e\n    Rive Code Generator\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eSimplify Rive integration at runtime:\u003c/strong\u003e\u003cbr\u003e\n  Generate type-safe wrappers for Rive files.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/rive-app/rive-code-generator-wip/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"Rive Code Generator is released under the MIT license.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/rive-app/rive-code-generator-wip/actions\"\u003e\n    \u003cimg src=\"https://github.com/rive-app/rive-code-generator-wip/actions/workflows/build_rive_code_generator.yaml/badge.svg\" alt=\"Current GitHub Actions build status.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/rive-app/rive-code-generator-wip/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/rive-app/rive-code-generator-wip\" alt=\"Latest GitHub release.\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/rive-app/rive-code-generator-wip/blob/main/CONTRIBUTING.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome!\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\n  \u003ca href=\"#releases\"\u003eReleases\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003ca href=\"#custom-templates\"\u003eCustom Templates\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003ca href=\"#contributing\"\u003eContribute\u003c/a\u003e\n  \u003cspan\u003e · \u003c/span\u003e\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/h3\u003e\n\nThis tool parses Rive (`.riv`) files and extracts component names, artboards, state machine inputs, and other components in a human-readable format. Key features include:\n\n- Creating type-safe wrappers for `.riv` files (e.g., static helper classes)\n- Generating JSON representations of `.riv` files\n- Diffing `.riv` files for version control purposes\n- Generating complete code components\n\nThe tool uses [Mustache](https://mustache.github.io/) templating for flexible output generation.\n\n:warning: Note that this tool is still experimental and untested. Feedback and contributions are appreciated.\n\n## Releases\n\nSee the [release workflow](.github/workflows/release_workflow.yaml) for release details.\n\nThe latest release can be downloaded from the [Releases](https://github.com/rive-app/rive-code-generator-wip/releases) page.\n\n## Usage\n\nRun the code generator using:\n\n```sh\n./build/out/lib/\u003cdebug|release\u003e/rive_code_generator -i \u003cinput_rive_file\u003e -o \u003coutput_directory\u003e -l \u003clanguage\u003e\n```\n\nExample:\n```sh\n./build/out/lib/release/rive_code_generator -i ./examples/rive_files/animation.riv -o ./examples/generated_code.dart -l dart\n```\n\n## Custom Templates\n\nYou can use custom Mustache templates for code generation:\n\n```sh\n./build/out/lib/release/rive_code_generator -i ./rive_files/ -o ./output/rive.json -t templates/json_template.mustache\n```\n\nSample templates are available in the [`templates`](./templates) directory.\n\n### Template Syntax\n\nThe tool uses [Mustache](https://mustache.github.io/) templating. Please refer to the [Mustache documentation](https://mustache.github.io/) for syntax details.\n\nFor each Rive file `{{#riv_files}}`, the following variables are available:\n- `{{riv_pascal_case}}`: The Rive file name in PascalCase\n- `{{riv_camel_case}}`: The Rive file name in camelCase\n- `{{riv_snake_case}}`: The Rive file name in snake_case\n- `{{riv_kebab_case}}`: The Rive file name in kebab-case\n\n- `{{assets}}`: List of assets in the Rive file\n- For each asset `{{#assets}}`:\n    - `{{asset_name}}`: Name of the asset\n    - `{{asset_camel_case}}`: Name of the asset in camelCase\n    - `{{asset_pascal_case}}`: Name of the asset in PascalCase\n    - `{{asset_snake_case}}`: Name of the asset in snake_case\n    - `{{asset_kebab_case}}`: Name of the asset in kebab-case\n    - `{{asset_type}}`: Type of the asset\n    - `{{asset_id}}`: ID of the asset\n    - `{{asset_cdn_uuid}}`: CDN UUID of the asset\n    - `{{asset_cdn_base_url}}`: CDN base URL of the asset\n\n- For each artboard `{{#artboards}}`:\n    - `{{artboard_name}}`: The original artboard name\n    - `{{artboard_pascal_case}}`: The artboard name in PascalCase\n    - `{{artboard_camel_case}}`: The artboard name in camelCase\n    - `{{artboard_snake_case}}`: The artboard name in snake_case\n    - `{{artboard_kebab_case}}`: The artboard name in kebab-case\n    - `{{animations}}`: List of animation names for the artboard\n    - For each animation `{{#animations}}`:\n        - `{{animation_name}}`: Name of the animation\n        - `{{animation_camel_case}}`: Name of the animation in camelCase\n        - `{{animation_pascal_case}}`: Name of the animation in PascalCase\n        - `{{animation_snake_case}}`: Name of the animation in snake_case\n        - `{{animation_kebab_case}}`: Name of the animation in kebab-case\n    - `{{state_machines}}`: List of state machines for the artboard\n    - For each state machine `{{#state_machines}}`:\n        - `{{state_machine_name}}`: Name of the state machine\n        - `{{state_machine_camel_case}}`: Name of the state machine in camelCase\n        - `{{state_machine_pascal_case}}`: Name of the state machine in PascalCase\n        - `{{state_machine_snake_case}}`: Name of the state machine in snake_case\n        - `{{state_machine_kebab_case}}`: Name of the state machine in kebab-case\n        - `{{inputs}}`: List of inputs for the state machine\n        - For each input `{{#inputs}}`:\n            - `{{input_name}}`: Name of the input\n            - `{{input_type}}`: Type of the input\n            - `{{input_default_value}}`: Default value of the input\n    - `{{text_value_runs}}`: List of text value runs for the artboard\n    - For each text value run `{{#text_value_runs}}`:\n        - `{{text_value_run_name}}`: Name of the text value run\n        - `{{text_value_run_camel_case}}`: Name of the text value run in camelCase\n        - `{{text_value_run_pascal_case}}`: Name of the text value run in PascalCase\n        - `{{text_value_run_snake_case}}`: Name of the text value run in snake_case\n        - `{{text_value_run_kebab_case}}`: Name of the text value run in kebab-case\n        - `{{text_value_run_default}}`: Default value of the text value run\n        - `{{text_value_run_default_sanitized}}`: Default value of the text value run with special characters encoded\n    - For each nested text value run `{{#nested_text_value_runs}}`:\n        - `{{nested_text_value_run_name}}`: Name of the nested text value run\n        - `{{nested_text_value_run_path}}`: Path of the nested text value run\n\n**:warning: Warning:** For duplicated names (e.g., multiple artboards, animations, or assets with the same name), the original unique names will be preserved. However, the case-converted versions (such as camelCase, PascalCase, etc.) will have a unique identifier attached to avoid conflicts.\n\nFor example:\n- Original names: \"MyArtboard\", \"MyArtboard\"\n- Unique camelCase: \"myArtboard\", \"myArtboardU1\"\n\nThis ensures that all generated code and references remain unique and valid.\n\n## Supported Languages\n\nAt the moment, the tool supports Dart and JSON outputs. More defualt exports will be added. However, you can easily add your own by providing a custom template.\n\n## Contribute\n\nContributions are welcome! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frive-app%2Frive-code-generator-wip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frive-app%2Frive-code-generator-wip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frive-app%2Frive-code-generator-wip/lists"}