Compare commits

...

20 Commits

Author SHA1 Message Date
Atterpac 9c4b412aea fix react template css (#3477)
changelog
2024-05-14 06:39:20 +10:00
Atterpac 71b2edc0fe [V3-Linux] Upgrade to Webkitgtk4.1 (#3461)
* webkitgtk4.0->webkitgtk4.1

changelog

* Update mkdocs-website/docs/en/changelog.md

* Update deps in pipeline

* Update deps in pipeline

* Install 4.1 only when v3

* Install 4.1 only when v3

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-05-08 18:08:14 +10:00
Lea Anthony 7661cd189f Fix Go version 2024-05-08 08:27:38 +10:00
Mike D Pilsbury 0833a6d6d3 [v3] Correct detection of npm with acceptable version (#3458)
* Correct detection of npm with acceptable version

* Update changelog
2024-05-06 08:29:28 +10:00
Lea Anthony 7d851d8434 Fix disable min/max buttons on windows 2024-05-06 08:26:41 +10:00
Atterpac 2c29e1ca76 update devmode to use types and yaml (#3454)
go mod update
2024-05-05 17:27:53 +10:00
Travis McLane 5a57ee99ac example: environment - change css
text was colored white and therefore invisible.
2024-05-03 12:52:15 -05:00
Travis McLane 735b6b6c87 noop: remove Println for events.Linux.ApplicationStartup 2024-05-02 15:31:49 -05:00
Travis McLane 7ea0601fc6 remove Println
unknown key codes shouldn't print out to stdout
2024-05-02 11:02:21 -05:00
Travis McLane 99537f2816 remove Register/UnregisterWindow functionality
- this is no longer needed
2024-05-02 09:37:23 -05:00
Harry Fox b384bb885b add missing map init from application.init() (#3426)
* add missing map init from `application.init()`

* add changelog entry for #3426

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-05-02 21:57:51 +10:00
abichinger 2255af1c45 [v3] Add port flag to dev command (#3429)
* Add `port` flag to dev command, ...

Add support for environment variable WAILS_VITE_PORT

* Check if port is already in use

* Update changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-05-02 21:48:50 +10:00
Fabio Massaioli f55b781d86 [v3] Binding runtime fixes (#3431)
* Unmarshal arguments to appropriate type in binding calls

* Marshal multiple return values to arrays in binding calls

* Improve logging of remote method calls

* Add tests for `BoundMethod.Call`

* Fix return value if error is nil

* Update changelog

---------

Co-authored-by: Andreas Bichinger <andreas.bichinger@gmail.com>
2024-05-02 21:46:07 +10:00
Lea Anthony 38d9a9551f Add -trimpath for production build in project taskfile 2024-04-29 17:58:48 +10:00
Lea Anthony c38cee0a4a More optimised production build in project taskfile 2024-04-29 17:40:46 +10:00
Lea Anthony 0f9c7b1bbf Fix nanoid dep for npm package 2024-04-28 19:43:37 +10:00
Lea Anthony 32ddbd8e05 set target branch to v3-alpha 2024-04-28 17:13:59 +10:00
Lea Anthony 67c493f1a8 Fix example building 2024-04-27 17:43:58 +10:00
Lea Anthony 69c513e33d Fix pipeline tests 2024-04-27 17:38:10 +10:00
Lea Anthony 82b910dd6d Fix pipeline tests 2024-04-27 17:16:21 +10:00
110 changed files with 2418 additions and 599 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ jobs:
- 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 javascriptcoregtk-4.1-dev build-essential pkg-config
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev javascriptcoregtk-4.1-dev build-essential pkg-config
- name: Setup Go
uses: actions/setup-go@v3
@@ -122,7 +122,7 @@ jobs:
- 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 javascriptcoregtk-4.1-dev build-essential pkg-config
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev javascriptcoregtk-4.1-dev build-essential pkg-config
- name: Build Wails3 CLI
run: |
+12 -6
View File
@@ -62,8 +62,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
- name: Install linux dependencies (v3)
if: ${{ matrix.os == 'ubuntu-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev build-essential pkg-config
- name: Install linux dependencies (v2)
if: ${{ matrix.os == 'ubuntu-latest' && github.event.pull_request.base.ref == 'master' }}
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
@@ -72,25 +76,27 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Run tests (mac) | v2
if: ${{ matrix.os == 'macos-latest' && github.base_ref == 'master' }}
if: ${{ matrix.os == 'macos-latest' && github.event.pull_request.base.ref == 'master' }}
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
CGO_CFLAGS: -mmacosx-version-min=10.13
working-directory: ./v2
run: go test -v ./...
- name: Run tests (!mac) | v2
if: ${{ matrix.os != 'macos-latest' && github.base_ref == 'master' }}
if: ${{ matrix.os != 'macos-latest' && github.event.pull_request.base.ref == 'master' }}
working-directory: ./v2
run: go test -v ./...
- name: Run tests (mac) | v3
if: ${{ matrix.os == 'macos-latest' && github.base_ref == 'v3-alpha' }}
if: ${{ matrix.os == 'macos-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
CGO_CFLAGS: -mmacosx-version-min=10.13
working-directory: ./v3
run: go test -v ./...
- name: Run tests (!mac) | v3
if: ${{ matrix.os != 'macos-latest' && github.base_ref == 'v3-alpha' }}
if: ${{ matrix.os != 'macos-latest' && github.event.pull_request.base.ref == 'v3-alpha' }}
working-directory: ./v3
run: go test -v ./...
+20
View File
@@ -0,0 +1,20 @@
on:
push:
branches: ['v3-alpha']
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20"
- run: npm ci
working-directory: v3/internal/runtime/desktop/@wailsio/runtime
- uses: JS-DevTools/npm-publish@v3
with:
package: v3/internal/runtime/desktop/@wailsio/runtime
access: public
token: ${{ secrets.NPM_TOKEN }}
+8
View File
@@ -32,9 +32,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add ESM exports from the bundled JS runtime script by [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
- Add binding generator flag for using the bundled JS runtime script instead of the npm package by [@fbbdev](https://github.com/fbbdev) in [#3334](https://github.com/wailsapp/wails/pull/3334)
- Implement `setIcon` on linux by [@abichinger](https://github.com/abichinger) in [#3354](https://github.com/wailsapp/wails/pull/3354)
- Add flag `-port` to dev command and support environment variable `WAILS_VITE_PORT` by [@abichinger](https://github.com/abichinger) in [#3429](https://github.com/wailsapp/wails/pull/3429)
- Add tests for bound method calls by [@abichinger](https://github.com/abichinger) in [#3431](https://github.com/wailsapp/wails/pull/3431)
### Fixed
- Fixed react template css to show footer by [atterpac](https://github.com/atterpac) in [#3477](https://github.com/wailsapp/wails/pull/3477)
- Fixed zombie processes when working in devmode by updating to latest refresh by [Atterpac](https://github.com/atterpac) in [#3320](https://github.com/wailsapp/wails/pull/3320).
- Fixed appimage webkit file sourcing by [Atterpac](https://github.com/atterpac) in [#3306](https://github.com/wailsapp/wails/pull/3306).
- Fixed Doctor apt package verify by [Atterpac](https://github.com/Atterpac) in [#2972](https://github.com/wailsapp/wails/pull/2972).
@@ -59,9 +62,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix the import paths of model files in JS code produced by the binding generator by [@fbbdev](https://github.com/fbbdev) in [#3334](https://github.com/wailsapp/wails/pull/3334)
- Fix drag-n-drop on some linux distros by [@abichinger](https://github.com/abichinger) in [#3346](https://github.com/wailsapp/wails/pull/3346)
- Fix missing task for macOS when using `wails3 task dev` by [@hfoxy](https://github.com/hfoxy) in [#3417](https://github.com/wailsapp/wails/pull/3417)
- Fix registering events causing a nil map assignment by [@hfoxy](https://github.com/hfoxy) in [#3426](https://github.com/wailsapp/wails/pull/3426)
- Fix unmarshaling of bound method parameters by [@fbbdev](https://github.com/fbbdev) in [#3431](https://github.com/wailsapp/wails/pull/3431)
- Fix handling of multiple return values from bound methods by [@fbbdev](https://github.com/fbbdev) in [#3431](https://github.com/wailsapp/wails/pull/3431)
- Fix doctor detection of npm that is not installed with system package manager by [@pekim](https://github.com/pekim) in [#3458](https://github.com/wailsapp/wails/pull/3458)
### Changed
- Update linux webkit dependency to webkit2gtk-4.1 over webkitgtk2-4.0 to support Ubuntu 24.04 LTS by [atterpac](https://github.com/atterpac) in [#3461](https://github.com/wailsapp/wails/pull/3461)
- The bundled JS runtime script is now an ESM module: script tags importing it must have the `type="module"` attribute. By [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
- The `@wailsio/runtime` package does not publish its API on the `window.wails` object, and does not start the WML system. This has been done to improve encapsulation. The WML system can be started manually if desired by calling the new `WML.Enable` method. The bundled JS runtime script still performs both operations automatically. By [@fbbdev](https://github.com/fbbdev) in [#3295](https://github.com/wailsapp/wails/pull/3295)
- The Window API module `@wailsio/runtime/src/window` now exposes the containing window object as a default export. It is not possible anymore to import individual methods through ESM named or namespace import syntax.
+22 -3
View File
@@ -132,12 +132,28 @@ tasks:
- task: format
# - task: docs:update:api
test:example:
test:example:darwin:
dir: 'examples/{{.DIR}}'
platforms:
- darwin
cmds:
- echo "Building example {{.DIR}}"
- go mod tidy
- go build -o "testbuild-{{.DIR}}{{exeExt}}"
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
CGO_CFLAGS: -mmacosx-version-min=10.13
test:example:notdarwin:
dir: 'examples/{{.DIR}}'
platforms:
- linux
- windows
cmds:
- echo "Building example {{.DIR}}"
- go mod tidy
- go build -o "testbuild-{{.DIR}}{{exeExt}}"
test:examples:
summary: Builds the examples
@@ -155,7 +171,6 @@ tasks:
hide-window
keybindings
menu
oauth
plain
screen
show-macos-toolbar
@@ -166,6 +181,10 @@ tasks:
wml
cmds:
- for: { var: EXAMPLEDIRS }
task: test:example
task: test:example:darwin
vars:
DIR: "{{.ITEM}}"
- for: { var: EXAMPLEDIRS }
task: test:example:notdarwin
vars:
DIR: "{{.ITEM}}"
+2 -3
View File
@@ -7,7 +7,8 @@
body {
padding-top: 75px;
margin: 0 auto;
color: white;
background-color: white;
color: black;
text-align: -webkit-center;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
}
@@ -54,9 +55,7 @@
html += "<tr><td>Debug</td><td>"+ result.Debug +"</td></tr>";
if(result.PlatformInfo) {
for (let key in result.PlatformInfo) {
if (obj.hasOwnProperty(key)) {
html += "<tr><td>"+key+"</td><td>"+ result.PlatformInfo[key] +"</td></tr>";
}
}
}
html += "</table>";
+9 -19
View File
@@ -1,9 +1,9 @@
module github.com/wailsapp/wails/v3
go 1.21
go 1.22
require (
github.com/atterpac/refresh v0.7.3
github.com/atterpac/refresh v0.8.0
github.com/bep/debounce v1.2.1
github.com/ebitengine/purego v0.4.0-alpha.4
github.com/go-git/go-git/v5 v5.11.0
@@ -13,8 +13,6 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.3.0
github.com/gorilla/pat v1.0.1
github.com/gorilla/sessions v1.2.1
github.com/jackmordaunt/icns/v2 v2.2.1
github.com/jaypipes/ghw v0.12.0
github.com/leaanthony/clir v1.6.0
@@ -22,11 +20,10 @@ require (
github.com/leaanthony/gosod v1.0.3
github.com/leaanthony/u v1.1.0
github.com/leaanthony/winicon v1.0.0
github.com/lmittmann/tint v1.0.3
github.com/markbates/goth v1.77.0
github.com/lmittmann/tint v1.0.4
github.com/matryer/is v1.4.0
github.com/mattn/go-colorable v0.1.13
github.com/mattn/go-isatty v0.0.19
github.com/mattn/go-isatty v0.0.20
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/errors v0.9.1
github.com/pterm/pterm v0.12.51
@@ -34,7 +31,7 @@ require (
github.com/tc-hib/winres v0.1.6
github.com/wailsapp/go-webview2 v1.0.9
github.com/wailsapp/mimetype v1.4.1
golang.org/x/sys v0.18.0
golang.org/x/sys v0.19.0
modernc.org/sqlite v1.21.0
)
@@ -48,9 +45,9 @@ require (
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
@@ -58,11 +55,7 @@ require (
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/gookit/color v1.5.2 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.6.2 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
@@ -92,13 +85,10 @@ require (
golang.org/x/image v0.15.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
+16 -401
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@
package webview
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1 gio-unix-2.0
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
@@ -3,7 +3,7 @@
package webview
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1 gio-unix-2.0
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
+1 -1
View File
@@ -3,7 +3,7 @@
package webview
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 libsoup-2.4
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1 libsoup-3.0
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
@@ -1,35 +0,0 @@
[config]
root_path = "."
# debug | info | warn | error | mute
# Defaults to Info if not provided
log_level = "warn"
# Debounce setting for ignoring reptitive file system notifications
debounce = 1000 # Milliseconds
# Sets what files the watcher should ignore
[config.ignore]
# Directories to ignore
dir = [".git", "node_modules", "frontend", "bin"]
# Files to ignore
file = [".DS_Store", ".gitignore", ".gitkeep"]
# File extensions to watch
watched_extension = ["*.go"]
# Add .gitignore paths to ignore
git_ignore = true
[config.background]
cmd = "wails3 task dev:frontend"
[[config.executes]]
cmd = "go mod tidy"
blocking = true
[[config.executes]]
cmd = "wails3 task build"
blocking = true
[[config.executes]]
cmd = "KILL_STALE"
[[config.executes]]
cmd = "wails3 task run"
primary = true
@@ -0,0 +1,28 @@
config:
root_path: .
log_level: warn
debounce: 1000
ignore:
dir:
- .git
- node_modules
- frontend
- bin
file:
- .DS_Store
- .gitignore
- .gitkeep
watched_extension:
- "*.go"
git_ignore: true
executes:
- cmd: wails3 task install:frontend:deps
type: once
- cmd: wails3 task dev:frontend
type: background
- cmd: go mod tidy
type: blocking
- cmd: wails3 task build
type: blocking
- cmd: wails3 task run
type: primary
+53
View File
@@ -0,0 +1,53 @@
package commands
import (
"fmt"
"net"
"os"
"strconv"
"github.com/wailsapp/wails/v3/internal/flags"
)
const defaultVitePort = 9245
const wailsVitePort = "WAILS_VITE_PORT"
type DevOptions struct {
flags.Common
Config string `description:"The config file including path" default:"./build/devmode.config.yaml"`
VitePort int `name:"port" description:"Specify the vite dev server port"`
}
func Dev(options *DevOptions) error {
host := "localhost"
// flag takes precedence over environment variable
var port int
if options.VitePort != 0 {
port = options.VitePort
} else if p, err := strconv.Atoi(os.Getenv(wailsVitePort)); err == nil {
port = p
} else {
port = defaultVitePort
}
// check if port is already in use
l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", host, port))
if err != nil {
return err
}
if err = l.Close(); err != nil {
return err
}
// Set environment variable for the dev:frontend task
os.Setenv(wailsVitePort, strconv.Itoa(port))
// Set url of frontend dev server
os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("http://%s:%d", host, port))
return Watcher(&WatcherOptions{
Config: options.Config,
})
}
+2 -5
View File
@@ -1,19 +1,16 @@
package commands
import (
"os"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v3/internal/flags"
"os"
)
func Build(_ *flags.Build) error {
return wrapTask("build")
}
func Dev(_ *flags.Dev) error {
return wrapTask("dev")
}
func Package(_ *flags.Package) error {
return wrapTask("package")
}
+1 -1
View File
@@ -12,7 +12,7 @@ type WatcherOptions struct {
func Watcher(options *WatcherOptions) error {
stopChan := make(chan struct{})
watcherEngine, err := engine.NewEngineFromTOML(options.Config)
watcherEngine, err := engine.NewEngineFromYAML(options.Config)
if err != nil {
return err
}
+2
View File
@@ -23,6 +23,8 @@ func checkCommonDependencies(result map[string]string, ok *bool) {
if major < 7 {
*ok = false
npmVersion = append(npmVersion, []byte(". Installed, but requires npm >= 7.0.0")...)
} else {
*ok = true
}
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
package operatingsystem
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1
#include <webkit2/webkit2.h>
*/
import "C"

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