diff --git a/v2/cmd/wails/internal/commands/build/build.go b/v2/cmd/wails/internal/commands/build/build.go index ea9eddeb6..a8c458a92 100644 --- a/v2/cmd/wails/internal/commands/build/build.go +++ b/v2/cmd/wails/internal/commands/build/build.go @@ -24,10 +24,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { command := app.NewSubCommand("build", "Builds the application") - // Setup target type flag - //description := "Type of application to build. Valid types: " + validTargetTypes.Join(",") - //command.StringFlag("t", description, &outputType) - // Setup production flag production := false command.BoolFlag("production", "Build in production mode", &production) @@ -58,10 +54,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { tags := "" command.StringFlag("tags", "tags to pass to Go compiler (quoted and space separated)", &tags) - // Log to file - //logFile := "" - //command.StringFlag("l", "Log to file", &logFile) - // Retain assets keepAssets := false command.BoolFlag("k", "Keep generated assets", &keepAssets) @@ -74,11 +66,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { cleanBuildDirectory := false command.BoolFlag("clean", "Clean the build directory before building", &cleanBuildDirectory) - appleIdentity := "" - if runtime.GOOS == "darwin" { - command.StringFlag("sign", "Signs your app with the given identity.", &appleIdentity) - } - command.Action(func() error { quiet := verbosity == 0 @@ -96,11 +83,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { app.PrintBanner() } - // Ensure package is used with apple identity - if appleIdentity != "" && pack == false { - return fmt.Errorf("must use `-package` flag when using `-sign`") - } - // Setup mode mode := build.Debug if production { @@ -146,7 +128,6 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) { LDFlags: ldflags, Compiler: compilerCommand, KeepAssets: keepAssets, - AppleIdentity: appleIdentity, Verbosity: verbosity, Compress: compress, UserTags: userTags, diff --git a/v2/cmd/wails/internal/commands/generate/generate.go b/v2/cmd/wails/internal/commands/generate/generate.go index 7e99a9997..e2030161c 100644 --- a/v2/cmd/wails/internal/commands/generate/generate.go +++ b/v2/cmd/wails/internal/commands/generate/generate.go @@ -9,7 +9,7 @@ import ( "github.com/wailsapp/wails/v2/pkg/parser" ) -// AddSubcommand adds the `dev` command for the Wails application +// AddSubcommand adds the `generate` command for the Wails application func AddSubcommand(app *clir.Cli, w io.Writer) error { command := app.NewSubCommand("generate", "Code Generation Tools") @@ -19,7 +19,7 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error { // Quiet Init quiet := false - backendAPI.BoolFlag("q", "Supress output to console", &quiet) + backendAPI.BoolFlag("q", "Suppress output to console", &quiet) backendAPI.Action(func() error { @@ -85,7 +85,4 @@ func logPackage(pkg *parser.Package, logger *clilogger.CLILogger) { } } logger.Println("") - - // logger.Println(" Original Go Package Path:", pkg.Gopackage.PkgPath) - // logger.Println(" Original Go Package Path:", pkg.Gopackage.PkgPath) } diff --git a/v2/internal/binding/generate.go b/v2/internal/binding/generate.go index 87a8cf30f..cef5dff68 100644 --- a/v2/internal/binding/generate.go +++ b/v2/internal/binding/generate.go @@ -14,30 +14,6 @@ import ( "github.com/leaanthony/slicer" ) -const _comment = ` - -const backend = { - main: { - "xbarApp": { - "GetCategories": () => { - window.backend.main.xbarApp.GetCategories.call(arguments); - }, - - /** - * @param {string} arg1 - */ - "InstallPlugin": (arg1) => { - window.backend.main.xbarApp.InstallPlugin.call(arguments); - }, - "GetPlugins": () => { - window.backend.main.xbarApp.GetPlugins.call(arguments); - } - } - } -} - -export default backend;` - //go:embed assets/package.json var packageJSON []byte @@ -100,6 +76,8 @@ const backend = {`) } returnType += ">" returnTypeDetails = " - Go Type: " + methodDetails.Outputs[0].TypeName + } else { + returnType = "Promise" } output.WriteString(" * @returns {" + returnType + "} " + returnTypeDetails + "\n") output.WriteString(" */\n") @@ -125,13 +103,14 @@ const backend = {`) export default backend;`) output.WriteString("\n") + // TODO: Make this configurable in wails.json dirname, err := fs.RelativeToCwd("frontend/src/backend") if err != nil { log.Fatal(err) } if !fs.DirExists(dirname) { - err := fs.Mkdir(dirname) + err := fs.MkDirs(dirname) if err != nil { log.Fatal(err) } diff --git a/v2/internal/templates/templates/vanilla/basic.tmpl.go b/v2/internal/templates/templates/vanilla/basic.tmpl.go index fa91fbb94..88b061427 100644 --- a/v2/internal/templates/templates/vanilla/basic.tmpl.go +++ b/v2/internal/templates/templates/vanilla/basic.tmpl.go @@ -11,7 +11,7 @@ type Basic struct { runtime *wails.Runtime } -// newBasic creates a new Basic application struct +// NewBasic creates a new Basic application struct func NewBasic() *Basic { return &Basic{} }