Compare commits

...

18 Commits

Author SHA1 Message Date
Lea Anthony
36570645ff [v2] v2.0.0-beta.20 2021-11-09 20:37:44 +11:00
Lea Anthony
3711bdc41e [v2] Add default wailsjsdir when generating module 2021-11-09 20:31:51 +11:00
Lea Anthony
cbdcd9f63e [v2] Add default wailsjsdir to templates 2021-11-09 20:31:31 +11:00
Lea Anthony
a9268bc56e [v2] Re-enable cli flags for assetdir if needed. Fixes debugging from IDE. 2021-11-09 20:11:34 +11:00
Lea Anthony
f489347fca [website] Update sponsors 2021-11-09 06:39:36 +11:00
Lea Anthony
663925f9e8 [v2] v2.0.0-beta.19 2021-11-08 21:03:42 +11:00
Lea Anthony
cc2651c377 [v2] Tidy up 2021-11-08 21:02:54 +11:00
Lea Anthony
e651b9c7ff [v2] Fix dev build when no dev command in project 2021-11-08 21:01:42 +11:00
Lea Anthony
bcad236fb6 [v2] Revert svelte template changes 2021-11-08 20:53:13 +11:00
Lea Anthony
0af8d506c1 [v2] v2.0.0-beta.18 2021-11-08 20:28:04 +11:00
Lea Anthony
0b65a0f508 [v2] Fix svelte template 2021-11-08 20:27:28 +11:00
Lea Anthony
b03a758747 [v2] v2.0.0-beta.17 2021-11-08 20:13:29 +11:00
Lea Anthony
44597f2fbc [v2] Fix svelte template 2021-11-08 20:12:29 +11:00
Lea Anthony
0844113f3a [v2] Fix vanilla template 2021-11-08 20:08:41 +11:00
Lea Anthony
79e99b68d6 [v2] Fix css in templates 2021-11-08 19:23:28 +11:00
Lea Anthony
c64b7bb79c [v2] v2.0.0-beta.16 2021-11-08 19:15:07 +11:00
Lea Anthony
e72b438ad2 [website] Fix blog 2021-11-08 19:13:54 +11:00
Lea Anthony
3e4a112a3d Merge pull request #922 from wailsapp/v2-mac-docs
V2 Mac updates
2021-11-08 08:12:07 +00:00
17 changed files with 72 additions and 27 deletions

View File

@@ -97,6 +97,9 @@ This project is supported by these kind people / companies:
<a href="https://github.com/codydbentley" style="width:100px">
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
</a>
<a href="https://github.com/CrackDavid" style="width:100px">
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
</a>
<br/>
<br/>
<a href="https://github.com/matryer" style="width:100px">

View File

@@ -100,6 +100,9 @@
<a href="https://github.com/codydbentley" style="width:100px">
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
</a>
<a href="https://github.com/CrackDavid" style="width:100px">
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
</a>
<br/>
<br/>
<a href="https://github.com/matryer" style="width:100px">

View File

@@ -2,7 +2,7 @@
html {
text-align: center;
color: white;
background-color: rgba(0, 0, 0, 0);
background-color: rgba(33, 37, 43, 0.2);
width: 100%;
height: 100%;
}

View File

@@ -36,7 +36,7 @@ func main() {
Frameless: false,
StartHidden: false,
HideWindowOnClose: false,
RGBA: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
RGBA: &options.RGBA{R: 33, G: 37, B: 43, A: 255},
Assets: assets,
LogLevel: logger.DEBUG,
OnStartup: app.startup,

View File

@@ -4,6 +4,7 @@
"assetdir": "frontend/dist",
"frontend:install": "npm install",
"frontend:build": "npm run build",
"wailsjsdir": "./frontend",
"author": {
"name": "{{.AuthorName}}",
"email": "{{.AuthorEmail}}"

View File

@@ -1,12 +1,11 @@
html {
background-color: rgba(33, 37, 43, 0);
background-color: rgba(33, 37, 43, 0.2);
text-align: center;
color: white;
}
body {
margin: 0;
color: white;
font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;

View File

@@ -36,7 +36,7 @@ func main() {
Frameless: false,
StartHidden: false,
HideWindowOnClose: false,
RGBA: &options.RGBA{R: 0, G: 0, B: 0, A: 0},
RGBA: &options.RGBA{R: 33, G: 37, B: 43, A: 255},
Assets: assets,
LogLevel: logger.DEBUG,
OnStartup: app.startup,

View File

@@ -2,6 +2,7 @@
"name": "{{.ProjectName}}",
"outputfilename": "{{.BinaryName}}",
"assetdir": "frontend/src",
"wailsjsdir": "./frontend",
"author": {
"name": "{{.AuthorName}}",
"email": "{{.AuthorEmail}}"

View File

@@ -1,3 +1,3 @@
package internal
var Version = "v2.0.0-beta.15"
var Version = "v2.0.0-beta.20"

View File

@@ -61,6 +61,9 @@ func generateBindings(bindings *binding.Bindings) error {
return err
}
if projectConfig.WailsJSDir == "" {
projectConfig.WailsJSDir = filepath.Join(cwd, "frontend")
}
wrapperDir := filepath.Join(projectConfig.WailsJSDir, "wailsjs", "runtime")
_ = os.RemoveAll(wrapperDir)
extractor := gosod.New(wrapper.RuntimeWrapper)

View File

@@ -5,6 +5,7 @@ package appng
import (
"context"
"flag"
"os"
"path/filepath"
@@ -58,10 +59,37 @@ func CreateApp(appoptions *options.App) (*App, error) {
myLogger.SetLogLevel(appoptions.LogLevel)
// Check for CLI Flags
var assetdirFlag *string
var devServerURLFlag *string
var loglevelFlag *string
assetdir := os.Getenv("assetdir")
if assetdir == "" {
assetdirFlag = flag.String("assetdir", "", "Directory to serve assets")
}
devServerURL := os.Getenv("devserverurl")
if devServerURL == "" {
devServerURLFlag = flag.String("devserverurl", "", "URL of development server")
}
loglevel := os.Getenv("loglevel")
if loglevel == "" {
loglevelFlag = flag.String("loglevel", "debug", "Loglevel to use - Trace, Debug, Info, Warning, Error")
}
// If we weren't given the assetdir in the environment variables
if assetdir == "" {
flag.Parse()
if assetdirFlag != nil {
assetdir = *assetdirFlag
}
if devServerURLFlag != nil {
devServerURL = *devServerURLFlag
}
if loglevelFlag != nil {
loglevel = *loglevelFlag
}
}
if devServerURL != "" {
ctx = context.WithValue(ctx, "devserverurl", devServerURL)

View File

@@ -1,10 +1,11 @@
package gomod
import (
"github.com/Masterminds/semver"
"github.com/matryer/is"
"reflect"
"testing"
"github.com/Masterminds/semver"
"github.com/matryer/is"
)
const basic string = `module changeme
@@ -75,7 +76,7 @@ const basicUpdated string = `module changeme
go 1.17
require github.com/wailsapp/wails/v2 v2.0.0-beta.15
require github.com/wailsapp/wails/v2 v2.0.0-beta.20
require (
github.com/andybalholm/brotli v1.0.2 // indirect
@@ -330,7 +331,7 @@ const multilineRequireUpdated = `module changeme
go 1.17
require (
github.com/wailsapp/wails/v2 v2.0.0-beta.15
github.com/wailsapp/wails/v2 v2.0.0-beta.20
)
require (
@@ -381,12 +382,12 @@ func TestUpdateGoModVersion(t *testing.T) {
want []byte
wantErr bool
}{
{"basic", args{[]byte(basic), "v2.0.0-beta.15"}, []byte(basicUpdated), false},
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.15"}, []byte(multilineRequireUpdated), false},
{"basicmultilinereplace", args{[]byte(multilineReplace), "v2.0.0-beta.15"}, []byte(multilineReplaceUpdated), false},
{"basicmultilinereplaceblock", args{[]byte(multilineReplaceBlock), "v2.0.0-beta.15"}, []byte(multilineReplaceBlockUpdated), false},
{"basicmultilinereplacenoversion", args{[]byte(multilineReplaceNoVersion), "v2.0.0-beta.15"}, []byte(multilineReplaceNoVersionUpdated), false},
{"basicmultilinereplacenoversionblock", args{[]byte(multilineReplaceNoVersionBlock), "v2.0.0-beta.15"}, []byte(multilineReplaceNoVersionBlockUpdated), false},
{"basic", args{[]byte(basic), "v2.0.0-beta.20"}, []byte(basicUpdated), false},
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.20"}, []byte(multilineRequireUpdated), false},
{"basicmultilinereplace", args{[]byte(multilineReplace), "v2.0.0-beta.20"}, []byte(multilineReplaceUpdated), false},
{"basicmultilinereplaceblock", args{[]byte(multilineReplaceBlock), "v2.0.0-beta.20"}, []byte(multilineReplaceBlockUpdated), false},
{"basicmultilinereplacenoversion", args{[]byte(multilineReplaceNoVersion), "v2.0.0-beta.20"}, []byte(multilineReplaceNoVersionUpdated), false},
{"basicmultilinereplacenoversionblock", args{[]byte(multilineReplaceNoVersionBlock), "v2.0.0-beta.20"}, []byte(multilineReplaceNoVersionBlockUpdated), false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -413,8 +414,8 @@ func TestGoModOutOfSync(t *testing.T) {
want bool
wantErr bool
}{
{"basic", args{[]byte(basic), "v2.0.0-beta.15"}, true, false},
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.15"}, true, false},
{"basic", args{[]byte(basic), "v2.0.0-beta.20"}, true, false},
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.20"}, true, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -433,7 +434,7 @@ const multilineReplaceUpdated = `module changeme
go 1.17
require (
github.com/wailsapp/wails/v2 v2.0.0-beta.15
github.com/wailsapp/wails/v2 v2.0.0-beta.20
)
require (
@@ -468,14 +469,14 @@ require (
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
)
replace github.com/wailsapp/wails/v2 v2.0.0-beta.15 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
replace github.com/wailsapp/wails/v2 v2.0.0-beta.20 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
`
const multilineReplaceNoVersionUpdated = `module changeme
go 1.17
require (
github.com/wailsapp/wails/v2 v2.0.0-beta.15
github.com/wailsapp/wails/v2 v2.0.0-beta.20
)
require (
@@ -517,7 +518,7 @@ const multilineReplaceNoVersionBlockUpdated = `module changeme
go 1.17
require (
github.com/wailsapp/wails/v2 v2.0.0-beta.15
github.com/wailsapp/wails/v2 v2.0.0-beta.20
)
require (
@@ -562,7 +563,7 @@ const multilineReplaceBlockUpdated = `module changeme
go 1.17
require (
github.com/wailsapp/wails/v2 v2.0.0-beta.15
github.com/wailsapp/wails/v2 v2.0.0-beta.20
)
require (
@@ -598,6 +599,6 @@ require (
)
replace (
github.com/wailsapp/wails/v2 v2.0.0-beta.15 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
github.com/wailsapp/wails/v2 v2.0.0-beta.20 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
)
`

View File

@@ -532,6 +532,9 @@ func (b *BaseBuilder) BuildFrontend(outputLogger *clilogger.CLILogger) error {
switch b.projectData.OutputType {
case "dev":
buildCommand = b.projectData.DevCommand
if buildCommand == "" {
buildCommand = b.projectData.BuildCommand
}
default:
buildCommand = b.projectData.BuildCommand
}

View File

@@ -20,7 +20,7 @@ You mean this isn't ready for production? For your use case, it may well be read
known issues so keep your eye on [this project board](https://github.com/wailsapp/wails/projects/7) and if you would
like to contribute, you'd be very welcome!
So what's new for Wails v2 for Mac vs v1? Hint: They're pretty similar to the Windows Beta :wink:
So what's new for Wails v2 for Mac vs v1? Hint: It's pretty similar to the Windows Beta :wink:
### New Features

View File

@@ -23,6 +23,9 @@ sidebar_position: 99
<a href="https://github.com/codydbentley" style="width:100px">
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
</a>
<a href="https://github.com/CrackDavid" style="width:100px">
<img src="https://github.com/CrackDavid.png?size=100" width="100"/>
</a>
<br/>
<br/>
<a href="https://github.com/matryer" style="width:100px">

View File

@@ -67,7 +67,7 @@ import TabItem from "@theme/TabItem";
## Installing Wails
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.15` to install the Wails CLI.
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.20` to install the Wails CLI.
## System Check

View File

@@ -63,7 +63,7 @@ import TabItem from "@theme/TabItem";
## 安装 Wails
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.15` 安装 Wails CLI。
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.20` 安装 Wails CLI。
## 系统检查