Skip to content

Commit 193984e

Browse files
authored
Merge branch 'v3-alpha' into v3-update-templates
2 parents 6629ed9 + 20e050b commit 193984e

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

docs/src/content/docs/changelog.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
- `wails3 generate template` command by [@leaanthony](https://github.com/leaanthony)
3737
- `wails3 releasenotes` command by [@leaanthony](https://github.com/leaanthony)
3838
- `wails3 update cli` command by [@leaanthony](https://github.com/leaanthony)
39+
- `-clean` option for `wails3 generate bindings` command by [@leaanthony](https://github.com/leaanthony)
3940
- Allow for aarch64 (arm64) AppImage Linux builds by [@AkshayKalose](https://github.com/AkshayKalose) in [#3981](https://github.com/wailsapp/wails/pull/3981)
4041

4142
### Fixed
@@ -54,9 +55,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5455
- Fix event handling by [@leaanthony](https://github.com/leaanthony)
5556
- Fixed window shutdown logic by [@leaanthony](https://github.com/leaanthony)
5657
- Common taskfile now defaults to generating Typescript bindings for Typescript templates by [@leaanthony](https://github.com/leaanthony)
58+
- Fix Close application on WM_CLOSE message when no windows are open/systray only by [@mmalcek](https://github.com/mmalcek) in [#3990](https://github.com/wailsapp/wails/pull/3990)
5759
- Fixed garble build by @5aaee9 in [#3192](https://github.com/wailsapp/wails/pull/3192)
5860
- Updated the minimum system version in macOS .plist files from 10.13.0 to 10.15.0 by [@AkshayKalose](https://github.com/AkshayKalose) in [#3981](https://github.com/wailsapp/wails/pull/3981)
5961

62+
6063
### Changed
6164

6265
- Moved build assets to platform specific directories by [@leaanthony](https://github.com/leaanthony)

docs/src/content/docs/guides/cli.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ wails3 generate bindings [flags] [patterns...]
144144
| `-dry` | Dry run | `false` |
145145
| `-silent` | Silent mode | `false` |
146146
| `-v` | Debug output | `false` |
147+
| `-clean` | Clean output directory | `false` |
147148

148149
### `generate build-assets`
149150
Generates build assets for your application.

v3/examples/file-association/build/Taskfile.common.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tasks:
4747
generates:
4848
- "frontend/bindings/**/*"
4949
cmds:
50-
- wails3 generate bindings -f '{{.BUILD_FLAGS}}'{{if .UseTypescript}} -ts{{end}}
50+
- wails3 generate bindings -f '{{.BUILD_FLAGS}}' -clean=true {{if .UseTypescript}} -ts{{end}}
5151

5252
generate:icons:
5353
summary: Generates Windows `.ico` and Mac `.icns` files from an image

v3/internal/commands/bindings.go

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package commands
33
import (
44
"errors"
55
"fmt"
6+
"os"
67
"path/filepath"
78

89
"github.com/pterm/pterm"
@@ -37,6 +38,13 @@ func GenerateBindings(options *flags.GenerateBindingsOptions, patterns []string)
3738
return err
3839
}
3940

41+
// Clean the output directory if clean option is enabled
42+
if options.Clean {
43+
if err := os.RemoveAll(absPath); err != nil {
44+
return fmt.Errorf("failed to clean output directory: %w", err)
45+
}
46+
}
47+
4048
// Initialise file creator.
4149
var creator config.FileCreator
4250
if !options.DryRun {

v3/internal/commands/build_assets/Taskfile.tmpl.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ tasks:
4747
generates:
4848
- "frontend/bindings/**/*"
4949
cmds:
50-
- wails3 generate bindings -f {{ "'{{.BUILD_FLAGS}}'" }} {{if .Typescript}} -ts{{end}}
50+
- wails3 generate bindings -f {{ "'{{.BUILD_FLAGS}}'" }} -clean=true {{if .Typescript}} -ts{{end}}
51+
5152
generate:icons:
5253
summary: Generates Windows `.ico` and Mac `.icns` files from an image
5354
dir: build

v3/internal/flags/bindings.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type GenerateBindingsOptions struct {
2121
DryRun bool `name:"dry" description:"Do not write output files"`
2222
Silent bool `name:"silent" description:"Silent mode"`
2323
Verbose bool `name:"v" description:"Enable debug output"`
24+
Clean bool `name:"clean" description:"Clean output directory before generation" default:"true"`
2425
}
2526

2627
var ErrUnmatchedQuote = errors.New("build flags contain an unmatched quote")

v3/pkg/application/application_windows.go

+5
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,13 @@ func (m *windowsApp) wndProc(hwnd w32.HWND, msg uint32, wParam, lParam uintptr)
205205
}
206206
}
207207

208+
// Handle the main thread window
209+
// Quit the application if requested
208210
// Reprocess and cache screens when display settings change
209211
if hwnd == m.mainThreadWindowHWND {
212+
if msg == w32.WM_ENDSESSION || msg == w32.WM_DESTROY || msg == w32.WM_CLOSE {
213+
globalApplication.Quit()
214+
}
210215
if msg == w32.WM_DISPLAYCHANGE || (msg == w32.WM_SETTINGCHANGE && wParam == w32.SPI_SETWORKAREA) {
211216
err := m.processAndCacheScreens()
212217
if err != nil {

0 commit comments

Comments
 (0)