Compare commits

...

5 Commits

Author SHA1 Message Date
Lea Anthony 1644ee152e v2.6.0 2023-09-06 19:45:08 +10:00
David Haukeness 069fe18b9d Move watcher init to doWatcherLoop and implement -reloaddirs (#2871)
* remove random print statement

* move watcher into loop and implement reloaddirs

* Fixed -reloaddirs for issue #2829

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-09-06 19:33:22 +10:00
Lea Anthony acf8dea170 [chore] Big tidy up. Fix bullet point output. 2023-09-06 19:27:29 +10:00
github-actions[bot] 7a87b0476e chore: update sponsors.svg (#2885)
Co-authored-by: leaanthony <leaanthony@users.noreply.github.com>
2023-09-06 19:16:31 +10:00
Andreas Christou 886bcc7b47 Add print functionality to v2 (#2822)
* Add print functionality to v2

* Update changelog

* Update runtime docs

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-09-06 07:55:36 +10:00
1106 changed files with 30760 additions and 43410 deletions
-177
View File
@@ -1,177 +0,0 @@
# Community Guide
The number of Wails users is growing at an incredible rate, and if you're reading this, chances are you're ready to join. So... welcome!
## Resources
### Code of Conduct
This [Code of Conduct](./coc) is an easy guide to develop the technical communities in which we participate.
### Stay in the Know
- Follow our [official Twitter account](https://twitter.com/wailsapp).
### Get Support
- [GitHub](https://github.com/wailsapp/wails) - If you have a bug to report or feature to request, that's what the GitHub issues are for. Please respect the rules specified in each repository's issue template.
- [Discord](https://discord.gg/JDdSxwjhGf) - A place for Wails devs to meet and chat in real time.
- [QQ Group(中文)](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - A Wails group for Chinese developers to communicate, where you can get help from other developers.
### Explore the Ecosystem
- [The Awesome Wails Page](https://github.com/wailsapp/awesome-wails) - See what other awesome resources have been published by other awesome people.
## Ways of contributing
Wails is an open source, community driven project. We welcome anyone to join us in
contributing to the project. This documentation is aimed at anyone wishing to get
familiar with the project and the development processes.
There are many ways to contribute to the project:
- Developing new features
- Fixing bugs
- Testing
- Documenting features
- Writing tutorials / guides
- Helping others on the issues + discussions boards
Guides for these have been created in their own sections. Before getting started,
please introduce yourself in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520)
discussion.
### Developing New Features
We are always keen to add features to Wails and expand on what the project can do.
The process for adding new features are as follows:
- Pick an enhancement ticket with the "TODO" label. It's preferable to select one from the current
[Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) but the choice is yours.
- Before developing, check that the ticket includes the following information:
- The purpose of the enhancement
- What is out of scope for the enhancement
- What platforms the enhancement targets (most features should be cross-platform unless there's a very specific reason)
- If the ticket does not include this information, feel free to request the information from the
person who opened the ticket. Sometimes placeholder tickets are created and require more details
- Comment on the ticket stating if you wish to develop the feature
- Clone the repository and create a branch with the format `feature/<ticket_number>_<ticket_title>`
- New features often require documentation so please ensure you have also added or updated the documentation as part of
the changes
- Once the feature is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and
test cases listed with checkmarks, so that others can know what still needs to be tested.
- Once all the testing is completed, please update the status of the PR from draft and leave a message.
:::note
There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all
enhancement requests are reviewed for good fit. Not all ideas will be selected, so it's best to have discussion
about the enhancement first.
:::
:::warning
Any PRs opened without a corresponding ticket may be rejected.
:::
### Fixing Bugs
The process for fixing bugs are as follows:
- Check the current [Backlog](https://github.com/orgs/wailsapp/projects/1/views/1) and select a bug to fix
- Before developing, check that the ticket includes the following information:
- The scope of the issue including platforms affected
- The steps to reproduce. Sometimes bugs are opened that are not Wails issues and the onus is on the reporter to
prove that it is a Wails issue with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)
- The output of `wails doctor`
- A test that can reproduce the bug
- If the ticket does not include this information, feel free to request the information from the
person who opened the ticket.
- Comment on the ticket stating you wish to develop a fix
- Clone the repository and create a branch with the format `bugfix/<ticket_number>_<ticket_title>`
- Once the fix is ready for testing, create a draft PR. Please ensure the PR description has the test scenarios and
test cases listed with checkmarks, so that others can know what still needs to be tested.
- Once all the testing is completed, please update the status of the PR from draft and leave a message.
:::note
There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all
bugfixes should be discussed as the approach may have unintended side effects.
:::
:::warning
Any PRs opened without a corresponding ticket may be rejected.
:::
### Testing
Testing is vitally important to ensure quality in the project. There are a couple of
scenarios where testing can really help the project:
- Testing if a bug is reproducible on your local system
- Testing PRs to ensure that they work correctly
If you chose to test if someone's bug report is reproducible on your local system, then
feel free to add a comment on the ticket confirming this with the output of `wails doctor`.
To test PRs, choose a PR to test and check if the PR description has the testing scenarios
listed. If not, please ask the person who opened the PR to provide that list. Once you have
determined a valid test scenario, please report your findings on the PR.
If you ever need more clarity or help on testing, please ask a question in the [Contributing to Wails](https://github.com/wailsapp/wails/discussions/1520)
discussion or on slack.
### Documenting
This website is also the main documentation site for the project. Sometimes this gets
out of date and needs some slight adjustments. Some of the documentation isn't written
to the best standards either. Developing documentation is hard and so any contribution
to this is greatly appreciated. Features without documentation are unfinished so to the
project, it's _as important_ as the code.
We generally do not create tickets for updating documentation so if there is text you
think should be updated or rephrased then feel free to submit a PR for that. This site
is in the main repository under the `website` directory. We use [Docusaurus](https://docusaurus.io/) to create
the site so there is plenty of existing documentation and tutorials around to get started.
To set up a local documentation development environment, do the following:
- [Install npm](https://docs.npmjs.com/cli/v8/configuring-npm/install)
- `cd website`
- `npm install`
- `npm run start`
After it has all installed and is running, you should see the site at [`http://localhost:3000`](http://localhost:3000).
Any changes made to the site text will be immediately reflected in the browser.
#### Versioning
We employ a versioning system where we have the "latest" documentation AKA "Next Version" which
has all the changes that have occurred since the last release. We also keep the last release
documentation as well as the version before that.
There isn't usually a reason to update released documentation so we don't generally update
the documents in the `versioned_docs` or `versioned_sidebars` directories.
The "next version" docs are mainly in `website/docs` with some "version independent" documents
in `src/pages`. Any updates should be made in the `website/docs` directory.
#### Languages
The default documents of the Wails project are English documents. We use the "crowdin" tool to translate documents in other languages and synchronize them to the website. You can [join our project](https://crowdin.com/project/wails) and submit your translations to make contributions.
##### Add new language
If you want to add a new language to the documentation, please follow the prompts to [fill in and submit an Issue](https://github.com/wailsapp/wails/issues/new?assignees=&labels=documentation&template=documentation.yml). After being confirmed by the maintainer, we will add the language to the "crowdin" and you will then be able to submit your translation.
### Helping Others
A great way to contribute to the project is to help others who are experiencing difficulty.
This is normally reported as a ticket or a message on the Wails discord server. Even just
clarifying the issue can really help out. Sometimes, when an issue is discussed and gets
resolved, we create a guide out of it to help others who face the same issues.
To join the Wails discord server, click [here](https://discord.gg/JDdSxwjhGf).
:::note
Work In Progress
:::
@@ -1,29 +0,0 @@
# Contributing
## Introduction
Wails is a community project, and we welcome contributions from anyone. This document outlines the process for contributing to Wails.
## Ways of contributing
We welcome anyone to join us in contributing to the project. This documentation is aimed at anyone wishing to get
familiar with the project and the development processes.
There are many ways to contribute to the project:
- Developing new features
- Fixing bugs
- Testing
- Documenting features
- Writing tutorials / guides
- Helping others on the issues + discussions boards
- Improving the documentation
### Getting started
To get started, clone the project repository:
```shell
wails3 contribute
```
@@ -1,19 +0,0 @@
# 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:
```mdx-code-block
<div class="text--center">
<img
src={require("@site/static/img/defaultproject.webp").default}
width="50%"
class="screenshot"
/>
</div>
<br />
```
For more details on compilation options, please refer to the [CLI Reference](../reference/cli.mdx#build).
@@ -1,12 +0,0 @@
# 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
- Bind your Go code to the frontend so it can be called from JavaScript
- Using the power of [Vite](https://vitejs.dev/), will 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](../reference/cli.mdx#dev).
Coming soon: Tutorial
@@ -1,72 +0,0 @@
# Installation
To install the Wails CLI, ensure you have [Go 1.21+](https://go.dev/dl/) installed and run:
```shell
go install github.com/wailsapp/wails/v3/cmd/wails3@latest
```
## Supported Platforms
- Windows 10/11 AMD64/ARM64
- MacOS 10.13+ AMD64
- MacOS 11.0+ ARM64
- Linux AMD64/ARM64
## Dependencies
Wails has a number of common dependencies that are required before installation:
=== "Go 1.21+"
Download Go from the [Go Downloads Page](https://go.dev/dl/).
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/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 (Node 18+)"
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.
=== "Task (Optional)"
The Wails CLI embeds a task runner called [Task](https://taskfile.dev/#/installation). It is optional, but recommended. If you do not wish to install Task, you can use the `wails3 task` command instead of `task`.
Installing Task will give you the greatest flexibility.
## Platform Specific Dependencies
You will also need to install platform specific dependencies:
=== "Mac"
Wails requires that the xcode command line tools are installed. This can be
done by running:
```
xcode-select --install
```
=== "Windows"
Wails requires that the [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/) is installed. Some Windows installations will already have this installed. You can check using the `wails doctor` command.
=== "Linux"
Linux requires the standard `gcc` build tools plus `libgtk3` and `libwebkit`. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run <code>wails doctor</code> after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please consult [this guide](/guides/linux-distro-support).
## System Check
Running `wails3 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.
## The `wails3` command appears to be missing?
If your system is reporting that the `wails3` command is missing, check the following:
- Make sure you have followed the Go installation guide correctly.
- Check that the `go/bin` directory is in the `PATH` environment variable.
- Close/Reopen current terminals to pick up the new `PATH` variable.
@@ -1,228 +0,0 @@
# Application Development
There are no hard and fast rules for developing applications with Wails, but there are some basic guidelines.
## Application Setup
The pattern used by the default templates are that `main.go` is used for configuring and running the application, whilst
`app.go` is used for defining the application logic.
The `app.go` file will define a struct that has 2 methods which act as hooks into the main application:
```go title="app.go"
type App struct {
ctx context.Context
}
func NewApp() *App {
return &App{}
}
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
func (a *App) shutdown(ctx context.Context) {
}
```
- The startup method is called as soon as Wails allocates the resources it needs and is a good place for creating resources,
setting up event listeners and anything else the application needs at startup.
It is given a `context.Context` which is usually saved in a struct field. This context is needed for calling the
[runtime](../reference/runtime/intro.mdx). If this method returns an error, the application will terminate.
In dev mode, the error will be output to the console.
- The shutdown method will be called by Wails right at the end of the shutdown process. This is a good place to deallocate
memory and perform any shutdown tasks.
The `main.go` file generally consists of a single call to `wails.Run()`, which accepts the application configuration.
The pattern used by the templates is that before the call to `wails.Run()`, an instance of the struct we defined in
`app.go` is created and saved in a variable called `app`. This configuration is where we add our callbacks:
```go {3,9,10} title="main.go"
func main() {
app := NewApp()
err := wails.Run(&options.App{
Title: "My App",
Width: 800,
Height: 600,
OnStartup: app.startup,
OnShutdown: app.shutdown,
})
if err != nil {
log.Fatal(err)
}
}
```
More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks).
## Binding Methods
It is likely that you will want to call Go methods from the frontend. This is normally done by adding public methods to
the already defined struct in `app.go`:
```go {16-18} title="app.go"
type App struct {
ctx context.Context
}
func NewApp() *App {
return &App{}
}
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
func (a *App) shutdown(ctx context.Context) {
}
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s!", name)
}
```
In the main application configuration, the `Bind` key is where we can tell Wails what we want to bind:
```go {11-13} title="main.go"
func main() {
app := NewApp()
err := wails.Run(&options.App{
Title: "My App",
Width: 800,
Height: 600,
OnStartup: app.startup,
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}
```
This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods).
### Dealing with context when binding multiple structs
If you want to bind methods for multiple structs but want each struct to keep a reference to the context so that you
can use the runtime functions, a good pattern is to pass the context from the `OnStartup` method to your struct instances
:
```go
func main() {
app := NewApp()
otherStruct := NewOtherStruct()
err := wails.Run(&options.App{
Title: "My App",
Width: 800,
Height: 600,
OnStartup: func(ctx context.Context){
app.SetContext(ctx)
otherStruct.SetContext(ctx)
},
OnShutdown: app.shutdown,
Bind: []interface{}{
app,
otherStruct
},
})
if err != nil {
log.Fatal(err)
}
}
```
More information on Binding can be found [here](../howdoesitwork.mdx#method-binding).
## Application Menu
Wails supports adding a menu to your application. This is done by passing a [Menu](../reference/menus.mdx#menu) struct
to application config. It's common to use a method that returns a Menu, and even more common for that to be a method on
the `App` struct used for the lifecycle hooks.
```go {11} title="main.go"
func main() {
app := NewApp()
err := wails.Run(&options.App{
Title: "My App",
Width: 800,
Height: 600,
OnStartup: app.startup,
OnShutdown: app.shutdown,
Menu: app.menu(),
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}
```
## Assets
The great thing about the way Wails v2 handles assets is that it doesn't! The only thing you need to give Wails is an
`embed.FS`. How you get to that is entirely up to you. You can use vanilla html/css/js files like the vanilla template.
You could have some complicated build system, it doesn't matter.
When `wails build` is run, it will check the `wails.json` project file at the project root. There are 2 keys in the
project file that are read:
- "frontend:install"
- "frontend:build"
The first, if given, will be executed in the `frontend` directory to install the node modules.
The second, if given, will be executed in the `frontend` directory to build the frontend project.
If these 2 keys aren't given, then Wails does absolutely nothing with the frontend. It is only expecting that `embed.FS`.
### AssetsHandler
A Wails v2 app can optionally define a `http.Handler` in the `options.App`, which allows hooking into the AssetServer to
create files on the fly or process POST/PUT requests.
GET requests are always first handled by the `assets` FS. If the FS doesn't find the requested file the request will be
forwarded to the `http.Handler` for serving. Any requests other than GET will be directly processed by the `AssetsHandler`
if specified.
It's also possible to only use the `AssetsHandler` by specifiy `nil` as the `Assets` option.
## Built in Dev Server
Running `wails dev` will start the built in dev server which will start a file watcher in your project directory. By
default, if any file changes, wails checks if it was an application file (default: `.go`, configurable with `-e` flag).
If it was, then it will rebuild your application and relaunch it. If the changed file was in the assets,
it will issue a reload after a short amount of time.
The dev server uses a technique called "debouncing" which means it doesn't reload straight away,
as there may be multiple files changed in a short amount of time. When a trigger occurs, it waits for a set amount of time
before issuing a reload. If another trigger happens, it resets to the wait time again. By default this value is `100ms`.
If this value doesn't work for your project, it can be configured using the `-debounce` flag. If used, this value will
be saved to your project config and become the default.
## External Dev Server
Some frameworks come with their own live-reloading server, however they will not be able to take advantage of the Wails
Go bindings. In this scenario, it is best to run a watcher script that rebuilds the project into the build directory, which
Wails will be watching. For an example, see the default svelte template that uses [rollup](https://rollupjs.org/guide/en/).
For [create-react-app](https://create-react-app.dev/), it's possible to use
[this script](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd) to achieve a similar result.
## Go Module
The default Wails templates generate a `go.mod` file that contains the module name "changeme". You should change this
to something more appropriate after project generation.
-5
View File
@@ -1,5 +0,0 @@
---
template: home.html
---
Welcome to The Wails Project
-90
View File
@@ -1,90 +0,0 @@
# Introduction
Wails is a project that enables you to write desktop apps using Go and web technologies.
Consider it a lightweight and fast Electron alternative for Go. You can easily build applications with the flexibility
and power of Go, combined with a rich, modern frontend.
### Features
- Native Menus, Dialogs, Theming and Translucency
- Windows, macOS and linux support
- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS
- Easily call Go methods from JavaScript
- Automatic Go struct to TypeScript model generation
- No CGO or external DLLs required on Windows
- Live development mode using the power of [Vite](https://vitejs.dev/)
- Powerful CLI to easily Create, Build and Package applications
- A rich [runtime library](/docs/reference/runtime/intro)
- Applications built with Wails are Apple & Microsoft Store compliant
This is [varly](https://varly.app) - a desktop application for
MacOS & Windows written using Wails. Not only does it look great, it uses native menus and translucency - everything
you'd expect from a modern native app.
```mdx-code-block
<p class="text--center">
<a href="https://varly.app/">
<img
src={require("@site/static/img/showcase/varly2.webp").default}
style={{ width: "75%", "max-width": "800px" }}
/>
</a>
</p>
```
### Quick Start Templates
Wails comes with a number of pre-configured templates that allow you to get your application up and running quickly.
There are templates for the following frameworks: Svelte, React, Vue, Preact, Lit and Vanilla. There are both JavaScript
and TypeScript versions for each template.
### Native Elements
Wails uses a purpose built library for handling native elements such as Window, Menus, Dialogs, etc, so you can build
good-looking, feature rich desktop applications.
**It does not embed a browser**, so it is resource efficient. Instead, it uses the native rendering engine for the
platform. On Windows, this is the new Microsoft Webview2 library, built on Chromium.
### Go & JavaScript Interoperability
Wails automatically makes your Go methods available to JavaScript, so you can call them by name from your frontend!
It even generates TypeScript models for the structs used by your Go methods, so you can pass the same data structures
between Go and JavaScript.
### Runtime Library
Wails provides a runtime library, for both Go and JavaScript, that handles a lot of the things modern applications need,
like Eventing, Logging, Dialogs, etc.
### Live Development Experience
#### Automatic Rebuilds
When you run your application in "dev" mode, Wails will build your application as a native desktop application, but will
read your assets from disk. It will detect any changes to your Go code and automatically rebuild and relaunch your
application.
#### Automatic Reloads
When changes to your application assets are detected, your running application will "reload", reflecting your changes
almost immediately.
#### Develop your application in a Browser
If you prefer to debug and develop in a browser then Wails has you covered. The running application also has a webserver
that will run your application in any browser that connects to it. It will even refresh when your assets change on disk.
### Production-ready Native Binaries
When you're ready to do the final build of your application, the CLI will compile it down to a single executable, with
all the assets bundled into it. On Windows and MacOS, it is possible to create a native package for distribution. The
assets used in packaging (icon, info.plist, manifest file, etc) are part of your project and may be customised, giving
you total control over how your applications are built.
### Tooling
The Wails CLI provides a hassle-free way to generate, build and bundle your applications. It will do the heavy lifting
of creating icons, compiling your application with optimal settings and delivering a distributable, production ready
binary. Choose from a number of starter templates to get up and running quickly!
@@ -1,100 +0,0 @@
---
sidebar_position: 1
---
# Introduction
The runtime is a library that provides utility methods for your application. There is both a Go and JavaScript runtime
and the aim is to try and keep them at parity where possible.
It has utility methods for:
- [Window](window.mdx)
- [Menu](menu.mdx)
- [Dialog](dialog.mdx)
- [Events](events.mdx)
- [Browser](browser.mdx)
- [Log](log.mdx)
- [Clipboard](clipboard.mdx)
The Go Runtime is available through importing `github.com/wailsapp/wails/v2/pkg/runtime`. All methods in this package
take a context as the first parameter. This context should be obtained from the [OnStartup](../options.mdx#onstartup)
or [OnDomReady](../options.mdx#ondomready) hooks.
:::info Note
Whilst the context will be provided to the
[OnStartup](../options.mdx#onstartup) method, there's no guarantee the runtime will work in this method as
the window is initialising in a different thread. If
you wish to call runtime methods at startup, use [OnDomReady](../options.mdx#ondomready).
:::
The JavaScript library is available to the frontend via the `window.runtime` map. There is a runtime package generated when using `dev`
mode that provides TypeScript declarations for the runtime. This should be located in the `wailsjs` directory in your
frontend directory.
### Hide
Go: `Hide(ctx context.Context)`<br/>
JS: `Hide()`
Hides the application.
:::info Note
On Mac, this will hide the application in the same way as the `Hide` menu item in standard Mac applications.
This is different to hiding the window, but the application still being in the foreground.
For Windows and Linux, this is currently the same as `WindowHide`.
:::
### Show
Shows the application.
:::info Note
On Mac, this will bring the application back into the foreground.
For Windows and Linux, this is currently the same as `WindowShow`.
:::
Go: `Show(ctx context.Context)`<br/>
JS: `Show()`
### Quit
Quits the application.
Go: `Quit(ctx context.Context)`<br/>
JS: `Quit()`
### Environment
Returns details of the current environment.
Go: `Environment(ctx context.Context) EnvironmentInfo`<br/>
JS: `Environment(): Promise<EnvironmentInfo>`
#### EnvironmentInfo
Go:
```go
type EnvironmentInfo struct {
BuildType string
Platform string
Arch string
}
```
JS:
```ts
interface EnvironmentInfo {
buildType: string;
platform: string;
arch: string;
}
```
-17
View File
@@ -1,17 +0,0 @@
[data-md-color-scheme="slate"] {
--md-hue: 208;
--md-primary-fg-color--light: #ECB7B7;
--md-primary-fg-color--dark: #90030C;
--md-accent-fg-color: #ff4646;
--md-primary-fg-color: #2a2a2a;
--md-default-bg-color: #232323;
--md-footer-bg-color--dark: #2a2a2a;
}
.md-header__button.md-logo img, .md-header__button.md-logo svg {
fill: currentcolor;
display: block;
height: 2rem;
width: auto;
}
-93
View File
@@ -1,93 +0,0 @@
site_name: ""
site_description: The Wails Project - Build beautiful cross-platform applications using Go
theme:
name: material
custom_dir: overrides
logo: assets/images/wails-logo-horizontal-dark.svg
favicon: assets/images/favicon.svg
features:
- navigation.tabs
- navigation.sections
- navigation.expand
- navigation.instant
- navigation.top
- toc.integrate
- toc.follow
- search.suggest
- search.highlight
- content.tabs.link
- content.tabs.annotation
- content.tabs.copy
- content.code.copy
language: en
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode
extra:
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/wailsapp/wails
- icon: fontawesome/brands/twitter
link: https://twitter.com/wailsapp
- icon: fontawesome/brands/discord
link: https://discord.gg/JDdSxwjhGf
extra_css:
- stylesheets/extra.css
nav:
- Home: index.md
- Getting started:
# - Introduction: introduction.md
- Installation: getting-started/installation.md
# - Creating a Project: getting-started/creating-a-project.md
# - How does it work: how-does-it-work.md
# - Developing your Application: getting-started/developing-your-application.md
# - Compiling your Project: getting-started/compiling-your-project.md
# - API Reference:
# - Runtime:
# - Introduction: reference/runtime/introduction.md
# - CLI: reference/cli.md
# - Community:
# - Template: community/templates.md
# - Guides:
# - Angular: guides/angular.md
# - Showcase:
# - Emaillit: community/showcase/emailit.md
- Contributing: community/contributing.md
# - Links: community/links.md
markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.details
- pymdownx.superfences
- pymdownx.mark
- attr_list
- admonition
- footnotes
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
copyright:
Copyright © 2023 Lea Anthony
Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1" viewBox="0 0 180 167" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><g><path d="M196,19.285C196,14.712 192.095,11 187.286,11L27.714,11C22.905,11 19,14.712 19,19.285L19,158.715C19,163.288 22.905,167 27.714,167L187.286,167C192.095,167 196,163.288 196,158.715L196,19.285Z" transform="matrix(1.00565,0,0,1.05769,-18.1073,-10.6346)" style="fill:#fff"/></g><g><path d="M0,-51.891L14.429,-51.891L13.043,-21.183L22.568,-51.891L34.226,-51.891L34.084,-21.183L42.365,-51.891L56.794,-51.891L38.526,0L25.198,0L25.34,-32.45L15.211,0L1.919,0L0,-51.891Z" transform="matrix(2.51258,0,0,2.51258,20.0103,151.138)" style="fill-rule:nonzero"/></g></svg>

Before

Width:  |  Height:  |  Size: 774 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.4 KiB

-103
View File
@@ -1,103 +0,0 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "main.html" %}
<!-- Render hero under tabs -->
{% block tabs %}
{{ super() }}
<!-- Additional styles for landing page -->
<style>
/* Application header should be static for the landing page */
.md-header {
position: initial;
}
/* Remove spacing, as we cannot hide it completely */
.md-main__inner {
margin: 0;
}
/* Hide main content for now */
.md-content {
display: none;
}
/* Hide table of contents */
@media screen and (min-width: 60em) {
.md-sidebar--secondary {
display: none;
}
}
/* Hide navigation */
@media screen and (min-width: 76.25em) {
.md-sidebar--primary {
display: none;
}
}
</style>
<!-- Hero for landing page -->
<section class="mdx-container">
<div class="md-grid md-typeset">
<div class="mdx-hero">
<!-- Hero content -->
<div class="mdx-hero__content">
<br/>
<br/>
<div style="text-align: center">
This is the Wails v3 Alpha website.
This site will be updated as we progress through the alpha and beta releases.<br/><br/>
Please feel free to raise PRs against this website. Every single PR helps us get closer to a release.<br/><br/>
Thank you for sharing this journey with us.<br/><br/>
<br/>
<a
href="{{ page.next_page.url | url }}"
title="{{ page.next_page.title | e }}"
class="md-button md-button--primary"
>
Get started
</a>
</div>
<!-- <a-->
<!-- href="{{ 'introduction' | url }}"-->
<!-- title="Material for MkDocs Insiders"-->
<!-- class="md-button"-->
<!-- >-->
<!-- Learn more-->
<!-- </a>-->
</div>
</div>
</div>
</section>
{% endblock %}
<!-- Content -->
{% block content %}{% endblock %}
<!-- Application footer -->
{% block footer %}{% endblock %}
-31
View File
@@ -1,31 +0,0 @@
<!--
Copyright (c) 2016-2023 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% extends "base.html" %}
<!-- Theme-related JavaScript -->
{% block scripts %}
{{ super() }}
<!-- Extra JavaScript (can't be set in mkdocs.yml due to content hash) -->
<script src="{{ 'assets/javascripts/custom.js' | url }}"></script>
{% endblock %}
+1
View File
@@ -4,6 +4,7 @@ version: "3"
tasks:
release:
summary: Release a new version of Task. Call with `task v2:release -- <version>`
dir: tools/release
cmds:
- go run release.go {{.CLI_ARGS}}
+29 -17
View File
@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
@@ -138,20 +139,6 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
}
}
// create the project files watcher
watcher, err := initialiseWatcher(cwd)
if err != nil {
return err
}
defer func(watcher *fsnotify.Watcher) {
err := watcher.Close()
if err != nil {
logger.Fatal(err.Error())
}
}(watcher)
logutils.LogGreen("Watching (sub)/directory: %s", cwd)
logutils.LogGreen("Using DevServer URL: %s", f.DevServerURL())
if f.FrontendDevServerURL != "" {
logutils.LogGreen("Using Frontend DevServer URL: %s", f.FrontendDevServerURL)
@@ -165,7 +152,10 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
}()
// Watch for changes and trigger restartApp()
debugBinaryProcess = doWatcherLoop(buildOptions, debugBinaryProcess, f, watcher, exitCodeChannel, quitChannel, f.DevServerURL(), legacyUseDevServerInsteadofCustomScheme)
debugBinaryProcess, err = doWatcherLoop(cwd, buildOptions, debugBinaryProcess, f, exitCodeChannel, quitChannel, f.DevServerURL(), legacyUseDevServerInsteadofCustomScheme)
if err != nil {
return err
}
// Kill the current program if running and remove dev binary
if err := killProcessAndCleanupBinary(debugBinaryProcess, appBinary); err != nil {
@@ -337,7 +327,23 @@ func restartApp(buildOptions *build.Options, debugBinaryProcess *process.Process
}
// doWatcherLoop is the main watch loop that runs while dev is active
func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, watcher *fsnotify.Watcher, exitCodeChannel chan int, quitChannel chan os.Signal, devServerURL *url.URL, legacyUseDevServerInsteadofCustomScheme bool) *process.Process {
func doWatcherLoop(cwd string, buildOptions *build.Options, debugBinaryProcess *process.Process, f *flags.Dev, exitCodeChannel chan int, quitChannel chan os.Signal, devServerURL *url.URL, legacyUseDevServerInsteadofCustomScheme bool) (*process.Process, error) {
// create the project files watcher
watcher, err := initialiseWatcher(cwd)
if err != nil {
logutils.LogRed("Unable to create filesystem watcher. Reloads will not occur.")
return nil, err
}
defer func(watcher *fsnotify.Watcher) {
err := watcher.Close()
if err != nil {
log.Fatal(err.Error())
}
}(watcher)
logutils.LogGreen("Watching (sub)/directory: %s", cwd)
// Main Loop
var extensionsThatTriggerARebuild = sliceToMap(strings.Split(f.Extensions, ","))
var dirsThatTriggerAReload []string
@@ -351,6 +357,12 @@ func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Proc
continue
}
dirsThatTriggerAReload = append(dirsThatTriggerAReload, thePath)
err = watcher.Add(thePath)
if err != nil {
logutils.LogRed("Unable to watch path: %s due to error %v", thePath, err)
} else {
logutils.LogGreen("Watching (sub)/directory: %s", thePath)
}
}
quit := false
@@ -499,7 +511,7 @@ func doWatcherLoop(buildOptions *build.Options, debugBinaryProcess *process.Proc
quit = true
}
}
return debugBinaryProcess
return debugBinaryProcess, nil
}
func joinPath(url *url.URL, subPath string) string {
-1
View File
@@ -38,7 +38,6 @@ func initialiseWatcher(cwd string) (*fsnotify.Watcher, error) {
if err != nil {
return nil, err
}
println("watching: " + dir)
}
return watcher, nil
}

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