Skip to content

Conversation

@tmclane
Copy link
Member

@tmclane tmclane commented Nov 5, 2025

Description

This MR corrects a small annoyance when using the init command while providing a -git argument.
In that case the generated Javascript bindings in the frontend/src/bindings directory are not placed in the changeme directory anymore.

This causes a compilation failure that must be corrected by editing one file per generated project to add in the proper path to the generated bindings.

See the attachment for the complete testing done.

testing.md

For example:

wails3 init -t sveltekit-ts -n testing -git github.com/tmclane/testing

 Wails (v3.0.0-dev)  Init project
Creating project
----------------

Project Name      | testing
Project Directory | /Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing
Template          | SvelteKit Typescript + Vite
Template Source   | https://wails.io
Template Version  | v0.0.1


Project 'testing' created successfully.
 INFO  Initialized git repository with remote: github.com/tmclane/testing

Produces

wails3 build                                                                                        10:28:26
 WARNING  `wails3 build` is an alias for `wails3 task build`. Use `wails task` for better control and more options.

task: [darwin:common:go:mod:tidy] go mod tidy
task: [darwin:common:generate:icons] wails3 generate icons -input appicon.png -macfilename darwin/icons.icns -windowsfilename windows/icon.ico
task: [darwin:common:go:mod:tidy] go mod tidy
task: [generate:bindings (BUILD_FLAGS=-buildvcs=false -gcflags=all="-l")] wails3 generate bindings -f '-buildvcs=false -gcflags=all="-l"' -clean=true -ts
 Wails (v3.0.0-dev)  Generate Bindings
 ▀ Loading packages... (0s)task: [darwin:common:install:frontend:deps] npm install
 INFO  Processed: 384 Packages, 1 Service, 1 Method, 0 Enums, 0 Models in 1.557312747s.
 INFO  Output directory: /Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/bindings

added 56 packages, and audited 57 packages in 11s

5 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (3 low, 5 moderate)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
task: [build:frontend (PRODUCTION=)] npm run build:dev -q

> [email protected] build:dev
> vite build --minify false --mode development

▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

    tsconfig.json:2:12:
      2 │   "extends": "./.svelte-kit/tsconfig.json",
        ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vite v5.4.21 building SSR bundle for development...
