5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 23:41:38 +08:00

update devmode to use types and yaml (#3454)

go mod update
This commit is contained in:
Atterpac 2024-05-05 00:27:53 -07:00 committed by GitHub
parent 5a57ee99ac
commit 2c29e1ca76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 35 additions and 42 deletions

View File

@ -3,7 +3,7 @@ module github.com/wailsapp/wails/v3
go 1.21
require (
github.com/atterpac/refresh v0.7.4
github.com/atterpac/refresh v0.8.0
github.com/bep/debounce v1.2.1
github.com/ebitengine/purego v0.4.0-alpha.4
github.com/go-git/go-git/v5 v5.11.0

View File

@ -31,8 +31,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW
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/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk=
github.com/atterpac/refresh v0.7.4 h1:EFknxg00weECF6jlQGKnhFaAMxhArwYwriqgS/ko9io=
github.com/atterpac/refresh v0.7.4/go.mod h1:fJpWySLdpbANS8Ej5OvfZVZIVvi/9bmnhTjKS5EjQes=
github.com/atterpac/refresh v0.8.0 h1:KGMu60O/D1CxjvNwxcDJriCJo0CX9DLqY0lwLLaW4nE=
github.com/atterpac/refresh v0.8.0/go.mod h1:fJpWySLdpbANS8Ej5OvfZVZIVvi/9bmnhTjKS5EjQes=
github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY=
github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=

View File

@ -1,35 +0,0 @@
[config]
root_path = "."
# debug | info | warn | error | mute
# Defaults to Info if not provided
log_level = "warn"
# Debounce setting for ignoring reptitive file system notifications
debounce = 1000 # Milliseconds
# Sets what files the watcher should ignore
[config.ignore]
# Directories to ignore
dir = [".git", "node_modules", "frontend", "bin"]
# Files to ignore
file = [".DS_Store", ".gitignore", ".gitkeep"]
# File extensions to watch
watched_extension = ["*.go"]
# Add .gitignore paths to ignore
git_ignore = true
[config.background]
cmd = "wails3 task dev:frontend"
[[config.executes]]
cmd = "go mod tidy"
blocking = true
[[config.executes]]
cmd = "wails3 task build"
blocking = true
[[config.executes]]
cmd = "KILL_STALE"
[[config.executes]]
cmd = "wails3 task run"
primary = true

View File

@ -0,0 +1,28 @@
config:
root_path: .
log_level: warn
debounce: 1000
ignore:
dir:
- .git
- node_modules
- frontend
- bin
file:
- .DS_Store
- .gitignore
- .gitkeep
watched_extension:
- "*.go"
git_ignore: true
executes:
- cmd: wails3 task install:frontend:deps
type: once
- cmd: wails3 task dev:frontend
type: background
- cmd: go mod tidy
type: blocking
- cmd: wails3 task build
type: blocking
- cmd: wails3 task run
type: primary

View File

@ -15,7 +15,7 @@ const wailsVitePort = "WAILS_VITE_PORT"
type DevOptions struct {
flags.Common
Config string `description:"The config file including path" default:"./build/devmode.config.toml"`
Config string `description:"The config file including path" default:"./build/devmode.config.yaml"`
VitePort int `name:"port" description:"Specify the vite dev server port"`
}

View File

@ -12,7 +12,7 @@ type WatcherOptions struct {
func Watcher(options *WatcherOptions) error {
stopChan := make(chan struct{})
watcherEngine, err := engine.NewEngineFromTOML(options.Config)
watcherEngine, err := engine.NewEngineFromYAML(options.Config)
if err != nil {
return err
}

View File

@ -437,7 +437,7 @@ tasks:
dev:
summary: Runs the application in development mode
cmds:
- wails3 dev -config ./build/devmode.config.toml -port {{ "{{.VITE_PORT}}" }}
- wails3 dev -config ./build/devmode.config.yaml -port {{ "{{.VITE_PORT}}" }}
dev:reload:
summary: Reloads the application