mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
Compare commits
102 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a632ac5068 | |||
| e3af0945d0 | |||
| 975c55a3d5 | |||
| c3d57d05c3 | |||
| e9cc68fe3a | |||
| 5d9fe49cf9 | |||
| fd3d1801ed | |||
| f517c8b980 | |||
| 73b547a730 | |||
| 6a8322cdb5 | |||
| 07fc8e3707 | |||
| 4cbc7f3eec | |||
| a1f067377f | |||
| 3c5d850a30 | |||
| 92c9f546eb | |||
| 7d14a75ff3 | |||
| 5547792b68 | |||
| b2839ed719 | |||
| 674042df36 | |||
| b9de31e38e | |||
| 929dfb4123 | |||
| 11fdc6a558 | |||
| 801cf3c84a | |||
| 4efc8e358d | |||
| 9ce0ddb4f8 | |||
| d88a741ce7 | |||
| c76ced7daa | |||
| fc46455526 | |||
| 70b7aa1ec2 | |||
| 03545e33d9 | |||
| e32c2b05e4 | |||
| 57c04ba740 | |||
| 426a569c89 | |||
| 08e12de2a0 | |||
| 0a63215cde | |||
| ae688aa07d | |||
| e960798e85 | |||
| 93335d7661 | |||
| d96ec5d332 | |||
| 0533d2e208 | |||
| b328f60172 | |||
| ac560a6526 | |||
| 2693de6822 | |||
| 3c39b674d3 | |||
| afe922a4e3 | |||
| c24bd5e3e8 | |||
| a59f8b2cf3 | |||
| 30d17a760d | |||
| 6c46f6b41c | |||
| 42708e7f40 | |||
| 63c9baa466 | |||
| ee4ce1d3ef | |||
| a9fb0713a1 | |||
| b42a18be6b | |||
| 3e938a10aa | |||
| b9fc72bbc8 | |||
| b5406cb13e | |||
| d51268b8d0 | |||
| 4b376bcf0d | |||
| 8efa4698cf | |||
| 45c6f73132 | |||
| d4500e89e2 | |||
| 7637833898 | |||
| a774459cd7 | |||
| 90c9186dc6 | |||
| 79db5a4657 | |||
| 4257decf30 | |||
| 1f4b578bce | |||
| d0b0b5d594 | |||
| c0d2c0447c | |||
| f6c82dcaba | |||
| 1c9765096d | |||
| 18ee469c47 | |||
| e31ad83472 | |||
| 3f9067c815 | |||
| ab0b0f8a7f | |||
| 6d1489bf8e | |||
| 05eddc65b1 | |||
| 787ca80770 | |||
| d228b2ad37 | |||
| e9519269ca | |||
| 5a7b868e80 | |||
| d370f72ede | |||
| 3369327ad2 | |||
| eca6afc18c | |||
| 34c725231c | |||
| db519de1cd | |||
| 6aa6762f12 | |||
| 64e44b1b51 | |||
| 3116c1a622 | |||
| c26f3ad7d1 | |||
| 40f645a864 | |||
| a419721dcd | |||
| e731e2591a | |||
| 59b25edb5c | |||
| 647bc87600 | |||
| ebf56f6585 | |||
| 1644ee152e | |||
| 069fe18b9d | |||
| acf8dea170 | |||
| 7a87b0476e | |||
| 886bcc7b47 |
@@ -2,7 +2,7 @@ name: Build + Test v2
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [release/*, master]
|
||||
branches: [release/*, master, bugfix/*]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -12,31 +12,32 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: [1.18, 1.19]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-11]
|
||||
go-version: ['1.20']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache-dependency-path: ./v2/go.sum
|
||||
|
||||
- name: Run tests (mac)
|
||||
if: matrix.os == 'macos-latest'
|
||||
if: matrix.os == 'macos-latest' || matrix.os == 'macos-11'
|
||||
env:
|
||||
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
- name: Run tests (!mac)
|
||||
if: matrix.os != 'macos-latest'
|
||||
if: matrix.os != 'macos-latest' && matrix.os != 'macos-11'
|
||||
working-directory: ./v2
|
||||
run: go test -v ./...
|
||||
|
||||
@@ -50,7 +51,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
@@ -89,15 +90,16 @@ jobs:
|
||||
vanilla-ts,
|
||||
plain,
|
||||
]
|
||||
go-version: [1.18, 1.19]
|
||||
go-version: ['1.20']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
cache-dependency-path: ./v2/go.sum
|
||||
|
||||
- name: Build Wails CLI
|
||||
run: |
|
||||
|
||||
@@ -26,6 +26,29 @@ jobs:
|
||||
run: |
|
||||
echo "::warning::Feature branch does not contain any changes to the website."
|
||||
|
||||
# lint_go:
|
||||
# name: Run Go Linters
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4
|
||||
#
|
||||
# - name: Setup Go
|
||||
# uses: actions/setup-go@v4
|
||||
# with:
|
||||
# go-version: "1.21"
|
||||
#
|
||||
# - name: Update go modules
|
||||
# working-directory: ./v2
|
||||
# run: go mod tidy
|
||||
#
|
||||
# - name: Run Linter
|
||||
# uses: golangci/golangci-lint-action@v3
|
||||
# with:
|
||||
# version: v1.54
|
||||
# working-directory: ./v2
|
||||
# args: --timeout=10m0s --config ./.golangci.yml
|
||||
|
||||
test_go:
|
||||
name: Run Go Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -33,7 +56,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
go-version: [1.18, 1.19]
|
||||
go-version: [1.19]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
pull_request: {}
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths:
|
||||
- .github/workflows/semgrep.yml
|
||||
schedule:
|
||||
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
|
||||
- cron: 14 16 * * *
|
||||
name: Semgrep
|
||||
jobs:
|
||||
semgrep:
|
||||
name: semgrep/ci
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
||||
container:
|
||||
image: returntocorp/semgrep
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: semgrep ci
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
<p align="center" style="text-align: center">
|
||||
<img src="./assets/images/logo-universal.png" width="55%"><br/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Créer des applications de bureau avec Go et les technologies Web.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE">
|
||||
<img alt="GitHub" src="https://img.shields.io/github/license/wailsapp/wails"/>
|
||||
</a>
|
||||
<a href="https://goreportcard.com/report/github.com/wailsapp/wails">
|
||||
<img src="https://goreportcard.com/badge/github.com/wailsapp/wails" />
|
||||
</a>
|
||||
<a href="https://pkg.go.dev/github.com/wailsapp/wails">
|
||||
<img src="https://pkg.go.dev/badge/github.com/wailsapp/wails.svg" alt="Go Reference"/>
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/issues">
|
||||
<img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" />
|
||||
</a>
|
||||
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status">
|
||||
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield" />
|
||||
</a>
|
||||
<a href="https://github.com/avelino/awesome-go" rel="nofollow">
|
||||
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome" />
|
||||
</a>
|
||||
<a href="https://discord.gg/BrRSWTaxVK">
|
||||
<img alt="Discord" src="https://dcbadge.vercel.app/api/server/BrRSWTaxVK?style=flat"/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://github.com/wailsapp/wails/actions/workflows/build-and-test.yml" rel="nofollow">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/wailsapp/wails/build-and-test.yml?branch=master&logo=Github" alt="Build" />
|
||||
</a>
|
||||
<a href="https://github.com/wailsapp/wails/tags" rel="nofollow">
|
||||
<img alt="GitHub tag (latest SemVer pre-release)" src="https://img.shields.io/github/v/tag/wailsapp/wails?include_prereleases&label=version"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
<strong>
|
||||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
## Sommaire
|
||||
|
||||
- [Sommaire](#sommaire)
|
||||
- [Introduction](#introduction)
|
||||
- [Fonctionnalités](#fonctionnalités)
|
||||
- [Feuille de route](#feuille-de-route)
|
||||
- [Démarrage](#démarrage)
|
||||
- [Les sponsors](#les-sponsors)
|
||||
- [Foire aux questions](#foire-aux-questions)
|
||||
- [Les étoiles au fil du temps](#les-étoiles-au-fil-du-temps)
|
||||
- [Les contributeurs](#les-contributeurs)
|
||||
- [License](#license)
|
||||
- [Inspiration](#inspiration)
|
||||
|
||||
## Introduction
|
||||
|
||||
La méthode traditionnelle pour fournir des interfaces web aux programmes Go consiste à utiliser un serveur web intégré. Wails propose une approche différente : il offre la possibilité d'intégrer à la fois le code Go et une interface web dans un seul binaire. Des outils sont fournis pour vous faciliter la tâche en gérant la création, la compilation et le regroupement des projets. Il ne vous reste plus qu'à faire preuve de créativité!
|
||||
|
||||
## Fonctionnalités
|
||||
|
||||
- Utiliser Go pour le backend
|
||||
- Utilisez n'importe quelle technologie frontend avec laquelle vous êtes déjà familier pour construire votre interface utilisateur.
|
||||
- Créez rapidement des interfaces riches pour vos programmes Go à l'aide de modèles prédéfinis.
|
||||
- Appeler facilement des méthodes Go à partir de Javascript
|
||||
- Définitions Typescript auto-générées pour vos structures et méthodes Go
|
||||
- Dialogues et menus natifs
|
||||
- Prise en charge native des modes sombre et clair
|
||||
- Prise en charge des effets modernes de translucidité et de "frosted window".
|
||||
- Système d'événements unifié entre Go et Javascript
|
||||
- Outil puissant pour générer et construire rapidement vos projets
|
||||
- Multiplateforme
|
||||
- Utilise des moteurs de rendu natifs - _pas de navigateur intégré_ !
|
||||
|
||||
### Feuille de route
|
||||
|
||||
La feuille de route du projet peut être consultée [ici](https://github.com/wailsapp/wails/discussions/1484). Veuillez consulter avant d'ouvrir une demande d'amélioration.
|
||||
|
||||
## Démarrage
|
||||
|
||||
Les instructions d'installation se trouvent sur le site [site officiel](https://wails.io/docs/gettingstarted/installation).
|
||||
|
||||
## Les sponsors
|
||||
|
||||
Ce projet est soutenu par ces personnes aimables et entreprises:
|
||||
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://wails.io/img/sponsor/jetbrains-grayscale.webp" style="width: 100px"/>
|
||||
</p>
|
||||
|
||||
## Foire aux questions
|
||||
|
||||
- S'agit-il d'une alternative à Electron ?
|
||||
|
||||
Cela dépend de vos besoins. Il est conçu pour permettre aux programmeurs Go de créer facilement des applications de bureau légères ou d'ajouter une interface à leurs applications existantes. Wails offre des éléments natifs tels que des menus et des boîtes de dialogue, il peut donc être considéré comme une alternative légère à electron.
|
||||
|
||||
- À qui s'adresse ce projet ?
|
||||
|
||||
Les programmeurs Go qui souhaitent intégrer une interface HTML/JS/CSS à leurs applications, sans avoir à créer un serveur et à ouvrir un navigateur pour l'afficher.
|
||||
|
||||
- Pourquoi ce nom ??
|
||||
|
||||
Lorsque j'ai vu WebView, je me suis dit : "Ce que je veux vraiment, c'est un outil pour construire une application WebView, un peu comme Rails l'est pour Ruby". Au départ, il s'agissait donc d'un jeu de mots (Webview on Rails). Il se trouve que c'est aussi un homophone du nom anglais du [Pays](https://en.wikipedia.org/wiki/Wales) d'où je viens. Il s'est donc imposé.
|
||||
|
||||
## Les étoiles au fil du temps
|
||||
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
|
||||
## Les contributeurs
|
||||
|
||||
La liste des contributeurs devient trop importante pour le readme ! Toutes les personnes extraordinaires qui ont contribué à ce projet ont leur propre page [ici](https://wails.io/credits#contributors).
|
||||
|
||||
## License
|
||||
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||
|
||||
## Inspiration
|
||||
|
||||
Ce projet a été principalement codé sur les albums suivants :
|
||||
|
||||
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
||||
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
||||
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
||||
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
||||
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
||||
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
||||
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
||||
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
||||
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
||||
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
||||
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
||||
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||
+19
-48
@@ -44,7 +44,7 @@
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
@@ -54,17 +54,16 @@
|
||||
|
||||
- [目次](#目次)
|
||||
- [はじめに](#はじめに)
|
||||
- [公式サイト](#公式サイト)
|
||||
- [ロードマップ](#ロードマップ)
|
||||
- [特徴](#特徴)
|
||||
- [スポンサー](#スポンサー)
|
||||
- [ロードマップ](#ロードマップ)
|
||||
- [始め方](#始め方)
|
||||
- [スポンサー](#スポンサー)
|
||||
- [FAQ](#faq)
|
||||
- [スター数の推移](#スター数の推移)
|
||||
- [コントリビューター](#コントリビューター)
|
||||
- [特記事項](#特記事項)
|
||||
- [スペシャルサンクス](#スペシャルサンクス)
|
||||
- [ライセンス](#ライセンス)
|
||||
- [インスピレーション](#インスピレーション)
|
||||
|
||||
|
||||
## はじめに
|
||||
|
||||
@@ -72,44 +71,35 @@ Go プログラムにウェブインタフェースを提供する従来の方
|
||||
Wails では Go のコードとウェブフロントエンドを単一のバイナリにまとめる機能を提供します。
|
||||
また、プロジェクトの作成、コンパイル、ビルドを行うためのツールが提供されています。あなたがすべきことは創造性を発揮することです!
|
||||
|
||||
### 公式サイト
|
||||
|
||||
Version 2:
|
||||
|
||||
Wails v2 が 3 つのプラットフォームでベータ版としてリリースされました。興味のある方は[新しいウェブサイト](https://wails.io)をご覧ください。
|
||||
|
||||
レガシー版 v1:
|
||||
|
||||
レガシー版 v1 のドキュメントは[https://wails.app](https://wails.app)で見ることができます。
|
||||
|
||||
### ロードマップ
|
||||
|
||||
プロジェクトのロードマップは[こちら](https://github.com/wailsapp/wails/discussions/1484)になります。
|
||||
機能拡張のリクエストを出す前にご覧ください。
|
||||
|
||||
## 特徴
|
||||
|
||||
- バックエンドには Go を利用しています
|
||||
- 使い慣れたフロントエンド技術を利用して UI を構築できます
|
||||
- あらかじめ用意されたテンプレートを利用することで、リッチなフロントエンドを備えた Go プログラムを作成できます
|
||||
- あらかじめ用意されたテンプレートを利用することで、リッチなフロントエンドを備えた Go プログラムを素早く作成できます
|
||||
- JavaScript から Go のメソッドを簡単に呼び出すことができます
|
||||
- あなたの書いた Go の構造体やメソットに応じた TypeScript の定義が自動生成されます
|
||||
- ネイティブのダイアログとメニューが利用できます
|
||||
- ネイティブなダーク/ライトモードをサポートします
|
||||
- モダンな半透明や「frosted window」エフェクトをサポートしています
|
||||
- Go と JavaScript 間で統一されたイベント・システムを備えています
|
||||
- プロジェクトを素早く生成して構築する強力な cli ツールを用意しています
|
||||
- マルチプラットフォームに対応しています
|
||||
- ネイティブなレンダリングエンジンを使用しています - _つまりブラウザを埋め込んでいるわけではありません!_
|
||||
|
||||
## スポンサー
|
||||
### ロードマップ
|
||||
|
||||
このプロジェクトは、以下の方々・企業によって支えられています。
|
||||
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
|
||||
プロジェクトのロードマップは[こちら](https://github.com/wailsapp/wails/discussions/1484)になります。
|
||||
機能拡張のリクエストを出す前にご覧ください。
|
||||
|
||||
## 始め方
|
||||
|
||||
インストール方法は[公式サイト](https://wails.io/docs/gettingstarted/installation)に掲載されています。
|
||||
|
||||
## スポンサー
|
||||
|
||||
このプロジェクトは、以下の方々・企業によって支えられています。
|
||||
<img src="website/static/img/sponsors.svg" style="width:100%;max-width:800px;"/>
|
||||
|
||||
## FAQ
|
||||
|
||||
- Electron の代替品になりますか?
|
||||
@@ -130,20 +120,18 @@ Wails v2 が 3 つのプラットフォームでベータ版としてリリー
|
||||
|
||||
## スター数の推移
|
||||
|
||||
[](https://starchart.cc/wailsapp/wails)
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
|
||||
## コントリビューター
|
||||
|
||||
貢献してくれた方のリストが大きくなりすぎて、readme に入りきらなくなりました!
|
||||
このプロジェクトに貢献してくれた素晴らしい方々のページは[こちら](https://wails.io/credits#contributors)です。
|
||||
|
||||
## 特記事項
|
||||
## ライセンス
|
||||
|
||||
このプロジェクトは以下の方々の協力がなければ、実現しなかったと思います。
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||
|
||||
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - 彼のサポートとフィードバックはとても大きいものでした。
|
||||
- [Serge Zaitsev](https://github.com/zserge) - Wails のウィンドウで使用している[Webview](https://github.com/zserge/webview)の作者です。
|
||||
- [Byron](https://github.com/bh90210) - 時には Byron が一人でこのプロジェクトを存続させてくれたこともありました。彼の素晴らしいインプットがなければ v1 に到達することはなかったでしょう。
|
||||
## インスピレーション
|
||||
|
||||
プロジェクトを進める際に、以下のアルバムたちも支えてくれています。
|
||||
|
||||
@@ -161,20 +149,3 @@ Wails v2 が 3 つのプラットフォームでベータ版としてリリー
|
||||
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||
|
||||
## スペシャルサンクス
|
||||
|
||||
<p align="center" style="text-align: center">
|
||||
<a href="https://pace.dev"><img src="/assets/images/pace.jpeg"/></a><br/>
|
||||
このプロジェクトを後援し、WailsをApple Siliconに移植する取り組みを支援してくれた <a href="https://pace.dev">Pace</a> に <i>とても</i>感謝しています!<br/><br/>
|
||||
パワフルで素早く簡単に使えるプロジェクト管理ツールをお探しなら、ぜひチェックしてみてください!<br/><br/>
|
||||
</p>
|
||||
|
||||
<p align="center" style="text-align: center">
|
||||
ライセンスを提供していただいたJetBrains社に感謝します!<br/><br/>
|
||||
ロゴをクリックして、感謝の気持ちを伝えてください!<br/><br/>
|
||||
<a href="https://www.jetbrains.com?from=Wails"><img src="/assets/images/jetbrains-grayscale.png" width="30%"></a>
|
||||
</p>
|
||||
|
||||
## ライセンス
|
||||
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
@@ -122,7 +122,13 @@ This project is supported by these kind people / companies:
|
||||
|
||||
## Stargazers over time
|
||||
|
||||
[](https://star-history.com/#wailsapp/wails&Date)
|
||||
<a href="https://star-history.com/#wailsapp/wails&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=wailsapp/wails&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md)
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@
|
||||
<samp>
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md)
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
@@ -52,7 +52,7 @@
|
||||
- [Содержание](#содержание)
|
||||
- [Вступление](#вступление)
|
||||
- [Особенности](#особенности)
|
||||
- [Roadmap](#roadmap)
|
||||
- [Roadmap](#roadmap)
|
||||
- [Быстрый старт](#быстрый-старт)
|
||||
- [Спонсоры](#спонсоры)
|
||||
- [FAQ](#faq)
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
|
||||
[English](README.md) · [简体中文](README.zh-Hans.md) · [日本語](README.ja.md) ·
|
||||
[한국어](README.ko.md) · [Español](README.es.md) · [Português](README.pt-br.md) ·
|
||||
[Русский](README.ru.md)
|
||||
[Русский](README.ru.md) · [Francais](README.fr.md)
|
||||
|
||||
</samp>
|
||||
</strong>
|
||||
|
||||
@@ -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,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.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
template: home.html
|
||||
---
|
||||
|
||||
Welcome to The Wails Project
|
||||
@@ -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;
|
||||
}
|
||||
```
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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 |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user