✓ 99 modules transformed.
x Build failed in 465ms
error during build:
Could not resolve "../../bindings/changeme" from "src/routes/+page.svelte"
file: /Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/src/routes/+page.svelte
    at getRollupError (file:///Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/node_modules/rollup/dist/es/shared/parseAst.js:401:41)
    at error (file:///Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/node_modules/rollup/dist/es/shared/parseAst.js:397:42)
    at ModuleLoader.handleInvalidResolvedId (file:///Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/node_modules/rollup/dist/es/shared/node-entry.js:21565:24)
    at file:///Users/tmclane/Projects/W/wails/v3/cmd/wails3/testing/testing/frontend/node_modules/rollup/dist/es/shared/node-entry.js:21525:26
  ERROR   task: Failed to run task "build": exit status 1

The culprit is :

Could not resolve "../../bindings/changeme" from "src/routes/+page.svelte"

The generated bindings are found in :

tree frontend/bindings/

frontend/bindings/
└── github.com
    └── tmclane
        └── testing
            ├── greetservice.ts
            └── index.ts

Fixes # (issue)

Type of change

Please select the option that is relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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.

  • Windows
  • macOS
  • Linux

If you checked Linux, please specify the distro and version.

Test Configuration


          Wails Doctor



# Wails
Version  | v2.6.0
Revision | 24853a7e3bc239bb5d3d432af580ea2725525d1f
Modified | true

# System
┌─────────────────────────┐
| OS           | MacOS    |
| Version      | 26.0.1   |
| ID           | 25A362   |
| Go Version   | go1.21.3 |
| Platform     | darwin   |
| Architecture | amd64    |
└─────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version     |
| Xcode command line tools  | N/A          | Installed | 2412        |
| Nodejs                    | N/A          | Installed | 25.1.0      |
| npm                       | N/A          | Installed | 11.6.2      |
| *Xcode                    | N/A          | Installed | 16.4 (16F6) |
| *upx                      | N/A          | Installed | upx 5.0.2   |
| *nsis                     | N/A          | Installed | v3.11       |
└───────────────────── * - Optional Dependency ──────────────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Summary by CodeRabbit

  • Refactor
    • Repo initialization no longer modifies go.mod; module name is determined during template rendering.
  • New Features
    • Templates now accept a Go module value so frontend bindings are generated dynamically instead of a hardcoded placeholder.
  • Bug Fixes
    • Fixed template reference to JavaScript bindings when using the git option; some Vue templates now render mustache placeholders as literals.
  • Chores
    • Cleaned up unreleased changelog header.

@tmclane tmclane requested a review from leaanthony November 5, 2025 17:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Removed exported GitURLToModuleName and go.mod mutation from the init command; introduced an internal gitURLToModuleName and a TemplateOptions.GoModule field, and updated templates and template tests to use and render {{.GoModule}} for frontend bindings and go.mod.

Changes

Cohort / File(s) Summary
Init command cleanup
v3/internal/commands/init.go
Removed exported GitURLToModuleName and logic that read/modified go.mod during repository initialization; imports reordered.
Templates core
v3/internal/templates/templates.go, v3/internal/templates/templates_test.go, v3/internal/templates/templates.go
Added GoModule string to TemplateOptions; added internal gitURLToModuleName helper and populate template data with GoModule; tests updated to call unexported helper and package adjusted.
Module template
v3/internal/templates/_common/go.mod.tmpl
Replaced static module changeme with module {{.GoModule}}.
Frontend templates (bindings import changes)
v3/internal/templates/.../frontend/**/*.{tmpl,js,ts,jsx,tsx,svelte,vue}
Replaced hardcoded imports referencing changeme with templated {{.GoModule}} across many frontend templates (base, lit, preact, qwik, react, solid, svelte, sveltekit, vanilla, vue, etc.).
Vue template literal & metadata tweaks
v3/internal/templates/vue*/frontend/src/components/HelloWorld.vue.tmpl
Updated import paths to ../../bindings/{{.GoModule}}; escaped Vue mustache interpolations to literal strings in template output; added a © marker to <script setup> in one template.
Templates registration
v3/internal/templates/templates.go
Template installation now derives and carries GoModule in template data for renderer.
Changelog
v3/UNRELEASED_CHANGELOG.md
Fixed leading dash before HTML comment and added a "Fixed" entry referencing JS bindings when using the -git CLI option.
Manifests
go.mod, package.json (templates references)
Template rendering now uses {{.GoModule}} in generated module/package references (manifests included).

Sequence Diagram(s)

sequenceDiagram
    participant CLI as init command (old)
    participant Templates as templates subsystem (new)
    participant Renderer as Template Renderer

    CLI->>CLI: (old) GitURLToModuleName(url) [exported]
    CLI->>CLI: (old) Modify go.mod with derived module

    Templates->>Templates: gitURLToModuleName(url)  -- derive GoModule --
    Templates->>Renderer: pass templateData { GoModule }
    Renderer->>Renderer: render templates with {{.GoModule}}
    note over Renderer: Frontend templates now import bindings/{{.GoModule}}
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Attention areas:
    • Verify correctness of gitURLToModuleName across URL schemes (ssh, https, file, Windows paths).
    • Confirm GoModule is populated for all install flows (git and fallback to project name).
    • Check all frontend templates for consistent substitution and no syntax regressions.
    • Review Vue mustache escaping to ensure generated templates render as intended.

Suggested labels

Bug, size:L, lgtm

Suggested reviewers

  • leaanthony

Poem

🐰
I hopped through lines and changed the name,
Swapped "changeme" for module fame.
From git URL I softly glean,
A tidy template, clean and keen —
Carrots for builds and no more shame. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: updating bindings references in templates to use dynamic module paths instead of static 'changeme' placeholders.
Description check ✅ Passed The description provides a clear problem statement, reproduction steps, example output showing the error, and identifies the root cause. It includes testing details and is marked as a bug fix with proper checklist.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

⚠️ Missing Changelog Update

Hi @tmclane, please update v3/UNRELEASED_CHANGELOG.md with a description of your changes.

This helps us keep track of changes for the next release.

@github-actions github-actions bot added the Documentation Improvements or additions to documentation label Nov 5, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 5, 2025

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: 935c04d
Status: ✅  Deploy successful!
Preview URL: https://718106d4.wails.pages.dev
Branch Preview URL: https://travis-v3-alpha-bugfix-bindi.wails.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
v3/internal/templates/templates.go (1)

492-522: Consider handling trailing slashes in Git URLs.

The gitURLToModuleName function correctly handles multiple URL formats, but doesn't trim trailing slashes. URLs like https://github.com/user/repo.git/ or [email protected]:user/repo/ would result in module names ending with /.

Apply this diff to handle trailing slashes:

 	// Remove leading forward slash for file system paths
 	moduleName = strings.TrimPrefix(moduleName, "/")
+	// Remove trailing forward slash
+	moduleName = strings.TrimSuffix(moduleName, "/")
 	return moduleName
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4e340 and 1cfa608.

📒 Files selected for processing (25)
  • v3/internal/commands/init.go (1 hunks)
  • v3/internal/templates/_common/go.mod.tmpl (1 hunks)
  • v3/internal/templates/base/frontend/main.js.tmpl (1 hunks)
  • v3/internal/templates/lit-ts/frontend/src/my-element.ts.tmpl (1 hunks)
  • v3/internal/templates/lit/frontend/src/my-element.js.tmpl (1 hunks)
  • v3/internal/templates/preact-ts/frontend/src/app.tsx.tmpl (1 hunks)
  • v3/internal/templates/preact/frontend/src/app.jsx.tmpl (1 hunks)
  • v3/internal/templates/qwik-ts/frontend/src/app.tsx.tmpl (1 hunks)
  • v3/internal/templates/qwik/frontend/src/app.jsx.tmpl (1 hunks)
  • v3/internal/templates/react-swc-ts/frontend/src/App.tsx.tmpl (1 hunks)
  • v3/internal/templates/react-swc/frontend/src/App.jsx.tmpl (1 hunks)
  • v3/internal/templates/react-ts/frontend/src/App.tsx.tmpl (1 hunks)
  • v3/internal/templates/react/frontend/src/App.jsx.tmpl (1 hunks)
  • v3/internal/templates/solid-ts/frontend/src/App.tsx.tmpl (1 hunks)
  • v3/internal/templates/solid/frontend/src/App.jsx.tmpl (1 hunks)
  • v3/internal/templates/svelte-ts/frontend/src/App.svelte.tmpl (1 hunks)
  • v3/internal/templates/svelte/frontend/src/App.svelte.tmpl (1 hunks)
  • v3/internal/templates/sveltekit-ts/frontend/src/routes/+page.svelte.tmpl (1 hunks)
  • v3/internal/templates/sveltekit/frontend/src/routes/+page.svelte.tmpl (1 hunks)
  • v3/internal/templates/templates.go (3 hunks)
  • v3/internal/templates/templates_test.go (2 hunks)
  • v3/internal/templates/vanilla-ts/frontend/src/main.ts.tmpl (1 hunks)
  • v3/internal/templates/vanilla/frontend/main.js.tmpl (1 hunks)
  • v3/internal/templates/vue-ts/frontend/src/components/HelloWorld.vue.tmpl (3 hunks)
  • v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: fbbdev
Repo: wailsapp/wails PR: 4001
File: v3/internal/generator/testdata/output/lang=TS/UseInterfaces=true/UseNames=false/github.com/wailsapp/wails/v3/internal/generator/testcases/function_single_internal/greetservice.ts:0-0
Timestamp: 2025-01-15T22:33:30.639Z
Learning: In the Wails framework's TypeScript bindings, the import path "/wails/runtime.js" is intentionally absolute and should not be changed to a relative path.
📚 Learning: 2025-01-15T22:33:30.639Z
Learnt from: fbbdev
Repo: wailsapp/wails PR: 4001
File: v3/internal/generator/testdata/output/lang=TS/UseInterfaces=true/UseNames=false/github.com/wailsapp/wails/v3/internal/generator/testcases/function_single_internal/greetservice.ts:0-0
Timestamp: 2025-01-15T22:33:30.639Z
Learning: In the Wails framework's TypeScript bindings, the import path "/wails/runtime.js" is intentionally absolute and should not be changed to a relative path.

Applied to files:

  • v3/internal/templates/solid-ts/frontend/src/App.tsx.tmpl
  • v3/internal/templates/qwik-ts/frontend/src/app.tsx.tmpl
  • v3/internal/templates/react-swc-ts/frontend/src/App.tsx.tmpl
  • v3/internal/templates/svelte/frontend/src/App.svelte.tmpl
  • v3/internal/templates/sveltekit/frontend/src/routes/+page.svelte.tmpl
  • v3/internal/templates/qwik/frontend/src/app.jsx.tmpl
  • v3/internal/templates/vanilla-ts/frontend/src/main.ts.tmpl
  • v3/internal/templates/preact-ts/frontend/src/app.tsx.tmpl
  • v3/internal/templates/react-ts/frontend/src/App.tsx.tmpl
  • v3/internal/templates/sveltekit-ts/frontend/src/routes/+page.svelte.tmpl
  • v3/internal/templates/svelte-ts/frontend/src/App.svelte.tmpl
  • v3/internal/templates/preact/frontend/src/app.jsx.tmpl
  • v3/internal/templates/base/frontend/main.js.tmpl
  • v3/internal/templates/solid/frontend/src/App.jsx.tmpl
  • v3/internal/templates/lit/frontend/src/my-element.js.tmpl
🧬 Code graph analysis (1)
v3/internal/templates/templates.go (2)
v3/internal/commands/init.go (1)
  • Init (51-115)
v3/internal/flags/init.go (1)
  • Init (3-22)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (29)
v3/internal/templates/templates_test.go (2)

1-1: LGTM: Package declaration correctly updated.

The package change from commands to templates correctly reflects the relocation of the module name derivation logic.


109-109: LGTM: Test updated to use unexported function.

The test correctly targets the relocated and now-unexported gitURLToModuleName helper. The comprehensive test coverage (18 test cases covering various git URL formats, protocols, and edge cases) remains intact.

v3/internal/commands/init.go (2)

10-11: Import grouping adjusted.

The import reorganization is a minor formatting change with no functional impact.


21-49: LGTM: Cleaner separation of concerns confirmed.

The initGitRepository function now focuses solely on git operations (initializing repo, creating remote, staging files) without modifying go.mod. This is a cleaner design as module naming responsibility has moved to the templating system.

Verification confirms templates.Install properly:

  1. Derives GoModule from the -git flag via gitURLToModuleName() (line 262)
  2. Falls back to project name when derivation returns empty (lines 263-265)
  3. Passes GoModule to template rendering in TemplateOptions struct (line 269)

The gitURLToModuleName() function handles HTTPS, SSH, Git protocol, and filesystem URLs correctly, with test cases validating behavior across GitHub, GitLab, BitBucket, and custom domains.

v3/internal/templates/qwik/frontend/src/app.jsx.tmpl (1)

2-2: LGTM: Import path correctly templatized.

The change from ../bindings/changeme to ../bindings/{{.GoModule}} correctly implements dynamic binding resolution for the Qwik template.

v3/internal/templates/solid-ts/frontend/src/App.tsx.tmpl (1)

2-2: LGTM: Import path correctly templatized.

The change from ../bindings/changeme to ../bindings/{{.GoModule}} correctly implements dynamic binding resolution for the Solid TypeScript template.

v3/internal/templates/react-swc/frontend/src/App.jsx.tmpl (1)

2-2: LGTM: Import path correctly templatized.

The change from ../bindings/changeme to ../bindings/{{.GoModule}} correctly implements dynamic binding resolution for the React SWC template.

v3/internal/templates/base/frontend/main.js.tmpl (1)

1-1: LGTM: Import path correctly templatized.

The change from ./bindings/changeme to ./bindings/{{.GoModule}} correctly implements dynamic binding resolution for the base vanilla JavaScript template. The relative path ./ (versus ../ in other templates) is intentional, reflecting that main.js is at the frontend/ root rather than in a src/ subdirectory.

v3/internal/templates/sveltekit/frontend/src/routes/+page.svelte.tmpl (1)

2-2: LGTM: Import path correctly templatized.

The change from ../../bindings/changeme to ../../bindings/{{.GoModule}} correctly implements dynamic binding resolution for the SvelteKit template. The deeper relative path ../../ is intentional, reflecting SvelteKit's file-system routing structure where this component is nested in src/routes/.

v3/internal/templates/_common/go.mod.tmpl (1)

1-1: Module name validation not implemented—verify this limitation is acceptable.

The GoModule field is properly populated with fallback logic:

  • Lines 262-265 in templates.go: calls gitURLToModuleName(options.Git) and falls back to options.ProjectName if empty
  • This correctly handles missing -git flag and empty URLs

However, no validation exists for Go module naming constraints. The gitURLToModuleName function (lines 494-522) strips URL schemes and normalizes formatting but does not validate that the result is a valid Go module name (lowercase alphanumeric + dots/slashes/hyphens only). Malformed input could produce invalid module names that fail during go mod tidy execution rather than failing early.

Confirm whether this deferred validation strategy (relying on go mod tidy to catch errors) is acceptable, or if upfront module name validation should be added.

v3/internal/templates/react-swc-ts/frontend/src/App.tsx.tmpl (1)

2-2: LGTM! Dynamic module binding correctly implemented.

The import path now uses the {{.GoModule}} template variable instead of the hardcoded "changeme" placeholder, enabling proper binding resolution when projects are initialized with custom Git URLs.

v3/internal/templates/svelte/frontend/src/App.svelte.tmpl (1)

2-2: LGTM! Import path correctly templated.

The binding path now dynamically resolves to the correct Go module at generation time.

v3/internal/templates/vanilla-ts/frontend/src/main.ts.tmpl (1)

1-1: LGTM! Binding path correctly updated.

The dynamic module binding will resolve properly when the template is rendered.

v3/internal/templates/preact/frontend/src/app.jsx.tmpl (1)

2-2: LGTM! Template variable correctly applied.

The import path now uses {{.GoModule}} for dynamic binding resolution.

v3/internal/templates/vanilla/frontend/main.js.tmpl (1)

1-1: LGTM! Correct relative path for frontend root.

The import uses ./bindings/ (not ../bindings/) which is appropriate since this file is in the frontend/ root directory rather than frontend/src/.

v3/internal/templates/qwik-ts/frontend/src/app.tsx.tmpl (1)

2-2: LGTM! Binding path templated correctly.

Consistent with other framework templates in using {{.GoModule}} for dynamic module resolution.

v3/internal/templates/react-ts/frontend/src/App.tsx.tmpl (1)

2-2: LGTM! Dynamic binding correctly implemented.

The template now properly resolves the Go module binding at generation time.

v3/internal/templates/preact-ts/frontend/src/app.tsx.tmpl (1)

2-2: LGTM! Import path correctly updated.

Verification confirms that {{.GoModule}} is properly defined in the TemplateOptions struct, consistently populated during template rendering, and used across 22 template files. All frontend templates now correctly reference dynamic module bindings instead of hardcoded values.

v3/internal/templates/react/frontend/src/App.jsx.tmpl (1)

2-2: LGTM! Import path correctly updated to use dynamic module.

The change from hardcoded "changeme" to {{.GoModule}} resolves the binding reference issue described in the PR objectives.

v3/internal/templates/sveltekit-ts/frontend/src/routes/+page.svelte.tmpl (1)

2-2: LGTM! Import path correctly updated with appropriate relative depth.

The use of ../../bindings/{{.GoModule}} is correct for this file's location in src/routes/.

v3/internal/templates/lit-ts/frontend/src/my-element.ts.tmpl (1)

3-3: LGTM! Import path correctly updated.

The dynamic {{.GoModule}} placeholder will resolve to the correct binding path at template generation time.

v3/internal/templates/svelte-ts/frontend/src/App.svelte.tmpl (1)

2-2: LGTM! Import path correctly updated.

The change is consistent with other frontend templates in this PR.

v3/internal/templates/lit/frontend/src/my-element.js.tmpl (1)

2-2: LGTM! Import path correctly updated.

v3/internal/templates/solid/frontend/src/App.jsx.tmpl (1)

2-2: LGTM! Import path correctly updated.

v3/internal/templates/templates.go (2)

78-78: LGTM! New field enables dynamic module binding resolution.

The GoModule field allows templates to reference the correct binding path, solving the core issue described in the PR objectives.


262-269: LGTM! Correct fallback logic for module name derivation.

The logic appropriately derives the module name from the Git URL when available, falling back to the project name otherwise.

v3/internal/templates/vue-ts/frontend/src/components/HelloWorld.vue.tmpl (1)

3-3: LGTM! Import path correctly updated.

The change to ../../bindings/{{.GoModule}} is correct for this file's location.

v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl (2)

3-3: LGTM! Import path correctly uses template variable.

The change from hardcoded "changeme" to {{.GoModule}} fixes the bindings reference issue described in the PR objectives. This ensures generated projects use the correct module path from the start.


35-47: LGTM! Vue template syntax correctly escaped for Go template processing.

The escaped curly braces (\{\{ \}\}) are necessary to prevent Go's template engine from interpreting Vue's interpolation syntax. During generation, \{\{ msg \}\} becomes {{ msg }} in the final Vue component, which Vue then processes correctly at runtime.

<div><p>\{\{ time \}\}</p></div>
</div>
</template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove stray character at end of file.

The "∑" character appears to be unintentional and should be removed.

Apply this diff:

 </template>
-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
</template>
🤖 Prompt for AI Agents
In v3/internal/templates/vue-ts/frontend/src/components/HelloWorld.vue.tmpl
around line 48, there is a stray "∑" character at the end of the file; remove
that character and ensure the file ends cleanly (no unintended characters) and
preferably ends with a single newline.

@@ -1,6 +1,6 @@
<script setup>
©<script setup>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Remove stray "©" character before <script setup>.

The "©" character will break Vue's Single File Component syntax, causing parse errors during frontend builds.

Apply this diff to fix:

-©<script setup>
+<script setup>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
©<script setup>
<script setup>
🤖 Prompt for AI Agents
In v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl around
lines 1 to 1, there is a stray "©" character immediately before the opening
"<script setup>" tag which breaks Vue SFC parsing; remove the leading "©" so the
file begins directly with "<script setup>" (no extra characters or whitespace
before the tag) and save the template.

@tmclane tmclane force-pushed the travis-v3-alpha-bugfix/bindings-reference branch from 4a05f66 to 007adab Compare November 6, 2025 19:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl (1)

1-1: Critical: The stray "©" character must be removed.

This issue was previously flagged and remains unresolved. The "©" character before <script setup> will cause Vue SFC parse errors and break frontend builds.

Apply this diff:

-©<script setup>
+<script setup>
🧹 Nitpick comments (1)
v3/internal/templates/templates_test.go (1)

5-5: Consider renaming test function for consistency.

The test function name Test_GitURLToModuleName still references the old exported function name, but now tests the unexported gitURLToModuleName function. Consider renaming to Test_gitURLToModuleName or TestGitURLToModuleName for better alignment with the tested function.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a05f66 and 007adab.

📒 Files selected for processing (4)
  • v3/UNRELEASED_CHANGELOG.md (2 hunks)
  • v3/internal/templates/templates_test.go (2 hunks)
  • v3/internal/templates/vue-ts/frontend/src/components/HelloWorld.vue.tmpl (3 hunks)
  • v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • v3/internal/templates/vue-ts/frontend/src/components/HelloWorld.vue.tmpl
  • v3/UNRELEASED_CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (3)
v3/internal/templates/vue/frontend/src/components/HelloWorld.vue.tmpl (2)

3-3: LGTM: Import path fix correctly addresses the PR objective.

The change from hardcoded changeme to the templated {{.GoModule}} ensures that bindings are correctly referenced based on the actual Go module path when -git is provided during wails3 init.


35-47: LGTM: Vue template interpolations are correctly escaped.

The Go template escaping ({{"{{"}} / {{"}}"}})) properly preserves Vue's mustache syntax in the generated output, ensuring that {{ msg }}, {{ result }}, and {{ time }} render correctly in the final Vue component.

v3/internal/templates/templates_test.go (1)

1-1: LGTM: Package name correctly updated.

The package declaration change from commands to templates correctly reflects the relocation of the test to align with the internal gitURLToModuleName function now residing in the templates package.

@tmclane tmclane marked this pull request as draft November 7, 2025 21:08
@tmclane
Copy link
Member Author

tmclane commented Nov 7, 2025

Until I get full testing in here I am converting it to 'draft'.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
59.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Documentation Improvements or additions to documentation templates v3-alpha

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants