Compare commits

..

1 Commits

Author SHA1 Message Date
Lea Anthony c24aef8ea1 Initial commit. Need to fix userid write permission issues 2022-02-22 19:12:13 +11:00
82 changed files with 2173 additions and 1786 deletions
+12 -4
View File
@@ -6,9 +6,15 @@ labels: bug
assignees: ''
---
<!---
*** Please note: No new bug reports are being accepted for Wails v1 ***
--->
#####################################################
**V1 users: If you have a technical issue, please do not open a bug this way!**
Please use the `wails issue` command!
If you do not do this then the issue may be closed automatically.
NOTE: If your bug is related to Windows, make sure you read
the [Windows Developer Guide](https://wails.app/guides/windows/)
#####################################################
**Description**
A clear and concise description of what the bug is.
@@ -27,7 +33,9 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**System Details**
Please add the output of `wails doctor`.
V2 users: Please add the output of `wails doctor`.
**Additional context**
Add any other context about the problem here.
- [ ] This issue is for Windows and I have read the [Windows Developer Guide](https://wails.app/guides/windows/)
@@ -6,9 +6,6 @@ labels: enhancement
assignees: ''
---
<!---
*** Please note: No new feature requests are being accepted for Wails v1 ***
--->
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+4 -10
View File
@@ -1,5 +1,5 @@
<p align="center" style="text-align: center">
<img src="logo-universal.png" width="55%"><br/>
<img src="logo.png" width="55%"><br/>
</p>
<p align="center">
Build desktop applications using Go & Web Technologies.<br/><br/>
@@ -79,18 +79,12 @@ approach: it provides the ability to wrap both Go code and a web frontend into a
make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
<span id="nav-3-1"></span>
<hr/>
<h3><strong>PLEASE NOTE: As we are approaching the v2 release, we are not accepting any new feature requests or bug reports for v1. If you have a critical issue, please open a ticket and state why it is critical.</strong></h3>
<hr/>
### Version 2
### Official Website
Wails v2 has been released in Beta for all 3 platforms. Check out the [new website](https://wails.io) if you are
interested in trying it out.
The official docs can be found at [https://wails.app](https://wails.app).
### Legacy v1 Website
The legacy v1 docs can be found at [https://wails.app](https://wails.app).
Click [here](https://wails.io) if you are interested in trying out v2 Beta for Windows.
<span id="nav-4"></span>
+2 -6
View File
@@ -1,5 +1,5 @@
<p align="center" style="text-align: center">
<img src="logo-universal.png" width="55%"><br/>
<img src="logo.png" width="55%"><br/>
</p>
<p align="center">
使用 Go 和 Web 技术构建桌面应用程序。<br/><br/>
@@ -81,13 +81,9 @@
### 官方网站
#### v1
官方文档可以在 [https://wails.app](https://wails.app) 中找到。
#### v2
Wails v2 已针对所有 3 个平台发布了 Beta 版。如果您有兴趣尝试一下,请查看[新网站](https://wails.io)。
如果您对适用于 Windows 的 v2 测试版感兴趣,可以点击[此处](https://wails.io)查看。
镜像网站:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

+10 -38
View File
@@ -93,9 +93,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
debug := false
command.BoolFlag("debug", "Retains debug data in the compiled application", &debug)
nsis := false
command.BoolFlag("nsis", "Generate NSIS installer for Windows", &nsis)
command.Action(func() error {
quiet := verbosity == 0
@@ -120,12 +117,20 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
}
// Tags
experimental := false
userTags := []string{}
for _, tag := range strings.Split(tags, " ") {
thisTag := strings.TrimSpace(tag)
if thisTag != "" {
userTags = append(userTags, thisTag)
}
if thisTag == "exp" {
experimental = true
}
}
if runtime.GOOS == "linux" && !experimental {
return fmt.Errorf("Linux version coming soon!")
}
// Webview2 installer strategy (download by default)
@@ -209,9 +214,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
return err
}
projectOptions, err := project.Load(cwd)
if err != nil {
return err
}
// Check platform
validPlatformArch := slicer.String([]string{
@@ -227,15 +229,7 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
"windows/arm64",
})
outputBinaries := map[string]string{}
// Allows cancelling the build after the first error. It would be nice if targets.Each would support funcs
// returning an error.
var targetErr error
targets.Each(func(platform string) {
if targetErr != nil {
return
}
if !validPlatformArch.Contains(platform) {
buildOptions.Logger.Println("platform '%s' is not supported - skipping. Supported platforms: %s", platform, validPlatformArch.Join(","))
@@ -270,11 +264,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
}
switch buildOptions.Platform {
case "linux":
if runtime.GOOS != "linux" {
logger.Println("Crosscompiling to Linux not currently supported.\n")
return
}
case "darwin":
if runtime.GOOS != "darwin" {
logger.Println("Crosscompiling to Mac not currently supported.\n")
@@ -307,35 +296,18 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
outputFilename, err := build.Build(buildOptions)
if err != nil {
logger.Println("Error: %s", err.Error())
targetErr = err
logger.Println("Error: ", err.Error())
return
}
// Subsequent iterations
buildOptions.IgnoreFrontend = true
buildOptions.CleanBuildDirectory = false
// Output stats
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.\n", outputFilename, time.Since(start).Round(time.Millisecond).String()))
outputBinaries[platform] = outputFilename
})
if targetErr != nil {
return targetErr
}
if nsis {
amd64Binary := outputBinaries["windows/amd64"]
arm64Binary := outputBinaries["windows/arm64"]
if amd64Binary == "" && arm64Binary == "" {
return fmt.Errorf("cannot build nsis installer - no windows targets")
}
if err := build.GenerateNSISInstaller(buildOptions, amd64Binary, arm64Binary); err != nil {
return err
}
}
return nil
})
}
+14 -6
View File
@@ -103,12 +103,20 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
logger := clilogger.New(w)
app.PrintBanner()
experimental := false
userTags := []string{}
for _, tag := range strings.Split(flags.tags, " ") {
thisTag := strings.TrimSpace(tag)
if thisTag != "" {
userTags = append(userTags, thisTag)
}
if thisTag == "exp" {
experimental = true
}
}
if runtime.GOOS == "linux" && !experimental {
return fmt.Errorf("Linux version coming soon!")
}
cwd, err := os.Getwd()
@@ -142,10 +150,10 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
return err
}
// frontend:dev:watcher command.
if command := projectConfig.DevWatcherCommand; command != "" {
// frontend:dev server command
if projectConfig.DevCommand != "" {
var devCommandWaitGroup sync.WaitGroup
closer := runFrontendDevWatcherCommand(cwd, command, &devCommandWaitGroup)
closer := runFrontendDevCommand(cwd, projectConfig.DevCommand, &devCommandWaitGroup)
defer closer(&devCommandWaitGroup)
}
@@ -368,9 +376,9 @@ func loadAndMergeProjectConfig(cwd string, flags *devFlags) (*project.Project, e
return projectConfig, nil
}
// runFrontendDevWatcherCommand will run the `frontend:dev:watcher` command if it was given, ex- `npm run dev`
func runFrontendDevWatcherCommand(cwd string, devCommand string, wg *sync.WaitGroup) func(group *sync.WaitGroup) {
LogGreen("Running frontend dev watcher command: '%s'", devCommand)
// runFrontendDevCommand will run the `frontend:dev` command if it was given, ex- `npm run dev`
func runFrontendDevCommand(cwd string, devCommand string, wg *sync.WaitGroup) func(group *sync.WaitGroup) {
LogGreen("Running frontend dev command: '%s'", devCommand)
ctx, cancel := context.WithCancel(context.Background())
dir := filepath.Join(cwd, "frontend")
cmdSlice := strings.Split(devCommand, " ")
@@ -26,13 +26,6 @@ func (a App) domReady(ctx context.Context) {
// Add your action here
}
// beforeClose is called when the application is about to quit,
// either by clicking the window close button or calling runtime.Quit.
// Returning true will cause the application to continue, false will continue shutdown as normal.
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
return false
}
// shutdown is called at application termination
func (a *App) shutdown(ctx context.Context) {
// Perform your teardown here
@@ -7,27 +7,23 @@ import (
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed frontend/dist
var assets embed.FS
//go:embed build/appicon.png
var icon []byte
func main() {
// Create an instance of the app structure
app := NewApp()
// Create application with options
err := wails.Run(&options.App{
Title: "{{.ProjectName}}",
Width: 1024,
Height: 768,
MinWidth: 1024,
MinHeight: 768,
Title: "{{.ProjectName}}",
Width: 1024,
Height: 768,
// MinWidth: 720,
// MinHeight: 570,
// MaxWidth: 1280,
// MaxHeight: 740,
DisableResize: false,
@@ -35,16 +31,12 @@ func main() {
Frameless: false,
StartHidden: false,
HideWindowOnClose: false,
RGBA: &options.RGBA{R: 255, G: 255, B: 255, A: 255},
RGBA: &options.RGBA{255, 255, 255, 255},
Assets: assets,
Menu: nil,
Logger: nil,
LogLevel: logger.DEBUG,
OnStartup: app.startup,
OnDomReady: app.domReady,
OnBeforeClose: app.beforeClose,
OnShutdown: app.shutdown,
WindowStartState: options.Normal,
Bind: []interface{}{
app,
},
@@ -53,27 +45,6 @@ func main() {
WebviewIsTransparent: false,
WindowIsTranslucent: false,
DisableWindowIcon: false,
// DisableFramelessWindowDecorations: false,
WebviewUserDataPath: "",
},
// Mac platform specific options
Mac: &mac.Options{
TitleBar: &mac.TitleBar{
TitlebarAppearsTransparent: true,
HideTitle: false,
HideTitleBar: false,
FullSizeContent: false,
UseToolbar: false,
HideToolbarSeparator: true,
},
Appearance: mac.NSAppearanceNameDarkAqua,
WebviewIsTransparent: true,
WindowIsTranslucent: true,
About: &mac.AboutInfo{
Title: "{{.ProjectName}}",
Message: "",
Icon: icon,
},
},
})
@@ -0,0 +1,16 @@
{
"name": "{{.ProjectName}}",
"author": "",
"private": true,
"scripts": {
"install": "go install github.com/wailsapp/wails/v2/cmd/wails@latest",
"build": "wails build --clean",
"build:macos": "npm run build -- --platform darwin/universal",
"build:macos-arm": "npm run build -- --platform darwin/arm64",
"build:macos-intel": "npm run build -- --platform darwin",
"build:windows": "npm run build -- --platform windows/amd64"
},
"workspaces": [
"frontend"
]
}
@@ -1,9 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Start building the app for macos platform..."
wails build --clean --platform darwin/arm64
echo -e "End running the script!"
@@ -1,9 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Start building the app for macos platform..."
wails build --clean --platform darwin
echo -e "End running the script!"
@@ -1,9 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Start building the app for macos platform..."
wails build --clean --platform darwin/universal
echo -e "End running the script!"
@@ -1,9 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Start building the app for windows platform..."
wails build --clean --platform windows/amd64
echo -e "End running the script!"
@@ -1,9 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Start building the app..."
wails build --clean
echo -e "End running the script!"
@@ -1,14 +0,0 @@
#! /bin/bash
echo -e "Start running the script..."
cd ../
echo -e "Current Go version: \c"
go version
echo -e "Install the Wails command line tool..."
go install github.com/wailsapp/wails/v2/cmd/wails@latest
echo -e "Successful installation!"
echo -e "End running the script!"
@@ -2,6 +2,8 @@ package initialise
import (
"fmt"
"github.com/flytam/filenamify"
"github.com/leaanthony/slicer"
"io"
"os"
"os/exec"
@@ -9,9 +11,6 @@ import (
"strings"
"time"
"github.com/flytam/filenamify"
"github.com/leaanthony/slicer"
"github.com/wailsapp/wails/v2/pkg/buildassets"
"github.com/wailsapp/wails/v2/cmd/wails/internal/commands/initialise/templates"
@@ -150,7 +149,7 @@ func initProject(options *templates.Options, quiet bool) error {
}
// Install the default assets
err = buildassets.Install(options.TargetDir)
err = buildassets.Install(options.TargetDir, options.ProjectName)
if err != nil {
return err
}
@@ -12,7 +12,6 @@ import (
"strings"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/pkg/errors"
"github.com/leaanthony/debme"
@@ -296,17 +295,9 @@ func gitclone(options *Options) (string, error) {
if err != nil {
return "", err
}
// Parse remote template url and version number
templateInfo := strings.Split(options.TemplateName, "@")
cloneOption := &git.CloneOptions{
URL: templateInfo[0],
}
if len(templateInfo) > 1 {
cloneOption.ReferenceName = plumbing.NewTagReferenceName(templateInfo[1])
}
_, err = git.PlainClone(dirname, false, cloneOption)
_, err = git.PlainClone(dirname, false, &git.CloneOptions{
URL: options.TemplateName,
})
return dirname, err

Some files were not shown because too many files have changed in this diff Show More