1529e55d25
Nuevo agente para crear y compilar aplicaciones Wails (Go + React). Soporta compilación cross-platform: Linux, Windows, macOS. Incluye script de creación de proyecto con DevFactory y frontend-lib integrados.
72 lines
1.8 KiB
Go
72 lines
1.8 KiB
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
|
|
"github.com/wailsapp/wails/v2"
|
|
"github.com/wailsapp/wails/v2/pkg/options"
|
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
|
"github.com/wailsapp/wails/v2/pkg/options/linux"
|
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
|
)
|
|
|
|
//go:embed all:frontend/dist
|
|
var assets embed.FS
|
|
|
|
func main() {
|
|
app := NewApp()
|
|
|
|
err := wails.Run(&options.App{
|
|
Title: "{{APP_TITLE}}",
|
|
Width: 1280,
|
|
Height: 800,
|
|
MinWidth: 800,
|
|
MinHeight: 600,
|
|
AssetServer: &assetserver.Options{
|
|
Assets: assets,
|
|
},
|
|
BackgroundColour: &options.RGBA{R: 15, G: 23, B: 42, A: 1}, // slate-900
|
|
OnStartup: app.startup,
|
|
OnShutdown: app.shutdown,
|
|
OnDomReady: app.domReady,
|
|
Bind: []interface{}{
|
|
app,
|
|
},
|
|
// Windows options
|
|
Windows: &windows.Options{
|
|
WebviewIsTransparent: false,
|
|
WindowIsTranslucent: false,
|
|
DisableWindowIcon: false,
|
|
DisableFramelessWindowDecorations: false,
|
|
WebviewUserDataPath: "",
|
|
Theme: windows.SystemDefault,
|
|
},
|
|
// Linux options
|
|
Linux: &linux.Options{
|
|
ProgramName: "{{APP_NAME}}",
|
|
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
|
|
WindowIsTranslucent: false,
|
|
},
|
|
// macOS options
|
|
Mac: &mac.Options{
|
|
TitleBar: &mac.TitleBar{
|
|
TitlebarAppearsTransparent: true,
|
|
HideTitle: false,
|
|
HideTitleBar: false,
|
|
FullSizeContent: false,
|
|
UseToolbar: false,
|
|
HideToolbarSeparator: true,
|
|
},
|
|
About: &mac.AboutInfo{
|
|
Title: "{{APP_TITLE}}",
|
|
Message: "Built with Wails + React",
|
|
},
|
|
},
|
|
})
|
|
|
|
if err != nil {
|
|
println("Error:", err.Error())
|
|
}
|
|
}
|