Compare commits

..

3 Commits

Author SHA1 Message Date
leaanthony 4c05c0bd30 chore: update contributors.svg 2023-04-02 22:55:17 +00:00
Lea Anthony b38ad7c7f1 Add initial svg 2023-04-03 08:54:45 +10:00
Lea Anthony acfca594f2 Debug contrib image 2023-04-03 08:53:11 +10:00
93 changed files with 16490 additions and 3752 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Generate Contributors Image
on:
schedule:
- cron: '0 1 * * 0' # At 01:00 on Sunday.
push:
branches:
- 'v2/update-contrib-svg'
jobs:
contributors:
runs-on: ubuntu-latest
if: github.repository == 'wailsapp/wails'
steps:
- uses: actions/checkout@v3
- uses: wow-actions/contributors-list@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
svgPath: ./website/static/img/contributors.svg
noCommit: true
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore: update contributors.svg"
add-paths: "website/static/img/contributors.svg"
title: Update Contributors Image
body: Generated new image
branch: update-contributors
delete-branch: true
@@ -1,40 +0,0 @@
name: update-contributors-svg
on:
workflow_dispatch: # Can trigger manually
schedule:
- cron: '0 7 * * *' # Schedule on everyday 7:00
jobs:
update-svg:
name: Update contributors SVG
runs-on: ubuntu-latest # You can also try macos-latest
steps:
- uses: actions/checkout@v3
- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Install deps
run: pnpm install
- name: Run SVG generation script
run: pnpx make-github-contributor-svg -t ${{ secrets.GITHUB_TOKEN }} -o vuejs-translations -r docs-zh-cn
- name: Move SVG
run: mv .github-contributors/* website/static/img/
- name: Commit
uses: EndBug/add-and-commit@v4
with:
message: "chore(workflow): update contributors image"
add: "website/static/img/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+4 -6
View File
@@ -1,9 +1,9 @@
name: Label Sponsors
name: Label sponsors
on:
pull_request:
types: [opened]
types: [ opened ]
issues:
types: [opened]
types: [ opened ]
jobs:
build:
name: is-sponsor-label
@@ -11,7 +11,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: JasonEtco/is-sponsor-label-action@v1
with:
label: Sponsor ❤️
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,9 +1,8 @@
name: Upload Source Documents
name: Push Checks
on:
push:
branches: [master]
workflow_dispatch:
jobs:
push_files_to_crowdin:
@@ -14,28 +13,25 @@ jobs:
- uses: actions/checkout@v2
- name: Verify Changed files
id: changed-files
uses: tj-actions/changed-files@v35
uses: tj-actions/verify-changed-files@v11.1
id: verify-changed-files
with:
files: |
website/**/*.mdx
website/**/*.md
website/**/*.json
- name: Setup Nodejs
- name: Set node
uses: actions/setup-node@v2
with:
node-version: 18.x
node-version: 16.x
- name: Setup Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload source documents
if: steps.changed-files.outputs.any_changed == 'true'
- name: Push files
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
working-directory: ./website
run: task crowdin:push
run: |
cd website
corepack enable
pnpm install
pnpm run crowdin push -b master
@@ -1,4 +1,4 @@
name: Sync Translations
name: Sync Translated Documents
on:
workflow_dispatch:
@@ -10,30 +10,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Setup Nodejs
- name: Set node
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
node-version: 16.x
- name: Sync Translated Documents
run: cd scripts && chmod 755 ./sync-translated-documents.sh && ./sync-translated-documents.sh
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
working-directory: ./website
run: task crowdin:pull
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "docs: sync translations"
title: "docs: sync translations"
commit-message: "docs: sync documents"
title: "docs: sync documents"
body: "- [x] Sync translated documents"
branch: chore/sync-translations
labels: translation
branch: feature/documents
delete-branch: true
draft: true
-1
View File
@@ -35,4 +35,3 @@ v2/cmd/wails/internal/commands/initialise/templates/testtemplates/
/v3/.task
/v3/examples/build/bin/testapp
/websitev3/site/
/v3/examples/plugins/bin/testapp
+5 -5
View File
@@ -1,24 +1,24 @@
# https://taskfile.dev
version: "3"
version: '3'
vars:
GREETING: Hello, World!
tasks:
contributors:check:
check-contributors:
cmds:
- npx -y all-contributors-cli check
contributors:update:
update-contributors:
cmds:
- go run v3/tasks/contribs/main.go
contributors:build:
build-contributors:
cmds:
- npx -y all-contributors-cli generate
release:
dir: v2/tools/release
cmds:
- go run release.go
- go run release.go
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
cd ../website
npx @crowdin/cli@latest pull -b master --export-only-approved
+3 -5
View File
@@ -2,15 +2,14 @@ package flags
import (
"fmt"
"github.com/samber/lo"
"github.com/wailsapp/wails/v2/internal/project"
"github.com/wailsapp/wails/v2/pkg/commands/build"
"net"
"net/url"
"os"
"path/filepath"
"runtime"
"github.com/samber/lo"
"github.com/wailsapp/wails/v2/internal/project"
"github.com/wailsapp/wails/v2/pkg/commands/build"
)
type Dev struct {
@@ -127,7 +126,6 @@ func (d *Dev) GenerateBuildOptions() *build.Options {
Compiler: d.Compiler,
ForceBuild: d.ForceBuild,
IgnoreFrontend: d.SkipFrontend,
SkipBindings: d.SkipBindings,
Verbosity: d.Verbosity,
WailsJSDir: d.WailsJSDir,
RaceDetector: d.RaceDetector,
+25
View File
@@ -44,6 +44,31 @@ func sliceToMap(input []string) map[string]struct{} {
return result
}
type devFlags struct {
ldflags string
compilerCommand string
assetDir string
extensions string
reloadDirs string
openBrowser bool
noReload bool
skipBindings bool
wailsjsdir string
tags string
verbosity int
loglevel string
forceBuild bool
debounceMS int
devServer string
appargs string
saveConfig bool
raceDetector bool
frontendDevServerURL string
skipFrontend bool
noColour bool
}
// Application runs the application in dev mode
func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
@@ -130,5 +130,6 @@ func (f *Frontend) MenuSetApplicationMenu(menu *menu.Menu) {
}
func (f *Frontend) MenuUpdateApplicationMenu() {
f.MenuSetApplicationMenu(f.frontendOptions.Menu)
f.mainWindow.UpdateApplicationMenu()
}
+2 -27
View File
@@ -1,12 +1,11 @@
package system
import (
"os/exec"
"strings"
"github.com/wailsapp/wails/v2/internal/shell"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
"os/exec"
"strings"
)
var (
@@ -33,30 +32,6 @@ func GetInfo() (*Info, error) {
return &result, nil
}
func checkNodejs() *packagemanager.Dependency {
// Check for Nodejs
output, err := exec.Command("node", "-v").Output()
installed := true
version := ""
if err != nil {
installed = false
} else {
if len(output) > 0 {
version = strings.TrimSpace(strings.Split(string(output), "\n")[0])[1:]
}
}
return &packagemanager.Dependency{
Name: "Nodejs",
PackageName: "N/A",
Installed: installed,
InstallCommand: "Available at https://nodejs.org/en/download/",
Version: version,
Optional: false,
External: false,
}
}
func checkNPM() *packagemanager.Dependency {
// Check for npm
+2 -2
View File
@@ -9,8 +9,9 @@ import (
"strings"
"syscall"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
)
// Determine if the app is running on Apple Silicon
@@ -33,7 +34,6 @@ func (i *Info) discover() error {
i.OS = osinfo
i.Dependencies = append(i.Dependencies, checkXCodeSelect())
i.Dependencies = append(i.Dependencies, checkNodejs())
i.Dependencies = append(i.Dependencies, checkNPM())
i.Dependencies = append(i.Dependencies, checkXCodeBuild())
i.Dependencies = append(i.Dependencies, checkUPX())
-1
View File
@@ -49,7 +49,6 @@ func checkLocallyInstalled(checker func() *packagemanager.Dependency, dependency
}
var checkerFunctions = map[string]func() *packagemanager.Dependency{
"Nodejs": checkNodejs,
"npm": checkNPM,
"docker": checkDocker,
"upx": checkUPX,
-1
View File
@@ -19,7 +19,6 @@ func (i *Info) discover() error {
i.OS = osinfo
i.Dependencies = append(i.Dependencies, checkWebView2())
i.Dependencies = append(i.Dependencies, checkNodejs())
i.Dependencies = append(i.Dependencies, checkNPM())
i.Dependencies = append(i.Dependencies, checkUPX())
i.Dependencies = append(i.Dependencies, checkNSIS())
+2 -1
View File
@@ -69,7 +69,8 @@ func (r *request) Body() (io.ReadCloser, error) {
return r.body, nil
}
r.body = webkit_uri_scheme_request_get_http_body(r.req)
// WebKit2GTK has currently no support for request bodies.
r.body = http.NoBody
return r.body, nil
}
-69
View File
@@ -1,69 +0,0 @@
//go:build linux && (webkit2_36 || webkit2_40)
package webview
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 libsoup-2.4
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
#include "libsoup/soup.h"
*/
import "C"
import (
"net/http"
"strings"
"unsafe"
)
func webkit_uri_scheme_request_get_http_method(req *C.WebKitURISchemeRequest) string {
method := C.GoString(C.webkit_uri_scheme_request_get_http_method(req))
return strings.ToUpper(method)
}
func webkit_uri_scheme_request_get_http_headers(req *C.WebKitURISchemeRequest) http.Header {
hdrs := C.webkit_uri_scheme_request_get_http_headers(req)
var iter C.SoupMessageHeadersIter
C.soup_message_headers_iter_init(&iter, hdrs)
var name *C.char
var value *C.char
h := http.Header{}
for C.soup_message_headers_iter_next(&iter, &name, &value) != 0 {
h.Add(C.GoString(name), C.GoString(value))
}
return h
}
func webkit_uri_scheme_request_finish(req *C.WebKitURISchemeRequest, code int, header http.Header, stream *C.GInputStream, streamLength int64) error {
resp := C.webkit_uri_scheme_response_new(stream, C.gint64(streamLength))
defer C.g_object_unref(C.gpointer(resp))
cReason := C.CString(http.StatusText(code))
C.webkit_uri_scheme_response_set_status(resp, C.guint(code), cReason)
C.free(unsafe.Pointer(cReason))
cMimeType := C.CString(header.Get(HeaderContentType))
C.webkit_uri_scheme_response_set_content_type(resp, cMimeType)
C.free(unsafe.Pointer(cMimeType))
hdrs := C.soup_message_headers_new(C.SOUP_MESSAGE_HEADERS_RESPONSE)
for name, values := range header {
cName := C.CString(name)
for _, value := range values {
cValue := C.CString(value)
C.soup_message_headers_append(hdrs, cName, cValue)
C.free(unsafe.Pointer(cValue))
}
C.free(unsafe.Pointer(cName))
}
C.webkit_uri_scheme_response_set_http_headers(resp, hdrs)
C.webkit_uri_scheme_request_finish_with_response(req, resp)
return nil
}
+54 -4
View File
@@ -3,19 +3,69 @@
package webview
/*
#cgo linux pkg-config: webkit2gtk-4.0
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 libsoup-2.4
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
#include "libsoup/soup.h"
*/
import "C"
import (
"io"
"net/http"
"strings"
"unsafe"
)
const Webkit2MinMinorVersion = 36
func webkit_uri_scheme_request_get_http_body(_ *C.WebKitURISchemeRequest) io.ReadCloser {
return http.NoBody
func webkit_uri_scheme_request_get_http_method(req *C.WebKitURISchemeRequest) string {
method := C.GoString(C.webkit_uri_scheme_request_get_http_method(req))
return strings.ToUpper(method)
}
func webkit_uri_scheme_request_get_http_headers(req *C.WebKitURISchemeRequest) http.Header {
hdrs := C.webkit_uri_scheme_request_get_http_headers(req)
var iter C.SoupMessageHeadersIter
C.soup_message_headers_iter_init(&iter, hdrs)
var name *C.char
var value *C.char
h := http.Header{}
for C.soup_message_headers_iter_next(&iter, &name, &value) != 0 {
h.Add(C.GoString(name), C.GoString(value))
}
return h
}
func webkit_uri_scheme_request_finish(req *C.WebKitURISchemeRequest, code int, header http.Header, stream *C.GInputStream, streamLength int64) error {
resp := C.webkit_uri_scheme_response_new(stream, C.gint64(streamLength))
defer C.g_object_unref(C.gpointer(resp))
cReason := C.CString(http.StatusText(code))
C.webkit_uri_scheme_response_set_status(resp, C.guint(code), cReason)
C.free(unsafe.Pointer(cReason))
cMimeType := C.CString(header.Get(HeaderContentType))
C.webkit_uri_scheme_response_set_content_type(resp, cMimeType)
C.free(unsafe.Pointer(cMimeType))
hdrs := C.soup_message_headers_new(C.SOUP_MESSAGE_HEADERS_RESPONSE)
for name, values := range header {
cName := C.CString(name)
for _, value := range values {
cValue := C.CString(value)
C.soup_message_headers_append(hdrs, cName, cValue)
C.free(unsafe.Pointer(cValue))
}
C.free(unsafe.Pointer(cName))
}
C.webkit_uri_scheme_response_set_http_headers(resp, hdrs)
C.webkit_uri_scheme_request_finish_with_response(req, resp)
return nil
}
-83
View File
@@ -1,83 +0,0 @@
//go:build linux && webkit2_40
package webview
/*
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.0 gio-unix-2.0
#include "gtk/gtk.h"
#include "webkit2/webkit2.h"
#include "gio/gunixinputstream.h"
*/
import "C"
import (
"fmt"
"io"
"net/http"
"unsafe"
)
func webkit_uri_scheme_request_get_http_body(req *C.WebKitURISchemeRequest) io.ReadCloser {
stream := C.webkit_uri_scheme_request_get_http_body(req)
if stream == nil {
return http.NoBody
}
return &webkitRequestBody{stream: stream}
}
type webkitRequestBody struct {
stream *C.GInputStream
closed bool
}
// Read implements io.Reader
func (r *webkitRequestBody) Read(p []byte) (int, error) {
if r.closed {
return 0, io.ErrClosedPipe
}
var content unsafe.Pointer
var contentLen int
if p != nil {
content = unsafe.Pointer(&p[0])
contentLen = len(p)
}
var n C.gsize
var gErr *C.GError
res := C.g_input_stream_read_all(r.stream, content, C.gsize(contentLen), &n, nil, &gErr)
if res == 0 {
return 0, formatGError("stream read failed", gErr)
} else if n == 0 {
return 0, io.EOF
}
return int(n), nil
}
func (r *webkitRequestBody) Close() error {
if r.closed {
return nil
}
r.closed = true
// https://docs.gtk.org/gio/method.InputStream.close.html
// Streams will be automatically closed when the last reference is dropped, but you might want to call this function
// to make sure resources are released as early as possible.
var err error
var gErr *C.GError
if C.g_input_stream_close(r.stream, nil, &gErr) == 0 {
err = formatGError("stream close failed", gErr)
}
C.g_object_unref(C.gpointer(r.stream))
r.stream = nil
return err
}
func formatGError(msg string, gErr *C.GError, args ...any) error {
if gErr != nil && gErr.message != nil {
msg += ": " + C.GoString(gErr.message)
C.g_error_free(gErr)
}
return fmt.Errorf(msg, args...)
}
-5
View File
@@ -1,5 +0,0 @@
//go:build linux && webkit2_40
package webview
const Webkit2MinMinorVersion = 40

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