mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 05:30:22 +08:00
Merge branch 'master' into v3/plugins
This commit is contained in:
commit
eb36258c73
2
.github/workflows/push.yml
vendored
2
.github/workflows/push.yml
vendored
@ -22,12 +22,12 @@ jobs:
|
||||
website/**/*.json
|
||||
|
||||
- name: Set node
|
||||
if: steps.verify-changed-files.outputs.files_changed != 'true'
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: Push files
|
||||
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
||||
env:
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
run: |
|
||||
|
@ -97,6 +97,7 @@ This project is supported by these kind people / companies:
|
||||
<p align="center">
|
||||
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
|
||||
</p>
|
||||
|
||||
## FAQ
|
||||
|
||||
- Is this an alternative to Electron?
|
||||
|
@ -1 +1 @@
|
||||
v2.4.0
|
||||
v2.4.1
|
@ -66,7 +66,7 @@ window.wails = {
|
||||
defaultCursor: null,
|
||||
borderThickness: 6,
|
||||
shouldDrag: false,
|
||||
deferDragToMouseMove: false,
|
||||
deferDragToMouseMove: true,
|
||||
cssDragProperty: "--wails-draggable",
|
||||
cssDragValue: "drag",
|
||||
}
|
||||
@ -130,7 +130,7 @@ window.addEventListener('mousedown', (e) => {
|
||||
}
|
||||
}
|
||||
if (window.wails.flags.deferDragToMouseMove) {
|
||||
window.wails.flags.shouldDrag = true;
|
||||
window.wails.flags.shouldDrag = true;
|
||||
} else {
|
||||
e.preventDefault()
|
||||
window.WailsInvoke("drag");
|
||||
@ -152,10 +152,9 @@ function setResize(cursor) {
|
||||
|
||||
window.addEventListener('mousemove', function (e) {
|
||||
if (window.wails.flags.shouldDrag) {
|
||||
window.wails.flags.shouldDrag = false;
|
||||
let mousePressed = e.buttons !== undefined ? e.buttons : e.which;
|
||||
if(mousePressed <= 0) {
|
||||
window.wails.flags.shouldDrag = false;
|
||||
} else {
|
||||
if (mousePressed > 0) {
|
||||
window.WailsInvoke("drag");
|
||||
return;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -53,10 +53,10 @@ This package contains the static analyser used for parsing Wails projects so tha
|
||||
- [x] Recursive
|
||||
- [x] Anonymous
|
||||
- [ ] Generation of models
|
||||
- [ ] Scalars
|
||||
- [x] Scalars
|
||||
- [ ] Arrays
|
||||
- [ ] Maps
|
||||
- [ ] Structs
|
||||
- [x] Structs
|
||||
- [ ] Generation of bindings
|
||||
|
||||
## Limitations
|
||||
|
@ -4,6 +4,8 @@ import (
|
||||
"bytes"
|
||||
"embed"
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
@ -35,13 +37,34 @@ const modelsHeader = `// @ts-check
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
`
|
||||
|
||||
func pkgAlias(fullPkg string) string {
|
||||
pkgParts := strings.Split(fullPkg, "/")
|
||||
return pkgParts[len(pkgParts)-1]
|
||||
}
|
||||
|
||||
func GenerateModels(models map[packagePath]map[structName]*StructDef) (string, error) {
|
||||
if models == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var buffer bytes.Buffer
|
||||
buffer.WriteString(modelsHeader)
|
||||
for pkg, pkgModels := range models {
|
||||
|
||||
// sort pkgs by alias (e.g. services) instead of full pkg name (e.g. github.com/wailsapp/wails/somedir/services)
|
||||
// and then sort resulting list by the alias
|
||||
var keys []string
|
||||
for pkg, _ := range models {
|
||||
keys = append(keys, pkg)
|
||||
}
|
||||
|
||||
sort.Slice(keys, func(i, j int) bool {
|
||||
return pkgAlias(keys[i]) < pkgAlias(keys[j])
|
||||
})
|
||||
|
||||
for _, pkg := range keys {
|
||||
err := GenerateModel(&buffer, &ModelDefinitions{
|
||||
Package: pkg,
|
||||
Models: pkgModels,
|
||||
Package: pkgAlias(pkg),
|
||||
Models: models[pkg],
|
||||
})
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -2,132 +2,76 @@ package parser
|
||||
|
||||
import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"strings"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const expected = `
|
||||
export namespace main {
|
||||
|
||||
export class Person {
|
||||
name: string;
|
||||
parent: Person;
|
||||
details: anon1;
|
||||
address: package.Address;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Person(source);
|
||||
}
|
||||
func TestGenerateModels(t *testing.T) {
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.name = source["name"]
|
||||
this.parent = source["parent"]
|
||||
this.details = source["details"]
|
||||
this.address = source["address"]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export class anon1 {
|
||||
age: int;
|
||||
address: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new anon1(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.age = source["age"]
|
||||
this.address = source["address"]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
`
|
||||
|
||||
func TestGenerateClass(t *testing.T) {
|
||||
person := StructDef{
|
||||
Name: "Person",
|
||||
Fields: []*Field{
|
||||
{
|
||||
Name: "Name",
|
||||
Type: &ParameterType{
|
||||
Name: "string",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Parent",
|
||||
Type: &ParameterType{
|
||||
Name: "Person",
|
||||
IsStruct: true,
|
||||
IsPointer: true,
|
||||
Package: "main",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Details",
|
||||
Type: &ParameterType{
|
||||
Name: "anon1",
|
||||
IsStruct: true,
|
||||
Package: "main",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Address",
|
||||
Type: &ParameterType{
|
||||
Name: "Address",
|
||||
IsStruct: true,
|
||||
IsPointer: true,
|
||||
Package: "github.com/some/other/package",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
anon1 := StructDef{
|
||||
Name: "anon1",
|
||||
Fields: []*Field{
|
||||
{
|
||||
Name: "Age",
|
||||
Type: &ParameterType{
|
||||
Name: "int",
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Address",
|
||||
Type: &ParameterType{
|
||||
Name: "string",
|
||||
},
|
||||
},
|
||||
tests := []struct {
|
||||
dir string
|
||||
want string
|
||||
}{
|
||||
{
|
||||
"testdata/function_single",
|
||||
"",
|
||||
},
|
||||
{
|
||||
"testdata/function_from_imported_package",
|
||||
getFile("testdata/function_from_imported_package/models.ts"),
|
||||
},
|
||||
{
|
||||
"testdata/variable_single",
|
||||
"",
|
||||
},
|
||||
{
|
||||
"testdata/variable_single_from_function",
|
||||
"",
|
||||
},
|
||||
{
|
||||
"testdata/variable_single_from_other_function",
|
||||
getFile("testdata/variable_single_from_other_function/models.ts"),
|
||||
},
|
||||
{
|
||||
"testdata/struct_literal_single",
|
||||
getFile("testdata/struct_literal_single/models.ts"),
|
||||
},
|
||||
{
|
||||
"testdata/struct_literal_multiple",
|
||||
"",
|
||||
},
|
||||
{
|
||||
"testdata/struct_literal_multiple_other",
|
||||
getFile("testdata/struct_literal_multiple_other/models.ts"),
|
||||
},
|
||||
{
|
||||
"testdata/struct_literal_multiple_files",
|
||||
"",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.dir, func(t *testing.T) {
|
||||
// Run parser on directory
|
||||
project, err := ParseProject(tt.dir)
|
||||
if err != nil {
|
||||
t.Fatalf("ParseProject() error = %v", err)
|
||||
}
|
||||
|
||||
var builder strings.Builder
|
||||
models := make(map[string]*StructDef)
|
||||
models["Person"] = &person
|
||||
models["anon1"] = &anon1
|
||||
def := ModelDefinitions{
|
||||
Package: "main",
|
||||
Models: models,
|
||||
}
|
||||
// Generate Models
|
||||
got, err := GenerateModels(project.Models)
|
||||
if err != nil {
|
||||
t.Fatalf("GenerateModels() error = %v", err)
|
||||
}
|
||||
|
||||
err := GenerateModel(&builder, &def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
text := builder.String()
|
||||
println("Built string")
|
||||
println(text)
|
||||
if diff := cmp.Diff(expected, text); diff != "" {
|
||||
t.Errorf("GenerateClass() failed:\n" + diff)
|
||||
if diff := cmp.Diff(tt.want, got); diff != "" {
|
||||
err = os.WriteFile(filepath.Join(tt.dir, "models.got.ts"), []byte(got), 0644)
|
||||
if err != nil {
|
||||
t.Errorf("os.WriteFile() error = %v", err)
|
||||
return
|
||||
}
|
||||
t.Fatalf("GenerateModels() mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -90,16 +90,39 @@ func (f *Field) JSName() string {
|
||||
return strings.ToLower(f.Name[0:1]) + f.Name[1:]
|
||||
}
|
||||
|
||||
func (f *Field) JSDef(pkg string) string {
|
||||
name := f.JSName()
|
||||
|
||||
var result string
|
||||
// TSBuild contains the typescript to build a field for a JS object
|
||||
// via assignment for simple types or constructors for structs
|
||||
func (f *Field) TSBuild(pkg string) string {
|
||||
if !f.Type.IsStruct {
|
||||
return fmt.Sprintf("source['%s']", f.JSName())
|
||||
}
|
||||
|
||||
if f.Type.Package == "" || f.Type.Package == pkg {
|
||||
result += fmt.Sprintf("%s: %s;", name, f.Type.Name)
|
||||
return fmt.Sprintf("%s.createFrom(source['%s'])", f.Type.Name, f.JSName())
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s.%s.createFrom(source['%s'])", pkgAlias(f.Type.Package), f.Type.Name, f.JSName())
|
||||
}
|
||||
|
||||
func (f *Field) JSDef(pkg string) string {
|
||||
var jsType string
|
||||
switch f.Type.Name {
|
||||
case "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr", "float32", "float64":
|
||||
jsType = "number"
|
||||
case "string":
|
||||
jsType = "string"
|
||||
case "bool":
|
||||
jsType = "boolean"
|
||||
default:
|
||||
jsType = f.Type.Name
|
||||
}
|
||||
|
||||
var result string
|
||||
if f.Type.Package == "" || f.Type.Package == pkg {
|
||||
result += fmt.Sprintf("%s: %s;", f.JSName(), jsType)
|
||||
} else {
|
||||
parts := strings.Split(f.Type.Package, "/")
|
||||
result += fmt.Sprintf("%s: %s.%s;", name, parts[len(parts)-1], f.Type.Name)
|
||||
result += fmt.Sprintf("%s: %s.%s;", f.JSName(), parts[len(parts)-1], jsType)
|
||||
}
|
||||
|
||||
if !ast.IsExported(f.Name) {
|
||||
|
@ -13,7 +13,7 @@ export namespace {{.Package}} {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
{{range $def.Fields}}this.{{.JSName}} = source["{{.JSName}}"]
|
||||
{{range $def.Fields}}this.{{.JSName}} = {{.TSBuild $pkg}};
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
51
v3/internal/parser/testdata/function_from_imported_package/models.ts
vendored
Normal file
51
v3/internal/parser/testdata/function_from_imported_package/models.ts
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export namespace main {
|
||||
|
||||
export class Person {
|
||||
name: string;
|
||||
address: services.Address;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Person(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.name = source['name'];
|
||||
this.address = services.Address.createFrom(source['address']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace services {
|
||||
|
||||
export class Address {
|
||||
street: string;
|
||||
state: string;
|
||||
country: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Address(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.street = source['street'];
|
||||
this.state = source['state'];
|
||||
this.country = source['country'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
5
v3/internal/parser/testdata/function_single/models.ts
vendored
Normal file
5
v3/internal/parser/testdata/function_single/models.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// TODO : nothing generated yet
|
5
v3/internal/parser/testdata/struct_literal_multiple/models.ts
vendored
Normal file
5
v3/internal/parser/testdata/struct_literal_multiple/models.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// TODO : nothing generated yet
|
5
v3/internal/parser/testdata/struct_literal_multiple_files/models.ts
vendored
Normal file
5
v3/internal/parser/testdata/struct_literal_multiple_files/models.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// TODO : nothing generated yet
|
51
v3/internal/parser/testdata/struct_literal_multiple_other/models.ts
vendored
Normal file
51
v3/internal/parser/testdata/struct_literal_multiple_other/models.ts
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export namespace main {
|
||||
|
||||
export class Person {
|
||||
name: string;
|
||||
address: services.Address;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Person(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.name = source['name'];
|
||||
this.address = services.Address.createFrom(source['address']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace services {
|
||||
|
||||
export class Address {
|
||||
street: string;
|
||||
state: string;
|
||||
country: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Address(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.street = source['street'];
|
||||
this.state = source['state'];
|
||||
this.country = source['country'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
64
v3/internal/parser/testdata/struct_literal_single/models.ts
vendored
Normal file
64
v3/internal/parser/testdata/struct_literal_single/models.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export namespace main {
|
||||
|
||||
export class Person {
|
||||
name: string;
|
||||
parent: Person;
|
||||
details: anon1;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Person(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.name = source['name'];
|
||||
this.parent = Person.createFrom(source['parent']);
|
||||
this.details = anon1.createFrom(source['details']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export class anon1 {
|
||||
age: number;
|
||||
address: anon2;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new anon1(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.age = source['age'];
|
||||
this.address = anon2.createFrom(source['address']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export class anon2 {
|
||||
street: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new anon2(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.street = source['street'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
5
v3/internal/parser/testdata/variable_single/models.ts
vendored
Normal file
5
v3/internal/parser/testdata/variable_single/models.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// TODO : nothing generated yet
|
5
v3/internal/parser/testdata/variable_single_from_function/models.ts
vendored
Normal file
5
v3/internal/parser/testdata/variable_single_from_function/models.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// TODO : nothing generated yet
|
51
v3/internal/parser/testdata/variable_single_from_other_function/models.ts
vendored
Normal file
51
v3/internal/parser/testdata/variable_single_from_other_function/models.ts
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export namespace main {
|
||||
|
||||
export class Person {
|
||||
name: string;
|
||||
address: services.Address;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Person(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.name = source['name'];
|
||||
this.address = services.Address.createFrom(source['address']);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace services {
|
||||
|
||||
export class Address {
|
||||
street: string;
|
||||
state: string;
|
||||
country: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new Address(source);
|
||||
}
|
||||
|
||||
constructor(source: any = {}) {
|
||||
if ('string' === typeof source) {
|
||||
source = JSON.parse(source);
|
||||
}
|
||||
|
||||
this.street = source['street'];
|
||||
this.state = source['state'];
|
||||
this.country = source['country'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -8,45 +8,79 @@ The project config resides in the `wails.json` file in the project directory. Th
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "[The project name]",
|
||||
"assetdir": "[Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty]",
|
||||
"reloaddirs": "[Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations]",
|
||||
"build:dir": "[The directory where the build files reside. Defaults to 'build']",
|
||||
"frontend:dir": "[Relative path to the frontend directory. Defaults to 'frontend']",
|
||||
"frontend:install": "[The command to install node dependencies, run in the frontend directory - often `npm install`]",
|
||||
"frontend:build": "[The command to build the assets, run in the frontend directory - often `npm run build`]",
|
||||
"frontend:dev": "[This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build]",
|
||||
"frontend:dev:build": "[This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev]",
|
||||
"frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]",
|
||||
"frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]",
|
||||
"frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output]",
|
||||
"wailsjsdir": "[Relative path to the directory that the auto-generated JS modules will be created]",
|
||||
"version": "[Project config version]",
|
||||
"outputfilename": "[The name of the binary]",
|
||||
"debounceMS": 100, // The default time the dev server waits to reload when it detects a change in assets
|
||||
"devServer": "[Address to bind the wails dev sever to. Default: localhost:34115]",
|
||||
"appargs": "[Arguments passed to the application in shell style when in dev mode]",
|
||||
"runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS.
|
||||
"preBuildHooks": {
|
||||
"GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]",
|
||||
"GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]",
|
||||
"*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]"
|
||||
},
|
||||
"postBuildHooks": {
|
||||
"GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]",
|
||||
"GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]",
|
||||
"*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]"
|
||||
},
|
||||
"info": { // Data used to populate manifests and version info.
|
||||
"companyName": "[The company name. Default: [The project name]]",
|
||||
"productName": "[The product name. Default: [The project name]]",
|
||||
"productVersion": "[The version of the product. Default: '1.0.0']",
|
||||
"copyright": "[The copyright of the product. Default: 'Copyright.........']",
|
||||
"comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']"
|
||||
},
|
||||
"nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple']",
|
||||
"obfuscated": "[Whether the app should be obfuscated. Default: false]",
|
||||
"garbleargs": "[The arguments to pass to the garble command when using the obfuscated flag]"
|
||||
// Project config version
|
||||
"version": "",
|
||||
// The project name
|
||||
"name": "",
|
||||
// Relative path to the directory containing the compiled assets, this is normally inferred and could be left empty
|
||||
"assetdir": "",
|
||||
// Additional directories to trigger reloads (comma separated), this is only used for some advanced asset configurations
|
||||
"reloaddirs": "",
|
||||
// The directory where the build files reside. Defaults to 'build'
|
||||
"build:dir": "",
|
||||
// Relative path to the frontend directory. Defaults to 'frontend'
|
||||
"frontend:dir": "",
|
||||
// The command to install node dependencies, run in the frontend directory - often `npm install`
|
||||
"frontend:install": "",
|
||||
// The command to build the assets, run in the frontend directory - often `npm run build`
|
||||
"frontend:build": "",
|
||||
// This command has been replaced by frontend:dev:build. If frontend:dev:build is not specified will falls back to this command. \nIf this command is also not specified will falls back to frontend:build
|
||||
"frontend:dev": "",
|
||||
// This command is the dev equivalent of frontend:build. If not specified falls back to frontend:dev
|
||||
"frontend:dev:build": "",
|
||||
// This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install
|
||||
"frontend:dev:install": "",
|
||||
// This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers
|
||||
"frontend:dev:watcher": "",
|
||||
// URL to a 3rd party dev server to be used to serve assets, EG Vite. \nIf this is set to 'auto' then the devServerUrl will be inferred from the Vite output
|
||||
"frontend:dev:serverUrl": "",
|
||||
// Relative path to the directory that the auto-generated JS modules will be created
|
||||
"wailsjsdir": "",
|
||||
// The name of the binary
|
||||
"outputfilename": "",
|
||||
// The default time the dev server waits to reload when it detects a change in assets
|
||||
"debounceMS": 100,
|
||||
// Address to bind the wails dev sever to. Default: localhost:34115
|
||||
"devServer": "",
|
||||
// Arguments passed to the application in shell style when in dev mode
|
||||
"appargs": "",
|
||||
// Defines if build hooks should be run though they are defined for an OS other than the host OS.
|
||||
"runNonNativeBuildHooks": false,
|
||||
"preBuildHooks": {
|
||||
// The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.
|
||||
"GOOS/GOARCH": "",
|
||||
// The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.
|
||||
"GOOS/*": "",
|
||||
// The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".
|
||||
"*/*": ""
|
||||
},
|
||||
"postBuildHooks": {
|
||||
// The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.
|
||||
"GOOS/GOARCH": "",
|
||||
// The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.
|
||||
"GOOS/*": "",
|
||||
// The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.
|
||||
"*/*": ""
|
||||
},
|
||||
// Data used to populate manifests and version info.
|
||||
"info": {
|
||||
// The company name. Default: [The project name]
|
||||
"companyName": "",
|
||||
// The product name. Default: [The project name]
|
||||
"productName": "",
|
||||
// The version of the product. Default: '1.0.0'
|
||||
"productVersion": "",
|
||||
// The copyright of the product. Default: 'Copyright.........'
|
||||
"copyright": "",
|
||||
// A short comment of the app. Default: 'Built using Wails (https://wails.app)'
|
||||
"comments": ""
|
||||
},
|
||||
// 'multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. Default: 'multiple'
|
||||
"nsisType": "",
|
||||
// Whether the app should be obfuscated. Default: false
|
||||
"obfuscated": "",
|
||||
// The arguments to pass to the garble command when using the obfuscated flag
|
||||
"garbleargs": ""
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -13,6 +13,15 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### Changements
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Corrections
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### Ajouts
|
||||
|
@ -13,6 +13,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### Changed
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Fixed
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### Added
|
||||
|
@ -13,6 +13,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### Changed
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Fixed
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### Added
|
||||
|
@ -13,6 +13,15 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### Alterado
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Corrigido
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### Adicionado
|
||||
|
@ -13,6 +13,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### Changed
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Fixed
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### Added
|
||||
|
@ -13,6 +13,15 @@
|
||||
|
||||
## [即将发布]
|
||||
|
||||
## v2.4.1 - 2022-03-20
|
||||
|
||||
### 变更
|
||||
- 支持在窗口上再次单击带有 `--wails-draggable: drag` 的项。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2482) 中变更
|
||||
|
||||
### 修复
|
||||
- 修复了使用 `wails dev` 和 AssetServer 尝试记录到记录器时的 panic。 由 @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2481) 中修复
|
||||
- 修复了与 WebView2 运行时大于 `110.0.1587.69` 的兼容性,它在重新加载前端之前显示 `connection refused` 的 html 页面。 由 @stffabi 在 [PR](https://github.com/wailsapp/wails/pull/2496) 中修复
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
### 新增
|
||||
|
@ -14,11 +14,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
### Changed
|
||||
- [v3] Typescript model generation using `StructDef`s from new AST-based parser. Added by @ATenderholt in [PR1](https://github.com/wailsapp/wails/pull/2428/files) and [PR2](https://github.com/wailsapp/wails/pull/2485).
|
||||
|
||||
## v2.4.0 - 2022-03-08
|
||||
|
||||
## v2.4.1 - 2023-03-20
|
||||
|
||||
### Changed
|
||||
- Support single clicks on items with `--wails-draggable: drag` again on Windows. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2482)
|
||||
|
||||
### Fixed
|
||||
- Fixed panic when using `wails dev` and the AssetServer tried to log to the logger. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2481)
|
||||
- Fixed compatibility with WebView2 Runtime > `110.0.1587.69` which showed a `connection refused` html page before doing a reload of the frontend. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2496)
|
||||
|
||||
## v2.4.0 - 2023-03-08
|
||||
|
||||
### Added
|
||||
- Added Webview GPU acceleration options for [Windows](/docs/reference/options#webviewgpuisdisabled) and [Linux](/docs/reference/options#webviewgpupolicy). Added by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2266)
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 160 KiB |
Loading…
Reference in New Issue
Block a user