From 85b1f909a7e25d4ad6cda362622e95d73283fc88 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 26 Mar 2024 20:56:58 +1100 Subject: [PATCH 1/8] Plugin updates --- v3/pkg/application/application.go | 16 +- v3/pkg/application/plugins.go | 27 ++- v3/pkg/application/plugins_api.go | 7 + v3/plugins/kvstore/kvstore.go | 6 +- v3/plugins/log/plugin.go | 2 +- v3/plugins/oauth/plugin.go | 10 +- v3/plugins/oauth/plugin.js | 241 +++++++++++----------- v3/plugins/sqlite/plugin.go | 5 +- v3/plugins/start_at_login/plugin.go | 2 +- v3/plugins/start_at_login/plugin_linux.go | 6 +- 10 files changed, 177 insertions(+), 145 deletions(-) create mode 100644 v3/pkg/application/plugins_api.go diff --git a/v3/pkg/application/application.go b/v3/pkg/application/application.go index c2703dda8fe..81aa23d5ae5 100644 --- a/v3/pkg/application/application.go +++ b/v3/pkg/application/application.go @@ -130,9 +130,12 @@ func New(appOptions Options) *App { } result.plugins = NewPluginManager(appOptions.Plugins, srv) - err = result.plugins.Init() - if err != nil { - globalApplication.fatal("Fatal error in plugins initialisation: " + err.Error()) + errors := result.plugins.Init() + if len(errors) > 0 { + for _, err := range errors { + globalApplication.error("Error initialising plugin: " + err.Error()) + } + globalApplication.fatal("Fatal error in plugins initialisation") } err = result.bindings.AddPlugins(appOptions.Plugins) @@ -541,7 +544,12 @@ func (a *App) Run() error { return err } - a.plugins.Shutdown() + errors := a.plugins.Shutdown() + if len(errors) > 0 { + for _, err := range errors { + a.error("Error shutting down plugin: " + err.Error()) + } + } return nil } diff --git a/v3/pkg/application/plugins.go b/v3/pkg/application/plugins.go index 915c4ee7329..e15cbac39ef 100644 --- a/v3/pkg/application/plugins.go +++ b/v3/pkg/application/plugins.go @@ -1,13 +1,17 @@ package application import ( + "github.com/pkg/errors" "github.com/wailsapp/wails/v3/internal/assetserver" ) +type PluginAPI interface { +} + type Plugin interface { Name() string - Init() error - Shutdown() + Init(api PluginAPI) error + Shutdown() error CallableByJS() []string InjectJS() string } @@ -26,13 +30,14 @@ func NewPluginManager(plugins map[string]Plugin, assetServer *assetserver.AssetS return result } -func (p *PluginManager) Init() error { +func (p *PluginManager) Init() []error { + + api := newPluginAPI() for _, plugin := range p.plugins { - err := plugin.Init() + err := plugin.Init(api) if err != nil { globalApplication.error("Plugin failed to initialise:", "plugin", plugin.Name(), "error", err.Error()) - p.Shutdown() - return err + return p.Shutdown() } p.initialisedPlugins = append(p.initialisedPlugins, plugin) injectJS := plugin.InjectJS() @@ -44,9 +49,15 @@ func (p *PluginManager) Init() error { return nil } -func (p *PluginManager) Shutdown() { +func (p *PluginManager) Shutdown() []error { + var errs []error for _, plugin := range p.initialisedPlugins { - plugin.Shutdown() + err := plugin.Shutdown() globalApplication.debug("Plugin shutdown: " + plugin.Name()) + if err != nil { + err = errors.Wrap(err, "Plugin failed to shutdown: "+plugin.Name()) + errs = append(errs, err) + } } + return errs } diff --git a/v3/pkg/application/plugins_api.go b/v3/pkg/application/plugins_api.go new file mode 100644 index 00000000000..36d235cb1e8 --- /dev/null +++ b/v3/pkg/application/plugins_api.go @@ -0,0 +1,7 @@ +package application + +type pluginAPI struct{} + +func newPluginAPI() *pluginAPI { + return &pluginAPI{} +} diff --git a/v3/plugins/kvstore/kvstore.go b/v3/plugins/kvstore/kvstore.go index 50370ffba4d..c5df22ed58f 100644 --- a/v3/plugins/kvstore/kvstore.go +++ b/v3/plugins/kvstore/kvstore.go @@ -2,6 +2,7 @@ package kvstore import ( "encoding/json" + "github.com/pkg/errors" "github.com/wailsapp/wails/v3/pkg/application" "io" "os" @@ -35,13 +36,14 @@ func NewPlugin(config *Config) *KeyValueStore { } // Shutdown will save the store to disk if there are unsaved changes. -func (kvs *KeyValueStore) Shutdown() { +func (kvs *KeyValueStore) Shutdown() error { if kvs.unsaved { err := kvs.Save() if err != nil { - application.Get().Logger.Error("Error saving store: " + err.Error()) + return errors.Wrap(err, "Error saving store") } } + return nil } // Name returns the name of the plugin. diff --git a/v3/plugins/log/plugin.go b/v3/plugins/log/plugin.go index f9e180c3425..1cb59b860d4 100644 --- a/v3/plugins/log/plugin.go +++ b/v3/plugins/log/plugin.go @@ -49,7 +49,7 @@ func NewPlugin() *Plugin { // Shutdown is called when the app is shutting down // You can use this to clean up any resources you have allocated -func (p *Plugin) Shutdown() {} +func (p *Plugin) Shutdown() error { return nil } // Name returns the name of the plugin. // You should use the go module format e.g. github.com/myuser/myplugin diff --git a/v3/plugins/oauth/plugin.go b/v3/plugins/oauth/plugin.go index d8ad1e5f2ec..2f2a1dd844a 100644 --- a/v3/plugins/oauth/plugin.go +++ b/v3/plugins/oauth/plugin.go @@ -26,6 +26,7 @@ type Plugin struct { config Config server *http.Server router *pat.Router + api application.PluginAPI } type Config struct { @@ -69,18 +70,19 @@ func NewPlugin(config Config) *Plugin { return result } -func (p *Plugin) Shutdown() { +func (p *Plugin) Shutdown() error { if p.server != nil { - p.server.Close() + return p.server.Close() } + return nil } func (p *Plugin) Name() string { return "github.com/wailsapp/wails/v3/plugins/oauth" } -func (p *Plugin) Init() error { - +func (p *Plugin) Init(api application.PluginAPI) error { + p.api = api store := sessions.NewCookieStore([]byte(p.config.SessionSecret)) store.MaxAge(p.config.MaxAge) store.Options.Path = "/" diff --git a/v3/plugins/oauth/plugin.js b/v3/plugins/oauth/plugin.js index 4ca97e971df..9bdf307c600 100644 --- a/v3/plugins/oauth/plugin.js +++ b/v3/plugins/oauth/plugin.js @@ -2,485 +2,486 @@ // https://www.fileformat.info/tool/hash.htm?text=auth.Github // 4111675027 +import wails from '@wailsapp/runtime'; function Amazon() { - return wails.CallByID(2331828509); + return wails.Call.ByID(2331828509); } function Apple() { - return wails.CallByID(3176757999); + return wails.Call.ByID(3176757999); } function Auth0() { - return wails.CallByID(2541844605); + return wails.Call.ByID(2541844605); } function AzureAD() { - return wails.CallByID(4136596197); + return wails.Call.ByID(4136596197); } function BattleNet() { - return wails.CallByID(1768856346); + return wails.Call.ByID(1768856346); } function Bitbucket() { - return wails.CallByID(526693694); + return wails.Call.ByID(526693694); } function Box() { - return wails.CallByID(2583659906); + return wails.Call.ByID(2583659906); } function Dailymotion() { - return wails.CallByID(1431387676); + return wails.Call.ByID(1431387676); } function Deezer() { - return wails.CallByID(828114094); + return wails.Call.ByID(828114094); } function DigitalOcean() { - return wails.CallByID(3019360447); + return wails.Call.ByID(3019360447); } function Discord() { - return wails.CallByID(655199039); + return wails.Call.ByID(655199039); } function Dropbox() { - return wails.CallByID(3446570357); + return wails.Call.ByID(3446570357); } function EveOnline() { - return wails.CallByID(1615270010); + return wails.Call.ByID(1615270010); } function Facebook() { - return wails.CallByID(825207297); + return wails.Call.ByID(825207297); } function Fitbit() { - return wails.CallByID(1290725671); + return wails.Call.ByID(1290725671); } function Gitea() { - return wails.CallByID(3921640321); + return wails.Call.ByID(3921640321); } function Github() { - return wails.CallByID(1424971906); + return wails.Call.ByID(1424971906); } function Gitlab() { - return wails.CallByID(387644474); + return wails.Call.ByID(387644474); } function Google() { - return wails.CallByID(1712198358); + return wails.Call.ByID(1712198358); } function GooglePlus() { - return wails.CallByID(2550604010); + return wails.Call.ByID(2550604010); } function Heroku() { - return wails.CallByID(3655952201); + return wails.Call.ByID(3655952201); } function Instagram() { - return wails.CallByID(65944971); + return wails.Call.ByID(65944971); } function Intercom() { - return wails.CallByID(10529210); + return wails.Call.ByID(10529210); } function Kakao() { - return wails.CallByID(3034570310); + return wails.Call.ByID(3034570310); } function LastFM() { - return wails.CallByID(1802166992); + return wails.Call.ByID(1802166992); } function Line() { - return wails.CallByID(2789106871); + return wails.Call.ByID(2789106871); } function LinkedIn() { - return wails.CallByID(1277552879); + return wails.Call.ByID(1277552879); } function LogoutAmazon() { - return wails.CallByID(469077327); + return wails.Call.ByID(469077327); } function LogoutApple() { - return wails.CallByID(3655868585); + return wails.Call.ByID(3655868585); } function LogoutAuth0() { - return wails.CallByID(18151695); + return wails.Call.ByID(18151695); } function LogoutAzureAD() { - return wails.CallByID(2138080511); + return wails.Call.ByID(2138080511); } function LogoutBattleNet() { - return wails.CallByID(4280940652); + return wails.Call.ByID(4280940652); } function LogoutBitbucket() { - return wails.CallByID(3756772960); + return wails.Call.ByID(3756772960); } function LogoutBox() { - return wails.CallByID(2810174732); + return wails.Call.ByID(2810174732); } function LogoutDailymotion() { - return wails.CallByID(2060789018); + return wails.Call.ByID(2060789018); } function LogoutDeezer() { - return wails.CallByID(1779336988); + return wails.Call.ByID(1779336988); } function LogoutDigitalOcean() { - return wails.CallByID(2745195285); + return wails.Call.ByID(2745195285); } function LogoutDiscord() { - return wails.CallByID(1756238441); + return wails.Call.ByID(1756238441); } function LogoutDropbox() { - return wails.CallByID(1276092991); + return wails.Call.ByID(1276092991); } function LogoutEveOnline() { - return wails.CallByID(3427696132); + return wails.Call.ByID(3427696132); } function LogoutFacebook() { - return wails.CallByID(3289650391); + return wails.Call.ByID(3289650391); } function LogoutFitbit() { - return wails.CallByID(4026910725); + return wails.Call.ByID(4026910725); } function LogoutGitea() { - return wails.CallByID(289654943); + return wails.Call.ByID(289654943); } function LogoutGithub() { - return wails.CallByID(1644797072); + return wails.Call.ByID(1644797072); } function LogoutGitlab() { - return wails.CallByID(654269224); + return wails.Call.ByID(654269224); } function LogoutGoogle() { - return wails.CallByID(4020864940); + return wails.Call.ByID(4020864940); } function LogoutGooglePlus() { - return wails.CallByID(3868989020); + return wails.Call.ByID(3868989020); } function LogoutHeroku() { - return wails.CallByID(2618955859); + return wails.Call.ByID(2618955859); } function LogoutInstagram() { - return wails.CallByID(931376085); + return wails.Call.ByID(931376085); } function LogoutIntercom() { - return wails.CallByID(4092924400); + return wails.Call.ByID(4092924400); } function LogoutKakao() { - return wails.CallByID(3794403964); + return wails.Call.ByID(3794403964); } function LogoutLastFM() { - return wails.CallByID(1376498158); + return wails.Call.ByID(1376498158); } function LogoutLine() { - return wails.CallByID(3582304913); + return wails.Call.ByID(3582304913); } function LogoutLinkedIn() { - return wails.CallByID(1607790273); + return wails.Call.ByID(1607790273); } function LogoutMastodon() { - return wails.CallByID(4210982224); + return wails.Call.ByID(4210982224); } function LogoutMeetup() { - return wails.CallByID(3715047585); + return wails.Call.ByID(3715047585); } function LogoutMicrosoftOnline() { - return wails.CallByID(97532862); + return wails.Call.ByID(97532862); } function LogoutNaver() { - return wails.CallByID(2633825507); + return wails.Call.ByID(2633825507); } function LogoutNextCloud() { - return wails.CallByID(3261782247); + return wails.Call.ByID(3261782247); } function LogoutOkta() { - return wails.CallByID(624232214); + return wails.Call.ByID(624232214); } function LogoutOnedrive() { - return wails.CallByID(814508603); + return wails.Call.ByID(814508603); } function LogoutOpenIDConnect() { - return wails.CallByID(1020114184); + return wails.Call.ByID(1020114184); } function LogoutPatreon() { - return wails.CallByID(202386648); + return wails.Call.ByID(202386648); } function LogoutPayPal() { - return wails.CallByID(1094363076); + return wails.Call.ByID(1094363076); } function LogoutSalesForce() { - return wails.CallByID(186208216); + return wails.Call.ByID(186208216); } function LogoutSeaTalk() { - return wails.CallByID(967155452); + return wails.Call.ByID(967155452); } function LogoutShopify() { - return wails.CallByID(710746663); + return wails.Call.ByID(710746663); } function LogoutSlack() { - return wails.CallByID(2829130917); + return wails.Call.ByID(2829130917); } function LogoutSoundCloud() { - return wails.CallByID(1958837967); + return wails.Call.ByID(1958837967); } function LogoutSpotify() { - return wails.CallByID(3505564851); + return wails.Call.ByID(3505564851); } function LogoutSteam() { - return wails.CallByID(1111934849); + return wails.Call.ByID(1111934849); } function LogoutStrava() { - return wails.CallByID(1393113524); + return wails.Call.ByID(1393113524); } function LogoutStripe() { - return wails.CallByID(2886428130); + return wails.Call.ByID(2886428130); } function LogoutTikTok() { - return wails.CallByID(3971249709); + return wails.Call.ByID(3971249709); } function LogoutTwitch() { - return wails.CallByID(88308904); + return wails.Call.ByID(88308904); } function LogoutTwitter() { - return wails.CallByID(1067400118); + return wails.Call.ByID(1067400118); } function LogoutTwitterV2() { - return wails.CallByID(2761439446); + return wails.Call.ByID(2761439446); } function LogoutTypetalk() { - return wails.CallByID(128226145); + return wails.Call.ByID(128226145); } function LogoutUber() { - return wails.CallByID(3429923567); + return wails.Call.ByID(3429923567); } function LogoutVK() { - return wails.CallByID(1951646996); + return wails.Call.ByID(1951646996); } function LogoutWeCom() { - return wails.CallByID(1686099456); + return wails.Call.ByID(1686099456); } function LogoutWepay() { - return wails.CallByID(1261265379); + return wails.Call.ByID(1261265379); } function LogoutXero() { - return wails.CallByID(2890165735); + return wails.Call.ByID(2890165735); } function LogoutYahoo() { - return wails.CallByID(2054451877); + return wails.Call.ByID(2054451877); } function LogoutYammer() { - return wails.CallByID(407239716); + return wails.Call.ByID(407239716); } function LogoutYandex() { - return wails.CallByID(2947524466); + return wails.Call.ByID(2947524466); } function LogoutZoom() { - return wails.CallByID(4146090020); + return wails.Call.ByID(4146090020); } function Mastodon() { - return wails.CallByID(3603981882); + return wails.Call.ByID(3603981882); } function Meetup() { - return wails.CallByID(1147762171); + return wails.Call.ByID(1147762171); } function MicrosoftOnline() { - return wails.CallByID(1805946880); + return wails.Call.ByID(1805946880); } function Naver() { - return wails.CallByID(749569909); + return wails.Call.ByID(749569909); } function NextCloud() { - return wails.CallByID(1924196249); + return wails.Call.ByID(1924196249); } function Okta() { - return wails.CallByID(412847760); + return wails.Call.ByID(412847760); } function Onedrive() { - return wails.CallByID(3973355685); + return wails.Call.ByID(3973355685); } function OpenIDConnect() { - return wails.CallByID(2729309874); + return wails.Call.ByID(2729309874); } function Patreon() { - return wails.CallByID(3723931538); + return wails.Call.ByID(3723931538); } function PayPal() { - return wails.CallByID(3284153782); + return wails.Call.ByID(3284153782); } function SalesForce() { - return wails.CallByID(1734014770); + return wails.Call.ByID(1734014770); } function SeaTalk() { - return wails.CallByID(3129463546); + return wails.Call.ByID(3129463546); } function Shopify() { - return wails.CallByID(1877652737); + return wails.Call.ByID(1877652737); } function Slack() { - return wails.CallByID(812719543); + return wails.Call.ByID(812719543); } function SoundCloud() { - return wails.CallByID(3726943661); + return wails.Call.ByID(3726943661); } function Spotify() { - return wails.CallByID(256059429); + return wails.Call.ByID(256059429); } function Steam() { - return wails.CallByID(4258843427); + return wails.Call.ByID(4258843427); } function Strava() { - return wails.CallByID(1874925690); + return wails.Call.ByID(1874925690); } function Stripe() { - return wails.CallByID(2661473260); + return wails.Call.ByID(2661473260); } function TikTok() { - return wails.CallByID(1284732707); + return wails.Call.ByID(1284732707); } function Twitch() { - return wails.CallByID(487656954); + return wails.Call.ByID(487656954); } function Twitter() { - return wails.CallByID(3389126356); + return wails.Call.ByID(3389126356); } function TwitterV2() { - return wails.CallByID(4048286460); + return wails.Call.ByID(4048286460); } function Typetalk() { - return wails.CallByID(1880294983); + return wails.Call.ByID(1880294983); } function Uber() { - return wails.CallByID(2810476945); + return wails.Call.ByID(2810476945); } function VK() { - return wails.CallByID(1043499094); + return wails.Call.ByID(1043499094); } function WeCom() { - return wails.CallByID(2495227034); + return wails.Call.ByID(2495227034); } function Wepay() { - return wails.CallByID(3921566885); + return wails.Call.ByID(3921566885); } function Xero() { - return wails.CallByID(1174147097); + return wails.Call.ByID(1174147097); } function Yahoo() { - return wails.CallByID(4227069139); + return wails.Call.ByID(4227069139); } function Yammer() { - return wails.CallByID(2053813786); + return wails.Call.ByID(2053813786); } function Yandex() { - return wails.CallByID(1095025512); + return wails.Call.ByID(1095025512); } function Zoom() { - return wails.CallByID(391053986); + return wails.Call.ByID(391053986); } diff --git a/v3/plugins/sqlite/plugin.go b/v3/plugins/sqlite/plugin.go index e9feadc1377..0e2b20282ef 100644 --- a/v3/plugins/sqlite/plugin.go +++ b/v3/plugins/sqlite/plugin.go @@ -45,10 +45,11 @@ func NewPlugin(config *Config) *Plugin { // Shutdown is called when the app is shutting down // You can use this to clean up any resources you have allocated -func (p *Plugin) Shutdown() { +func (p *Plugin) Shutdown() error { if p.conn != nil { - p.conn.Close() + return p.conn.Close() } + return nil } // Name returns the name of the plugin. diff --git a/v3/plugins/start_at_login/plugin.go b/v3/plugins/start_at_login/plugin.go index 4f6a69d8999..313a7a0538a 100644 --- a/v3/plugins/start_at_login/plugin.go +++ b/v3/plugins/start_at_login/plugin.go @@ -19,7 +19,7 @@ func NewPlugin(options Config) *Plugin { // Shutdown is called when the app is shutting down // You can use this to clean up any resources you have allocated -func (p *Plugin) Shutdown() {} +func (p *Plugin) Shutdown() error { return nil } // Name returns the name of the plugin. // You should use the go module format e.g. github.com/myuser/myplugin diff --git a/v3/plugins/start_at_login/plugin_linux.go b/v3/plugins/start_at_login/plugin_linux.go index 341ef07aa92..cd36172d975 100644 --- a/v3/plugins/start_at_login/plugin_linux.go +++ b/v3/plugins/start_at_login/plugin_linux.go @@ -55,7 +55,7 @@ func (p *Plugin) IsStartAtLogin() (bool, error) { return result, nil } -func (p Plugin) autostartFile() string { +func (p *Plugin) autostartFile() string { homedir, _ := os.UserHomeDir() exe, _ := os.Executable() name := filepath.Base(exe) @@ -63,7 +63,7 @@ func (p Plugin) autostartFile() string { return strings.Join([]string{homedir, ".config", "autostart", autostartFile}, "/") } -func (p Plugin) createAutoStartFile(filename string, enabled bool) { +func (p *Plugin) createAutoStartFile(filename string, enabled bool) { file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0600) defer file.Close() @@ -73,7 +73,7 @@ func (p Plugin) createAutoStartFile(filename string, enabled bool) { } exe, _ := os.Executable() input := startTpl{ - Name: filepath.Base(exe) , + Name: filepath.Base(exe), Cmd: exe, Enabled: enabled, } From c7bd39abc7d9994dfb11daf0e0f0464ef93280c4 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 26 Mar 2024 21:02:26 +1100 Subject: [PATCH 2/8] Update plugin example --- v3/examples/plugins/main.go | 9 ++++----- v3/examples/plugins/plugins/hashes/plugin.go | 5 +++-- v3/plugins/kvstore/kvstore.go | 2 +- v3/plugins/log/plugin.go | 2 +- v3/plugins/single_instance/plugin.go | 6 +++--- v3/plugins/sqlite/plugin.go | 3 ++- v3/plugins/start_at_login/plugin.go | 4 +++- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/v3/examples/plugins/main.go b/v3/examples/plugins/main.go index 99f273d00e9..a3141bbb48f 100644 --- a/v3/examples/plugins/main.go +++ b/v3/examples/plugins/main.go @@ -6,7 +6,6 @@ import ( "plugin_demo/plugins/hashes" "github.com/wailsapp/wails/v3/pkg/application" - "github.com/wailsapp/wails/v3/plugins/experimental/server" "github.com/wailsapp/wails/v3/plugins/kvstore" "github.com/wailsapp/wails/v3/plugins/log" "github.com/wailsapp/wails/v3/plugins/single_instance" @@ -35,10 +34,10 @@ func main() { Filename: "store.json", AutoSave: true, }), - "server": server.NewPlugin(&server.Config{ - Enabled: true, - Port: 34115, - }), + //"server": server.NewPlugin(&server.Config{ + // Enabled: true, + // Port: 34115, + //}), "single_instance": single_instance.NewPlugin(&single_instance.Config{ // When true, the original app will be activated when a second instance is launched ActivateAppOnSubsequentLaunch: true, diff --git a/v3/examples/plugins/plugins/hashes/plugin.go b/v3/examples/plugins/plugins/hashes/plugin.go index b3b8426903b..aa6a5f4e925 100644 --- a/v3/examples/plugins/plugins/hashes/plugin.go +++ b/v3/examples/plugins/plugins/hashes/plugin.go @@ -5,6 +5,7 @@ import ( "crypto/sha1" "crypto/sha256" "encoding/hex" + "github.com/wailsapp/wails/v3/pkg/application" ) // ---------------- Plugin Setup ---------------- @@ -15,13 +16,13 @@ func NewPlugin() *Plugin { return &Plugin{} } -func (r *Plugin) Shutdown() {} +func (r *Plugin) Shutdown() error { return nil } func (r *Plugin) Name() string { return "Hashes Plugin" } -func (r *Plugin) Init() error { +func (r *Plugin) Init(api application.PluginAPI) error { return nil } diff --git a/v3/plugins/kvstore/kvstore.go b/v3/plugins/kvstore/kvstore.go index c5df22ed58f..e2b5e75265f 100644 --- a/v3/plugins/kvstore/kvstore.go +++ b/v3/plugins/kvstore/kvstore.go @@ -53,7 +53,7 @@ func (kvs *KeyValueStore) Name() string { // Init is called when the plugin is loaded. It is passed the application.App // instance. This is where you should do any setup. -func (kvs *KeyValueStore) Init() error { +func (kvs *KeyValueStore) Init(api application.PluginAPI) error { err := kvs.open(kvs.config.Filename) if err != nil { return err diff --git a/v3/plugins/log/plugin.go b/v3/plugins/log/plugin.go index 1cb59b860d4..623801aa55b 100644 --- a/v3/plugins/log/plugin.go +++ b/v3/plugins/log/plugin.go @@ -57,7 +57,7 @@ func (p *Plugin) Name() string { return "github.com/wailsapp/wails/v3/plugins/log" } -func (p *Plugin) Init() error { +func (p *Plugin) Init(api application.PluginAPI) error { return nil } diff --git a/v3/plugins/single_instance/plugin.go b/v3/plugins/single_instance/plugin.go index b3bad39f5a9..caa8b68a4a7 100644 --- a/v3/plugins/single_instance/plugin.go +++ b/v3/plugins/single_instance/plugin.go @@ -43,8 +43,8 @@ func NewPlugin(config *Config) *Plugin { } // Shutdown is called when the app is shutting down -func (p *Plugin) Shutdown() { - p.lockfile.Close() +func (p *Plugin) Shutdown() error { + return p.lockfile.Close() } // Name returns the name of the plugin. @@ -55,7 +55,7 @@ func (p *Plugin) Name() string { // Init is called when the app is starting up. You can use this to // initialise any resources you need. You can also access the application // instance via the app property. -func (p *Plugin) Init() error { +func (p *Plugin) Init(api application.PluginAPI) error { var err error lockfileName := p.config.LockFilePath + "/" + p.config.LockFileName p.lockfile, err = CreateLockFile(lockfileName, application.Get().GetPID()) diff --git a/v3/plugins/sqlite/plugin.go b/v3/plugins/sqlite/plugin.go index 0e2b20282ef..f1ac8675fcd 100644 --- a/v3/plugins/sqlite/plugin.go +++ b/v3/plugins/sqlite/plugin.go @@ -5,6 +5,7 @@ import ( _ "embed" "errors" "fmt" + "github.com/wailsapp/wails/v3/pkg/application" _ "modernc.org/sqlite" "strings" ) @@ -60,7 +61,7 @@ func (p *Plugin) Name() string { // Init is called when the app is starting up. You can use this to // initialise any resources you need. -func (p *Plugin) Init() error { +func (p *Plugin) Init(api application.PluginAPI) error { p.callableMethods = []string{"Execute", "Select"} p.js = executeselectjs if p.config.CanOpenFromJS { diff --git a/v3/plugins/start_at_login/plugin.go b/v3/plugins/start_at_login/plugin.go index 313a7a0538a..7ad4cf009dd 100644 --- a/v3/plugins/start_at_login/plugin.go +++ b/v3/plugins/start_at_login/plugin.go @@ -1,5 +1,7 @@ package start_at_login +import "github.com/wailsapp/wails/v3/pkg/application" + type Plugin struct { disabled bool options Config @@ -27,7 +29,7 @@ func (p *Plugin) Name() string { return "github.com/wailsapp/wails/v3/plugins/start_at_login" } -func (p *Plugin) Init() error { +func (p *Plugin) Init(api application.PluginAPI) error { // OS specific initialiser err := p.init() if err != nil { From 238b9ede787b693705fc0a9a8f36da50ac44f6b2 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Tue, 26 Mar 2024 21:11:35 +1100 Subject: [PATCH 3/8] Update plugin example --- v3/examples/plugins/go.mod | 15 ++-- v3/examples/plugins/go.sum | 162 +++++++++++++++++------------------- v3/examples/plugins/main.go | 2 +- 3 files changed, 86 insertions(+), 93 deletions(-) diff --git a/v3/examples/plugins/go.mod b/v3/examples/plugins/go.mod index 232e375a8e9..904976bf171 100644 --- a/v3/examples/plugins/go.mod +++ b/v3/examples/plugins/go.mod @@ -7,8 +7,12 @@ toolchain go1.22.0 require github.com/wailsapp/wails/v3 v3.0.0-alpha.0 require ( + dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/bep/debounce v1.2.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/ebitengine/purego v0.4.0-alpha.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -17,30 +21,25 @@ require ( github.com/go-git/go-git/v5 v5.11.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/uuid v1.3.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/kr/pretty v0.3.1 // indirect github.com/leaanthony/go-ansi-parser v1.6.1 // indirect github.com/leaanthony/u v1.1.0 // indirect github.com/lmittmann/tint v1.0.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/samber/lo v1.38.1 // indirect github.com/sergi/go-diff v1.2.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/skeema/knownhosts v1.2.1 // indirect github.com/wailsapp/go-webview2 v1.0.9 // indirect github.com/wailsapp/mimetype v1.4.1 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect diff --git a/v3/examples/plugins/go.sum b/v3/examples/plugins/go.sum index 23a5a9343bb..1b9020e4519 100644 --- a/v3/examples/plugins/go.sum +++ b/v3/examples/plugins/go.sum @@ -1,17 +1,22 @@ -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY= github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -19,54 +24,41 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/ebitengine/purego v0.4.0-alpha.4 h1:Y7yIV06Yo5M2BAdD7EVPhfp6LZ0tEcQo5770OhYUVes= github.com/ebitengine/purego v0.4.0-alpha.4/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.2.0 h1:GcoouCP9J+5slw2uXAocL70z8ml4A8B/H8nEPt6CLPk= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbKy9zOy4aAKrJ5pibIRpVO2BXnK1Tlcg+caKI7Ox5M= -github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc= -github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= +github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= +github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck= github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -77,8 +69,7 @@ github.com/leaanthony/go-ansi-parser v1.6.1 h1:xd8bzARK3dErqkPFtoF9F3/HgN8UQk0ed github.com/leaanthony/go-ansi-parser v1.6.1/go.mod h1:+vva/2y4alzVmmIEpk9QDhA7vLC5zKDTRwfZGOp3IWU= github.com/leaanthony/u v1.1.0 h1:2n0d2BwPVXSUq5yhe8lJPHdxevE2qK5G99PMStMZMaI= github.com/leaanthony/u v1.1.0/go.mod h1:9+o6hejoRljvZ3BzdYlVL0JYCwtnAsVuN9pVTQcaRfI= -github.com/lmittmann/tint v1.0.0 h1:fzEj70K1L58uyoePQxKe+ezDZJ5pybiWGdA0JeFvvyw= -github.com/lmittmann/tint v1.0.0/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= +github.com/lmittmann/tint v1.0.3 h1:W5PHeA2D8bBJVvabNfQD/XW9HPLZK1XoPZH0cq8NouQ= github.com/lmittmann/tint v1.0.3/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= @@ -89,17 +80,12 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -110,21 +96,17 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97 h1:3RPlVWzZ/PDqmVuf/FKHARG5EMid/tl7cv54Sw/QRVY= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -132,75 +114,87 @@ github.com/wailsapp/go-webview2 v1.0.9 h1:lrU+q0cf1wgLdR69rN+ZnRtMJNaJRrcQ4ELxoO github.com/wailsapp/go-webview2 v1.0.9/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo= github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs= github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= diff --git a/v3/examples/plugins/main.go b/v3/examples/plugins/main.go index a3141bbb48f..150fe325348 100644 --- a/v3/examples/plugins/main.go +++ b/v3/examples/plugins/main.go @@ -45,7 +45,7 @@ func main() { "start_at_login": start_at_login.NewPlugin(start_at_login.Config{}), }, Assets: application.AssetOptions{ - Handler: application.AssetFileServerFS(assets), + Handler: application.BundledAssetFileServer(assets), }, }) From c839c053cb71c3e07c38c0307157a931829de1d1 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Fri, 29 Mar 2024 21:44:59 +1100 Subject: [PATCH 4/8] [windows] Fix min/max buttons --- v3/pkg/application/webview_window_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index 3f7cf36f558..85840d25ee3 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -240,10 +240,10 @@ func (w *windowsWebviewWindow) run() { // Min/max buttons if !options.Windows.DisableMinimiseButton { - w.setMinimiseButtonEnabled(false) + w.setMinimiseButtonEnabled(true) } if !options.Windows.DisableMaximiseButton { - w.setMaximiseButtonEnabled(false) + w.setMaximiseButtonEnabled(true) } // Register the window with the application From eee373f15a0067cb1e85811e9d3b7ac22ffd5d68 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 1 Apr 2024 04:55:34 +1100 Subject: [PATCH 5/8] [windows] Set window icon when in debug mode --- v3/pkg/application/webview_window_windows.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index 85840d25ee3..d7cf6c8aaa5 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -273,6 +273,12 @@ func (w *windowsWebviewWindow) run() { icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3)) if err == nil { w.setIcon(icon) + } else { + // Load the icon from the application icon bytes + icon, err = w32.CreateLargeHIconFromImage(globalApplication.options.Icon) + if err == nil { + w.setIcon(icon) + } } } else { w.disableIcon() @@ -862,7 +868,7 @@ func (w *windowsWebviewWindow) setBackdropType(backdropType BackdropType) { } func (w *windowsWebviewWindow) setIcon(icon w32.HICON) { - w32.SendMessage(w.hwnd, w32.BM_SETIMAGE, w32.IMAGE_ICON, icon) + w32.SendMessage(w.hwnd, w32.WM_SETICON, w32.ICON_BIG, icon) } func (w *windowsWebviewWindow) disableIcon() { From 88ff84f5a5eb0160443a4c1c97bfce6bb1f2bc95 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 1 Apr 2024 05:02:39 +1100 Subject: [PATCH 6/8] [windows] Improve Set window icon when in debug mode --- v3/pkg/application/webview_window_windows.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/v3/pkg/application/webview_window_windows.go b/v3/pkg/application/webview_window_windows.go index d7cf6c8aaa5..f9ebc329a83 100644 --- a/v3/pkg/application/webview_window_windows.go +++ b/v3/pkg/application/webview_window_windows.go @@ -271,14 +271,13 @@ func (w *windowsWebviewWindow) run() { if !options.Windows.DisableIcon { // App icon ID is 3 icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3)) - if err == nil { - w.setIcon(icon) - } else { - // Load the icon from the application icon bytes + if err != nil { icon, err = w32.CreateLargeHIconFromImage(globalApplication.options.Icon) - if err == nil { - w.setIcon(icon) - } + } + if err != nil { + globalApplication.Logger.Warn("Failed to load icon: %v", err) + } else { + w.setIcon(icon) } } else { w.disableIcon() From 3e3f7b9273b902594abb679712503ade41a6e146 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 3 Apr 2024 08:27:32 +1100 Subject: [PATCH 7/8] Update discord link --- mkdocs-website/docs/en/getting-started/feedback.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkdocs-website/docs/en/getting-started/feedback.md b/mkdocs-website/docs/en/getting-started/feedback.md index f592f9849f7..ae5f944a26c 100644 --- a/mkdocs-website/docs/en/getting-started/feedback.md +++ b/mkdocs-website/docs/en/getting-started/feedback.md @@ -5,7 +5,7 @@ posts before creating new ones. Here are the different ways to provide feedback: === "Bugs" - If you find a bug, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel on Discord. + If you find a bug, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel on Discord. - The post should clearly state what the bug is and have a simple reproducible example. If the docs are unclear what *should* happen, please include that in the post. - The post should be given the `Bug` tag. @@ -24,17 +24,17 @@ posts before creating new ones. Here are the different ways to provide feedback: If you have a fix for a bug or an update for documentation, please do the following: - Open a pull request on the [Wails repository](https://github.com/wailsapp/wails). The title of the PR should start with `[v3 alpha]`. - - Create a post in the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel. + - Create a post in the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel. - The post should be given the `PR` tag. - Please include a link to the PR in your post. === "Suggestions" - If you have a suggestion, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/3mgVyGua) channel on Discord: + If you have a suggestion, please let us know by posting into the [v3 Alpha Feedback](https://discord.gg/Vgff2p8gsy) channel on Discord: - The post should be given the `Suggestion` tag. - Please feel free to reach out to us on [Discord](https://discord.gg/3mgVyGua) if you have any questions. + Please feel free to reach out to us on [Discord](https://discord.gg/Vgff2p8gsy) if you have any questions. === "Upvoting" From e91c30fad0d3cd7b1ffd8c09a58c8f908832be98 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 3 Apr 2024 20:48:55 +1100 Subject: [PATCH 8/8] Small doctor improvements --- v2/cmd/wails/doctor.go | 2 +- v3/internal/doctor/doctor.go | 102 ++++++++++++++++----------- v3/internal/doctor/doctor_common.go | 30 ++++++++ v3/internal/doctor/doctor_darwin.go | 20 +++++- v3/internal/doctor/doctor_linux.go | 14 ++-- v3/internal/doctor/doctor_test.go | 10 +++ v3/internal/doctor/doctor_windows.go | 10 +-- v3/internal/version/version.txt | 2 +- 8 files changed, 134 insertions(+), 56 deletions(-) create mode 100644 v3/internal/doctor/doctor_common.go create mode 100644 v3/internal/doctor/doctor_test.go diff --git a/v2/cmd/wails/doctor.go b/v2/cmd/wails/doctor.go index 5306cab1742..015ef8a0b90 100644 --- a/v2/cmd/wails/doctor.go +++ b/v2/cmd/wails/doctor.go @@ -67,7 +67,7 @@ func diagnoseEnvironment(f *flags.Doctor) error { wailsTableData = append(wailsTableData, []string{"Package Manager", info.PM.Name()}) } - err = pterm.DefaultTable.WithData(wailsTableData).Render() + err = pterm.DefaultTable.WithBoxed().WithData(wailsTableData).Render() if err != nil { return err } diff --git a/v3/internal/doctor/doctor.go b/v3/internal/doctor/doctor.go index c46fd9027c7..4bbae931e1a 100644 --- a/v3/internal/doctor/doctor.go +++ b/v3/internal/doctor/doctor.go @@ -7,6 +7,7 @@ import ( "runtime/debug" "slices" "strconv" + "strings" "github.com/go-git/go-git/v5" "github.com/jaypipes/ghw" @@ -65,7 +66,7 @@ func Run() (err error) { return dep.Path == "github.com/wailsapp/wails/v3" }) - wailsVersion := version.VersionString + wailsVersion := strings.TrimSpace(version.VersionString) if wailsPackage != nil && wailsPackage.Replace != nil { wailsVersion = "(local) => " + filepath.ToSlash(wailsPackage.Replace.Path) // Get the latest commit hash @@ -80,47 +81,13 @@ func Run() (err error) { platformExtras, ok := getInfo() + dependencies := make(map[string]string) + checkPlatformDependencies(dependencies, &ok) + spinner.Success() /** Output **/ - pterm.DefaultSection.Println("Build Environment") - - tableData := pterm.TableData{ - {"Wails CLI", wailsVersion}, - {"Go Version", runtime.Version()}, - } - - if buildInfo, _ := debug.ReadBuildInfo(); buildInfo != nil { - buildSettingToName := map[string]string{ - "vcs.revision": "Revision", - "vcs.modified": "Modified", - } - for _, buildSetting := range buildInfo.Settings { - name := buildSettingToName[buildSetting.Key] - if name == "" { - continue - } - tableData = append(tableData, []string{name, buildSetting.Value}) - } - } - - mapKeys := lo.Keys(BuildSettings) - slices.Sort(mapKeys) - for _, key := range mapKeys { - tableData = append(tableData, []string{key, BuildSettings[key]}) - } - - //// Exit early if PM not found - //if info.PM != nil { - // wailsTableData = append(wailsTableData, []string{"Package Manager", info.PM.Name()}) - //} - - err = pterm.DefaultTable.WithData(tableData).Render() - if err != nil { - return err - } - pterm.DefaultSection.Println("System") systemTabledata := pterm.TableData{ @@ -133,7 +100,7 @@ func Run() (err error) { {pterm.Sprint("Architecture"), runtime.GOARCH}, } - mapKeys = lo.Keys(platformExtras) + mapKeys := lo.Keys(platformExtras) slices.Sort(mapKeys) for _, key := range mapKeys { systemTabledata = append(systemTabledata, []string{key, platformExtras[key]}) @@ -177,11 +144,66 @@ func Run() (err error) { //systemTabledata = append(systemTabledata, []string{"CPU", cpu.Processors[0].Model}) - err = pterm.DefaultTable.WithData(systemTabledata).Render() + err = pterm.DefaultTable.WithBoxed().WithData(systemTabledata).Render() + if err != nil { + return err + } + + // Build Environment + + pterm.DefaultSection.Println("Build Environment") + + tableData := pterm.TableData{ + {"Wails CLI", wailsVersion}, + {"Go Version", runtime.Version()}, + } + + if buildInfo, _ := debug.ReadBuildInfo(); buildInfo != nil { + buildSettingToName := map[string]string{ + "vcs.revision": "Revision", + "vcs.modified": "Modified", + } + for _, buildSetting := range buildInfo.Settings { + name := buildSettingToName[buildSetting.Key] + if name == "" { + continue + } + tableData = append(tableData, []string{name, buildSetting.Value}) + } + } + + mapKeys = lo.Keys(BuildSettings) + slices.Sort(mapKeys) + for _, key := range mapKeys { + tableData = append(tableData, []string{key, BuildSettings[key]}) + } + + err = pterm.DefaultTable.WithBoxed(true).WithData(tableData).Render() if err != nil { return err } + // Dependencies + pterm.DefaultSection.Println("Dependencies") + dependenciesBox := pterm.DefaultBox.WithTitleBottomCenter().WithTitle(pterm.Gray("*") + " - Optional Dependency") + dependencyTableData := pterm.TableData{} + if len(dependencies) == 0 { + pterm.Info.Println("No dependencies found") + } else { + var optionals pterm.TableData + mapKeys = lo.Keys(dependencies) + for _, key := range mapKeys { + if strings.HasPrefix(dependencies[key], "*") { + optionals = append(optionals, []string{key, dependencies[key]}) + } else { + dependencyTableData = append(dependencyTableData, []string{key, dependencies[key]}) + } + } + dependencyTableData = append(dependencyTableData, optionals...) + dependenciesTableString, _ := pterm.DefaultTable.WithData(dependencyTableData).Srender() + dependenciesBox.Println(dependenciesTableString) + } + pterm.DefaultSection.Println("Diagnosis") if !ok { pterm.Warning.Println("There are some items above that need addressing!") diff --git a/v3/internal/doctor/doctor_common.go b/v3/internal/doctor/doctor_common.go new file mode 100644 index 00000000000..944729bb040 --- /dev/null +++ b/v3/internal/doctor/doctor_common.go @@ -0,0 +1,30 @@ +package doctor + +import ( + "bytes" + "os/exec" + "strconv" + "strings" +) + +func checkCommonDependencies(result map[string]string, ok *bool) { + // Check for npm + npmVersion := []byte("Not Installed. Requires npm >= 7.0.0") + npmVersion, err := exec.Command("npm", "-v").Output() + if err != nil { + *ok = false + } else { + npmVersion = bytes.TrimSpace(npmVersion) + // Check that it's at least version 7 by converting first byte to int and checking if it's >= 7 + // Parse the semver string + semver := strings.Split(string(npmVersion), ".") + if len(semver) > 0 { + major, _ := strconv.Atoi(semver[0]) + if major < 7 { + *ok = false + npmVersion = append(npmVersion, []byte(". Installed, but requires npm >= 7.0.0")...) + } + } + } + result["npm"] = string(npmVersion) +} diff --git a/v3/internal/doctor/doctor_darwin.go b/v3/internal/doctor/doctor_darwin.go index d92d8953ee0..9ffb368f1aa 100644 --- a/v3/internal/doctor/doctor_darwin.go +++ b/v3/internal/doctor/doctor_darwin.go @@ -3,6 +3,7 @@ package doctor import ( + "bytes" "github.com/samber/lo" "os/exec" "strings" @@ -31,11 +32,16 @@ func getInfo() (map[string]string, bool) { result["Apple Silicon"] = appleSilicon result["CPU"] = getSysctl("machdep.cpu.brand_string") + return result, ok +} + +func checkPlatformDependencies(result map[string]string, ok *bool) { + // Check for xcode command line tools output, err := exec.Command("xcode-select", "-v").Output() cliToolsVersion := "N/A. Install by running: `xcode-select --install`" if err != nil { - ok = false + *ok = false } else { cliToolsVersion = strings.TrimPrefix(string(output), "xcode-select version ") cliToolsVersion = strings.TrimSpace(cliToolsVersion) @@ -43,5 +49,15 @@ func getInfo() (map[string]string, bool) { } result["Xcode cli tools"] = cliToolsVersion - return result, ok + checkCommonDependencies(result, ok) + + // Check for nsis + nsisVersion := []byte("Not Installed. Install with `brew install makensis`.") + output, err = exec.Command("makensis", "-VERSION").Output() + if err == nil && output != nil { + nsisVersion = output + } + nsisVersion = bytes.TrimSpace(nsisVersion) + + result["*NSIS"] = string(nsisVersion) } diff --git a/v3/internal/doctor/doctor_linux.go b/v3/internal/doctor/doctor_linux.go index 7c64da1a66b..f9454305f1d 100644 --- a/v3/internal/doctor/doctor_linux.go +++ b/v3/internal/doctor/doctor_linux.go @@ -2,15 +2,13 @@ package doctor -import ( - "github.com/wailsapp/wails/v3/internal/doctor/packagemanager" - "github.com/wailsapp/wails/v3/internal/operatingsystem" -) - func getInfo() (map[string]string, bool) { result := make(map[string]string) - ok := true + return result, true +} +func checkPlatformDependencies(result map[string]string, ok *bool) { + result := make(map[string]string) info, _ := operatingsystem.Info() pm := packagemanager.Find(info.ID) @@ -23,7 +21,7 @@ func getInfo() (map[string]string, bool) { if dep.Optional { status = "[Optional] " } else { - ok = false + *ok = false } status += "not installed." if dep.InstallCommand != "" { @@ -36,5 +34,5 @@ func getInfo() (map[string]string, bool) { result[dep.Name] = status } - return result, ok + checkCommonDependencies(result, ok) } diff --git a/v3/internal/doctor/doctor_test.go b/v3/internal/doctor/doctor_test.go new file mode 100644 index 00000000000..98f4c3f8a35 --- /dev/null +++ b/v3/internal/doctor/doctor_test.go @@ -0,0 +1,10 @@ +package doctor + +import "testing" + +func TestRun(t *testing.T) { + err := Run() + if err != nil { + t.Errorf("TestRun failed: %v", err) + } +} diff --git a/v3/internal/doctor/doctor_windows.go b/v3/internal/doctor/doctor_windows.go index c8b0c6b2961..541041e0aa5 100644 --- a/v3/internal/doctor/doctor_windows.go +++ b/v3/internal/doctor/doctor_windows.go @@ -18,10 +18,6 @@ func getInfo() (map[string]string, bool) { webviewVersion = "Error:" + err.Error() } result["WebView2 Version"] = webviewVersion - - // add nsis - result["NSIS"] = getNSISVersion() - return result, ok } @@ -33,3 +29,9 @@ func getNSISVersion() string { } return string(output) } + +func checkPlatformDependencies(result map[string]string, ok *bool) { + checkCommonDependencies(result, ok) + // add nsis + result["NSIS"] = getNSISVersion() +} diff --git a/v3/internal/version/version.txt b/v3/internal/version/version.txt index 60fbe96c7c7..5781d3b0460 100644 --- a/v3/internal/version/version.txt +++ b/v3/internal/version/version.txt @@ -1 +1 @@ -v3.0.0-alpha.4 +v3.0.0-alpha.4 \ No newline at end of file