[v2] Docs update

(cherry picked from commit 589eb3864f)
This commit is contained in:
Lea Anthony
2021-09-27 19:35:30 +10:00
parent 828f07ea13
commit 1d8f74d6d7
150 changed files with 19195 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"label": "Getting Started",
"position": 10
}

View File

@@ -0,0 +1,19 @@
---
sidebar_position: 6
---
# Compiling your Project
From the project directory, run `wails build`.
This will compile your project and save the production-ready binary in the `build/bin` directory.
If you run the binary, you should see the default application:
<div class="text--center">
<img src="/img/defaultproject.png" width="50%" style={{"box-shadow": "rgb(255 255 255 / 20%) 0px 4px 8px 0px, rgb(104 104 104) 0px 6px 20px 0px"}}/>
</div>
<br/>
For more details on compilation options, please refer to the [CLI Reference](/docs/reference/cli#build).

View File

@@ -0,0 +1,15 @@
---
sidebar_position: 5
---
# Developing your Application
You can run your application in development mode by running `wails dev` from your project directory. This will do the following things:
- Build your application and run it
- Watch for modifications in your Go files and rebuild/re-run on change
- Sets up a [webserver](http://localhost:34115) that will serve your application over a browser. This allows you to use your favourite browser extensions. You can even call your Go code from the console.
To get started, run `wails dev` in the project directory. More information on this can be found [here](/docs/reference/cli#dev).
Coming soon: Tutorial

View File

@@ -0,0 +1,53 @@
---
sidebar_position: 2
---
# Creating a Project
## Project Generation
Now that the CLI is installed, you can generate a new project by using the `wails init` command.
To get up and running quickly, you can generate a default project by running `wails init -n myproject`. This will
create a directory called `myproject` and populate it with the default template.
Other project templates are available and can be listed using `wails init -l`.
To see the other options available, you can run `wails init -help`.
More details can be found in the [CLI Reference](/docs/reference/cli#init).
## Project Layout
Wails projects have the following layout:
```
.
├── build/
│ ├── appicon.png
│ ├── darwin/
│ └── windows/
├── frontend/
├── go.mod
├── go.sum
├── main.go
└── wails.json
```
### Project structure rundown
- `/main.go` - The main application
- `/frontend/` - Frontend project files
- `/build/` - Project build directory
- `/build/appicon.png` - The application icon
- `/build/darwin/` - Mac specific project files
- `/build/windows/` - Windows specific project files
- `/wails.json` - The project configuration
- `/go.mod` - Go module file
- `/go.sum` - Go module checksum file
The `frontend` directory has nothing specific to Wails and can be any frontend project of your choosing.
The `build` directory is used during the build process. These files may be updated to customise your builds. If
files are removed from the build directory, default versions will be regenerated.
The default module name in `go.mod` is "changeme". You should change this to something more appropriate.

View File

@@ -0,0 +1,71 @@
---
sidebar_position: 1
---
# Installation
## Supported Platforms
- Windows 10
- MacOS x64 & arm64 (due October '21)
- Linux (due December '21)
## Dependencies
Wails has a number of common dependencies that are required before installation:
- Go 1.17+
- npm (Node 14+)
### Go
Download Go from the [Go Downloads Page](https://golang.org/dl/).
Ensure that you follow the official [Go installation instructions](https://golang.org/doc/install#install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
* Check Go is installed correctly: `go version`
* Check "~/go/bin" is in your PATH variable: `echo $PATH | grep go/bin`
### npm
Download NPM from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against.
Run `npm --version` to verify.
## Platform Specific Dependencies
You will also need to install platform specific dependencies:
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs
defaultValue="Windows"
values={[
{label: 'Windows', value: 'Windows'},
{label: 'MacOS', value: 'MacOS'},
{label: 'Linux', value: 'Linux'},
]}>
<TabItem value="MacOS">
Coming Soon...
</TabItem>
<TabItem value="Windows">
Wails requires that the <a href='https://developer.microsoft.com/en-us/microsoft-edge/webview2/'>WebView2</a> runtime is installed.
Some Windows installations will already have this installed. You can check using the `wails doctor` command (see below).
</TabItem>
<TabItem value="Linux">
Coming Soon...
</TabItem>
</Tabs>
## Optional Dependencies
- [UPX](https://upx.github.io/) for compressing your applications.
## Installing Wails
Run `go get github.com/wailsapp/wails/v2/cmd/wails` to install the Wails CLI.
## System Check
Running `wails doctor` will check if you have the correct dependencies installed. If not, it will advise on what is missing and help on how to rectify any problems.