diff --git a/v2/cmd/wails/internal/commands/initialise/initialise.go b/v2/cmd/wails/internal/commands/initialise/initialise.go index 13a6483b..35ebef25 100644 --- a/v2/cmd/wails/internal/commands/initialise/initialise.go +++ b/v2/cmd/wails/internal/commands/initialise/initialise.go @@ -181,7 +181,6 @@ func initProject(options *templates.Options, quiet bool) error { // Output stats elapsed := time.Since(start) - options.Logger.Println("") options.Logger.Println("Project Name: " + options.ProjectName) options.Logger.Println("Project Directory: " + options.TargetDir) options.Logger.Println("Project Template: " + options.TemplateName) diff --git a/website/docs/tutorials/_category_.json b/website/docs/tutorials/_category_.json new file mode 100644 index 00000000..dfac1d17 --- /dev/null +++ b/website/docs/tutorials/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Tutorials", + "position": 70 +} diff --git a/website/docs/tutorials/helloworld.mdx b/website/docs/tutorials/helloworld.mdx new file mode 100644 index 00000000..86ebae7e --- /dev/null +++ b/website/docs/tutorials/helloworld.mdx @@ -0,0 +1,114 @@ +--- +sidebar_position: 10 +--- + +# Hello World + +The aim of this tutorial is to get you up and running with the most basic +application using Wails. You will be able to: + + - Create a new Wails application + - Build the application + - Run the application + +:::note +This tutorial uses Windows as the target platform. Output will vary slightly +depending on your operating system. +::: + +## Create a new Wails application + +To create a new Wails application using the default vanilla JS template, +you need to run the following command: + +```bash +wails init -n helloworld +``` + +You should see something similar to the following: + +``` +Wails CLI v2.0.0 + +Initialising Project 'helloworld' +--------------------------------- + +Project Name: helloworld +Project Directory: C:\Users\leaan\tutorial\helloworld +Project Template: vanilla +Template Support: https://wails.io + +Initialised project 'helloworld' in 232ms. +``` + +This will create a new directory called `helloworld` in the current directory. +In this directory, you will find a number of files: + +``` +build/ - Contains the build files + compiled application +frontend/ - Contains the frontend files +app.go - Contains the application code +main.go - The main program with the application configuration +wails.json - The project configuration file +go.mod - The go module file +go.sum - The go module checksum file +``` + +## Build the application + +To build the application, change to the new `helloworld` project directory and run the following command: + +```bash +wails build +``` + +You should see something like the following: + +``` +Wails CLI v2.0.0 + +App Type: desktop +Platforms: windows/amd64 +Compiler: C:\Users\leaan\go\go1.18.3\bin\go.exe +Build Mode: Production +Skip Frontend: false +Compress: false +Package: true +Clean Build Dir: false +LDFlags: "" +Tags: [] +Race Detector: false + +Building target: windows/amd64 +------------------------------ + - Installing frontend dependencies: Done. + - Compiling frontend: Done. + - Generating bundle assets: Done. + - Compiling application: Done. +Built 'C:\Users\leaan\tutorial\helloworld\build\bin\helloworld.exe' in 10.616s. +``` + +This has compiled the application and saved it in the `build/bin` directory. + +## Run the application + +If we view the `build/bin` directory in Windows Explorer, we should see our project binary: + +
+