mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8e7df4226 | |||
| b83b386169 | |||
| a0503653ac | |||
| 7895cc8675 | |||
| abf5d3256c | |||
| 0a3d94988f | |||
| 1968630e6d | |||
| 1d4b74ef27 | |||
| 61e6ce81aa | |||
| 00020e165f | |||
| 31bb5b0460 | |||
| 4052c20f12 | |||
| dbb37e4ab5 | |||
| 09f86fd066 | |||
| 615ba63e56 | |||
| 13005bd116 | |||
| 66d2dce2e6 | |||
| 3aaa1f8e34 | |||
| aaa65ff7c2 | |||
| 5f412d0bfb | |||
| aa8cd7ce67 | |||
| ae99d7a973 | |||
| a632ac5068 | |||
| e3af0945d0 | |||
| 975c55a3d5 | |||
| c3d57d05c3 | |||
| e9cc68fe3a | |||
| 5d9fe49cf9 | |||
| fd3d1801ed | |||
| f517c8b980 | |||
| 73b547a730 | |||
| 6a8322cdb5 | |||
| 07fc8e3707 |
@@ -2,7 +2,7 @@ name: Build + Test v2
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [release/*, master]
|
||||
branches: [release/*, master, bugfix/*]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -12,31 +12,32 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: [1.18, 1.19]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.20']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- 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
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache-dependency-path: ./v2/go.sum
|
||||
|
||||
- name: Run tests (mac)
|
||||
if: matrix.os == 'macos-latest'
|
||||
if: matrix.os == 'macos-latest' || matrix.os == 'macos-11'
|
||||
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'
|
||||
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11'
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
@@ -50,7 +51,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
@@ -89,15 +90,16 @@ jobs:
|
||||
vanilla-ts,
|
||||
plain,
|
||||
]
|
||||
go-version: [1.18, 1.19]
|
||||
go-version: ['1.20']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache-dependency-path: ./v2/go.sum
|
||||
|
||||
- name: Build Wails CLI
|
||||
run: |
|
||||
|
||||
+23
-23
@@ -26,28 +26,28 @@ jobs:
|
||||
run: |
|
||||
echo "::warning::Feature branch does not contain any changes to the website."
|
||||
|
||||
lint_go:
|
||||
name: Run Go Linters
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "1.21"
|
||||
|
||||
- name: Update go modules
|
||||
working-directory: ./v2
|
||||
run: go mod tidy
|
||||
|
||||
- name: Run Linter
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.54
|
||||
working-directory: ./v2
|
||||
args: --timeout=10m0s --config ./.golangci.yml
|
||||
# lint_go:
|
||||
# name: Run Go Linters
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Setup Go
|
||||
# uses: actions/setup-go@v4
|
||||
# with:
|
||||
# go-version: "1.21"
|
||||
#
|
||||
# - name: Update go modules
|
||||
# working-directory: ./v2
|
||||
# run: go mod tidy
|
||||
#
|
||||
# - name: Run Linter
|
||||
# uses: golangci/golangci-lint-action@v3
|
||||
# with:
|
||||
# version: v1.54
|
||||
# working-directory: ./v2
|
||||
# args: --timeout=10m0s --config ./.golangci.yml
|
||||
|
||||
test_go:
|
||||
name: Run Go Tests
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: [1.18, 1.19]
|
||||
go-version: [1.19]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ Wails では Go のコードとウェブフロントエンドを単一のバイ
|
||||
|
||||
## スター数の推移
|
||||
|
||||
[](https://starchart.cc/wailsapp/wails)
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
|
||||
## コントリビューター
|
||||
|
||||
|
||||
@@ -122,7 +122,13 @@ This project is supported by these kind people / companies:
|
||||
|
||||
## Stargazers over time
|
||||
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
<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>
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
@@ -104,6 +104,10 @@ func diagnoseEnvironment(f *flags.Doctor) error {
|
||||
if len(gpu.GraphicsCards) > 1 {
|
||||
prefix = "GPU " + strconv.Itoa(idx+1) + " "
|
||||
}
|
||||
if card.DeviceInfo == nil {
|
||||
systemTabledata = append(systemTabledata, []string{prefix, "Unknown"})
|
||||
continue
|
||||
}
|
||||
details := fmt.Sprintf("%s (%s) - Driver: %s", card.DeviceInfo.Product.Name, card.DeviceInfo.Vendor.Name, card.DeviceInfo.Driver)
|
||||
systemTabledata = append(systemTabledata, []string{prefix, details})
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.7.0
|
||||
v2.7.1
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/wailsapp/wails/v2
|
||||
|
||||
go 1.18
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
@@ -33,7 +33,7 @@ require (
|
||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||
github.com/samber/lo v1.38.1
|
||||
github.com/stretchr/testify v1.8.1
|
||||
github.com/tc-hib/winres v0.1.5
|
||||
github.com/tc-hib/winres v0.2.1
|
||||
github.com/tidwall/sjson v1.1.7
|
||||
github.com/tkrajina/go-reflector v0.5.6
|
||||
github.com/wailsapp/go-webview2 v1.0.10
|
||||
@@ -94,7 +94,7 @@ require (
|
||||
github.com/yuin/goldmark-emoji v1.0.1 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
|
||||
golang.org/x/image v0.10.0 // indirect
|
||||
golang.org/x/image v0.12.0 // indirect
|
||||
golang.org/x/term v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
|
||||
@@ -208,8 +208,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/tc-hib/winres v0.1.5 h1:2dA5yfjdoEA3UyRaOC92HNMt3jap66pLzoW4MjpC/0M=
|
||||
github.com/tc-hib/winres v0.1.5/go.mod h1:pe6dOR40VOrGz8PkzreVKNvEKnlE8t4yR8A8naL+t7A=
|
||||
github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA=
|
||||
github.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk=
|
||||
github.com/tidwall/gjson v1.8.0/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk=
|
||||
github.com/tidwall/gjson v1.9.3 h1:hqzS9wAHMO+KVBBkLxYdkEeeFHuqr95GfClRLKlgK0E=
|
||||
github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||
@@ -255,9 +255,8 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
|
||||
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.10.0 h1:gXjUUtwtx5yOE0VKWq1CH4IJAClq4UGgUA3i+rpON9M=
|
||||
golang.org/x/image v0.10.0/go.mod h1:jtrku+n79PfroUbvDdeUWMAI+heR786BofxrbiSF+J0=
|
||||
golang.org/x/image v0.12.0 h1:w13vZbU4o5rKOFFR8y7M+c4A5jXDC0uXTdHYRP8X2DQ=
|
||||
golang.org/x/image v0.12.0/go.mod h1:Lu90jvHG7GfemOIcldsh9A2hS01ocl6oNO7ype5mEnk=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||
@@ -316,7 +315,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
|
||||
@@ -396,7 +396,7 @@ void ReleaseContext(void *inctx) {
|
||||
// Credit: https://stackoverflow.com/q/33319295
|
||||
void WindowPrint(void *inctx) {
|
||||
|
||||
// Check if macOS 11.0 or newer
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(macOS 11.0, *)) {
|
||||
ON_MAIN_THREAD(
|
||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||
@@ -424,4 +424,5 @@ void WindowPrint(void *inctx) {
|
||||
[po runOperationModalForWindow:ctx.mainWindow delegate:ctx.mainWindow.delegate didRunSelector:nil contextInfo:nil];
|
||||
)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -219,23 +219,27 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
||||
config.preferences.tabFocusesLinks = *preferences.tabFocusesLinks;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110300
|
||||
if (@available(macOS 11.3, *)) {
|
||||
if (preferences.textInteractionEnabled != NULL) {
|
||||
config.preferences.textInteractionEnabled = *preferences.textInteractionEnabled;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120300
|
||||
if (@available(macOS 12.3, *)) {
|
||||
if (preferences.fullscreenEnabled != NULL) {
|
||||
config.preferences.elementFullscreenEnabled = *preferences.fullscreenEnabled;
|
||||
}
|
||||
if (preferences.fullscreenEnabled != NULL) {
|
||||
config.preferences.elementFullscreenEnabled = *preferences.fullscreenEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
// [config.preferences setValue:[NSNumber numberWithBool:true] forKey:@"developerExtrasEnabled"];
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
|
||||
if (@available(macOS 10.15, *)) {
|
||||
config.preferences.fraudulentWebsiteWarningEnabled = fraudulentWebsiteWarningEnabled;
|
||||
}
|
||||
#endif
|
||||
|
||||
WKUserContentController* userContentController = [WKUserContentController new];
|
||||
[userContentController addScriptMessageHandler:self name:@"external"];
|
||||
@@ -431,10 +435,11 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
||||
|
||||
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
||||
openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
if (@available(macOS 10.14, *)) {
|
||||
openPanel.canChooseDirectories = parameters.allowsDirectories;
|
||||
}
|
||||
|
||||
#endif
|
||||
[openPanel
|
||||
beginSheetModalForWindow:webView.window
|
||||
completionHandler:^(NSInteger result) {
|
||||
@@ -558,14 +563,18 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
||||
#ifdef USE_NEW_FILTERS
|
||||
NSMutableArray *contentTypes = [[NSMutableArray new] autorelease];
|
||||
for (NSString *filter in filterList) {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(macOS 11.0, *)) {
|
||||
UTType *t = [UTType typeWithFilenameExtension:filter];
|
||||
[contentTypes addObject:t];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(macOS 11.0, *)) {
|
||||
[dialog setAllowedContentTypes:contentTypes];
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
[dialog setAllowedFileTypes:filterList];
|
||||
#endif
|
||||
@@ -638,17 +647,21 @@ typedef void (^schemeTaskCaller)(id<WKURLSchemeTask>);
|
||||
#ifdef USE_NEW_FILTERS
|
||||
NSMutableArray *contentTypes = [[NSMutableArray new] autorelease];
|
||||
for (NSString *filter in filterList) {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(macOS 11.0, *)) {
|
||||
UTType *t = [UTType typeWithFilenameExtension:filter];
|
||||
[contentTypes addObject:t];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if( contentTypes.count == 0) {
|
||||
[dialog setAllowsOtherFileTypes:true];
|
||||
} else {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
|
||||
if (@available(macOS 11.0, *)) {
|
||||
[dialog setAllowedContentTypes:contentTypes];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
@@ -23,6 +23,7 @@ extern void processMessage(const char *message);
|
||||
@end
|
||||
|
||||
void showInspector(void *inctx) {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
|
||||
ON_MAIN_THREAD(
|
||||
if (@available(macOS 12.0, *)) {
|
||||
WailsContext *ctx = (__bridge WailsContext*) inctx;
|
||||
@@ -47,7 +48,7 @@ void showInspector(void *inctx) {
|
||||
NSLog(@"Opening the inspector needs at least MacOS 12");
|
||||
}
|
||||
);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void setupF12hotkey() {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
//go:build linux && !qt
|
||||
// +build linux,!qt
|
||||
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend/desktop/linux"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//go:build qt
|
||||
// +build qt
|
||||
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend/desktop/qt"
|
||||
"github.com/wailsapp/wails/v2/internal/logger"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
func NewFrontend(ctx context.Context, appoptions *options.App, logger *logger.Logger, appBindings *binding.Bindings, dispatcher frontend.Dispatcher) frontend.Frontend {
|
||||
return qt.NewFrontend(ctx, appoptions, logger, appBindings, dispatcher)
|
||||
}
|
||||
+2
-1
@@ -4,8 +4,9 @@
|
||||
package linux
|
||||
|
||||
import (
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
"unsafe"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
)
|
||||
|
||||
/*
|
||||
-1
@@ -105,7 +105,6 @@ const startURL = "wails://wails/"
|
||||
var secondInstanceBuffer = make(chan options.SecondInstanceData, 1)
|
||||
|
||||
type Frontend struct {
|
||||
|
||||
// Context
|
||||
ctx context.Context
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user