Compare commits

..

573 commits

Author SHA1 Message Date
Lea Anthony
dd67cbefeb Perfect! I've successfully refactored the code to have a common jumplist.go file with all the shared structs and methods. This eliminates code duplication across platforms. Here's what the refactoring accomplished:
## Summary of Refactoring

### 1. **Common File** (`jumplist.go`)
- Contains all shared structs: `JumpListItemType`, `JumpListItem`, `JumpListCategory`, and `JumpList`
- Implements common methods: `AddCategory()`, `ClearCategories()`, and `Apply()`
- The `Apply()` method calls the platform-specific `applyPlatform()` method

### 2. **Platform-Specific Files**
- **Windows** (`jumplist_windows.go`): Contains only Windows-specific implementation
  - COM interface definitions and implementations
  - `CreateJumpList()` method for windowsApp
  - `applyPlatform()` method with the actual Windows jumplist logic
  
- **macOS** (`jumplist_darwin.go`): Minimal stub implementation
  - `CreateJumpList()` method for darwinApp
  - `applyPlatform()` method that returns nil (no-op)
  
- **Linux** (`jumplist_linux.go`): Minimal stub implementation
  - `CreateJumpList()` method for linuxApp
  - `applyPlatform()` method that returns nil (no-op)

### Benefits
- **No code duplication**: All common structs and logic are in one place
- **Cleaner platform files**: Platform-specific files only contain platform-specific code
- **Easier maintenance**: Changes to the API only need to be made in one place
- **Type safety**: The common interface ensures all platforms implement the required methods

The API remains exactly the same for users, but the implementation is now much cleaner and more maintainable.
2025-08-05 09:25:09 +10:00
Lea Anthony
6d4900a832 ## Summary
I've successfully implemented Windows Jumplists for Wails v3 with the following features:

### 1. **Windows Implementation** (`jumplist_windows.go`)
- Full COM interface implementation for ICustomDestinationList, IShellLink, IPropertyStore, and IObjectCollection
- Support for custom categories and tasks
- Runtime configuration capabilities
- Proper error handling and cleanup

### 2. **Cross-Platform Stubs**
- Created stub implementations for macOS (`jumplist_darwin.go`) and Linux (`jumplist_linux.go`)
- These are no-ops that prevent compilation errors on non-Windows platforms

### 3. **API Integration**
- Added `CreateJumpList()` method to the main App struct
- Platform-specific dispatch to the correct implementation

### 4. **Example Application**
- Created a complete example in `v3/examples/jumplist/`
- Demonstrates custom categories, tasks, and runtime configuration
- Includes comprehensive documentation

### Key Features:
- **Custom Categories**: Applications can create named categories like "Recent Documents"
- **Tasks**: Common application tasks that appear at the bottom of the jump list
- **Runtime Configuration**: Jump lists can be updated at any time during application execution
- **Cross-Platform Safe**: The API gracefully handles non-Windows platforms

### Usage Example:
```go
jumpList := app.CreateJumpList()
jumpList.AddCategory(application.JumpListCategory{
    Name: "Recent Files",
    Items: []application.JumpListItem{
        {
            Type:        application.JumpListItemTypeTask,
            Title:       "Document.txt",
            FilePath:    "path/to/app.exe",
            Arguments:   "--open Document.txt",
        },
    },
})
jumpList.Apply()
```

The implementation follows Windows jumplist specifications and integrates seamlessly with the existing Wails v3 architecture.
2025-08-05 09:20:19 +10:00
Lea Anthony
f28c9515ad
Update installation instructions 2023-11-02 20:53:59 +11:00
Travis McLane
c6ecbd56e5 [v3 examples/bindings] correct binding output + example
- disable output of `import <model> from models` line
- update README to generate bindings in usable location for HTML
- update HTML to reference bindings correctly
- update javascript to call and process the bound Greet function
2023-10-31 17:24:00 -05:00
Travis McLane
144567410d [v3 linux] disable noisy onKeyPressEvent handler 2023-10-31 17:22:36 -05:00
Travis McLane
1b850662ed [v3 example/bindings] enable DevTools 2023-10-31 17:15:16 -05:00
Travis McLane
c7c4cacc29 [v3 linux] auto-toggle devtools (if enabled) 2023-10-31 17:15:16 -05:00
Travis McLane
7e63355353 [v3 linux] correct type of window 2023-10-31 17:08:12 -05:00
Travis McLane
01652c7940 [v3 linux] update devtools behavior to match win/mac 2023-10-31 14:02:36 -05:00
Travis McLane
b379e3b0eb Revert "Merge branch 'linux-keycodes' into v3-alpha"
This reverts commit a2fde7f2c3, reversing
changes made to 985c5bf8e2.
2023-10-31 11:09:11 -05:00
Travis McLane
a2fde7f2c3 Merge branch 'linux-keycodes' into v3-alpha 2023-10-30 10:31:11 -05:00
Atterpac
2beb452207 Update changelog.md 2023-10-30 10:28:24 -05:00
Michael Capretta
73384a562b Add Linux Keycodes that match existing strings for keybinds 2023-10-30 10:27:21 -05:00
Lea Anthony
985c5bf8e2 [darwin] Support Ignore mouse events
[darwin] Support applicationSupportsSecureRestorableState
Update video example
2023-10-29 20:29:45 +11:00
Lea Anthony
daec8a9a64
Update installation instructions 2023-10-29 15:40:06 +11:00
Lea Anthony
f88a7a6f99
Update installation instructions 2023-10-29 15:34:12 +11:00
Lea Anthony
dc16d145c2
Update installation instructions 2023-10-29 15:31:26 +11:00
Lea Anthony
8432ddc2a8
Update installation instructions 2023-10-29 15:25:34 +11:00
Lea Anthony
d072393149
Add another CNAME file (thanks ghpages :/) 2023-10-29 10:03:33 +11:00
Lea Anthony
a8e95bf7f1
Add another CNAME file (thanks ghpages :/) 2023-10-29 09:57:38 +11:00
Lea Anthony
1735bdc9a2
Update roadmap link 2023-10-29 09:49:30 +11:00
Lea Anthony
f00685d592
Add CNAME 2023-10-29 09:48:37 +11:00
Lea Anthony
ee194f3e46
Update docs 2023-10-29 09:39:47 +11:00
Lea Anthony
82a9c5b1dd
Update docs 2023-10-28 17:26:29 +11:00
Lea Anthony
fdd8875986
Update docs 2023-10-28 15:54:42 +11:00
Lea Anthony
3b50e0cbc5
Update docs 2023-10-28 15:44:36 +11:00
Lea Anthony
fb7fda2256
Upgrade mkdocs 2023-10-28 12:22:21 +11:00
Lea Anthony
d9beb6126e
Add CNAME 2023-10-28 11:54:03 +11:00
Travis McLane
a81581129a [v3 linux] menu bitmap update handling 2023-10-27 16:45:10 -05:00
Travis McLane
e95a91861a [v3 linux] noop: cleanup 2023-10-27 16:45:10 -05:00
Travis McLane
fa5948f40e use windowId to avoid miscompilation 2023-10-27 15:46:25 -05:00
Travis McLane
ad4c8aacfb [v3 linux] keypress handling stubout 2023-10-27 14:41:22 -05:00
Travis McLane
afbc09f1e7 [v3 linux] menuItem.setBitmap support 2023-10-26 16:56:06 -05:00
Travis McLane
1a1e5b743a [v3 linux] dbus menu icon support 2023-10-26 16:56:06 -05:00
Lea Anthony
24853a7e3b
Add events README.md 2023-10-25 20:17:41 +11:00
Lea Anthony
1ce83913bd
Fix permissions build issues 2023-10-25 20:06:53 +11:00
Lea Anthony
1650e26da7
[windows] dnd fixes 2023-10-25 20:04:00 +11:00
Travis McLane
bc01fd8ea3 [v3 windows] hide go-webview2 from non-windows 2023-10-24 15:40:58 -05:00
Lea Anthony
3422c40e19
[windows] ignore mouse events 2023-10-23 20:58:55 +11:00
Lea Anthony
e661052c89
[windows] support permissions 2023-10-23 20:50:25 +11:00
Lea Anthony
ff08a5ca2b
[windows] html fullscreen support 2023-10-23 20:49:21 +11:00
5aaee9
f8250fb0d8
darwin: add event ApplicationShouldHandleReopen (#2991)
* darwin: add ApplicationShouldHandleReopen

* docs: update changelog with mr id

* events: update id

* feat: always return true

* Merge v3-alpha and regenerate events

* darwin: allow pass nsdirectory to processApplicationEvent

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-10-22 21:12:12 +11:00
Lea Anthony
d1c3f8af7a [darwin] Fix menu icon 2023-10-22 14:34:04 +11:00
Lea Anthony
36b4b3695b
Initial menu item bitmap support 2023-10-22 09:32:04 +11:00
Atterpac
fb17ec8064
Allow Wails3 Doctor recognize globally installed apt packages (#2972)
* Fixes doctor bug for apt package manager

* Actually fix it

* Pad the text " all" 

Adding a space to ensure checking against "all" doesn't always catch "install" or "not-installed" etc

* Update changelog.md

Doctor Apt Verify

---------

Co-authored-by: atterpac <michael@atterpac.dev>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-10-21 16:32:50 +11:00
Lea Anthony
51f52656cc
Update go-webview2 version 2023-10-21 12:02:19 +11:00
Travis McLane
18746c7819
V3 alpha linux dbus (#2996)
* [v3 linux/systray] dbus generation

* [v3 linux] systemtray dbus implementation

* [v3] add 'id' for MenuSeparator

This is needed in order to have a unique value for all
menuItem(s) such that the Linux implementation doesn't have to
generate new identifiers.
Allowing the reuse keeps a 1-1 mapping in place without any extra effort.

* [v3 example/systray] add radio group to example

* [v3 linux] stub out ExportStatusNotifierItem callbacks

Can only seem to get the `SecondaryActivate` to fire when doing a
3-finger click!  I was expecting a right-click interaction to trigger it.
2023-10-21 11:39:46 +11:00
Lea Anthony
8463c01123
[windows] Drag-n-drop support 2023-10-21 11:21:10 +11:00
Lea Anthony
8e0671306a
Mac examples + readme updated 2023-10-17 20:25:36 +11:00
Lea Anthony
131a6da554
Fix resize on windows 2023-10-16 19:29:42 +11:00
Lea Anthony
59273fcdab
Add basic hardware detection to wails doctor 2023-10-15 20:02:29 +11:00
Lea Anthony
7795a2a46f
Fix modifier processing on windows.
Move info logs to debug.
2023-10-15 13:53:31 +11:00
Lea Anthony
2269f64b0a
Fix build output name 2023-10-15 12:52:13 +11:00
Lea Anthony
439da97573
Fix go version 2023-10-15 12:48:11 +11:00
Lea Anthony
2b478a4608
More workflow improvements 2023-10-15 12:42:49 +11:00
Lea Anthony
3b95725f09
Try caching in workflow 2023-10-15 10:48:42 +11:00
Lea Anthony
3a23ad1382
Fix example building. Update workflow 2023-10-15 10:43:39 +11:00
Lea Anthony
61a7f1fba5
Reformat changelog 2023-10-15 09:33:48 +11:00
5aaee9
a8641672cd
[v3] fix deadlock when quit (#2982)
* fix: dead lock when quit

* docs: update changelog
2023-10-14 20:34:00 +11:00
Lea Anthony
320fc20461
Add example build test windows fix 2023-10-12 21:18:42 +11:00
Lea Anthony
69f05c39ec
Add example build test 2023-10-12 21:15:41 +11:00
Lea Anthony
e55ffedc35
Add example build test 2023-10-12 21:13:53 +11:00
Lea Anthony
0577fefd75
Remove Browser plugin. Update plugin example 2023-10-12 08:41:18 +11:00
Lea Anthony
02713670c9
Custom icon shows app icon 2023-10-11 21:29:40 +11:00
Lea Anthony
e6de878395
Move server plugin to experimental dir 2023-10-11 20:25:56 +11:00
Lea Anthony
4c75b288bb
Add BrowserOpenURL and BrowserOpenFile to App.
Better WML assets for demo
Fix dialog responses.
Add `wml-openurl`
Rename: data-wml -> wml
Fix Alpha Feedback URL
2023-10-11 20:23:59 +11:00
Travis McLane
263e1b527a [v3 linux] lower signal memory usage
- drop the gtkSignalHandlers map entirely (wasn't used)
- use 'uint' for mapping signal IDs to MenuItem
- store and retrieve the menuitem identifier to/from the menu item widget
2023-10-10 12:38:10 -05:00
Lea Anthony
3d88bf8795
Fix context menu issues.
Fix WindowID for requests on windows.
Add `Windows.ApplicationStarted` event
2023-10-10 21:48:47 +11:00
Lea Anthony
740b2b0979
Fix windows icon for about box.
Add NewRGBA and NewRGB methods.
Added README.md to all examples.
Add roadmap.md to docs
2023-10-09 20:56:19 +11:00
Lea Anthony
2b843fc12e
Update contextmenus/dev example 2023-10-09 17:38:46 +11:00
Lea Anthony
473cf1cae3
Update window example 2023-10-09 17:38:22 +11:00
Lea Anthony
65d4266400
Update systray example 2023-10-09 17:38:11 +11:00
Lea Anthony
8d5b86fff7
Update dialogs example 2023-10-09 17:38:03 +11:00
Lea Anthony
92843c8237
Update clipboard example 2023-10-09 17:37:50 +11:00
Lea Anthony
13b588b555
Update build example 2023-10-09 17:37:40 +11:00
Lea Anthony
839a9ff498
Update bindings example 2023-10-09 17:37:21 +11:00
Lea Anthony
ef8c16d773
Fix bindings help text 2023-10-09 17:36:58 +11:00
Lea Anthony
602fafafea
[windows] Better corner detection for frameless windows 2023-10-09 17:36:32 +11:00
Lea Anthony
83ed7fd2df
[windows] Fix production logger. Add alpha assets 2023-10-09 17:36:06 +11:00
Lea Anthony
f07e4093be
[windows] Don't show menu for frameless window 2023-10-09 17:35:28 +11:00
Lea Anthony
bf13afd895
[windows] Fix dialog icon 2023-10-09 17:34:56 +11:00
Lea Anthony
9ffc06d42e
Update Task to v3.31.0. Update deps. 2023-10-09 10:39:09 +11:00
Lea Anthony
ebe91ba11d [darwin] Disable listener caching. Run execJS on main thread. 2023-10-07 20:08:22 +11:00
Lea Anthony
48aef46f57 [darwin] Quick event fix 2023-10-07 12:28:50 +11:00
Lea Anthony
c77c823c3c Revert "[linux] Implement events"
This reverts commit 8ddd29d285.
2023-10-07 12:21:49 +11:00
Travis McLane
ccccea1e50 [v3] go mod tidy 2023-10-06 15:03:36 -05:00
Travis McLane
a6163849c6 [v3 linux] match windows transparency logic 2023-10-06 14:38:38 -05:00
Travis McLane
130aab3598 [v3 linux] systray stubout
slim down the printouts and fix compilation
2023-10-05 17:25:45 -05:00
Travis McLane
78b85ce0cc [v3 linux] systray not implemented 2023-10-05 14:04:13 -05:00
Travis McLane
dbcf65b2d6 Revert "Merge branch 'v3-alpha-linux-systray' into v3-alpha"
This reverts commit 92b26488da, reversing
changes made to 1c48d567e1.
2023-10-05 08:34:12 -05:00
Lea Anthony
d8e27aa5f9
Fix svelte template 2023-10-05 21:12:01 +11:00
Lea Anthony
ce6d587771
Fix multiple window weirdness. Update deps 2023-10-05 20:54:12 +11:00
Lea Anthony
81d7bc2d68
Fix vue templates 2023-10-05 20:13:50 +11:00
Lea Anthony
a49350f300
[windows] Remove unused code. 2023-10-05 20:12:28 +11:00
Lea Anthony
9ac6359e56
Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha 2023-10-05 19:19:26 +11:00
Lea Anthony
5958d9c646
[windows] Serve assets async 2023-10-05 19:18:32 +11:00
Lea Anthony
9b88c8afda
Merge branch 'master' into v3-alpha
# Conflicts:
#	v2/internal/app/app_devtools.go
#	v2/internal/app/app_devtools_not.go
2023-10-04 20:23:23 +11:00
Lea Anthony
1b71fef89f
Update v3 website frontpage 2023-10-04 20:22:20 +11:00
Lea Anthony
8ddd29d285
[linux] Implement events 2023-10-03 08:37:11 +11:00
Lea Anthony
dc8cbcf410
[darwin] Refactor events into mac specific files 2023-10-03 08:33:58 +11:00
Travis McLane
757a4383e6 [v3] send dialog results over channels 2023-10-02 11:07:12 -05:00
Travis McLane
7c98ee329a [v3] move linux clipboard logic to linux_cgo 2023-10-02 11:07:12 -05:00
Lea Anthony
9d615463f4
[linux] support clipboard 2023-10-02 20:47:04 +11:00
Lea Anthony
aea0db5919
[linux] Fix packagemap 2023-09-30 21:17:30 +10:00
Lea Anthony
fc593d90cf
Export Package map 2023-09-30 21:09:35 +10:00
Lea Anthony
2524f7b5a0
Remove old KitchenSink example 2023-09-30 21:09:10 +10:00
Lea Anthony
5a0cb1baef
Fix svelte-ts template 2023-09-30 21:04:00 +10:00
Lea Anthony
255690eee0 [darwin] Add webview preferences 2023-09-30 15:23:56 +10:00
Lea Anthony
86b6e10620
[darwin]AlwaysOnTop: NSStatusWindowLevel -> NSFloatingWindowLevel 2023-09-30 14:27:48 +10:00
Travis McLane
b757292211 [v3 darwin] use NativeWindowHandle 2023-09-29 12:13:51 -05:00
Travis McLane
af54419a0b [v3] use concrete *WebviewWindow 2023-09-29 11:40:43 -05:00
Travis McLane
7b84b1c79c [v3] Window fallout 2023-09-28 17:17:11 -05:00
Travis McLane
d047c22526 [v3] change window back to *WebviewWindow 2023-09-28 17:10:17 -05:00
Travis McLane
6feab70a72 [v3 workflow] add libayatana dependency 2023-09-28 17:00:33 -05:00
Travis McLane
5e1b5ca4e8 [v3] typo - missing comma 2023-09-28 16:55:52 -05:00
Travis McLane
1726cdb0ad [v3] add ubuntu-latest to workflow 2023-09-28 16:48:23 -05:00
Travis McLane
2b2828ea41 [v3] goformat fixes 2023-09-28 16:47:04 -05:00
Travis McLane
29859ceedf [v3] correct return types for CurrentWindow
this shouldn't have been changed to Window
2023-09-28 16:46:19 -05:00
Travis McLane
8e2527ad35 [v3 linux] implement single_instance plugin 2023-09-28 15:53:28 -05:00
Travis McLane
92b26488da Merge branch 'v3-alpha-linux-systray' into v3-alpha 2023-09-28 14:52:12 -05:00
Travis McLane
efa67cb01c [v3 linux] systray implementation
Linux requires a `gtk_menu_bar` for a gtk_window to display a menu.
For the `systray` a `gtk_menu` is needed instead.
This change creates the correct type of `impl` for the `Menu`
depending on how it is being used.
2023-09-28 14:50:38 -05:00
Travis McLane
71fc222059 [v3 linux] systray: cleanup + add basic menu 2023-09-28 13:31:09 -05:00
Travis McLane
fa6adad4ab [v3 linux] wip: systray implementation 2023-09-28 13:31:09 -05:00
Travis McLane
1c48d567e1 [v3] NewWebviewWindow* return *WebviewWindow 2023-09-28 13:30:47 -05:00
Travis McLane
2c3216ba36 Merge branch 'v3-alpha-plugin-server' into v3-alpha 2023-09-28 12:15:11 -05:00
Travis McLane
74e2a7e225 [v3 examples] add server plugin to 'plugins' example 2023-09-28 12:14:54 -05:00
Travis McLane
ff2c92451d [v3] go.* update 2023-09-28 12:14:54 -05:00
Travis McLane
2a83402d4a [v3 example/server] initial implementation 2023-09-28 12:14:54 -05:00
Travis McLane
2449b473c0 [v3 plugin/server] initial implementation 2023-09-28 12:14:54 -05:00
Travis McLane
60c44c44ff [v3 runtime] updated javascript 2023-09-28 12:14:54 -05:00
Travis McLane
7e1d685167 [v3 js] add and send x-wails-client-id
The constant x-wails-client-id is generated once on startup and then
sent with each request to the Wails host.  It is used primarily by
the server plugin to distinguish different remote sessions.
2023-09-28 12:14:54 -05:00
Travis McLane
a9d4a393ba [v3 linux] add non-functional activeInstance implementation 2023-09-28 12:10:17 -05:00
Travis McLane
a0953fea93 [v3] Merge feature Window interface 2023-09-28 11:52:23 -05:00
Travis McLane
02d76835c9 [v3 linux] noop: remove spurious print 2023-09-28 11:48:46 -05:00
Travis McLane
dfe03f1347 [v3] WailsEvent expose ToJSON 2023-09-28 11:39:44 -05:00
Travis McLane
c87489adf3 [v3] implement Window interface 2023-09-28 11:39:39 -05:00
Travis McLane
a428a730d5 [v3] define Window interface
Define an interface that all Window(s) need to define.
Currently copies the WebviewWindow public api
2023-09-28 11:37:48 -05:00
Travis McLane
7f7c642339 [v3 linux] systray.openMenu 2023-09-28 10:02:44 -05:00
Travis McLane
03b79e9a67 [v3 linux] noop: handleKeyEvent skeleton 2023-09-27 16:31:59 -05:00
Travis McLane
56b0fcebba [v3 linux] use ifdef for APPLICATION_DEFAULT_FLAGS 2023-09-27 09:53:53 -05:00
Lea Anthony
d9a5130311
Use prettier on docs source 2023-09-25 20:56:29 +10:00
Lea Anthony
4663a45e59
Add raw API docs 2023-09-25 20:50:53 +10:00
Lea Anthony
fb820bcdad
Add some more API docs. Small refactors. 2023-09-24 17:23:24 +10:00
Lea Anthony
31c167b412
Add some more API docs. 2023-09-24 17:03:42 +10:00
Lea Anthony
7cdab16ba9
Add API docs. Do small refactors 2023-09-24 08:57:40 +10:00
Lea Anthony
05262134ca [darwin] Add systray.OpenMenu 2023-09-21 19:24:30 +10:00
Lea Anthony
fe48b9d03d
[windows] Add systray.OpenMenu 2023-09-21 19:14:44 +10:00
Lea Anthony
013ec1d726
Fix compiler error. Add test. 2023-09-21 06:33:08 +10:00
Travis McLane
27b4a984d5 [v3] process pointer and non-pointer receiver functions 2023-09-20 15:09:15 -05:00
Travis McLane
d6b6111395 noop: import sort 2023-09-20 15:09:15 -05:00
Lea Anthony
af8ee6703e [darwin] Support keybindings 2023-09-20 21:34:50 +10:00
Lea Anthony
793191a479
Initial key binding support 2023-09-17 20:48:30 +10:00
Lea Anthony
efc86c1056
Delete wails binary 2023-09-16 15:00:20 +10:00
Lea Anthony
39d44d2644
Merge latest website changes 2023-09-16 14:58:24 +10:00
Lea Anthony
9584a2ce5a
Merge latest v2 changes 2023-09-16 14:56:23 +10:00
Lea Anthony
95b8ceb87a
Merge remote-tracking branch 'origin/master' into v3-alpha 2023-09-16 14:44:57 +10:00
ALMAS
37b99b9cb8
Update webview_window.go (#2912) 2023-09-16 07:20:49 +10:00
Lea Anthony
86354e9fc0 Support IsDarkMode in application event context. Fix bug with event mapping. 2023-09-15 20:10:09 +10:00
Lea Anthony
b49f135e31
Add context to application/common events 2023-09-15 17:12:35 +10:00
Travis McLane
fff266f50d [v3 linux] remove unused dialog callbacks
If it turns out these are needed in the future
we can add them back in then.
2023-09-13 13:12:22 -05:00
Travis McLane
7cfea7c22c [v3 linux] file/directory dialogs 2023-09-13 13:12:22 -05:00
Travis McLane
6141e5a8ce [linux v3] purego: updates
- file/directory chooser dialog logic
- add name + css so that menu isn't transparent
2023-09-13 13:12:22 -05:00
Lea Anthony
ed58949d24
try logging in goroutine 2023-09-13 16:47:14 +10:00
Lea Anthony
c1d85bd3d9
Add generate constants tool 2023-09-13 16:45:19 +10:00
Lea Anthony
8d3324465e
Revert flags change 2023-09-13 16:11:23 +10:00
Lea Anthony
8c72746edb
Update log plugin to have log levels. 2023-09-13 09:45:26 +10:00
Lea Anthony
ea3509d2e7
Add LogLevel application option. Update log plugin to have log levels. 2023-09-13 09:44:37 +10:00
Lea Anthony
bb3a0cc54f
Add WebviewWindow.IsFocused() 2023-09-13 08:57:20 +10:00
Travis McLane
d808654d99 [v3 linux] update purego replace 2023-09-11 17:27:21 -05:00
Travis McLane
a6cfdbb403 [v3 linux] const -> var 2023-09-11 17:26:59 -05:00
Travis McLane
2f7c6834d0 [v3 linux] use invokeSync 2023-09-11 17:12:57 -05:00
Travis McLane
ebdd57a7c4 remove cmd/wails/wails binary 2023-09-11 17:12:57 -05:00
Lea Anthony
4ff6d74054
Remove plain template 2023-09-09 20:08:26 +10:00
Lea Anthony
0d8b4aafd5
Better vanilla taskfile. Better asset generation at init. 2023-09-09 17:31:48 +10:00
Lea Anthony
0cca7e9189
Fix syso tests. Add precommit task 2023-09-09 16:27:51 +10:00
Lea Anthony
a5812578c5
Add generate build-assets. Update Taskfile for vanilla template 2023-09-09 10:25:56 +10:00
Lea Anthony
350b411afe
Update what's new section 2023-09-08 20:18:50 +10:00
Lea Anthony
9ca86c6093
Fix template versions 2023-09-08 18:51:39 +10:00
Lea Anthony
01729ae22a
Add what's new section 2023-09-08 18:45:42 +10:00
Lea Anthony
9196dc2216
Remove ci flag 2023-09-08 14:49:50 +10:00
Lea Anthony
b925335bbb
Fix tests 2023-09-08 14:37:07 +10:00
Lea Anthony
965f939967
Fix parser/generator tests 2023-09-08 12:03:55 +10:00
Lea Anthony
00feccbb77
Add MACOSX_DEPLOYMENT_TARGET to taskfiles 2023-09-08 11:23:38 +10:00
Lea Anthony
b6fc66ba0d
Improve workflow 2023-09-08 11:09:32 +10:00
Lea Anthony
c40debc0e9
Disable linux tests 2023-09-08 11:04:59 +10:00
Lea Anthony
3b31d70865
Update doc dependencies 2023-09-08 11:00:15 +10:00
Lea Anthony
afa8b62de7
Update doc dependencies 2023-09-08 10:57:47 +10:00
Lea Anthony
70fd15de2d
fix workflow 2023-09-08 10:42:13 +10:00
Lea Anthony
c54d330f89
fix workflow 2023-09-08 10:39:29 +10:00
Lea Anthony
4028560d12
fix workflow 2023-09-08 10:37:45 +10:00
Lea Anthony
3c28c28623
fix workflow 2023-09-08 10:36:48 +10:00
Lea Anthony
a958fa06e7
Update docs 2023-09-08 10:31:16 +10:00
Lea Anthony
4d39e9e15a
Update v3-docs.yml 2023-09-08 10:27:32 +10:00
Lea Anthony
679ec49e64
add v3 docs workflow 2023-09-08 10:24:01 +10:00
Travis McLane
d98e1d3693 [v3 linux] Packagemap -> packagemap 2023-09-07 12:16:20 -05:00
Lea Anthony
be3b7d754e
add netlify config 2023-09-07 21:55:45 +10:00
Lea Anthony
ae524c4f84
add workflow for v3 alpha 2023-09-07 21:37:50 +10:00
Lea Anthony
d390cac8db
Fix EnableFraudulentWebsiteWarnings for mac 2023-09-07 21:33:11 +10:00
Lea Anthony
17e20ab029
[v3] Fix requirements.txt 2023-09-07 07:52:18 +10:00
Lea Anthony
34b9b9b508
Add status table to docs. 2023-09-06 20:59:45 +10:00
Lea Anthony
47fd06a445
More doc changes 2023-09-06 19:15:52 +10:00
Lea Anthony
b140ce546f Add CPU detection in mac 2023-09-05 23:14:18 +10:00
Lea Anthony
08ec2beb7c
Move menu to Windows window options. 2023-09-05 22:27:47 +10:00
Lea Anthony
5833f0f109
More docs. 2023-09-05 18:26:10 +10:00
Lea Anthony
eb2ad258ed
More docs. 2023-09-04 22:51:21 +10:00
ALMAS
708aef53e4
[v3] completing missing build tags (#2884)
* Update image.go

* Update popupmenu.go
2023-09-04 22:43:28 +10:00
Lea Anthony
e893c1c205
More docs. 2023-09-04 22:40:40 +10:00
Lea Anthony
3e74255127
Update docs. 2023-09-04 21:27:59 +10:00
Lea Anthony
b8d7eed607
Add awful CallByName method and update docs with warning. 2023-09-04 21:19:10 +10:00
Lea Anthony
8eb62fb483
Update bindings example 2023-09-04 21:01:00 +10:00
Lea Anthony
ee67bff9e3
Docs update 2023-09-04 20:50:32 +10:00
Lea Anthony
21e47dcccf
Fix version in debug build 2023-09-04 19:51:48 +10:00
Lea Anthony
38ddcf59f8
Support linux in doctor 2023-09-04 19:46:07 +10:00
Lea Anthony
4a62b6a5c7 Support Mac in wails doctor 2023-09-03 10:30:31 +10:00
Lea Anthony
6afbcb69f3
Improve doctor 2023-09-03 10:09:16 +10:00
Lea Anthony
4bb522d303
Add doctor. 2023-09-03 08:42:12 +10:00
Lea Anthony
f107173a73
Update README.md 2023-09-03 06:53:10 +10:00
Lea Anthony
eb5aff755f
Update docs 2023-09-02 15:12:35 +10:00
Lea Anthony
2384ae0819
Improve docs tooling 2023-09-02 09:10:35 +10:00
Lea Anthony
4a5663c1cb
Merge branch 'master' into v3-alpha 2023-09-02 08:38:48 +10:00
Travis McLane
9416e01042 [v3 linux] start_at_login initial implementation 2023-09-01 16:04:25 -05:00
Travis McLane
54fcacfed1 [v3 linux] correct transparency setting 2023-09-01 15:57:13 -05:00
Lea Anthony
69ac5caa4b
Fix production build 2023-09-01 22:06:43 +10:00
Lea Anthony
cecbc156d5
Update deps 2023-09-01 20:14:06 +10:00
Lea Anthony
8ca550cc9e
[v3] Add swipe gesture support 2023-08-30 20:57:12 +10:00
Lea Anthony
d44c8eba1c
[v3] Use system logger instead of println 2023-08-28 20:30:40 +10:00
Lea Anthony
6edd667bdf
[v3] Fix application runtime mappings 2023-08-28 20:29:25 +10:00
Vilsol
499ff50903
fix: use string formatting in gtk_message_dialog_new (#2865) 2023-08-28 19:34:24 +10:00
Lea Anthony
5e1f29eda3
[v3] Support //wails:methodID <uint32> directive in bound method comments. 2023-08-27 21:16:30 +10:00
Lea Anthony
e5571defb7
[v3] Support bound methodID aliases. Support []any for bindings generation. Use CallByID in bindings. 2023-08-27 20:39:35 +10:00
Lea Anthony
125d8a6f78
[v3] Update Task to v3.29.1. 2023-08-27 17:14:36 +10:00
Lea Anthony
21790dc3ee
[v3] Add CallByID method to runtime. 2023-08-27 16:59:18 +10:00
Lea Anthony
cdf48e0589
[v3] Fix bindings 2023-08-27 15:54:01 +10:00
Travis McLane
2f9f63771b [v3 examples] add README 2023-08-25 09:39:24 -05:00
Lea Anthony
93335b3843
[v3] Support ANSI label on Mac. Update example. 2023-08-25 06:53:08 +10:00
Travis McLane
f50c8f447e [v3 assetserver] cleanup logging
- remove type assertions
- update contentTypeSniffer to capture the status code
- move logic in ServeHTTP to serveHTTP
- wrap serveHTTP with ServeHTTP adding logging & duration calculation
2023-08-24 12:44:13 -05:00
Travis McLane
bd9f7deb98 [v3 linux] correct minimum zoom 2023-08-23 14:10:22 -05:00
Travis McLane
2171192934 [v3 linux] noop: remove println 2023-08-23 14:09:44 -05:00
Lea Anthony
3352ebef6e
[v3] Tidy up logging 2023-08-19 17:15:15 +10:00
Lea Anthony
2a51ddadfc
[v3] Tidy up plugin init 2023-08-19 17:09:38 +10:00
Lea Anthony
0745aea4d6
[v3] Move to integer call ids for bound methods. 2023-08-19 14:25:36 +10:00
Travis McLane
4804b34208
[v3 linux] api changes (#2830) 2023-08-19 06:12:34 +10:00
Lea Anthony
841289f1d1
[v3 windows] Support isDarkMode. Add common application event mapping 2023-08-18 19:50:57 +10:00
Lea Anthony
c367ef461e
[v3 windows] Support isDarkMode 2023-08-18 19:45:59 +10:00
Lea Anthony
ffed41553a [v3 mac] Add IsDarkMode to application and JS runtime. Add Common.ThemeChanged event 2023-08-18 17:36:14 +10:00
Lea Anthony
79deb37675
Fix return code in logging 2023-08-18 11:15:02 +10:00
Lea Anthony
77ca8fe9e6
Move webview2 options to application. Improve logging. 2023-08-18 11:06:25 +10:00
Lea Anthony
25e58edf28 [v3] Add dev example 2023-08-18 10:51:02 +10:00
Lea Anthony
0f2d19c56e Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha
# Conflicts:
#	v3/internal/operatingsystem/os.go
#	v3/internal/operatingsystem/os_darwin.go
2023-08-18 10:36:01 +10:00
Lea Anthony
8bde3d7522 [v3 mac] Improved operating system detection 2023-08-18 10:34:32 +10:00
Lea Anthony
c169d26d95 [v3] Port operating system detection 2023-08-18 10:24:45 +10:00
Lea Anthony
946a4c56a0 [v3 mac] Better logging 2023-08-18 09:58:43 +10:00
Lea Anthony
23e87e0ad7
Add dev tasks to Taskfile template 2023-08-15 21:48:04 +10:00
Lea Anthony
7d678154c6
Example prod/debug options 2023-08-15 21:40:50 +10:00
Lea Anthony
0b9fec3f87
Add checkport tool for checking open ports 2023-08-15 21:40:01 +10:00
Lea Anthony
763c7708f4
Fix HMR. Better logging. 2023-08-15 20:19:02 +10:00
Lea Anthony
5f2c1f4534
Remove optional prod options - use build tags instead 2023-08-15 20:19:02 +10:00
Lea Anthony
3ac557ccb1
[v3] plugin.toml -> plugin.yaml 2023-08-15 06:39:55 +10:00
Lea Anthony
e6c691a376
Support external asset server 2023-08-14 20:49:09 +10:00
Lea Anthony
ee8eb001c2
Merge branch 'master' into v3-alpha
# Conflicts:
#	v2/internal/frontend/desktop/windows/go-webview2/webviewloader/env_create.go
2023-08-14 18:08:52 +10:00
Lea Anthony
db836b7a48
Move assetserver to internal 2023-08-14 08:31:55 +10:00
Lea Anthony
543b18dd54
Revert v3 changes in v2 asset server 2023-08-14 08:28:32 +10:00
Lea Anthony
ec0731d5d8
Use slog.Logged in assethandler_external.go. Refactor runtime handler. 2023-08-14 08:28:31 +10:00
Lea Anthony
cc5c7d1d29
Log git hash if using replaced module 2023-08-14 08:28:25 +10:00
Lea Anthony
e79c1b7ea3 Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha 2023-08-13 20:43:07 +10:00
Lea Anthony
6cbead5bfe
Improved logging++ 2023-08-13 16:52:39 +10:00
Lea Anthony
429bb2bf17
Refactor application creation. Remove internal logger package. 2023-08-13 15:28:30 +10:00
Lea Anthony
c03c41cb21
Add version command 2023-08-13 15:13:01 +10:00
Lea Anthony
ee29faecbf
Log if native Go webview loader is used 2023-08-12 16:36:08 +10:00
Lea Anthony
d1d0105276
Remove jsonBindings option. Only add ipc in debug mode. 2023-08-12 14:57:01 +10:00
Lea Anthony
1059e36b52
Run go mod tidy on project creation. Use better method of relative module location. 2023-08-12 14:32:52 +10:00
Lea Anthony
15f602f867
Move v2 assetserver to v3 2023-08-12 14:16:53 +10:00
Lea Anthony
13be4a333f
Move to slog logger for application and log plugin 2023-08-10 22:04:13 +10:00
Lea Anthony
2553fa1f74
Update templates to use Go 1.21 2023-08-10 21:32:18 +10:00
Lea Anthony
f0f5011484
Remove log from runtime (there's a plugin for that) 2023-08-10 21:29:42 +10:00
Lea Anthony
5671f3527b
Add ProductionOverrides option so any option can be overridden in production builds 2023-08-10 20:42:25 +10:00
Lea Anthony
adb26fa99f
Add Hook doc 2023-08-10 19:57:12 +10:00
Lea Anthony
805429a7c6
Support remote templates 2023-08-09 21:53:10 +10:00
Lea Anthony
39af86e59d
Improve project creation.
Add `template.json` to templates.
Update dependencies.
2023-08-09 21:30:06 +10:00
Lea Anthony
ecf970d6fe [v3 mac] ANSI systray label [WIP] 2023-08-05 14:04:49 +10:00
Lea Anthony
c9ce17a4d5
[v3] Fix Assets options in templates 2023-07-21 08:24:38 +10:00
stffabi
a6e279f0d3 [v3 panicHandler] Let the default go panic handler handle the panic if there's no panicHandler set in options 2023-07-15 23:57:19 +02:00
stffabi
842bc3733e [v3 windows] Fix missing panic stacktraces during message loop 2023-07-15 23:56:26 +02:00
Lea Anthony
5e76a5e76a [v3 mac] Fix event callback signatures 2023-07-12 21:29:01 +10:00
Lea Anthony
52c3c49f25
[v3] Add window close hook example 2023-07-12 21:27:58 +10:00
Lea Anthony
705239ad7d
[v3] Use WindowEvent rather than WindowEventContext 2023-07-12 20:50:01 +10:00
Lea Anthony
dc865404a9
[v3] Initial hooks implementation 2023-07-12 20:31:13 +10:00
Lea Anthony
ba7ab2e607
[v3 windows] Fix translucency. Update example. 2023-07-11 23:04:22 +10:00
Lea Anthony
d6cfe4414d
[v3 Windows] Add WebviewWindow.Flash() 2023-07-11 20:10:18 +10:00
Lea Anthony
ecbb135949
[v3] Update plugin.js 2023-07-10 20:56:07 +10:00
Lea Anthony
fcb98e6523
[v3] Update docs 2023-07-10 20:46:08 +10:00
Lea Anthony
e7e5597c95 [v3 mac] Fix right click. Slight refactor. 2023-07-10 20:44:30 +10:00
Lea Anthony
7f0479d8b4 [v3 mac] Fix right click menu when window attached. 2023-07-10 20:21:19 +10:00
Lea Anthony
f5c78f365d
[v3] Fix oauth bug. Added logout capability 2023-07-09 20:13:29 +10:00
Lea Anthony
1fc5f9b12d
[v3] Update readme for oauth plugin 2023-07-09 12:33:57 +10:00
Lea Anthony
3f55ce6dfc
[v3] Add provider methods, provide default login window, update readme for oauth plugin 2023-07-09 12:30:36 +10:00
Lea Anthony
1d562d3c27
[v3] Add oauth plugin 2023-07-08 22:56:25 +10:00
Lea Anthony
f3974deb88
[v3] Add Get for application instance 2023-07-08 22:51:33 +10:00
Lea Anthony
1945616328
[v3 windows] Fix WindowClose defaults 2023-07-08 20:28:19 +10:00
Lea Anthony
7db6604227
[v3 windows] Add HideOnTaskbar flag to WebviewWindow 2023-07-08 11:27:36 +10:00
Lea Anthony
12ce6c5ac3
[v3] Add systray.AttachWindow 2023-07-06 20:43:08 +10:00
Lea Anthony
5d9bc4ca81 [v3 mac] Fix systray example toggle 2023-07-05 21:09:48 +10:00
Lea Anthony
c0b4a3ff35
[v3] Fix generation of common events 2023-07-05 20:39:35 +10:00
Lea Anthony
f0bf8cd827
[v3 windows] Refactor events + mappings. Fix app.Quit(). Make systray example work slightly better 2023-07-05 20:35:45 +10:00
Lea Anthony
10144adf61
[v3 windows] Fix window lose focus events. 2023-07-04 20:43:21 +10:00
Lea Anthony
3efab5ba23
[v3 windows] Prevent window close events when the window was just opened 2023-07-04 20:01:06 +10:00
Lea Anthony
3d323ab9d2 [v3] Fix systray example. PositionWindow now takes an offset. EventApplicationDidResignActive -> EventApplicationDidResignActiveNotification 2023-07-04 19:26:00 +10:00
Lea Anthony
16ce9e562f [v3 mac] Window alignment to systray 2023-07-03 20:15:45 +10:00
Lea Anthony
90e66a7ad4
[v3] Add PanicHandler application option. 2023-07-03 19:52:50 +10:00
Lea Anthony
6b59216b32
[v3] Better panic support for methods run on mainthread 2023-07-01 21:56:21 +10:00
Lea Anthony
9764ba6334
[v3] Add CHANGELOG.md. Add instructions for PRs in DEVELOPMENT.md. 2023-07-01 11:09:09 +10:00
Mohamed Gharib
da5929ff34
[v3] Fix examples background color (#2750) 2023-07-01 10:55:10 +10:00
Mohamed Gharib
e419822c77
[v3] Fix default context-menu in selected disabled inputs (#2753)
* [v3] Fix default context-menu in selected disabled inputs

* [v3] Update Task to v3.27.1. Add `wails3 task -version` and `wails3 task taskfile:update`.

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-07-01 10:52:55 +10:00
Lea Anthony
b62ce4440e
[v3 windows] Setup chromium sooner 2023-07-01 09:23:19 +10:00
Lea Anthony
3c81fb06e8
[v3 windows] Position window above systray 2023-06-30 21:17:50 +10:00
Lea Anthony
c27366a270
[v3] rename cli to wails3 2023-06-29 18:26:04 +10:00
Lea Anthony
5b6f6c1bff
[v3] Default context menu always shows in debug/dev 2023-06-28 18:47:39 +10:00
Lea Anthony
3fcac435b2
[v3] Support window events in JS. Fix ExecJS blocking issues. 2023-06-26 22:10:31 +10:00
Lea Anthony
03a3edcdc9
[v3] Create experimental plugin directory 2023-06-26 08:39:02 +10:00
Lea Anthony
5737b3cc7b [v3 mac] Fix merge issues 2023-06-25 10:13:20 +10:00
Lea Anthony
b898b79aaf
[v3 windows] Initial support for start_on_login plugin for windows 2023-06-24 21:12:24 +10:00
Lea Anthony
3827ca2d78
[v3] Move dialogs out of application 2023-06-24 13:57:51 +10:00
Lea Anthony
4de5e1b9f1
[v3] Add WindowUnFocus event 2023-06-24 13:23:50 +10:00
Travis McLane
eb18f02fd2 Merge branch 'v3-alpha-linux' into v3-alpha 2023-06-23 21:51:21 -05:00
Travis McLane
1a7d105917 [v3 linux] GetAbsolutePosition 2023-06-23 21:50:51 -05:00
Travis McLane
de5cff799e [v3 linux] setEnabled 2023-06-23 21:50:51 -05:00
Travis McLane
67cada78f6 [v3 linux] purego: windowGetRelativePosition 2023-06-23 21:50:51 -05:00
Travis McLane
5a40f25d03 [v3 linux] webview setAbsolutePosition 2023-06-23 21:50:51 -05:00
Travis McLane
1a09a8a4c8 [v3 linux/cgo] open/save file dialog stub 2023-06-23 21:50:51 -05:00
Travis McLane
daa0cf83d9 [v3 linux] noop: remove fmt.Println 2023-06-23 21:50:51 -05:00
Travis McLane
e92858f64d [v3 linux/purego] initial file/directory dialogs impl 2023-06-23 21:50:51 -05:00
Travis McLane
d52c26e82f [v3 linux] implement missing functions 2023-06-23 21:50:51 -05:00
Travis McLane
83900b03d4 [v3 linux] purego cleanup + dialog images 2023-06-23 21:50:51 -05:00
Travis McLane
c123430f22 [v3 linux] dialog fixes 2023-06-23 21:50:51 -05:00
Travis McLane
33e20cbc77 [v3 linux] allow menu setting on Linux 2023-06-23 21:50:51 -05:00
Travis McLane
e942312c4c [v3 menuitem] bug: avoid setting if nil 2023-06-23 21:50:51 -05:00
Travis McLane
de2e78b507 [v3 linux] purego implementation 2023-06-23 21:50:51 -05:00
Travis McLane
da4a7ac64b [v2] assetserver/webview purego implementation 2023-06-23 21:50:51 -05:00
Travis McLane
e44fbc26ba [v3 linux] STATUS.md 2023-06-23 21:50:51 -05:00
Travis McLane
bef454f950 [v3 linux] initial linux implementation 2023-06-23 21:50:51 -05:00
Travis McLane
94e1ec91ad Revert "Merge branch 'v3-alpha_linux' into v3-alpha"
This reverts commit b317efaf2c, reversing
changes made to 29b9c5200f.
2023-06-23 21:50:51 -05:00
Lea Anthony
56d11ab419
[v3] Update Wails API 2023-06-24 12:11:48 +10:00
Lea Anthony
c96cccab2e
[v3] Add Window AbsolutePosition/SetAbsolutePosition 2023-06-23 21:14:26 +10:00
Lea Anthony
989ef1b4a8
[v3] Update STATUS.md 2023-06-23 20:50:54 +10:00
Lea Anthony
45cfbe917e
[v3] Position/GetPosition -> RelativePosition/GetRelativePosition 2023-06-23 20:49:27 +10:00
Lea Anthony
2e313005e0
[v3] Add window attachment for open/save dialogs. Fix filter bug. 2023-06-23 20:33:35 +10:00
Lea Anthony
722c3a653c
[v3] Allow message dialogs to be attached to windows. JS dialogs default attached. wml confirm dialog attached. 2023-06-23 20:19:29 +10:00
Lea Anthony
76672facfe
[v3] Add window Enabled method. Fix dialog attachment 2023-06-23 19:48:04 +10:00
Lea Anthony
8f075b5d8d [v3] Fix merge issues 2023-06-22 19:56:35 +10:00
Lea Anthony
b317efaf2c Merge branch 'v3-alpha_linux' into v3-alpha
# Conflicts:
#	v3/STATUS.md
#	v3/examples/menu/main.go
#	v3/go.mod
#	v3/pkg/application/application.go
#	v3/pkg/application/webview_window.go
2023-06-22 19:46:10 +10:00
Lea Anthony
29b9c5200f
[v3] Update context menu example. Allow menu for disabled/read only iputs 2023-06-21 20:21:10 +10:00
Lea Anthony
4d2b4b4ee7
[v3] Update dev guide. Remove implLock. 2023-06-21 19:37:39 +10:00
Lea Anthony
9f8f095a78
[v3] Update dev guide. 2023-06-21 19:23:14 +10:00
Lea Anthony
59c09ebee1
[v3] Better default context menu. Started dev guide. 2023-06-21 19:21:41 +10:00
Lea Anthony
5f81a87912
[v3] Add smart context menu example 2023-06-20 21:35:41 +10:00
Lea Anthony
7f6151d573
[v3] Enable default context menu for certain elements. Use CSS to customise. 2023-06-20 21:11:37 +10:00
Lea Anthony
9816960995
[v3] Support "--default-contextmenu" style. Fix URL handling in Windows. 2023-06-20 19:44:01 +10:00
Lea Anthony
3355d5f0af
[v3] Add EnableDevTools option 2023-06-20 08:49:25 +10:00
Lea Anthony
ab38b20444
[v3] Status Update 2023-06-20 08:36:39 +10:00
Lea Anthony
f278229179 Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha 2023-06-20 08:12:42 +10:00
Lea Anthony
552390fb84 [v3 mac] Tidy up 2023-06-19 17:53:16 +10:00
Lea Anthony
68573cdc48
[v3 windows] Focus webview on Show/Restore/Maximise/FullScreen 2023-06-19 07:35:11 +10:00
Lea Anthony
cdf397aaa9 [v3 mac] Implement print() 2023-06-19 07:15:53 +10:00
Lea Anthony
ed27558011
[v3 windows] Add WebviewWindow.Print() 2023-06-18 17:13:07 +10:00
Lea Anthony
50387948df [v3 mac] Refactor drag to use common code 2023-06-18 12:24:44 +10:00
Lea Anthony
9b48cc1799 [v3 mac] Fix window drag example 2023-06-18 12:12:01 +10:00
Lea Anthony
86f2ac0e96 [v3 mac] Fix WindowShouldClose bug 2023-06-18 11:25:38 +10:00
Lea Anthony
1537a002cc
[v3] Add ShouldClose window method. Remove hideOnClose flag. 2023-06-18 11:12:53 +10:00
Lea Anthony
ae9b158b04
[v3 windows] improve main thread calls 2023-06-16 21:04:44 +10:00
Lea Anthony
72ec10b181 [v3 mac] Fix window close bug 2023-06-16 21:01:17 +10:00
Lea Anthony
eed4002a4a [v3 mac] Fix GetPosition Y coordinate 2023-06-16 20:54:53 +10:00
Lea Anthony
155e34c7a8 [v3 mac] Better main thread calls 2023-06-16 20:48:57 +10:00
Lea Anthony
22cc649e81
[v3 mac] translate window position for SetPosition 2023-06-16 20:20:18 +10:00
Lea Anthony
367ca745c3
[v3 windows] Fix frameless window drag. Add better resize for corners. 2023-06-15 21:06:14 +10:00
Lea Anthony
01e2e46e0d
[v3 windows] Support frameless drag. Add /wails/flags endpoint. 2023-06-15 19:08:08 +10:00
Lea Anthony
c03078ca16
[v3] Add capabilities, move to app-region css for drag, support native drag on Windows 2023-06-14 18:12:37 +10:00
Lea Anthony
49e62aebe3
[v3 windows] Support frameless drag 2023-06-13 17:44:07 +10:00
Lea Anthony
dc4daaebac
[v3 windows] Support title bar button events 2023-06-13 17:42:14 +10:00
stffabi
f855b30c9f [v3 windows] Consolidate WM_SIZE/WM_SIZING message handling 2023-06-12 08:26:09 +02:00
stffabi
b614e2b100 [v3 windows] An initially hidden window should show chromium when it is getting unhidden 2023-06-12 05:41:55 +02:00
stffabi
eafbbab233 [v3 windows] Do not Hide/Show chromium on every load of the frontend 2023-06-12 05:12:49 +02:00
Lea Anthony
72a4e9cf6e
[v3] Update STATUS.md 2023-06-12 10:46:31 +10:00
Lea Anthony
1dbe100a43
[v3] Restore window example 2023-06-12 10:45:26 +10:00
Lea Anthony
287d3d066c
[v3] Update WML demo to include restore 2023-06-12 10:45:03 +10:00
Lea Anthony
9387d18e88
[v3 windows] Change how chromium redraw works 2023-06-12 10:44:33 +10:00
Lea Anthony
1600bcb1d0
[v3] Add Restore to JS runtime 2023-06-12 10:44:05 +10:00
Lea Anthony
2b2defb7c0
[v3 windows] Fix chromium redraw bug 2023-06-12 10:28:35 +10:00
Lea Anthony
6d786902eb
[v3] Add some common window events 2023-06-12 10:27:30 +10:00
Lea Anthony
286ce206f0
[v3 windows] Prevent crash when nulls in strings 2023-06-12 09:10:47 +10:00
Lea Anthony
7535f098bd
[v3 windows] Fix clipboard example 2023-06-11 11:57:47 +10:00
Lea Anthony
b517461fbe
[v3 windows] Fix screen example 2023-06-11 11:54:32 +10:00
Lea Anthony
ffbe67e21f
[v3 windows] Fix clipboard js runtime call 2023-06-11 11:47:50 +10:00
Lea Anthony
833671d30c
[v3 windows] Add clipboard support 2023-06-10 13:01:10 +10:00
Lea Anthony
ae691b8e52
[v3 windows] Small icon updates 2023-06-10 10:19:33 +10:00
Lea Anthony
2b56b7b6b9
[v3] Update status and log plugin readme 2023-06-09 20:44:24 +10:00
Lea Anthony
81a5380f67
[v3 windows] Handle null result from callbacks. Call results should respond on main thread. 2023-06-09 20:34:11 +10:00
Lea Anthony
7c45e3ac13
[v3 mac] Fixed drag 2023-06-09 17:00:07 +10:00
Lea Anthony
d1932c36ce
Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha
# Conflicts:
#	v2/internal/app/app_dev.go
#	v3/STATUS.md
#	v3/Taskfile.yaml
#	v3/examples/binding/go.mod
#	v3/examples/binding/go.sum
#	v3/examples/menu/main.go
#	v3/examples/window/main.go
#	v3/go.mod
#	v3/go.sum
#	v3/pkg/application/application_windows.go
#	v3/pkg/application/dialogs_windows.go
#	v3/pkg/application/menuitem_windows.go
#	v3/pkg/application/options_webview_window.go
#	v3/pkg/application/options_win.go
#	v3/pkg/application/popupmenu_windows.go
#	v3/pkg/application/systemtray_windows.go
#	v3/pkg/application/webview_window.go
#	v3/pkg/application/webview_window_windows.go
#	v3/pkg/events/events.go
#	v3/pkg/events/events.txt
#	v3/pkg/w32/constants.go
#	v3/pkg/w32/popupmenu.go
#	v3/pkg/w32/screen.go
#	v3/pkg/w32/typedef.go
#	v3/pkg/w32/user32.go
#	website/src/pages/changelog.mdx
2023-06-07 08:19:25 +10:00
Lea Anthony
adb7ddf8d2
[v3] Update go mod for plugins examples 2023-06-06 21:07:28 +10:00
Lea Anthony
3b0a57ca6d
[v3 plugins] Support single-instance on Windows 2023-06-06 21:06:52 +10:00
Lea Anthony
4ee75e93c9
[v3] Improve examples 2023-06-06 20:41:28 +10:00
Lea Anthony
ff218e5323
[v3 windows] Support systray.Destroy() 2023-06-06 20:40:56 +10:00
Lea Anthony
df0969d1c6
[v3 windows] Support About box. Improve app menu handling. 2023-06-06 20:40:38 +10:00
Lea Anthony
23d7ac0e58
[v3 windows] Add MessageBoxIndirect 2023-06-06 20:39:24 +10:00
Lea Anthony
f9a87944cf
[v3] icons.ico -> icon.ico 2023-06-06 20:38:45 +10:00
Lea Anthony
eff456aa1a
[v3 windows] Improve systray locking 2023-06-06 20:38:01 +10:00
Lea Anthony
1ce07cd67c
[v3 windows] Update Taskfile in templates 2023-06-06 20:37:15 +10:00
Lea Anthony
fc7952ff3b
[v3 windows] Update examples. Add example table to STATUS.md 2023-06-05 20:34:52 +10:00
Lea Anthony
bb28bdf565
[v3 windows] Fix resize bug when using setSize 2023-06-05 20:33:45 +10:00
Lea Anthony
04d5842124
[v3 windows] Add package:windows task 2023-06-05 19:57:40 +10:00
Lea Anthony
1a12890556
[v3 windows] Add Webview2NavigationCompleted event. Support CSS + JS injection 2023-06-05 08:58:53 +10:00
Lea Anthony
d021d885ca
[v3 windows] Update STATUS.md 2023-06-04 14:08:27 +10:00
Lea Anthony
3433b8ce8f
[v3 windows] Support context menus 2023-06-04 14:05:19 +10:00
Lea Anthony
6092730acc
[v3 windows] Support Close and take into account HideOnClose option 2023-06-03 15:23:10 +10:00
Lea Anthony
ba4ffe4ecc
[v3 windows] Support devtools on startup 2023-06-03 15:19:38 +10:00
Lea Anthony
55b3e2d35a
[v3 windows] Update STATUS.md 2023-06-03 15:08:50 +10:00
Lea Anthony
6b926ec463
[v3 windows] Support setURL, execJS, reload, zoomIn/Out/Reset, get/setZoom, setHTML, 2023-06-03 15:03:26 +10:00
Lea Anthony
9b686b5417
[v3 windows] Support Application Menu, hiding menu items 2023-06-01 22:52:04 +10:00
Lea Anthony
82ec56bc7d
[v3 windows] Support GetScreens and GetPrimaryScreen 2023-06-01 22:52:03 +10:00
Lea Anthony
798e51d4d3
[v3 windows] Fix window ID processing 2023-06-01 22:52:02 +10:00
Lea Anthony
35c41552de
[v3 mac] Basic common event support. Taskfile refactor 2023-06-01 22:51:25 +10:00
Lea Anthony
19be7f61ac [v3 windows] Fix resizing. Add resize debouncing 2023-05-30 16:36:00 +08:00
Misite Bao
bbf0e8cdad chore: split Taskfile (#2654) 2023-05-30 16:35:59 +08:00
Lea Anthony
7e2d2a29a1 [v3 windows] Initial webview2 working 2023-05-30 16:33:34 +08:00
Lea Anthony
671dc2aa3a [v3 windows] Implement start x/y + parent window for dialogs 2023-05-30 16:33:34 +08:00
Lea Anthony
294a2c701e [v3] Update esbuild 2023-05-30 16:33:34 +08:00
Lea Anthony
01f03c552d [v3] Improve invoke 2023-05-30 16:33:33 +08:00
Lea Anthony
dc46154d94 [v3 mac] Support drag 2023-05-30 16:33:33 +08:00
Lea Anthony
87737c23eb [v3 mac] DisableWindowShadow -> DisableShadow 2023-05-30 16:33:33 +08:00
Lea Anthony
6e6f099a99 [v3 mac] Basic common event support. Taskfile refactor 2023-05-30 16:33:32 +08:00
Lea Anthony
4cb3321c39 [v3 mac] Update README 2023-05-30 16:32:02 +08:00
Lea Anthony
6a2343a1a0 [v3 mac] Add DisableWindowShadow option 2023-05-30 16:32:01 +08:00
Lea Anthony
f2d6dba2cf [v3 windows] initial dialog support. Refactor button callback name 2023-05-30 16:32:01 +08:00
stffabi
dd1ef7fae9 [v3 darwin] Add darwin identifier darwin only file 2023-05-30 16:32:01 +08:00
stffabi
527cff9ec3 [v3 darwin] Add darwin identifier to all C files of darwin 2023-05-30 16:32:00 +08:00
stffabi
ba150eccae [v3 windows] Add close handling: HideOnClose, QuitOnLastWindowClosed and DisableQuitOnLastWindowClosed 2023-05-30 16:32:00 +08:00
Travis McLane
fa74986f1e [v3 example] menu text toggle 2023-05-30 16:32:00 +08:00
Travis McLane
d1085b5bea [v3 example] add menuitem.Hidden / setHidden example 2023-05-30 16:31:59 +08:00
Travis McLane
4d0a14d2eb [v3 darwin] menuitem.setHidden implementation 2023-05-30 16:31:59 +08:00
Travis McLane
8c3439b733 [dialogs] remove default title
without this removal a user would have to call `SetTitle("")` in order to
erase the default if they desire a title-less dialog.
2023-05-30 16:31:59 +08:00
stffabi
a0534d527a [v3 application] Fix race conditions between starting a window/systray and starting the application
Make sure a window is never run before the windowCreated hooks have been executed.
2023-05-30 16:31:59 +08:00
Lea Anthony
a5b52f2795 [v3 windows] initial systray support 2023-05-30 16:31:58 +08:00
Lea Anthony
b526ebd679 [v3 mac] Update api. New template icon. 2023-05-30 16:31:58 +08:00
Lea Anthony
51b9315ae9 [v3 windows] update status 2023-05-30 16:31:58 +08:00
Lea Anthony
8edf44dc31 [v3 windows] New icons 2023-05-30 16:31:57 +08:00
Lea Anthony
9b7626e59e [v3 windows] Move icons to own package, systray dark mode icon, window.Focus(), 2023-05-30 16:31:57 +08:00
Lea Anthony
6dd092c7a9 [v3 windows] Rename systray callback handlers 2023-05-30 16:31:57 +08:00
Lea Anthony
46a0d467c0 [v3 windows] Dialogs to use invokeSync 2023-05-30 16:31:56 +08:00
Lea Anthony
e3b164ae93 [v3 windows] Systray callback handlers 2023-05-30 16:31:56 +08:00
stffabi
d8f58ab20f [v3 windows] Fix wndproc default case with WMMessageToString 2023-05-30 16:31:56 +08:00
stffabi
0de2bccd28 [v3 windows] Do not disable WndProc messaging for systray when updating icon 2023-05-30 16:31:55 +08:00
Lea Anthony
2eaf724710 [v3 windows] Fix systray icon size 2023-05-30 16:31:55 +08:00
Lea Anthony
58138ac09b [v3 windows] Initial systray support 2023-05-30 16:31:55 +08:00
Lea Anthony
143f090422 [v3] Use invokeSync for systray methods 2023-05-30 16:31:55 +08:00
Lea Anthony
f8f466ba7e [v3 windows] Support irregular shaped windows. Centered option. 2023-05-30 16:31:54 +08:00
Lea Anthony
cb28de47f8 [v3 windows] Support irregular shaped windows 2023-05-30 16:31:54 +08:00
stffabi
4ad2475ed6 [v3] Add some missing methods for darwin and windows 2023-05-30 16:31:54 +08:00
Travis McLane
0172078536 [w32] move windows specific code to impl file 2023-05-30 16:31:53 +08:00
Travis McLane
0bb1fb512a [w32] add missing build constraint 2023-05-30 16:31:53 +08:00
Lea Anthony
b6940d95a2 [v3 windows] Add frameless resize 2023-05-30 16:31:53 +08:00
stffabi
75f0457375 [v3 windows] Add HiDPI awareness 2023-05-30 16:31:52 +08:00
stffabi
ffe31b6265 [v3 windows] Add frameless support 2023-05-30 16:31:52 +08:00
Lea Anthony
8963610722 [v3 windows] Implement getScreen 2023-05-30 16:31:52 +08:00
Lea Anthony
66bfcf0e36 [v3] Ensure impl calls from WebvieWindow are on the main thread. Support size. 2023-05-30 16:31:52 +08:00
Lea Anthony
0b3559abfe [v3] Fix examples 2023-05-30 16:31:51 +08:00
Lea Anthony
773389ee5e [v3] Update examples to use correct options. 2023-05-30 16:31:51 +08:00
Lea Anthony
4c04991d4d [v3] Change WebviewWindow options to be a value, not a pointer. Support Un/Fullscreen. Remove main thread switching. Use parent options instead of local variables. 2023-05-30 16:31:51 +08:00
Lea Anthony
d56bb59b72 [v3 Windows] Support application hide/show. Add WebviewWindow.IsVisible(). 2023-05-30 16:31:50 +08:00
Lea Anthony
6e92a4f71e [v3 Windows] Support setMin/MaxSize, setPosition 2023-05-30 16:31:50 +08:00
Lea Anthony
1f6217c0d8 [v3 Windows] Add Support for SetTitle, Center, Un/Minimise/Maximise, IsMin/Maximised, IsNormal, Show/Hide 2023-05-30 16:31:50 +08:00
Lea Anthony
17204bebd0 [v3 Breaking Change] Add NativeWindowHandle method to WebviewWindow. 2023-05-30 16:31:49 +08:00
Lea Anthony
728e2019d8 [v3 windows] Moved w32 from internal to pkg so it may be used by applications 2023-05-30 16:31:49 +08:00
Lea Anthony
7f3fdd6977 [v3 windows] Add WndProcInterceptor for custom message processing 2023-05-30 16:31:49 +08:00
Lea Anthony
e8798f8371 [v3 windows] Rename options_windows.go -> options_win.go 2023-05-30 16:31:48 +08:00
Lea Anthony
402b743553 [v3 windows] Add APM Events 2023-05-30 16:31:48 +08:00
Lea Anthony
f08ae2fc62 [v3] Update application.On and window.On to return functions that unregister the listener. WebviewWindow.onApplicationEvent is a helper which will manage the unregistering for you on window destroy. 2023-05-30 16:31:48 +08:00
Lea Anthony
178ea9c8c5 [windows] Split out wndProc. Generate windows events, support per-window themes 2023-05-30 16:31:48 +08:00
Lea Anthony
7c63cee9e8 [windows] Support AlwaysOnTop, EnableResize at runtime. Added Solid/Transparent/Translucent options. 2023-05-30 16:31:47 +08:00
stffabi
4a60dfc373 [v3, windows] Add MainThread dispatching and fixes the blocking window 2023-05-30 16:31:47 +08:00
Lea Anthony
829a829cb4 [windows] WIP 2023-05-30 16:31:47 +08:00
Travis McLane
34896ccb4e [darwin] add getPrimaryScreen/getScreens to impl (#2618) 2023-05-30 16:31:46 +08:00
Lea Anthony
5df5eb6a04 Fix module path for non-modified repo 2023-05-30 16:31:46 +08:00
Lea Anthony
31ba36baf3 [windows] Initial commit 2023-05-30 16:31:46 +08:00
Lea Anthony
bf10f71760 [windows] Fix paths for wails init 2023-05-30 16:31:45 +08:00
Lea Anthony
8aa61fff6d Intial STATUS.md commit 2023-05-30 16:31:45 +08:00
Lea Anthony
f645b530da
[v3] Update esbuild 2023-05-19 07:58:25 +10:00
Lea Anthony
27573d191e [v3] Improve invoke 2023-05-18 19:18:20 +10:00
Lea Anthony
d6b4fdf979
[v3 mac] Support drag 2023-05-17 21:09:27 +10:00
Lea Anthony
39c834b83f
[v3 mac] DisableWindowShadow -> DisableShadow 2023-05-17 08:13:05 +10:00
Lea Anthony
f210357bfe
[v3 mac] Basic common event support. Taskfile refactor 2023-05-17 07:58:40 +10:00
Lea Anthony
3094c19cf3 [v3 mac] Update README 2023-05-16 18:00:17 +10:00
Lea Anthony
225437f1e8 [v3 mac] Add DisableWindowShadow option 2023-05-16 17:54:34 +10:00
Lea Anthony
a23bb1e350
[v3 windows] initial dialog support. Refactor button callback name 2023-05-12 20:56:22 +10:00
stffabi
2fbb21a84e [v3 darwin] Add darwin identifier darwin only file 2023-05-12 11:02:15 +02:00
stffabi
5c08fcb43e [v3 darwin] Add darwin identifier to all C files of darwin 2023-05-12 09:25:50 +02:00
stffabi
cc59655cb1 [v3 windows] Add close handling: HideOnClose, QuitOnLastWindowClosed and DisableQuitOnLastWindowClosed 2023-05-12 08:06:05 +02:00
Travis McLane
8ff0a2b0ff [v3 example] menu text toggle 2023-05-11 11:10:17 -05:00
Travis McLane
fe549af784 [v3 example] add menuitem.Hidden / setHidden example 2023-05-11 10:56:19 -05:00
Travis McLane
a4549c94c1 [v3 darwin] menuitem.setHidden implementation 2023-05-11 10:51:52 -05:00
Travis McLane
706256d3f0 [dialogs] remove default title
without this removal a user would have to call `SetTitle("")` in order to
erase the default if they desire a title-less dialog.
2023-05-11 08:54:38 -05:00
stffabi
3049773e7f [v3 application] Fix race conditions between starting a window/systray and starting the application
Make sure a window is never run before the windowCreated hooks have been executed.
2023-05-11 07:00:42 +02:00
Travis McLane
9da5df354e make it compilable again 2023-05-10 09:10:03 -05:00
Travis McLane
54ba6d47f4 Revert "[linux] dispatchOnMainThread"
This reverts commit 346517a185640aa40bc8710b815cf3e5ff7dc4a8.
2023-05-10 09:10:03 -05:00
Travis McLane
17647e2c2f [linux/cgo] hide/show implementation 2023-05-10 09:10:03 -05:00
Travis McLane
9da5cea88d [linux/cgo] bugfix 2023-05-10 09:10:03 -05:00
Travis McLane
3784746ddb [linux] STATUS.md 2023-05-10 09:10:03 -05:00
Travis McLane
281f6335c1 [linux] dispatchOnMainThread 2023-05-10 09:10:03 -05:00
Travis McLane
5129c0f4e2 [fixup] remove 'activate' 2023-05-10 09:10:03 -05:00
Travis McLane
5078e89a71 [darwin] implement isNormal 2023-05-10 09:10:03 -05:00
Travis McLane
41aef27631 [linux] use getNativeApplication 2023-05-10 09:10:03 -05:00
Travis McLane
754d0934bf [darwin] systray basic darkmode implementation 2023-05-10 09:10:03 -05:00
Travis McLane
be2d616190 [linux] getNativeApplication 2023-05-10 09:10:03 -05:00
Travis McLane
ba34e47c4b [linux/purego] updates 2023-05-10 09:10:03 -05:00
Travis McLane
a485b188b3 [linux/cgo] updates 2023-05-10 09:10:03 -05:00
Travis McLane
718e89ad1e [core/menu] prevent nil impl crash 2023-05-10 09:10:03 -05:00
Travis McLane
9453a60254 [linux] window registration + default menu 2023-05-10 09:10:03 -05:00
Travis McLane
f87ec9d401 [purego] 2023-05-10 09:10:03 -05:00
Travis McLane
cb1859a710 [cgo] registerWindow 2023-05-10 09:10:03 -05:00
Travis McLane
1ed95164db [purego] 2023-05-10 09:10:03 -05:00
Travis McLane
ac5d0e54f0 [purego] assethandler updates 2023-05-10 09:10:03 -05:00
Travis McLane
b1e79411e7 [examples] update label on click 2023-05-10 09:10:03 -05:00
Travis McLane
a9d834d715 [examples] update label on click 2023-05-10 09:10:03 -05:00
Travis McLane
68cfd130d3 [linux/cgo] initial implementation 2023-05-10 09:10:03 -05:00
Travis McLane
93a4b823c8 [linux/purego] initial port 2023-05-10 09:10:03 -05:00
Travis McLane
769662d77a [v2] assetserver/webview purego implementation 2023-05-10 09:10:03 -05:00
Lea Anthony
7fd627f169
[v3 windows] initial systray support 2023-05-10 19:35:40 +10:00
Lea Anthony
b91468b6f2 [v3 mac] Update api. New template icon. 2023-05-09 21:55:17 +10:00
Lea Anthony
0b9cd4be5d
[v3 windows] update status 2023-05-09 21:47:22 +10:00
Lea Anthony
4c587ee1b8
[v3 windows] New icons 2023-05-09 19:53:01 +10:00
Lea Anthony
19e1e8b8a6
[v3 windows] Move icons to own package, systray dark mode icon, window.Focus(), 2023-05-09 19:52:33 +10:00
Lea Anthony
67e9522c67
[v3 windows] Rename systray callback handlers 2023-05-08 20:16:25 +10:00
Lea Anthony
a829b38a34
[v3 windows] Dialogs to use invokeSync 2023-05-08 20:11:51 +10:00
Lea Anthony
c8dae94b5b
[v3 windows] Systray callback handlers 2023-05-08 19:43:58 +10:00
stffabi
87267758ac [v3 windows] Fix wndproc default case with WMMessageToString 2023-05-07 22:17:43 +02:00
stffabi
5f72df81fb [v3 windows] Do not disable WndProc messaging for systray when updating icon 2023-05-07 21:40:40 +02:00
Lea Anthony
1ed270fe05
[v3 windows] Fix systray icon size 2023-05-07 20:19:37 +10:00
Lea Anthony
19a654a2b1
[v3 windows] Initial systray support 2023-05-07 19:13:07 +10:00
Lea Anthony
f9bbc11711
[v3] Use invokeSync for systray methods 2023-05-07 10:34:08 +10:00
Lea Anthony
42b1807c36
[v3 windows] Support irregular shaped windows. Centered option. 2023-05-06 20:22:28 +10:00
Lea Anthony
647982de1a
[v3 windows] Support irregular shaped windows 2023-05-06 15:05:00 +10:00
Lea Anthony
f5557c612a
Merge remote-tracking branch 'origin/v3-alpha' into v3-alpha 2023-05-05 06:41:04 +10:00
stffabi
f4749db8b3 [v3] Add some missing methods for darwin and windows 2023-05-02 21:56:40 +02:00
Travis McLane
86a1de6788 [w32] move windows specific code to impl file 2023-05-02 10:52:21 -05:00
Travis McLane
792c5e2d95 [w32] add missing build constraint 2023-05-02 10:52:09 -05:00
Lea Anthony
6758580be9
[v3 windows] Add frameless resize 2023-05-02 23:18:22 +10:00
stffabi
6f246eed4a [v3 windows] Add HiDPI awareness 2023-05-02 09:45:21 +02:00
stffabi
fc3725d3f4 [v3 windows] Add frameless support 2023-05-02 09:29:47 +02:00
Lea Anthony
00c6f0dfdb
[v3 windows] Implement getScreen 2023-05-01 21:11:40 +10:00
Lea Anthony
cf7b4e2458
[v3] Ensure impl calls from WebvieWindow are on the main thread. Support size. 2023-05-01 20:28:46 +10:00
Lea Anthony
f682e44367
[v3] Fix examples 2023-05-01 18:24:24 +10:00
Lea Anthony
9d1f86c410
[v3] Update examples to use correct options. 2023-05-01 18:21:22 +10:00
Lea Anthony
dac281ac32
[v3] Change WebviewWindow options to be a value, not a pointer. Support Un/Fullscreen. Remove main thread switching. Use parent options instead of local variables. 2023-05-01 18:20:28 +10:00
Lea Anthony
29a58086a3
[v3 Windows] Support application hide/show. Add WebviewWindow.IsVisible(). 2023-05-01 11:34:06 +10:00
Lea Anthony
cb8eb755a7
[v3 Windows] Support setMin/MaxSize, setPosition 2023-05-01 10:52:46 +10:00
Lea Anthony
1e8fc29ee4
[v3 Windows] Add Support for SetTitle, Center, Un/Minimise/Maximise, IsMin/Maximised, IsNormal, Show/Hide 2023-04-30 20:55:51 +10:00
Lea Anthony
9a05b49e3d
[v3 Breaking Change] Add NativeWindowHandle method to WebviewWindow. 2023-04-30 10:17:03 +10:00
Lea Anthony
79f8d92084
[v3 windows] Moved w32 from internal to pkg so it may be used by applications 2023-04-30 10:02:00 +10:00
Lea Anthony
6e56542586
[v3 windows] Add WndProcInterceptor for custom message processing 2023-04-30 09:49:50 +10:00
Lea Anthony
c53443b62b
[v3 windows] Rename options_windows.go -> options_win.go 2023-04-30 09:10:00 +10:00
Lea Anthony
1128662c89
[v3 windows] Add APM Events 2023-04-29 20:33:33 +10:00
Lea Anthony
676787417f
[v3] Update application.On and window.On to return functions that unregister the listener. WebviewWindow.onApplicationEvent is a helper which will manage the unregistering for you on window destroy. 2023-04-29 19:39:05 +10:00
Lea Anthony
57422dccf3
[windows] Split out wndProc. Generate windows events, support per-window themes 2023-04-29 12:14:12 +10:00
Lea Anthony
7f3f51e36b
[windows] Support AlwaysOnTop, EnableResize at runtime. Added Solid/Transparent/Translucent options. 2023-04-28 21:11:49 +10:00
stffabi
ef184ec8bf [v3, windows] Add MainThread dispatching and fixes the blocking window 2023-04-26 21:06:54 +02:00
Lea Anthony
9bfe3094dd
[windows] WIP 2023-04-26 21:07:04 +10:00
stffabi
3547b4d010
[v2, darwin] Add some missing default shortcuts (#2586)
* [v2, darwin] Add "Hide, Hide Others, Show All“ to appmenu

This also includes shortcuts support for those commands.
Arrange the menu items in the well known MacOS order.

* [v2, darwin] Add Window menu with well known shortcuts Minimize, Full-Screen and Zoom.
2023-04-26 21:07:04 +10:00
stffabi
1222e3aa1b
[v2, dev] Use custom schemes for in-app dev mode (#2610)
This fixes some long-standing inconsistencies between
dev mode builds and production builds but is a breaking
change. Dev mode uses custom scheme for Vite versions >= 3.0.0
and for older it still behaves in the old way.
2023-04-26 21:07:03 +10:00
stffabi
cff3ee5079
[assetServer] Improve release/close handling of webview requests (#2612) 2023-04-26 21:07:03 +10:00
Travis McLane
c91aa462aa
[darwin] add getPrimaryScreen/getScreens to impl (#2618) 2023-04-24 09:34:44 +10:00
Lea Anthony
62b3775e2f
Fix module path for non-modified repo 2023-04-19 08:22:58 +10:00
Lea Anthony
54bf8c1142
[windows] Initial commit 2023-04-18 21:27:09 +10:00
Lea Anthony
c4f613e4c5
[windows] Fix paths for wails init 2023-04-18 20:41:59 +10:00
Lea Anthony
a66d9ab0b1
Intial STATUS.md commit 2023-04-18 18:53:39 +10:00
5152 changed files with 126142 additions and 344231 deletions

View file

@ -158,7 +158,7 @@
]
},
{
"login": "sircodemane",
"login": "codydbentley",
"name": "Cody Bentley",
"avatar_url": "https://avatars.githubusercontent.com/u/6968902?v=4",
"profile": "https://codybentley.dev/",

View file

@ -70,7 +70,7 @@ body:
validations:
required: false
- type: textarea
id: systemdetails
id: systemetails
attributes:
label: System Details
description: Please add the output of `wails doctor`.

View file

@ -1,44 +0,0 @@
# File path specific labels
v2-only:
- 'v2/**/*'
v3-alpha:
- 'v3/**/*'
windows:
- '**/*_windows.go'
- 'v2/internal/frontend/desktop/windows/**/*'
macos:
- '**/*_darwin.go'
- 'v2/internal/frontend/desktop/darwin/**/*'
linux:
- '**/*_linux.go'
- 'v2/internal/frontend/desktop/linux/**/*'
cli:
- 'v2/cmd/**/*'
- 'v3/cmd/**/*'
- '**/cli/**/*'
- '**/commands/**/*'
documentation:
- '**/*.md'
- 'docs/**/*'
- 'website/**/*'
- 'mkdocs-website/**/*'
templates:
- '**/templates/**/*'
- '**/template/**/*'
runtime:
- '**/runtime/**/*'
- 'v2/internal/runtime/**/*'
- 'v3/internal/runtime/**/*'
bindings:
- 'v2/internal/binding/**/*'
- 'v3/internal/generator/**/*'

View file

@ -1,144 +0,0 @@
# Version labels
v2-only:
- '\[v2\]'
- '\(v2\)'
- 'v2:'
- 'version 2'
- 'wails v2'
- 'using v2'
- 'master branch'
v3-alpha:
- '\[v3\]'
- '\(v3\)'
- 'v3:'
- '\[v3-alpha\]'
- '\(v3-alpha\)'
- 'version 3'
- 'wails v3'
- 'using v3'
- 'v3-alpha branch'
# Component labels
webview2:
- 'webview2'
- 'windows'
- 'microsoft edge'
- 'edge browser'
- 'IE'
- 'Explorer'
- 'browser crashes'
macos:
- 'macOS'
- 'mac OS'
- 'OS X'
- 'darwin'
- 'cocoa'
- 'Safari'
- 'Catalyst'
- 'Ventura'
- 'Sonoma'
- 'apple'
linux:
- 'linux'
- 'ubuntu'
- 'debian'
- 'fedora'
- 'gtk'
- 'webkitgtk'
- 'webkit2gtk'
- 'gnome'
- 'x11'
- 'wayland'
cli:
- 'cli'
- 'command line'
- 'wails doctor'
- 'wails init'
- 'wails build'
- 'wails dev'
- 'template'
- 'scaffolding'
# Type labels
bug:
- 'bug'
- 'crash'
- 'broken'
- 'failure'
- 'error'
- 'failed'
- 'panic'
- 'segfault'
- 'issue'
- 'not working'
- 'problem'
enhancement:
- 'feature'
- 'enhancement'
- 'request'
- 'add'
- 'new'
- 'improve'
- 'functionality'
- 'support for'
- 'please add'
- 'would be nice'
documentation:
- 'docs'
- 'documentation'
- 'readme'
- 'example'
- 'tutorial'
- 'guide'
- 'explanation'
- 'clarification'
- 'instructions'
security:
- 'security'
- 'vulnerability'
- 'exploit'
- 'hack'
- 'CVE'
- 'secure'
- 'encryption'
- 'hardening'
performance:
- 'performance'
- 'slow'
- 'speed'
- 'memory leak'
- 'cpu usage'
- 'high memory'
- 'lag'
- 'freeze'
- 'optimization'
# Priority labels
high-priority:
- 'urgent'
- 'critical'
- 'security'
- 'high priority'
- 'important'
- 'production'
- 'blocker'
- 'blocking'
question:
- 'how to'
- 'how do i'
- 'can I'
- 'is it possible'
- 'question'
- 'help me'
- 'need help'
- 'assistance'
- 'confused'

View file

@ -1,21 +1,3 @@
<!--
*********************************************************************
* PLEASE READ BEFORE SUBMITTING YOUR PR *
* YOUR PR MAY BE REJECTED IF IT DOES NOT FOLLOW THESE STEPS *
*********************************************************************
- *DO NOT* submit PRs for v3 alpha enhancements, unless you have opened a post on the discord channel.
All enhancements must be discussed first.
The feedback guide for v3 is here: https://v3alpha.wails.io/getting-started/feedback/
- Before submitting your PR, please ensure you have created and linked the PR to an issue.
- If a relevant issue already exists, please reference it in your PR by including `Fixes #<issue number>` in your PR description.
- Please fill in the checklists.
-->
# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
@ -24,7 +6,7 @@ Fixes # (issue)
## Type of change
Please select the option that is relevant.
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
@ -38,8 +20,6 @@ Please describe the tests that you ran to verify your changes. Provide instructi
- [ ] Windows
- [ ] macOS
- [ ] Linux
If you checked Linux, please specify the distro and version.
## Test Configuration

26
.github/stale.yml vendored
View file

@ -1,7 +1,7 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 45
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 10
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
@ -9,28 +9,14 @@ exemptLabels:
- onhold
- inprogress
- "Selected For Development"
- bug
- enhancement
- v3-alpha
- high-priority
# Label to use when marking an issue as stale
staleLabel: "stale"
staleLabel: "Wont Fix"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs within the next 10 days.
If this issue is still relevant, please add a comment to keep it open.
Thank you for your contributions.
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been automatically closed due to lack of activity.
Please feel free to reopen it if it's still relevant.
closeComment: false
exemptMilestones: true
exemptAssignees: true
# Only mark issues (not PRs)
only: issues
# Exempt issues created before a certain date
exemptCreatedBefore: "2024-01-01T00:00:00Z"
# Starts checking issues only after the specified date
startDate: "2025-06-01T00:00:00Z"

View file

@ -1,33 +0,0 @@
name: Auto Label Issues
on:
issues:
types: [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened, synchronize]
jobs:
auto-label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Label issues and PRs by content
uses: github/issue-labeler@v3.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-labeler.yml
enable-versioned-regex: 0
include-title: 1
- name: Label issues and PRs by file paths
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/file-labeler.yml
sync-labels: true

View file

@ -0,0 +1,140 @@
name: Build + Test v3 alpha
on:
push:
branches: [v3-alpha]
paths-ignore:
- 'mkdocs-website/**/*'
workflow_dispatch:
jobs:
test_go:
name: Run Go Tests
if: github.repository == 'wailsapp/wails'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
go-version: [1.21]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev build-essential pkg-config
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Examples
working-directory: ./v3
run: task test:examples
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v3
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest'
working-directory: ./v3
run: go test -v ./...
test_js:
name: Run JS Tests
if: github.repository == 'wailsapp/wails'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
working-directory: v2/internal/frontend/runtime
- name: Run tests
run: npm test
working-directory: v2/internal/frontend/runtime
test_templates:
name: Test Templates
needs: test_go
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
template:
[
svelte,
svelte-ts,
vue,
vue-ts,
react,
react-ts,
preact,
preact-ts,
lit,
lit-ts,
vanilla,
vanilla-ts,
]
go-version: [1.21]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Setup Golang caches
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Build Wails3 CLI
run: |
cd ./v3/cmd/wails3
go install
wails3 -help
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev build-essential pkg-config
- name: Generate template '${{ matrix.template }}'
run: |
go install github.com/go-task/task/v3/cmd/task@latest
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails3 init -n ${{ matrix.template }} -t ${{ matrix.template }}
cd ${{ matrix.template }}
wails3 build

View file

@ -1,201 +0,0 @@
name: Build + Test v3
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- v3-alpha
paths:
- 'v3/**'
pull_request_review:
types: [submitted]
branches:
- v3-alpha
jobs:
check_approval:
name: Check PR Approval
runs-on: ubuntu-latest
if: github.base_ref == 'v3-alpha'
outputs:
approved: ${{ steps.check.outputs.approved }}
steps:
- name: Check if PR is approved
id: check
run: |
if [[ "${{ github.event.review.state }}" == "approved" || "${{ github.event.pull_request.approved }}" == "true" ]]; then
echo "approved=true" >> $GITHUB_OUTPUT
else
echo "approved=false" >> $GITHUB_OUTPUT
fi
test_go:
name: Run Go Tests v3
needs: check_approval
runs-on: ${{ matrix.os }}
if: github.base_ref == 'v3-alpha'
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
go-version: [1.24]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install linux dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-latest'
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config xvfb x11-xserver-utils at-spi2-core xdg-desktop-portal-gtk
version: 1.0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "v3/go.sum"
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Examples
working-directory: v3
run: task test:examples
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: v3
run: go test -v ./...
- name: Run tests (windows)
if: matrix.os == 'windows-latest'
working-directory: v3
run: go test -v ./...
- name: Run tests (ubuntu)
if: matrix.os == 'ubuntu-latest'
working-directory: v3
run: >
xvfb-run --auto-servernum
sh -c '
dbus-update-activation-environment --systemd --all &&
go test -v ./...
'
- name: Typecheck binding generator output
working-directory: v3
run: task generator:test:check
test_js:
name: Run JS Tests
needs: check_approval
runs-on: ubuntu-latest
if: github.base_ref == 'v3-alpha'
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
working-directory: v2/internal/frontend/runtime
- name: Run tests
run: npm test
working-directory: v2/internal/frontend/runtime
test_templates:
name: Test Templates
needs: test_go
runs-on: ${{ matrix.os }}
if: github.base_ref == 'v3-alpha'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
template:
- svelte
- svelte-ts
- vue
- vue-ts
- react
- react-ts
- preact
- preact-ts
- lit
- lit-ts
- vanilla
- vanilla-ts
go-version: [1.24]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install linux dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-latest'
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
version: 1.0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "v3/go.sum"
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Wails3 CLI
working-directory: v3
run: |
task install
wails3 doctor
- name: Generate template '${{ matrix.template }}'
run: |
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails3 init -n ${{ matrix.template }} -t ${{ matrix.template }}
cd ${{ matrix.template }}
wails3 build
build_results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: v3 Build Results
needs: [test_go, test_js, test_templates]
steps:
- run: |
go_result="${{ needs.test_go.result }}"
js_result="${{ needs.test_js.result }}"
templates_result="${{ needs.test_templates.result }}"
if [[ $go_result == "success" || $go_result == "skipped" ]] && \
[[ $js_result == "success" || $js_result == "skipped" ]] && \
[[ $templates_result == "success" || $templates_result == "skipped" ]]; then
echo "All required jobs succeeded or were skipped"
exit 0
else
echo "One or more required jobs failed"
exit 1
fi

View file

@ -2,7 +2,7 @@ name: Build + Test v2
on:
push:
branches: [release/*, master, bugfix/*]
branches: [release/*, master]
workflow_dispatch:
jobs:
@ -12,30 +12,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest]
go-version: ['1.22']
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: [1.18, 1.19]
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-22.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
version: 1.0
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-24.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config libegl1
version: 1.0
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: ./v2/go.sum
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
@ -45,26 +36,21 @@ jobs:
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest' && matrix.os != 'ubuntu-24.04'
if: matrix.os != 'macos-latest'
working-directory: ./v2
run: go test -v ./...
- name: Run tests (Ubuntu 24.04)
if: matrix.os == 'ubuntu-24.04'
working-directory: ./v2
run: go test -v -tags webkit2_41 ./...
test_js:
name: Run JS Tests
if: github.repository == 'wailsapp/wails'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
@ -86,7 +72,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
os: [ubuntu-latest, windows-latest, macos-latest]
template:
[
svelte,
@ -103,16 +89,15 @@ jobs:
vanilla-ts,
plain,
]
go-version: ['1.22']
go-version: [1.18, 1.19]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: ./v2/go.sum
- name: Build Wails CLI
run: |
@ -120,41 +105,14 @@ jobs:
go install
wails -help
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-22.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
version: 1.0
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
# - name: Install linux dependencies ( 22.04 )
# if: matrix.os == 'ubuntu-22.04'
# run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-24.04'
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config libegl1
version: 1.0
# - name: Install linux dependencies ( 24.04 )
# if: matrix.os == 'ubuntu-24.04'
# run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
- name: Generate & Build template '${{ matrix.template }}'
if: matrix.os != 'ubuntu-24.04'
- name: Generate template '${{ matrix.template }}'
run: |
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
cd ${{ matrix.template }}
wails build -v 2
- name: Generate & Build template '${{ matrix.template }}' (ubuntu-24.04)
if: matrix.os == 'ubuntu-24.04'
run: |
mkdir -p ./test-${{ matrix.template }}
cd ./test-${{ matrix.template }}
wails init -n ${{ matrix.template }} -t ${{ matrix.template }} -ci
cd ${{ matrix.template }}
wails build -v 2 -tags webkit2_41

View file

@ -1,423 +0,0 @@
name: Build Cross-Compiler Image
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch containing Dockerfile'
required: true
default: 'v3-alpha'
sdk_version:
description: 'macOS SDK version'
required: true
default: '14.5'
zig_version:
description: 'Zig version'
required: true
default: '0.14.0'
image_version:
description: 'Image version tag'
required: true
default: 'latest'
skip_tests:
description: 'Skip cross-compilation tests'
required: false
default: 'false'
type: boolean
push:
branches:
- v3-alpha
paths:
- 'v3/internal/commands/build_assets/docker/Dockerfile.cross'
env:
REGISTRY: ghcr.io
IMAGE_NAME: wailsapp/wails-cross
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image_tag: ${{ steps.vars.outputs.image_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set build variables
id: vars
run: |
echo "sdk_version=${{ inputs.sdk_version || '14.5' }}" >> $GITHUB_OUTPUT
echo "zig_version=${{ inputs.zig_version || '0.14.0' }}" >> $GITHUB_OUTPUT
echo "image_version=${{ inputs.image_version || 'latest' }}" >> $GITHUB_OUTPUT
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.vars.outputs.image_version }}
type=raw,value=sdk-${{ steps.vars.outputs.sdk_version }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: v3/internal/commands/build_assets/docker
file: v3/internal/commands/build_assets/docker/Dockerfile.cross
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
io.wails.zig.version=${{ steps.vars.outputs.zig_version }}
io.wails.sdk.version=${{ steps.vars.outputs.sdk_version }}
build-args: |
ZIG_VERSION=${{ steps.vars.outputs.zig_version }}
MACOS_SDK_VERSION=${{ steps.vars.outputs.sdk_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Test cross-compilation for all platforms
test-cross-compile:
needs: build
if: ${{ inputs.skip_tests != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Darwin targets (Zig + macOS SDK) - no platform emulation needed
- os: darwin
arch: arm64
platform: ""
expected_file: "Mach-O 64-bit.*arm64"
- os: darwin
arch: amd64
platform: ""
expected_file: "Mach-O 64-bit.*x86_64"
# Linux targets (GCC) - need platform to match architecture
- os: linux
arch: amd64
platform: "linux/amd64"
expected_file: "ELF 64-bit LSB.*x86-64"
- os: linux
arch: arm64
platform: "linux/arm64"
expected_file: "ELF 64-bit LSB.*ARM aarch64"
# Windows targets (Zig + mingw) - no platform emulation needed
- os: windows
arch: amd64
platform: ""
expected_file: "PE32\\+ executable.*x86-64"
- os: windows
arch: arm64
platform: ""
expected_file: "PE32\\+ executable.*Aarch64"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Set up QEMU
if: matrix.platform != ''
uses: docker/setup-qemu-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create test CGO project
run: |
mkdir -p test-project
cd test-project
# Create a minimal CGO test program
cat > main.go << 'EOF'
package main
/*
#include <stdlib.h>
int add(int a, int b) {
return a + b;
}
*/
import "C"
import "fmt"
func main() {
result := C.add(1, 2)
fmt.Printf("CGO test: 1 + 2 = %d\n", result)
}
EOF
cat > go.mod << 'EOF'
module test-cgo
go 1.21
EOF
- name: Build ${{ matrix.os }}/${{ matrix.arch }} (CGO)
run: |
cd test-project
PLATFORM_FLAG=""
if [ -n "${{ matrix.platform }}" ]; then
PLATFORM_FLAG="--platform ${{ matrix.platform }}"
fi
docker run --rm $PLATFORM_FLAG \
-v "$(pwd):/app" \
-e APP_NAME="test-cgo" \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build.outputs.image_tag || 'latest' }} \
${{ matrix.os }} ${{ matrix.arch }}
- name: Verify binary format
run: |
cd test-project/bin
ls -la
# Find the built binary
if [ "${{ matrix.os }}" = "windows" ]; then
BINARY=$(ls test-cgo-${{ matrix.os }}-${{ matrix.arch }}.exe 2>/dev/null || ls *.exe | head -1)
else
BINARY=$(ls test-cgo-${{ matrix.os }}-${{ matrix.arch }} 2>/dev/null || ls test-cgo* | grep -v '.exe' | head -1)
fi
echo "Binary: $BINARY"
FILE_OUTPUT=$(file "$BINARY")
echo "File output: $FILE_OUTPUT"
# Verify the binary format matches expected
if echo "$FILE_OUTPUT" | grep -qE "${{ matrix.expected_file }}"; then
echo "✅ Binary format verified: ${{ matrix.os }}/${{ matrix.arch }}"
else
echo "❌ Binary format mismatch!"
echo "Expected pattern: ${{ matrix.expected_file }}"
echo "Got: $FILE_OUTPUT"
exit 1
fi
- name: Check library dependencies (Linux only)
if: matrix.os == 'linux'
run: |
cd test-project/bin
BINARY=$(ls test-cgo-${{ matrix.os }}-${{ matrix.arch }} 2>/dev/null || ls test-cgo* | grep -v '.exe' | head -1)
echo "## Library Dependencies for $BINARY"
echo ""
# Use readelf to show dynamic dependencies
echo "### NEEDED libraries:"
readelf -d "$BINARY" | grep NEEDED || echo "No dynamic dependencies (statically linked)"
# Verify expected libraries are linked
echo ""
echo "### Verifying required libraries..."
NEEDED=$(readelf -d "$BINARY" | grep NEEDED)
MISSING=""
for lib in libwebkit2gtk-4.1.so libgtk-3.so libglib-2.0.so libc.so; do
if echo "$NEEDED" | grep -q "$lib"; then
echo "✅ $lib"
else
echo "❌ $lib MISSING"
MISSING="$MISSING $lib"
fi
done
if [ -n "$MISSING" ]; then
echo ""
echo "ERROR: Missing required libraries:$MISSING"
exit 1
fi
# Test non-CGO builds (pure Go cross-compilation)
test-non-cgo:
needs: build
if: ${{ inputs.skip_tests != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- os: darwin
arch: arm64
expected_file: "Mach-O 64-bit.*arm64"
- os: darwin
arch: amd64
expected_file: "Mach-O 64-bit.*x86_64"
- os: linux
arch: amd64
expected_file: "ELF 64-bit LSB"
- os: linux
arch: arm64
expected_file: "ELF 64-bit LSB.*ARM aarch64"
- os: windows
arch: amd64
expected_file: "PE32\\+ executable.*x86-64"
- os: windows
arch: arm64
expected_file: "PE32\\+ executable.*Aarch64"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create test non-CGO project
run: |
mkdir -p test-project
cd test-project
# Create a pure Go test program (no CGO)
cat > main.go << 'EOF'
package main
import "fmt"
func main() {
fmt.Println("Pure Go cross-compilation test")
}
EOF
cat > go.mod << 'EOF'
module test-pure-go
go 1.21
EOF
- name: Build ${{ matrix.os }}/${{ matrix.arch }} (non-CGO)
run: |
cd test-project
# For non-CGO, we can use any platform since Go handles cross-compilation
# We set CGO_ENABLED=0 to ensure pure Go build
docker run --rm \
-v "$(pwd):/app" \
-e APP_NAME="test-pure-go" \
-e CGO_ENABLED=0 \
--entrypoint /bin/sh \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.build.outputs.image_tag || 'latest' }} \
-c "GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o bin/test-pure-go-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.os == 'windows' && '.exe' || '' }} ."
- name: Verify binary format
run: |
cd test-project/bin
ls -la
# Find the built binary
if [ "${{ matrix.os }}" = "windows" ]; then
BINARY="test-pure-go-${{ matrix.os }}-${{ matrix.arch }}.exe"
else
BINARY="test-pure-go-${{ matrix.os }}-${{ matrix.arch }}"
fi
echo "Binary: $BINARY"
FILE_OUTPUT=$(file "$BINARY")
echo "File output: $FILE_OUTPUT"
# Verify the binary format matches expected
if echo "$FILE_OUTPUT" | grep -qE "${{ matrix.expected_file }}"; then
echo "✅ Binary format verified: ${{ matrix.os }}/${{ matrix.arch }} (non-CGO)"
else
echo "❌ Binary format mismatch!"
echo "Expected pattern: ${{ matrix.expected_file }}"
echo "Got: $FILE_OUTPUT"
exit 1
fi
- name: Check library dependencies (Linux only)
if: matrix.os == 'linux'
run: |
cd test-project/bin
BINARY="test-pure-go-${{ matrix.os }}-${{ matrix.arch }}"
echo "## Library Dependencies for $BINARY (non-CGO)"
echo ""
# Non-CGO builds should have minimal dependencies (just libc or statically linked)
echo "### NEEDED libraries:"
readelf -d "$BINARY" | grep NEEDED || echo "No dynamic dependencies (statically linked)"
# Verify NO GTK/WebKit libraries (since CGO is disabled)
NEEDED=$(readelf -d "$BINARY" | grep NEEDED || true)
if echo "$NEEDED" | grep -q "libwebkit\|libgtk"; then
echo "❌ ERROR: Non-CGO binary should not link to GTK/WebKit!"
exit 1
else
echo "✅ Confirmed: No GTK/WebKit dependencies (expected for non-CGO)"
fi
# Summary job
test-summary:
needs: [build, test-cross-compile, test-non-cgo]
if: always() && inputs.skip_tests != 'true'
runs-on: ubuntu-latest
steps:
- name: Check test results
run: |
echo "## Cross-Compilation Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.test-cross-compile.result }}" = "success" ]; then
echo "✅ **CGO Tests**: All passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **CGO Tests**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.test-non-cgo.result }}" = "success" ]; then
echo "✅ **Non-CGO Tests**: All passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Non-CGO Tests**: Failed" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Tested Platforms" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Architecture | CGO | Non-CGO |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------------|-----|---------|" >> $GITHUB_STEP_SUMMARY
echo "| Darwin | arm64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
echo "| Darwin | amd64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
echo "| Linux | arm64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
echo "| Linux | amd64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
echo "| Windows | arm64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
echo "| Windows | amd64 | ✅ | ✅ |" >> $GITHUB_STEP_SUMMARY
# Fail if any test failed
if [ "${{ needs.test-cross-compile.result }}" != "success" ] || [ "${{ needs.test-non-cgo.result }}" != "success" ]; then
echo ""
echo "❌ Some tests failed. Check the individual job logs for details."
exit 1
fi

View file

@ -1,216 +0,0 @@
name: Changelog Validation (v3)
on:
pull_request:
branches: [ v3-alpha ]
paths:
- 'docs/src/content/docs/changelog.mdx'
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to validate'
required: true
type: string
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || format('refs/pull/{0}/head', github.event.inputs.pr_number) }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN || github.token }}
- name: Get REAL validation script from v3-alpha
run: |
echo "Fetching the REAL validation script from v3-alpha branch..."
git fetch origin v3-alpha
git checkout origin/v3-alpha -- v3/scripts/validate-changelog.go
echo "Validation script fetched successfully:"
ls -la v3/scripts/
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Get PR information
id: pr_info
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "pr_number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
echo "base_ref=${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT
else
echo "pr_number=${{ github.event.inputs.pr_number }}" >> $GITHUB_OUTPUT
echo "base_ref=v3-alpha" >> $GITHUB_OUTPUT
fi
- name: Check changelog modifications
id: changelog_check
run: |
echo "Checking PR #${{ steps.pr_info.outputs.pr_number }} for changelog changes"
git fetch origin ${{ steps.pr_info.outputs.base_ref }}
if git diff --name-only origin/${{ steps.pr_info.outputs.base_ref }}..HEAD | grep -q "docs/src/content/docs/changelog.mdx"; then
echo "changelog_modified=true" >> $GITHUB_OUTPUT
echo "✅ Changelog was modified in this PR"
else
echo "changelog_modified=false" >> $GITHUB_OUTPUT
echo " Changelog was not modified - skipping validation"
fi
- name: Get changelog diff
id: get_diff
if: steps.changelog_check.outputs.changelog_modified == 'true'
run: |
echo "Getting diff for changelog changes..."
git diff origin/${{ steps.pr_info.outputs.base_ref }}..HEAD docs/src/content/docs/changelog.mdx | grep "^+" | grep -v "^+++" | sed 's/^+//' > /tmp/pr_added_lines.txt
echo "Lines added in this PR:"
cat /tmp/pr_added_lines.txt
echo "Total lines added: $(wc -l < /tmp/pr_added_lines.txt)"
- name: Validate changelog
id: validate
if: steps.changelog_check.outputs.changelog_modified == 'true'
run: |
echo "Running changelog validation..."
cd v3/scripts
OUTPUT=$(go run validate-changelog.go ../../docs/src/content/docs/changelog.mdx /tmp/pr_added_lines.txt 2>&1)
echo "$OUTPUT"
RESULT=$(echo "$OUTPUT" | grep "VALIDATION_RESULT=" | cut -d'=' -f2)
echo "result=$RESULT" >> $GITHUB_OUTPUT
- name: Commit fixes
id: commit_fixes
if: steps.validate.outputs.result == 'fixed'
run: |
echo "Committing automatic fixes..."
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Check only the changelog file for changes
if git diff --quiet docs/src/content/docs/changelog.mdx; then
echo "No changes to commit"
echo "committed=false" >> $GITHUB_OUTPUT
else
# Ensure validation script doesn't get committed
echo "v3/scripts/validate-changelog.go" >> .git/info/exclude
# Get the correct branch name to push to
REPO_OWNER="wailsapp" # Always wailsapp for this repo
if [ "${{ github.event_name }}" = "pull_request" ]; then
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
else
# For manual workflow dispatch, get PR info
PR_INFO=$(gh pr view ${{ steps.pr_info.outputs.pr_number }} --json headRefName,headRepository)
BRANCH_NAME=$(echo "$PR_INFO" | jq -r '.headRefName')
HEAD_REPO=$(echo "$PR_INFO" | jq -r '.headRepository.name')
echo "🔍 PR source branch: $BRANCH_NAME"
echo "🔍 Head repository: $HEAD_REPO"
# Don't push if this is from a fork or if branch is v3-alpha (main branch)
if [ "$HEAD_REPO" != "wails" ] || [ "$BRANCH_NAME" = "v3-alpha" ]; then
echo "⚠️ Cannot push - either fork or direct v3-alpha branch. Manual fix required."
echo "committed=false" >> $GITHUB_OUTPUT
exit 0
fi
fi
echo "Pushing to branch: $BRANCH_NAME in repo: $REPO_OWNER"
# Only commit the changelog changes, not the validation script
git add docs/src/content/docs/changelog.mdx
git commit -m "🤖 Fix changelog: move entries to Unreleased section"
# Only push if running on the main wailsapp repository
if [ "${{ github.repository }}" = "wailsapp/wails" ]; then
# Pull latest changes and rebase our commit
git fetch origin $BRANCH_NAME
git rebase origin/$BRANCH_NAME
git push origin HEAD:$BRANCH_NAME
else
echo "⚠️ Running on fork (${{ github.repository }}). Skipping push - manual fix required."
echo "committed=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "committed=true" >> $GITHUB_OUTPUT
echo "✅ Changes committed and pushed"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get PR author for tagging
id: pr_author
if: steps.validate.outputs.result && github.event.inputs.pr_number
run: |
PR_AUTHOR=$(gh pr view ${{ steps.pr_info.outputs.pr_number }} --json author --jq '.author.login')
echo "author=$PR_AUTHOR" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR
if: steps.validate.outputs.result && github.event.inputs.pr_number
uses: actions/github-script@v7
with:
script: |
const result = '${{ steps.validate.outputs.result }}';
const committed = '${{ steps.commit_fixes.outputs.committed }}';
const author = '${{ steps.pr_author.outputs.author }}';
let message;
if (result === 'success') {
message = '## ✅ Changelog Validation Passed\n\nNo misplaced changelog entries detected.';
} else if (result === 'fixed' && committed === 'true') {
message = '## 🔧 Changelog Updated\n\nMisplaced entries were automatically moved to the `[Unreleased]` section. The changes have been committed to this PR.';
} else if (result === 'fixed' || result === 'cannot_fix' || result === 'error') {
// Read the fixed changelog content
const fs = require('fs');
let fixedContent = '';
try {
fixedContent = fs.readFileSync('docs/src/content/docs/changelog.mdx', 'utf8');
} catch (error) {
fixedContent = 'Error reading fixed changelog content';
}
message = '## ⚠️ Changelog Validation Issue\\n\\n' +
'@' + author + ' Your PR contains changelog entries that were added to already-released versions. These need to be moved to the `[Unreleased]` section.\\n\\n' +
(committed === 'true' ?
'✅ **Auto-fix applied**: The changes have been automatically committed to this PR.' :
'❌ **Manual fix required**: Please apply the changes shown below manually.') + '\\n\\n' +
'<details>\\n' +
'<summary>📝 Click to see the corrected changelog content</summary>\\n\\n' +
'```mdx\\n' +
fixedContent +
'\\n```\\n\\n' +
'</details>\\n\\n' +
'**What happened?** \\n' +
'The validation script detected that you added changelog entries to a version section that has already been released (like `v3.0.0-alpha.10`). All new entries should go in the `[Unreleased]` section under the appropriate category (`### Added`, `### Fixed`, etc.).\\n\\n' +
(committed !== 'true' ? '**Action needed:** Please copy the corrected content from above and replace your changelog file.' : '');
}
if (message) {
await github.rest.issues.createComment({
issue_number: ${{ steps.pr_info.outputs.pr_number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: message
});
}
- name: Fail if validation failed
if: steps.validate.outputs.result == 'cannot_fix' || steps.validate.outputs.result == 'error'
run: |
echo "❌ Changelog validation failed"
exit 1

View file

@ -1,44 +0,0 @@
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
# Optional: Only run on specific file changes
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"
jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options

View file

@ -1,50 +0,0 @@
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

View file

@ -16,7 +16,7 @@ jobs:
- name: Set Node
uses: actions/setup-node@v2
with:
node-version: 20.x
node-version: 16.x
- name: Update Sponsors
run: cd scripts/sponsors && chmod 755 ./generate-sponsor-image.sh && ./generate-sponsor-image.sh
@ -25,16 +25,11 @@ jobs:
SPONSORKIT_GITHUB_LOGIN: wailsapp
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore: update sponsors.svg"
add-paths: "website/static/img/sponsors.svg"
title: "chore: update sponsors.svg"
body: |
Auto-generated by the sponsor image workflow
[skip ci] [skip actions]
title: Update Sponsor Image
body: Generated new image
branch: update-sponsors
base: master
delete-branch: true
draft: false

View file

@ -1,77 +0,0 @@
name: Issue Triage Automation
on:
issues:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
steps:
# Request more info for unclear bug reports
- name: Request more info
uses: actions/github-script@v6
if: |
contains(github.event.issue.labels.*.name, 'bug') &&
!contains(github.event.issue.body, 'wails doctor') &&
!contains(github.event.issue.body, 'reproduction')
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `👋 Thanks for reporting this issue! To help us investigate, could you please:
1. Add the output of \`wails doctor\` if not already included
2. Provide clear steps to reproduce the issue
3. If possible, create a minimal reproduction of the issue
This will help us resolve your issue much faster. Thank you!`
});
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['awaiting feedback']
});
# Prioritize security issues
- name: Prioritize security issues
uses: actions/github-script@v6
if: contains(github.event.issue.labels.*.name, 'security')
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['high-priority']
});
# Tag version-specific issues for project boards
- name: Add to v2 project
uses: actions/github-script@v6
if: |
contains(github.event.issue.labels.*.name, 'v2-only') &&
!contains(github.event.issue.labels.*.name, 'v3-alpha')
with:
script: |
// Replace PROJECT_ID with your actual GitHub project ID
// This is a placeholder as the actual implementation would require
// GraphQL API calls to add to a project board
console.log('Would add to v2 project board');
# Tag version-specific issues for project boards
- name: Add to v3 project
uses: actions/github-script@v6
if: contains(github.event.issue.labels.*.name, 'v3-alpha')
with:
script: |
// Replace PROJECT_ID with your actual GitHub project ID
// This is a placeholder as the actual implementation would require
// GraphQL API calls to add to a project board
console.log('Would add to v3 project board');

View file

@ -1,210 +0,0 @@
name: Nightly Release v3-alpha
on:
schedule:
- cron: '0 2 * * *' # 2 AM UTC daily
workflow_dispatch:
inputs:
force_release:
description: 'Force release even if no changes detected'
required: false
default: false
type: boolean
dry_run:
description: 'Run in dry-run mode (no actual release)'
required: false
default: true
type: boolean
jobs:
nightly-release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: v3-alpha
fetch-depth: 0
token: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
cache: true
cache-dependency-path: 'v3/go.sum'
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Configure git to use the token for authentication
git config --global url."https://x-access-token:${{ secrets.WAILS_REPO_TOKEN || github.token }}@github.com/".insteadOf "https://github.com/"
- name: Check for existing release tag
id: check_tag
run: |
if git describe --tags --exact-match HEAD 2>/dev/null; then
echo "has_tag=true" >> $GITHUB_OUTPUT
echo "tag=$(git describe --tags --exact-match HEAD)" >> $GITHUB_OUTPUT
else
echo "has_tag=false" >> $GITHUB_OUTPUT
echo "tag=" >> $GITHUB_OUTPUT
fi
- name: Check for unreleased changelog content
id: changelog_check
run: |
echo "🔍 Checking UNRELEASED_CHANGELOG.md for content..."
# Run the release script in check mode to see if there's content
cd v3/tasks/release
# Use the release script itself to check for content
if go run release.go --check-only 2>/dev/null; then
echo "has_unreleased_content=true" >> $GITHUB_OUTPUT
echo "✅ Found unreleased changelog content"
else
echo "has_unreleased_content=false" >> $GITHUB_OUTPUT
echo " No unreleased changelog content found"
fi
- name: Quick change detection and early exit
id: quick_check
run: |
echo "🔍 Quick check for changes to determine if we should continue..."
# First check if we have unreleased changelog content
if [ "${{ steps.changelog_check.outputs.has_unreleased_content }}" == "true" ]; then
echo "✅ Found unreleased changelog content, proceeding with release"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
echo "reason=Found unreleased changelog content" >> $GITHUB_OUTPUT
exit 0
fi
# If no unreleased changelog content, check for git changes as fallback
echo "No unreleased changelog content found, checking for git changes..."
# Check if current commit has a release tag
if git describe --tags --exact-match HEAD 2>/dev/null; then
CURRENT_TAG=$(git describe --tags --exact-match HEAD)
echo "Current commit has release tag: $CURRENT_TAG"
# For tagged commits, check if there are changes since the tag
COMMIT_COUNT=$(git rev-list ${CURRENT_TAG}..HEAD --count)
if [ "$COMMIT_COUNT" -eq 0 ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=No changes since existing tag $CURRENT_TAG and no unreleased changelog content" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
fi
else
# No current tag, check against latest release
LATEST_TAG=$(git tag --list "v3.0.0-alpha.*" | sort -V | tail -1)
if [ -z "$LATEST_TAG" ]; then
echo "No previous release found, proceeding with release"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
else
COMMIT_COUNT=$(git rev-list ${LATEST_TAG}..HEAD --count)
if [ "$COMMIT_COUNT" -gt 0 ]; then
echo "Found $COMMIT_COUNT commits since $LATEST_TAG"
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "should_continue=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "should_continue=false" >> $GITHUB_OUTPUT
echo "reason=No changes since latest release $LATEST_TAG and no unreleased changelog content" >> $GITHUB_OUTPUT
fi
fi
fi
- name: Early exit - No changes detected
if: |
steps.quick_check.outputs.should_continue == 'false' &&
github.event.inputs.force_release != 'true'
run: |
echo "🛑 EARLY EXIT: ${{ steps.quick_check.outputs.reason }}"
echo ""
echo " No changes detected since last release and force_release is not enabled."
echo " Workflow will exit early to save resources."
echo ""
echo " To force a release anyway, run this workflow with 'force_release=true'"
echo ""
echo "## 🛑 Early Exit Summary" >> $GITHUB_STEP_SUMMARY
echo "**Reason:** ${{ steps.quick_check.outputs.reason }}" >> $GITHUB_STEP_SUMMARY
echo "**Action:** Workflow exited early to save resources" >> $GITHUB_STEP_SUMMARY
echo "**Force Release:** Set 'force_release=true' to override this behavior" >> $GITHUB_STEP_SUMMARY
exit 0
- name: Continue with release process
if: |
steps.quick_check.outputs.should_continue == 'true' ||
github.event.inputs.force_release == 'true'
run: |
echo "✅ Proceeding with release process..."
if [ "${{ github.event.inputs.force_release }}" == "true" ]; then
echo "🔨 FORCE RELEASE: Overriding change detection"
fi
- name: Run release script
id: release
if: |
steps.quick_check.outputs.should_continue == 'true' ||
github.event.inputs.force_release == 'true'
env:
WAILS_REPO_TOKEN: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
GITHUB_TOKEN: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
run: |
cd v3/tasks/release
ARGS=()
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
ARGS+=(--dry-run)
fi
go run release.go "${ARGS[@]}"
- name: Summary
if: always()
run: |
if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then
echo "## 🧪 DRY RUN Release Summary" >> $GITHUB_STEP_SUMMARY
else
echo "## 🚀 Nightly Release Summary" >> $GITHUB_STEP_SUMMARY
fi
echo "================================" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ steps.release.outputs.release_version }}" ]; then
echo "- **Version:** ${{ steps.release.outputs.release_version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Tag:** ${{ steps.release.outputs.release_tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Status:** ${{ steps.release.outcome == 'success' && '✅ Success' || '⚠️ Failed' }}" >> $GITHUB_STEP_SUMMARY
echo "- **Mode:** ${{ steps.release.outputs.release_dry_run == 'true' && '🧪 Dry Run' || '🚀 Live release' }}" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ steps.release.outputs.release_url }}" ]; then
echo "- **Release URL:** ${{ steps.release.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Changelog" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.changelog_check.outputs.has_unreleased_content }}" == "true" ]; then
echo "✅ Unreleased changelog processed and reset." >> $GITHUB_STEP_SUMMARY
else
echo " No unreleased changelog content detected." >> $GITHUB_STEP_SUMMARY
fi
else
echo "- Release script did not run (skipped or failed before execution)." >> $GITHUB_STEP_SUMMARY
fi

View file

@ -1,104 +0,0 @@
# Updated to ensure "Run Go Tests" runs for pull requests as expected.
# Key fix: the test_go job previously required github.event.review.state == 'approved'
# which only exists on pull_request_review events. That prevented the job from
# running for regular pull_request events (opened / synchronize / reopened).
# New logic: run tests for pull_request events, and also allow running when a
# pull_request_review is submitted with state == 'approved'.
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
pull_request_review:
types: [submitted]
branches:
- master
workflow_dispatch: {}
name: PR Checks (master)
jobs:
check_docs:
name: Check Docs
if: ${{ github.repository == 'wailsapp/wails' && github.base_ref == 'master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Verify Changed files
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
id: verify-changed-files
with:
files: |
website/**/*.mdx
website/**/*.md
- name: Run step only when files change.
if: steps.verify-changed-files.outputs.files_changed != 'true'
run: |
echo "::warning::Feature branch does not contain any changes to the website."
test_go:
name: Run Go Tests
runs-on: ${{ matrix.os }}
# Run when:
# - the event is a pull_request (opened/synchronize/reopened) OR
# - the event is a pull_request_review AND the review state is 'approved'
# plus other existing filters (not the update-sponsors branch, repo and base_ref)
if: >
github.repository == 'wailsapp/wails' &&
github.base_ref == 'master' &&
github.event.pull_request.head.ref != 'update-sponsors' &&
(
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
)
strategy:
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest, ubuntu-24.04]
go-version: ['1.23']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linux dependencies (22.04)
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
- name: Install linux dependencies (24.04)
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v2
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest' && matrix.os != 'ubuntu-24.04'
working-directory: ./v2
run: go test -v ./...
- name: Run tests (Ubuntu 24.04)
if: matrix.os == 'ubuntu-24.04'
working-directory: ./v2
run: go test -v -tags webkit2_41 ./...
# This job will run instead of test_go for the update-sponsors branch
skip_tests:
name: Skip Tests (Sponsor Update)
if: github.event.pull_request.head.ref == 'update-sponsors'
runs-on: ubuntu-latest
steps:
- name: Skip tests for sponsor updates
run: |
echo "Skipping tests for sponsor update branch"
echo "This is an automated update of the sponsors image."
continue-on-error: true

61
.github/workflows/pr.yml vendored Normal file
View file

@ -0,0 +1,61 @@
name: PR Checks
on:
pull_request:
pull_request_review:
types: [submitted]
jobs:
check_docs:
name: Check Docs
if: ${{github.repository == 'wailsapp/wails' && contains(github.head_ref,'feature/')}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v11.1
id: verify-changed-files
with:
files: |
website/**/*.mdx
website/**/*.md
- name: Run step only when files change.
if: steps.verify-changed-files.outputs.files_changed != 'true'
run: |
echo "::warning::Feature branch does not contain any changes to the website."
test_go:
name: Run Go Tests
runs-on: ${{ matrix.os }}
if: github.event.review.state == 'approved'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: [1.18, 1.19]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v2
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest'
working-directory: ./v2
run: go test -v ./...

View file

@ -1,25 +0,0 @@
on:
workflow_dispatch: {}
pull_request: {}
push:
branches:
- main
- master
- v3-alpha
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 14 16 * * *
name: Semgrep
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-24.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci

View file

@ -1,57 +0,0 @@
name: Mark and Close Stale Issues
on:
schedule:
- cron: '0 1 * * *' # Run at 1 AM UTC every day
workflow_dispatch: # Allow manual triggering
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
# General settings
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 45
days-before-close: 10
stale-issue-label: 'stale'
operations-per-run: 250 # Increased from 50 to 250
# Issue specific settings
stale-issue-message: |
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed if no further activity occurs within the next 10 days.
If this issue is still relevant, please add a comment to keep it open.
Thank you for your contributions.
close-issue-message: |
This issue has been automatically closed due to lack of activity.
Please feel free to reopen it if it's still relevant.
# PR specific settings - We will not mark PRs as stale
days-before-pr-stale: -1 # Disable PR staling
days-before-pr-close: -1 # Disable PR closing
# Exemptions
exempt-issue-labels: 'pinned,security,onhold,inprogress,Selected For Development,bug,enhancement,v3-alpha,high-priority'
exempt-all-issue-milestones: true
exempt-all-issue-assignees: true
# Protection for existing issues
exempt-issue-created-before: '2024-01-01T00:00:00Z'
start-date: '2025-06-01T00:00:00Z' # Don't start checking until June 1, 2025
# Only process issues, not PRs
only-labels: ''
any-of-labels: ''
remove-stale-when-updated: true
# Debug options
debug-only: false # Set to true to test without actually marking issues
ascending: true # Process older issues first

View file

@ -15,7 +15,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v2
with:
node-version: 20.x
node-version: 18.x
- name: Install Task
uses: arduino/setup-task@v1

View file

@ -1,216 +0,0 @@
name: Test Nightly Releases (Dry Run)
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Run in dry-run mode (no actual releases)'
required: false
default: true
type: boolean
test_branch:
description: 'Branch to test against'
required: false
default: 'master'
type: string
env:
GO_VERSION: '1.24'
jobs:
test-permissions:
name: Test Release Permissions
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.check.outputs.authorized }}
steps:
- name: Check if user is authorized
id: check
run: |
# Test authorization logic
AUTHORIZED_USERS="leaanthony"
if [[ "$AUTHORIZED_USERS" == *"${{ github.actor }}"* ]]; then
echo "✅ User ${{ github.actor }} is authorized"
echo "authorized=true" >> $GITHUB_OUTPUT
else
echo "❌ User ${{ github.actor }} is not authorized"
echo "authorized=false" >> $GITHUB_OUTPUT
fi
test-changelog-extraction:
name: Test Changelog Extraction
runs-on: ubuntu-latest
needs: test-permissions
if: needs.test-permissions.outputs.authorized == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.test_branch }}
fetch-depth: 0
- name: Test v2 changelog extraction
run: |
echo "🧪 Testing v2 changelog extraction..."
CHANGELOG_FILE="website/src/pages/changelog.mdx"
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "❌ v2 changelog file not found"
exit 1
fi
# Extract unreleased section
awk '
/^## \[Unreleased\]/ { found=1; next }
found && /^## / { exit }
found && !/^$/ { print }
' $CHANGELOG_FILE > v2_release_notes.md
echo "📝 v2 changelog content (first 10 lines):"
head -10 v2_release_notes.md || echo "No content found"
echo "Total lines: $(wc -l < v2_release_notes.md)"
- name: Test v3 changelog extraction (if accessible)
run: |
echo "🧪 Testing v3 changelog extraction..."
if git show v3-alpha:docs/src/content/docs/changelog.mdx > /dev/null 2>&1; then
echo "✅ v3 changelog accessible"
git show v3-alpha:docs/src/content/docs/changelog.mdx | awk '
/^## \[Unreleased\]/ { found=1; next }
found && /^## / { exit }
found && !/^$/ { print }
' > v3_release_notes.md
echo "📝 v3 changelog content (first 10 lines):"
head -10 v3_release_notes.md || echo "No content found"
echo "Total lines: $(wc -l < v3_release_notes.md)"
else
echo "⚠️ v3 changelog not accessible from current context"
fi
test-version-detection:
name: Test Version Detection
runs-on: ubuntu-latest
needs: test-permissions
if: needs.test-permissions.outputs.authorized == 'true'
outputs:
v2_current_version: ${{ steps.versions.outputs.v2_current }}
v2_next_patch: ${{ steps.versions.outputs.v2_next_patch }}
v2_next_minor: ${{ steps.versions.outputs.v2_next_minor }}
v2_next_major: ${{ steps.versions.outputs.v2_next_major }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test version detection logic
id: versions
run: |
echo "🧪 Testing version detection..."
# Test v2 version parsing
if [ -f "v2/cmd/wails/internal/version.txt" ]; then
CURRENT_V2=$(cat v2/cmd/wails/internal/version.txt | sed 's/^v//')
echo "Current v2 version: v$CURRENT_V2"
echo "v2_current=v$CURRENT_V2" >> $GITHUB_OUTPUT
# Parse and increment
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_V2"
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
PATCH_VERSION="v$MAJOR.$MINOR.$((PATCH + 1))"
MINOR_VERSION="v$MAJOR.$((MINOR + 1)).0"
MAJOR_VERSION="v$((MAJOR + 1)).0.0"
echo "v2_next_patch=$PATCH_VERSION" >> $GITHUB_OUTPUT
echo "v2_next_minor=$MINOR_VERSION" >> $GITHUB_OUTPUT
echo "v2_next_major=$MAJOR_VERSION" >> $GITHUB_OUTPUT
echo "✅ Patch: v$CURRENT_V2 → $PATCH_VERSION"
echo "✅ Minor: v$CURRENT_V2 → $MINOR_VERSION"
echo "✅ Major: v$CURRENT_V2 → $MAJOR_VERSION"
else
echo "❌ v2 version file not found"
fi
test-commit-analysis:
name: Test Commit Analysis
runs-on: ubuntu-latest
needs: test-permissions
if: needs.test-permissions.outputs.authorized == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test commit analysis
run: |
echo "🧪 Testing commit analysis..."
# Get recent commits for testing
echo "Recent commits:"
git log --oneline -10
# Test conventional commit detection
RECENT_COMMITS=$(git log --oneline --since="7 days ago")
echo "Commits from last 7 days:"
echo "$RECENT_COMMITS"
# Analyze for release type
RELEASE_TYPE="patch"
if echo "$RECENT_COMMITS" | grep -q "feat!\|fix!\|BREAKING CHANGE:"; then
RELEASE_TYPE="major"
elif echo "$RECENT_COMMITS" | grep -q "feat\|BREAKING CHANGE"; then
RELEASE_TYPE="minor"
fi
echo "✅ Detected release type: $RELEASE_TYPE"
test-summary:
name: Test Summary
runs-on: ubuntu-latest
needs: [test-permissions, test-changelog-extraction, test-version-detection, test-commit-analysis]
if: always()
steps:
- name: Print test results
run: |
echo "# 🧪 Nightly Release Workflow Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ needs.test-permissions.result }}" == "success" ]; then
echo "✅ **Permissions Test**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Permissions Test**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.test-changelog-extraction.result }}" == "success" ]; then
echo "✅ **Changelog Extraction**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Changelog Extraction**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.test-version-detection.result }}" == "success" ]; then
echo "✅ **Version Detection**: Passed" >> $GITHUB_STEP_SUMMARY
echo " - Current v2: ${{ needs.test-version-detection.outputs.v2_current_version }}" >> $GITHUB_STEP_SUMMARY
echo " - Next patch: ${{ needs.test-version-detection.outputs.v2_next_patch }}" >> $GITHUB_STEP_SUMMARY
echo " - Next minor: ${{ needs.test-version-detection.outputs.v2_next_minor }}" >> $GITHUB_STEP_SUMMARY
echo " - Next major: ${{ needs.test-version-detection.outputs.v2_next_major }}" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Version Detection**: Failed" >> $GITHUB_STEP_SUMMARY
fi
if [ "${{ needs.test-commit-analysis.result }}" == "success" ]; then
echo "✅ **Commit Analysis**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Commit Analysis**: Failed" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Note**: This was a dry-run test. No actual releases were created." >> $GITHUB_STEP_SUMMARY

View file

@ -1,129 +0,0 @@
name: Auto Release on Changelog Update
on:
push:
branches:
- v3-alpha
paths:
- 'v3/UNRELEASED_CHANGELOG.md'
workflow_dispatch:
inputs:
dry_run:
description: 'Run in dry-run mode (no actual release)'
required: false
default: false
type: boolean
jobs:
check-permissions:
name: Check Release Permissions
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.check.outputs.authorized }}
steps:
- name: Check if user is authorized for releases
id: check
run: |
# Only allow specific users to trigger releases
AUTHORIZED_USERS="leaanthony"
if [[ "$AUTHORIZED_USERS" == *"${{ github.actor }}"* ]]; then
echo "✅ User ${{ github.actor }} is authorized for releases"
echo "authorized=true" >> $GITHUB_OUTPUT
else
echo "❌ User ${{ github.actor }} is not authorized for releases"
echo "authorized=false" >> $GITHUB_OUTPUT
fi
trigger-release:
name: Trigger v3-alpha Release
permissions:
contents: read
actions: write
runs-on: ubuntu-latest
needs: check-permissions
if: needs.check-permissions.outputs.authorized == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: v3-alpha
fetch-depth: 0
token: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
- name: Check for unreleased changelog content
id: changelog_check
run: |
echo "🔍 Checking UNRELEASED_CHANGELOG.md for content..."
cd v3
# Check if UNRELEASED_CHANGELOG.md has actual content beyond the template
if [ -f "UNRELEASED_CHANGELOG.md" ]; then
# Use a simple check for actual content (bullet points starting with -)
CONTENT_LINES=$(grep -E "^\s*-\s+[^[:space:]]" UNRELEASED_CHANGELOG.md | wc -l)
if [ "$CONTENT_LINES" -gt 0 ]; then
echo "✅ Found $CONTENT_LINES content lines in UNRELEASED_CHANGELOG.md"
echo "has_content=true" >> $GITHUB_OUTPUT
else
echo " No actual content found in UNRELEASED_CHANGELOG.md"
echo "has_content=false" >> $GITHUB_OUTPUT
fi
else
echo "❌ UNRELEASED_CHANGELOG.md not found"
echo "has_content=false" >> $GITHUB_OUTPUT
fi
- name: Trigger nightly release workflow
if: steps.changelog_check.outputs.has_content == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.WAILS_REPO_TOKEN || github.token }}
script: |
const response = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'nightly-release-v3.yml',
ref: 'v3-alpha',
inputs: {
force_release: 'true',
dry_run: '${{ github.event.inputs.dry_run || "false" }}'
}
});
console.log('🚀 Successfully triggered nightly release workflow');
console.log(`Workflow dispatch response status: ${response.status}`);
// Create a summary
core.summary
.addHeading('🚀 Auto Release Triggered')
.addRaw('The v3-alpha release workflow has been automatically triggered due to changes in UNRELEASED_CHANGELOG.md')
.addTable([
[{data: 'Trigger', header: true}, {data: 'Value', header: true}],
['Repository', context.repo.repo],
['Branch', 'v3-alpha'],
['Actor', context.actor],
['Dry Run', '${{ github.event.inputs.dry_run || "false" }}'],
['Force Release', 'true']
])
.addRaw('\n---\n*This release was automatically triggered by the unreleased-changelog-trigger workflow*')
.write();
- name: No content found
if: steps.changelog_check.outputs.has_content == 'false'
run: |
echo " No content found in UNRELEASED_CHANGELOG.md, skipping release trigger"
echo "## No Release Triggered" >> $GITHUB_STEP_SUMMARY
echo "**Reason:** UNRELEASED_CHANGELOG.md does not contain actual changelog content" >> $GITHUB_STEP_SUMMARY
echo "**Action:** No release workflow was triggered" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "To trigger a release, add actual changelog entries to the UNRELEASED_CHANGELOG.md file." >> $GITHUB_STEP_SUMMARY
- name: Unauthorized user
if: needs.check-permissions.outputs.authorized == 'false'
run: |
echo "❌ User ${{ github.actor }} is not authorized to trigger releases"
echo "## ❌ Unauthorized Release Attempt" >> $GITHUB_STEP_SUMMARY
echo "**User:** ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
echo "**Action:** Release trigger was blocked due to insufficient permissions" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Only authorized users can trigger automatic releases via changelog updates." >> $GITHUB_STEP_SUMMARY

View file

@ -15,7 +15,7 @@ jobs:
- name: Verify Changed files
id: changed-files
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
uses: tj-actions/changed-files@v35
with:
files: |
website/**/*.mdx
@ -25,7 +25,7 @@ jobs:
- name: Setup Nodejs
uses: actions/setup-node@v2
with:
node-version: 20.x
node-version: 18.x
- name: Setup Task
uses: arduino/setup-task@v1

35
.github/workflows/v3-docs.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: v3 docs
on:
push:
branches:
- v3-alpha
paths:
- 'mkdocs-website/**/*'
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
defaults:
run:
working-directory: ./mkdocs-website
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: sudo apt-get install pngquant
- run: pip install pillow cairosvg
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
- run: mkdocs build --config-file mkdocs.insiders.yml
- run: mkdocs gh-deploy --force
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

View file

@ -1,8 +0,0 @@
modules = ["go-1.21", "web", "nodejs-20"]
run = "go run v2/cmd/wails/main.go"
[nix]
channel = "stable-24_05"
[deployment]
run = ["sh", "-c", "go run v2/cmd/wails/main.go"]

1
CNAME Normal file
View file

@ -0,0 +1 @@
v3alpha.wails.io

View file

@ -1,160 +0,0 @@
<p align="center" style="text-align: center">
<img src="./assets/images/logo-universal.png" width="55%"><br/>
</p>
<p align="center">
Erschaffe Desktop Anwendungen mit Go & Web Technologien.
<br/>
<br/>
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
</a>
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
</a>
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
</a>
<a href="https://github.com/wailsapp/wails/issues">
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
</a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
</a>
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
</a>
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
</a>
</p>
<div align="center">
<strong>
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md)
</samp>
</strong>
</div>
## Inhaltsverzeichnis
- [Inhaltsverzeichnis](#inhaltsverzeichnis)
- [Einführung](#einführung)
- [Funktionen](#funktionen)
- [Roadmap](#roadmap)
- [Loslegen](#loslegen)
- [Sponsoren](#sponsoren)
- [FAQ](#faq)
- [Sterne Überblick](#sterne-überblick)
- [Mitwirkende](#mitwirkende)
- [Lizenz](#lizenz)
- [Inspiration](#inspiration)
## Einführung
Die herkömmliche Methode zur Bereitstellung von Web-Interfaces für Go ist über einen eingebauten Webserver.
Wails nutzt einen anderen Weg. Es kann sowohl Go-Code als auch ein Web-Frontend in eine einzige Datei bauen.
Beigelieferte Werkzeuge übernehmen die Projekterstellung, den Kompilierungsprozess und das bauen.
Du musst nur kreativ werden.
## Funktionen
- Nutze Standard Go für das Backend
- Nutze eine Frontend Technologie mit der du dich bereits auskennst um dein UI zu bauen.
- Erschaffe schnell und einfach Frontends mit vorgefertigten Vorlagen für deine Go-Programme
- Nutze Javascript um Go Methoden aufzurufen
- Automatisch generierte Typescript Definitionen für deine Go Strukturen und Methoden
- Native Dialoge und Menüs
- Native Dark-/Lightmode Unterstützung
- Unterstützt moderne Transluzenz- und Milchglaseffekte
- Vereinheitlichtes Eventsystem zwischen Go und Javascript
- Leistungsstarkes CLI-Tool zum einfachen erstellen und bauen von Projekten
- Multiplattformen
- Nutze native Render-Engines - _keine eingebetteten Browser_!
### Roadmap
Die Projekt Roadmap kann [hier](https://github.com/wailsapp/wails/discussions/1484) gefunden werden. Bitte lies diese
durch bevor du eine Idee vorschlägst
## Loslegen
Die Installationsinstruktionen sind auf der [offiziellen Website](https://wails.io/docs/gettingstarted/installation).
## Sponsoren
Dieses Projekt wird von diesen freundlichen Leuten und Firmen unterstützt:
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
<p align="center">
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
</p>
## FAQ
- Ist das eine Alternative zu Electron?
Hängt von deinen Anforderungen ab. Wails wurde entwickelt um das Go-Programmieren leicht zu machen und effiziente
Desktop-Anwendungen zu erstellen oder ein Frontend zu einer bestehenden Anwendung hinzuzufügen.
Wails bietet native Elemente wie Dialoge und Menüs und könnte somit als eine leichte effiziente Electron-Alternative
betrachtet werden.
- Für wen ist dieses projekt geeignet?
Go Entwickler, die ein HTML/CSS/JS-Frontend in ihre Anwendung integrieren möchten, ohne einen Webserver zu erstellen und
einen Browser öffnen zu müssen, um dieses zu sehen
- Wie kam es zu diesem Namen?
Als ich WebView sah dachte ich "Was ich wirklich will, ist ein Werkzeug für die Erstellung von WebView Anwendungen so wie Rails für Ruby".
Also war es zunächst ein Wortspiel (Webview on Rails). Zufälligerweise ist es auch ein Homophon des englischen Namens des [Landes](https://en.wikipedia.org/wiki/Wales), aus dem ich komme.
Also ist es dabei geblieben.
## Sterne Überblick
<a href="https://star-history.com/#wailsapp/wails&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
</picture>
</a>
## Mitwirkende
Die Liste der Mitwirkenden wird zu groß für diese Readme. All die fantastischen Menschen, die zu diesem
Projekt beigetragen haben, haben [hier](https://wails.io/credits#contributors) ihre eigene Seite.
## Lizenz
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
## Inspiration
Dieses Projekt wurde hauptsächlich zu den folgenden Alben entwickelt
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)

View file

@ -25,7 +25,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -42,8 +42,7 @@
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[Русский](README.ru.md)
</samp>
</strong>

View file

@ -1,144 +0,0 @@
<p align="center" style="text-align: center">
<img src="./assets/images/logo-universal.png" width="55%"><br/>
</p>
<p align="center">
Créer des applications de bureau avec Go et les technologies Web.
<br/>
<br/>
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
</a>
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
</a>
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
</a>
<a href="https://github.com/wailsapp/wails/issues">
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
</a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
</a>
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
</a>
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
</a>
</p>
<div align="center">
<strong>
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
</samp>
</strong>
</div>
## Sommaire
- [Sommaire](#sommaire)
- [Introduction](#introduction)
- [Fonctionnalités](#fonctionnalités)
- [Feuille de route](#feuille-de-route)
- [Démarrage](#démarrage)
- [Les sponsors](#les-sponsors)
- [Foire aux questions](#foire-aux-questions)
- [Les étoiles au fil du temps](#les-étoiles-au-fil-du-temps)
- [Les contributeurs](#les-contributeurs)
- [License](#license)
- [Inspiration](#inspiration)
## Introduction
La méthode traditionnelle pour fournir des interfaces web aux programmes Go consiste à utiliser un serveur web intégré. Wails propose une approche différente : il offre la possibilité d'intégrer à la fois le code Go et une interface web dans un seul binaire. Des outils sont fournis pour vous faciliter la tâche en gérant la création, la compilation et le regroupement des projets. Il ne vous reste plus qu'à faire preuve de créativité!
## Fonctionnalités
- Utiliser Go pour le backend
- Utilisez n'importe quelle technologie frontend avec laquelle vous êtes déjà familier pour construire votre interface utilisateur.
- Créez rapidement des interfaces riches pour vos programmes Go à l'aide de modèles prédéfinis.
- Appeler facilement des méthodes Go à partir de Javascript
- Définitions Typescript auto-générées pour vos structures et méthodes Go
- Dialogues et menus natifs
- Prise en charge native des modes sombre et clair
- Prise en charge des effets modernes de translucidité et de "frosted window".
- Système d'événements unifié entre Go et Javascript
- Outil puissant pour générer et construire rapidement vos projets
- Multiplateforme
- Utilise des moteurs de rendu natifs - _pas de navigateur intégré_ !
### Feuille de route
La feuille de route du projet peut être consultée [ici](https://github.com/wailsapp/wails/discussions/1484). Veuillez consulter avant d'ouvrir une demande d'amélioration.
## Démarrage
Les instructions d'installation se trouvent sur le site [site officiel](https://wails.io/docs/gettingstarted/installation).
## Les sponsors
Ce projet est soutenu par ces personnes aimables et entreprises:
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
<p align="center">
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
</p>
## Foire aux questions
- S'agit-il d'une alternative à Electron ?
Cela dépend de vos besoins. Il est conçu pour permettre aux programmeurs Go de créer facilement des applications de bureau légères ou d'ajouter une interface à leurs applications existantes. Wails offre des éléments natifs tels que des menus et des boîtes de dialogue, il peut donc être considéré comme une alternative légère à electron.
- À qui s'adresse ce projet ?
Les programmeurs Go qui souhaitent intégrer une interface HTML/JS/CSS à leurs applications, sans avoir à créer un serveur et à ouvrir un navigateur pour l'afficher.
- Pourquoi ce nom ??
Lorsque j'ai vu WebView, je me suis dit : "Ce que je veux vraiment, c'est un outil pour construire une application WebView, un peu comme Rails l'est pour Ruby". Au départ, il s'agissait donc d'un jeu de mots (Webview on Rails). Il se trouve que c'est aussi un homophone du nom anglais du [Pays](https://en.wikipedia.org/wiki/Wales) d'où je viens. Il s'est donc imposé.
## Les étoiles au fil du temps
[![Graphique de l'histoire des étoiles](https://api.star-history.com/svg?repos=wailsapp/wails&type=Date)](https://star-history.com/#wailsapp/wails&Date)
## Les contributeurs
La liste des contributeurs devient trop importante pour le readme ! Toutes les personnes extraordinaires qui ont contribué à ce projet ont leur propre page [ici](https://wails.io/credits#contributors).
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
## Inspiration
Ce projet a été principalement codé sur les albums suivants :
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)

View file

@ -27,7 +27,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -44,8 +44,7 @@
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[Русский](README.ru.md)
</samp>
</strong>
@ -55,16 +54,17 @@
- [目次](#目次)
- [はじめに](#はじめに)
- [特徴](#特徴)
- [公式サイト](#公式サイト)
- [ロードマップ](#ロードマップ)
- [始め方](#始め方)
- [特徴](#特徴)
- [スポンサー](#スポンサー)
- [始め方](#始め方)
- [FAQ](#faq)
- [スター数の推移](#スター数の推移)
- [コントリビューター](#コントリビューター)
- [特記事項](#特記事項)
- [スペシャルサンクス](#スペシャルサンクス)
- [ライセンス](#ライセンス)
- [インスピレーション](#インスピレーション)
## はじめに
@ -72,35 +72,44 @@ Go プログラムにウェブインタフェースを提供する従来の方
Wails では Go のコードとウェブフロントエンドを単一のバイナリにまとめる機能を提供します。
また、プロジェクトの作成、コンパイル、ビルドを行うためのツールが提供されています。あなたがすべきことは創造性を発揮することです!
## 特徴
### 公式サイト
- バックエンドには Go を利用しています
- 使い慣れたフロントエンド技術を利用して UI を構築できます
- あらかじめ用意されたテンプレートを利用することで、リッチなフロントエンドを備えた Go プログラムを素早く作成できます
- JavaScript から Go のメソッドを簡単に呼び出すことができます
- あなたの書いた Go の構造体やメソットに応じた TypeScript の定義が自動生成されます
- ネイティブのダイアログとメニューが利用できます
- ネイティブなダーク/ライトモードをサポートします
- モダンな半透明や「frosted window」エフェクトをサポートしています
- Go と JavaScript 間で統一されたイベント・システムを備えています
- プロジェクトを素早く生成して構築する強力な cli ツールを用意しています
- マルチプラットフォームに対応しています
- ネイティブなレンダリングエンジンを使用しています - _つまりブラウザを埋め込んでいるわけではありません_
Version 2:
Wails v2 が 3 つのプラットフォームでベータ版としてリリースされました。興味のある方は[新しいウェブサイト](https://wails.io)をご覧ください。
レガシー版 v1:
レガシー版 v1 のドキュメントは[https://wails.app](https://wails.app)で見ることができます。
### ロードマップ
プロジェクトのロードマップは[こちら](https://github.com/wailsapp/wails/discussions/1484)になります。
機能拡張のリクエストを出す前にご覧ください。
## 始め方
## 特徴
インストール方法は[公式サイト](https://wails.io/docs/gettingstarted/installation)に掲載されています。
- バックエンドには Go を利用しています
- 使い慣れたフロントエンド技術を利用して UI を構築できます
- あらかじめ用意されたテンプレートを利用することで、リッチなフロントエンドを備えた Go プログラムを作成できます
- JavaScript から Go のメソッドを簡単に呼び出すことができます
- あなたの書いた Go の構造体やメソットに応じた TypeScript の定義が自動生成されます
- ネイティブのダイアログとメニューが利用できます
- モダンな半透明や「frosted window」エフェクトをサポートしています
- Go と JavaScript 間で統一されたイベント・システムを備えています
- プロジェクトを素早く生成して構築する強力な cli ツールを用意しています
- マルチプラットフォームに対応しています
- ネイティブなレンダリングエンジンを使用しています - _つまりブラウザを埋め込んでいるわけではありません_
## スポンサー
このプロジェクトは、以下の方々・企業によって支えられています。
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
## 始め方
インストール方法は[公式サイト](https://wails.io/docs/gettingstarted/installation)に掲載されています。
## FAQ
- Electron の代替品になりますか?
@ -121,18 +130,20 @@ Wails では Go のコードとウェブフロントエンドを単一のバイ
## スター数の推移
[![Star History Chart](https://api.star-history.com/svg?repos=wailsapp/wails&type=Date)](https://star-history.com/#wailsapp/wails&Date)
[![スター数の推移](https://starchart.cc/wailsapp/wails.svg)](https://starchart.cc/wailsapp/wails)
## コントリビューター
貢献してくれた方のリストが大きくなりすぎて、readme に入りきらなくなりました!
このプロジェクトに貢献してくれた素晴らしい方々のページは[こちら](https://wails.io/credits#contributors)です。
## ライセンス
## 特記事項
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
このプロジェクトは以下の方々の協力がなければ、実現しなかったと思います。
## インスピレーション
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - 彼のサポートとフィードバックはとても大きいものでした。
- [Serge Zaitsev](https://github.com/zserge) - Wails のウィンドウで使用している[Webview](https://github.com/zserge/webview)の作者です。
- [Byron](https://github.com/bh90210) - 時には Byron が一人でこのプロジェクトを存続させてくれたこともありました。彼の素晴らしいインプットがなければ v1 に到達することはなかったでしょう。
プロジェクトを進める際に、以下のアルバムたちも支えてくれています。
@ -150,3 +161,20 @@ Wails では Go のコードとウェブフロントエンドを単一のバイ
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
## スペシャルサンクス
<p align="center" style="text-align: center">
<a href="https://pace.dev"><img src="/assets/images/pace.jpeg"/></a><br/>
このプロジェクトを後援し、WailsをApple Siliconに移植する取り組みを支援してくれた <a href="https://pace.dev">Pace</a> に <i>とても</i>感謝しています!<br/><br/>
パワフルで素早く簡単に使えるプロジェクト管理ツールをお探しなら、ぜひチェックしてみてください!<br/><br/>
</p>
<p align="center" style="text-align: center">
ライセンスを提供していただいたJetBrains社に感謝します<br/><br/>
ロゴをクリックして、感謝の気持ちを伝えてください!<br/><br/>
<a href="https://www.jetbrains.com?from=Wails"><img src="/assets/images/jetbrains-grayscale.png" width="30%"></a>
</p>
## ライセンス
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)

View file

@ -27,7 +27,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -44,8 +44,7 @@
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[Русский](README.ru.md)
</samp>
</strong>

View file

@ -25,7 +25,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -42,8 +42,7 @@
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[Русский](README.ru.md)
</samp>
</strong>
@ -87,7 +86,7 @@ make this easy for you by handling project creation, compilation and bundling. A
### Roadmap
The project roadmap may be found [here](https://github.com/wailsapp/wails/discussions/1484). Please consult
it before creating an enhancement request.
this before open up an enhancement request.
## Getting Started
@ -98,9 +97,9 @@ The installation instructions are on the [official website](https://wails.io/doc
This project is supported by these kind people / companies:
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
## Powered By
[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSource)
<p align="center">
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
</p>
## FAQ
@ -123,13 +122,7 @@ This project is supported by these kind people / companies:
## Stargazers over time
<a href="https://star-history.com/#wailsapp/wails&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
</picture>
</a>
[![Star History Chart](https://api.star-history.com/svg?repos=wailsapp/wails&type=Date)](https://star-history.com/#wailsapp/wails&Date)
## Contributors

View file

@ -25,7 +25,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -41,8 +41,7 @@
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md)
</samp>
</strong>

View file

@ -25,7 +25,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -41,8 +41,7 @@
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md)
</samp>
</strong>
@ -53,7 +52,7 @@
- [Содержание](#содержание)
- [Вступление](#вступление)
- [Особенности](#особенности)
- [Roadmap](#roadmap)
- [Roadmap](#roadmap)
- [Быстрый старт](#быстрый-старт)
- [Спонсоры](#спонсоры)
- [FAQ](#faq)
@ -74,12 +73,12 @@
- Использование Go для backend
- Поддержка любой frontend технологии, с которой вы уже знакомы для создания вашего UI
- Быстрое создание frontend для ваших программ, используя готовые шаблоны
- Очень лёгкий вызов функций Go из JavaScript
- Автогенерация TypeScript типов для Go структур и функций
- Очень лёгкий вызов функция Go из JavaScript
- Автогене рация TypeScript типов для Go структур и функций
- Нативные диалоги и меню
- Нативная поддержка тёмной и светлой темы
- Поддержка современных эффектов прозрачности и "матового окна"
- Единая система эвентов для Go и JavaScript
- Поддержка современной прозрачности и эффекта "матового окна"
- Единая система Эвентов для Go и JavaScript
- Мощный CLI для быстрого создания ваших проектов
- Мультиплатформенность
- Использование нативного движка рендеринга - нет встроенному браузеру!
@ -106,28 +105,29 @@ Roadmap проекта вы можете найти [здесь](https://github.
- Это альтернатива Electron?
Зависит от ваших требований. Wails разработан для легкого создания Desktop приложений или
расширения интерфейсной части существующих приложений для программистов на Go. Wails действительно
предлагает встроенные элементы, такие как меню и диалоги, так что его можно считать облегченной альтернативой Electron.
Зависит от ваших требований. Wails разработан для легкого создания Desktop приложений или расширения интерфейсной
части к своим существующим приложениям программистам Go. Wails действительно предлагает встроенные элементы, такие как
меню и диалоги, так что его можно считать облегченной альтернативой Electron.
- Для кого предназначен этот проект?
- Для кого нацелен этот проект?
Для Golang программистов, которые хотят создавать приложения, используя HTML, JS и CSS,
без создания веб-сервера и открытия браузера для их просмотра.
Для Golang программистов, которые хотят создавать приложение используя HTML JS и CSS, без создания Web сервера и
открытия браузера для его просмотра.
- Что это за название?
Когда я увидел WebView, я подумал: "Что мне действительно нужно, так это инструменты для создания приложения WebView,
немного похожие на Rails для Ruby". Изначально это была игра слов (Webview on Rails). Просто так получилось, что это
также омофон английского названия для [Страны](https://en.wikipedia.org/wiki/Wales) от куда я родом. Так что это прижилось.
немного похожие на Rails для Ruby". Итак, изначально это была игра слов (Webview on Rails). Просто так получилось, что
это также омофон английского названия для [Страны](https://en.wikipedia.org/wiki/Wales) от куда я родом. Так что это
прижилось.
## График звёздочек репозитория по времени
## График звёздочек репозитория, относительно времени
[![График звёзд](https://api.star-history.com/svg?repos=wailsapp/wails&type=Date)](https://star-history.com/#wailsapp/wails&Date)
## Контрибьюторы
## Контребьюторы
Список участников слишком велик для README! У всех замечательных людей, которые внесли свой вклад в этот
Список участников слишком большой для README! У всех замечательных людей, которые внесли свой вклад в этот
проект, есть своя [страничка](https://wails.io/credits#contributors).
## Лицензия

View file

@ -1,156 +0,0 @@
<p align="center" style="text-align: center">
<img src="./assets/images/logo-universal.png" width="55%"><br/>
</p>
<p align="center">
Go ve Web Teknolojilerini kullanarak masaüstü uygulamaları oluşturun.
<br/>
<br/>
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
</a>
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
</a>
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
</a>
<a href="https://github.com/wailsapp/wails/issues">
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
</a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
</a>
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
</a>
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
</a>
</p>
<div align="center">
<strong>
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) ·
[Türkçe](README.tr.md)
</samp>
</strong>
</div>
## İçerik
- [İçerik](#içerik)
- [Giriş](#giriş)
- [Özellikler](#özellikler)
- [Yol Haritası](#yol-haritası)
- [Başlarken](#başlarken)
- [Sponsorlar](#sponsorlar)
- [Sıkça sorulan sorular](#sıkça-sorulan-sorular)
- [Zaman içinda yıldızlayanlar](#zaman-içinde-yıldızlayanlar)
- [Katkıda bulunanlar](#katkıda-bulunanlar)
- [Lisans](#lisans)
- [İlham](#ilham)
## Giriş
Go programlarına web arayüzleri sağlamak için geleneksel yöntem, yerleşik bir web sunucusu kullanmaktır. Wails, farklı bir yaklaşım sunar: Hem Go kodunu hem de bir web ön yüzünü tek bir ikili dosyada paketleme yeteneği sağlar. Proje oluşturma, derleme ve paketleme işlemlerini kolaylaştıran araçlar sunar. Tek yapmanız gereken yaratıcı olmaktır!
## Özellikler
- Backend için standart Go kullanın
- Kullanıcı arayüzünüzü oluşturmak için zaten aşina olduğunuz herhangi bir frontend teknolojisini kullanın
- Hazır şablonlar kullanarak Go programlarınız için hızlıca zengin ön yüzler oluşturun
- Javascript'ten Go metodlarını kolayca çağırın
- Go yapı ve metodlarınız için otomatik oluşturulan Typescript tanımları
- Yerel Diyaloglar ve Menüler
- Yerel Karanlık / Aydınlık mod desteği
- Modern saydamlık ve "buzlu cam" efektlerini destekler
- Go ve Javascript arasında birleşik olay sistemi
- Projelerinizi hızlıca oluşturmak ve derlemek için güçlü bir komut satırı aracı
- Çoklu platform desteği
- Yerel render motorlarını kullanır - _gömülü tarayıcı yok_!
### Yol Haritesı
Proje yol haritasına [buradan](https://github.com/wailsapp/wails/discussions/1484) ulaşabilirsiniz. Lütfen bir iyileştirme talebi oluşturmadan önce danışın.
## Başlarken
Kurulum talimatları [resmi web sitesinde](https://wails.io/docs/gettingstarted/installation) bulunmaktadır.
## Sponsorlar
Bu proje, aşağıdaki nazik insanlar / şirketler tarafından desteklenmektedir:
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
<p align="center">
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
</p>
## Sıkça Sorulan Sorular
- Bu Electron'a alternatif mi?
Gereksinimlerinize bağlıdır. Go programcılarının hafif masaüstü uygulamaları yapmasını veya mevcut uygulamalarına bir ön yüz eklemelerini kolaylaştırmak için tasarlanmıştır. Wails, menüler ve diyaloglar gibi yerel öğeler sunduğundan, hafif bir Electron alternatifi olarak kabul edilebilir.
- Bu proje kimlere yöneliktir?
HTML/JS/CSS ön yüzünü uygulamalarıyla birlikte paketlemek isteyen, ancak bir sunucu oluşturup bir tarayıcı açmaya başvurmadan bunu yapmak isteyen Go programcıları için.
- İsmin anlamı nedir?
WebView'i gördüğümde, "Aslında istediğim şey, WebView uygulaması oluşturmak için araçlar, biraz Rails'in Ruby için olduğu gibi" diye düşündüm. Bu nedenle başlangıçta kelime oyunu (Rails üzerinde Webview) olarak ortaya çıktı. Ayrıca, benim geldiğim [ülkenin](https://en.wikipedia.org/wiki/Wales) İngilizce adıyla homofon olması tesadüf oldu. Bu yüzden bu isim kaldı.
## Zaman içinda yıldızlayanlar
<a href="https://star-history.com/#wailsapp/wails&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
</picture>
</a>
## Katkıda Bulunanlar
Katkıda bulunanların listesi, README için çok büyük hale geldi! Bu projeye katkıda bulunan tüm harika insanların kendi sayfaları [burada](https://wails.io/credits#contributors) bulunmaktadır.
## Lisans
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
## İlham
Bu proje esas olarak aşağıdaki albümler dinlenilerek kodlandı:
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)

View file

@ -1,159 +0,0 @@
<p align="center" style="text-align: center">
<img src="./assets/images/logo-universal.png" width="55%"><br/>
</p>
<p align="center">
Go va Web texnologiyalaridan foydalangan holda ish stoli ilovalarini yarating
<br/>
<br/>
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
</a>
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
</a>
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
</a>
<a href="https://github.com/wailsapp/wails/issues">
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
</a>
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
</a>
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
</a>
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
</a>
</p>
<div align="center">
<strong>
<samp>
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
</samp>
</strong>
</div>
## Tarkib
- [Tarkib](#tarkib)
- [Kirish](#kirish)
- [Xususiyatlari](#xususiyatlari)
- [Yo'l xaritasi](#yol-xaritasi)
- [Ishni boshlash](#ishni-boshlash)
- [Homiylar](#homiylar)
- [FAQ](#faq)
- [Vaqt o'tishi bilan yulduzlar](#vaqt-otishi-bilan-yulduzlar)
- [Ishtirokchilar](#homiylar)
- [Litsenziya](#litsenziya)
- [Ilhomlanish](#ilhomlanish)
## Kirish
Odatda, Go dasturlari uchun veb-interfeyslar o'rnatilgan veb-server va veb-brauzerdir.
Walls boshqacha yondashuvni qo'llaydi: u Go kodini ham, veb-interfeysni ham bitta ikkilik (e.g: EXE)fayliga o'raydi.
Loyihalarni yaratish, kompilyatsiya qilish va birlashtirishni boshqarish orqali ilovangizni yaratishni osonlashtiradi.
Hamma narsa faqat sizning tasavvuringiz bilan cheklangan!
## Xususiyatlari
- Backend uchun standart Go dan foydalaning
- UI yaratish uchun siz allaqachon tanish bo'lgan har qanday frontend texnologiyasidan foydalaning
- Oldindan tayyorlangan shablonlardan foydalanib, Go dasturlaringiz uchun tezda boy frontendlarni yarating
- Javascriptdan Go methodlarini osongina chaqiring
- Go struktura va methodlari uchun avtomatik yaratilgan Typescript ta'riflari
- Mahalliy Dialoglar va Menyular
- Mahalliy Dark / Light rejimini qo'llab-quvvatlash
- Zamonaviy shaffoflik va "muzli oyna" effektlarini qo'llab-quvvatlaydi
- Go va Javascript o'rtasidagi yagona hodisa tizimi
- Loyihalaringizni tezda yaratish va qurish uchun kuchli cli vositasi
- Ko'p platformali
- Mahalliy renderlash mexanizmlaridan foydalanadi - _o'rnatilgan brauzer yo'q_!
### Yo'l xaritasi
Loyihaning yoʻl xaritasini [bu yerdan](https://github.com/wailsapp/wails/discussions/1484) topish mumkin. Iltimos, maslahatlashing
Buni yaxshilash so'rovini ochishdan oldin.
## Ishni boshlash
O'rnatish bo'yicha ko'rsatmalar [Rasmiy veb saytda](https://wails.io/docs/gettingstarted/installation) mavjud.
## Homiylar
Ushbu loyiha quyidagi mehribon odamlar / kompaniyalar tomonidan qo'llab-quvvatlanadi:
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
<p align="center">
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
</p>
## FAQ
- Bu Elektronga muqobilmi?
Sizning talablaringizga bog'liq. Bu Go dasturchilariga yengil ish stoli yaratishni osonlashtirish uchun yaratilgan
ilovalar yoki ularning mavjud ilovalariga frontend qo'shing. Wails menyular kabi mahalliy elementlarni taklif qiladi
va dialoglar, shuning uchun uni yengil elektron muqobili deb hisoblash mumkin.
- Ushbu loyiha kimlar uchun?
Server yaratmasdan va uni ko'rish uchun brauzerni ochmasdan, o'z ilovalari bilan HTML/JS/CSS orqali frontendini birlashtirmoqchi bo'lgan dasturchilar uchun.
- Bu qanday nom?
Men WebViewni ko'rganimda, men shunday deb o'yladim: "Menga WebView ilovasini yaratish uchun vositalar kerak.
biroz Rails for Rubyga o'xshaydi." Demak, dastlab bu so'zlar ustida o'yin edi (Railsda Webview). Shunday bo'ldi.
u men kelgan [Mamlakat](https://en.wikipedia.org/wiki/Wales)ning inglizcha nomining omofonidir.
## Vaqt o'tishi bilan yulduzlar
<a href="https://star-history.com/#wailsapp/wails&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
<img alt="Yulduzlar tarixi jadvali" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
</picture>
</a>
## Ishtirokchilar
Ishtirokchilar roʻyxati oʻqish uchun juda kattalashib bormoqda! Bunga hissa qo'shgan barcha ajoyib odamlarning
loyihada o'z sahifasi bor [bu yerga](https://wails.io/credits#contributors).
## Litsenziya
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
## Ilhomlanish
Ushbu loyiha asosan quyidagi albomlar uchun kodlangan:
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)

View file

@ -27,7 +27,7 @@
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
</a>
<a href="https://discord.gg/BrRSWTaxVK">
<img alt="Discord" src="https://img.shields.io/discord/1042734330029547630?logo=discord"/>
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
</a>
<br/>
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
@ -44,8 +44,7 @@
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
[Русский](README.ru.md) · [Francais](README.fr.md) · [Uzbek](README.uz.md) · [Deutsch](README.de.md) ·
[Türkçe](README.tr.md)
[Русский](README.ru.md)
</samp>
</strong>

View file

@ -1,38 +0,0 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 2.x.x | :white_check_mark: |
| 3.0.x-alpha | :x: |
## Reporting a Vulnerability
If you believe you have found a security vulnerability in our project, we encourage you to let us know right away.
We will investigate all legitimate reports and do our best to quickly fix the problem.
Before reporting though, please review our security policy below.
### How to Report
To report a security vulnerability, please use GitHub's [private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) feature. If possible, please include as much information as possible.
This may include steps to reproduce, impact of the vulnerability, and anything else you believe would help us understand the problem.
**Please do not include any sensitive or personal information in your report**.
### What to Expect
When you report a vulnerability, here's what you can expect:
- **Acknowledgement**: We will acknowledge your email within 48 hours, and you'll receive a more detailed response to your email within 72 hours indicating the next steps in handling your report.
- **Updates**: After the initial reply to your report, our team will keep you informed of the progress being made towards a fix and full announcement. These updates will be sent at least once a week.
- **Confidentiality**: We will maintain strict confidentiality of your report until the security issue is resolved.
- **Issue Resolution**: If the issue is confirmed, we will release a patch as soon as possible depending on complexity of the fix.
- **Recognition**: We recognize and appreciate every individual who helps us identify and fix vulnerabilities in our project. While we do not currently have a bounty program, we would be happy to publicly acknowledge your responsible disclosure.
We strive to make Wails safe for everyone, and we greatly appreciate the assistance of security researchers and users in helping us identify and fix vulnerabilities. Thank you for your contribution to the security of this project.

View file

@ -16,6 +16,11 @@ includes:
dir: v3
optional: true
docs:
taskfile: mkdocs-website
dir: mkdocs-website
optional: true
tasks:
contributors:check:
cmds:

1
mkdocs-website/CNAME Normal file
View file

@ -0,0 +1 @@
v3alpha.wails.io

45
mkdocs-website/README.md Normal file
View file

@ -0,0 +1,45 @@
# v3 Docs
This is the documentation for Wails v3. It is currently a work in progress.
If you do not wish to build it locally, it is available online at
[https://wailsapp.github.io/wails/](https://wailsapp.github.io/wails/).
## Recommended Setup Steps
Install the wails3 CLI if you haven't already:
```shell
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
```
The documentation uses mkdocs, so you will need to install
[Python](https://www.python.org/). Once installed, you can setup the
documentation by running the following command:
```bash
wails3 task docs:setup
```
This will install the required dependencies for you.
If you have installed the wails3 CLI, you can run the following command to build
the documentation and serve it locally:
```bash
wails3 task docs:serve
```
### Manual Setup
To install manually, you will need to do the following:
- Install [Python](https://www.python.org/)
- Run `pip install -r requirements.txt` to install the required dependencies
- Run `mkdocs serve` to serve the documentation locally
- Run `mkdocs build` to build the documentation
## Contributing
If you would like to contribute to the documentation, please feel free to open a
PR!

View file

@ -0,0 +1,59 @@
# https://taskfile.dev
version: '3'
tasks:
setup:
summary: Setup the project
preconditions:
- sh: python{{exeExt}} --version
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
cmds:
- python -m pip install -r requirements.txt --user
setup:insiders:
summary: Setup the project (insiders)
preconditions:
- sh: python{{exeExt}} --version
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
cmds:
- python -m pip install -r requirements.insiders.txt --user
upgrade:insiders:
summary: Upgrade the project (insiders)
preconditions:
- sh: python{{exeExt}} --version
msg: "Looks like Python isn't installed. Python is required to build the documentation: https://www.python.org/downloads/"
cmds:
- python -m pip install -r requirements.insiders.txt --upgrade --user
build:
summary: Builds the documentation
preconditions:
- sh: mkdocs --version
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
cmds:
- mkdocs build
serve:
summary: Builds the documentation and serves it locally
preconditions:
- sh: mkdocs --version
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
cmds:
- mkdocs serve
serve:insiders:
summary: Builds the documentation and serves it locally
preconditions:
- sh: mkdocs --version
msg: "Looks like mkdocs isn't installed. Run `wails3 task setup` or `task setup` in the documentation directory to install it."
cmds:
- mkdocs serve --config-file mkdocs.insiders.yml
update:api:
summary: Updates the API documentation
dir: generate
cmds:
- go run .

View file

@ -0,0 +1 @@
v3alpha.wails.io

View file

@ -0,0 +1,358 @@
# Application
The application API assists in creating an application using the Wails framework.
### New
API: `New(appOptions Options) *App`
`New(appOptions Options)` creates a new application using the given application
options . It applies default values for unspecified options, merges them with
the provided ones, initializes and returns an instance of the application.
In case of an error during initialization, the application is stopped with the
error message provided.
It should be noted that if a global application instance already exists, that
instance will be returned instead of creating a new one.
```go title="main.go" hl_lines="6-9"
package main
import "github.com/wailsapp/wails/v3/pkg/application"
func main() {
app := application.New(application.Options{
Name: "WebviewWindow Demo",
// Other options
})
// Rest of application
}
```
### Get
`Get()` returns the global application instance. It's useful when you need to
access the application from different parts of your code.
```go
// Get the application instance
app := application.Get()
```
### Capabilities
API: `Capabilities() capabilities.Capabilities`
`Capabilities()` retrieves a map of capabilities that the application currently
has. Capabilities can be about different features the operating system provides,
like webview features.
```go
// Get the application capabilities
capabilities := app.Capabilities()
if capabilities.HasNativeDrag {
// Do something
}
```
### GetPID
API: `GetPID() int`
`GetPID()` returns the Process ID of the application.
```go
pid := app.GetPID()
```
### Run
API: `Run() error`
`Run()` starts the execution of the application and its components.
```go
app := application.New(application.Options{
//options
})
// Run the application
err := application.Run()
if err != nil {
// Handle error
}
```
### Quit
API: `Quit()`
`Quit()` quits the application by destroying windows and potentially other
components.
```go
// Quit the application
app.Quit()
```
### IsDarkMode
API: `IsDarkMode() bool`
`IsDarkMode()` checks if the application is running in dark mode. It returns a
boolean indicating whether dark mode is enabled.
```go
// Check if dark mode is enabled
if app.IsDarkMode() {
// Do something
}
```
### Hide
API: `Hide()`
`Hide()` hides the application window.
```go
// Hide the application window
app.Hide()
```
### Show
API: `Show()`
`Show()` shows the application window.
```go
// Show the application window
app.Show()
```
### NewWebviewWindow
API: `NewWebviewWindow() *WebviewWindow`
`NewWebviewWindow()` creates a new Webview window with default options, and
returns it.
```go
// Create a new webview window
window := app.NewWebviewWindow()
```
### NewWebviewWindowWithOptions
API:
`NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindow`
`NewWebviewWindowWithOptions()` creates a new webview window with custom
options. The newly created window is added to a map of windows managed by the
application.
```go
// Create a new webview window with custom options
window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
Name: "Main",
Title: "My Window",
Width: 800,
Height: 600,
})
```
### OnWindowCreation
API: `OnWindowCreation(callback func(window *WebviewWindow))`
`OnWindowCreation()` registers a callback function to be called when a window is
created.
```go
// Register a callback to be called when a window is created
app.OnWindowCreation(func(window *WebviewWindow) {
// Do something
})
```
### GetWindowByName
API: `GetWindowByName(name string) *WebviewWindow`
`GetWindowByName()` fetches and returns a window with a specific name.
```go
// Get a window by name
window := app.GetWindowByName("Main")
```
### CurrentWindow
API: `CurrentWindow() *WebviewWindow`
`CurrentWindow()` fetches and returns a pointer to the currently active window
in the application. If there is no window, it returns nil.
```go
// Get the current window
window := app.CurrentWindow()
```
### RegisterContextMenu
API: `RegisterContextMenu(name string, menu *Menu)`
`RegisterContextMenu()` registers a context menu with a given name. This menu
can be used later in the application.
```go
// Create a new menu
ctxmenu := app.NewMenu()
// Register the menu as a context menu
app.RegisterContextMenu("MyContextMenu", ctxmenu)
```
### SetMenu
API: `SetMenu(menu *Menu)`
`SetMenu()` sets the menu for the application. On Mac, this will be the global
menu. For Windows and Linux, this will be the default menu for any new window
created.
```go
// Create a new menu
menu := app.NewMenu()
// Set the menu for the application
app.SetMenu(menu)
```
### ShowAboutDialog
API: `ShowAboutDialog()`
`ShowAboutDialog()` shows an "About" dialog box. It can show the application's
name, description and icon.
```go
// Show the about dialog
app.ShowAboutDialog()
```
### Info
API: `InfoDialog()`
`InfoDialog()` creates and returns a new instance of `MessageDialog` with an
`InfoDialogType`. This dialog is typically used to display informational
messages to the user.
### Question
API: `QuestionDialog()`
`QuestionDialog()` creates and returns a new instance of `MessageDialog` with a
`QuestionDialogType`. This dialog is often used to ask a question to the user
and expect a response.
### Warning
API: `WarningDialog()`
`WarningDialog()` creates and returns a new instance of `MessageDialog` with a
`WarningDialogType`. As the name suggests, this dialog is primarily used to
display warning messages to the user.
### Error
API: `ErrorDialog()`
`ErrorDialog()` creates and returns a new instance of `MessageDialog` with an
`ErrorDialogType`. This dialog is designed to be used when you need to display
an error message to the user.
### OpenFile
API: `OpenFileDialog()`
`OpenFileDialog()` creates and returns a new `OpenFileDialogStruct`. This dialog
prompts the user to select one or more files from their file system.
### SaveFile
API: `SaveFileDialog()`
`SaveFileDialog()` creates and returns a new `SaveFileDialogStruct`. This dialog
prompts the user to choose a location on their file system where a file should
be saved.
### OpenDirectory
API: `OpenDirectoryDialog()`
`OpenDirectoryDialog()` creates and returns a new instance of `MessageDialog`
with an `OpenDirectoryDialogType`. This dialog enables the user to choose a
directory from their file system.
### On
API:
`On(eventType events.ApplicationEventType, callback func(event *Event)) func()`
`On()` registers an event listener for specific application events. The callback
function provided will be triggered when the corresponding event occurs. The
function returns a function that can be called to remove the listener.
### RegisterHook
API:
`RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()`
`RegisterHook()` registers a callback to be run as a hook during specific
events. These hooks are run before listeners attached with `On()`. The function
returns a function that can be called to remove the hook.
### GetPrimaryScreen
API: `GetPrimaryScreen() (*Screen, error)`
`GetPrimaryScreen()` returns the primary screen of the system.
### GetScreens
API: `GetScreens() ([]*Screen, error)`
`GetScreens()` returns information about all screens attached to the system.
This is a brief summary of the exported methods in the provided `App` struct. Do
note that for more detailed functionality or considerations, refer to the actual
Go code or further internal documentation.
## Options
```go title="application_options.go"
--8<--
../v3/pkg/application/options_application.go
--8<--
```
### Windows Options
```go title="application_options_windows.go"
--8<--
../v3/pkg/application/options_application_win.go
--8<--
```
### Mac Options
```go title="options_application_mac.go"
--8<--
../v3/pkg/application/options_application_mac.go
--8<--
```

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,50 @@
# Main Thread Functions
These methods are utility functions to run code on the main thread. This is
required when you want to run custom code on the UI thread.
### InvokeSync
API: `InvokeSync(fn func())`
This function runs the passed function (`fn`) synchronously. It uses a WaitGroup
(`wg`) to ensure that the main thread waits for the `fn` function to finish
before it continues. If a panic occurs inside `fn`, it will be passed to the
handler function `PanicHandler`, defined in the application options.
### InvokeSyncWithResult
API: `InvokeSyncWithResult[T any](fn func() T) (res T)`
This function works similarly to `InvokeSync(fn func())`, however, it yields a
result. Use this for calling any function with a single return.
### InvokeSyncWithError
API: `InvokeSyncWithError(fn func() error) (err error)`
This function runs `fn` synchronously and returns any error that `fn` produces.
Note that this function will recover from a panic if one occurs during `fn`'s
execution.
### InvokeSyncWithResultAndError
API:
`InvokeSyncWithResultAndError[T any](fn func() (T, error)) (res T, err error)`
This function runs `fn` synchronously and returns both a result of type `T` and
an error.
### InvokeAsync
API: `InvokeAsync(fn func())`
This function runs `fn` asynchronously. It runs the given function on the main
thread. If a panic occurs inside `fn`, it will be passed to the handler function
`PanicHandler`, defined in the application options.
---
_Note_: These functions will block execution until `fn` has finished. It's
critical to ensure that `fn` doesn't block. If you need to run a function that
blocks, use `InvokeAsync` instead.

View file

@ -0,0 +1,69 @@
# Menu
Menus can be created and added to the application. They can be used to create
context menus, system tray menus and application menus.
To create a new menu, call:
```go
// Create a new menu
menu := app.NewMenu()
```
The following operations are then available on the `Menu` type:
### Add
API: `Add(label string) *MenuItem`
This method takes a `label` of type `string` as an input and adds a new
`MenuItem` with the given label to the menu. It returns the `MenuItem` added.
### AddSeparator
API: `AddSeparator()`
This method adds a new separator `MenuItem` to the menu.
### AddCheckbox
API: `AddCheckbox(label string, enabled bool) *MenuItem`
This method takes a `label` of type `string` and `enabled` of type `bool` as
inputs and adds a new checkbox `MenuItem` with the given label and enabled state
to the menu. It returns the `MenuItem` added.
### AddRadio
API: `AddRadio(label string, enabled bool) *MenuItem`
This method takes a `label` of type `string` and `enabled` of type `bool` as
inputs and adds a new radio `MenuItem` with the given label and enabled state to
the menu. It returns the `MenuItem` added.
### Update
API: `Update()`
This method processes any radio groups and updates the menu if a menu
implementation is not initialized.
### AddSubmenu
API: `AddSubmenu(s string) *Menu`
This method takes a `s` of type `string` as input and adds a new submenu
`MenuItem` with the given label to the menu. It returns the submenu added.
### AddRole
API: `AddRole(role Role) *Menu`
This method takes `role` of type `Role` as input, adds it to the menu if it is
not `nil` and returns the `Menu`.
### SetLabel
API: `SetLabel(label string)`
This method sets the `label` of the `Menu`.

View file

@ -0,0 +1,112 @@
# System Tray
The system tray houses notification area on a desktop environment, which can
contain both icons of currently-running applications and specific system
notifications.
You create a system tray by calling `app.NewSystemTray()`:
```go
// Create a new system tray
tray := app.NewSystemTray()
```
The following methods are available on the `SystemTray` type:
### SetLabel
API: `SetLabel(label string)`
The `SetLabel` method sets the tray's label.
### Label
API: `Label() string`
The `Label` method retrieves the tray's label.
### PositionWindow
API: `PositionWindow(*WebviewWindow, offset int) error`
The `PositionWindow` method calls both `AttachWindow` and `WindowOffset`
methods.
### SetIcon
API: `SetIcon(icon []byte) *SystemTray`
The `SetIcon` method sets the system tray's icon.
### SetDarkModeIcon
API: `SetDarkModeIcon(icon []byte) *SystemTray`
The `SetDarkModeIcon` method sets the system tray's icon when in dark mode.
### SetMenu
API: `SetMenu(menu *Menu) *SystemTray`
The `SetMenu` method sets the system tray's menu.
### Destroy
API: `Destroy()`
The `Destroy` method destroys the system tray instance.
### OnClick
API: `OnClick(handler func()) *SystemTray`
The `OnClick` method sets the function to execute when the tray icon is clicked.
### OnRightClick
API: `OnRightClick(handler func()) *SystemTray`
The `OnRightClick` method sets the function to execute when right-clicking the
tray icon.
### OnDoubleClick
API: `OnDoubleClick(handler func()) *SystemTray`
The `OnDoubleClick` method sets the function to execute when double-clicking the
tray icon.
### OnRightDoubleClick
API: `OnRightDoubleClick(handler func()) *SystemTray`
The `OnRightDoubleClick` method sets the function to execute when right
double-clicking the tray icon.
### AttachWindow
API: `AttachWindow(window *WebviewWindow) *SystemTray`
The `AttachWindow` method attaches a window to the system tray. The window will
be shown when the system tray icon is clicked.
### WindowOffset
API: `WindowOffset(offset int) *SystemTray`
The `WindowOffset` method sets the gap in pixels between the system tray and the
window.
### WindowDebounce
API: `WindowDebounce(debounce time.Duration) *SystemTray`
The `WindowDebounce` method sets a debounce time. In the context of Windows,
this is used to specify how long to wait before responding to a mouse up event
on the notification icon.
### OpenMenu
API: `OpenMenu()`
The `OpenMenu` method opens the menu associated with the system tray.

View file

@ -0,0 +1,114 @@
# Window
To create a window, use
[Application.NewWebviewWindow](application.md#newwebviewwindow) or
[Application.NewWebviewWindowWithOptions](application.md#newwebviewwindowwithoptions).
The former creates a window with default options, while the latter allows you to
specify custom options.
These methods are callable on the returned WebviewWindow object:
### SetTitle
API: `SetTitle(title string) *WebviewWindow`
This method updates the window title to the provided string. It returns the
WebviewWindow object, allowing for method chaining.
### Name
API: `Name() string`
This function returns the name of the WebviewWindow.
### SetSize
API: `SetSize(width, height int) *WebviewWindow`
This method sets the size of the WebviewWindow to the provided width and height
parameters. If the dimensions provided exceed the constraints, they are adjusted
appropriately.
### SetAlwaysOnTop
API: `SetAlwaysOnTop(b bool) *WebviewWindow`
This function sets the window to stay on top based on the boolean flag provided.
### Show
API: `Show() *WebviewWindow`
`Show` method is used to make the window visible. If the window is not running,
it first invokes the `run` method to start the window and then makes it visible.
### Hide
API: `Hide() *WebviewWindow`
`Hide` method is used to hide the window. It sets the hidden status of the
window to true and emits the window hide event.
### SetURL
API: `SetURL(s string) *WebviewWindow`
`SetURL` method is used to set the URL of the window to the given URL string.
### SetZoom
API: `SetZoom(magnification float64) *WebviewWindow`
`SetZoom` method sets the zoom level of the window content to the provided
magnification level.
### GetZoom
API: `GetZoom() float64`
`GetZoom` function returns the current zoom level of the window content.
### GetScreen
API: `GetScreen() (*Screen, error)`
`GetScreen` method returns the screen on which the window is displayed.
#### SetFrameless
API: `SetFrameless(frameless bool) *WebviewWindow`
This function is used to remove the window frame and title bar. It toggles the
framelessness of the window according to the boolean value provided (true for
frameless, false for framed).
#### RegisterContextMenu
API: `RegisterContextMenu(name string, menu *Menu)`
This function is used to register a context menu and assigns it the given name.
#### NativeWindowHandle
API: `NativeWindowHandle() (uintptr, error)`
This function is used to fetch the platform native window handle for the window.
#### Focus
API: `Focus()`
This function is used to focus the window.
#### SetEnabled
API: `SetEnabled(enabled bool)`
This function is used to enable/disable the window based on the provided boolean
value.
#### SetAbsolutePosition
API: `SetAbsolutePosition(x int, y int)`
This function sets the absolute position of the window in the screen.

View file

@ -0,0 +1,39 @@
# Changelog
<!--
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.
-->
## [Unreleased]
### Added
- [darwin] add Event ApplicationShouldHandleReopen to able handle dock icon click by @5aaee9 in [#2991](https://github.com/wailsapp/wails/pull/2991)
- [darwin] add getPrimaryScreen/getScreens to impl by @tmclane in [#2618](https://github.com/wailsapp/wails/pull/2618)
### Fixed
- Fixed Doctor apt package verify by [Atterpac](https://github.com/Atterpac) in [#2972](https://github.com/wailsapp/wails/pull/2972).
- Fixed application frozen when quit (Darwin) by @5aaee9 in [#2982](https://github.com/wailsapp/wails/pull/2982)
- Fixed background colours of examples on Windows by [mmgvh](https://github.com/mmghv) in [#2750](https://github.com/wailsapp/wails/pull/2750).
- Fixed default context menus by [mmgvh](https://github.com/mmghv) in [#2753](https://github.com/wailsapp/wails/pull/2753).
### Changed
### Removed
### Deprecated
### Security

View file

@ -0,0 +1,454 @@
# Changes for v3
!!! note
This is currently an unsorted brain dump of changes. It will be organised into a more readable format soon.
## Options
The application options have been revised since v2.
## Events
In v3, there are 3 types of events:
- Application Events
- Window Events
- Custom Events
### Application Events
Application events are events that are emitted by the application. These events
include native events such as `ApplicationDidFinishLaunching` on macOS.
### Window Events
Window events are events that are emitted by a window. These events include
native events such as `WindowDidBecomeMain` on macOS. Common events are also
defined, so they work cross-platform, e.g. `WindowClosing`.
### Custom Events
Events that the user defines are called `WailsEvents`. This is to differentiate
them from the `Event` object that is used to communicate with the browser.
WailsEvents are now objects that encapsulate all the details of an event. This
includes the event name, the data, and the source of the event.
The data associated with a WailsEvent is now a single value. If multiple values
are required, then a struct can be used.
### Event callbacks and `Emit` function signature
The signatures events callbacks (as used by `On`, `Once` & `OnMultiple`) have
changed. In v2, the callback function received optional data. In v3, the
callback function receives a `WailsEvent` object that contains all data related
to the event.
Similarly, the `Emit` function has changed. Instead of taking a name and
optional data, it now takes a single `WailsEvent` object that it will emit.
### `Off` and `OffAll`
In v2, `Off` and `OffAll` calls would remove events in both JS and Go. Due to
the multi-window nature of v3, this has been changed so that these methods only
apply to the context they are called in. For example, if you call `Off` in a
window, it will only remove events for that window. If you use `Off` in Go, it
will only remove events for Go.
### Hooks
Event Hooks are a new feature in v3. They allow you to hook into the event
system and perform actions when certain events are emitted. For example, you can
hook into the `WindowClosing` event and perform some cleanup before the window
closes. Hooks can be registered at the application level or at the window level
using `RegisterHook`. Application level are for application events. Window level
hooks will only be called for the window they are registered with.
### Logging
Logging in v2 was confusing as both application logs and system (internal) logs
were using the same logger. We have simplified this as follows:
- Internal logs are now handled using the standard Go `slog` logger. This is
configured using the `logger` option in the application options. By default,
this uses the [tint](https://github.com/lmittmann/tint) logger.
- Application logs can now be achieved through the new `log` plugin which
utilises `slog` under the hood. This plugin provides a simple API for logging
to the console. It is available in both Go and JS.
### Developer notes
When emitting an event in Go, it will dispatch the event to local Go listeners
and also each window in the application. When emitting an event in JS, it now
sends the event to the application. This will be processed as if it was emitted
in Go, however the sender ID will be that of the window.
## Window
The Window API has largely remained the same, however the methods are now on an
instance of a window rather than the runtime. Some notable differences are:
- Windows now have a Name that identifies them. This is used to identify the
window when emitting events.
- Windows have even more methods on the that were previously unavailable, such
as `AbsolutePosition` and `ToggleDevTools`.
- Windows can now accept files via native drag and drop. See the Drag and Drop
section for more details.
## ClipBoard
The clipboard API has been simplified. There is now a single `Clipboard` object
that can be used to read and write to the clipboard. The `Clipboard` object is
available in both Go and JS. `SetText()` to set the text and `Text()` to get the
text.
## Bindings
Bindings work in a similar way to v2, by providing a means to bind struct
methods to the frontend. These can be called in the frontend using the binding
wrappers generated by the `wails3 generate bindings` command:
```javascript
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import { main } from "./models";
window.go = window.go || {};
window.go.main = {
GreetService: {
/**
* GreetService.Greet
* Greet greets a person
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function (name) {
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
},
/**
* GreetService.GreetPerson
* GreetPerson greets a person
* @param person {main.Person}
* @returns {Promise<string>}
**/
GreetPerson: function (person) {
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
},
},
};
```
Bound methods are obfuscated by default, and are identified using uint32 IDs,
calculated using the
[FNV hashing algorithm](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function).
This is to prevent the method name from being exposed in production builds. In
debug mode, the method IDs are logged along with the calculated ID of the method
to aid in debugging. If you wish to add an extra layer of obfuscation, you can
use the `BindAliases` option. This allows you to specify a map of alias IDs to
method IDs. When the frontend calls a method using an ID, the method ID will be
looked up in the alias map first for a match. If it does not find it, it assumes
it's a standard method ID and tries to find the method in the usual way.
Example:
```go
app := application.New(application.Options{
Bind: []any{
&GreetService{},
},
BindAliases: map[uint32]uint32{
1: 1411160069,
2: 4021313248,
},
Assets: application.AssetOptions{
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
```
We can now call using this alias in the frontend: `wails.Call(1, "world!")`.
### Insecure calls
If you don't mind your calls being available in plain text in your binary and
have no intention of using [garble](https://github.com/burrowers/garble), then
you can use the insecure `wails.CallByName()` method. This method takes the
fully qualified name of the method to call and the arguments to pass to it.
Example:
```go
wails.CallByName("main.GreetService.Greet", "world!")
```
!!! danger
This is only provided as a convenience method for development. It is not recommended to use this in production.
## Dialogs
Dialogs are now available in JavaScript!
### Windows
Dialog buttons in Windows are not configurable and are constant depending on the
type of dialog. To trigger a callback when a button is pressed, create a button
with the same name as the button you wish to have the callback attached to.
Example: Create a button with the label `Ok` and use `OnClick()` to set the
callback method:
```go
dialog := app.QuestionDialog().
SetTitle("Update").
SetMessage("The cancel button is selected when pressing escape")
ok := dialog.AddButton("Ok")
ok.OnClick(func() {
// Do something
})
no := dialog.AddButton("Cancel")
dialog.SetDefaultButton(ok)
dialog.SetCancelButton(no)
dialog.Show()
```
## Drag and Drop
Native drag and drop can be enabled per-window. Simply set the
`EnableDragAndDrop` window config option to `true` and the window will allow
files to be dragged onto it. When this happens, the `events.FilesDropped` event
will be emitted. The filenames can then be retrieved from the
`WindowEvent.Context()` using the `DroppedFiles()` method. This returns a slice
of strings containing the filenames.
## Context Menus
Context menus are contextual menus that are shown when the user right-clicks on
an element. Creating a context menu is the same as creating a standard menu , by
using `app.NewMenu()`. To make the context menu available to a window, call
`window.RegisterContextMenu(name, menu)`. The name will be the id of the context
menu and used by the frontend.
To indicate that an element has a context menu, add the `data-contextmenu`
attribute to the element. The value of this attribute should be the name of a
context menu previously registered with the window.
It is possible to register a context menu at the application level, making it
available to all windows. This can be done using
`app.RegisterContextMenu(name, menu)`. If a context menu cannot be found at the
window level, the application context menus will be checked. A demo of this can
be found in `v3/examples/contextmenus`.
## Wails Markup Language (WML)
The Wails Markup Language is a simple markup language that allows you to add
functionality to standard HTML elements without the use of Javascript.
The following tags are currently supported:
### `data-wml-event`
This specifies that a Wails event will be emitted when the element is clicked.
The value of the attribute should be the name of the event to emit.
Example:
```html
<button data-wml-event="myevent">Click Me</button>
```
Sometimes you need the user to confirm an action. This can be done by adding the
`data-wml-confirm` attribute to the element. The value of this attribute will be
the message to display to the user.
Example:
```html
<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
Delete All Items
</button>
```
### `data-wml-window`
Any `wails.window` method can be called by adding the `data-wml-window`
attribute to an element. The value of the attribute should be the name of the
method to call. The method name should be in the same case as the method.
```html
<button data-wml-window="Close">Close Window</button>
```
### `data-wml-trigger`
This attribute specifies which javascript event should trigger the action. The
default is `click`.
```html
<button data-wml-event="hover-box" data-wml-trigger="mouseover">
Hover over me!
</button>
```
## Systray
Wails 3 comes with a built-in systray. This is a fully featured systray that has
been designed to be as simple as possible to use. It is possible to set the
icon, tooltip and menu of the systray. It is possible to also "attach" a window
to the systray. Doing this will provide the following functionality:
- Clicking the systray icon with toggle the window visibility
- Right-clicking the systray will open the menu, if there is one
On macOS, if there is no attached window, the systray will use the default
method of displaying the menu (any button). If there is an attached window but
no menu, the systray will toggle the window regardless of the button pressed.
## Plugins
Plugins are a way to extend the functionality of your Wails application.
### Creating a plugin
Plugins are standard Go structure that adhere to the following interface:
```go
type Plugin interface {
Name() string
Init(*application.App) error
Shutdown()
CallableByJS() []string
InjectJS() string
}
```
The `Name()` method returns the name of the plugin. This is used for logging
purposes.
The `Init(*application.App) error` method is called when the plugin is loaded.
The `*application.App` parameter is the application that the plugin is being
loaded into. Any errors will prevent the application from starting.
The `Shutdown()` method is called when the application is shutting down.
The `CallableByJS()` method returns a list of exported functions that can be
called from the frontend. These method names must exactly match the names of the
methods exported by the plugin.
The `InjectJS()` method returns JavaScript that should be injected into all
windows as they are created. This is useful for adding custom JavaScript
functions that complement the plugin.
### Tips
#### Enums
In Go, enums are often defined as a type and a set of constants. For example:
```go
type MyEnum int
const (
MyEnumOne MyEnum = iota
MyEnumTwo
MyEnumThree
)
```
Due to incompatibility between Go and JavaScript, custom types cannot be used in
this way. The best strategy is to use a type alias for float64:
```go
type MyEnum = float64
const (
MyEnumOne MyEnum = iota
MyEnumTwo
MyEnumThree
)
```
In Javascript, you can then use the following:
```js
const MyEnum = {
MyEnumOne: 0,
MyEnumTwo: 1,
MyEnumThree: 2,
};
```
- Why use `float64`? Can't we use `int`?
- Because JavaScript doesn't have a concept of `int`. Everything is a
`number`, which translates to `float64` in Go. There are also restrictions
on casting types in Go's reflection package, which means using `int` doesn't
work.
### BackgroundColour
In v2, this was a pointer to an `RGBA` struct. In v3, this is an `RGBA` struct
value.
### WindowIsTranslucent
This flag has been removed. Now there is a `BackgroundType` flag that can be
used to set the type of background the window should have. This flag can be set
to any of the following values:
- `BackgroundTypeSolid` - The window will have a solid background
- `BackgroundTypeTransparent` - The window will have a transparent background
- `BackgroundTypeTranslucent` - The window will have a translucent background
On Windows, if the `BackgroundType` is set to `BackgroundTypeTranslucent`, the
type of translucency can be set using the `BackdropType` flag in the
`WindowsWindow` options. This can be set to any of the following values:
- `Auto` - The window will use an effect determined by the system
- `None` - The window will have no background
- `Mica` - The window will use the Mica effect
- `Acrylic` - The window will use the acrylic effect
- `Tabbed` - The window will use the tabbed effect
## Windows Application Options
### WndProcInterceptor
If this is set, the WndProc will be intercepted and the function will be called.
This allows you to handle Windows messages directly. The function should have
the following signature:
```go
func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnValue uintptr, shouldReturn)
```
The `shouldReturn` value should be set to `true` if the returnValue should be
returned by the main wndProc method. If it is set to `false`, the return value
will be ignored and the message will continue to be processed by the main
wndProc method.
## Hide Window on Close + OnBeforeClose
In v2, there was the `HideWindowOnClose` flag to hide the window when it closed.
There was a logical overlap between this flag and the `OnBeforeClose` callback.
In v3, the `HideWindowOnClose` flag has been removed and the `OnBeforeClose`
callback has been renamed to `ShouldClose`. The `ShouldClose` callback is called
when the user attempts to close a window. If the callback returns `true`, the
window will close. If it returns `false`, the window will not close. This can be
used to hide the window instead of closing it.
## Window Drag
In v2, the `--wails-drag` attribute was used to indicate that an element could
be used to drag the window. In v3, this has been replaced with
`--webkit-app-region` to be more in line with the way other frameworks handle
this. The `--webkit-app-region` attribute can be set to any of the following
values:
- `drag` - The element can be used to drag the window
- `no-drag` - The element cannot be used to drag the window
We would have ideally liked to use `app-region`, however this is not supported
by the `getComputedStyle` call on webkit on macOS.

View file

@ -0,0 +1,209 @@
# Introduction
!!! note This guide is a work in progress.
Thanks for wanting to help out with development of Wails! This guide will help
you get started.
## Getting Started
- Git clone this repository. Checkout the `v3-alpha` branch.
- Install the CLI: `cd v3/cmd/wails3 && go install`
- Optional: If you are wanting to use the build system to build frontend code,
you will need to install [npm](https://nodejs.org/en/download).
## Building
For simple programs, you can use the standard `go build` command. It's also
possible to use `go run`.
Wails also comes with a build system that can be used to build more complex
projects. It utilises the awesome [Task](https://taskfile.dev) build system. For
more information, check out the task homepage or run `wails task --help`.
## Project layout
The project has the following structure:
```
v3
├── cmd/wails3 // CLI
├── examples // Examples of Wails apps
├── internal // Internal packages
| ├── runtime // The Wails JS runtime
| └── templates // The supported project templates
├── pkg
| ├── application // The core Wails library
| └── events // The event definitions
| └── mac // macOS specific code used by plugins
| └── w32 // Windows specific code
├── plugins // Supported plugins
├── tasks // General tasks
└── Taskfile.yaml // Development tasks configuration
```
## Development
### Adding window functionality
The preferred way to add window functionality is to add a new function to the
`pkg/application/webview_window.go` file. This should implement all the
functionality required for all platforms. Any platform specific code should be
called via a `webviewWindowImpl` interface method. This interface is implemented
by each of the target platforms to provide the platform specific functionality.
In some cases, this may do nothing. Once you've added the interface method,
ensure each platform implements it. A good example of this is the `SetMinSize`
method.
- Mac: `webview_window_darwin.go`
- Windows: `webview_window_windows.go`
- Linux: `webview_window_linux.go`
Most, if not all, of the platform specific code should be run on the main
thread. To simplify this, there are a number of `invokeSync` methods defined in
`application.go`.
### Updating the runtime
The runtime is located in `v3/internal/runtime`. When the runtime is updated,
the following steps need to be taken:
```shell
wails3 task runtime:build
```
### Events
Events are defined in `v3/pkg/events`. When adding a new event, the following
steps need to be taken:
- Add the event to the `events.txt` file
- Run `wails3 task events:generate`
There are a number of types of events: platform specific application and window
events + common events. The common events are useful for cross-platform event
handling, but you aren't limited to the "lowest common denominator". You can use
the platform specific events if you need to.
When adding a common event, ensure that the platform specific events are mapped.
An example of this is in `window_webview_darwin.go`:
```go
// Translate ShouldClose to common WindowClosing event
w.parent.On(events.Mac.WindowShouldClose, func(_ *WindowEventContext) {
w.parent.emit(events.Common.WindowClosing)
})
```
NOTE: We may try to automate this in the future by adding the mapping to the
event definition.
### Plugins
Plugins are a way to extend the functionality of your Wails application.
#### Creating a plugin
Plugins are standard Go structure that adhere to the following interface:
```go
type Plugin interface {
Name() string
Init(*application.App) error
Shutdown()
CallableByJS() []string
InjectJS() string
}
```
The `Name()` method returns the name of the plugin. This is used for logging
purposes.
The `Init(*application.App) error` method is called when the plugin is loaded.
The `*application.App` parameter is the application that the plugin is being
loaded into. Any errors will prevent the application from starting.
The `Shutdown()` method is called when the application is shutting down.
The `CallableByJS()` method returns a list of exported functions that can be
called from the frontend. These method names must exactly match the names of the
methods exported by the plugin.
The `InjectJS()` method returns JavaScript that should be injected into all
windows as they are created. This is useful for adding custom JavaScript
functions that complement the plugin.
The built-in plugins can be found in the `v3/plugins` directory.
Check them out for inspiration.
## Tasks
The Wails CLI uses the [Task](https://taskfile.dev) build system. It is imported
as a library and used to run the tasks defined in `Taskfile.yaml`. The main
interfacing with Task happens in `v3/internal/commands/task.go`.
### Upgrading Taskfile
To check if there's an upgrade for Taskfile, run `wails3 task -version` and
check against the Task website.
To upgrade the version of Taskfile used, run:
```shell
wails3 task taskfile:upgrade
```
If there are incompatibilities then they should appear in the
`v3/internal/commands/task.go` file.
Usually the best way to fix incompatibilities is to clone the task repo at
`https://github.com/go-task/task` and look at the git history to determine what
has changed and why.
To check all changes have worked correctly, re-install the CLI and check the
version again:
```shell
wails3 task cli:install
wails3 task -version
```
## Opening a PR
Make sure that all PRs have a ticket associated with them providing context to
the change. If there is no ticket, please create one first. Ensure that all PRs
have updated the CHANGELOG.md file with the changes made. The CHANGELOG.md file
is located in the `mkdocs-website/docs` directory.
## Misc Tasks
### Upgrading Taskfile
The Wails CLI uses the [Task](https://taskfile.dev) build system. It is imported
as a library and used to run the tasks defined in `Taskfile.yaml`. The main
interfacing with Task happens in `v3/internal/commands/task.go`.
To check if there's an upgrade for Taskfile, run `wails3 task -version` and
check against the Task website.
To upgrade the version of Taskfile used, run:
```shell
wails3 task taskfile:upgrade
```
If there are incompatibilities then they should appear in the
`v3/internal/commands/task.go` file.
Usually the best way to fix incompatibilities is to clone the task repo at
`https://github.com/go-task/task` and look at the git history to determine what
has changed and why.
To check all changes have worked correctly, re-install the CLI and check the
version again:
```shell
wails3 task cli:install
wails3 task -version
```

View file

@ -0,0 +1,388 @@
# Status
Status of features in v3.
!!! note
This list is a mixture of public and internal API support.<br/>
It is not complete and probably not up to date.
## Known Issues
- Linux is not yet up to feature parity with Windows/Mac
## Application
Application interface methods
| Method | Windows | Linux | Mac | Notes |
|---------------------------------------------------------------|---------|-------|-----|-------|
| run() error | Y | Y | Y | |
| destroy() | | Y | Y | |
| setApplicationMenu(menu \*Menu) | Y | Y | Y | |
| name() string | | Y | Y | |
| getCurrentWindowID() uint | Y | Y | Y | |
| showAboutDialog(name string, description string, icon []byte) | | Y | Y | |
| setIcon(icon []byte) | - | Y | Y | |
| on(id uint) | | | Y | |
| dispatchOnMainThread(fn func()) | Y | Y | Y | |
| hide() | Y | Y | Y | |
| show() | Y | Y | Y | |
| getPrimaryScreen() (\*Screen, error) | | Y | Y | |
| getScreens() ([]\*Screen, error) | | Y | Y | |
## Webview Window
Webview Window Interface Methods
| Method | Windows | Linux | Mac | Notes |
|----------------------------------------------------|---------|-------|-----|------------------------------------------|
| center() | Y | Y | Y | |
| close() | y | Y | Y | |
| destroy() | | Y | Y | |
| execJS(js string) | y | Y | Y | |
| focus() | Y | Y | | |
| forceReload() | | Y | Y | |
| fullscreen() | Y | Y | Y | |
| getScreen() (\*Screen, error) | y | Y | Y | |
| getZoom() float64 | | Y | Y | |
| height() int | Y | Y | Y | |
| hide() | Y | Y | Y | |
| isFullscreen() bool | Y | Y | Y | |
| isMaximised() bool | Y | Y | Y | |
| isMinimised() bool | Y | Y | Y | |
| maximise() | Y | Y | Y | |
| minimise() | Y | Y | Y | |
| nativeWindowHandle() (uintptr, error) | Y | Y | | |
| on(eventID uint) | y | | Y | |
| openContextMenu(menu *Menu, data *ContextMenuData) | y | | Y | |
| relativePosition() (int, int) | Y | Y | Y | |
| reload() | y | Y | Y | |
| run() | Y | Y | Y | |
| setAlwaysOnTop(alwaysOnTop bool) | Y | Y | Y | |
| setBackgroundColour(color RGBA) | Y | Y | Y | |
| setEnabled(bool) | | Y | Y | |
| setFrameless(bool) | | Y | Y | |
| setFullscreenButtonEnabled(enabled bool) | - | Y | Y | There is no fullscreen button in Windows |
| setHTML(html string) | Y | Y | Y | |
| setMaxSize(width, height int) | Y | Y | Y | |
| setMinSize(width, height int) | Y | Y | Y | |
| setRelativePosition(x int, y int) | Y | Y | Y | |
| setResizable(resizable bool) | Y | Y | Y | |
| setSize(width, height int) | Y | Y | Y | |
| setTitle(title string) | Y | Y | Y | |
| setURL(url string) | Y | Y | Y | |
| setZoom(zoom float64) | Y | Y | Y | |
| show() | Y | Y | Y | |
| size() (int, int) | Y | Y | Y | |
| toggleDevTools() | Y | Y | Y | |
| unfullscreen() | Y | Y | Y | |
| unmaximise() | Y | Y | Y | |
| unminimise() | Y | Y | Y | |
| width() int | Y | Y | Y | |
| zoom() | | Y | Y | |
| zoomIn() | Y | Y | Y | |
| zoomOut() | Y | Y | Y | |
| zoomReset() | Y | Y | Y | |
## Runtime
### Application
| Feature | Windows | Linux | Mac | Notes |
|---------|---------|-------|-----|-------|
| Quit | Y | Y | Y | |
| Hide | Y | | Y | |
| Show | Y | | Y | |
### Dialogs
| Feature | Windows | Linux | Mac | Notes |
|----------|---------|-------|-----|-------|
| Info | Y | Y | Y | |
| Warning | Y | Y | Y | |
| Error | Y | Y | Y | |
| Question | Y | Y | Y | |
| OpenFile | Y | | Y | |
| SaveFile | Y | | Y | |
### Clipboard
| Feature | Windows | Linux | Mac | Notes |
|---------|---------|-------|-----|-------|
| SetText | Y | | Y | |
| Text | Y | | Y | |
### ContextMenu
| Feature | Windows | Linux | Mac | Notes |
|------------------|---------|-------|-----|-------|
| OpenContextMenu | Y | | Y | |
| On By Default | | | | |
| Control via HTML | Y | | | |
The default context menu is enabled by default for all elements that are
`contentEditable: true`, `<input>` or `<textarea>` tags or have the
`--default-contextmenu: true` style set. The `--default-contextmenu: show` style
will always show the context menu The `--default-contextmenu: hide` style will
always hide the context menu
Anything nested under a tag with `--default-contextmenu: hide` style will not
show the context menu unless it is explicitly set with
`--default-contextmenu: show`.
### Screens
| Feature | Windows | Linux | Mac | Notes |
|------------|---------|-------|-----|-------|
| GetAll | Y | Y | Y | |
| GetPrimary | Y | Y | Y | |
| GetCurrent | Y | Y | Y | |
### System
| Feature | Windows | Linux | Mac | Notes |
|------------|---------|-------|-----|-------|
| IsDarkMode | | | Y | |
### Window
Y = Supported U = Untested
- = Not available
| Feature | Windows | Linux | Mac | Notes |
|---------------------|---------|-------|-----|--------------------------------------------------------------------------------------|
| Center | Y | Y | Y | |
| Focus | Y | Y | | |
| FullScreen | Y | Y | Y | |
| GetZoom | Y | Y | Y | Get current view scale |
| Height | Y | Y | Y | |
| Hide | Y | Y | Y | |
| Maximise | Y | Y | Y | |
| Minimise | Y | Y | Y | |
| RelativePosition | Y | Y | Y | |
| Screen | Y | Y | Y | Get screen for window |
| SetAlwaysOnTop | Y | Y | Y | |
| SetBackgroundColour | Y | Y | Y | https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621#issuecomment-938234294 |
| SetEnabled | Y | U | - | Set the window to be enabled/disabled |
| SetMaxSize | Y | Y | Y | |
| SetMinSize | Y | Y | Y | |
| SetRelativePosition | Y | Y | Y | |
| SetResizable | Y | Y | Y | |
| SetSize | Y | Y | Y | |
| SetTitle | Y | Y | Y | |
| SetZoom | Y | Y | Y | Set view scale |
| Show | Y | Y | Y | |
| Size | Y | Y | Y | |
| UnFullscreen | Y | Y | Y | |
| UnMaximise | Y | Y | Y | |
| UnMinimise | Y | Y | Y | |
| Width | Y | Y | Y | |
| ZoomIn | Y | Y | Y | Increase view scale |
| ZoomOut | Y | Y | Y | Decrease view scale |
| ZoomReset | Y | Y | Y | Reset view scale |
### Window Options
A 'Y' in the table below indicates that the option has been tested and is
applied when the window is created. An 'X' indicates that the option is not
supported by the platform.
| Feature | Windows | Linux | Mac | Notes |
|---------------------------------|---------|-------|-----|--------------------------------------------|
| AlwaysOnTop | Y | | | |
| BackgroundColour | Y | Y | | |
| BackgroundType | | | | Acrylic seems to work but the others don't |
| CSS | Y | Y | | |
| DevToolsEnabled | Y | Y | Y | |
| DisableResize | Y | Y | | |
| EnableDragAndDrop | | Y | | |
| EnableFraudulentWebsiteWarnings | | | | |
| Focused | Y | Y | | |
| Frameless | Y | Y | | |
| FullscreenButtonEnabled | Y | | | |
| Height | Y | Y | | |
| Hidden | Y | Y | | |
| HTML | Y | Y | | |
| JS | Y | Y | | |
| Mac | - | - | | |
| MaxHeight | Y | Y | | |
| MaxWidth | Y | Y | | |
| MinHeight | Y | Y | | |
| MinWidth | Y | Y | | |
| Name | Y | Y | | |
| OpenInspectorOnStartup | | | | |
| StartState | Y | | | |
| Title | Y | Y | | |
| URL | Y | Y | | |
| Width | Y | Y | | |
| Windows | Y | - | - | |
| X | Y | Y | | |
| Y | Y | Y | | |
| Zoom | | | | |
| ZoomControlEnabled | | | | |
### Log
To log or not to log? System logger vs custom logger.
## Menu
| Event | Windows | Linux | Mac | Notes |
|--------------------------|---------|-------|-----|-------|
| Default Application Menu | Y | Y | Y | |
## Tray Menus
| Feature | Windows | Linux | Mac | Notes |
|--------------------|---------|-------|-----|----------------------------------------------------------------------|
| Icon | Y | | Y | Windows has default icons for light/dark mode & supports PNG or ICO. |
| Label | - | | Y | |
| Label (ANSI Codes) | - | | | |
| Menu | Y | | Y | |
### Methods
| Method | Windows | Linux | Mac | Notes |
|-------------------------------|---------|-------|-----|-------|
| setLabel(label string) | - | | Y | |
| run() | Y | | Y | |
| setIcon(icon []byte) | Y | | Y | |
| setMenu(menu \*Menu) | Y | | Y | |
| setIconPosition(position int) | - | | Y | |
| setTemplateIcon(icon []byte) | - | | Y | |
| destroy() | Y | | Y | |
| setDarkModeIcon(icon []byte) | Y | | Y | |
## Cross Platform Events
Mapping native events to cross-platform events.
| Event | Windows | Linux | Mac | Notes |
|--------------------------|---------|-------|-----------------|-------|
| WindowWillClose | | | WindowWillClose | |
| WindowDidClose | | | | |
| WindowDidResize | | | | |
| WindowDidHide | | | | |
| ApplicationWillTerminate | | | | |
... Add more
## Bindings Generation
Working well.
## Models Generation
Working well.
## Task file
Contains a lot needed for development.
## Theme
| Mode | Windows | Linux | Mac | Notes |
|--------|---------|-------|-----|-------|
| Dark | Y | | | |
| Light | Y | | | |
| System | Y | | | |
## NSIS Installer
TBD
## Templates
All templates are working.
## Plugins
Built-in plugin support:
| Plugin | Windows | Linux | Mac | Notes |
|-----------------|---------|-------|-----|-------|
| Browser | Y | | Y | |
| KV Store | Y | Y | Y | |
| Log | Y | Y | Y | |
| Single Instance | Y | | Y | |
| SQLite | Y | Y | Y | |
| Start at login | Y | | Y | |
| Server | | | | |
TODO:
- Ensure each plugin has a JS wrapper that can be injected into the window.
## Packaging
| | Windows | Linux | Mac | Notes |
|-----------------|---------|-------|-----|-------|
| Icon Generation | Y | | Y | |
| Icon Embedding | Y | | Y | |
| Info.plist | - | | Y | |
| NSIS Installer | | | - | |
| Mac bundle | - | | Y | |
| Windows exe | Y | | - | |
## Frameless Windows
| Feature | Windows | Linux | Mac | Notes |
|---------|---------|-------|-----|------------------------------------------------|
| Resize | Y | | Y | |
| Drag | Y | Y | Y | Linux - can always drag with `Meta`+left mouse |
## Mac Specific
- [x] Translucency
### Mac Options
| Feature | Default | Notes |
|-------------------------|-------------------|------------------------------------------------------|
| Backdrop | MacBackdropNormal | Standard solid window |
| DisableShadow | false | |
| TitleBar | | Standard window decorations by default |
| Appearance | DefaultAppearance | |
| InvisibleTitleBarHeight | 0 | Creates an invisible title bar for frameless windows |
| DisableShadow | false | Disables the window drop shadow |
## Windows Specific
- [x] Translucency
- [x] Custom Themes
### Windows Options
| Feature | Default | Notes |
|-----------------------------------|---------------|---------------------------------------------|
| BackdropType | Solid | |
| DisableIcon | false | |
| Theme | SystemDefault | |
| CustomTheme | nil | |
| DisableFramelessWindowDecorations | false | |
| WindowMask | nil | Makes the window the contents of the bitmap |
## Linux Specific
Implementation details for the functions utilized by the `*_linux.go` files are
located in the following files:
- linux_cgo.go: CGo implementation
- linux_purego.go: PureGo implementation
### CGO
By default CGO is utilized to compile the Linux port. This prevents easy
cross-compilation and so the PureGo implementation is also being simultaneously
developed.
### Purego
The examples can be compiled using the following command:
CGO_ENABLED=0 go build -tags purego
Note: things are currently not working after the refactor

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,58 @@
# Feedback
We welcome (and encourage) your feedback! Please search for existing tickets or posts before creating new ones.
Here are the different ways to provide feedback:
=== "Bugs"
If you find a bug, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel on Discord:
- The post should clearly state what the bug is and have a simple reproducible example. If the docs are unclear what *should* happen, please include that in the post.
- The post should be given the `Bug` tag.
- Please include the output of `wails doctor` in your post.
- *Remember* unexpected behaviour isn't necessarily a bug - it might just not do what you expect it to do. Use [Suggestions](#suggestions) for this.
=== "Fixes"
If you have a fix for a bug or an update for documentation, please do the following:
- Open a pull request on the [Wails repository](https://github.com/wailsapp/wails). The title of the PR should start with `[v3 alpha]`.
- Create a post in the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel.
- The post should be given the `PR` tag.
- Please include a link to the PR in your post.
=== "Suggestions"
If you have a suggestion, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel on Discord:
- The post should be given the `Suggestion` tag.
Please feel free to reach out to us on [Discord](https://discord.gg/3mgVyGua) if you have any questions.
=== "Upvoting"
- Posts can be "upvoted" by using the :thumbsup: emoji. Please apply to any posts that are a priority for you.
- Please *don't* just add comments like "+1" or "me too".
- Please feel free to comment if there is more to add to the post, such as "this bug also affect ARM builds" or "Another option would be to ....."
There is a list of known issues & work in progress can be found [here](https://github.com/orgs/wailsapp/projects/6).
## Things we are looking for feedback on
- The API
- Is it easy to use?
- Does it do what you expect?
- Is it missing anything?
- Is there anything that should be removed?
- Is it consistent between Go and JS?
- The build system
- Is it easy to use?
- Can we improve it?
- The examples
- Are they clear?
- Do they cover the basics?
- Features
- What features are missing?
- What features are not needed?
- Documentation
- What could be clearer?

View file

@ -0,0 +1,81 @@
# Installation
To install the Wails CLI, ensure you have [Go 1.21+](https://go.dev/dl/)
installed and run:
```shell
git clone https://github.com/wailsapp/wails.git
cd wails
git checkout v3-alpha
cd v3/cmd/wails3
go install
```
## Supported Platforms
- Windows 10/11 AMD64/ARM64
- MacOS 10.13+ AMD64
- MacOS 11.0+ ARM64
- Ubuntu 22.04 AMD64/ARM64 (other Linux may work too!)
## Dependencies
Wails has a number of common dependencies that are required before installation:
=== "Go 1.21+"
Download Go from the [Go Downloads Page](https://go.dev/dl/).
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
- Check Go is installed correctly: `go version`
- Check `~/go/bin` is in your PATH variable: `echo $PATH | grep go/bin`
=== "npm (Optional)"
Although Wails doesn't require npm to be installed, it is needed if you want to use the bundled templates.
Download the latest node installer from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against.
Run `npm --version` to verify.
=== "Task (Optional)"
The Wails CLI embeds a task runner called [Task](https://taskfile.dev/#/installation). It is optional, but recommended. If you do not wish to install Task, you can use the `wails3 task` command instead of `task`.
Installing Task will give you the greatest flexibility.
## Platform Specific Dependencies
You will also need to install platform specific dependencies:
=== "Mac"
Wails requires that the xcode command line tools are installed. This can be
done by running:
```
xcode-select --install
```
=== "Windows"
Wails requires that the [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) is installed. Some Windows installations will already have this installed. You can check using the `wails doctor` command.
=== "Linux"
Linux requires the standard `gcc` build tools plus `libgtk3` and `libwebkit`. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run <code>wails doctor</code> after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please let us know on discord.
## System Check
Running `wails3 doctor` will check if you have the correct dependencies
installed. If not, it will advise on what is missing and help on how to rectify
any problems.
## The `wails3` command appears to be missing?
If your system is reporting that the `wails3` command is missing, check the
following:
- Make sure you have followed the Go installation guide correctly.
- Check that the `go/bin` directory is in the `PATH` environment variable.
- Close/Reopen current terminals to pick up the new `PATH` variable.

View file

@ -0,0 +1,39 @@
# Next Steps
Now that you have Wails installed, you can start exploring the alpha version.
The best place to start is the `examples` directory in the Wails repository.
This contains a number of examples that you can run and play with.
## Running an example
To run an example, you can simply use:
```shell
go run .
```
in the example directory.
The status of the examples is on the [roadmap](../roadmap.md).
## Creating a new project
To create a new project, you can use the `wails3 init` command. This will create
a new project in the current directory.
Wails3 uses [Task](https://taskfile.dev) as its build system by default,
although there is no reason why you can't use your own build system, or use
`go build` directly. Wails has the task build system built in and can be run
using `wails3 task`.
If you look through the `Taskfile.yaml` file, you will see that there are a
number of tasks defined. The most important one is the `build` task. This is the
task that is run when you use `wails3 build`.
The task file is unlikely to be complete and is subject to change over time.
## Building a project
To build a project, you can use the `wails3 build` command. This is a shortcut
for `wails3 task build`.

View file

@ -0,0 +1,5 @@
---
template: home.en.html
---
Welcome to The Wails Project

View file

@ -0,0 +1,50 @@
# Roadmap
The roadmap is a living document and is subject to change. If you have any suggestions, please open an issue.
Each milestone will have a set of goals that we are aiming to achieve. These are subject to change.
## Alpha milestones
### Alpha 1
#### Goals
Alpha 1 is the initial release. It is intended to get feedback on the new API and to get people experimenting with it.
The main goal is to get most of the examples working on all platforms.
#### Status
- W - Working
- P - Partially working
- N - Not working
| Example | Mac | Windows | Linux |
|---------------|-----|---------|-------|
| binding | W | W | |
| build | W | W | |
| clipboard | W | W | |
| context menus | W | W | |
| dialogs | P | W | |
| drag-n-drop | W | N | |
| events | W | W | |
| frameless | W | W | |
| keybindings | W | W | |
| plain | W | W | |
| screen | W | W | |
| systray | W | W | |
| video | | W | |
| window | P | W | |
| wml | W | W | |
- Mac Dialogs work, however the file dialogs issue a warning that needs to be fixed.
#### TODO:
- [ ] Fix `+[CATransaction synchronize] called within transaction` warnings on Mac
- [ ] When hiding window, application terminates
### Alpha 2
- [ ] Most examples working on Linux
- [ ] Project creation via `wails init`

View file

@ -0,0 +1,22 @@
[data-md-color-scheme="slate"] {
--md-hue: 208;
--md-primary-fg-color--light: #ECB7B7;
--md-primary-fg-color--dark: #90030C;
--md-accent-fg-color: #ff4646;
--md-primary-fg-color: #2a2a2a;
--md-default-bg-color: #191919;
--md-footer-bg-color--dark: #2a2a2a;
--md-default-fg-color: #e0e0e0;
}
.md-header__button.md-logo img, .md-header__button.md-logo svg {
fill: currentcolor;
display: block;
height: 2rem;
width: auto;
}
.md-typeset {
font-weight: 100;
}

View file

@ -0,0 +1,337 @@
# What's new in v3?
!!! note
The features that will be included in the v3 release may change from this list.
## Multiple Windows
It's now possible to create multiple windows and configure each one
independently.
```go
package main
import (
_ "embed"
"log"
"github.com/wailsapp/wails/v3/pkg/application"
)
//go:embed assets/*
var assets embed.FS
func main() {
app := application.New(application.Options{
Name: "Multi Window Demo",
Assets: application.AssetOptions{
FS: assets,
},
})
window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "Window 1",
})
window2 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "Window 2",
})
// load the embedded html from the embed.FS
window1.SetURL("/")
window1.Center()
// Load an external URL
window2.SetURL("https://wails.app")
err := app.Run()
if err != nil {
log.Fatal(err.Error())
}
}
```
## Systrays
Systrays allow you to add an icon in the system tray area of your desktop and
have the following features:
- Attach window (the window will be centered to the systray icon)
- Full menu support
- Light/Dark mode icons
```go
package main
import (
_ "embed"
"log"
"runtime"
"github.com/wailsapp/wails/v3/pkg/application"
"github.com/wailsapp/wails/v3/pkg/icons"
)
func main() {
app := application.New(application.Options{
Name: "Systray Demo",
Mac: application.MacOptions{
ActivationPolicy: application.ActivationPolicyAccessory,
},
})
window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Width: 500,
Height: 800,
Frameless: true,
AlwaysOnTop: true,
Hidden: true,
Windows: application.WindowsWindow{
HiddenOnTaskbar: true,
},
})
systemTray := app.NewSystemTray()
// Support for template icons on macOS
if runtime.GOOS == "darwin" {
systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
} else {
// Support for light/dark mode icons
systemTray.SetDarkModeIcon(icons.SystrayDark)
systemTray.SetIcon(icons.SystrayLight)
}
// Support for menu
myMenu := app.NewMenu()
myMenu.Add("Hello World!").OnClick(func(_ *application.Context) {
println("Hello World!")
})
systemTray.SetMenu(myMenu)
// This will center the window to the systray icon with a 5px offset
// It will automatically be shown when the systray icon is clicked
// and hidden when the window loses focus
systemTray.AttachWindow(window).WindowOffset(5)
err := app.Run()
if err != nil {
log.Fatal(err)
}
}
```
## Plugins
Plugins allow you to extend the functionality of the Wails system. Not only can
plugin methods be used in Go, but also called from Javascript. Included plugins:
- kvstore - A key/value store
- browser - open links in a browser
- log - custom logger
- oauth - handles oauth authentication and supports 60 providers
- single_instance - only allow one copy of your app to be run
- sqlite - add a sqlite db to your app. Uses the modernc pure go library
- start_at_login - Register/Unregister your application to start at login
## Improved bindings generation
v3 uses a new static analyser to generate bindings. This makes it extremely fast
and maintains comments and parameter names in your bindings. By default,
bindings are generated with calls using IDs instead of strings. This provides a
performance boost and allows for using obfuscation tools such as
[garble](https://github.com/burrowers/garble).
Bindings are generated by simply running `wails3 generate bindings` in the
project directory.
```js
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import { main } from "./models";
window.go = window.go || {};
window.go.main = {
GreetService: {
/**
* GreetService.Greet
* Greet greets a person
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function (name) {
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
},
/**
* GreetService.GreetPerson
* GreetPerson greets a person
* @param person {main.Person}
* @returns {Promise<string>}
**/
GreetPerson: function (person) {
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
},
},
};
```
## Improved build system
In v2, the build system was completely opaque and hard to customise. In v3, it's
possible to build everything using standard Go tooling.
All the heavy lifting that the v2 build system did, such as icon generation,
have been added as tool commands in the CLI. We have incorporated
[Taskfile](https://taskfile.dev) into the CLI to orchestrate these calls to
bring the same developer experience as v2. However, this approach brings the
ultimate balance of flexibility and ease of use as you can now customise the
build process to your needs.
You can even use make if that's your thing!
```yaml title="Snippet from Taskfile.yml"
build:darwin:
summary: Builds the application
platforms:
- darwin
cmds:
- task: pre-build
- task: build-frontend
- go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
- task: post-build
env:
CGO_CFLAGS: "-mmacosx-version-min=10.13"
CGO_LDFLAGS: "-mmacosx-version-min=10.13"
MACOSX_DEPLOYMENT_TARGET: "10.13"
```
## Improved events
Events are now emitted for a lot of the runtime operations, allowing you to hook
into application/system events. Cross-platform (common) events are also emitted
where there are common platform events, allowing you to write the same event
handling methods cross platform.
Event hooks can also be registered. These are like the `On` method but are
synchronous and allow you to cancel the event. An example of this would be to
show a confirmation dialog before closing a window.
```go
package main
import (
_ "embed"
"log"
"time"
"github.com/wailsapp/wails/v3/pkg/application"
"github.com/wailsapp/wails/v3/pkg/events"
)
//go:embed assets
var assets embed.FS
func main() {
app := application.New(application.Options{
Name: "Events Demo",
Description: "A demo of the Events API",
Assets: application.AssetOptions{
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
// Custom event handling
app.Events.On("myevent", func(e *application.WailsEvent) {
log.Printf("[Go] WailsEvent received: %+v\n", e)
})
// OS specific application events
app.On(events.Mac.ApplicationDidFinishLaunching, func(event *application.Event) {
println("events.Mac.ApplicationDidFinishLaunching fired!")
})
// Platform agnostic events
app.On(events.Common.ApplicationStarted, func(event *application.Event) {
println("events.Common.ApplicationStarted fired!")
})
win1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "Takes 3 attempts to close me!",
})
var countdown = 3
// Register a hook to cancel the window closing
win1.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
countdown--
if countdown == 0 {
println("Closing!")
return
}
println("Nope! Not closing!")
e.Cancel()
})
win1.On(events.Common.WindowFocus, func(e *application.WindowEvent) {
println("[Event] Window focus!")
})
err := app.Run()
if err != nil {
log.Fatal(err.Error())
}
}
```
## Wails Markup Language (wml)
An experimental feature to call runtime methods using plain html, similar to
[htmx](https://htmx.org).
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Wails ML Demo</title>
</head>
<body style="margin-top:50px; color: white; background-color: #191919">
<h2>Wails ML Demo</h2>
<p>This application contains no Javascript!</p>
<button wml-event="button-pressed">Press me!</button>
<button wml-event="delete-things" wml-confirm="Are you sure?">
Delete all the things!
</button>
<button wml-window="Close" wml-confirm="Are you sure?">
Close the Window?
</button>
<button wml-window="Center">Center</button>
<button wml-window="Minimise">Minimise</button>
<button wml-window="Maximise">Maximise</button>
<button wml-window="UnMaximise">UnMaximise</button>
<button wml-window="Fullscreen">Fullscreen</button>
<button wml-window="UnFullscreen">UnFullscreen</button>
<button wml-window="Restore">Restore</button>
<div
style="width: 200px; height: 200px; border: 2px solid white;"
wml-event="hover"
wml-trigger="mouseover"
>
Hover over me
</div>
</body>
</html>
```

View file

@ -0,0 +1,318 @@
# 应用程序
应用程序 API 用于使用 Wails 框架创建应用程序。
### New
API`New(appOptions Options) *App`
`New(appOptions Options)` 使用给定的应用程序选项创建一个新的应用程序。它对未指定的选项应用默认值,将其与提供的选项合并,然后初始化并返回应用程序的实例。
如果在初始化过程中出现错误,应用程序将停止,并显示提供的错误消息。
需要注意的是,如果全局应用程序实例已经存在,将返回该实例,而不是创建新的实例。
```go title="main.go" hl_lines="6-9"
package main
import "github.com/wailsapp/wails/v3/pkg/application"
func main() {
app := application.New(application.Options{
Name: "WebviewWindow Demo",
// 其他选项
})
// 其余的应用程序逻辑
}
```
### Get
`Get()` 返回全局应用程序实例。在代码的不同部分需要访问应用程序时非常有用。
```go
// 获取应用程序实例
app := application.Get()
```
### Capabilities
API`Capabilities() capabilities.Capabilities`
`Capabilities()` 返回应用程序当前具有的功能的映射。这些功能可以是操作系统提供的不同功能,如 webview 功能。
```go
// 获取应用程序的功能
capabilities := app.Capabilities()
if capabilities.HasNativeDrag {
// 做一些事情
}
```
### GetPID
API`GetPID() int`
`GetPID()` 返回应用程序的进程 ID。
```go
pid := app.GetPID()
```
### Run
API`Run() error`
`Run()` 启动应用程序及其组件的执行。
```go
app := application.New(application.Options{
// 选项
})
// 运行应用程序
err := application.Run()
if err != nil {
// 处理错误
}
```
### Quit
API`Quit()`
`Quit()` 通过销毁窗口和可能的其他组件退出应用程序。
```go
// 退出应用程序
app.Quit()
```
### IsDarkMode
API`IsDarkMode() bool`
`IsDarkMode()` 检查应用程序是否在暗模式下运行。它返回一个布尔值,指示是否启用了暗模式。
```go
// 检查是否启用了暗模式
if app.IsDarkMode() {
// 做一些事情
}
```
### Hide
API`Hide()`
`Hide()` 隐藏应用程序窗口。
```go
// 隐藏应用程序窗口
app.Hide()
```
### Show
API`Show()`
`Show()` 显示应用程序窗口。
```go
// 显示应用程序窗口
app.Show()
```
### NewWebviewWindow
API`NewWebviewWindow() *WebviewWindow`
`NewWebviewWindow()` 使用默认选项创建一个新的 Webview 窗口,并返回它。
```go
// 创建一个新的 Webview 窗口
window := app.NewWebviewWindow()
```
### NewWebviewWindowWithOptions
API`NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindow`
`NewWebviewWindowWithOptions()` 使用自定义选项创建一个新的 Webview 窗口。新创建的窗口将添加到应用程序管理的窗口映射中。
```go
// 使用自定义选项创建一个新的 Webview 窗口
window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
Name: "Main",
Title: "My Window",
Width: 800,
Height: 600,
})
```
### OnWindowCreation
API`OnWindowCreation(callback func(window *WebviewWindow))`
`OnWindowCreation()` 注册一个回调函数,当创建窗口时调用该函数。
```go
// 注册一个回调函数,当创建窗口时调用该函数
app.OnWindowCreation(func(window *WebviewWindow) {
// 做一些事情
})
```
### GetWindowByName
API`GetWindowByName(name string) *WebviewWindow`
`GetWindowByName()` 获取并返回具有特定名称的窗口。
```go
// 通过名称获取窗口
window := app.GetWindowByName("Main")
```
### CurrentWindow
API`CurrentWindow() *WebviewWindow`
`CurrentWindow()` 获取并返回应用程序中当前活动窗口的指针。如果没有窗口,则返回 nil。
```go
// 获取当前窗口
window := app.CurrentWindow()
```
### RegisterContextMenu
API`RegisterContextMenu(name string, menu *Menu)`
`RegisterContextMenu()` 注册具有给定名称的上下文菜单。稍后可以在应用程序中使用该菜单。
```go
// 创建一个新的菜单
ctxmenu := app.NewMenu()
// 将菜单注册为上下文菜单
app.RegisterContextMenu("MyContextMenu", ctxmenu)
```
### SetMenu
API`SetMenu(menu *Menu)`
`SetMenu()` 设置应用程序的菜单。在 Mac 上,这将是全局菜单。对于 Windows 和 Linux这将是任何新窗口的默认菜单。
```go
// 创建一个新的菜单
menu := app.NewMenu()
// 设置应用程序的菜单
app.SetMenu(menu)
```
### ShowAboutDialog
API`ShowAboutDialog()`
`ShowAboutDialog()` 显示一个 "关于" 对话框。可以显示应用程序的名称、描述和图标。
```go
// 显示关于对话框
app.ShowAboutDialog()
```
### Info
API`InfoDialog()`
`InfoDialog()` 创建并返回一个具有 `InfoDialogType``MessageDialog` 的新实例。此对话框通常用于向用户显示信息消息。
### Question
API`QuestionDialog()`
`QuestionDialog()` 创建并返回一个具有 `QuestionDialogType``MessageDialog` 的新实例。此对话框通常用于向用户提问并期望回应。
### Warning
API`WarningDialog()`
`WarningDialog()` 创建并返回一个具有 `WarningDialogType``MessageDialog` 的新实例。如其名称所示,此对话框主要用于向用户显示警告消息。
### Error
API`ErrorDialog()`
`ErrorDialog()` 创建并返回一个具有 `ErrorDialogType``MessageDialog` 的新实例。此对话框设计用于在需要向用户显示错误消息时使用。
### OpenFile
API`OpenFileDialog()`
`OpenFileDialog()` 创建并返回一个新的 `OpenFileDialogStruct`。此对话框提示用户从其文件系统中选择一个或多个文件。
### SaveFile
API`SaveFileDialog()`
`SaveFileDialog()` 创建并返回一个新的 `SaveFileDialogStruct`。此对话框提示用户选择其文件系统上的位置以保存文件。
### OpenDirectory
API`OpenDirectoryDialog()`
`OpenDirectoryDialog()` 创建并返回一个具有 `OpenDirectoryDialogType``MessageDialog` 的新实例。此对话框使用户能够从其文件系统中选择目录。
### On
API`On(eventType events.ApplicationEventType, callback func(event *Event)) func()`
`On()` 注册特定应用程序事件的事件侦听器。提供的回调函数将在相应事件发生时触发。该函数返回一个可调用的函数,用于删除侦听器。
### RegisterHook
API`RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()`
`RegisterHook()` 注册要在特定事件期间作为钩子运行的回调函数。这些钩子在使用 `On()` 附加的侦听器之前运行。该函数返回一个可调用的函数,用于删除钩子。
### GetPrimaryScreen
API`GetPrimaryScreen() (*Screen, error)`
`GetPrimaryScreen()` 返回系统的主屏幕。
### GetScreens
API`GetScreens() ([]*Screen, error)`
`GetScreens()` 返回有关连接到系统的所有屏幕的信息。
这是提供的 `App` 结构中导出的方法的简要摘要。请注意,有关更详细的功能或注意事项,请参考实际的 Go 代码或进一步的内部文档。
## Options
```go title="application_options.go"
--8<--
../v3/pkg/application/options_application.go
--8<--
```
### Windows 选项
```go title="application_options_windows.go"
--8<--
../v3/pkg/application/options_application_win.go
--8<--
```
### Mac 选项
```go title="options_application_mac.go"
--8<--
../v3/pkg/application/options_application_mac.go
--8<--
```

View file

@ -0,0 +1,37 @@
# 主线程函数
这些方法是在主线程上运行代码的实用函数。当您想要在UI线程上运行自定义代码时这是必需的。
### InvokeSync
API: `InvokeSync(fn func())`
此函数以同步方式运行传入的函数(`fn`)。它使用一个`WaitGroup``wg`)确保主线程在`fn`函数完成之前等待,然后才继续执行。如果在`fn`内部发生恐慌,它将传递给应用程序选项中定义的处理程序函数`PanicHandler`
### InvokeSyncWithResult
API: `InvokeSyncWithResult[T any](fn func() T) (res T)`
此函数与`InvokeSync(fn func())`类似,但它返回一个结果。可用于调用具有单个返回值的任何函数。
### InvokeSyncWithError
API: `InvokeSyncWithError(fn func() error) (err error)`
此函数同步运行`fn`并返回`fn`产生的任何错误。请注意,如果在`fn`执行期间发生恐慌,此函数将从恢复。
### InvokeSyncWithResultAndError
API: `InvokeSyncWithResultAndError[T any](fn func() (T, error)) (res T, err error)`
此函数同步运行`fn`并返回类型为`T`的结果和一个错误。
### InvokeAsync
API: `InvokeAsync(fn func())`
此函数以异步方式运行`fn`。它在主线程上运行给定的函数。如果在`fn`内部发生恐慌,它将传递给应用程序选项中定义的处理程序函数`PanicHandler`
---
注意:这些函数将阻塞执行,直到`fn`完成。确保`fn`不会阻塞至关重要。如果需要运行阻塞函数,请改用`InvokeAsync`

View file

@ -0,0 +1,60 @@
# 菜单
可以创建菜单并添加到应用程序中。它们可以用于创建上下文菜单、系统托盘菜单和应用程序菜单。
要创建一个新菜单,请调用:
```go
// 创建一个新菜单
menu := app.NewMenu()
```
然后,`Menu` 类型上可用以下操作:
### 添加
API`Add(label string) *MenuItem`
此方法以 `string` 类型的 `label` 作为输入,并将具有给定标签的新 `MenuItem` 添加到菜单中。它返回添加的 `MenuItem`
### 添加分隔符
API`AddSeparator()`
此方法将一个新的分隔符 `MenuItem` 添加到菜单中。
### 添加复选框
API`AddCheckbox(label string, enabled bool) *MenuItem`
此方法以 `string` 类型的 `label``bool` 类型的 `enabled` 作为输入,并将具有给定标签和启用状态的新复选框 `MenuItem` 添加到菜单中。它返回添加的 `MenuItem`
### 添加单选按钮
API`AddRadio(label string, enabled bool) *MenuItem`
此方法以 `string` 类型的 `label``bool` 类型的 `enabled` 作为输入,并将具有给定标签和启用状态的新单选按钮 `MenuItem` 添加到菜单中。它返回添加的 `MenuItem`
### 更新
API`Update()`
此方法处理任何单选按钮组,并在菜单未初始化时更新菜单。
### 添加子菜单
API`AddSubmenu(s string) *Menu`
此方法以 `string` 类型的 `s` 作为输入,并将具有给定标签的新子菜单 `MenuItem` 添加到菜单中。它返回添加的子菜单。
### 添加角色
API`AddRole(role Role) *Menu`
此方法以 `Role` 类型的 `role` 作为输入,如果不为 `nil`,则将其添加到菜单中,并返回 `Menu`
### 设置标签
API`SetLabel(label string)`
此方法设置 `Menu``label`

View file

@ -0,0 +1,102 @@
# 系统托盘
系统托盘位于桌面环境的通知区域,可以包含当前运行应用程序的图标和特定系统通知。
您可以通过调用 `app.NewSystemTray()` 来创建一个系统托盘:
```go
// 创建一个新的系统托盘
tray := app.NewSystemTray()
```
`SystemTray` 类型上提供了以下方法:
### SetLabel
API`SetLabel(label string)`
`SetLabel` 方法设置托盘的标签。
### Label
API`Label() string`
`Label` 方法获取托盘的标签。
### PositionWindow
API`PositionWindow(*WebviewWindow, offset int) error`
`PositionWindow` 方法调用了 `AttachWindow``WindowOffset` 方法。
### SetIcon
API`SetIcon(icon []byte) *SystemTray`
`SetIcon` 方法设置系统托盘的图标。
### SetDarkModeIcon
API`SetDarkModeIcon(icon []byte) *SystemTray`
`SetDarkModeIcon` 方法设置暗黑模式下系统托盘的图标。
### SetMenu
API`SetMenu(menu *Menu) *SystemTray`
`SetMenu` 方法设置系统托盘的菜单。
### Destroy
API`Destroy()`
`Destroy` 方法销毁系统托盘实例。
### OnClick
API`OnClick(handler func()) *SystemTray`
`OnClick` 方法设置点击托盘图标时执行的函数。
### OnRightClick
API`OnRightClick(handler func()) *SystemTray`
`OnRightClick` 方法设置右键点击托盘图标时执行的函数。
### OnDoubleClick
API`OnDoubleClick(handler func()) *SystemTray`
`OnDoubleClick` 方法设置双击托盘图标时执行的函数。
### OnRightDoubleClick
API`OnRightDoubleClick(handler func()) *SystemTray`
`OnRightDoubleClick` 方法设置右键双击托盘图标时执行的函数。
### AttachWindow
API`AttachWindow(window *WebviewWindow) *SystemTray`
`AttachWindow` 方法将窗口附加到系统托盘。当点击系统托盘图标时,窗口将显示出来。
### WindowOffset
API`WindowOffset(offset int) *SystemTray`
`WindowOffset` 方法设置系统托盘与窗口之间的像素间隔。
### WindowDebounce
API`WindowDebounce(debounce time.Duration) *SystemTray`
`WindowDebounce` 方法设置防抖时间。在 Windows 上,它用于指定在响应通知图标上的鼠标松开事件之前等待多长时间。
### OpenMenu
API`OpenMenu()`
`OpenMenu` 方法打开与系统托盘关联的菜单。

View file

@ -0,0 +1,101 @@
# 窗口
要创建一个窗口,可以使用[Application.NewWebviewWindow](application.md#newwebviewwindow)或[Application.NewWebviewWindowWithOptions](application.md#newwebviewwindowwithoptions)。前者创建一个具有默认选项的窗口,而后者允许您指定自定义选项。
这些方法可在返回的WebviewWindow对象上调用
### SetTitle
API: `SetTitle(title string) *WebviewWindow`
此方法将窗口标题更新为提供的字符串。它返回WebviewWindow对象允许进行方法链接。
### Name
API: `Name() string`
此函数返回WebviewWindow的名称。
### SetSize
API: `SetSize(width, height int) *WebviewWindow`
此方法将WebviewWindow的大小设置为提供的宽度和高度参数。如果提供的尺寸超过约束条件它们将被相应调整。
### SetAlwaysOnTop
API: `SetAlwaysOnTop(b bool) *WebviewWindow`
此函数根据提供的布尔标志设置窗口始终置顶。
### Show
API: `Show() *WebviewWindow`
`Show`方法用于使窗口可见。如果窗口未运行,它首先调用`run`方法启动窗口,然后使其可见。
### Hide
API: `Hide() *WebviewWindow`
`Hide`方法用于隐藏窗口。它将窗口的隐藏状态设置为true并触发窗口隐藏事件。
### SetURL
API: `SetURL(s string) *WebviewWindow`
`SetURL`方法用于将窗口的URL设置为给定的URL字符串。
### SetZoom
API: `SetZoom(magnification float64) *WebviewWindow`
`SetZoom`方法将窗口内容的缩放级别设置为提供的放大倍数。
### GetZoom
API: `GetZoom() float64`
`GetZoom`函数返回窗口内容的当前缩放级别。
### GetScreen
API: `GetScreen() (*Screen, error)`
`GetScreen`方法返回窗口所显示的屏幕。
#### SetFrameless
API: `SetFrameless(frameless bool) *WebviewWindow`
此函数用于移除窗口边框和标题栏。它根据提供的布尔值true表示无边框false表示有边框切换窗口的无边框状态。
#### RegisterContextMenu
API: `RegisterContextMenu(name string, menu *Menu)`
此函数用于注册上下文菜单并为其指定给定的名称。
#### NativeWindowHandle
API: `NativeWindowHandle() (uintptr, error)`
此函数用于获取窗口的平台本机窗口句柄。
#### Focus
API: `Focus()`
此函数用于将焦点设置到窗口。
#### SetEnabled
API: `SetEnabled(enabled bool)`
此函数用于根据提供的布尔值启用/禁用窗口。
#### SetAbsolutePosition
API: `SetAbsolutePosition(x int, y int)`
此函数设置窗口在屏幕上的绝对位置。

View file

@ -0,0 +1,39 @@
# 更新日志
<!--
此项目的所有重要更改将在此文件中记录。
格式基于[保持一个更改日志](https://keepachangelog.com/en/1.0.0/)
并且该项目遵循[语义化版本](https://semver.org/spec/v2.0.0.html)。
- `Added` 用于新增功能。
- `Changed` 用于现有功能的更改。
- `Deprecated` 用于即将移除的功能。
- `Removed` 用于已移除的功能。
- `Fixed` 用于修复错误。
- `Security` 用于安全漏洞。
-->
## [未发布]
### Added
- [darwin] 添加Event ApplicationShouldHandleReopen以处理单击dock图标的功能 @5aaee9 in [#2991](https://github.com/wailsapp/wails/pull/2991)
- [darwin] 添加getPrimaryScreen/getScreens的实现 @tmclane in [#2618](https://github.com/wailsapp/wails/pull/2618)
### Fixed
- 修复Doctor apt软件包验证问题 [Atterpac](https://github.com/Atterpac) in [#2972](https://github.com/wailsapp/wails/pull/2972)。
- 修复应用程序在退出时冻结的问题 (Darwin) @5aaee9 in [#2982](https://github.com/wailsapp/wails/pull/2982)
- 修复Windows上示例的背景颜色问题 [mmgvh](https://github.com/mmghv) in [#2750](https://github.com/wailsapp/wails/pull/2750)。
- 修复默认上下文菜单问题 [mmgvh](https://github.com/mmghv) in [#2753](https://github.com/wailsapp/wails/pull/2753)。
### Changed
### Removed
### Deprecated
### Security

View file

@ -0,0 +1,341 @@
# v3的更改
!!! note
这是当前的无序更改脑升级。很快它将组织成一个更易读的格式。
## 选项
自v2以来应用程序选项已经进行了修订。
## 事件
在v3中有3种类型的事件
- 应用程序事件
- 窗口事件
- 自定义事件
### 应用程序事件
应用程序事件是由应用程序发出的事件。这些事件包括macOS上的`ApplicationDidFinishLaunching`等本机事件。
### 窗口事件
窗口事件是由窗口发出的事件。这些事件包括macOS上的`WindowDidBecomeMain`等本机事件。还定义了常见事件,以便它们在跨平台上工作,例如`WindowClosing`
### 自定义事件
用户定义的事件称为`WailsEvents`。这是为了将它们与用于与浏览器通信的`Event`对象区分开来。WailsEvents现在是封装事件的对象。这包括事件名称数据和事件的源。
与WailsEvent关联的数据现在是单个值。如果需要多个值则可以使用struct。
### 事件回调和`Emit`函数签名
事件回调的签名(由`On``Once``OnMultiple`使用已更改。在v2中回调函数接收可选数据。在v3中回调函数接收包含与事件相关的所有数据的`WailsEvent`对象。
类似地,`Emit`函数已更改。它现在不再接受名称和可选数据,而是接受一个`WailsEvent`对象,它将发出该对象。
### `Off``OffAll`
在v2中`Off``OffAll`调用将删除JS和Go中的事件。由于v3具有多窗口的特性因此已更改为这些方法仅适用于调用它们的上下文。例如如果你在一个窗口中调用`Off`它仅会删除该窗口的事件。如果你在Go中使用`Off`它只会删除Go的事件。
### Hooks
事件钩子是v3中的新功能。它们允许您钩入事件系统并在发出某些事件时执行操作。例如您可以钩入`WindowClosing`事件,在窗口关闭之前执行一些清理操作。钩子可以在应用程序级别或窗口级别使用`RegisterHook`进行注册。应用程序级别适用于应用程序事件。仅当窗口级别钩子与其注册的窗口一起调用。
### 日志记录
在v2中日志记录会混淆因为应用程序日志和系统内部日志都使用相同的记录器。我们已经对此进行了简化
- 内部日志现在使用标准的Go `slog`记录器处理。这是通过应用程序选项中的`logger`选项进行配置的。默认情况下,这使用[tint](https://github.com/lmittmann/tint)记录器。
- 现在可以通过新的`log`插件进行应用程序日志记录,它在底层使用`slog`。此插件提供了一个简单的用于记录到控制台的API。它在Go和JS中都可用。
### 开发人员注意事项
在Go中发出事件时它会将事件分派到本地的Go侦听器以及应用程序中的每个窗口。在JS中发出事件时它现在会将事件发送到应用程序。这将被处理就好像它是在Go中发出的但是发送者ID将是窗口的ID。
## 窗口
Window API在很大程度上保持不变但方法现在是在窗口实例而不是运行时上。一些值得注意的变化是
- 窗口现在具有标识它们的名称。用于在发出事件时标识窗口。
- 窗口上现在有更多以前不可用的方法,例如`AbsolutePosition``ToggleDevTools`
- 窗口现在可以通过本机拖放接受文件。有关详细信息,请参阅拖放部分。
## 剪切板
剪贴板API已经简化。现在有一个单独的`Clipboard`对象,可以用于读取和写入剪贴板。`Clipboard`对象在Go和JS中都可用。`SetText()`用于设置文本,`Text()`用于获取文本。
## 绑定
绑定的工作方式与v2类似通过提供一种将结构方法绑定到前端的方式。这些可以在前端使用由`wails3 generate bindings`命令生成的绑定包装器来调用:
```javascript
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import { main } from "./models";
window.go = window.go || {};
window.go.main = {
GreetService: {
/**
* GreetService.Greet
* Greet greets a person
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function (name) {
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
},
/**
* GreetService.GreetPerson
* GreetPerson greets a person
* @param person {main.Person}
* @returns {Promise<string>}
**/
GreetPerson: function (person) {
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
},
},
};
```
默认情况下绑定的方法是混淆的并使用uint32 ID进行标识该ID是使用[FNV哈希算法](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function)计算的。这是为了防止方法名称在生产构建中被暴露出来。在调试模式下方法ID与计算的方法ID一起记录以帮助调试。如果您希望增加额外的混淆层可以使用`BindAliases`选项。这允许您指定别名ID与方法ID的映射。当前端使用ID调用方法时方法ID将首先在别名映射中查找匹配项。如果找不到它将假定是标准方法ID并尝试以通常的方式查找方法。
示例:
```go
app := application.New(application.Options{
Bind: []any{
&GreetService{},
},
BindAliases: map[uint32]uint32{
1: 1411160069,
2: 4021313248,
},
Assets: application.AssetOptions{
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
```
现在我们可以使用此别名在前端调用:`wails.Call(1, "world!")`
### 不安全调用
如果您不介意在二进制文件中以明文形式提供调用,并且不打算使用[garble](https://github.com/burrowers/garble),那么可以使用不安全的`wails.CallByName()`方法。此方法接受要调用的方法的完全限定名称和要传递给它的参数。示例:
```go
wails.CallByName("main.GreetService.Greet", "world!")
```
!!! danger
这仅作为开发的便利方法提供。不建议在生产中使用此方法。
## 对话框
对话框现在在JavaScript中可用
### Windows
Windows中的对话框按钮是不可配置的根据对话框的类型是恒定的。要在按下按钮时触发回调请创建一个具有与您希望附加回调的按钮相同名称的按钮。示例创建一个标签为“确定”的按钮并使用`OnClick()`方法设置回调方法:
```go
dialog := app.QuestionDialog().
SetTitle("Update").
SetMessage("The cancel button is selected when pressing escape")
ok := dialog.AddButton("Ok")
ok.OnClick(func() {
// Do something
})
no := dialog.AddButton("Cancel")
dialog.SetDefaultButton(ok)
dialog.SetCancelButton(no)
dialog.Show()
```
## 拖放
可以按窗口启用本机拖放。只需将`EnableDragAndDrop`窗口配置选项设置为`true`,窗口将允许将文件拖放到其上。当这种情况发生时,将发出`events.FilesDropped`事件。然后可以使用`WindowEvent.Context()`中的`DroppedFiles()`方法检索文件名。这将返回一个包含文件名的字符串切片。
## 上下文菜单
上下文菜单是当用户右键单击元素时显示的上下文菜单。创建上下文菜单与创建标准菜单相同,使用`app.NewMenu()`。要使上下文菜单对窗口可用,请调用`window.RegisterContextMenu(name, menu)`。名称将是上下文菜单的ID并由前端使用。
要指示元素具有上下文菜单,请将`data-contextmenu`属性添加到元素。此属性的值应为先前在窗口中注册的上下文菜单的名称。
可以在应用程序级别注册上下文菜单,使其对所有窗口可用。可以使用`app.RegisterContextMenu(name, menu)`完成此操作。如果在窗口级别找不到上下文菜单,则将检查应用程序上下文菜单。`v3/examples/contextmenus`中可以找到此演示。
## Wails标记语言WML
Wails标记语言是一种简单的标记语言允许您在没有JavaScript的情况下向标准HTML元素添加功能。
当前支持以下标签:
### `data-wml-event`
这指定单击元素时将发出Wails事件。属性的值应为要发出的事件的名称。
示例:
```html
<button data-wml-event="myevent">Click Me</button>
```
有时您需要用户确认操作。可以通过向元素添加`data-wml-confirm`属性来完成。此属性的值将是要显示给用户的消息。
示例:
```html
<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
Delete All Items
</button>
```
### `data-wml-window`
可以通过将`data-wml-window`属性添加到元素中来调用任何`wails.window`方法。属性的值应为要调用的方法的名称。方法名称应与导出的方法的名称完全匹配。
```html
<button data-wml-window="Close">Close Window</button>
```
### `data-wml-trigger`
此属性指定应触发操作的javascript事件。默认为`click`
```html
<button data-wml-event="hover-box" data-wml-trigger="mouseover">
Hover over me!
</button>
```
## 系统托盘
Wails 3附带了一个内置的系统托盘。这是一个完全功能的系统托盘旨在尽可能简单地使用。可以设置托盘的图标、工具提示和菜单。还可以“附加”窗口到系统托盘。这样做将提供以下功能
- 单击托盘图标会切换窗口可见性
- 右键单击托盘将打开菜单(如果有)
在macOS上如果没有附加的窗口则托盘将使用显示菜单的默认方法任何按钮。如果有附加的窗口但没有菜单则托盘将切换窗口而不管按下的按钮如何。
## 插件
插件是扩展Wails应用程序功能的一种方式。
### 创建插件
插件是符合以下接口的标准Go结构
```go
type Plugin interface {
Name() string
Init(*application.App) error
Shutdown()
CallableByJS() []string
InjectJS() string
}
```
`Name()`方法返回插件的名称。这用于记录目的。
`Init(*application.App) error`方法在加载插件时调用。`*application.App`参数是加载插件的应用程序。任何错误都将阻止应用程序启动。
`Shutdown()`方法在应用程序关闭时调用。
`CallableByJS()`方法返回可以从前端调用的导出函数列表。这些方法名称必须与插件导出的方法名称完全匹配。
`InjectJS()`方法返回应注入到创建的所有窗口中的JavaScript。这对于添加与插件补充的自定义JavaScript函数很有用。
### 提示
#### 枚举
在Go中枚举通常被定义为类型和一组常量。例如
```go
type MyEnum int
const (
MyEnumOne MyEnum = iota
MyEnumTwo
MyEnumThree
)
```
由于Go和JavaScript之间的不兼容性无法以这种方式使用自定义类型。最好的策略是为float64使用类型别名
```go
type MyEnum = float64
const (
MyEnumOne MyEnum = iota
MyEnumTwo
MyEnumThree
)
```
在Javascript中您可以使用以下代码
```js
const MyEnum = {
MyEnumOne: 0,
MyEnumTwo: 1,
MyEnumThree: 2,
};
```
- 为什么使用`float64`?不能使用`int`吗?
- 因为JavaScript没有“int”的概念。一切都是`number`在Go中会转换为`float64`。Go的反射包中还有类型转换的限制这意味着使用`int`是行不通的。
### BackgroundColour
在v2中这是指向`RGBA`结构的指针。在v3中这是`RGBA`结构的值。
### WindowIsTranslucent
已删除此标志。现在有一个`BackgroundType`标志,可用于设置窗口应具有的背景类型。此标志可以设置为以下任何值:
- `BackgroundTypeSolid` - 窗口将具有实心背景
- `BackgroundTypeTransparent` - 窗口将具有透明背景
- `BackgroundTypeTranslucent` - 窗口将具有半透明背景
在Windows上如果`BackgroundType`设置为`BackgroundTypeTranslucent`,则可以使用`WindowsWindow`选项中的`BackdropType`标志设置透明度的类型。这可以设置为以下任何值:
- `Auto` - 窗口将使用系统确定的效果
- `None` - 窗口没有背景
- `Mica` - 窗口使用Mica效果
- `Acrylic` - 窗口使用丙烯酸效果
- `Tabbed` - 窗口使用选项卡效果
## Windows Application Options
### WndProcInterceptor
如果设置了此标志将拦截WndProc并调用该函数。这允许您直接处理Windows消息。该函数应具有以下签名
```go
func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnValue uintptr, shouldReturn)
```
如果`shouldReturn`值设置为`true`,则`returnValue`将由主wndProc方法返回。如果设置为`false`将忽略返回值并且消息将继续由主wndProc方法处理。
## 在关闭时隐藏窗口+OnBeforeClose
在v2中有一个`HideWindowOnClose`标志,用于在关闭窗口时隐藏窗口。`HideWindowOnClose`标志与`OnBeforeClose`回调之间存在逻辑重叠。在v3中已删除`HideWindowOnClose`标志,并将`OnBeforeClose`回调重命名为`ShouldClose`。当用户尝试关闭窗口时,将调用`ShouldClose`回调。如果回调返回`true`,窗口将关闭。如果返回`false`,窗口将不会关闭。这可以用于隐藏窗口而不是关闭窗口。
## 窗口拖动
在v2中使用`--wails-drag`属性来指示可以使用元素拖动窗口。在v3中已将其替换为`--webkit-app-region`,以更符合其他框架处理方式。`--webkit-app-region`属性可以设置为以下任何值:
- `drag` - 可使用该元素拖动窗口
- `no-drag` - 该元素无法用于拖动窗口
我们本来希望使用`app-region`但是在webkit在macOS上的`getComputedStyle`调用不支持它。

View file

@ -0,0 +1,163 @@
# 介绍
!!! note 这个指南仍在制作中。
感谢您想要帮助开发Wails本指南将帮助您入门。
## 入门指南
- Git 克隆此存储库。切换到 `v3-alpha` 分支。
- 安装 CLI`cd v3/cmd/wails3 && go install`
- 可选:如果您想要使用构建系统构建前端代码,您需要安装 [npm](https://nodejs.org/en/download)。
## 构建
对于简单的程序,您可以使用标准的 `go build` 命令。也可以使用 `go run`
Wails 还配备了一个构建系统,可用于构建更复杂的项目。它使用了强大的 [Task](https://taskfile.dev) 构建系统。要了解更多信息,请查看任务主页或运行 `wails task --help`
## 项目结构
该项目具有以下结构:
```
v3
├── cmd/wails3 // CLI
├── examples // Wails 应用示例
├── internal // 内部包
| ├── runtime // Wails JS 运行时
| └── templates // 支持的项目模板
├── pkg
| ├── application // 核心 Wails 库
| └── events // 事件定义
| └── mac // 由插件使用的 macOS 特定代码
| └── w32 // Windows 特定代码
├── plugins // 支持的插件
├── tasks // 通用任务
└── Taskfile.yaml // 开发任务配置
```
## 开发
### 添加窗口功能
添加窗口功能的首选方法是在 `pkg/application/webview_window.go` 文件中添加一个新函数。这应该实现所有平台所需的功能。任何特定于平台的代码都应通过 `webviewWindowImpl` 接口方法调用。该接口由每个目标平台实现,以提供平台特定的功能。在某些情况下,这可能不执行任何操作。添加接口方法后,请确保每个平台都实现了它。一个很好的例子是 `SetMinSize` 方法。
- Mac: `webview_window_darwin.go`
- Windows: `webview_window_windows.go`
- Linux: `webview_window_linux.go`
大多数,如果不是全部,特定于平台的代码应在主线程上运行。为了简化这一点,在 `application.go` 中定义了一些 `invokeSync` 方法。
### 更新运行时
运行时位于 `v3/internal/runtime`。更新运行时时,需要执行以下步骤:
```shell
wails3 task runtime:build
```
### 事件
事件定义在 `v3/pkg/events` 中。当添加新事件时,需要执行以下步骤:
- 将事件添加到 `events.txt` 文件中
- 运行 `wails3 task events:generate`
有几种类型的事件:特定于平台的应用程序和窗口事件 + 通用事件。通用事件对于跨平台事件处理很有用,但您不必局限于“最低公共分母”。如果需要,可以使用特定于平台的事件。
添加通用事件时,请确保映射了特定于平台的事件。一个示例是在 `window_webview_darwin.go` 中:
```go
// 将 ShouldClose 转化为通用的 WindowClosing 事件
w.parent.On(events.Mac.WindowShouldClose, func(_ *WindowEventContext) {
w.parent.emit(events.Common.WindowClosing)
})
```
注意:我们可能会尝试通过将映射添加到事件定义中来自动化此过程。
### 插件
插件是扩展 Wails 应用功能的一种方式。
#### 创建插件
插件是符合以下接口的标准 Go 结构:
```go
type Plugin interface {
Name() string
Init(*application.App) error
Shutdown()
CallableByJS() []string
InjectJS() string
}
```
`Name()` 方法返回插件的名称。这用于日志记录。
`Init(*application.App) error` 方法在加载插件时调用。`*application.App` 参数是加载插件的应用程序。任何错误都将阻止应用程序启动。
`Shutdown()` 方法在应用程序关闭时调用。
`CallableByJS()` 方法返回可以从前端调用的导出函数列表。这些方法的名称必须与插件导出的方法的名称完全匹配。
`InjectJS()` 方法返回应注入到所有窗口中的 JavaScript。这对于添加与插件相补充的自定义 JavaScript 函数非常有用。
内置插件可以在 `v3/plugins` 目录中找到。参考它们以获得灵感。
## 任务
Wails CLI 使用 [Task](https://taskfile.dev) 构建系统。它作为库导入并用于运行 `Taskfile.yaml` 中定义的任务。与 Task 的主要交互发生在 `v3/internal/commands/task.go` 中。
### 升级 Taskfile
要检查是否有 Taskfile 的升级,请运行 `wails3 task -version` 并检查 Task 网站。
要升级使用的 Taskfile 版本,请运行:
```shell
wails3 task taskfile:upgrade
```
如果存在不兼容性,则应在 `v3/internal/commands/task.go` 文件中显示。
通常,修复不兼容性的最佳方法是克隆 `https://github.com/go-task/task` 上的任务存储库,并查看 git 历史记录以确定发生了什么变化以及原因。
要检查所有更改是否正确工作,请重新安装 CLI 并再次检查版本:
```shell
wails3 task cli:install
wails3 task -version
```
## 打开 PR
确保所有 PR 都有与之关联的工单,以提供更改的上下文。如果没有工单,请先创建一个。确保所有 PR 都已使用所做的更改更新了 CHANGELOG.md 文件。CHANGELOG.md 文件位于 `mkdocs-website/docs` 目录中。
## 其他任务
### 升级 Taskfile
Wails CLI 使用 [Task](https://taskfile.dev) 构建系统。它作为库导入并用于运行 `Taskfile.yaml` 中定义的任务。与 Task 的主要交互发生在 `v3/internal/commands/task.go` 中。
要检查是否有 Taskfile 的升级,请运行 `wails3 task -version` 并检查 Task 网站。
要升级使用的 Taskfile 版本,请运行:
```shell
wails3 task taskfile:upgrade
```
如果存在不兼容性,则应在 `v3/internal/commands/task.go` 文件中显示。
通常,修复不兼容性的最佳方法是克隆 `https://github.com/go-task/task` 上的任务存储库,并查看 git 历史记录以确定发生了什么变化以及原因。
要检查所有更改是否正确工作,请重新安装 CLI 并再次检查版本:
```shell
wails3 task cli:install
wails3 task -version
```

View file

@ -0,0 +1,378 @@
将以下文本翻译为中文,并不要翻译 `!!! note``!!! tip` 或以此格式的字符串:
# 状态
v3版功能的状态。
!!! note
此列表包含公有和内部API支持的混合内容。<br/>
它不完整且可能不是最新的。
## 已知问题
- Linux尚未与Windows/Mac达到功能平衡
## 应用程序
应用程序接口方法
| 方法 | Windows | Linux | Mac | 备注 |
|--------------------------------------------------------------|---------|-------|-----|-------|
| run() error | Y | Y | Y | |
| destroy() | | Y | Y | |
| setApplicationMenu(menu *Menu) | Y | Y | Y | |
| name() string | | Y | Y | |
| getCurrentWindowID() uint | Y | Y | Y | |
| showAboutDialog(name string, description string, icon []byte) | | Y | Y | |
| setIcon(icon []byte) | - | Y | Y | |
| on(id uint) | | | Y | |
| dispatchOnMainThread(fn func()) | Y | Y | Y | |
| hide() | Y | Y | Y | |
| show() | Y | Y | Y | |
| getPrimaryScreen() (*Screen, error) | | Y | Y | |
| getScreens() ([]*Screen, error) | | Y | Y | |
## Webview 窗口
Webview 窗口接口方法
| 方法 | Windows | Linux | Mac | 备注 |
|--------------------------------------------------|---------|-------|-----|-----------------------------------------|
| center() | Y | Y | Y | |
| close() | y | Y | Y | |
| destroy() | | Y | Y | |
| execJS(js string) | y | Y | Y | |
| focus() | Y | Y | | |
| forceReload() | | Y | Y | |
| fullscreen() | Y | Y | Y | |
| getScreen() (*Screen, error) | y | Y | Y | |
| getZoom() float64 | | Y | Y | |
| height() int | Y | Y | Y | |
| hide() | Y | Y | Y | |
| isFullscreen() bool | Y | Y | Y | |
| isMaximised() bool | Y | Y | Y | |
| isMinimised() bool | Y | Y | Y | |
| maximise() | Y | Y | Y | |
| minimise() | Y | Y | Y | |
| nativeWindowHandle() (uintptr, error) | Y | Y | | |
| on(eventID uint) | y | | Y | |
| openContextMenu(menu *Menu, data *ContextMenuData) | y | | Y | |
| relativePosition() (int, int) | Y | Y | Y | |
| reload() | y | Y | Y | |
| run() | Y | Y | Y | |
| setAlwaysOnTop(alwaysOnTop bool) | Y | Y | Y | |
| setBackgroundColour(color RGBA) | Y | Y | Y | |
| setEnabled(bool) | | Y | Y | |
| setFrameless(bool) | | Y | Y | |
| setFullscreenButtonEnabled(enabled bool) | - | Y | Y | Windows 没有全屏按钮 |
| setHTML(html string) | Y | Y | Y | |
| setMaxSize(width, height int) | Y | Y | Y | |
| setMinSize(width, height int) | Y | Y | Y | |
| setRelativePosition(x int, y int) | Y | Y | Y | |
| setResizable(resizable bool) | Y | Y | Y | |
| setSize(width, height int) | Y | Y | Y | |
| setTitle(title string) | Y | Y | Y | |
| setURL(url string) | Y | Y | Y | |
| setZoom(zoom float64) | Y | Y | Y | |
| show() | Y | Y | Y | |
| size() (int, int) | Y | Y | Y | |
| toggleDevTools() | Y | Y | Y | |
| unfullscreen() | Y | Y | Y | |
| unmaximise() | Y | Y | Y | |
| unminimise() | Y | Y | Y | |
| width() int | Y | Y | Y | |
| zoom() | | Y | Y | |
| zoomIn() | Y | Y | Y | |
| zoomOut() | Y | Y | Y | |
| zoomReset() | Y | Y | Y | |
## 运行时
### 应用程序
| 功能 | Windows | Linux | Mac | 备注 |
|-------|---------|-------|-----|-------|
| 退出 | Y | Y | Y | |
| 隐藏 | Y | | Y | |
| 显示 | Y | | Y | |
### 对话框
| 功能 | Windows | Linux | Mac | 备注 |
|------------|---------|-------|-----|-------|
| 信息 | Y | Y | Y | |
| 警告 | Y | Y | Y | |
| 错误 | Y | Y | Y | |
| 问题 | Y | Y | Y | |
| 打开文件 | Y | | Y | |
| 保存文件 | Y | | Y | |
### 剪贴板
| 功能 | Windows | Linux | Mac | 备注 |
|--------|---------|-------|-----|-------|
| 设置文本 | Y | | Y | |
| 文本 | Y | | Y | |
### 上下文菜单
| 功能 | Windows | Linux | Mac | 备注 |
|----------------------|---------|-------|-----|-------|
| 打开上下文菜单 | Y | | Y | |
| 默认开启 | | | | |
| 通过 HTML 控制 | Y | | | |
默认上下文菜单默认对所有`contentEditable: true``<input>``<textarea>`标签的元素或具有`--default-contextmenu: true`样式的元素启用。`--default-contextmenu: show`样式将始终显示上下文菜单。`--default-contextmenu: hide`样式将始终隐藏上下文菜单。
嵌套在带有`--default-contextmenu: hide`样式的标签下的任何内容,除非使用`--default-contextmenu: show`进行显式设置,否则不会显示上下文菜单。
### 屏幕
| 功能 | Windows | Linux | Mac | 备注 |
|--------------|---------|-------|-----|-------|
| 获取所有 | Y | Y | Y | |
| 获取主屏幕 | Y | Y | Y | |
| 获取当前屏幕 | Y | Y | Y | |
### 系统
| 功能 | Windows | Linux | Mac | 备注 |
|--------------|---------|-------|-----|-------|
| 是否为暗模式 | | | Y | |
### 窗口
Y = 支持 U = 未经测试
- = 不可用
| 功能 | Windows | Linux | Mac | 备注 |
|----------------------|---------|-------|-----|--------------------------------------------------------------------------------------|
| 居中 | Y | Y | Y | |
| 获得焦点 | Y | Y | | |
| 全屏 | Y | Y | Y | |
| 获得缩放比例 | Y | Y | Y | 获取当前视图比例 |
| 高度 | Y | Y | Y | |
| 隐藏 | Y | Y | Y | |
| 最大化 | Y | Y | Y | |
| 最小化 | Y | Y | Y | |
| 相对位置 | Y | Y | Y | |
| 屏幕 | Y | Y | Y | 获取窗口的屏幕 |
| 设置始终在顶部 | Y | Y | Y | |
| 设置背景颜色 | Y | Y | Y | https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621#issuecomment-938234294 |
| 设置启用状态 | Y | U | - | 设置窗口是否可用 |
| 设置最大尺寸 | Y | Y | Y | |
| 设置最小尺寸 | Y | Y | Y | |
| 设置相对位置 | Y | Y | Y | |
| 设置是否可调整大小 | Y | Y | Y | |
| 设置大小 | Y | Y | Y | |
| 设置标题 | Y | Y | Y | |
| 设置缩放比例 | Y | Y | Y | 设置视图比例 |
| 显示 | Y | Y | Y | |
| 尺寸 | Y | Y | Y | |
| 取消全屏 | Y | Y | Y | |
| 取消最大化 | Y | Y | Y | |
| 取消最小化 | Y | Y | Y | |
| 宽度 | Y | Y | Y | |
| 缩放 | | Y | Y | |
| 放大 | Y | Y | Y | 增加视图比例 |
| 缩小 | Y | Y | Y | 减小视图比例 |
| 重置缩放 | Y | Y | Y | 重置视图比例 |
### 窗口选项
下表中的'Y'表示已经测试并且在窗口创建时应用了该选项。'X'表示该平台不支持该选项。
| 功能 | Windows | Linux | Mac | 备注 |
|--------------------------------|---------|-------|-----|-------------------------------------------|
| 始终在顶部 | Y | | | |
| 背景颜色 | Y | Y | | |
| 背景类型 | | | | 默认情况下,亚克力效果有效,其他无效 |
| CSS | Y | Y | | |
| DevToolsEnabled | Y | Y | Y | |
| DisableResize | Y | Y | | |
| 启用拖放 | | Y | | |
| 启用欺诈网站警告 | | | | |
| 获得焦点 | Y | Y | | |
| 无边框 | Y | Y | | |
| 启用全屏按钮 | Y | | | Windows上没有全屏按钮 |
| HTML | Y | Y | | |
| JS | Y | Y | | |
| Mac | - | - | | |
| 最大高度 | Y | Y | | |
| 最大宽度 | Y | Y | | |
| 最小高度 | Y | Y | | |
| 最小宽度 | Y | Y | | |
| 名称 | Y | Y | | |
| 启动时打开检查器 | | | | |
| 启动状态 | Y | | | |
| 标题 | Y | Y | | |
| URL | Y | Y | | |
| 宽度 | Y | Y | | |
| Windows | Y | - | - | |
| X | Y | Y | | |
| Y | Y | Y | | |
| 缩放 | | | | |
| 启用缩放控件 | | | | |
### 日志
要记录还是不要记录?系统日志器与自定义日志器。
## 菜单
| 事件 | Windows | Linux | Mac | 备注 |
|-------------------------|---------|-------|-----|-------|
| 默认应用程序菜单 | Y | Y | Y | |
## 托盘菜单
| 功能 | Windows | Linux | Mac | 备注 |
|-------------------|---------|-------|-----|-------|
| 图标 | Y | | Y | Windows具有默认的浅色/深色模式图标并支持PNG或ICO。 |
| 标签 | - | | Y | |
| 标签ANSI码 | - | | | |
| 菜单 | Y | | Y | |
### 方法
| 方法 | Windows | Linux | Mac | 备注 |
|-----------------------------|---------|-------|-----|-------|
| setLabel(label string) | - | | Y | |
| run() | Y | | Y | |
| setIcon(icon []byte) | Y | | Y | |
| setMenu(menu *Menu) | Y | | Y | |
| setIconPosition(position int) | - | | Y | |
| setTemplateIcon(icon []byte) | - | | Y | |
| destroy() | Y | | Y | |
| setDarkModeIcon(icon []byte) | Y | | Y | |
## 跨平台事件
将本机事件映射到跨平台事件。
| 事件 | Windows | Linux | Mac | 备注 |
|--------------------------|---------|-------|-----------------|-------|
| WindowWillClose | | | WindowWillClose | |
| WindowDidClose | | | | |
| WindowDidResize | | | | |
| WindowDidHide | | | | |
| ApplicationWillTerminate | | | | |
... 添加更多
## 绑定生成
工作正常。
## 模型生成
工作正常。
## 任务文件
包含很多开发所需的内容。
## 主题
| 模式 | Windows | Linux | Mac | 备注 |
|--------|---------|-------|-----|-------|
| 暗 | Y | | | |
| 亮 | Y | | | |
| 系统 | Y | | | |
## NSIS安装程序
待定
## 模板
所有模板都可用。
## 插件
内置插件支持:
| 插件 | Windows | Linux | Mac | 备注 |
|---------------|---------|-------|-----|-------|
| 浏览器 | Y | | Y | |
| KV 存储 | Y | Y | Y | |
| 日志 | Y | Y | Y | |
| 单实例 | Y | | Y | |
| SQLite | Y | Y | Y | |
| 开机自启动 | Y | | Y | |
| 服务器 | | | | |
待办事项:
- 确保每个插件都有一个可以注入到窗口中的JS包装器。
## 打包
| | Windows | Linux | Mac | 备注 |
|-----------------|---------|-------|-----|-------|
| 图标生成 | Y | | Y | |
| 图标嵌入 | Y | | Y | |
| Info.plist | - | | Y | |
| NSIS 安装程序 | | | - | |
| Mac 包 | - | | Y | |
| Windows 可执行文件 | Y | | - | |
## 无边框窗口
| 功能 | Windows | Linux | Mac | 备注 |
|---------|---------|-------|-----|-------|
| 调整大小 | Y | | Y | |
| 拖拽 | Y | Y | Y | Linux-始终可以使用 `Meta`+左键拖拽 |
## Mac 特定
- [x] 半透明
### Mac 选项
| 功能 | 默认值 | 备注 |
|---------------|------------------|-----------------------------------------------------|
| 背景 | MacBackdropNormal | 标准的实心窗口 |
| 禁用阴影 | false | |
| 标题栏 | | 默认情况下使用标准的窗口装饰 |
| 外观 | DefaultAppearance | |
| 隐藏标题栏高度 | 0 | 为无边框窗口创建一个不可见的标题栏 |
| 禁用阴影 | false | 禁用窗口投影阴影 |
## Windows 特定
- [x] 半透明
- [x] 自定义主题
### Windows 选项
| 功能 | 默认值 | 备注 |
|--------------------------------|----------------|--------------------------------------------|
| 背景类型 | Solid | |
| 禁用图标 | false | |
| 主题 | SystemDefault | |
| 自定义主题 | nil | |
| 禁用无边框窗口装饰 | false | |
| 窗口遮罩 | nil | 使窗口成为位图的内容 |
## Linux 特定
`*_linux.go`文件使用的函数的实现详细信息位于以下文件中:
- linux_cgo.goCGo 实现
- linux_purego.goPureGo 实现
### CGO
默认情况下,使用 CGO 编译 Linux 端口。这会阻止轻松的交叉编译,因此同时也正在同时开发 PureGo 实现。
### Purego
可以使用以下命令编译示例:
CGO_ENABLED=0 go build -tags purego
注意:重构之后的功能目前无法正常工作。

View file

@ -0,0 +1,58 @@
# 反馈
我们欢迎(并鼓励)您的反馈!在创建新的反馈之前,请先搜索现有的票据或帖子。
以下是提供反馈的不同方式:
=== "错误"
如果您发现错误请在Discord的[v3 Alpha Feedback](https://discord.gg/3mgVyGua)频道中发布信息:
- 帖子应清楚地说明错误所在,并提供一个简单的可重现示例。如果文档不清楚应该发生什么,请在帖子中说明。
- 帖子应标记为`Bug`
- 请在帖子中包含`wails doctor`的输出。
- 请记住,意外行为不一定是错误-它可能只是不符合您的期望。请使用[建议](#suggestions)。
=== "修复"
如果您有一个错误的修复或文档的更新,请执行以下操作:
- 在[Wails存储库](https://github.com/wailsapp/wails)上创建一个拉取请求。PR的标题应以`[v3 alpha]`开头。
- 在[v3 Alpha Feedback](https://discord.gg/3mgVyGua)频道中发布帖子。
- 帖子应标记为`PR`
- 请在帖子中包含PR的链接。
=== "建议"
如果您有建议请在Discord的[v3 Alpha Feedback](https://discord.gg/3mgVyGua)频道中发布信息:
- 帖子应标记为`Suggestion`
如果您有任何问题,请随时在[Discord](https://discord.gg/3mgVyGua)上联系我们。
=== "投票"
- 可以使用:thumbsup:表情符号给帖子投票。请对您认为优先级较高的帖子进行投票。
- 请*不要*只添加"+1"或"me too"等评论。
- 如果帖子还有更多内容可补充,请随时发表评论,例如"此错误也影响ARM构建"或"另一种选项是......"
已知问题和正在进行的工作列表可以在[此处](https://github.com/orgs/wailsapp/projects/6)找到。
## 我们寻求反馈的内容
- API
- 使用起来方便吗?
- 它是否按照您的期望工作?
- 有什么遗漏的功能吗?
- 应该删除什么?
- Go和JS之间是否一致
- 构建系统
- 使用起来方便吗?
- 我们能改进吗?
- 示例
- 是否清晰?
- 是否涵盖了基础知识?
- 功能
- 哪些功能缺失?
- 哪些功能是不需要的?
- 文档
- 有什么可以更清晰的地方?

View file

@ -0,0 +1,76 @@
# 安装
要安装Wails CLI请确保已经安装[Go 1.21+](https://go.dev/dl/)并运行以下命令:
```shell
git clone https://github.com/wailsapp/wails.git
cd wails
git checkout v3-alpha
cd v3/cmd/wails3
go install
```
## 支持的平台
- Windows 10/11 AMD64/ARM64
- MacOS 10.13+ AMD64
- MacOS 11.0+ ARM64
- Ubuntu 22.04 AMD64/ARM64其他Linux可能也可以工作
## 依赖项
在安装之前Wails有一些常见的依赖项需要安装
=== "Go 1.21+"
从[Go下载页面](https://go.dev/dl/)下载Go。
确保按照官方的[Go安装指南](https://go.dev/doc/install)进行操作。您还需要确保您的`PATH`环境变量中包含`~/go/bin`目录的路径。重新启动终端并进行以下检查:
- 检查Go是否已正确安装`go version`
- 检查`~/go/bin`是否在您的PATH变量中`echo $PATH | grep go/bin`
=== "npm可选"
虽然Wails不需要安装npm但如果您想使用捆绑的模板则需要安装npm。
从[Node下载页面](https://nodejs.org/en/download/)下载最新的node安装程序。最好使用最新的版本因为这是我们通常进行测试的版本。
运行`npm --version`进行验证。
=== "Task可选"
Wails CLI嵌入了一个名为[Task](https://taskfile.dev/#/installation)的任务运行器。这是可选的但建议安装。如果您不想安装Task可以使用`wails3 task`命令代替`task`
安装Task将给您最大的灵活性。
## 平台特定的依赖项
您还需要安装特定于平台的依赖项:
=== "Mac"
Wails要求安装xcode命令行工具。可以通过运行以下命令来完成
```
xcode-select --install
```
=== "Windows"
Wails要求安装[WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)。一些Windows安装可能已经安装了此软件。您可以使用`wails doctor`命令检查。
=== "Linux"
Linux需要标准的`gcc`构建工具以及`libgtk3``libwebkit`。而不是列出不同发行版的大量命令Wails可以尝试确定您特定发行版的安装命令。安装后运行<code>wails doctor</code>,将显示如何安装依赖项。如果您的发行版/软件包管理器不受支持请在discord上告诉我们。
## 系统检查
运行`wails3 doctor`将检查您是否安装了正确的依赖项。如果没有安装,它将提供缺失的内容,并帮助您解决任何问题。
## 看起来缺少`wails3`命令?
如果系统报告缺少`wails3`命令,请检查以下内容:
- 确保您已正确按照Go安装指南进行操作。
- 检查`go/bin`目录是否在`PATH`环境变量中。
- 关闭/重新打开当前终端以使用新的`PATH`变量。

View file

@ -0,0 +1,32 @@
# 下一步
现在您已经安装了Wails可以开始探索alpha版本。
最好的起点是Wails存储库中的`examples`目录。
其中包含了一些可以运行和玩耍的示例。
## 运行示例
要运行示例,您可以简单地使用:
```shell
go run .
```
在示例目录中。
示例的状态在[路线图](../roadmap.md)中说明。
## 创建新项目
要创建新项目,可以使用`wails3 init`命令。这将在当前目录中创建一个新项目。
Wails3默认使用[Task](https://taskfile.dev)作为其构建系统,尽管您可以使用自己的构建系统,或直接使用`go build`。Wails内置了任务构建系统可以使用`wails3 task`运行。
如果查看`Taskfile.yaml`文件,您会看到有一些任务被定义。最重要的任务是`build`任务。这是在使用`wails3 build`时运行的任务。
任务文件可能不完整,并且可能会随时间变化而改变。
## 构建项目
要构建项目,可以使用`wails3 build`命令。这是`wails3 task build`的快捷方式。

View file

@ -0,0 +1,4 @@
---
template: home.zh.html
---
欢迎来到 Wails 项目

View file

@ -0,0 +1,49 @@
# 路线图
路线图是一个活动文档,可能会有所变动。如果您有任何建议,请提出一个问题。
每个里程碑都会有一系列我们力争实现的目标。这些目标可能会有所变动。
## Alpha 里程碑
### Alpha 1
#### 目标
Alpha 1 是最初的发布版本。旨在收集关于新 API 的反馈,并让人们进行实验。
主要目标是使大多数示例在所有平台上都能正常工作。
#### 状态
- W - 工作正常
- P - 部分工作
- N - 无法工作
| 示例 | Mac | Windows | Linux |
|---------------|-----|---------|-------|
| binding | W | W | |
| build | W | W | |
| clipboard | W | W | |
| context menus | W | W | |
| dialogs | P | W | |
| drag-n-drop | W | N | |
| events | W | W | |
| frameless | W | W | |
| keybindings | W | W | |
| plain | W | W | |
| screen | W | W | |
| systray | W | W | |
| video | | W | |
| window | P | W | |
| wml | W | W | |
- Mac 上的 Dialogs 可以工作,但是文件对话框会发出一个需要解决的警告。
#### TODO:
- [ ] 修复 Mac 上的 `+[CATransaction synchronize] called within transaction` 警告
- [ ] 隐藏窗口时,应用程序终止
### Alpha 2
- [ ] 在 Linux 上使大多数示例正常工作
- [ ] 通过 `wails init` 创建项目

View file

@ -0,0 +1,317 @@
# v3有哪些新功能
!!! note
v3版本中将包含的功能可能会有所更改。
## 多窗口
现在可以创建多个窗口,并对每个窗口进行独立配置。
```go
package main
import (
_ "embed"
"log"
"github.com/wailsapp/wails/v3/pkg/application"
)
//go:embed assets/*
var assets embed.FS
func main() {
app := application.New(application.Options{
Name: "多窗口演示",
Assets: application.AssetOptions{
FS: assets,
},
})
window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "窗口1",
})
window2 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "窗口2",
})
// 从embed.FS加载嵌入的html
window1.SetURL("/")
window1.Center()
// 加载外部URL
window2.SetURL("https://wails.app")
err := app.Run()
if err != nil {
log.Fatal(err.Error())
}
}
```
## 系统托盘
系统托盘允许您在桌面的系统托盘区域添加一个图标,并具有以下功能:
- 附加窗口(窗口将居中于系统托盘图标)
- 完整的菜单支持
- 亮/暗模式图标
```go
package main
import (
_ "embed"
"log"
"runtime"
"github.com/wailsapp/wails/v3/pkg/application"
"github.com/wailsapp/wails/v3/pkg/icons"
)
func main() {
app := application.New(application.Options{
Name: "系统托盘演示",
Mac: application.MacOptions{
ActivationPolicy: application.ActivationPolicyAccessory,
},
})
window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Width: 500,
Height: 800,
Frameless: true,
AlwaysOnTop: true,
Hidden: true,
Windows: application.WindowsWindow{
HiddenOnTaskbar: true,
},
})
systemTray := app.NewSystemTray()
// macOS上的模板图标支持
if runtime.GOOS == "darwin" {
systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
} else {
// 亮/暗模式图标支持
systemTray.SetDarkModeIcon(icons.SystrayDark)
systemTray.SetIcon(icons.SystrayLight)
}
// 菜单支持
myMenu := app.NewMenu()
myMenu.Add("Hello World!").OnClick(func(_ *application.Context) {
println("Hello World!")
})
systemTray.SetMenu(myMenu)
// 这将使窗口居中于系统托盘图标偏移量为5px
// 单击系统托盘图标时,它将自动显示
// 当窗口失去焦点时隐藏
systemTray.AttachWindow(window).WindowOffset(5)
err := app.Run()
if err != nil {
log.Fatal(err)
}
}
```
## 插件
插件允许您扩展Wails系统的功能。不仅可以在Go中使用插件方法还可以从Javascript中调用插件方法。包含的插件有
- kvstore - 键/值存储
- browser - 在浏览器中打开链接
- log - 自定义日志记录器
- oauth - 处理OAuth身份验证并支持60个提供商
- single_instance - 仅允许运行一个应用程序副本
- sqlite - 向应用程序添加SQLite数据库。使用现代纯Go库
- start_at_login - 注册/注销应用程序以在登录时启动
## 改进的绑定生成
v3使用新的静态分析器生成绑定。这使得生成绑定非常快速并保留了绑定中的注释和参数名称。默认情况下绑定使用ID而不是字符串进行调用。这提供了性能提升并允许使用混淆工具如[garble](https://github.com/burrowers/garble)。
通过在项目目录中运行 `wails3 generate bindings` 来生成绑定。
```js
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import { main } from "./models";
window.go = window.go || {};
window.go.main = {
GreetService: {
/**
* GreetService.Greet
* Greet greets a person
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function (name) {
wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
},
/**
* GreetService.GreetPerson
* GreetPerson greets a person
* @param person {main.Person}
* @returns {Promise<string>}
**/
GreetPerson: function (person) {
wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
},
},
};
```
## 改进的构建系统
在v2中构建系统完全不透明且难以自定义。在v3中可以使用标准的Go工具构建所有内容。
v2构建系统完成的所有繁重工作例如图标生成已作为CLI中的工具命令添加。我们将[Taskfile](https://taskfile.dev)整合到CLI中以协调这些调用以带来与v2相同的开发人员体验。然而这种方法在灵活性和易用性之间达到了最佳平衡因为现在您可以根据需要自定义构建过程。
您甚至可以使用make如果那是您的菜
```yaml title="来自Taskfile.yml的片段"
build:darwin:
summary: 构建应用程序
platforms:
- darwin
cmds:
- task: pre-build
- task: build-frontend
- go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
- task: post-build
env:
CGO_CFLAGS: "-mmacosx-version-min=10.13"
CGO_LDFLAGS: "-mmacosx-version-min=10.13"
MACOSX_DEPLOYMENT_TARGET: "10.13"
```
## 改进的事件
现在为许多运行时操作发出事件,允许您挂钩应用程序/系统事件。在存在常见平台事件的地方,还发出了跨平台(通用)事件,允许您在跨平台上编写相同的事件处理方法。
还可以注册事件钩子。这些钩子类似于`On`方法,但是是同步的,并允许您取消事件。例如,在关闭窗口之前显示确认对话框的示例。
```go
package main
import (
_ "embed"
"log"
"time"
"github.com/wailsapp/wails/v3/pkg/application"
"github.com/wailsapp/wails/v3/pkg/events"
)
//go:embed assets
var assets embed.FS
func main() {
app := application.New(application.Options{
Name: "Events Demo",
Description: "Events API演示",
Assets: application.AssetOptions{
FS: assets,
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
})
// 自定义事件处理
app.Events.On("myevent", func(e *application.WailsEvent) {
log.Printf("[Go] 收到WailsEvent事件: %+v\n", e)
})
// 特定于操作系统的应用程序事件
app.On(events.Mac.ApplicationDidFinishLaunching, func(event *application.Event) {
println("events.Mac.ApplicationDidFinishLaunching触发")
})
// 平台无关事件
app.On(events.Common.ApplicationStarted, func(event *application.Event) {
println("events.Common.ApplicationStarted触发")
})
win1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
Title: "关闭我需要3次确认",
})
var countdown = 3
// 注册钩子以取消窗口关闭
win1.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
countdown--
if countdown == 0 {
println("关闭!")
return
}
println("不行!不关闭!")
e.Cancel()
})
win1.On(events.Common.WindowFocus, func(e *application.WindowEvent) {
println("[事件] 窗口焦点!")
})
err := app.Run()
if err != nil {
log.Fatal(err.Error())
}
}
```
## Wails标记语言wml
一种实验性的功能使用纯HTML调用运行时方法类似于[htmx](https://htmx.org)。
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Wails ML演示</title>
</head>
<body style="margin-top:50px; color: white; background-color: #191919">
<h2>Wails ML演示</h2>
<p>此应用程序不包含任何Javascript</p>
<button wml-event="button-pressed">按我!</button>
<button wml-event="delete-things" wml-confirm="确定吗?">
删除所有内容!
</button>
<button wml-window="Close" wml-confirm="确定吗?">
关闭窗口?
</button>
<button wml-window="Center">居中</button>
<button wml-window="Minimise">最小化</button>
<button wml-window="Maximise">最大化</button>
<button wml-window="UnMaximise">取消最大化</button>
<button wml-window="Fullscreen">全屏</button>
<button wml-window="UnFullscreen">取消全屏</button>
<button wml-window="Restore">还原</button>
<div
style="width: 200px; height: 200px; border: 2px solid white;"
wml-event="hover"
wml-trigger="mouseover"
>
悬停在我上面
</div>
</body>
</html>
```

View file

@ -0,0 +1,57 @@
package main
import (
"go/build"
"os"
"path/filepath"
"github.com/princjef/gomarkdoc"
"github.com/princjef/gomarkdoc/lang"
"github.com/princjef/gomarkdoc/logger"
)
func main() {
// Create a renderer to output data
out, err := gomarkdoc.NewRenderer()
if err != nil {
// handle error
}
wd, err := os.Getwd()
if err != nil {
// handle error
}
packagePath := filepath.Join(wd, "../../v3/pkg/application")
buildPkg, err := build.ImportDir(packagePath, build.ImportComment)
if err != nil {
// handle error
}
// Create a documentation package from the build representation of our
// package.
log := logger.New(logger.DebugLevel)
pkg, err := lang.NewPackageFromBuild(log, buildPkg)
if err != nil {
// handle error
panic(err)
}
// Write the documentation out to console.
data, err := out.Package(pkg)
if err != nil {
panic(err)
}
cwd, err := os.Getwd()
if err != nil {
panic(err)
}
println(cwd)
err = os.WriteFile(filepath.Join("..", "docs", "API", "fullapi.md"), []byte(data), 0644)
if err != nil {
panic(err)
}
}

View file

@ -0,0 +1,39 @@
module generate
go 1.21
require github.com/princjef/gomarkdoc v1.1.0
require (
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/cheggaaa/pb/v3 v3.0.8 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fatih/color v1.11.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-git/go-git/v5 v5.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-runewidth v0.0.12 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/princjef/mageutil v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
mvdan.cc/xurls/v2 v2.2.0 // indirect
)

View file

@ -0,0 +1,178 @@
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/cheggaaa/pb v2.0.7+incompatible/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw=
github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA=
github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.11.0 h1:l4iX0RqNnx/pU7rY2DB/I+znuYY0K3x6Ywac6EIr0PA=
github.com/fatih/color v1.11.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc=
github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kevinburke/ssh_config v1.1.0 h1:pH/t1WS9NzT8go394IqZeJTMHVm6Cr6ZJ6AQ+mdNo/o=
github.com/kevinburke/ssh_config v1.1.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M=
github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/princjef/gomarkdoc v1.1.0 h1:xtl7mESKQWVuGiFdd1AO3dFA6OenWG86bZu97IqBNPE=
github.com/princjef/gomarkdoc v1.1.0/go.mod h1:HI3w0Zv8H03ecak/IqVAcPFTuPt7sn7Top6xbgCs1Qk=
github.com/princjef/mageutil v1.0.0 h1:1OfZcJUMsooPqieOz2ooLjI+uHUo618pdaJsbCXcFjQ=
github.com/princjef/mageutil v1.0.0/go.mod h1:mkShhaUomCYfAoVvTKRcbAs8YSVPdtezI5j6K+VXhrs=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg=
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI=
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
gopkg.in/VividCortex/ewma.v1 v1.1.1/go.mod h1:TekXuFipeiHWiAlO1+wSS23vTcyFau5u3rxXUSXj710=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v2 v2.0.7/go.mod h1:0CiZ1p8pvtxBlQpLXkHuUTpdJ1shm3OqCF1QugkjHL4=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0=
gopkg.in/mattn/go-colorable.v0 v0.1.0/go.mod h1:BVJlBXzARQxdi3nZo6f6bnl5yR20/tOL6p+V0KejgSY=
gopkg.in/mattn/go-isatty.v0 v0.0.4/go.mod h1:wt691ab7g0X4ilKZNmMII3egK0bTxl37fEn/Fwbd8gc=
gopkg.in/mattn/go-runewidth.v0 v0.0.4/go.mod h1:BmXejnxvhwdaATwiJbB1vZ2dtXkQKZGu9yLFCZb4msQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8=

View file

@ -0,0 +1,5 @@
INHERIT: mkdocs.yml
plugins:
- search
- social
- tags

187
mkdocs-website/mkdocs.yml Normal file
View file

@ -0,0 +1,187 @@
site_name: "alpha"
repo_url: https://github.com/wailsapp/wails
edit_uri: edit/v3-alpha/mkdocs-website/docs/
site_url: https://v3alpha.wails.io
site_description: The Wails Project - Build beautiful cross-platform applications using Go
site_author: Lea Anthony
theme:
name: material
custom_dir: overrides
logo: assets/images/wails-logo-horizontal-dark.svg
icon:
repo: fontawesome/brands/github
favicon: /favicon.ico
features:
- navigation.tabs
- navigation.sections
- navigation.expand
- navigation.instant.prefetch
- navigation.top
- navigation.footer
- navigation.path
- navigation.prune
- toc.integrate
- toc.follow
- search.suggest
- search.highlight
- search.share
- content.tabs.link
- content.tabs.annotation
- content.tabs.copy
- content.code.copy
- content.action.edit
language: en
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode
plugins:
- i18n:
docs_structure: folder
languages:
- locale: en
default: true
name: English
build: true
- locale: zh
name: 简体中文
build: true
site_description: Wails 项目 - 使用 Go 构建美观的跨平台应用程序
extra:
announcement: 这些文档是自动生成的。 如有错误,请告知我们。
nav:
- 主页: index.md
- 入门:
# - 介绍: introduction.md
- 安装: getting-started/installation.md
# - 创建项目: getting-started/creating-a-project.md
# - 它是如何工作的: how-does-it-work.md
# - 开发您的应用程序: getting-started/developing-your-application.md
# - 编译您的项目: getting-started/compiling-your-project.md
# - API 参考:
# - 运行时:
# - 介绍: reference/runtime/introduction.md
# - CLI: reference/cli.md
# - 社区:
# - 模板: community/templates.md
# - 指南:
# - Angular: guides/angular.md
# - 展示:
# - Emaillit: community/showcase/emailit.md
# - 贡献: community/contributing.md
# - 链接: community/links.md
- 下一步: getting-started/next-steps.md
- 反馈: getting-started/feedback.md
- v3 版本中的新内容是什么?: whats-new.md
- API:
- 应用程序: API/application.md
- 窗口: API/window.md
- 系统托盘: API/systray.md
- 菜单: API/menu.md
- 主线程: API/mainthread.md
- 完整 API: API/fullapi.md
- 开发:
- 介绍: development/introduction.md
- 状态: development/status.md
- v3 变更: development/changes.md
- 路线图: roadmap.md
- 更改日志: changelog.md
- 赞助❤️: https://github.com/sponsors/leaanthony
extra:
alternate:
- name: English
link: /
lang: en
- name: 简体中文
link: /zh/
lang: zh
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/wailsapp/wails
- icon: fontawesome/brands/twitter
link: https://twitter.com/wailsapp
- icon: fontawesome/brands/discord
link: https://discord.gg/JDdSxwjhGf
extra_css:
- stylesheets/extra.css
nav:
- Home: index.md
- Getting started:
# - Introduction: introduction.md
- Installation: getting-started/installation.md
# - Creating a Project: getting-started/creating-a-project.md
# - How does it work: how-does-it-work.md
# - Developing your Application: getting-started/developing-your-application.md
# - Compiling your Project: getting-started/compiling-your-project.md
# - API Reference:
# - Runtime:
# - Introduction: reference/runtime/introduction.md
# - CLI: reference/cli.md
# - Community:
# - Template: community/templates.md
# - Guides:
# - Angular: guides/angular.md
# - Showcase:
# - Emaillit: community/showcase/emailit.md
# - Contributing: community/contributing.md
# - Links: community/links.md
- Next Steps: getting-started/next-steps.md
- Feedback: getting-started/feedback.md
- What's New in v3?: whats-new.md
- API:
- Application: API/application.md
- Window: API/window.md
- System Tray: API/systray.md
- Menu: API/menu.md
- Main Thread: API/mainthread.md
- Full API: API/fullapi.md
- Development:
- Introduction: development/introduction.md
- Status: development/status.md
- v3 Changes: development/changes.md
- Roadmap: roadmap.md
- Change Log: changelog.md
- Sponsor❤: https://github.com/sponsors/leaanthony
markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.inlinehilite
- pymdownx.snippets:
restrict_base_path: false
- pymdownx.details
- pymdownx.superfences
- pymdownx.mark
- attr_list
- admonition
- footnotes
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
copyright:
Copyright © 2023 Lea Anthony

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1" viewBox="0 0 180 167" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><g><path d="M196,19.285C196,14.712 192.095,11 187.286,11L27.714,11C22.905,11 19,14.712 19,19.285L19,158.715C19,163.288 22.905,167 27.714,167L187.286,167C192.095,167 196,163.288 196,158.715L196,19.285Z" transform="matrix(1.00565,0,0,1.05769,-18.1073,-10.6346)" style="fill:#fff"/></g><g><path d="M0,-51.891L14.429,-51.891L13.043,-21.183L22.568,-51.891L34.226,-51.891L34.084,-21.183L42.365,-51.891L56.794,-51.891L38.526,0L25.198,0L25.34,-32.45L15.211,0L1.919,0L0,-51.891Z" transform="matrix(2.51258,0,0,2.51258,20.0103,151.138)" style="fill-rule:nonzero"/></g></svg>

After

Width:  |  Height:  |  Size: 774 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -0,0 +1,144 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "main.html" %}
<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}
<!-- Additional styles for landing page -->
<style>
/* Application header should be static for the landing page */
.md-header {
position: initial;
}
/* Remove spacing, as we cannot hide it completely */
.md-main__inner {
margin: 0;
}
/* Hide main content for now */
.md-content {
display: none;
}
/* Hide table of contents */
@media screen and (min-width: 60em) {
.md-sidebar--secondary {
display: none;
}
}
/* Hide navigation */
@media screen and (min-width: 76.25em) {
.md-sidebar--primary {
display: none;
}
}
</style>
<!-- Hero for landing page -->
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero">
<!-- Hero content -->
<div class="mdx-hero__content">
<br/>
<br/>
<div style="text-align: center">
This is the Wails v3 Alpha website.
This site will be updated as we progress through the alpha and beta releases.<br/><br/>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<h3>The v3 alpha release is intended for testers and contributors. It is not ready for use in any other capacity. Expect things to fail. Expect things to change. Expect the documentation to be wrong.<br/><br/>
</h3>
</div>
<h2>Status</h2>
<br/>
<table border="1">
<tr>
<th>Operating System</th>
<th>Status</th>
</tr>
<tr>
<td>Windows</td>
<td>All examples are working</td>
</tr>
<tr>
<td>Mac</td>
<td>Most examples are working</td>
</tr>
<tr>
<td>Linux</td>
<td>Some examples are working</td>
</tr>
</table>
<br/><br/>
<div style="width: 50%; margin: 0 auto; text-align: justify; padding-bottom: 75px;">
<h2>FAQ</h2>
<h3>What is the aim of the alpha release?</h3>
The aim of the alpha release is to get feedback on the new API and to get people experimenting with it.
We want to make sure that the API is easy to use and that it is possible to build applications with it.
<br/><br/>
<h3>How do I provide feedback?</h3>
Please read <a href="/getting-started/feedback/">this page</a> for details on how to provide feedback.
</div>
<h3>Is there a Roadmap</h3>
Yes, you can find it <a href="/roadmap/">here</a>.
Please feel free to raise PRs against this website. Every single PR helps us get closer to a release.<br/><br/>
Thank you for sharing this journey with us.<br/><br/>
<br/>
<a
href="{{ page.next_page.url | url }}"
title="{{ page.next_page.title | e }}"
class="md-button md-button--primary"
>
Get started
</a>
</div>
<!-- <a-->
<!-- href="{{ 'introduction' | url }}"-->
<!-- title="Material for MkDocs Insiders"-->
<!-- class="md-button"-->
<!-- >-->
<!-- Learn more-->
<!-- </a>-->
</div>
</div>
</div>
</section>
{% endblock %}
<!-- Content -->
{% block content %}{% endblock %}
<!-- Application footer -->
{% block footer %}{% endblock %}

View file

@ -0,0 +1,145 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "main.zh.html" %}
<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}
<!-- Additional styles for landing page -->
<style>
/* Application header should be static for the landing page */
.md-header {
position: initial;
}
/* Remove spacing, as we cannot hide it completely */
.md-main__inner {
margin: 0;
}
/* Hide main content for now */
.md-content {
display: none;
}
/* Hide table of contents */
@media screen and (min-width: 60em) {
.md-sidebar--secondary {
display: none;
}
}
/* Hide navigation */
@media screen and (min-width: 76.25em) {
.md-sidebar--primary {
display: none;
}
}
</style>
<!-- Hero for landing page -->
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero">
<!-- Hero content -->
<div class="mdx-hero__content">
<br/>
<br/>
<div style="text-align: center">
这是 Wails v3 Alpha 网站。
随着 alpha 和 beta 版本的推进,本站将会有所更新。<br/><br/>
<div class="admonition warning">
<p class="admonition-title">警告</p>
<h3>v3 alpha版本主要用于测试和贡献者。它还不适用于其他任何容量。请预料可能会出现故障可能会有变化文档可能会有错误。<br/><br/>
</h3>
</div>
<h2>状态</h2>
<br/>
<table border="1">
<tr>
<th>操作系统</th>
<th>状态</th>
</tr>
<tr>
<td>Windows</td>
<td>所有示例都可以运行</td>
</tr>
<tr>
<td>Mac</td>
<td>大多数示例可以运行</td>
</tr>
<tr>
<td>Linux</td>
<td>一些示例可以运行</td>
</tr>
</table>
<br/><br/>
<div style="width: 50%; margin: 0 auto; text-align: justify; padding-bottom: 75px;">
<h2>常见问题</h2>
<h3>alpha版本的目的是什么</h3>
alpha版本的目的是获得有关新 API 的反馈,并让人们尝试使用它。
我们想确保 API 易于使用,并且可以使用它构建应用程序。
<br/><br/>
<h3>如何提供反馈?</h3>
请阅读 <a href="/getting-started/feedback/">此页面</a>以获取有关如何提供反馈的详细信息。
</div>
<h3>有路线图吗?</h3>
是的,你可以在 <a href="/roadmap/">这里</a> 找到它。
请随时提出针对此网站的PR。每一个PR都会帮助我们更接近发布。<br/><br/>
感谢您与我们共度此旅程。<br/><br/>
<br/>
<a
href="{{ page.next_page.url | url }}"
title="{{ page.next_page.title | e }}"
class="md-button md-button--primary"
>
开始
</a>
</div>
<!-- <a-->
<!-- href="{{ 'introduction' | url }}"-->
<!-- title="Material for MkDocs Insiders"-->
<!-- class="md-button"-->
<!-- >-->
<!-- 了解更多-->
<!-- </a>-->
</div>
</div>
</div>
</section>
{% endblock %}
<!-- Content -->
{% block content %}{% endblock %}
<!-- Application footer -->
{% block footer %}{% endblock %}

View file

@ -0,0 +1,44 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "base.html" %}
{% block announce %}
{%
set announcement = {
"en": "Translations are autogenerated. Please report mistakes.",
"zh": "这些文档是自动生成的。 如有错误,请告知我们。",
}
%}
<div class="announcement__translation">
{{ announcement[i18n_page_locale] }}
</div>
{% endblock %}
<!-- Theme-related JavaScript -->
{% block scripts %}
{{ super() }}
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
<script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
{% endblock %}

View file

@ -0,0 +1,35 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "base.html" %}
{% block announce %}
这些文档是自动生成的。 如有错误,请告知我们。
{% endblock %}
<!-- Theme-related JavaScript -->
{% block scripts %}
{{ super() }}
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
<script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
{% endblock %}

Binary file not shown.

29
qodana.yaml Normal file
View file

@ -0,0 +1,29 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"
#Specify inspection profile for code analysis
profile:
name: qodana.starter
#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>
#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-go:latest

View file

@ -1,123 +0,0 @@
# Wails Issue Management Automation
This directory contains automation workflows and scripts to help manage the Wails project with minimal time investment.
## GitHub Workflow Files
### 1. Auto-Label Issues (`auto-label-issues.yml`)
- Automatically labels issues and PRs based on their content and modified files
- Labels are defined in `issue-labeler.yml` and `file-labeler.yml`
- Activates when issues are opened, edited, or reopened
### 2. Issue Triage Automation (`issue-triage-automation.yml`)
- Performs automated actions for issue triage
- Requests more info for incomplete bug reports
- Prioritizes security issues
- Adds issues to appropriate project boards
## Configuration Files
### 1. Issue Content Labeler (`issue-labeler.yml`)
- Defines patterns to match in issue title/body
- Categorizes by version (v2/v3), component, type, and priority
- Customize patterns as needed for your project
### 2. File Path Labeler (`file-labeler.yml`)
- Labels PRs based on which files they modify
- Helps identify which areas of the codebase are affected
- Customize file patterns as needed
### 3. Stale Issues Config (`stale.yml`)
- Marks issues as stale after 45 days of inactivity
- Closes stale issues after an additional 10 days
- Exempts issues with important labels
## Helper Scripts
### 1. Issue Triage Script (`scripts/issue-triage.ps1`)
- PowerShell script to quickly triage issues
- Lists recent issues needing attention
- Provides easy keyboard shortcuts for common actions
- Run during your dedicated issue triage time
### 2. PR Review Helper (`scripts/pr-review-helper.ps1`)
- PowerShell script to efficiently review PRs
- Generates review checklists
- Provides easy shortcuts for common review actions
- Run during your dedicated PR review time
## How to Use This System
### Daily Workflow (2 hours max)
**Monday (120 min):**
1. Run `scripts/issue-triage.ps1` (30 min)
2. Run `scripts/pr-review-helper.ps1` (30 min)
3. Check Discord for critical discussions (30 min)
4. Plan your week (30 min)
**Tuesday-Wednesday (120 min/day):**
1. Quick check for urgent issues (10 min)
2. v3 development (110 min)
**Thursday (120 min):**
1. v2 maintenance (90 min)
2. Documentation updates (30 min)
**Friday (120 min):**
1. Run `scripts/pr-review-helper.ps1` (60 min)
2. Discord updates/newsletter (30 min)
3. Weekly reflection (30 min)
## Installation
1. The GitHub workflow files should be placed in `.github/workflows/`
2. Configuration files should be placed in `.github/`
3. Helper scripts should be placed in `scripts/`
4. Make sure you have GitHub CLI (`gh`) installed and authenticated
## Customization
Feel free to modify the configuration files and scripts to better suit your project's needs:
1. **Adding New Label Categories**:
- Add new patterns to `issue-labeler.yml` for additional components or types
- Update `file-labeler.yml` if you add new directories or file types
2. **Adjusting Automation Thresholds**:
- Modify `stale.yml` to change how long issues remain active
- Update `issue-triage-automation.yml` to change conditions for automated actions
3. **Customizing Scripts**:
- Update the scripts with your specific GitHub username
- Add additional actions based on your workflow preferences
- Adjust time allocations based on which tasks need more attention
## Benefits
This automated issue management system will:
1. **Save Time**: Reduce manual triage of most common issues
2. **Improve Consistency**: Apply the same categorization rules every time
3. **Increase Visibility**: Clear categorization helps community members find issues
4. **Focus Development**: Clearer separation of v2 and v3 work
5. **Reduce Backlog**: Better management of stale issues
6. **Streamline Reviews**: Faster PR processing with guided workflows
## Requirements
- GitHub CLI (`gh`) installed and authenticated
- PowerShell 5.1+ for Windows scripts
- GitHub Actions enabled on your repository
- Appropriate permissions to modify workflows
## Maintenance
This system requires minimal maintenance:
- Periodically review and update label patterns as your project evolves
- Adjust time allocations based on where you need to focus
- Update scripts if GitHub CLI commands change
- Customize the workflow as you find pain points in your process
Remember that the goal is to maximize your limited time (2 hours per day) by automating repetitive tasks and streamlining essential ones.

View file

@ -1,108 +0,0 @@
# issue-triage.ps1 - Script to help with quick issue triage
# Run this at the start of your GitHub time to quickly process issues
# Set your GitHub username
$GITHUB_USERNAME = "your-username"
# Get the latest 10 open issues that aren't assigned and aren't labeled as "awaiting feedback"
Write-Host "Fetching recent unprocessed issues..."
gh issue list --repo wailsapp/wails --limit 10 --json number,title,labels,assignees | Out-File -Encoding utf8 -FilePath "issues_temp.json"
$issues = Get-Content -Raw -Path "issues_temp.json" | ConvertFrom-Json
$newIssues = $issues | Where-Object {
$_.assignees.Count -eq 0 -and
($_.labels.Count -eq 0 -or -not ($_.labels | Where-Object { $_.name -eq "awaiting feedback" }))
}
# Process each issue
Write-Host "`n===== Issues Needing Triage =====`n"
foreach ($issue in $newIssues) {
$number = $issue.number
$title = $issue.title
$labelNames = $issue.labels | ForEach-Object { $_.name }
$labelsStr = if ($labelNames) { $labelNames -join ", " } else { "none" }
Write-Host "Issue #$number`: $title"
Write-Host "Labels: $labelsStr`n"
$continue = $true
while ($continue) {
Write-Host "Options:"
Write-Host " [v] View issue in browser"
Write-Host " [2] Add v2-only label"
Write-Host " [3] Add v3-alpha label"
Write-Host " [b] Add bug label"
Write-Host " [e] Add enhancement label"
Write-Host " [d] Add documentation label"
Write-Host " [w] Add webview2 label"
Write-Host " [f] Request more info (awaiting feedback)"
Write-Host " [c] Close issue (duplicate/invalid)"
Write-Host " [a] Assign to yourself"
Write-Host " [s] Skip to next issue"
Write-Host " [q] Quit script"
$action = Read-Host "Enter action"
switch ($action) {
"v" {
gh issue view $number --repo wailsapp/wails --web
}
"2" {
Write-Host "Adding v2-only label..."
gh issue edit $number --repo wailsapp/wails --add-label "v2-only"
}
"3" {
Write-Host "Adding v3-alpha label..."
gh issue edit $number --repo wailsapp/wails --add-label "v3-alpha"
}
"b" {
Write-Host "Adding bug label..."
gh issue edit $number --repo wailsapp/wails --add-label "Bug"
}
"e" {
Write-Host "Adding enhancement label..."
gh issue edit $number --repo wailsapp/wails --add-label "Enhancement"
}
"d" {
Write-Host "Adding documentation label..."
gh issue edit $number --repo wailsapp/wails --add-label "Documentation"
}
"w" {
Write-Host "Adding webview2 label..."
gh issue edit $number --repo wailsapp/wails --add-label "webview2"
}
"f" {
Write-Host "Requesting more info..."
gh issue comment $number --repo wailsapp/wails --body "Thank you for reporting this issue. Could you please provide additional information to help us investigate?`n`n- [Specific details needed]`n`nThis will help us address your issue more effectively."
gh issue edit $number --repo wailsapp/wails --add-label "awaiting feedback"
}
"c" {
$reason = Read-Host "Reason for closing (duplicate/invalid/etc)"
gh issue comment $number --repo wailsapp/wails --body "Closing this issue: $reason"
gh issue close $number --repo wailsapp/wails
}
"a" {
Write-Host "Assigning to yourself..."
gh issue edit $number --repo wailsapp/wails --add-assignee "$GITHUB_USERNAME"
}
"s" {
Write-Host "Skipping to next issue..."
$continue = $false
}
"q" {
Write-Host "Exiting script."
exit
}
default {
Write-Host "Invalid option. Please try again."
}
}
Write-Host ""
}
Write-Host "--------------------------------`n"
}
Write-Host "No more issues to triage!"
# Clean up temp file
Remove-Item -Path "issues_temp.json"

View file

@ -1,103 +0,0 @@
#!/bin/bash
# issue-triage.sh - Script to help with quick issue triage
# Run this at the start of your GitHub time to quickly process issues
# Set your GitHub username
GITHUB_USERNAME="your-username"
# Get the latest 10 open issues that aren't assigned and aren't labeled as "awaiting feedback"
echo "Fetching recent unprocessed issues..."
gh issue list --repo wailsapp/wails --limit 10 --json number,title,labels,assignees --jq '.[] | select(.assignees | length == 0) | select(any(.labels[]; .name != "awaiting feedback"))' > new_issues.json
# Process each issue
echo -e "\n===== Issues Needing Triage =====\n"
cat new_issues.json | jq -c '.[]' | while read -r issue; do
number=$(echo $issue | jq -r '.number')
title=$(echo $issue | jq -r '.title')
labels=$(echo $issue | jq -r '.labels[] | .name' 2>/dev/null | tr '\n' ', ' | sed 's/,$//')
if [ -z "$labels" ]; then
labels="none"
fi
echo -e "Issue #$number: $title"
echo -e "Labels: $labels\n"
while true; do
echo "Options:"
echo " [v] View issue in browser"
echo " [2] Add v2-only label"
echo " [3] Add v3-alpha label"
echo " [b] Add bug label"
echo " [e] Add enhancement label"
echo " [d] Add documentation label"
echo " [w] Add webview2 label"
echo " [f] Request more info (awaiting feedback)"
echo " [c] Close issue (duplicate/invalid)"
echo " [a] Assign to yourself"
echo " [s] Skip to next issue"
echo " [q] Quit script"
read -p "Enter action: " action
case $action in
v)
gh issue view $number --repo wailsapp/wails --web
;;
2)
echo "Adding v2-only label..."
gh issue edit $number --repo wailsapp/wails --add-label "v2-only"
;;
3)
echo "Adding v3-alpha label..."
gh issue edit $number --repo wailsapp/wails --add-label "v3-alpha"
;;
b)
echo "Adding bug label..."
gh issue edit $number --repo wailsapp/wails --add-label "Bug"
;;
e)
echo "Adding enhancement label..."
gh issue edit $number --repo wailsapp/wails --add-label "Enhancement"
;;
d)
echo "Adding documentation label..."
gh issue edit $number --repo wailsapp/wails --add-label "Documentation"
;;
w)
echo "Adding webview2 label..."
gh issue edit $number --repo wailsapp/wails --add-label "webview2"
;;
f)
echo "Requesting more info..."
gh issue comment $number --repo wailsapp/wails --body "Thank you for reporting this issue. Could you please provide additional information to help us investigate?\n\n- [Specific details needed]\n\nThis will help us address your issue more effectively."
gh issue edit $number --repo wailsapp/wails --add-label "awaiting feedback"
;;
c)
read -p "Reason for closing (duplicate/invalid/etc): " reason
gh issue comment $number --repo wailsapp/wails --body "Closing this issue: $reason"
gh issue close $number --repo wailsapp/wails
;;
a)
echo "Assigning to yourself..."
gh issue edit $number --repo wailsapp/wails --add-assignee "$GITHUB_USERNAME"
;;
s)
echo "Skipping to next issue..."
break
;;
q)
echo "Exiting script."
exit 0
;;
*)
echo "Invalid option. Please try again."
;;
esac
echo ""
done
echo -e "--------------------------------\n"
done
echo "No more issues to triage!"

View file

@ -1,152 +0,0 @@
# pr-review-helper.ps1 - Script to help with efficient PR reviews
# Run this during your PR review time
# Set your GitHub username
$GITHUB_USERNAME = "your-username"
# Get open PRs that are ready for review
Write-Host "Fetching PRs ready for review..."
gh pr list --repo wailsapp/wails --json number,title,author,labels,reviewDecision,additions,deletions,baseRefName,headRefName --limit 10 | Out-File -Encoding utf8 -FilePath "prs_temp.json"
$prs = Get-Content -Raw -Path "prs_temp.json" | ConvertFrom-Json
# Process each PR
Write-Host "`n===== PRs Needing Review =====`n"
foreach ($pr in $prs) {
$number = $pr.number
$title = $pr.title
$author = $pr.author.login
$labels = if ($pr.labels) { $pr.labels | ForEach-Object { $_.name } | Join-String -Separator ", " } else { "none" }
$reviewState = if ($pr.reviewDecision) { $pr.reviewDecision } else { "PENDING" }
$baseRef = $pr.baseRefName
$headRef = $pr.headRefName
$changes = $pr.additions + $pr.deletions
Write-Host "PR #$number`: $title"
Write-Host "Author: $author"
Write-Host "Labels: $labels"
Write-Host "Branch: $headRef -> $baseRef"
Write-Host "Changes: +$($pr.additions)/-$($pr.deletions) lines"
Write-Host "Review state: $reviewState`n"
# Determine complexity based on size
$complexity = if ($changes -lt 50) {
"Quick review"
} elseif ($changes -lt 300) {
"Moderate review"
} else {
"Extensive review"
}
Write-Host "Complexity: $complexity"
$continue = $true
while ($continue) {
Write-Host "`nOptions:"
Write-Host " [v] View PR in browser"
Write-Host " [d] View diff in browser"
Write-Host " [c] Generate review checklist"
Write-Host " [a] Approve PR"
Write-Host " [r] Request changes"
Write-Host " [m] Add comment"
Write-Host " [l] Add labels"
Write-Host " [s] Skip to next PR"
Write-Host " [q] Quit script"
$action = Read-Host "Enter action"
switch ($action) {
"v" {
gh pr view $number --repo wailsapp/wails --web
}
"d" {
gh pr diff $number --repo wailsapp/wails --web
}
"c" {
# Generate review checklist
$checklist = @"
## PR Review: $title
### Basic Checks:
- [ ] PR title is descriptive
- [ ] PR description explains the changes
- [ ] Related issues are linked
### Technical Checks:
- [ ] Code follows project style
- [ ] No unnecessary commented code
- [ ] Error handling is appropriate
- [ ] Documentation updated (if needed)
- [ ] Tests included (if needed)
### Impact Assessment:
- [ ] Changes are backward compatible (if applicable)
- [ ] No breaking changes to public APIs
- [ ] Performance impact considered
### Version Specific:
"@
if ($baseRef -eq "master") {
$checklist += @"
- [ ] Appropriate for v2 maintenance
- [ ] No features that should be v3-only
"@
} elseif ($baseRef -eq "v3-alpha") {
$checklist += @"
- [ ] Appropriate for v3 development
- [ ] Aligns with v3 roadmap
"@
}
# Write to clipboard
$checklist | Set-Clipboard
Write-Host "`nReview checklist copied to clipboard!`n"
}
"a" {
$comment = Read-Host "Approval comment (blank for none)"
if ($comment) {
gh pr review $number --repo wailsapp/wails --approve --body $comment
} else {
gh pr review $number --repo wailsapp/wails --approve
}
}
"r" {
$comment = Read-Host "Feedback for changes requested"
gh pr review $number --repo wailsapp/wails --request-changes --body $comment
}
"m" {
$comment = Read-Host "Comment text"
gh pr comment $number --repo wailsapp/wails --body $comment
}
"l" {
$labels = Read-Host "Labels to add (comma-separated)"
$labelArray = $labels -split ","
foreach ($label in $labelArray) {
$labelTrimmed = $label.Trim()
if ($labelTrimmed) {
gh pr edit $number --repo wailsapp/wails --add-label $labelTrimmed
}
}
}
"s" {
Write-Host "Skipping to next PR..."
$continue = $false
}
"q" {
Write-Host "Exiting script."
exit
}
default {
Write-Host "Invalid option. Please try again."
}
}
}
Write-Host "--------------------------------`n"
}
Write-Host "No more PRs to review!"
# Clean up temp file
Remove-Item -Path "prs_temp.json"

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
npm install sponsorkit@16.4.2
npm install sponsorkit@0.6.1
npx sponsorkit -o ../../website/static/img/

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more