fix: add missing fields for local/remote template rendering#5057
fix: add missing fields for local/remote template rendering#5057jes0131 wants to merge 1 commit intowailsapp:v3-alphafrom
Conversation
WalkthroughThis PR introduces two new public type definitions ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.16.4)v3/internal/templates/templates.go┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable the changed files summary in the walkthrough.Disable the |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
v3/internal/templates/templates.go (1)
83-95: Consolidate duplicated config structs to avoid schema drift.
FileAssociationandProtocolConfigare duplicated here and inv3/internal/commands/build-assets.go(same fields/tags). Consider moving them to a shared internal package and reusing one canonical definition to prevent future divergence.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@v3/internal/templates/templates.go` around lines 83 - 95, FileAssociation and ProtocolConfig are duplicated and risk schema drift; extract a single canonical definition (preserving the yaml/json tags) into a shared internal package (e.g., internal/templates or internal/types), remove the duplicate structs from v3/internal/templates/templates.go and v3/internal/commands/build-assets.go, update all references to use the new shared types (replace local FileAssociation and ProtocolConfig usages with the new package's FileAssociation and ProtocolConfig), and run a quick build to fix imports and ensure tags remain identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@v3/internal/templates/templates.go`:
- Around line 83-95: FileAssociation and ProtocolConfig are duplicated and risk
schema drift; extract a single canonical definition (preserving the yaml/json
tags) into a shared internal package (e.g., internal/templates or
internal/types), remove the duplicate structs from
v3/internal/templates/templates.go and v3/internal/commands/build-assets.go,
update all references to use the new shared types (replace local FileAssociation
and ProtocolConfig usages with the new package's FileAssociation and
ProtocolConfig), and run a quick build to fix imports and ensure tags remain
identical.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cdb11200-deec-4454-9637-58bbb9e51718
📒 Files selected for processing (1)
v3/internal/templates/templates.go
Description
When using
wails3 generate templateto create a custom template and then initializing a project withwails3 init -t ./my-template, the init command failed with a template rendering error because several fields referenced inbuild_assets/windows/msix/app_manifest.xml.tmplandbuild_assets/windows/msix/template.xml.tmplwere missing from the data struct used for local/remote template rendering.The missing fields were:
Publisher,ProcessorArchitecture,ExecutableName,ExecutablePath,OutputPath,CertificatePath,FileAssociations, andProtocols.This fix adds those fields to the data struct in
Install(), following the same defaulting logic used inGenerateBuildAssets().Fixes #4815
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.wails3 generate template -name mytemplatewails3 init -n myproject -t ./mytemplateIf you checked Linux, please specify the distro and version.
Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit