mirror of
https://github.com/taigrr/wails.git
synced 2026-04-17 04:05:12 -07:00
Compare commits
13 Commits
v2.0.0-bet
...
v2.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81a9619fd7 | ||
|
|
ce103af77b | ||
|
|
2649c3d17d | ||
|
|
a35cc035b0 | ||
|
|
995fe38ee4 | ||
|
|
7fd311f7a6 | ||
|
|
356774e3f7 | ||
|
|
5d8653be83 | ||
|
|
8b5bcdfeff | ||
|
|
f6655d019f | ||
|
|
8f31183fa8 | ||
|
|
64528b4f02 | ||
|
|
7945853294 |
@@ -88,7 +88,7 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
|||||||
command.StringFlag("wailsjsdir", "Directory to generate the Wails JS modules", &flags.wailsjsdir)
|
command.StringFlag("wailsjsdir", "Directory to generate the Wails JS modules", &flags.wailsjsdir)
|
||||||
command.StringFlag("tags", "tags to pass to Go compiler (quoted and space separated)", &flags.tags)
|
command.StringFlag("tags", "tags to pass to Go compiler (quoted and space separated)", &flags.tags)
|
||||||
command.IntFlag("v", "Verbosity level (0 - silent, 1 - standard, 2 - verbose)", &flags.verbosity)
|
command.IntFlag("v", "Verbosity level (0 - silent, 1 - standard, 2 - verbose)", &flags.verbosity)
|
||||||
command.StringFlag("loglevel", "Loglevel to use - Trace, Dev, Info, Warning, Error", &flags.loglevel)
|
command.StringFlag("loglevel", "Loglevel to use - Trace, Debug, Info, Warning, Error", &flags.loglevel)
|
||||||
command.BoolFlag("f", "Force build application", &flags.forceBuild)
|
command.BoolFlag("f", "Force build application", &flags.forceBuild)
|
||||||
command.IntFlag("debounce", "The amount of time to wait to trigger a reload on change", &flags.debounceMS)
|
command.IntFlag("debounce", "The amount of time to wait to trigger a reload on change", &flags.debounceMS)
|
||||||
command.StringFlag("devserverurl", "The url of the dev server to use", &flags.devServerURL)
|
command.StringFlag("devserverurl", "The url of the dev server to use", &flags.devServerURL)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package generate
|
package generate
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/leaanthony/clir"
|
"github.com/leaanthony/clir"
|
||||||
"github.com/wailsapp/wails/v2/cmd/wails/internal"
|
"github.com/wailsapp/wails/v2/cmd/wails/internal"
|
||||||
"github.com/wailsapp/wails/v2/internal/shell"
|
"github.com/wailsapp/wails/v2/internal/shell"
|
||||||
@@ -36,14 +37,14 @@ func AddModuleCommand(app *clir.Cli, parent *clir.Command, w io.Writer) error {
|
|||||||
tagList := internal.ParseUserTags(tags)
|
tagList := internal.ParseUserTags(tags)
|
||||||
tagList = append(tagList, "bindings")
|
tagList = append(tagList, "bindings")
|
||||||
|
|
||||||
_, _, err = shell.RunCommand(cwd, "go", "build", "-tags", strings.Join(tagList, ","), "-o", filename)
|
stdout, stderr, err := shell.RunCommand(cwd, "go", "build", "-tags", strings.Join(tagList, ","), "-o", filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("%s\n%s\n%s", stdout, stderr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, _, err = shell.RunCommand(cwd, filename)
|
stdout, stderr, err = shell.RunCommand(cwd, filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("%s\n%s\n%s", stdout, stderr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.Remove(filename)
|
err = os.Remove(filename)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
package internal
|
package internal
|
||||||
|
|
||||||
var Version = "v2.0.0-beta.10"
|
var Version = "v2.0.0-beta.12"
|
||||||
|
|||||||
@@ -100,12 +100,10 @@ func (b *Bindings) GenerateBackendJS(targetfile string, isDevBindings bool) erro
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
output.WriteString(fmt.Sprintf(" }"))
|
output.WriteString(" },\n")
|
||||||
output.WriteString("\n")
|
|
||||||
})
|
})
|
||||||
|
|
||||||
output.WriteString(fmt.Sprintf(" },\n"))
|
output.WriteString(" },\n\n")
|
||||||
output.WriteString("\n")
|
|
||||||
})
|
})
|
||||||
|
|
||||||
output.WriteString(`};
|
output.WriteString(`};
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ func (a *BrowserAssetServer) Load(filename string) ([]byte, string, error) {
|
|||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString("window.awaitIPC('" + filename + "', ()=>{")
|
buffer.WriteString("window.awaitIPC('" + filename + "', ()=>{")
|
||||||
buffer.Write(content)
|
buffer.Write(content)
|
||||||
buffer.WriteString("});")
|
buffer.WriteString(`
|
||||||
|
});`)
|
||||||
content = buffer.Bytes()
|
content = buffer.Bytes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ type DevWebServer struct {
|
|||||||
dispatcher frontend.Dispatcher
|
dispatcher frontend.Dispatcher
|
||||||
assetServer *assetserver.BrowserAssetServer
|
assetServer *assetserver.BrowserAssetServer
|
||||||
socketMutex sync.Mutex
|
socketMutex sync.Mutex
|
||||||
websocketClients map[*websocket.Conn]struct{}
|
websocketClients map[*websocket.Conn]*sync.Mutex
|
||||||
menuManager *menumanager.Manager
|
menuManager *menumanager.Manager
|
||||||
starttime string
|
starttime string
|
||||||
|
|
||||||
@@ -58,6 +58,7 @@ func (d *DevWebServer) Run(ctx context.Context) error {
|
|||||||
|
|
||||||
d.server.Get("/wails/ipc", websocket.New(func(c *websocket.Conn) {
|
d.server.Get("/wails/ipc", websocket.New(func(c *websocket.Conn) {
|
||||||
d.newWebsocketSession(c)
|
d.newWebsocketSession(c)
|
||||||
|
locker := d.websocketClients[c]
|
||||||
// websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index
|
// websocket.Conn bindings https://pkg.go.dev/github.com/fasthttp/websocket?tab=doc#pkg-index
|
||||||
var (
|
var (
|
||||||
mt int
|
mt int
|
||||||
@@ -85,9 +86,12 @@ func (d *DevWebServer) Run(ctx context.Context) error {
|
|||||||
d.logger.Error(err.Error())
|
d.logger.Error(err.Error())
|
||||||
}
|
}
|
||||||
if result != "" {
|
if result != "" {
|
||||||
|
locker.Lock()
|
||||||
if err = c.WriteMessage(mt, []byte(result)); err != nil {
|
if err = c.WriteMessage(mt, []byte(result)); err != nil {
|
||||||
|
locker.Unlock()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
locker.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -293,7 +297,7 @@ func (d *DevWebServer) newWebsocketSession(c *websocket.Conn) {
|
|||||||
d.LogDebug(fmt.Sprintf("Websocket client %p disconnected", c))
|
d.LogDebug(fmt.Sprintf("Websocket client %p disconnected", c))
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
d.websocketClients[c] = struct{}{}
|
d.websocketClients[c] = &sync.Mutex{}
|
||||||
d.LogDebug(fmt.Sprintf("Websocket client %p connected", c))
|
d.LogDebug(fmt.Sprintf("Websocket client %p connected", c))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,12 +309,21 @@ type EventNotify struct {
|
|||||||
func (d *DevWebServer) broadcast(message string) {
|
func (d *DevWebServer) broadcast(message string) {
|
||||||
d.socketMutex.Lock()
|
d.socketMutex.Lock()
|
||||||
defer d.socketMutex.Unlock()
|
defer d.socketMutex.Unlock()
|
||||||
for client := range d.websocketClients {
|
for client, locker := range d.websocketClients {
|
||||||
err := client.WriteMessage(websocket.TextMessage, []byte(message))
|
go func() {
|
||||||
if err != nil {
|
if client == nil {
|
||||||
d.logger.Error(err.Error())
|
d.logger.Error("Lost connection to websocket server")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
locker.Lock()
|
||||||
|
err := client.WriteMessage(websocket.TextMessage, []byte(message))
|
||||||
|
if err != nil {
|
||||||
|
locker.Unlock()
|
||||||
|
d.logger.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
locker.Unlock()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,15 +344,20 @@ func (d *DevWebServer) notify(name string, data ...interface{}) {
|
|||||||
func (d *DevWebServer) broadcastExcludingSender(message string, sender *websocket.Conn) {
|
func (d *DevWebServer) broadcastExcludingSender(message string, sender *websocket.Conn) {
|
||||||
d.socketMutex.Lock()
|
d.socketMutex.Lock()
|
||||||
defer d.socketMutex.Unlock()
|
defer d.socketMutex.Unlock()
|
||||||
for client := range d.websocketClients {
|
for client, locker := range d.websocketClients {
|
||||||
if client == sender {
|
go func() {
|
||||||
continue
|
if client == sender {
|
||||||
}
|
return
|
||||||
err := client.WriteMessage(websocket.TextMessage, []byte(message))
|
}
|
||||||
if err != nil {
|
locker.Lock()
|
||||||
d.logger.Error(err.Error())
|
err := client.WriteMessage(websocket.TextMessage, []byte(message))
|
||||||
return
|
if err != nil {
|
||||||
}
|
locker.Unlock()
|
||||||
|
d.logger.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
locker.Unlock()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +388,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
|
|||||||
DisableStartupMessage: true,
|
DisableStartupMessage: true,
|
||||||
}),
|
}),
|
||||||
menuManager: menuManager,
|
menuManager: menuManager,
|
||||||
websocketClients: make(map[*websocket.Conn]struct{}),
|
websocketClients: make(map[*websocket.Conn]*sync.Mutex),
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,27 @@ func UpdateGoModVersion(goModText []byte, currentVersion string) ([]byte, error)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Replace
|
||||||
|
if len(file.Replace) == 0 {
|
||||||
|
return file.Format()
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, req := range file.Replace {
|
||||||
|
if req.Syntax == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
tokenPosition := 0
|
||||||
|
if !req.Syntax.InBlock {
|
||||||
|
tokenPosition = 1
|
||||||
|
}
|
||||||
|
if req.Syntax.Token[tokenPosition] == "github.com/wailsapp/wails/v2" {
|
||||||
|
version := req.Syntax.Token[tokenPosition+1]
|
||||||
|
_, err := semver.NewVersion(version)
|
||||||
|
if err == nil {
|
||||||
|
req.Syntax.Token[tokenPosition+1] = currentVersion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return file.Format()
|
return file.Format()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ const basicUpdated string = `module changeme
|
|||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require github.com/wailsapp/wails/v2 v2.0.0-beta.10
|
require github.com/wailsapp/wails/v2 v2.0.0-beta.12
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/andybalholm/brotli v1.0.2 // indirect
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
@@ -153,13 +153,184 @@ require (
|
|||||||
|
|
||||||
//replace github.com/wailsapp/wails/v2 v2.0.0-beta.7 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
//replace github.com/wailsapp/wails/v2 v2.0.0-beta.7 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
`
|
`
|
||||||
|
const multilineReplace = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.7
|
||||||
|
)
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace github.com/wailsapp/wails/v2 v2.0.0-beta.7 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
`
|
||||||
|
|
||||||
|
const multilineReplaceNoVersion = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.7
|
||||||
|
)
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
`
|
||||||
|
|
||||||
|
const multilineReplaceNoVersionBlock = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.7
|
||||||
|
)
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|
||||||
|
const multilineReplaceBlock = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.7
|
||||||
|
)
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.7 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|
||||||
const multilineRequireUpdated = `module changeme
|
const multilineRequireUpdated = `module changeme
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/wailsapp/wails/v2 v2.0.0-beta.10
|
github.com/wailsapp/wails/v2 v2.0.0-beta.12
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -210,8 +381,12 @@ func TestUpdateGoModVersion(t *testing.T) {
|
|||||||
want []byte
|
want []byte
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{"basic", args{[]byte(basic), "v2.0.0-beta.10"}, []byte(basicUpdated), false},
|
{"basic", args{[]byte(basic), "v2.0.0-beta.12"}, []byte(basicUpdated), false},
|
||||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.10"}, []byte(multilineRequireUpdated), false},
|
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.12"}, []byte(multilineRequireUpdated), false},
|
||||||
|
{"basicmultilinereplace", args{[]byte(multilineReplace), "v2.0.0-beta.12"}, []byte(multilineReplaceUpdated), false},
|
||||||
|
{"basicmultilinereplaceblock", args{[]byte(multilineReplaceBlock), "v2.0.0-beta.12"}, []byte(multilineReplaceBlockUpdated), false},
|
||||||
|
{"basicmultilinereplacenoversion", args{[]byte(multilineReplaceNoVersion), "v2.0.0-beta.12"}, []byte(multilineReplaceNoVersionUpdated), false},
|
||||||
|
{"basicmultilinereplacenoversionblock", args{[]byte(multilineReplaceNoVersionBlock), "v2.0.0-beta.12"}, []byte(multilineReplaceNoVersionBlockUpdated), false},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
@@ -238,8 +413,8 @@ func TestGoModOutOfSync(t *testing.T) {
|
|||||||
want bool
|
want bool
|
||||||
wantErr bool
|
wantErr bool
|
||||||
}{
|
}{
|
||||||
{"basic", args{[]byte(basic), "v2.0.0-beta.10"}, true, false},
|
{"basic", args{[]byte(basic), "v2.0.0-beta.12"}, true, false},
|
||||||
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.10"}, true, false},
|
{"basicmultiline", args{[]byte(multilineRequire), "v2.0.0-beta.12"}, true, false},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
@@ -252,3 +427,177 @@ func TestGoModOutOfSync(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const multilineReplaceUpdated = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.12
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace github.com/wailsapp/wails/v2 v2.0.0-beta.12 => 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.12
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
`
|
||||||
|
const multilineReplaceNoVersionBlockUpdated = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.12
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|
||||||
|
const multilineReplaceBlockUpdated = `module changeme
|
||||||
|
|
||||||
|
go 1.17
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.12
|
||||||
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/andybalholm/brotli v1.0.2 // indirect
|
||||||
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
|
github.com/fasthttp/websocket v0.0.0-20200320073529-1554a54587ab // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.3.1 // indirect
|
||||||
|
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||||
|
github.com/gofiber/fiber/v2 v2.17.0 // indirect
|
||||||
|
github.com/gofiber/websocket/v2 v2.0.8 // indirect
|
||||||
|
github.com/google/uuid v1.1.2 // indirect
|
||||||
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
|
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
|
||||||
|
github.com/klauspost/compress v1.12.2 // indirect
|
||||||
|
github.com/leaanthony/debme v1.2.1 // indirect
|
||||||
|
github.com/leaanthony/go-ansi-parser v1.0.1 // indirect
|
||||||
|
github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/go-webview2 v0.0.0-20211007092718-65d2f028ef2d // indirect
|
||||||
|
github.com/leaanthony/gosod v1.0.3 // indirect
|
||||||
|
github.com/leaanthony/slicer v1.5.0 // indirect
|
||||||
|
github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect
|
||||||
|
github.com/leaanthony/webview2runtime v1.1.0 // indirect
|
||||||
|
github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect
|
||||||
|
github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20200117113501-90175b0fbe3f // indirect
|
||||||
|
github.com/tkrajina/go-reflector v0.5.5 // indirect
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
|
github.com/valyala/fasthttp v1.28.0 // indirect
|
||||||
|
github.com/valyala/tcplisten v1.0.0 // indirect
|
||||||
|
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
github.com/wailsapp/wails/v2 v2.0.0-beta.12 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2
|
||||||
|
)
|
||||||
|
`
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ import TabItem from "@theme/TabItem";
|
|||||||
|
|
||||||
## Installing Wails
|
## Installing Wails
|
||||||
|
|
||||||
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.10` to install the Wails CLI.
|
Run `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.12` to install the Wails CLI.
|
||||||
|
|
||||||
## System Check
|
## System Check
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ import TabItem from "@theme/TabItem";
|
|||||||
|
|
||||||
## 安装 Wails
|
## 安装 Wails
|
||||||
|
|
||||||
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.10` 安装 Wails CLI。
|
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@v2.0.0-beta.12` 安装 Wails CLI。
|
||||||
|
|
||||||
## 系统检查
|
## 系统检查
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user