mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 22:13:36 +08:00
docs: fix and sync documents (#2140)
This commit is contained in:
parent
ea6aee91f1
commit
bd66451dd9
@ -12,7 +12,7 @@
|
||||
"message": "Utilisez les technologies que vous connaissez déjà pour construire des applications étonnantes."
|
||||
},
|
||||
"homepage.Features.Title3": {
|
||||
"message": "Fast"
|
||||
"message": "Rapide"
|
||||
},
|
||||
"homepage.Features.Description3": {
|
||||
"message": "Générez, construisez et empaquetez rapidement vos projets en utilisant le CLI Wails."
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
Partage de fichiers facile, sécurisé et gratuit pour tout le monde. Apprenez-en plus sur [Riftshare.app](https://riftshare.app)
|
||||
|
||||
## Features
|
||||
## Fonctionnalités
|
||||
|
||||
- Partage facile et sécurisé de fichiers entre ordinateurs à la fois sur le réseau local et via Internet
|
||||
- Supporte l'envoi de fichiers ou de répertoires de manière sécurisée par le protocole [magic wormhole](https://magic-wormhole.readthedocs.io/en/latest/)
|
||||
|
@ -2,11 +2,11 @@
|
||||
sidebar_position: 6
|
||||
---
|
||||
|
||||
# Compiling your Project
|
||||
# Compiler votre projet
|
||||
|
||||
From the project directory, run `wails build`. This will compile your project and save the production-ready binary in the `build/bin` directory.
|
||||
À partir du répertoire du projet, exécutez `wails build`. Cela compilera votre projet et sauvegardera le binaire prêt à la production dans le répertoire `build/bin`.
|
||||
|
||||
If you run the binary, you should see the default application:
|
||||
Si vous exécutez le binaire, vous devriez voir l'application par défaut :
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
@ -19,4 +19,4 @@ If you run the binary, you should see the default application:
|
||||
<br />
|
||||
```
|
||||
|
||||
For more details on compilation options, please refer to the [CLI Reference](../reference/cli.mdx#build).
|
||||
Pour plus de détails sur les options de compilation, veuillez vous référer à la [documentation du CLI](../reference/cli.mdx#build).
|
||||
|
@ -2,15 +2,15 @@
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Developing your Application
|
||||
# Développez votre application
|
||||
|
||||
You can run your application in development mode by running `wails dev` from your project directory. This will do the following things:
|
||||
Vous pouvez exécuter votre application en mode développement en exécutant `wails dev` à partir du répertoire de votre projet. Cela fera les choses suivantes :
|
||||
|
||||
- Build your application and run it
|
||||
- Construire votre application et l'exécuter
|
||||
- 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
|
||||
- En utilisant la puissance de [Vite](https://vitejs.dev/), surveillera les modifications dans vos fichiers Go et reconstruira / ré-exécutera en cas de changement
|
||||
- Mettra en place un [serveur web](http://localhost:34115) qui servira votre application via un navigateur. Cela vous permet d'utiliser les extensions de votre navigateur préféré. Vous pouvez même appeler votre code Go depuis la console
|
||||
|
||||
To get started, run `wails dev` in the project directory. More information on this can be found [here](../reference/cli.mdx#dev).
|
||||
Pour commencer, exécutez `wails dev` dans le répertoire du projet. Plus d'informations à ce sujet peuvent être trouvées [ici](../reference/cli.mdx#dev).
|
||||
|
||||
Coming soon: Tutorial
|
||||
Prochainement : Tutoriel
|
||||
|
@ -2,13 +2,13 @@
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Creating a Project
|
||||
# Créer un projet
|
||||
|
||||
## Project Generation
|
||||
## Génération de projet
|
||||
|
||||
Now that the CLI is installed, you can generate a new project by using the `wails init` command.
|
||||
Maintenant que le CLI est installé, vous pouvez générer un nouveau projet en utilisant la commande `wails init`.
|
||||
|
||||
Pick your favourite framework:
|
||||
Choisissez votre framework favori :
|
||||
|
||||
```mdx-code-block
|
||||
import Tabs from "@theme/Tabs";
|
||||
@ -90,13 +90,13 @@ If you would rather use TypeScript:<br/>
|
||||
|
||||
<hr />
|
||||
|
||||
There are also [community templates](../community/templates.mdx) available that offer different capabilities and frameworks.
|
||||
Il y a aussi [des modèles créés par la communauté](../community/templates.mdx) qui sont disponibles et qui offrent différentes possibilités.
|
||||
|
||||
To see the other options available, you can run `wails init -help`. More details can be found in the [CLI Reference](../reference/cli.mdx#init).
|
||||
Pour voir les autres options disponibles, vous pouvez exécuter `wails init -help`. Plus de détails peuvent être trouvés dans la [documentation du CLI](../reference/cli.mdx#init).
|
||||
|
||||
## Project Layout
|
||||
## Structure du projet
|
||||
|
||||
Wails projects have the following layout:
|
||||
Les projets Wails ont la structure suivante:
|
||||
|
||||
```
|
||||
.
|
||||
@ -111,20 +111,20 @@ Wails projects have the following layout:
|
||||
└── wails.json
|
||||
```
|
||||
|
||||
### Project structure rundown
|
||||
### Récapitulatif de la structure du projet
|
||||
|
||||
- `/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
|
||||
- `/main.go` - L'application principale
|
||||
- `/frontend/` - Fichiers de la partie frontend
|
||||
- `/build/` - Répertoire de construction du projet
|
||||
- `/build/appicon.png` - L'icône de l'application
|
||||
- `/build/darwin/` - Fichiers spécifiques pour Mac
|
||||
- `/build/windows/` - Fichiers spécifiques pour Windows
|
||||
- `/wails.json` - La configuration du projet
|
||||
- `/go.mod` - Le fichier du module Go
|
||||
- `/go.sum` - Le checksum du fichier du module Go
|
||||
|
||||
The `frontend` directory has nothing specific to Wails and can be any frontend project of your choosing.
|
||||
Le répertoire `frontend` n'a rien de spécifique à Wails et n'importe quel outil de frontend peut être utilisé.
|
||||
|
||||
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.
|
||||
Le répertoire `build` est utilisé pendant le processus de compilation. Ces fichiers peuvent être mis à jour pour personnaliser vos builds. Si fichiers sont supprimés du répertoire de compilation, les versions par défaut seront régénérées.
|
||||
|
||||
The default module name in `go.mod` is "changeme". You should change this to something more appropriate.
|
||||
Le nom du module par défaut dans `go.mod` est "changeme". Vous devriez changer cela pour quelque chose de plus approprié.
|
||||
|
@ -4,38 +4,38 @@ sidebar_position: 1
|
||||
|
||||
# Installation
|
||||
|
||||
## Supported Platforms
|
||||
## Plates-formes Prises en charge
|
||||
|
||||
- Windows 10/11 AMD64/ARM64
|
||||
- MacOS 10.13+ AMD64
|
||||
- MacOS 11.0+ ARM64
|
||||
- Linux AMD64/ARM64
|
||||
|
||||
## Dependencies
|
||||
## Dépendances
|
||||
|
||||
Wails has a number of common dependencies that are required before installation:
|
||||
Wails a un certain nombre de dépendances communes qui sont nécessaires avant l'installation :
|
||||
|
||||
- Go 1.18+
|
||||
- NPM (Node 15+)
|
||||
|
||||
### Go
|
||||
|
||||
Download Go from the [Go Downloads Page](https://go.dev/dl/).
|
||||
Télécharger Go à partir de la [Page de téléchargement](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:
|
||||
Assurez-vous que vous suivez les instructions officielles de [l'installation de Go](https://go.dev/doc/install). Vous devrez également vous assurer que votre variable d'environnement `PATH` inclut également le chemin vers votre répertoire `~/go/bin`. Redémarrez votre terminal et effectuez les vérifications suivantes :
|
||||
|
||||
- Check Go is installed correctly: `go version`
|
||||
- Check "~/go/bin" is in your PATH variable: `echo $PATH | grep go/bin`
|
||||
- Vérifiez que Go est installé correctement : `go version`
|
||||
- Vérifiez que "~/go/bin" est dans votre variable PATH : `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.
|
||||
Téléchargez le NPM à partir de la [page de téléchargement de Node](https://nodejs.org/en/download/). Il est préférable d'utiliser la dernière version car c'est avec celle-là que nous effectuons nos tests.
|
||||
|
||||
Run `npm --version` to verify.
|
||||
Exécutez `npm --version` pour vérifier.
|
||||
|
||||
## Platform Specific Dependencies
|
||||
## Dépendances spécifiques aux plateformes
|
||||
|
||||
You will also need to install platform specific dependencies:
|
||||
Vous devrez également installer des dépendances spécifiques liés à la plateforme que vous utilisez :
|
||||
|
||||
```mdx-code-block
|
||||
import Tabs from "@theme/Tabs";
|
||||
@ -50,41 +50,41 @@ import TabItem from "@theme/TabItem";
|
||||
]}
|
||||
>
|
||||
<TabItem value="MacOS">
|
||||
Wails requires that the xcode command line tools are installed. This can be
|
||||
done by running <code>xcode-select --install</code>.
|
||||
Wails a besoin que les outils de command line xocde soient installés. Cela peut être fait
|
||||
en exécutant <code>xcode-select --install</code>.
|
||||
</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 <code>wails doctor</code> command.
|
||||
Wails a besoin que <a href="https://developer.microsoft.com/en-us/microsoft-edge/webview2/">WebView2</a> runtime soit installé. Certaines installations de Windows auront déjà installé cette fonctionnalité. Vous pouvez vérifier en utilisant la commande <code>wails doctor</code>.
|
||||
</TabItem>
|
||||
<TabItem value={"Linux"}>
|
||||
Linux required the standard <code>gcc</code> build tools plus <code>libgtk3</code> and <code>libwebkit</code>. 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 the <a href={"/docs/guides/linux-distro-support"}>Add Linux Distro</a> guide.
|
||||
Linux a besoin de <code>gcc</code> build tools plus <code>libgtk3</code> et <code>libwebkit</code>. Plutôt que de lister une tonne de commandes pour différentes distributions, Wails peut essayer de déterminer ce que sont les commandes d'installation pour votre distribution spécifique. Exécutez <code>wails doctor</code> après l'installation pour voir de quelles dépendances vous avez besoin. Si votre gestionnaire de distribution/paquet n'est pas pris en charge, veuillez consulter le guide <a href={"/docs/guides/linux-distro-support"}>Ajouter une distribution Linux</a>.
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
```
|
||||
|
||||
## Optional Dependencies
|
||||
## Dépendances optionnelles
|
||||
|
||||
- [UPX](https://upx.github.io/) for compressing your applications.
|
||||
- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers.
|
||||
- [UPX](https://upx.github.io/) pour compresser vos applications.
|
||||
- [NSIS](https://wails.io/docs/guides/windows-installer/) pour générer des installateurs Windows.
|
||||
|
||||
## Installing Wails
|
||||
## Installer Wails
|
||||
|
||||
Run `go install github.com/wailsapp/wails/v2/cmd/wails@latest` to install the Wails CLI.
|
||||
Exécutez `go go install github.com/wailsapp/wails/v2/cmd/wails@latest` pour installer le CLI.
|
||||
|
||||
Note: If you get an error similar to this:
|
||||
Note: Si vous obtenez une erreur similaire à ceci:
|
||||
|
||||
```shell
|
||||
....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found
|
||||
```
|
||||
please check you have Go 1.18+ installed:
|
||||
vérifiez que vous avez installé Go 1.18+ :
|
||||
```shell
|
||||
go version
|
||||
```
|
||||
|
||||
## System Check
|
||||
## Vérification du système
|
||||
|
||||
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.
|
||||
Exécuter `wails doctor` qui vérifiera si vous avez les bonnes dépendances installées. Si ce n'est pas le cas, il vous conseillera sur ce qui manque et vous aidera à corriger tout problème.
|
||||
|
||||
## The `wails` command appears to be missing?
|
||||
## La commande `wails` semble manquer ?
|
||||
|
||||
If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.
|
||||
Si votre système signale que la commande `wails` est manquante, assurez-vous que vous avez suivi le guide d'installation correctement. Normalement, cela signifie que le répertoire `go/bin` du répertoire racine de votre utilisateur n'est pas dans la variable d'environnement `PATH` . Vous devrez également normalement fermer et réouvrir toutes les commandes ouvertes afin que les modifications apportées à l'environnement par l'installateur soient reflétées dans l'invite de commande.
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac App Store Guide
|
||||
|
||||
This page gives a brief overview of how to submit your Wails App to the Mac App Store.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You will need to have an Apple Developer account. Please find more information on the [Apple Developer Program](https://developer.apple.com/support/compare-memberships/) site
|
||||
- You will need to have your Certificates, Identifiers, and App created on the developer portal. More on this below
|
||||
- Xcode command line tools will need to be installed on your local machine
|
||||
|
||||
#### Create Certificates and Identifiers
|
||||
|
||||
1. Go to your [Apple Developer Account](https://developer.apple.com/account/)
|
||||
2. Under `Certificates, Identifiers & Profiles`, click `Identifiers` and Register a New App ID. Use the format (com.example.app)
|
||||
3. Under the same page click `Certificates` and generate new Certificates for Mac App Store Distribution. Download them and import the certificates into Keychain on your local machine.
|
||||
|
||||
#### Create App Submission
|
||||
|
||||
1. Go to the [App Store Connect Site](https://appstoreconnect.apple.com/apps)
|
||||
2. Register a new application and link the bundle ID that you created in the previous step
|
||||
3. Populate your app with the correct screen shots, descriptions, etc. as required by Apple
|
||||
4. Create a new version of your app
|
||||
|
||||
|
||||
## Mac App Store Process
|
||||
|
||||
#### Enable Apple's App Sandbox
|
||||
|
||||
Apps submitted to the Mac App Store must run under Apple's [App Sandbox](https://developer.apple.com/app-sandboxing/). You must create an `entitlements.plist` file for this to work. The recommendation is to create this file under this path `{PROJECT_DIR}/build/darwin/entitlements.plist`.
|
||||
|
||||
**Example Entitlements File**
|
||||
|
||||
This is an example entitlements file from the [RiftShare](https://github.com/achhabra2/riftshare) app. For reference please put in the entitlements your app requires. Refer to [this site](https://developer.apple.com/documentation/bundleresources/entitlements) for more information.
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### Build and Sign the App Package
|
||||
|
||||
The following is an example script for building and signing your app for Mac App Store submission. It assumes you are running the script from your root project directory.
|
||||
|
||||
Note the certificates for signing the app and signing the installer are different. Please make sure both are imported into Keychain. Find the strings in Keychain and insert them below. Populate your certificate names, and app name below. Running the following script will generate a signed `app.pkg` file in the root directory of your app.
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### Upload App Bundle
|
||||
|
||||
You will need to upload the generated package file and associate it to your Application before you will be able to submit it for review.
|
||||
|
||||
1. Download the [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784) from the Mac App Store
|
||||
2. Open it and sign in with your Apple ID
|
||||
3. Click the + sign and select the `APP_NAME.pkg` file that you generated in the previous step. Upload it
|
||||
4. Go back to the [App Store Connect](https://appstoreconnect.apple.com/apps) site and navigate back into your app submission. Select the version that you are ready to make available on the App Store. Under `Build` select the package that you uploaded via Transporter.
|
||||
|
||||
That's it! You can now use the site to submit your App for review. After a few business days if all goes well you should see your App live on the Mac App Store.
|
@ -14,7 +14,7 @@ Considérez cela comme une alternative légère et rapide d'Electron pour Go. Vo
|
||||
- Prise en charge de Windows, macOS et Linux
|
||||
- Modèles intégrés pour Svelte, React, Preact, Vue, Lit et Vanilla JS
|
||||
- Easily call Go methods from JavaScript
|
||||
- Génération automatique du modèle TypeScript à partir de struct Go
|
||||
- Automatic Go struct to TypeScript model generation
|
||||
- Aucun CGO ou DLL externe requis sous Windows
|
||||
- Mode développement en direct en utilisant la puissance de [Vite](https://vitejs.dev/)
|
||||
- CLI puissant pour créer, construire et empaqueter facilement des applications
|
||||
@ -36,7 +36,7 @@ Ceci est [varly](https://varly.app) - une application de bureau pour MacOS & Win
|
||||
|
||||
### Modèles de créations rapides
|
||||
|
||||
Wails est livré avec un certain nombre de modèles préconfigurés qui vous permettent de faire fonctionner votre application rapidement. Il y a des modèles pour les frameworks suivants : Svelte, React, Vue, Preact, Lit et Vanilla. Il existe à la fois des versions JavaScript et TypeScript pour chaque modèle.
|
||||
Wails est livré avec un certain nombre de modèles préconfigurés qui vous permettent de faire fonctionner votre application rapidement. Il y a des modèles pour les frameworks suivants : Svelte, React, Vue, Preact, Lit et Vanilla. There are both JavaScript and TypeScript versions for each template.
|
||||
|
||||
### Éléments natifs
|
||||
|
||||
|
@ -4,120 +4,120 @@ sidebar_position: 2
|
||||
|
||||
# CLI
|
||||
|
||||
The Wails CLI has a number of commands that are used for managing your projects. All commands are run in the following way:
|
||||
Le CLI Wails a un certain nombre de commandes qui sont utilisées pour gérer vos projets. Toutes les commandes sont exécutées de la manière suivante:
|
||||
|
||||
`wails <command> <flags>`
|
||||
`wails <commande> <options>`
|
||||
|
||||
## init
|
||||
|
||||
`wails init` is used for generating projects.
|
||||
`wails init` est utilisé pour générer des projets.
|
||||
|
||||
| Flag | Description | Default |
|
||||
|:------------------ |:----------------------------------------------------------------------------------------------------------------------- |:-------------------:|
|
||||
| -n "project name" | Name of the project. **Mandatory**. | |
|
||||
| -d "project dir" | Project directory to create | Name of the project |
|
||||
| -g | Initialise git repository | |
|
||||
| -l | List available project templates | |
|
||||
| -q | Suppress output to console | |
|
||||
| -t "template name" | The project template to use. This can be the name of a default template or a URL to a remote template hosted on github. | vanilla |
|
||||
| -ide | Generate IDE project files | |
|
||||
| -f | Force build application | false |
|
||||
| Option | Description | Par défaut |
|
||||
|:------------------------- |:---------------------------------------------------------------------------------------------------------------------- |:-------------:|
|
||||
| -n "nom du projet" | Nom du projet. **Obligatoire**. | |
|
||||
| -d "Répertoire du projet" | Dossier de projet à créer | Nom du projet |
|
||||
| -g | Initialisation du dépôt git | |
|
||||
| -l | Liste des modèles de projet disponibles | |
|
||||
| -q | Supprimer les logs dans la console | |
|
||||
| -t "nom du modèle" | Modèle de projet à utiliser. Cela peut être le nom d'un modèle par défaut ou d'une URL d'un projet hébergé sur github. | vanilla |
|
||||
| -ide | Générer les fichiers du projet IDE | |
|
||||
| -f | Forcer la compilation de l'application | false |
|
||||
|
||||
Example: `wails init -n test -d mytestproject -g -ide vscode -q`
|
||||
Exemple: `wails init -n test -d mytestproject -g -ide vscode -q`
|
||||
|
||||
This will generate a a project called "test" in the "mytestproject" directory, initialise git, generate vscode project files and do so silently.
|
||||
Cela va générer un projet appelé "test" dans le répertoire "mytestproject", initialiser git, générer des fichiers de projet vscode et le faire silencieusement.
|
||||
|
||||
More information on using IDEs with Wails can be found [here](../guides/ides.mdx).
|
||||
Plus d'informations sur l'utilisation des IDEs avec Wails peuvent être trouvées [ici](../guides/ides.mdx).
|
||||
|
||||
### Remote Templates
|
||||
### Modèles à distance
|
||||
|
||||
Remote templates (hosted on GitHub) are supported and can be installed by using the template's project URL.
|
||||
Les modèles distants (hébergés sur GitHub) sont pris en charge et peuvent être installés en utilisant l'URL du projet du modèle.
|
||||
|
||||
Example: `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]`
|
||||
Exemple : `wails init -n test -t https://github.com/leaanthony/testtemplate[@v1.0.0]`
|
||||
|
||||
A list of community maintained templates can be found [here](../community/templates.mdx)
|
||||
Une liste de modèles gérés par la communauté peut être trouvée [ici](../community/templates.mdx)
|
||||
|
||||
:::warning Attention
|
||||
|
||||
**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!**
|
||||
**Le projet Wails n'entretient pas, n'est pas responsable ni responsable des modèles tiers !**
|
||||
|
||||
If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed.
|
||||
Si vous n'êtes pas sûr d'un modèle, inspectez les fichiers `package.json` et `wails.json` pour savoir quels scripts sont exécutés et quels paquets sont installés.
|
||||
|
||||
:::
|
||||
|
||||
## build
|
||||
|
||||
`wails build` is used for compiling your project to a production-ready binary.
|
||||
`wails build` est utilisé pour compiler votre projet vers un binaire prêt à la production.
|
||||
|
||||
| Flag | Description | Default |
|
||||
|:-------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| -platform | Build for the given (comma delimited) [platforms](../reference/cli.mdx#platforms) eg. `windows/arm64`. Note, if you do not give the architecture, `runtime.GOARCH` is used. | platform = `GOOS` environment variable if given else `runtime.GOOS`.<br/>arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. |
|
||||
| -clean | Cleans the `build/bin` directory | |
|
||||
| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go |
|
||||
| -ldflags "flags" | Additional ldflags to pass to the compiler | |
|
||||
| -nopackage | Do not package application | |
|
||||
| -o filename | Output filename | |
|
||||
| -s | Skip building the frontend | false |
|
||||
| -f | Force build application | false |
|
||||
| -tags "extra tags" | Build tags to pass to Go compiler. Must be quoted. Space or comma (but not both) separated | |
|
||||
| -upx | Compress final binary using "upx" | |
|
||||
| -upxflags | Flags to pass to upx | |
|
||||
| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 |
|
||||
| -webview2 | WebView2 installer strategy: download,embed,browser,error | download |
|
||||
| -u | Updates your project's `go.mod` to use the same version of Wails as the CLI | |
|
||||
| -debug | Retains debug information in the application. Allows the use of the devtools in the application window | false |
|
||||
| -trimpath | Remove all file system paths from the resulting executable. | false |
|
||||
| -race | Build with Go's race detector | false |
|
||||
| -windowsconsole | Keep the console window for Windows builds | |
|
||||
| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false |
|
||||
| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` |
|
||||
| Option | Description | Par défaut |
|
||||
|:-------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| -platform | Construit pour les [plates-formes](../reference/cli.mdx#platforms) données (séparées par des virgules) par exemple. `windows/arm64`. Notez que si vous ne donnez pas l'architecture, `runtime.GOARCH` est utilisé. | platform = le contenu de la variable d'environnement `GOOS` si elle existe, autrement `runtime.GOOS`.<br/>arch = le contenu de la variable d'environnement `GOARCH` si elle existe, autrement `runtime.GOARCH`. |
|
||||
| -clean | Nettoie le répertoire `build/bin` | |
|
||||
| -compiler "compiler" | Utiliser un autre compilateur pour compiler, par exemple go1.15beta1 | go |
|
||||
| -ldflags "flags" | Options supplémentaires à passer au compilateur | |
|
||||
| -nopackage | Ne pas empaqueter l'application | |
|
||||
| -o filename | Nom du fichier de sortie | |
|
||||
| -s | Ignorer la construction du frontend | false |
|
||||
| -f | Forcer la compilation de l'application | false |
|
||||
| -tags "extra tags" | Options de compilation à passer au compilateur Go. Doivent être entre guillemets. Séparés par un espace ou une virgule (pas les deux) | |
|
||||
| -upx | Compresser le binaire final en utilisant "upx" | |
|
||||
| -upxflags | Options à passer à upx | |
|
||||
| -v int | Niveau de verbosité (0 - silencieux, 1 - par défaut, 2 - verbeux) | 1 |
|
||||
| -webview2 | Stratégie d'installation WebView2 : download,embed,browser,error | download |
|
||||
| -u | Met à jour le `go.mod de votre projet` pour utiliser la même version de Wails que le CLI | |
|
||||
| -debug | Conserve les informations de débogage dans l'application. Permet l'utilisation des outils de développement dans la fenêtre de l'application | false |
|
||||
| -trimpath | Supprimer tous les chemins vers les fichiers système de l'exécutable final. | false |
|
||||
| -race | Construire avec le détecteur Go race | false |
|
||||
| -windowsconsole | Garder la fenêtre de la console lors de la construction d'une version pour Windows | |
|
||||
| -obfuscate | Cacher le code de l'application en utilisant [garble](https://github.com/burrowers/garble) | false |
|
||||
| -garbleargs | Arguments à passer à garble | `-literals -tiny -seed=random` |
|
||||
|
||||
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
|
||||
Pour une description détaillée des options `webview2` , veuillez vous référer au Guide de [Windows](../guides/windows.mdx).
|
||||
|
||||
If you prefer to build using standard Go tooling, please consult the [Manual Builds](../guides/manual-builds.mdx) guide.
|
||||
Si vous préférez construire en utilisant l'outil Go standard, veuillez consulter le guide [Constructions manuelles](../guides/manual-builds.mdx) .
|
||||
|
||||
Example:
|
||||
Exemple:
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
:::Info
|
||||
On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`.
|
||||
Sur Mac, l'application sera livrée avec `Info.plist`, pas `Info.dev.plist`.
|
||||
:::
|
||||
|
||||
:::info UPX on Apple Silicon
|
||||
:::info UPX sur Apple Silicon
|
||||
|
||||
There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon.
|
||||
Il y a [problèmes](https://github.com/upx/upx/issues/446) avec l'utilisation de UPX avec Apple Silicon.
|
||||
|
||||
:::
|
||||
|
||||
:::info UPX on Windows
|
||||
:::info UPX sur Windows
|
||||
|
||||
Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437).
|
||||
Certains antivirus marquent de manière erronée les binaires compressés d'`upx` comme virus, voir [la description du problème](https://github.com/upx/upx/issues/437).
|
||||
|
||||
:::
|
||||
|
||||
### Platforms
|
||||
### Platformes
|
||||
|
||||
Supported platforms are:
|
||||
Plateformes supportées:
|
||||
|
||||
| Platform | Description |
|
||||
|:---------------- |:--------------------------------------------- |
|
||||
| darwin | MacOS + architecture of build machine |
|
||||
| Plateforme | Description |
|
||||
|:---------------- |:-------------------------------------------------- |
|
||||
| darwin | MacOS + Architecture de la machine de construction |
|
||||
| darwin/amd64 | MacOS 10.13+ AMD64 |
|
||||
| darwin/arm64 | MacOS 11.0+ ARM64 |
|
||||
| darwin/universal | MacOS AMD64+ARM64 universal application |
|
||||
| windows | Windows 10/11 + architecture of build machine |
|
||||
| darwin/universal | Application universelle MacOS AMD64+ARM64 |
|
||||
| windows | Windows 10/11 + architecture de la machine |
|
||||
| windows/amd64 | Windows 10/11 AMD64 |
|
||||
| windows/arm64 | Windows 10/11 ARM64 |
|
||||
| linux | Linux + architecture of build machine |
|
||||
| linux | Linux + architecture de la machine |
|
||||
| linux/amd64 | Linux AMD64 |
|
||||
| linux/arm64 | Linux ARM64 |
|
||||
|
||||
## doctor
|
||||
|
||||
`wails doctor` will run diagnostics to ensure that your system is ready for development.
|
||||
`wails doctor` effectuera des diagnostics pour vous assurer que votre système est prêt pour développer avec wails.
|
||||
|
||||
Example:
|
||||
Exemple:
|
||||
|
||||
```
|
||||
Wails CLI v2.0.0-beta
|
||||
@ -149,10 +149,10 @@ Your system is ready for Wails development!
|
||||
|
||||
## dev
|
||||
|
||||
`wails dev` is used to run your application in a "live development" mode. This means:
|
||||
`wails dev` est utilisé pour exécuter votre application en mode « développement en direct ». Ceci signifie que :
|
||||
|
||||
- The application's `go.mod` will be updated to use the same version of Wails as the CLI
|
||||
- The application is compiled and run automatically
|
||||
- Le fichier `go.mod` de l'application sera mis à jour pour utiliser la même version de Wails que le CLI
|
||||
- L'application est compilée et exécutée automatiquement
|
||||
- A watcher is started and will trigger a rebuild of your dev app if it detects changes to your go files
|
||||
- A webserver is started on `http://localhost:34115` which serves your application (not just frontend) over http. This allows you to use your favourite browser development extensions
|
||||
- All application assets are loaded from disk. If they are changed, the application will automatically reload (not rebuild). All connected browsers will also reload
|
||||
@ -162,14 +162,14 @@ Your system is ready for Wails development!
|
||||
- A second JS module is generated that provides a wrapper + TS declaration for the runtime
|
||||
- On macOS, it will bundle the application into a `.app` file and run it. It will use a `build/darwin/Info.dev.plist` for development.
|
||||
|
||||
| Flag | Description | Default |
|
||||
| Option | Description | Par défaut |
|
||||
|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- |
|
||||
| -assetdir "./path/to/assets" | Serve assets from the given directory instead of using the provided asset FS | Value in `wails.json` |
|
||||
| -browser | Opens a browser to `http://localhost:34115` on startup | |
|
||||
| -compiler "compiler" | Use a different go compiler to build, eg go1.15beta1 | go |
|
||||
| -compiler "compiler" | Utiliser un autre compilateur pour compiler, par exemple go1.15beta1 | go |
|
||||
| -e | Extensions to trigger rebuilds (comma separated) | go |
|
||||
| -reloaddirs | Additional directories to trigger reloads (comma separated) | Value in `wails.json` |
|
||||
| -ldflags "flags" | Additional ldflags to pass to the compiler | |
|
||||
| -ldflags "flags" | Options supplémentaires à passer au compilateur | |
|
||||
| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | |
|
||||
| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | Debug |
|
||||
| -noreload | Disable automatic reload when assets change | |
|
||||
@ -182,10 +182,10 @@ Your system is ready for Wails development!
|
||||
| -frontenddevserverurl "url" | Use 3rd party dev server url to serve assets, EG Vite | "" |
|
||||
| -appargs "args" | Arguments passed to the application in shell style | |
|
||||
| -save | Saves the given `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` flags in `wails.json` to become the defaults for subsequent invocations. | |
|
||||
| -race | Build with Go's race detector | false |
|
||||
| -s | Skip building the frontend | false |
|
||||
| -race | Construire avec le détecteur Go race | false |
|
||||
| -s | Ignorer la construction du frontend | false |
|
||||
|
||||
Example:
|
||||
Exemple:
|
||||
|
||||
`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser`
|
||||
|
||||
@ -204,7 +204,7 @@ There is more information on using this feature with existing framework scripts
|
||||
|
||||
Wails uses templates for project generation. The `wails generate template` command helps scaffold a template so that it may be used for generating projects.
|
||||
|
||||
| Flag | Description |
|
||||
| Option | Description |
|
||||
|:---------------- |:------------------------------------------- |
|
||||
| -name | The template name (Mandatory) |
|
||||
| -frontend "path" | Path to frontend project to use in template |
|
||||
@ -219,7 +219,7 @@ The `wails generate module` command allows you to manually generate the `wailsjs
|
||||
|
||||
`wails update` will update the version of the Wails CLI.
|
||||
|
||||
| Flag | Description |
|
||||
| Option | Description |
|
||||
|:------------------ |:------------------------------------- |
|
||||
| -pre | Update to latest pre-release version |
|
||||
| -version "version" | Install a specific version of the CLI |
|
||||
|
@ -224,22 +224,21 @@ This defines AssetServer specific options. It allows to customize the AssetServe
|
||||
Not all features of an `http.Request` are currently supported, please see the following feature matrix:
|
||||
|
||||
| Feature | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support.
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
Name: AssetServer<br/> Type: `*assetserver.Options`
|
||||
|
||||
@ -734,3 +733,5 @@ Name: Debug<br/> Type: `options.Debug`
|
||||
Setting this to `true` will open the WebInspector on startup of the application.
|
||||
|
||||
Name: OpenInspectorOnStartup<br/> Type: `bool`
|
||||
|
||||
[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.0.0-rc.1"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "Premiers pas",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "Référence",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,11 +16,11 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "Communauté",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "Galerie",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
@ -28,11 +28,11 @@
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "Tutoriels",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "Contribuer",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.0.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "Premiers pas",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "Référence",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,11 +16,11 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "Communauté",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "Galerie",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
@ -28,11 +28,11 @@
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "Tutoriels",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "Contribuer",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.1.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "Premiers pas",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "Référence",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,11 +16,11 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "Communauté",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "Galerie",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
@ -28,11 +28,11 @@
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "Tutoriels",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "Contribuer",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.2.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "Premiers pas",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "Référence",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,11 +16,11 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "Communauté",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "Galerie",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
@ -28,11 +28,11 @@
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "Tutoriels",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "Contribuer",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,19 @@ Le format est basé sur [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
- Ajout de l'option `OpenInspectorOnStartup` au débogage pour permettre d'ouvrir le WebInspector au démarrage de l'application en mode débogage . Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2080)
|
||||
- Sur MacOS, `wails doctor` affiche à présent la version de Xcode installée. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2089)
|
||||
- L'[AssetServer](/docs/reference/options#assetserver) supporte à présent les range-requests si l' [Assets](/docs/reference/options/#assets-1) `fs.FS` importe `io.ReadSeeker`. Ajouté par @stffabi : [PR](https://github.com/wailsapp/wails/pull/2091)
|
||||
- Ajouter une nouvelle propriété `bindings` dans le fichier de configuration `wails.json`. Plus d'informations sur la nouvelle propriété peuvent être trouvées dans le [schéma](/schemas/config.v2.json) mis à jour. Les propriétés `prefix` et `suffix` vous permettent de contrôler le nom d'entité TypeScript généré dans le fichier `model.ts`. Ajouté par @OlegGulevskyy dans [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- Ajouter une nouvelle propriété `bindings` dans le fichier de configuration `wails.json`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Les propriétés `prefix` et `suffix` vous permettent de contrôler le nom d'entité TypeScript généré dans le fichier `model.ts`. Ajouté par @OlegGulevskyy dans [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- La méthode `WindowSetAlwaysOnTop` est maintenant exposée dans l'exécutable JS. Fixé par @gotid dans la [PR](https://github.com/wailsapp/wails/pull/2128)
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports serving the index.html file when requesting a directory. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
- Added support for WebKit2GTK 2.36+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP methods and Headers. The app must be compiled with the Go build tag `webkit2_36` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2151)
|
||||
|
||||
### Corrections
|
||||
- Le booléen activant la fonctionnalité `noreload` n'était pas utilisable dans le mode développement de wails. Corrigé par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2081)
|
||||
- `le dossier build/bin` se dupliquait sur chaque rechargement en mode `wails dev`. Corrigé par @OlegGulevskyy dans cette [PR](https://github.com/wailsapp/wails/pull/2103)
|
||||
- Empêcher une fine ligne blanche au bas d'une fenêtre sans cadre sous Windows. Correction par @stffabi dans cette [PR](https://github.com/wailsapp/wails/pull/2111)
|
||||
- Better signal handling for Linux. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2152)
|
||||
|
||||
### Changements
|
||||
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -54,11 +54,11 @@ Nous sommes toujours désireux d'ajouter des fonctionnalités à Wails et de dé
|
||||
- Une fois que tous les tests sont terminés, veuillez mettre à jour le statut de la PR à partir du brouillon et laisser un message.
|
||||
|
||||
:::note
|
||||
Il n'y a rien qui vous empêche d'ouvrir un ticket et d'y travailler vous-même, mais soyez conscient que toutes les demandes d'amélioration sont examinées pour s'assurer qu'elle s'adapte bien au projet. Toutes les idées ne seront pas sélectionnées, il est donc préférable d'avoir une discussion sur l'amélioration en premier.
|
||||
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. Toutes les idées ne seront pas sélectionnées, il est donc préférable d'avoir une discussion sur l'amélioration en premier.
|
||||
:::
|
||||
|
||||
:::warning
|
||||
Toute PRs ouvertes sans ticket correspondant peuvent être rejetées.
|
||||
Any PRs opened without a corresponding ticket may be rejected.
|
||||
:::
|
||||
|
||||
### Corriger des Bugs
|
||||
@ -78,11 +78,11 @@ Le processus de correction des bugs est le suivant :
|
||||
- Une fois que tous les tests sont terminés, veuillez mettre à jour le statut de la PR à partir du brouillon et laisser un message.
|
||||
|
||||
:::note
|
||||
Il n'y a rien qui vous empêche d'ouvrir un ticket et d'y travailler vous-même, mais soyez conscient que tous les correctifs doivent être discutés en amont afin d'éviter des effets de bord non désirés.
|
||||
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
|
||||
Toute PRs ouvertes sans ticket correspondant peuvent être rejetées.
|
||||
Any PRs opened without a corresponding ticket may be rejected.
|
||||
:::
|
||||
|
||||
### Tester
|
||||
|
@ -4,7 +4,7 @@
|
||||
"description": "Navbar item with label Sponsor"
|
||||
},
|
||||
"item.label.Docs": {
|
||||
"message": "Docs",
|
||||
"message": "Documentation",
|
||||
"description": "Navbar item with label Docs"
|
||||
},
|
||||
"item.label.Blog": {
|
||||
|
@ -1,57 +1,57 @@
|
||||
{
|
||||
"homepage.Features.Title1": {
|
||||
"message": "Feature Rich"
|
||||
"message": "豊富な機能"
|
||||
},
|
||||
"homepage.Features.Description1": {
|
||||
"message": "メニューやダイアログといったネイティブUI要素を使用して、クロスプラットフォームアプリを構築しましょう。"
|
||||
},
|
||||
"homepage.Features.Title2": {
|
||||
"message": "Familiar"
|
||||
"message": "使い慣れた技術"
|
||||
},
|
||||
"homepage.Features.Description2": {
|
||||
"message": "Use the technologies you already know to build amazing applications."
|
||||
"message": "すでにあなたが知っている技術で、素晴らしいアプリを構築できます。"
|
||||
},
|
||||
"homepage.Features.Title3": {
|
||||
"message": "Fast"
|
||||
"message": "速い"
|
||||
},
|
||||
"homepage.Features.Description3": {
|
||||
"message": "Quickly generate, build and package your projects using the Wails CLI."
|
||||
"message": "Wails CLIを使用して、プロジェクトをすばやく生成、ビルド、およびパッケージ化できます。"
|
||||
},
|
||||
"homepage.Tagline": {
|
||||
"message": "Build beautiful cross-platform applications using Go"
|
||||
"message": "Goで美しいクロスプラットフォームアプリを開発"
|
||||
},
|
||||
"homepage.ButtonText": {
|
||||
"message": "Get Started"
|
||||
"message": "はじめよう"
|
||||
},
|
||||
"homepage.LearnMoreButtonText": {
|
||||
"message": "Learn More"
|
||||
"message": "詳しく"
|
||||
},
|
||||
"theme.ErrorPageContent.title": {
|
||||
"message": "This page crashed.",
|
||||
"message": "ページがクラッシュしました。",
|
||||
"description": "The title of the fallback page when the page crashed"
|
||||
},
|
||||
"theme.ErrorPageContent.tryAgain": {
|
||||
"message": "Try again",
|
||||
"message": "再試行",
|
||||
"description": "The label of the button to try again when the page crashed"
|
||||
},
|
||||
"theme.NotFound.title": {
|
||||
"message": "Page Not Found",
|
||||
"message": "ページが見つかりません",
|
||||
"description": "The title of the 404 page"
|
||||
},
|
||||
"theme.NotFound.p1": {
|
||||
"message": "We could not find what you were looking for.",
|
||||
"message": "リクエストされたページは見つかりませんでした。",
|
||||
"description": "The first paragraph of the 404 page"
|
||||
},
|
||||
"theme.NotFound.p2": {
|
||||
"message": "Please contact the owner of the site that linked you to the original URL and let them know their link is broken.",
|
||||
"message": "リンク元のページの所有者に連絡し、このリンクが無効であることをお知らせください。",
|
||||
"description": "The 2nd paragraph of the 404 page"
|
||||
},
|
||||
"theme.AnnouncementBar.closeButtonAriaLabel": {
|
||||
"message": "Close",
|
||||
"message": "閉じる",
|
||||
"description": "The ARIA label for close button of announcement bar"
|
||||
},
|
||||
"theme.blog.archive.title": {
|
||||
"message": "Archive",
|
||||
"message": "アーカイブ",
|
||||
"description": "The page & hero title of the blog archive page"
|
||||
},
|
||||
"theme.blog.archive.description": {
|
||||
@ -59,91 +59,91 @@
|
||||
"description": "The page & hero description of the blog archive page"
|
||||
},
|
||||
"theme.BackToTopButton.buttonAriaLabel": {
|
||||
"message": "Scroll back to top",
|
||||
"message": "ページ上部へ戻る",
|
||||
"description": "The ARIA label for the back to top button"
|
||||
},
|
||||
"theme.blog.paginator.navAriaLabel": {
|
||||
"message": "Blog list page navigation",
|
||||
"message": "ブログ投稿一覧ページナビゲーション",
|
||||
"description": "The ARIA label for the blog pagination"
|
||||
},
|
||||
"theme.blog.paginator.newerEntries": {
|
||||
"message": "Newer Entries",
|
||||
"message": "より新しい投稿",
|
||||
"description": "The label used to navigate to the newer blog posts page (previous page)"
|
||||
},
|
||||
"theme.blog.paginator.olderEntries": {
|
||||
"message": "Older Entries",
|
||||
"message": "より古い投稿",
|
||||
"description": "The label used to navigate to the older blog posts page (next page)"
|
||||
},
|
||||
"theme.blog.post.readingTime.plurals": {
|
||||
"message": "One min read|{readingTime} min read",
|
||||
"message": "1分で読めます|{readingTime}分で読めます",
|
||||
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.blog.post.readMoreLabel": {
|
||||
"message": "Read more about {title}",
|
||||
"message": "\"{title}\"の投稿をすべて読む",
|
||||
"description": "The ARIA label for the link to full blog posts from excerpts"
|
||||
},
|
||||
"theme.blog.post.readMore": {
|
||||
"message": "Read More",
|
||||
"message": "すべて読む",
|
||||
"description": "The label used in blog post item excerpts to link to full blog posts"
|
||||
},
|
||||
"theme.blog.post.paginator.navAriaLabel": {
|
||||
"message": "Blog post page navigation",
|
||||
"message": "ブログ投稿ページナビゲーション",
|
||||
"description": "The ARIA label for the blog posts pagination"
|
||||
},
|
||||
"theme.blog.post.paginator.newerPost": {
|
||||
"message": "Newer Post",
|
||||
"message": "次の新しい投稿",
|
||||
"description": "The blog post button label to navigate to the newer/previous post"
|
||||
},
|
||||
"theme.blog.post.paginator.olderPost": {
|
||||
"message": "Older Post",
|
||||
"message": "次の古い投稿",
|
||||
"description": "The blog post button label to navigate to the older/next post"
|
||||
},
|
||||
"theme.blog.sidebar.navAriaLabel": {
|
||||
"message": "Blog recent posts navigation",
|
||||
"message": "最近のブログ投稿のナビゲーション",
|
||||
"description": "The ARIA label for recent posts in the blog sidebar"
|
||||
},
|
||||
"theme.blog.post.plurals": {
|
||||
"message": "One post|{count} posts",
|
||||
"message": "1件の投稿|{count}件の投稿",
|
||||
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.blog.tagTitle": {
|
||||
"message": "{nPosts} tagged with \"{tagName}\"",
|
||||
"message": "\"{tagName}\"タグがついた{nPosts}件の投稿",
|
||||
"description": "The title of the page for a blog tag"
|
||||
},
|
||||
"theme.tags.tagsPageLink": {
|
||||
"message": "View All Tags",
|
||||
"message": "すべてのタグを見る",
|
||||
"description": "The label of the link targeting the tag list page"
|
||||
},
|
||||
"theme.CodeBlock.copyButtonAriaLabel": {
|
||||
"message": "Copy code to clipboard",
|
||||
"message": "コードをクリップボードにコピー",
|
||||
"description": "The ARIA label for copy code blocks button"
|
||||
},
|
||||
"theme.CodeBlock.copied": {
|
||||
"message": "Copied",
|
||||
"message": "コピーしました",
|
||||
"description": "The copied button label on code blocks"
|
||||
},
|
||||
"theme.CodeBlock.copy": {
|
||||
"message": "Copy",
|
||||
"message": "コピー",
|
||||
"description": "The copy button label on code blocks"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel": {
|
||||
"message": "Switch between dark and light mode (currently {mode})",
|
||||
"message": "ダークモード/ライトモードの切替 (現在は{mode}です)",
|
||||
"description": "The ARIA label for the navbar color mode toggle"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel.mode.dark": {
|
||||
"message": "dark mode",
|
||||
"message": "ダークモード",
|
||||
"description": "The name for the dark color mode"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel.mode.light": {
|
||||
"message": "light mode",
|
||||
"message": "ライトモード",
|
||||
"description": "The name for the light color mode"
|
||||
},
|
||||
"theme.docs.DocCard.categoryDescription": {
|
||||
"message": "{count} items",
|
||||
"message": "{count}件",
|
||||
"description": "The default description for a category card in the generated index about how many items this category includes"
|
||||
},
|
||||
"theme.docs.sidebar.expandButtonTitle": {
|
||||
"message": "Expand sidebar",
|
||||
"message": "サイドバーを展開",
|
||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||
},
|
||||
"theme.docs.sidebar.expandButtonAriaLabel": {
|
||||
@ -151,19 +151,19 @@
|
||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||
},
|
||||
"theme.docs.paginator.navAriaLabel": {
|
||||
"message": "Docs pages navigation",
|
||||
"message": "ドキュメントページナビゲーション",
|
||||
"description": "The ARIA label for the docs pagination"
|
||||
},
|
||||
"theme.docs.paginator.previous": {
|
||||
"message": "Previous",
|
||||
"message": "前へ",
|
||||
"description": "The label used to navigate to the previous doc"
|
||||
},
|
||||
"theme.docs.paginator.next": {
|
||||
"message": "Next",
|
||||
"message": "次へ",
|
||||
"description": "The label used to navigate to the next doc"
|
||||
},
|
||||
"theme.docs.sidebar.collapseButtonTitle": {
|
||||
"message": "Collapse sidebar",
|
||||
"message": "サイドバーを折りたたむ",
|
||||
"description": "The title attribute for collapse button of doc sidebar"
|
||||
},
|
||||
"theme.docs.sidebar.collapseButtonAriaLabel": {
|
||||
@ -171,74 +171,74 @@
|
||||
"description": "The title attribute for collapse button of doc sidebar"
|
||||
},
|
||||
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
|
||||
"message": "Toggle the collapsible sidebar category '{label}'",
|
||||
"message": "'{label}'カテゴリサイドバーの折りたたみを切替える",
|
||||
"description": "The ARIA label to toggle the collapsible sidebar category"
|
||||
},
|
||||
"theme.docs.tagDocListPageTitle.nDocsTagged": {
|
||||
"message": "One doc tagged|{count} docs tagged",
|
||||
"message": "1件のドキュメントがタグ付けされています|{count}件のドキュメントがタグ付けされています",
|
||||
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.docs.tagDocListPageTitle": {
|
||||
"message": "{nDocsTagged} with \"{tagName}\"",
|
||||
"message": "\"{tagName}\"タグがついた{nDocsTagged}件のドキュメント",
|
||||
"description": "The title of the page for a docs tag"
|
||||
},
|
||||
"theme.docs.versionBadge.label": {
|
||||
"message": "Version: {versionLabel}"
|
||||
"message": "バージョン: {versionLabel}"
|
||||
},
|
||||
"theme.docs.versions.unreleasedVersionLabel": {
|
||||
"message": "This is unreleased documentation for {siteTitle} {versionLabel} version.",
|
||||
"message": "これは、{siteTitle} {versionLabel}のまだ未公開となっているドキュメントです。",
|
||||
"description": "The label used to tell the user that he's browsing an unreleased doc version"
|
||||
},
|
||||
"theme.docs.versions.unmaintainedVersionLabel": {
|
||||
"message": "This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.",
|
||||
"message": "これは、{siteTitle} {versionLabel}のドキュメントで、現在はメンテナンスされていません。",
|
||||
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
|
||||
},
|
||||
"theme.docs.versions.latestVersionSuggestionLabel": {
|
||||
"message": "For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).",
|
||||
"message": "最新のドキュメントは、{latestVersionLink} ({versionLabel}) をご覧ください。",
|
||||
"description": "The label used to tell the user to check the latest version"
|
||||
},
|
||||
"theme.docs.versions.latestVersionLinkLabel": {
|
||||
"message": "latest version",
|
||||
"message": "最新バージョン",
|
||||
"description": "The label used for the latest version suggestion link label"
|
||||
},
|
||||
"theme.common.editThisPage": {
|
||||
"message": "Edit this page",
|
||||
"message": "このページを編集",
|
||||
"description": "The link label to edit the current page"
|
||||
},
|
||||
"theme.common.headingLinkTitle": {
|
||||
"message": "Direct link to heading",
|
||||
"message": "見出しへの直リンク",
|
||||
"description": "Title for link to heading"
|
||||
},
|
||||
"theme.lastUpdated.atDate": {
|
||||
"message": " on {date}",
|
||||
"message": "{date}",
|
||||
"description": "The words used to describe on which date a page has been last updated"
|
||||
},
|
||||
"theme.lastUpdated.byUser": {
|
||||
"message": " by {user}",
|
||||
"message": "{user}",
|
||||
"description": "The words used to describe by who the page has been last updated"
|
||||
},
|
||||
"theme.lastUpdated.lastUpdatedAtBy": {
|
||||
"message": "Last updated{atDate}{byUser}",
|
||||
"message": "{byUser}が{atDate}に最終更新",
|
||||
"description": "The sentence used to display when a page has been last updated, and by who"
|
||||
},
|
||||
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
|
||||
"message": "← Back to main menu",
|
||||
"message": "← メインメニューに戻る",
|
||||
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
|
||||
},
|
||||
"theme.navbar.mobileVersionsDropdown.label": {
|
||||
"message": "Versions",
|
||||
"message": "バージョン一覧",
|
||||
"description": "The label for the navbar versions dropdown on mobile view"
|
||||
},
|
||||
"theme.common.skipToMainContent": {
|
||||
"message": "Skip to main content",
|
||||
"message": "メインコンテンツにスキップ",
|
||||
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
|
||||
},
|
||||
"theme.tags.tagsListLabel": {
|
||||
"message": "Tags:",
|
||||
"message": "タグ:",
|
||||
"description": "The label alongside a tag list"
|
||||
},
|
||||
"theme.TOCCollapsible.toggleButtonLabel": {
|
||||
"message": "On this page",
|
||||
"message": "このページ",
|
||||
"description": "The label used by the button on the collapsible TOC component"
|
||||
},
|
||||
"theme.navbar.mobileLanguageDropdown.label": {
|
||||
@ -246,26 +246,26 @@
|
||||
"description": "The label for the mobile language switcher dropdown"
|
||||
},
|
||||
"theme.SearchBar.seeAll": {
|
||||
"message": "See all {count} results"
|
||||
"message": "{count}件の結果をすべて見る"
|
||||
},
|
||||
"theme.SearchBar.label": {
|
||||
"message": "Search",
|
||||
"message": "検索",
|
||||
"description": "The ARIA label and placeholder for search button"
|
||||
},
|
||||
"theme.SearchPage.documentsFound.plurals": {
|
||||
"message": "One document found|{count} documents found",
|
||||
"message": "1件のドキュメントが見つかりました|{count}件のドキュメントが見つかりました",
|
||||
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.SearchPage.existingResultsTitle": {
|
||||
"message": "Search results for \"{query}\"",
|
||||
"message": "\"{query}\"の検索結果",
|
||||
"description": "The search page title for non-empty query"
|
||||
},
|
||||
"theme.SearchPage.emptyResultsTitle": {
|
||||
"message": "Search the documentation",
|
||||
"message": "ドキュメントの検索",
|
||||
"description": "The search page title for empty query"
|
||||
},
|
||||
"theme.SearchPage.inputPlaceholder": {
|
||||
"message": "Type your search here",
|
||||
"message": "検索したい単語を入力",
|
||||
"description": "The placeholder for search page input"
|
||||
},
|
||||
"theme.SearchPage.inputLabel": {
|
||||
@ -273,31 +273,31 @@
|
||||
"description": "The ARIA label for search page input"
|
||||
},
|
||||
"theme.SearchPage.algoliaLabel": {
|
||||
"message": "Search by Algolia",
|
||||
"message": "Algoliaによる検索",
|
||||
"description": "The ARIA label for Algolia mention"
|
||||
},
|
||||
"theme.SearchPage.noResultsText": {
|
||||
"message": "No results were found",
|
||||
"message": "見つかりませんでした",
|
||||
"description": "The paragraph for empty search result"
|
||||
},
|
||||
"theme.SearchPage.fetchingNewResults": {
|
||||
"message": "Fetching new results...",
|
||||
"message": "新しい結果を取得中...",
|
||||
"description": "The paragraph for fetching new search results"
|
||||
},
|
||||
"theme.tags.tagsPageTitle": {
|
||||
"message": "Tags",
|
||||
"message": "タグ",
|
||||
"description": "The title of the tag list page"
|
||||
},
|
||||
"theme.docs.breadcrumbs.home": {
|
||||
"message": "Home page",
|
||||
"message": "ホームページ",
|
||||
"description": "The ARIA label for the home page in the breadcrumbs"
|
||||
},
|
||||
"theme.docs.breadcrumbs.navAriaLabel": {
|
||||
"message": "Breadcrumbs",
|
||||
"message": "パンくずリスト",
|
||||
"description": "The ARIA label for the breadcrumbs"
|
||||
},
|
||||
"theme.CodeBlock.wordWrapToggle": {
|
||||
"message": "Toggle word wrap",
|
||||
"message": "文字列の折り返しの切替",
|
||||
"description": "The title attribute for toggle word wrapping button of code block lines"
|
||||
},
|
||||
"theme.admonition.note": {
|
||||
|
@ -8,7 +8,7 @@
|
||||
"description": "The description for the blog used in SEO"
|
||||
},
|
||||
"sidebar.title": {
|
||||
"message": "Recent posts",
|
||||
"message": "最近の投稿",
|
||||
"description": "The label for the left sidebar"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"version.label": {
|
||||
"message": "Next Version 🚧",
|
||||
"message": "次期バージョン 🚧",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
|
@ -26,61 +26,61 @@ import TabItem from "@theme/TabItem";
|
||||
]}
|
||||
>
|
||||
<TabItem value="Svelte">
|
||||
Generate a <a href={"https://svelte.dev/"}>Svelte</a> project using JavaScript with:<br/><br/>
|
||||
JavaScriptによる<a href={"https://svelte.dev/"}>Svelte</a>プロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t svelte
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t svelte-ts
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="React">
|
||||
Generate a <a href={"https://reactjs.org/"}>React</a> project using JavaScript with:<br/><br/>
|
||||
JavaScriptによる<a href={"https://reactjs.org/"}>React</a>プロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t react
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t react-ts
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Vue">
|
||||
Generate a <a href={"https://vuejs.org/"}>Vue</a> project using JavaScript with:<br/><br/>
|
||||
JavaScriptによる<a href={"https://vuejs.org/"}>Vue</a>プロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t vue
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t vue-ts
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Preact">
|
||||
Generate a <a href={"https://preactjs.com/"}>Preact</a> project using JavaScript with:<br/><br/>
|
||||
JavaScriptによる<a href={"https://preactjs.com/"}>Preact</a>プロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t preact
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t preact-ts
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Lit">
|
||||
Generate a <a href={"https://lit.dev/"}>Lit</a> project using JavaScript with:<br/><br/>
|
||||
JavaScriptによる<a href={"https://lit.dev/"}>Lit</a>プロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t lit
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t lit-ts
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="Vanilla">
|
||||
Generate a Vanilla project using JavaScript with:<br/><br/>
|
||||
JavaScriptによるバニラなプロジェクトを生成する場合:<br/><br/>
|
||||
|
||||
wails init -n myproject -t vanilla
|
||||
|
||||
If you would rather use TypeScript:<br/>
|
||||
TypeScriptによるプロジェクトを生成する場合:<br/>
|
||||
|
||||
wails init -n myproject -t vanilla-ts
|
||||
|
||||
|
@ -84,6 +84,6 @@ go version
|
||||
|
||||
`wails doctor`を実行すると、必要な依存関係が正しくインストールされているかを確認することができます。 正しくインストールされていない場合は、その内容をあなたにお知らせして、どうすれば解決できるかを教えてくれます。
|
||||
|
||||
## The `wails` command appears to be missing?
|
||||
## `wails`コマンドが見つからないのですが?
|
||||
|
||||
If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment variable. You will also normally need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.
|
||||
`wails`コマンドが見つからないとシステムに怒られた場合は、Goが、公式のGoインストール手順に従って導入されているかを確認してください。 コマンドが見つからないほとんどの理由は、あなたのホームディレクトリ配下にある`go/bin`ディレクトリのパスが、`PATH`環境変数に含まれていないからです。 また、インストールによって行われた環境変更を反映させるために、もともと開いていたコマンドプロンプト(ターミナル)がある場合はそれらをいったん閉じて、再度開きなおしてください。
|
||||
|
@ -1,12 +1,12 @@
|
||||
# Application Development
|
||||
# アプリケーション開発
|
||||
|
||||
There are no hard and fast rules for developing applications with Wails, but there are some basic guidelines.
|
||||
Wailsでアプリケーションを作成する際に、厳格なルールはありませんが、基本的なガイドラインがいくつかあります。
|
||||
|
||||
## 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.
|
||||
デフォルトのテンプレートを使用した場合、`main.go`にはアプリケーションの構成および起動コードが記述され、`app.go`にはアプリケーションのロジック定義が記述されています。
|
||||
|
||||
The `app.go` file will define a struct that has 2 methods which act as hooks into the main application:
|
||||
`app.go`ファイルには、メインアプリケーションのフックとして機能する2つのメソッドを持った構造体を定義します。
|
||||
|
||||
```go title="app.go"
|
||||
type App struct {
|
||||
@ -25,11 +25,11 @@ 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.
|
||||
- startupメソッドは、Wailsが起動時に、必要リソースの割り当てが完了した際にすぐに呼び出されます。このメソッド内は、リソースの作成、イベントリスナーの設定、その他アプリケーションに必要な初期処理を実施するのに適しています。 メソッド呼び出し時に与えられる`context.Context`は、通常は、構造体のフィールドに格納するようにしてください。 なぜならば、このcontextは[runtime](../reference/runtime/intro.mdx)を呼び出す際に必要なためです。 このstartupメソッドがエラーを返却した場合、アプリケーションは終了します。 開発モードの場合、コンソールにエラーが出力されます。
|
||||
|
||||
- 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.
|
||||
- shutdownメソッドは、シャットダウンプロセスの最後に、Wailsによって呼び出されます。 このメソッド内は、メモリを解放し、任意のシャットダウンタスクを実施するのに適しています。
|
||||
|
||||
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:
|
||||
通常、`main.go`ファイルでは、アプリケーション構成を受け取る`wails.Run()`メソッドを1回だけ呼び出すようにします。 テンプレートでは、`wails.Run()`を呼び出す前に、`app.go`で定義した構造体のインスタンスを作成して、`app`に格納しています。 アプリケーション構成では、コールバックを追加できます:
|
||||
|
||||
```go {3,9,10} title="main.go"
|
||||
func main() {
|
||||
@ -50,11 +50,11 @@ func main() {
|
||||
|
||||
```
|
||||
|
||||
More information on application lifecycle hooks can be found [here](../howdoesitwork.mdx#application-lifecycle-callbacks).
|
||||
アプリケーションのライフサイクルフックについて詳しくは、[こちら](../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のメソッドを呼び出したいことがありますよね。 そのようなときは、`app.go`ですでに定義している構造体に、パブリックメソッドを追加しましょう:
|
||||
|
||||
```go {16-18} title="app.go"
|
||||
type App struct {
|
||||
@ -77,7 +77,7 @@ func (a *App) Greet(name string) string {
|
||||
}
|
||||
```
|
||||
|
||||
In the main application configuration, the `Bind` key is where we can tell Wails what we want to bind:
|
||||
アプリケーション構成の`Bind`キーで、Wailsに何をバインドさせたいかを指定できます:
|
||||
|
||||
```go {11-13} title="main.go"
|
||||
func main() {
|
||||
@ -101,11 +101,11 @@ func main() {
|
||||
|
||||
```
|
||||
|
||||
This will bind all public methods in our `App` struct (it will never bind the startup and shutdown methods).
|
||||
これにより、`App`構造体のすべてのパブリックメソッドがバインドされます(startupメソッド・shutdownメソッドはバインドされません)。
|
||||
|
||||
### Dealing with context when binding multiple structs
|
||||
### 複数の構造体をバインドするときのcontextの扱い
|
||||
|
||||
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 :
|
||||
もし、複数の構造体のメソッドをバインドしたくて、かつ、各構造体でランタイム関数を呼び出せるようにcontextを共有したい場合は、`OnStartup`のコールバック内で、各構造体にcontextを渡してあげるのが良いでしょう:
|
||||
|
||||
```go
|
||||
func main() {
|
||||
@ -133,11 +133,11 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
More information on Binding can be found [here](../howdoesitwork.mdx#method-binding).
|
||||
バインディングの詳細については、[こちら](../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.
|
||||
Wailsでは、アプリケーションにメニューを追加することができます。 追加したい場合は、アプリケーション構成に[Menu](../reference/menus.mdx#menu)構造体を渡してください。 通常は、Menuを返すようなメソッドを使用するようにします。ライフサイクルフックに使用される`App`構造体のメソッドとして用意するのが良いでしょう。
|
||||
|
||||
```go {11} title="main.go"
|
||||
func main() {
|
||||
@ -162,33 +162,33 @@ func main() {
|
||||
|
||||
```
|
||||
|
||||
## 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.
|
||||
Wails v2にアセットを処理させるための方法は複雑ではありません。 Wailsに与える必要があるのは、`embed.FS`だけです。 任意の方法で与えてあげてください。 バニラテンプレートで使用されているように、素のhtml/css/jsファイルをアセットとして使用できます。 もちろん、複雑なビルドシステムを使用することも可能ですが、必須要件ではありません。
|
||||
|
||||
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:
|
||||
`wails build`コマンドを実行すると、プロジェクトルートディレクトリに存在するプロジェクト構成ファイルである`wails.json`のチェックが行われます。 プロジェクトファイルには、次の2つのキーを含めることができます:
|
||||
|
||||
- "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.
|
||||
1番目のキーは、`frontend`ディレクトリにおいて、nodeモジュールをインストールするためのコマンドを指定します。 2番目のキーは、`frontend`ディレクトリにおいて、フロントエンドをビルドするためのコマンドを指定します。
|
||||
|
||||
If these 2 keys aren't given, then Wails does absolutely nothing with the frontend. It is only expecting that `embed.FS`.
|
||||
2つのキーのどちらともが指定されていない場合、Wailsはフロントエンドプロジェクトに対する操作を一切行いません。 `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.
|
||||
Wails v2では必要に応じて、`options.App`の中に`http.Handler`を定義することができます。これにより、アセットサーバにフックして、その場でファイルを作成したり、POST/PUTリクエストを処理したりすることができます。 GETリクエストが要求されたときは、まず初めに、`assets` FSにハンドリングされます。 リクエストされたファイルをFSが見つけられなかった場合、そのリクエストは`http.Handler`に転送されます。 GET以外のリクエストは、`AssetsHandler`が指定されていれば、当該ハンドラによって直接処理されます。 なお、`Assets`オプションに`nil`を指定することで、`AssetsHandler`のみを使用することも可能です。
|
||||
|
||||
## 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.
|
||||
`wails dev`コマンドを実行すると、ビルトイン開発サーバが起動し、プロジェクトディレクトリ内のファイル監視が開始されます。 デフォルトでは、ファイルの中身が変更された場合、Wailsはそのファイルがアプリケーションファイルであるかどうかをチェックします(デフォルト: `.go`、 `-e`フラグで制御可能)。 アプリケーションファイルであった場合は、アプリケーションをリビルドして再起動します。 アセットディレクトリ内でファイルが変更された場合は、少し経ってからリロードが実行されます。
|
||||
|
||||
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.
|
||||
開発サーバは"デバウンシング"と呼ばれるテクニックを使用しています。これにより、短時間で複数のファイルが更新されたとしても、すぐに再読み込みされることはありません。 トリガーが起動すると、再読み込みを実行する前に一定時間待機します。 待機中に別のトリガーが起動した場合、待機時間はリセットされます。 デフォルトでは、待機時間は`100ms`です。 この待機時間の値があなたのプロジェクトで適切ではない場合、`-debounce`フラグを使用して変更することができます。 このフラグを使用すると、値がプロジェクト構成ファイルに保存され、次回以降のデフォルト値となります。
|
||||
|
||||
## 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.
|
||||
フレームワークによっては独自のライブリロードサーバが付属しているものがありますが、それらはWailsのGoバインディングを使用することができません。 このような場面では、Wailsが監視するビルドディレクトリ内で、プロジェクトをリビルドする監視スクリプトを実行すると良いでしょう。 例としては、[rollup](https://rollupjs.org/guide/en/)を使用するデフォルトのsvelteテンプレートをご覧ください。 また[create-react-app](https://create-react-app.dev/)を使用する場合、[このスクリプト](https://gist.github.com/int128/e0cdec598c5b3db728ff35758abdbafd)を使用すると同様の結果を得ることができます。
|
||||
|
||||
## Go Module
|
||||
## Goモジュール
|
||||
|
||||
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.
|
||||
デフォルトのWailsテンプレートは、モジュール名が"changeme"となっている`go.mod`ファイルを生成します。 プロジェクトの生成が完了したら、適切なモジュール名に変更してください。
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Frontend
|
||||
# フロントエンド
|
||||
|
||||
## Script Injection
|
||||
## スクリプトの注入
|
||||
|
||||
When Wails serves your `index.html`, by default, it will inject 2 script entries into the `<body>` tag to load `/wails/ipc.js` and `/wails/runtime.js`. These files install the bindings and runtime respectively.
|
||||
Wailsが`index.html`を提供するとき、デフォルトでは、`<body>`タグ内に`/wails/ipc.js`および`/wails/runtime.js`の2つのスクリプトを読み込む行を注入します。 これらのスクリプトファイルは、バインディングおよびランタイムを提供しています。
|
||||
|
||||
The code below shows where these are injected by default:
|
||||
デフォルトでどの位置にスクリプトが注入されるかを、下記のコードに示します:
|
||||
|
||||
```html
|
||||
<html>
|
||||
@ -28,25 +28,25 @@ The code below shows where these are injected by default:
|
||||
</html>
|
||||
```
|
||||
|
||||
### Overriding Default Script Injection
|
||||
### デフォルトのスクリプト注入の上書き
|
||||
|
||||
To provide more flexibility to developers, there is a meta tag that may be used to customise this behaviour:
|
||||
開発者がより柔軟に対応できるように、これらの動作をカスタマイズするためのメタタグが用意されています:
|
||||
|
||||
```html
|
||||
<meta name="wails-options" content="[options]" />
|
||||
```
|
||||
|
||||
The options are as follows:
|
||||
オプションは次のとおりです:
|
||||
|
||||
| Value | Description |
|
||||
| ------------------- | ------------------------------------------------ |
|
||||
| noautoinjectruntime | Disable the autoinjection of `/wails/runtime.js` |
|
||||
| noautoinjectipc | Disable the autoinjection of `/wails/ipc.js` |
|
||||
| noautoinject | Disable all autoinjection of scripts |
|
||||
| 値 | 説明 |
|
||||
| ------------------- | ------------------------------- |
|
||||
| noautoinjectruntime | `/wails/runtime.js`の自動注入を無効化します |
|
||||
| noautoinjectipc | `/wails/ipc.js`の自動注入を無効化します |
|
||||
| noautoinject | すべてのスクリプトの自動注入を無効化します |
|
||||
|
||||
Multiple options may be used provided they are comma seperated.
|
||||
カンマで区切ることで、複数のオプションを指定できます。
|
||||
|
||||
This code is perfectly valid and operates the same as the autoinjection version:
|
||||
次のコードは、自動注入版のコードと完全に同じ挙動となります:
|
||||
|
||||
```html
|
||||
<html>
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Linux Distro Support
|
||||
# Linuxディストリビューションサポート
|
||||
|
||||
## Overview
|
||||
## 概要
|
||||
|
||||
Wails offers Linux support but providing installation instructions for all available distributions is an impossible task. Instead, Wails tries to determine if the packages you need to develop applications are available via your system's package manager. Currently, we support the following package managers:
|
||||
WailsはLinuxをサポートしていますが、すべてのLinuxディストリビューションに対してインストール手段を提供することは困難であるため、行っていません。 その代わりにWailsでは、アプリケーション開発に必要なパッケージが、システムのパッケージマネージャを介して利用可能かどうかを判断します。 現在、以下のパッケージマネージャをサポートしています:
|
||||
|
||||
- apt
|
||||
- dnf
|
||||
@ -12,11 +12,11 @@ Wails offers Linux support but providing installation instructions for all avail
|
||||
- pacman
|
||||
- zypper
|
||||
|
||||
## Adding package names
|
||||
## パッケージ名の追加
|
||||
|
||||
There may be circumstances where your distro uses one of the supported package managers but the package name is different. For example, you may use an Ubuntu derivative, but the package name for gtk may be different. Wails attempts to find the correct package by iterating through a list of package names. The list of packages are stored in the packagemanager specific file in the `v2/internal/system/packagemanager` directory. In our example, this would be `v2/internal/system/packagemanager/apt.go`.
|
||||
あなたが使用しているディストリビューションが、Wailsがサポートしているパッケージマネージャを使用していたとしても、パッケージ名が想定と異なっている場合があります。 例えば、Ubuntuの派生ディストリビューションを使用している場合、gtkのパッケージ名が異なる場合があります。 Wailsは、パッケージ名のリストを繰り返し処理することで、正しいパッケージを見つけようと試みます。 パッケージ名のリストは、`v2/internal/system/packagemanager`ディレクトリ内に、パッケージマネージャごとのファイルで格納されています。 下記は、`v2/internal/system/packagemanager/apt.go`の例です。
|
||||
|
||||
In this file, the list of packages are defined by the `Packages()` method:
|
||||
このファイルでは、パッケージのリストは`Packages()`メソッドによって定義されています:
|
||||
|
||||
```go
|
||||
func (a *Apt) Packages() packagemap {
|
||||
@ -43,7 +43,7 @@ func (a *Apt) Packages() packagemap {
|
||||
}
|
||||
```
|
||||
|
||||
Let's assume that in our linux distro, `libgtk-3` is packaged under the name `lib-gtk3-dev`. We could add support for this by adding the following line:
|
||||
お使いのLinuxディストリビューションが、`libgtk-3`パッケージが`lib-gtk3-dev`という名前で配布されていると仮定しましょう。 その場合、次の行を追加することで、対応することができます:
|
||||
|
||||
```go {5}
|
||||
func (a *Apt) Packages() packagemap {
|
||||
@ -71,12 +71,12 @@ func (a *Apt) Packages() packagemap {
|
||||
}
|
||||
```
|
||||
|
||||
## Adding new package managers
|
||||
## パッケージマネージャの追加
|
||||
|
||||
To add a new package manager, perform the following steps:
|
||||
新しいパッケージマネージャを追加するには、次の手順を実行します:
|
||||
|
||||
- Create a new file in `v2/internal/system/packagemanager` called `<pm>.go`, where `<pm>` is the name of the package manager.
|
||||
- Define a struct that conforms to the package manager interface defined in `pm.go`:
|
||||
- `v2/internal/system/packagemanager`に、`<pm>.go`という名前の新しいファイルを作成します。`<pm>`はパッケージマネージャの名前です。
|
||||
- `pm.go`の中で、PackageManagerインターフェースを実装した構造体を定義します:
|
||||
|
||||
```go
|
||||
type PackageManager interface {
|
||||
@ -88,13 +88,13 @@ type PackageManager interface {
|
||||
}
|
||||
```
|
||||
|
||||
- `Name()` should return the name of the package manager
|
||||
- `Packages()` should return a `packagemap`, that provides candidate filenames for dependencies
|
||||
- `PackageInstalled()` should return `true` if the given package is installed
|
||||
- `PackageAvailable()` should return `true` if the given package is not installed but available for installation
|
||||
- `InstallCommand()` should return the exact command to install the given package name
|
||||
- `Name()`メソッドで、パッケージマネージャの名前を返すように実装します。
|
||||
- `Packages()`メソッドで、依存関係の候補ファイル名を提供する`packagemap`を返すように実装します。
|
||||
- `PackageInstalled()`メソッドで、引数で渡されたパッケージがすでにインストールされている場合は`true`を返すように実装します。
|
||||
- `PackageAvailable()`メソッドで、引数で指定されたパッケージがインストールはされていないけれどもインストール可能であるなら`true`を返すように実装します。
|
||||
- `InstallCommand()`メソッドで、引数で指定されたパッケージをインストールするための正確なコマンドを返すように実装します。
|
||||
|
||||
Take a look at the other package managers code to get an idea how this works.
|
||||
他のパッケージマネージャのコードを参考にして、これらのコードがどのように動作するか把握してください。
|
||||
|
||||
:::info リマインド
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Linux
|
||||
|
||||
This page has miscellaneous guides related to developing Wails applications for Linux.
|
||||
このページでは、Linux向けのWailsアプリケーション開発に関する、様々なガイドを掲載しています。
|
||||
|
||||
## Video tag doesn't fire "ended" event
|
||||
## videoタグが"ended"イベントを発火しない
|
||||
|
||||
When using a video tag, the "ended" event is not fired when the video is finished playing. This is a bug in WebkitGTK, however you can use the following workaround to fix it:
|
||||
videoタグを使用している場合、ビデオの再生が終了しても"ended"イベントが発火しません。 これはWebkitのバグであり、次のような回避策を講じることで修正できます:
|
||||
|
||||
```js
|
||||
videoTag.addEventListener("timeupdate", (event) => {
|
||||
@ -15,4 +15,4 @@ videoTag.addEventListener("timeupdate", (event) => {
|
||||
});
|
||||
```
|
||||
|
||||
Source: [Lyimmi](https://github.com/Lyimmi) on the [discussions board](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275)
|
||||
出典: [ディスカッションボード](https://github.com/wailsapp/wails/issues/1729#issuecomment-1212291275)における[Lyimmi](https://github.com/Lyimmi)のコメント
|
||||
|
@ -1,36 +1,36 @@
|
||||
# Local Development
|
||||
# ローカル開発
|
||||
|
||||
## Overview
|
||||
## 概要
|
||||
|
||||
Wails is in constant development and new releases are regularly "tagged". This usually happens when all the newer code on `master` has been tested and confirmed working. If you need a bugfix or feature that has not yet made it to a release, it's possible to use the latest "bleeding edge" version using the following steps:
|
||||
Wailsは現在も継続的に開発されており、定期的に、新しいリリースに対して"タグ付け"が行われています。 "タグ付け"は通常、`master`ブランチに存在する新しいコードがすべてテストされ、正常な動作が確認されたときに行われます。 まだリリースされていない新機能やバグフィックスを利用したい場合、以下の手順で"ブリーディング・エッジ"版を使用できます:
|
||||
|
||||
- `git clone https://github.com/wailsapp/wails`
|
||||
- `cd wails/v2/cmd/wails`
|
||||
- `go install`
|
||||
|
||||
NOTE: The directory that you cloned the project into will now be called "clonedir".
|
||||
注意: このページでは、Wailsプロジェクトをクローンしたディレクトリのことを"clonedir"と記します。
|
||||
|
||||
The Wails CLI will now be at the very latest version.
|
||||
この手順により、Wails CLIは一番最新のバージョンとなります。
|
||||
|
||||
### Updating your project
|
||||
### 自身のプロジェクトの更新
|
||||
|
||||
To update projects to use the latest version of the Wails library, update the project's `go.mod` and ensure the following line is at the bottom of the file:
|
||||
クローンした最新バージョンのWailsライブラリを自身のプロジェクトで使用させたい場合、`go.mod`ファイルの末尾に次の行を追記してください:
|
||||
|
||||
`replace github.com/wailsapp/wails/v2 => <clonedir>`
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
On Windows: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2`
|
||||
Windowsの場合: `replace github.com/wailsapp/wails/v2 => C:\Users\leaan\Documents\wails-v2-beta\wails\v2`
|
||||
|
||||
On 'nix: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2`
|
||||
'nixの場合: `replace github.com/wailsapp/wails/v2 => /home/me/projects/wails/v2`
|
||||
|
||||
To revert to a stable version, run:
|
||||
安定バージョンに戻す場合は、次のコマンドを実行します:
|
||||
|
||||
`go install github.com/wailsapp/wails/v2/cmd/wails@latest`
|
||||
|
||||
## Testing a Branch
|
||||
## ブランチのテスト
|
||||
|
||||
If you want to test a branch, follow the instructions above, but ensure you switch the branch you want to test before installing:
|
||||
先述の手順に従えば、ブランチをテストすることができますが、インストールを実行する前に、テスト対象のブランチに切り替えるようにしてください:
|
||||
|
||||
- `git clone https://github.com/wailsapp/wails`
|
||||
- `cd wails`
|
||||
@ -38,11 +38,11 @@ If you want to test a branch, follow the instructions above, but ensure you swit
|
||||
- `cd v2/cmd/wails`
|
||||
- `go install`
|
||||
|
||||
Make sure you [update your project](#updating-your-project) as described above.
|
||||
そして、先述のとおり[自身のプロジェクトを更新](#updating-your-project)してください。
|
||||
|
||||
## Testing a PR
|
||||
## プルリクエストのテスト
|
||||
|
||||
If you want to test a PR, follow the instructions above, but ensure you fetch the PR and switch the branch before installing. Please replace `[IDofThePR]` with the ID of the PR shown on github.com:
|
||||
先述の手順に従えば、プルリクエストをテストすることができますが、インストールを実行する前に、テスト対象のプルリクエストを取得してブランチを切り替えるようにしてください。 下記手順の`[IDofThePR]`の部分は、github.comで表示されているプルリクエストのIDに置き換えてください:
|
||||
|
||||
- `git clone https://github.com/wailsapp/wails`
|
||||
- `cd wails`
|
||||
@ -52,4 +52,4 @@ If you want to test a PR, follow the instructions above, but ensure you fetch th
|
||||
- `cd v2/cmd/wails`
|
||||
- `go install`
|
||||
|
||||
Make sure you [update your project](#updating-your-project) as described above.
|
||||
そして、先述のとおり[自身のプロジェクトを更新](#updating-your-project)してください。
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac向けApp Storeガイド
|
||||
|
||||
このページでは、WailsアプリをMac向けApp Storeで公開する方法について、概要を説明します。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- Apple Developerアカウントを所持しておく必要があります。 詳しくは、[Apple Developer Program](https://developer.apple.com/support/compare-memberships/)のサイトを確認してください。
|
||||
- 開発者ポータルで、証明書、ID、アプリを作成しておく必要があります。 詳しくは以下の手順に従ってください。
|
||||
- Xcodeコマンドラインツールを、あなたのローカルマシンにインストールしておく必要があります。
|
||||
|
||||
#### Create Certificates and Identifiers
|
||||
|
||||
1. Go to your [Apple Developer Account](https://developer.apple.com/account/)
|
||||
2. Under `Certificates, Identifiers & Profiles`, click `Identifiers` and Register a New App ID. Use the format (com.example.app)
|
||||
3. Under the same page click `Certificates` and generate new Certificates for Mac App Store Distribution. Download them and import the certificates into Keychain on your local machine.
|
||||
|
||||
#### Create App Submission
|
||||
|
||||
1. Go to the [App Store Connect Site](https://appstoreconnect.apple.com/apps)
|
||||
2. Register a new application and link the bundle ID that you created in the previous step
|
||||
3. Populate your app with the correct screen shots, descriptions, etc. as required by Apple
|
||||
4. Create a new version of your app
|
||||
|
||||
|
||||
## Mac App Store Process
|
||||
|
||||
#### Enable Apple's App Sandbox
|
||||
|
||||
Apps submitted to the Mac App Store must run under Apple's [App Sandbox](https://developer.apple.com/app-sandboxing/). You must create an `entitlements.plist` file for this to work. The recommendation is to create this file under this path `{PROJECT_DIR}/build/darwin/entitlements.plist`.
|
||||
|
||||
**Example Entitlements File**
|
||||
|
||||
This is an example entitlements file from the [RiftShare](https://github.com/achhabra2/riftshare) app. For reference please put in the entitlements your app requires. Refer to [this site](https://developer.apple.com/documentation/bundleresources/entitlements) for more information.
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### Build and Sign the App Package
|
||||
|
||||
The following is an example script for building and signing your app for Mac App Store submission. It assumes you are running the script from your root project directory.
|
||||
|
||||
Note the certificates for signing the app and signing the installer are different. Please make sure both are imported into Keychain. Find the strings in Keychain and insert them below. Populate your certificate names, and app name below. Running the following script will generate a signed `app.pkg` file in the root directory of your app.
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### Upload App Bundle
|
||||
|
||||
You will need to upload the generated package file and associate it to your Application before you will be able to submit it for review.
|
||||
|
||||
1. Download the [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784) from the Mac App Store
|
||||
2. Open it and sign in with your Apple ID
|
||||
3. Click the + sign and select the `APP_NAME.pkg` file that you generated in the previous step. Upload it
|
||||
4. Go back to the [App Store Connect](https://appstoreconnect.apple.com/apps) site and navigate back into your app submission. Select the version that you are ready to make available on the App Store. Under `Build` select the package that you uploaded via Transporter.
|
||||
|
||||
That's it! You can now use the site to submit your App for review. After a few business days if all goes well you should see your App live on the Mac App Store.
|
@ -1,4 +1,4 @@
|
||||
# Troubleshooting
|
||||
# トラブルシューティング
|
||||
|
||||
An assortment of troubleshooting tips.
|
||||
|
||||
|
@ -4,7 +4,7 @@ sidebar_position: 20
|
||||
|
||||
# どうやって動いているの?
|
||||
|
||||
Wailsは、webkitフロントエンドを備えた、何の変哲もないGoアプリです。 アプリ全体のうちGoの部分は、アプリのコードと、ウィンドウ制御などの便利な機能を提供するランタイムライブラリで構成されています。 フロントエンドはwebkitウィンドウであり、フロンドエンドアセットをウィンドウ上に表示します。 Also available to the frontend is a JavaScript version of the runtime library. Finally, it is possible to bind Go methods to the frontend, and these will appear as JavaScript methods that can be called, just as if they were local JavaScript methods.
|
||||
Wailsは、webkitフロントエンドを備えた、何の変哲もないGoアプリです。 アプリ全体のうちGoの部分は、アプリのコードと、ウィンドウ制御などの便利な機能を提供するランタイムライブラリで構成されています。 フロントエンドはwebkitウィンドウであり、フロンドエンドアセットをウィンドウ上に表示します。 フロントエンドからも、JavaScriptでランタイムライブラリを呼び出すことができます。 そして最終的に、Goのメソッドはフロントエンドにバインドされ、ローカルのJavaScriptメソッドであるかのように、フロントエンドから呼び出すことができます。
|
||||
|
||||
```mdx-code-block
|
||||
<div className="text--center">
|
||||
@ -103,13 +103,13 @@ var assets embed.FS
|
||||
|
||||
#### アプリのライフサイクル
|
||||
|
||||
フロントエンドが`index.html`を読み込もうとする直前に、[OnStartup](reference/options.mdx#onstartup)で指定されたメソッドがコールバックされます。 A standard Go context is passed to this method. このメソッドに引数で渡されるContextは、今後、Wailsのラインタイムを呼び出すときに必要になるため、通常は、このContextへの参照を保持しておいてください。 同様に、アプリがシャットダウンされる直前には、[OnShutdown](reference/options.mdx#onshutdown)で指定されたコールバックが呼び出され、Contextも渡されます。 There is also an [OnDomReady](reference/options.mdx#ondomready) callback for when the frontend has completed loading all assets in `index.html` and is equivalent of the [`body onload`](https://www.w3schools.com/jsref/event_onload.asp) event in JavaScript. また、[OnBeforeClose](reference/options.mdx#onbeforeclose)を指定すると、ウィンドウを閉じる(またはアプリを終了する)イベントにフックさせることもできます。
|
||||
フロントエンドが`index.html`を読み込もうとする直前に、[OnStartup](reference/options.mdx#onstartup)で指定されたメソッドがコールバックされます。 Goの標準的なcontextがこのメソッドに渡されます。 このメソッドに引数で渡されるContextは、今後、Wailsのラインタイムを呼び出すときに必要になるため、通常は、このContextへの参照を保持しておいてください。 同様に、アプリがシャットダウンされる直前には、[OnShutdown](reference/options.mdx#onshutdown)で指定されたコールバックが呼び出され、Contextも渡されます。 `index.html`に含まれるすべてのアセットが読み込み終わったときに呼び出される[OnDomReady](reference/options.mdx#ondomready)コールバックもあります。これは、JavaScriptの[`body onload`](https://www.w3schools.com/jsref/event_onload.asp)イベントと同等のものです。 また、[OnBeforeClose](reference/options.mdx#onbeforeclose)を指定すると、ウィンドウを閉じる(またはアプリを終了する)イベントにフックさせることもできます。
|
||||
|
||||
#### メソッドのバインド
|
||||
|
||||
`Bind`オプションは、Wailsアプリで最も重要なオプションの1つです。 このオプションでは、フロントエンドに公開する、構造体のメソッドを指定することができます。 構造体は、従来のWebアプリにおける"コントローラ"の立ち位置であるとお考えください。 When the application starts, it examines the struct instances listed in the `Bind` field in the options, determines which methods are public (starts with an uppercase letter) and will generate JavaScript versions of those methods that can be called by the frontend code.
|
||||
`Bind`オプションは、Wailsアプリで最も重要なオプションの1つです。 このオプションでは、フロントエンドに公開する、構造体のメソッドを指定することができます。 構造体は、従来のWebアプリにおける"コントローラ"の立ち位置であるとお考えください。 アプリが起動すると、`Bind`オプションで指定されている構造体を対象に、その中にあるパブリックメソッド(大文字で始まるメソッド名)を探します。そして、フロントエンドのコードからそれらのメソッドを呼び出せるJavaScriptが生成されます。
|
||||
|
||||
:::info Note
|
||||
:::info 備考
|
||||
|
||||
Wailsで構造体を正しくバインドするためには、構造体の*インスタンス*をオプションで指定してください。
|
||||
|
||||
@ -184,9 +184,9 @@ func (a *App) Greet(name string) string {
|
||||
|
||||
`wails dev`コマンド(または、`wails generate module`コマンド)を実行すると、以下のものを含むフロントエンドモジュールが生成されます:
|
||||
|
||||
- JavaScript bindings for all bound methods
|
||||
- TypeScript declarations for all bound methods
|
||||
- TypeScript definitions for all Go structs used as inputs or outputs by the bound methods
|
||||
- バインドされたすべてのメソッドのJavaScript
|
||||
- バインドされたすべてのメソッドのTypeScript宣言
|
||||
- バインドされたメソッドの引数または返り値で使用されているGoの構造体のTypeScript宣言
|
||||
|
||||
これにより、強力な型付けがなされたデータ構造を使用して、フロントエンドから簡単にGoのコードを呼び出すことができます。
|
||||
|
||||
@ -201,7 +201,7 @@ func (a *App) Greet(name string) string {
|
||||
|
||||
### バインドされたGoメソッドの呼び出し
|
||||
|
||||
When you run your application with `wails dev`, it will automatically generate JavaScript bindings for your structs in a directory called `wailsjs/go` (You can also do this by running `wails generate module`). 生成されたファイルには、アプリ内のGoパッケージ名が反映されています。 先の例では、`Greet`というパブリックメソッドを持つ`app`をバインドしていました。 この場合、次のようなファイルが生成されることになります:
|
||||
`wails dev`コマンドでアプリを起動すると、Go構造体のJavaScriptバインディングが`wailsjs/go`ディレクトリに自動的に生成されます(`wails generate module`コマンドでも生成可能)。 生成されたファイルには、アプリ内のGoパッケージ名が反映されています。 先の例では、`Greet`というパブリックメソッドを持つ`app`をバインドしていました。 この場合、次のようなファイルが生成されることになります:
|
||||
|
||||
```bash
|
||||
wailsjs
|
||||
@ -211,7 +211,7 @@ wailsjs
|
||||
└─App.js
|
||||
```
|
||||
|
||||
Here we can see that there is a `main` package that contains the JavaScript bindings for the bound `App` struct, as well as the TypeScript declaration file for those methods. To call `Greet` from our frontend, we simply import the method and call it like a regular JavaScript function:
|
||||
ご覧のとおり、`main`パッケージ内の`App`構造体JavaScriptバインディングが、それらのメソッドのTypeScript型定義と並んで生成されていることが分かります。 フロントエンドから`Greet`メソッドを呼び出すには、単純にメソッドをインポートし、通常のJavaScript関数と同じように呼び出してください:
|
||||
|
||||
```javascript
|
||||
// ...
|
||||
@ -224,27 +224,27 @@ import {Greet} from '../wailsjs/go/main/App'
|
||||
}
|
||||
```
|
||||
|
||||
The TypeScript declaration file gives you the correct types for the bound methods:
|
||||
TypeScript型定義ファイルは、バインドされたメソッドの正しい型を提供します:
|
||||
|
||||
```ts
|
||||
export function Greet(arg1: string): Promise<string>;
|
||||
```
|
||||
|
||||
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 In the example above, `Greet` only returns a `string` so the JavaScript call will never reject - unless invalid data is passed to it.
|
||||
生成されたメソッドはPromiseを返すようになっています。 呼び出しが成功すると、Goからの1番目の返り値が`resolve`ハンドラに渡されます。 呼び出しに失敗したとみなされるのは、Goメソッドの2番目の返り値がerror型で、それがerrorインスタンスを返したときです。 これは、`reject`ハンドラを介して返されます。 先の例では、`Greet`メソッドは`string`型の返り値のみであるため、無効なデータが渡されない限り、JavaScript側でrejectハンドラが呼ばれることはありません。
|
||||
|
||||
All data types are correctly translated between Go and JavaScript. もちろん構造体も正しく解釈されます。 If you return a struct from a Go call, it will be returned to your frontend as a JavaScript class.
|
||||
すべてのデータ型は、GoとJavaScriptの間で正しく解釈されます。 もちろん構造体も正しく解釈されます。 Goから構造体が返された場合、フロントエンドにはJavaScriptのクラスとして返されます。
|
||||
|
||||
:::info Note
|
||||
:::info 備考
|
||||
|
||||
Struct fields *must* have a valid `json` tag to be included in the generated TypeScript.
|
||||
TypeScript型定義を正しく自動生成するために、構造体のフィールドには、有効な`json`タグを*必ず*付与するようにしてください。
|
||||
|
||||
ネストされた匿名構造体(無名構造体) は、現時点ではサポートされていません。
|
||||
|
||||
:::
|
||||
|
||||
Goに対して引数として構造体を渡すこともできます。 Any JavaScript map/class passed as an argument that is expecting a struct, will be converted to that struct type. あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 Using this module, it's possible to construct and send native JavaScript objects to the Go code.
|
||||
Goに対して引数として構造体を渡すこともできます。 構造体として取り扱ってほしいJavaScriptのマップやクラスを渡すと、構造体に変換されます。 あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 このモジュールを使用すると、JavaScriptネイティブなオブジェクトを構築し、Goコードへ送信することができます。
|
||||
|
||||
また、シグネチャに構造体を使用するGoメソッドもサポートされています。 All Go structs specified by a bound method (either as parameters or return types) will have TypeScript versions auto generated as part of the Go code wrapper module. Using these, it's possible to share the same data model between Go and JavaScript.
|
||||
また、シグネチャに構造体を使用するGoメソッドもサポートされています。 バインドされたメソッドで、引数または返り値として指定されているすべてのGo構造体は、Goのコードラッパーモジュールの一部として生成されたTypeScript定義を持っています。 れらを使用することで、GoとJavaScriptの間で、同じデータモデルを共有できます。
|
||||
|
||||
例: `Greet`メソッドを更新して、文字列型の代わりに`Person`型を引数で受け付けてみる:
|
||||
|
||||
@ -358,7 +358,7 @@ function generate() {
|
||||
|
||||
### ランタイムメソッドの呼び出し
|
||||
|
||||
The JavaScript runtime is located at `window.runtime` and contains many methods to do various tasks such as emit an event or perform logging operations:
|
||||
Javascriptランタイムは`window.runtime`に存在し、イベント発行やロギングなど、さまざまなタスクを実行するためのメソッドが含まれています:
|
||||
|
||||
```js title="mycode.js"
|
||||
window.runtime.EventsEmit("my-event", 1);
|
||||
|
@ -13,8 +13,8 @@ Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの
|
||||
- ネイティブなメニュー、ダイアログ、テーマ、透過処理を使用可能です
|
||||
- Windows、macOS、Linuxをサポートしています
|
||||
- Svelte、React、Preact、Vue、Lit、バニラJS向けにビルトインテンプレートを用意しています
|
||||
- Easily call Go methods from JavaScript
|
||||
- Automatic Go struct to TypeScript model generation
|
||||
- GoメソッドをJavaScriptから簡単に呼び出せます
|
||||
- Go構造体に対応するTypeScript型定義を自動生成します
|
||||
- WindowsにおいてCGOや外部DLLは必要ありません
|
||||
- [Vite](https://vitejs.dev/)の力を利用したライブ開発が可能です
|
||||
- アプリケーションを簡単に作成、ビルド、パッケージングするための強力なCLIを備えています
|
||||
@ -36,7 +36,7 @@ Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの
|
||||
|
||||
### クイックスタートテンプレート
|
||||
|
||||
Wailsには、アプリの開発をすばやく始められるように、多数のテンプレートが用意されています。 Svelte、React、Vue、Preact、LitおよびVanilla用で、それぞれのテンプレートがあります。 There are both JavaScript and TypeScript versions for each template.
|
||||
Wailsには、アプリの開発をすばやく始められるように、多数のテンプレートが用意されています。 Svelte、React、Vue、Preact、Lit向け、およびバニラなJavaScript用で、それぞれのテンプレートがあります。 各テンプレートには、Javascript版とTypescript版が用意されています。
|
||||
|
||||
### ネイティブ要素
|
||||
|
||||
@ -44,13 +44,13 @@ Wailsは、ウィンドウ、メニュー、ダイアログなどのネイティ
|
||||
|
||||
**ブラウザを埋め込まないため**、無駄なリソースを割きません。 ブラウザを埋め込まない代わりに、OSプラットフォームのネイティブなレンダリングエンジンを使用します。 例えばWindowsの場合、Chromium上でビルトされているMicrosoft Webview2ライブラリを使用します。
|
||||
|
||||
### Go & JavaScript Interoperability
|
||||
### GoとJavascriptのやり取り
|
||||
|
||||
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.
|
||||
Wailsは自動的に、GoのメソッドをJavascriptから利用できるようにするので、フロントエンドからGoのメソッド名を呼び出すことができます。 Goメソッドが使用する構造体を表すTypeScritpt型定義も自動生成されるため、GoとJavaScriptの間で同じデータ構造をやり取りすることができます。
|
||||
|
||||
### ランタイムライブラリ
|
||||
|
||||
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.
|
||||
WailsはGoとJavascriptの両方にランタイムライブラリを提供し、イベント、ロギング、ダイアログなど、モダンなアプリに必要な多くの機能を使うことができます。
|
||||
|
||||
### ライブ開発
|
||||
|
||||
|
@ -12,7 +12,7 @@ WailsのCLIには、プロジェクトの管理に使用できるコマンドが
|
||||
|
||||
`wails init`はプロジェクトの生成に使用します。
|
||||
|
||||
| フラグ | Description | デフォルト |
|
||||
| フラグ | 説明 | デフォルト |
|
||||
|:----------------- |:----------------------------------------------------------------------------- |:-------:|
|
||||
| -n "プロジェクト名" | プロジェクトの名前。 **必須項目**。 | |
|
||||
| -d "プロジェクトディレクトリ" | 作成するプロジェクトディレクトリ | プロジェクト名 |
|
||||
@ -37,11 +37,11 @@ WailsではGitHubでホストされているリモートテンプレートをサ
|
||||
|
||||
コミュニティがメンテナンスしているテンプレートの一覧は[こちら](../community/templates.mdx)をご覧ください。
|
||||
|
||||
:::warning Attention
|
||||
:::warning 注意
|
||||
|
||||
**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!**
|
||||
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
|
||||
|
||||
If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed.
|
||||
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
|
||||
|
||||
:::
|
||||
|
||||
@ -49,7 +49,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
|
||||
`wails build`は、プロジェクトを本番配布用のバイナリにコンパイルするときに使用します。
|
||||
|
||||
| フラグ | Description | デフォルト |
|
||||
| フラグ | 説明 | デフォルト |
|
||||
|:-------------------- |:-------------------------------------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| -platform | 指定された[プラットフォーム](../reference/cli.mdx#platforms)(カンマ区切り) 向けにビルドする。例: `windows/arm64`。 アーキテクチャを指定しない場合は、`runtime.GOARCH`の値が使用されます。 | platform = `GOOS` environment variable if given else `runtime.GOOS`.<br/>arch = `GOARCH` envrionment variable if given else `runtime.GOARCH`. |
|
||||
| -clean | `build/bin`ディレクトリをクリーンする | |
|
||||
@ -76,7 +76,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
|
||||
標準のGoツールを使用してビルドしたい場合は、[手動ビルド](../guides/manual-builds.mdx)ガイドをご覧ください。
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
@ -100,7 +100,7 @@ AppleシリコンにおけるUPXの使用には[既知の問題](https://github.
|
||||
|
||||
サポートされているプラットフォームは次のとおりです:
|
||||
|
||||
| プラットフォーム | Description |
|
||||
| プラットフォーム | 説明 |
|
||||
|:---------------- |:-------------------------------- |
|
||||
| darwin | MacOS + ビルドマシンのアーキテクチャ |
|
||||
| darwin/amd64 | MacOS 10.13+ AMD64 |
|
||||
@ -117,7 +117,7 @@ AppleシリコンにおけるUPXの使用には[既知の問題](https://github.
|
||||
|
||||
`wails doctor`は、あなたのコンピュータで開発の準備が整っているかを診断します。
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
```
|
||||
Wails CLI v2.0.0-beta
|
||||
@ -157,12 +157,12 @@ Your system is ready for Wails development!
|
||||
- `http://localhost:34115`でWebサーバが起動し、HTTP経由でアプリケーション(フロントエンドだけではありません)が提供されます。 これにより、任意のブラウザ拡張機能を使用することができます
|
||||
- すべてのアプリケーションアセットはディスクから読み込まれます。 アセットが変更された場合、アプリケーションは自動的に、リビルドではなくリロードされます。 接続されているすべてのブラウザもリロードされます
|
||||
- 以下を提供するJSモジュールが生成されます:
|
||||
- JavaScript wrappers of your Go methods with autogenerated JSDoc, providing code hinting
|
||||
- コードヒントを提供してくれるJSDocが自動付与された、GoメソッドのJavaScriptラッパー
|
||||
- インスタンス生成したりGoメソッドに渡すことのできる、Go構造体のTypeScriptバージョン
|
||||
- ランタイム用のラッパーおよびTypeScript型定義を含むJSモジュールも生成されます
|
||||
- MacOSでは、アプリケーションを`.app`ファイルにバンドルして実行されます。 開発向けに、`build/darwin/Info.dev.plist`が使用されます。
|
||||
|
||||
| フラグ | Description | デフォルト |
|
||||
| フラグ | 説明 | デフォルト |
|
||||
|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------- |:--------------------- |
|
||||
| -assetdir "./path/to/assets" | 通常のアセットFSを使用する代わりに、指定されたディレクトリからアセットを提供する | `wails.json`で指定されている値 |
|
||||
| -browser | 起動時にブラウザで`http://localhost:34115`を開く | |
|
||||
@ -185,7 +185,7 @@ Your system is ready for Wails development!
|
||||
| -race | Goのrace detectorを使用してビルドする | false |
|
||||
| -s | フロントエンドのビルドをスキップ | false |
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
`wails dev -assetdir ./frontend/dist -wailsjsdir ./frontend/src -browser`
|
||||
|
||||
@ -204,7 +204,7 @@ Example:
|
||||
|
||||
Wailsは、プロジェクトの生成に必ずテンプレートを使用します。 `wails generate template`コマンドは、プロジェクト生成時に使用できるテンプレートの作成を支援します。
|
||||
|
||||
| フラグ | Description |
|
||||
| フラグ | 説明 |
|
||||
|:---------------- |:---------------------------- |
|
||||
| -name | テンプレート名 (必須項目) |
|
||||
| -frontend "path" | テンプレートで使用するフロントエンドプロジェクトへのパス |
|
||||
@ -219,7 +219,7 @@ Wailsは、プロジェクトの生成に必ずテンプレートを使用しま
|
||||
|
||||
`wails update`コマンドを実行すると、Wails CLIのバージョンをアップデートできます。
|
||||
|
||||
| フラグ | Description |
|
||||
| フラグ | 説明 |
|
||||
|:------------------ |:----------------------- |
|
||||
| -pre | 最新のプレリリースバージョンにアップデートする |
|
||||
| -version "version" | 特定のバージョンのCLIをインストールする |
|
||||
|
@ -2,11 +2,11 @@
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# Menus
|
||||
# メニュー
|
||||
|
||||
It is possible to add an application menu to Wails projects. This is achieved by defining a [Menu](#menu) struct and setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method [MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu).
|
||||
Wailsプロジェクトに、アプリケーションメニューを追加することができます。 [Menu](#menu)構造体を定義し、アプリケーション設定の[`Menu`](../reference/options.mdx#menu)オプションへ設定するか、ランタイムの[MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu)メソッドを呼び出すことで、メニューを表示させることができます。
|
||||
|
||||
An example of how to create a menu:
|
||||
メニューを作成する例:
|
||||
|
||||
```go
|
||||
AppMenu := menu.NewMenu()
|
||||
@ -35,7 +35,7 @@ An example of how to create a menu:
|
||||
|
||||
Menu構造体を更新し、[MenuUpdateApplicationMenu](../reference/runtime/menu.mdx#menuupdateapplicationmenu)メソッドを呼び出すことで、メニューを動的に更新することも可能です。
|
||||
|
||||
The example above uses helper methods, however it's possible to build the menu structs manually.
|
||||
上記の例では、ヘルパーメソッドを使用していますが、Menu構造体を手動で構築することも可能です。
|
||||
|
||||
## Menu
|
||||
|
||||
@ -47,19 +47,19 @@ type Menu struct {
|
||||
}
|
||||
```
|
||||
|
||||
For the Application menu, each MenuItem represents a single menu such as "Edit".
|
||||
アプリケーションメニューにおいて、各MenuItemは、"編集"などの単一メニューを表します。
|
||||
|
||||
A simple helper method is provided for building menus:
|
||||
メニューを構築するするためのシンプルなヘルパーメソッドが提供されています:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
func NewMenuFromItems(first *MenuItem, rest ...*MenuItem) *Menu
|
||||
```
|
||||
|
||||
This makes the layout of the code more like that of a menu without the need to add the menu items manually after creating them. Alternatively, you can just create the menu items and add them to the menu manually.
|
||||
これにより、コードのレイアウトが、実際のメニューと似たレイアウトになるため、メニュー項目を作成した後にそれを手動で追加するといった作業は必要なくなります。 ヘルパーを使用せず、メニュー項目を作成して手動でメニューに追加することもできます。
|
||||
|
||||
## MenuItem
|
||||
|
||||
A MenuItem represents an item within a Menu.
|
||||
MenuItemは、メニュー内の項目を表します。
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
// MenuItem represents a menu item contained in a menu
|
||||
@ -76,30 +76,30 @@ type MenuItem struct {
|
||||
}
|
||||
```
|
||||
|
||||
| フィールド | Type | Notes |
|
||||
| ----------- | ------------------------------------ | ------------------------------------------------------------- |
|
||||
| Label | string | The menu text |
|
||||
| Accelerator | [\*keys.Accelerator](#accelerator) | Key binding for this menu item |
|
||||
| Type | [Type](#type) | Type of MenuItem |
|
||||
| Disabled | bool | Disables the menu item |
|
||||
| Hidden | bool | Hides this menu item |
|
||||
| Checked | bool | Adds check to item (Checkbox & Radio types) |
|
||||
| SubMenu | [\*Menu](#menu) | Sets the submenu |
|
||||
| Click | [Callback](#callback) | Callback function when menu clicked |
|
||||
| Role | string | Defines a [role](#role) for this menu item. Mac only for now. |
|
||||
| フィールド | 型 | 内容 |
|
||||
| ----------- | ------------------------------------ | -------------------------------------------- |
|
||||
| Label | string | メニューのテキスト |
|
||||
| Accelerator | [\*keys.Accelerator](#accelerator) | このメニュー項目のキーバインディング |
|
||||
| 型 | [型](#type) | メニュー項目の種類 |
|
||||
| Disabled | bool | メニュー項目を無効化する |
|
||||
| Hidden | bool | メニュー項目を非表示にする |
|
||||
| Checked | bool | 項目にチェックを追加する (チェックボックス & ラジオタイプ) |
|
||||
| SubMenu | [\*Menu](#menu) | サブメニューを設定する |
|
||||
| Click | [Callback](#callback) | メニューがクリックされたときのコールバック関数 |
|
||||
| Role | string | メニュー項目に[ロール](#role)を定義する。 現在のところ、Macでのみ有効です。 |
|
||||
|
||||
### Accelerator
|
||||
|
||||
Accelerators (sometimes called keyboard shortcuts) define a binding between a keystroke and a menu item. Wails defines an Accelerator as a combination or key + [Modifier](#modifier). They are available in the `"github.com/wailsapp/wails/v2/pkg/menu/keys"` package.
|
||||
Accelerator(キーボードショートカット) は、キーストロークとメニュー項目とのバインドを定義します。 Wailsでは、Acceleratorを、キー + [Modifier](#modifier)の組み合わせとして定義しています。 これらは`"github.com/wailsapp/wails/v2/pkg/menu/keys"`パッケージから利用可能です。
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
||||
// Defines cmd+o on Mac and ctrl-o on Window/Linux
|
||||
myShortcut := keys.CmdOrCtrl("o")
|
||||
```
|
||||
|
||||
Keys are any single character on a keyboard with the exception of `+`, which is defined as `plus`. Some keys cannot be represented as characters so there are a set of named characters that may be used:
|
||||
キーは、`+`を除いて、キーボード上の任意の一文字です(`+`は、`plus`で定義されています)。 いくつかのキーは一文字で表現できないため、名前付き文字のセットがあります:
|
||||
|
||||
| | | | |
|
||||
|:-----------:|:-----:|:-----:|:---------:|
|
||||
@ -119,7 +119,7 @@ Keys are any single character on a keyboard with the exception of `+`, which is
|
||||
| `page up` | `f14` | `f39` | |
|
||||
| `page down` | `f15` | `f30` | |
|
||||
|
||||
Wails also supports parsing accelerators using the same syntax as Electron. This is useful for storing accelerators in config files.
|
||||
またWailsでは、Electronと同じ構文のAcceleratorを解析することもできます。 設定ファイルにAcceleratorを保存する際に便利です。
|
||||
|
||||
例:
|
||||
|
||||
@ -130,7 +130,7 @@ Wails also supports parsing accelerators using the same syntax as Electron. This
|
||||
|
||||
#### Modifier
|
||||
|
||||
The following modifiers are keys that may be used in combination with the accelerator key:
|
||||
ModifierはAcceleratorキーと組み合わせて使用できるキーです:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
||||
const (
|
||||
@ -145,7 +145,7 @@ const (
|
||||
)
|
||||
```
|
||||
|
||||
A number of helper methods are available to create Accelerators using modifiers:
|
||||
Modifierを使用してAcceleratorを作成するためのヘルパーメソッドがあります:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
||||
func CmdOrCtrl(key string) *Accelerator
|
||||
@ -154,16 +154,16 @@ func Shift(key string) *Accelerator
|
||||
func Control(key string) *Accelerator
|
||||
```
|
||||
|
||||
Modifiers can be combined using `keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`:
|
||||
Modifierは`keys.Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier)`を使用して組み合わせることができます:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu/keys"
|
||||
// Defines "Ctrl+Option+A" on Mac and "Ctrl+Alt+A" on Window/Linux
|
||||
myShortcut := keys.Combo("a", ControlKey, OptionOrAltKey)
|
||||
```
|
||||
|
||||
### Type
|
||||
### 型
|
||||
|
||||
Each menu item must have a type and there are 5 types available:
|
||||
各メニュー項目は5種類のうちの1タイプを指定する必要があります:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
const (
|
||||
@ -175,7 +175,7 @@ const (
|
||||
)
|
||||
```
|
||||
|
||||
For convenience, helper methods are provided to quickly create a menu item:
|
||||
使い勝手の良い、メニュー項目をすばやく作成するためのヘルパーメソッドが提供されています:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
func Text(label string, accelerator *keys.Accelerator, click Callback) *MenuItem
|
||||
@ -185,7 +185,7 @@ func Checkbox(label string, checked bool, accelerator *keys.Accelerator, click C
|
||||
func SubMenu(label string, menu *Menu) *Menu
|
||||
```
|
||||
|
||||
You can also create menu items directly on a menu by using the "Add" helpers:
|
||||
"Add"ヘルパーメソッドを使用して、メニューに対して直接メニュー項目を追加することも可能です:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
func (m *Menu) AddText(label string, accelerator *keys.Accelerator, click Callback) *MenuItem
|
||||
@ -195,11 +195,11 @@ func (m *Menu) AddCheckbox(label string, checked bool, accelerator *keys.Acceler
|
||||
func (m *Menu) AddSubMenu(label string, menu *Menu) *MenuI
|
||||
```
|
||||
|
||||
A note on radio groups: A radio group is defined as a number of radio menu items that are next to each other in the menu. This means that you do not need to group items together as it is automatic. However, that also means you cannot have 2 radio groups next to each other - there must be a non-radio item between them.
|
||||
ラジオグループに関する注意事項: ラジオグループは、メニュー内でお互いに隣接しているラジオメニュー項目同士で1つのグループとして定義されます。 つまり、手動でグループ化する必要はありません。 逆に言うと、2つのラジオグループを隣接させることはできません。ラジオグループの間には、ラジオ項目ではないメニューアイテムが必要です。
|
||||
|
||||
### Callback
|
||||
|
||||
Each menu item may have a callback that is executed when the item is clicked:
|
||||
各メニュー項目には、項目がクリックされたときに呼び出されるコールバックがあります:
|
||||
|
||||
```go title="Package: github.com/wailsapp/wails/v2/pkg/menu"
|
||||
type Callback func(*CallbackData)
|
||||
@ -209,19 +209,19 @@ type CallbackData struct {
|
||||
}
|
||||
```
|
||||
|
||||
The function is given a `CallbackData` struct which indicates which menu item triggered the callback. This is useful when using radio groups that may share a callback.
|
||||
このコールバックには、どのメニュー項目がコールバックをトリガーしたのかを識別できる、`CallbackData`構造体が渡されます。 これは、同じコールバックを呼び出すラジオグループを作成する際などに便利です。
|
||||
|
||||
### Role
|
||||
|
||||
:::info Roles
|
||||
:::info ロール
|
||||
|
||||
Roles are currently supported on Mac only.
|
||||
現在、ロールはMacでのみサポートされています。
|
||||
|
||||
:::
|
||||
|
||||
A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles:
|
||||
メニュー項目には、もともと事前に定義されたメニュー項目のロールを設定することができます。 現在サポートされているロールは次のとおりです:
|
||||
|
||||
| ロール | 説明 |
|
||||
| ------------ | ------------------------------------------------------------------------ |
|
||||
| AppMenuRole | The standard Mac application menu. Can be created using `menu.AppMenu()` |
|
||||
| EditMenuRole | The standard Mac edit menu. Can be created using `menu.EditMenu()` |
|
||||
| ------------ | -------------------------------------------- |
|
||||
| AppMenuRole | Macアプリケーションの標準メニュー。 `menu.AppMenu()`で作成できます。 |
|
||||
| EditMenuRole | Macの標準的な編集メニュー。 `menu.EditMenu()`で作成できます。 |
|
||||
|
@ -224,22 +224,21 @@ AssetServerの固有オプションを定義します。 静的なアセット
|
||||
現在のところ、`http.Request`のすべての機能がサポートされているわけではありません。次の機能マトリクスを確認してください:
|
||||
|
||||
| 機能 | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
注意: 現在、LinuxはWebKit2GTKバージョン2.36.0未満をターゲットにしているため、使用できる機能が非常に限られています。 将来的に、WebKit2GTK 2.36.0以降の導入を予定しており、それによりいくつかの機能が新たにサポートされる予定です。
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
名前: AssetServer<br/> データ型: `*assetserver.Options`
|
||||
|
||||
@ -711,11 +710,11 @@ func main() {
|
||||
|
||||
名前: Icon<br/> データ型: `[]byte`
|
||||
|
||||
一部のウィンドウマネージャやデスクトップ環境では、ウィンドウフレームに配置されたり、他のコンテキストで表示される場合もあります。 On others, the icon is not used at all, so your mileage may vary.
|
||||
一部のウィンドウマネージャやデスクトップ環境では、ウィンドウフレームに配置されたり、他のコンテキストで表示される場合もあります。 反対に、環境によっては全くアイコンが使用されないこともありますのでご注意ください。
|
||||
|
||||
注意: 少なくともWayland上のGnomeでは、このアイコンは表示されません。 アプリケーションアイコンを表示させるには、`.desktop`ファイルを使用する必要があります。 KDEの場合は正常に表示されるはずです。
|
||||
|
||||
アイコンは、何の加工もされていないサイズで用意してください。つまり、拡大/縮小された画像は使用しないでください。 Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
|
||||
アイコンは、何の加工もされていないサイズで用意してください。つまり、拡大/縮小された画像は使用しないでください。 最高品質を確保するために、拡大/縮小は、最終的な目的サイズがはっきりするまで待ってください。
|
||||
|
||||
#### WindowIsTranslucent
|
||||
|
||||
@ -734,3 +733,5 @@ func main() {
|
||||
このオプションを`true`に設定すると、アプリケーション起動時にWeb開発者ツールが表示されます。
|
||||
|
||||
名前: OpenInspectorOnStartup<br/> データ型: `bool`
|
||||
|
||||
[^1]: この機能の動作には、WebKit2GTK 2.36以上が必要となるため、機能を確実に対応させたい場合は、アプリビルド時にビルドタグ`webkit2_36`を付与してください。 これにより、アプリに必要なWebKit2GTKの最小バージョン要件が2.36に引き上げられます。
|
||||
|
@ -2,9 +2,9 @@
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Project Config
|
||||
# プロジェクト構成
|
||||
|
||||
The project config resides in the `wails.json` file in the project directory. The structure of the config is:
|
||||
プロジェクト構成は、プロジェクトディレクトリ内の`wails.json`ファイルで設定します。 ファイルの構造は次のとおりです:
|
||||
|
||||
```json
|
||||
{
|
||||
@ -15,43 +15,43 @@ The project config resides in the `wails.json` file in the project directory. Th
|
||||
"frontend:dir": "[フロントエンドディレクトリの相対パス。 デフォルトは'frontend'です。]",
|
||||
"frontend:install": "[node依存関係をインストールするために、フロントエンドディレクトリで実行するコマンド。一般的には`npm install`です。]",
|
||||
"frontend:build": "[アセットをビルドするために、フロントエンドディレクトリで実行するコマンド。一般的には`npm run build`です。]",
|
||||
"frontend:dev": "[このコマンドはfrontend:dev:buildへ置換されました。 If frontend:dev:build is not specified will falls back to this command. このコマンドも指定されていない場合は、代わりにfrontend:buildが実行されます。]",
|
||||
"frontend:dev:build": "[開発モードにおけるfrontend:buildと同様のコマンド。 If not specified falls back to frontend:dev]",
|
||||
"frontend:dev:install": "[This command is the dev equivalent of frontend:install. If not specified falls back to frontend:install]",
|
||||
"frontend:dev:watcher": "[This command is run in a separate process on `wails dev`. Useful for 3rd party watchers or starting 3d party dev servers]",
|
||||
"frontend:dev:serverUrl": "[URL to a 3rd party dev server to be used to serve assets, EG Vite. 'auto'に設定すると、Viteの出力から自動的に開発サーバURLを推測します。]",
|
||||
"frontend:dev": "[このコマンドはfrontend:dev:buildへ置換されました。 frontend:dev:buildが指定されていない場合は、代わりにこのコマンドが実行されます。 このコマンドも指定されていない場合は、代わりにfrontend:buildが実行されます。]",
|
||||
"frontend:dev:build": "[開発モードにおけるfrontend:buildと同様のコマンド。 指定されていない場合は、代わりにfrontend:devが実行されます。]",
|
||||
"frontend:dev:install": "[開発モードにおけるfrontend:installと同様のコマンド。 指定されていない場合は、代わりにfrontend:installが実行されます。]",
|
||||
"frontend:dev:watcher": "[`wails dev`実行時に別プロセスで実行するコマンド。 サードパーティ製のウォッチャや開発サーバを起動したい場合に便利です。]",
|
||||
"frontend:dev:serverUrl": "[Viteなど、アセットを提供するサードパーティ製の開発サーバのURL。 'auto'に設定すると、Viteの出力から自動的に開発サーバURLを推測します。]",
|
||||
"wailsjsdir": "[自動生成されるJSモジュールを出力するディレクトリへの相対パス。]",
|
||||
"version": "[プロジェクト構成のバージョン]",
|
||||
"outputfilename": "[出力バイナリのファイル名]",
|
||||
"debounceMS": 100, // アセットファイルに変更があった場合に、開発サーバが再読み込みを行うまでのデフォルトの待ち時間。
|
||||
"devServer": "[Wailsの開発サーバをバインドするアドレス。 Default: localhost:34115]",
|
||||
"appargs": "[Arguments passed to the application in shell style when in dev mode]",
|
||||
"runNonNativeBuildHooks": false, // Defines if build hooks should be run though they are defined for an OS other than the host OS.
|
||||
"devServer": "[Wailsの開発サーバをバインドするアドレス。 デフォルト値: localhost:34115]",
|
||||
"appargs": "[開発モードのときに、アプリケーションに渡されるシェルスタイルの引数。]",
|
||||
"runNonNativeBuildHooks": false, // ホストOS以外のOS用にビルドフックが定義されている場合、それらを実行するかどうか。
|
||||
"preBuildHooks": {
|
||||
"GOOS/GOARCH": "[The command that will be executed before a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]",
|
||||
"GOOS/*": "[The command that will be executed before a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH". The "GOOS/*" hook is executed before the "*/*" hook.]",
|
||||
"*/*": "[The command that will be executed before every build: ${platform} is replaced with the "GOOS/GOARCH".]"
|
||||
"GOOS/GOARCH": "[指定されたGOOS/GOARCHのビルドの前に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換されます。 'GOOS/GOARCH'フックは、'GOOS/*'および'*/*'フックの前に実行されます。]",
|
||||
"GOOS/*": "[指定されたGOOSのビルド前に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換されます。 'GOOS/*'フックは、'*/*'フックの前に実行されます。]",
|
||||
"*/*": "[毎回のビルドの前に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換されます。]"
|
||||
},
|
||||
"postBuildHooks": {
|
||||
"GOOS/GOARCH": "[The command that will be executed after a build of the specified GOOS/GOARCH: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/GOARCH" hook is executed before the "GOOS/*" and "*/*" hook.]",
|
||||
"GOOS/*": "[The command that will be executed after a build of the specified GOOS: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary. The "GOOS/*" hook is executed before the "*/*" hook.]",
|
||||
"*/*": "[The command that will be executed after every build: ${platform} is replaced with the "GOOS/GOARCH" and ${bin} with the path to the compiled binary.]"
|
||||
"GOOS/GOARCH": "[指定されたGOOS/GOARCHのビルドの後に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換され、${bin}はコンパイル済みバイナリへのパスに置換されます。 'GOOS/GOARCH'フックは、'GOOS/*'および'*/*'フックの前に実行されます。]",
|
||||
"GOOS/*": "[指定されたGOOSのビルド後に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換され、${bin}はコンパイル済みバイナリへのパスに置換されます。 'GOOS/*'フックは、'*/*'フックの前に実行されます。]",
|
||||
"*/*": "[毎回のビルドの後に実行されるコマンド。${platform}は'GOOS/GOARCH'に置換され、${bin}はコンパイル済みバイナリへのパスに置換されます。]"
|
||||
},
|
||||
"info": { // Data used to populate manifests and version info.
|
||||
"companyName": "[The company name. Default: [The project name]]",
|
||||
"productName": "[The product name. Default: [The project name]]",
|
||||
"productVersion": "[The version of the product. Default: '1.0.0']",
|
||||
"copyright": "[The copyright of the product. Default: 'Copyright.........']",
|
||||
"comments": "[A short comment of the app. Default: 'Built using Wails (https://wails.app)']"
|
||||
"info": { // マニフェストやバージョン情報で使用されるデータ。
|
||||
"companyName": "[会社名。 デフォルト値: [プロジェクト名]]",
|
||||
"productName": "[製品名。 デフォルト値: [プロジェクト名]]",
|
||||
"productVersion": "[製品バージョン。 デフォルト値: '1.0.0']",
|
||||
"copyright": "[製品の著作権。 デフォルト値: 'Copyright.........']",
|
||||
"comments": "[アプリケーションの説明。 デフォルト値: 'Built using Wails (https://wails.app)']"
|
||||
},
|
||||
"nsisType": "['multiple': One installer per architecture. 'single': Single universal installer for all architectures being built. デフォルト値: 'multiple']",
|
||||
"nsisType": "['multiple': アーキテクチャごとに1つのインストーラ。 'single': ビルドした全アーキテクチャに対応する単一ユニバーサルインストーラ。 デフォルト値: 'multiple']",
|
||||
"obfuscated": "[アプリ難読化を実行するかどうか。 デフォルト値: false]",
|
||||
"garbleargs": "[obfuscatedフラグがtrueの際に、garbleコマンドへ渡す引数。]"
|
||||
}
|
||||
```
|
||||
|
||||
This file is read by the Wails CLI when running `wails build` or `wails dev`.
|
||||
このファイルは、Wails CLIで`wails build`コマンドまたは`wails dev`コマンドを実行した際に読み込まれます。
|
||||
|
||||
The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs.
|
||||
`wails build/dev`コマンドを実行時に、`assetdir`、`reloaddirs`、`wailsjsdir`、 `debounceMS`、 `devserver`、`frontenddevserverurl`フラグを使用すると、プロジェクト構成が更新され、次回以降コマンドを実行する際のデフォルト値となります。
|
||||
|
||||
このファイルのJSONスキーマは、[こちら](https://wails.io/schemas/config.v2.json)にあります。
|
||||
|
@ -2,7 +2,7 @@
|
||||
sidebar_position: 7
|
||||
---
|
||||
|
||||
# Browser
|
||||
# ブラウザ
|
||||
|
||||
これらは、システムブラウザに関連したメソッドです。
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
sidebar_position: 5
|
||||
---
|
||||
|
||||
# Dialog
|
||||
# ダイアログ
|
||||
|
||||
ランタイムでは、ファイルセレクターやメッセージボックスといったネイティブダイアログへのアクセスを提供しています。
|
||||
|
||||
@ -69,7 +69,7 @@ type OpenDialogOptions struct {
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Win | Mac | Lin |
|
||||
| フィールド | 説明 | Win | Mac | Lin |
|
||||
| -------------------------- | ------------------------- | --- | --- | --- |
|
||||
| DefaultDirectory | ダイアログが開かれたときに初期表示するディレクトリ | ✅ | ✅ | ✅ |
|
||||
| DefaultFilename | デフォルトファイル名 | ✅ | ✅ | ✅ |
|
||||
@ -94,7 +94,7 @@ type SaveDialogOptions struct {
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Win | Mac | Lin |
|
||||
| フィールド | 説明 | Win | Mac | Lin |
|
||||
| -------------------------- | ------------------------- | --- | --- | --- |
|
||||
| DefaultDirectory | ダイアログが開かれたときに初期表示するディレクトリ | ✅ | ✅ | ✅ |
|
||||
| DefaultFilename | デフォルトファイル名 | ✅ | ✅ | ✅ |
|
||||
@ -117,7 +117,7 @@ type MessageDialogOptions struct {
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Description | Win | Mac | Lin |
|
||||
| フィールド | 説明 | Win | Mac | Lin |
|
||||
| ------------- | ------------------------------------------------- | -------------- | --- | --- |
|
||||
| Type | メッセージダイアログの種類 (質問、情報など) | ✅ | ✅ | ✅ |
|
||||
| Title | ダイアログのタイトル | ✅ | ✅ | ✅ |
|
||||
@ -132,7 +132,7 @@ Windowsでは、ボタンのカスタマイズができない標準ダイアロ
|
||||
|
||||
質問ダイアログの場合、デフォルトボタンは"Yes"、キャンセルボタンは"No"となります。 この設定は、`DefaultButton`の値を`"No"`にすることで、変更できます。
|
||||
|
||||
Example:
|
||||
例:
|
||||
```go
|
||||
result, err := runtime.MessageDialog(a.ctx, runtime.MessageDialogOptions{
|
||||
Type: runtime.QuestionDialog,
|
||||
@ -144,13 +144,13 @@ Example:
|
||||
|
||||
#### Linux
|
||||
|
||||
Linux has standard dialog types in which the buttons are not customisable. The value returned will be one of: "Ok", "Cancel", "Yes", "No"
|
||||
Linuxでは、ボタンのカスタマイズができない標準ダイアログタイプがあります。 返り値は次のいずれかになります: "Ok"、"Cancel"、"Yes"、"No"
|
||||
|
||||
#### Mac
|
||||
|
||||
A message dialog on Mac may specify up to 4 buttons. If no `DefaultButton` or `CancelButton` is given, the first button is considered default and is bound to the `return` key.
|
||||
Macのメッセージダイアログでは、最大4つまでのボタンを指定できます。 `DefaultButton`や`CancelButton`が指定されていない場合、1番目のボタンがデフォルトボタンとして扱われ、`return`キーにバインドされます。
|
||||
|
||||
For the following code:
|
||||
例えば次のようなコードの場合:
|
||||
|
||||
```go
|
||||
selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
@ -173,7 +173,7 @@ selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
<br />
|
||||
```
|
||||
|
||||
And if we specify `DefaultButton` to be "two":
|
||||
そして`DefaultButton`を"two"に設定した場合:
|
||||
|
||||
```go
|
||||
selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
@ -184,7 +184,7 @@ selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
})
|
||||
```
|
||||
|
||||
the second button is shown as default. When `return` is pressed, the value "two" is returned.
|
||||
2番目のボタンがデフォルトになります。 このとき`return`キーが押されると、返り値として"two"が返却されます:
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
@ -197,7 +197,7 @@ the second button is shown as default. When `return` is pressed, the value "two"
|
||||
<br />
|
||||
```
|
||||
|
||||
If we now specify `CancelButton` to be "three":
|
||||
また、`CancelButton`を"three"に設定した場合
|
||||
|
||||
```go
|
||||
selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
@ -209,7 +209,7 @@ selection, err := runtime.MessageDialog(b.ctx, runtime.MessageDialogOptions{
|
||||
})
|
||||
```
|
||||
|
||||
the button with "three" is shown at the bottom of the dialog. When `escape` is pressed, the value "three" is returned:
|
||||
ダイアログの下部に"three"ボタンが表示されるようになります。 このとき`escape`キーが押されると、返り値として"three"が返却されます:
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
@ -246,7 +246,7 @@ type FileFilter struct {
|
||||
|
||||
#### Windows
|
||||
|
||||
Windows allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog:
|
||||
Windowsでは、ダイアログボックスで複数のファイルフィルタを使用できます。 それぞれのFileFiltersは、ダイアログ上で個別のエントリーとして表示されます:
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
@ -263,7 +263,7 @@ Windows allows you to use multiple file filters in dialog boxes. Each FileFilter
|
||||
|
||||
#### Linux
|
||||
|
||||
Linux allows you to use multiple file filters in dialog boxes. Each FileFilter will show up as a separate entry in the dialog:
|
||||
Linuxでは、ダイアログボックスで複数のファイルフィルタを使用できます。 それぞれのFileFiltersは、ダイアログ上で個別のエントリーとして表示されます:
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
@ -280,9 +280,9 @@ Linux allows you to use multiple file filters in dialog boxes. Each FileFilter w
|
||||
|
||||
#### Mac
|
||||
|
||||
Mac dialogs only have the concept of a single set of patterns to filter files. If multiple FileFilters are provided, Wails will use all the Patterns defined.
|
||||
Macのダイアログでは、ファイルをフィルタするためのパターンセットは1つしか持たせることができません。 もし複数のFileFiltersを定義した場合、Wailsはそれらすべてのパターンを使用します。
|
||||
|
||||
Example:
|
||||
例:
|
||||
|
||||
```go
|
||||
selection, err := runtime.OpenFileDialog(b.ctx, runtime.OpenDialogOptions{
|
||||
@ -299,4 +299,4 @@ Example:
|
||||
})
|
||||
```
|
||||
|
||||
This will result in the Open File dialog using `*.png,*.jpg,*.mov,*.mp4` as a filter.
|
||||
このとき、ファイル選択ダイアログを開くと、`*.png,*.jpg,*.mov,*.mp4`がフィルタとして使用されます。
|
||||
|
@ -2,9 +2,9 @@
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Events
|
||||
# イベント
|
||||
|
||||
The Wails runtime provides a unified events system, where events can be emitted or received by either Go or JavaScript. 必要に応じて、イベント発行時にデータを渡すことも可能です。 イベントリスナーは、そのデータをローカルデータ型で受け取ります。
|
||||
Wailsでは、GoまたはJavaScriptによって発行および受信できる、一元化されたイベントシステムが用意されています。 必要に応じて、イベント発行時にデータを渡すことも可能です。 イベントリスナーは、そのデータをローカルデータ型で受け取ります。
|
||||
|
||||
### EventsOn
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Introduction
|
||||
# イントロダクション
|
||||
|
||||
ランタイムは、アプリケーションにユーティリティメソッドを提供するライブラリです。 There is both a Go and JavaScript runtime and the aim is to try and keep them at parity where possible.
|
||||
ランタイムは、アプリケーションにユーティリティメソッドを提供するライブラリです。 GoとJavaScriptの両方にランタイムがあり、どちらにもほぼ同じメソッドが提供されています。
|
||||
|
||||
ユーティリティメソッドには次のようなものがあります:
|
||||
|
||||
- [Window](window.mdx)
|
||||
- [ウィンドウ](window.mdx)
|
||||
- [メニュー](menu.mdx)
|
||||
- [ダイアログ](dialog.mdx)
|
||||
- [イベント](events.mdx)
|
||||
@ -23,7 +23,7 @@ Goのランタイムは、`github.com/wailsapp/wails/v2/pkg/runtime`をインポ
|
||||
|
||||
:::
|
||||
|
||||
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. これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
|
||||
JavaScriptのランタイムは、`window.runtime`マップを介してフロントエンド上で利用できます。 `dev`モードでは、TypeScript型定義を提供するランタイムパッケージが生成されます。 これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
|
||||
|
||||
### 非表示
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Log
|
||||
# ログ
|
||||
|
||||
The Wails runtime provides a logging mechanism that may be called from Go or JavaScript. 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
|
||||
Wailsでは、GoまたはJavaScriptから呼び出すことのできるロギングメカニズムを用意しています。 一般的なロガーと同じように、ログにはいくつかのログレベルがあります:
|
||||
|
||||
- トレース
|
||||
- デバッグ
|
||||
- 情報
|
||||
- 警告
|
||||
- Trace
|
||||
- Debug
|
||||
- Info
|
||||
- Warning
|
||||
- Error
|
||||
- 致命的
|
||||
- Fatal
|
||||
|
||||
ロガーは、設定されている出力ログレベル以上のログメッセージを出力します。 例えば、出力ログレベルを`Debug`に設定した場合、`Trace`以外のすべてのレベルのメッセージが出力されます。
|
||||
|
||||
@ -101,14 +101,14 @@ Go: `LogFatalf(ctx context.Context, format string, args ...interface{})`<br/>
|
||||
|
||||
### LogSetLogLevel
|
||||
|
||||
出力ログレベルを設定します。 In JavaScript, the number relates to the following log levels:
|
||||
出力ログレベルを設定します。 JavaScriptでは、数値が次のログレベルに対応しています:
|
||||
|
||||
| 値 | ログレベル |
|
||||
| - | ----- |
|
||||
| 1 | トレース |
|
||||
| 2 | デバッグ |
|
||||
| 3 | 情報 |
|
||||
| 4 | 警告 |
|
||||
| - | ------- |
|
||||
| 1 | Trace |
|
||||
| 2 | Debug |
|
||||
| 3 | Info |
|
||||
| 4 | Warning |
|
||||
| 5 | Error |
|
||||
|
||||
Go: `LogSetLogLevel(ctx context.Context, level logger.LogLevel)`<br/> JS: `LogSetLogLevel(level: number)`
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.0.0-rc.1"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "はじめよう",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "リファレンス",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,23 +16,23 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "コミュニティ",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "事例紹介",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "ガイド",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "チュートリアル",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "コントリビューション",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.0.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "はじめよう",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "リファレンス",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,23 +16,23 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "コミュニティ",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "事例紹介",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "ガイド",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "チュートリアル",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "コントリビューション",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,11 @@
|
||||
"description": "The label for version v2.1.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "はじめよう",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "リファレンス",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
@ -16,23 +16,23 @@
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "コミュニティ",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "事例紹介",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "ガイド",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "チュートリアル",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "コントリビューション",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,35 +4,35 @@
|
||||
"description": "The label for version v2.2.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "はじめよう",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "リファレンス",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
"message": "Runtime",
|
||||
"message": "ランタイム",
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "コミュニティ",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "事例紹介",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "ガイド",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "チュートリアル",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "コントリビューション",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -19,11 +19,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
|
||||
- Add new property for the `wails.json` config file - `bindings`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Properties `prefix` and `suffix` allow you to control the generated TypeScript entity name in the `model.ts` file. Added by @OlegGulevskyy in [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- The `WindowSetAlwaysOnTop` method is now exposed in the JS runtime. Fixed by @gotid in [PR](https://github.com/wailsapp/wails/pull/2128)
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports serving the index.html file when requesting a directory. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
- Added support for WebKit2GTK 2.36+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP methods and Headers. The app must be compiled with the Go build tag `webkit2_36` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2151)
|
||||
|
||||
### Fixed
|
||||
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
|
||||
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
|
||||
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
|
||||
- Better signal handling for Linux. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2152)
|
||||
|
||||
### Changed
|
||||
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Markdown page example
|
||||
title: Markdownページの例
|
||||
---
|
||||
|
||||
# Markdown page example
|
||||
# Markdownページの例
|
||||
|
||||
シンプルな単一ページを作成する場合、Reactは必要ありません。
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"link.title.Docs": {
|
||||
"message": "Docs",
|
||||
"message": "ドキュメント",
|
||||
"description": "The title of the footer links column with title=Docs in the footer"
|
||||
},
|
||||
"link.title.Community": {
|
||||
@ -8,7 +8,7 @@
|
||||
"description": "The title of the footer links column with title=Community in the footer"
|
||||
},
|
||||
"link.title.More": {
|
||||
"message": "More",
|
||||
"message": "さらに知る",
|
||||
"description": "The title of the footer links column with title=More in the footer"
|
||||
},
|
||||
"link.item.label.Introduction": {
|
||||
@ -24,7 +24,7 @@
|
||||
"description": "The label of footer link with label=Changelog linking to /changelog"
|
||||
},
|
||||
"link.item.label.Github": {
|
||||
"message": "Github",
|
||||
"message": "GitHub",
|
||||
"description": "The label of footer link with label=Github linking to https://github.com/wailsapp/wails"
|
||||
},
|
||||
"link.item.label.Twitter": {
|
||||
@ -36,11 +36,11 @@
|
||||
"description": "The label of footer link with label=Slack linking to https://gophers.slack.com/messages/CJ4P9F7MZ/"
|
||||
},
|
||||
"link.item.label.Slack invite": {
|
||||
"message": "Slack invite",
|
||||
"message": "Slackへの招待",
|
||||
"description": "The label of footer link with label=Slack invite linking to https://invite.slack.golangbridge.org/"
|
||||
},
|
||||
"link.item.label.Blog": {
|
||||
"message": "Blog",
|
||||
"message": "ブログ",
|
||||
"description": "The label of footer link with label=Blog linking to /blog"
|
||||
},
|
||||
"copyright": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"item.label.Sponsor": {
|
||||
"message": "Sponsor ❤",
|
||||
"message": "スポンサー ❤",
|
||||
"description": "Navbar item with label Sponsor"
|
||||
},
|
||||
"item.label.Docs": {
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac App Store Guide
|
||||
|
||||
This page gives a brief overview of how to submit your Wails App to the Mac App Store.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You will need to have an Apple Developer account. Please find more information on the [Apple Developer Program](https://developer.apple.com/support/compare-memberships/) site
|
||||
- You will need to have your Certificates, Identifiers, and App created on the developer portal. More on this below
|
||||
- Xcode command line tools will need to be installed on your local machine
|
||||
|
||||
#### Create Certificates and Identifiers
|
||||
|
||||
1. Go to your [Apple Developer Account](https://developer.apple.com/account/)
|
||||
2. Under `Certificates, Identifiers & Profiles`, click `Identifiers` and Register a New App ID. Use the format (com.example.app)
|
||||
3. Under the same page click `Certificates` and generate new Certificates for Mac App Store Distribution. Download them and import the certificates into Keychain on your local machine.
|
||||
|
||||
#### Create App Submission
|
||||
|
||||
1. Go to the [App Store Connect Site](https://appstoreconnect.apple.com/apps)
|
||||
2. Register a new application and link the bundle ID that you created in the previous step
|
||||
3. Populate your app with the correct screen shots, descriptions, etc. as required by Apple
|
||||
4. Create a new version of your app
|
||||
|
||||
|
||||
## Mac App Store Process
|
||||
|
||||
#### Enable Apple's App Sandbox
|
||||
|
||||
Apps submitted to the Mac App Store must run under Apple's [App Sandbox](https://developer.apple.com/app-sandboxing/). You must create an `entitlements.plist` file for this to work. The recommendation is to create this file under this path `{PROJECT_DIR}/build/darwin/entitlements.plist`.
|
||||
|
||||
**Example Entitlements File**
|
||||
|
||||
This is an example entitlements file from the [RiftShare](https://github.com/achhabra2/riftshare) app. For reference please put in the entitlements your app requires. Refer to [this site](https://developer.apple.com/documentation/bundleresources/entitlements) for more information.
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### Build and Sign the App Package
|
||||
|
||||
The following is an example script for building and signing your app for Mac App Store submission. It assumes you are running the script from your root project directory.
|
||||
|
||||
Note the certificates for signing the app and signing the installer are different. Please make sure both are imported into Keychain. Find the strings in Keychain and insert them below. Populate your certificate names, and app name below. Running the following script will generate a signed `app.pkg` file in the root directory of your app.
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### Upload App Bundle
|
||||
|
||||
You will need to upload the generated package file and associate it to your Application before you will be able to submit it for review.
|
||||
|
||||
1. Download the [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784) from the Mac App Store
|
||||
2. Open it and sign in with your Apple ID
|
||||
3. Click the + sign and select the `APP_NAME.pkg` file that you generated in the previous step. Upload it
|
||||
4. Go back to the [App Store Connect](https://appstoreconnect.apple.com/apps) site and navigate back into your app submission. Select the version that you are ready to make available on the App Store. Under `Build` select the package that you uploaded via Transporter.
|
||||
|
||||
That's it! You can now use the site to submit your App for review. After a few business days if all goes well you should see your App live on the Mac App Store.
|
@ -224,22 +224,21 @@ This defines AssetServer specific options. It allows to customize the AssetServe
|
||||
Not all features of an `http.Request` are currently supported, please see the following feature matrix:
|
||||
|
||||
| Feature | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support.
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
Name: AssetServer<br/> Type: `*assetserver.Options`
|
||||
|
||||
@ -734,3 +733,5 @@ Name: Debug<br/> Type: `options.Debug`
|
||||
Setting this to `true` will open the WebInspector on startup of the application.
|
||||
|
||||
Name: OpenInspectorOnStartup<br/> Type: `bool`
|
||||
|
||||
[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
|
||||
|
@ -19,11 +19,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
|
||||
- Add new property for the `wails.json` config file - `bindings`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Properties `prefix` and `suffix` allow you to control the generated TypeScript entity name in the `model.ts` file. Added by @OlegGulevskyy in [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- The `WindowSetAlwaysOnTop` method is now exposed in the JS runtime. Fixed by @gotid in [PR](https://github.com/wailsapp/wails/pull/2128)
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports serving the index.html file when requesting a directory. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
- Added support for WebKit2GTK 2.36+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP methods and Headers. The app must be compiled with the Go build tag `webkit2_36` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2151)
|
||||
|
||||
### Fixed
|
||||
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
|
||||
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
|
||||
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
|
||||
- Better signal handling for Linux. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2152)
|
||||
|
||||
### Changed
|
||||
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac App Store Guide
|
||||
|
||||
This page gives a brief overview of how to submit your Wails App to the Mac App Store.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You will need to have an Apple Developer account. Please find more information on the [Apple Developer Program](https://developer.apple.com/support/compare-memberships/) site
|
||||
- You will need to have your Certificates, Identifiers, and App created on the developer portal. More on this below
|
||||
- Xcode command line tools will need to be installed on your local machine
|
||||
|
||||
#### Create Certificates and Identifiers
|
||||
|
||||
1. Go to your [Apple Developer Account](https://developer.apple.com/account/)
|
||||
2. Under `Certificates, Identifiers & Profiles`, click `Identifiers` and Register a New App ID. Use the format (com.example.app)
|
||||
3. Under the same page click `Certificates` and generate new Certificates for Mac App Store Distribution. Download them and import the certificates into Keychain on your local machine.
|
||||
|
||||
#### Create App Submission
|
||||
|
||||
1. Go to the [App Store Connect Site](https://appstoreconnect.apple.com/apps)
|
||||
2. Register a new application and link the bundle ID that you created in the previous step
|
||||
3. Populate your app with the correct screen shots, descriptions, etc. as required by Apple
|
||||
4. Create a new version of your app
|
||||
|
||||
|
||||
## Mac App Store Process
|
||||
|
||||
#### Enable Apple's App Sandbox
|
||||
|
||||
Apps submitted to the Mac App Store must run under Apple's [App Sandbox](https://developer.apple.com/app-sandboxing/). You must create an `entitlements.plist` file for this to work. The recommendation is to create this file under this path `{PROJECT_DIR}/build/darwin/entitlements.plist`.
|
||||
|
||||
**Example Entitlements File**
|
||||
|
||||
This is an example entitlements file from the [RiftShare](https://github.com/achhabra2/riftshare) app. For reference please put in the entitlements your app requires. Refer to [this site](https://developer.apple.com/documentation/bundleresources/entitlements) for more information.
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### Build and Sign the App Package
|
||||
|
||||
The following is an example script for building and signing your app for Mac App Store submission. It assumes you are running the script from your root project directory.
|
||||
|
||||
Note the certificates for signing the app and signing the installer are different. Please make sure both are imported into Keychain. Find the strings in Keychain and insert them below. Populate your certificate names, and app name below. Running the following script will generate a signed `app.pkg` file in the root directory of your app.
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### Upload App Bundle
|
||||
|
||||
You will need to upload the generated package file and associate it to your Application before you will be able to submit it for review.
|
||||
|
||||
1. Download the [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784) from the Mac App Store
|
||||
2. Open it and sign in with your Apple ID
|
||||
3. Click the + sign and select the `APP_NAME.pkg` file that you generated in the previous step. Upload it
|
||||
4. Go back to the [App Store Connect](https://appstoreconnect.apple.com/apps) site and navigate back into your app submission. Select the version that you are ready to make available on the App Store. Under `Build` select the package that you uploaded via Transporter.
|
||||
|
||||
That's it! You can now use the site to submit your App for review. After a few business days if all goes well you should see your App live on the Mac App Store.
|
@ -224,22 +224,21 @@ This defines AssetServer specific options. It allows to customize the AssetServe
|
||||
Not all features of an `http.Request` are currently supported, please see the following feature matrix:
|
||||
|
||||
| Feature | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support.
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
Name: AssetServer<br/> Type: `*assetserver.Options`
|
||||
|
||||
@ -734,3 +733,5 @@ Name: Debug<br/> Type: `options.Debug`
|
||||
Setting this to `true` will open the WebInspector on startup of the application.
|
||||
|
||||
Name: OpenInspectorOnStartup<br/> Type: `bool`
|
||||
|
||||
[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
|
||||
|
@ -19,11 +19,17 @@ O formato é baseado em [Manter um Log de Alterações](https://keepachangelog.c
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
|
||||
- Add new property for the `wails.json` config file - `bindings`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Properties `prefix` and `suffix` allow you to control the generated TypeScript entity name in the `model.ts` file. Added by @OlegGulevskyy in [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- The `WindowSetAlwaysOnTop` method is now exposed in the JS runtime. Fixed by @gotid in [PR](https://github.com/wailsapp/wails/pull/2128)
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports serving the index.html file when requesting a directory. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
- Added support for WebKit2GTK 2.36+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP methods and Headers. The app must be compiled with the Go build tag `webkit2_36` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2151)
|
||||
|
||||
### Corrigido
|
||||
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
|
||||
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
|
||||
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
|
||||
- Better signal handling for Linux. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2152)
|
||||
|
||||
### Alterado
|
||||
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac App Store Guide
|
||||
|
||||
This page gives a brief overview of how to submit your Wails App to the Mac App Store.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You will need to have an Apple Developer account. Please find more information on the [Apple Developer Program](https://developer.apple.com/support/compare-memberships/) site
|
||||
- You will need to have your Certificates, Identifiers, and App created on the developer portal. More on this below
|
||||
- Xcode command line tools will need to be installed on your local machine
|
||||
|
||||
#### Create Certificates and Identifiers
|
||||
|
||||
1. Go to your [Apple Developer Account](https://developer.apple.com/account/)
|
||||
2. Under `Certificates, Identifiers & Profiles`, click `Identifiers` and Register a New App ID. Use the format (com.example.app)
|
||||
3. Under the same page click `Certificates` and generate new Certificates for Mac App Store Distribution. Download them and import the certificates into Keychain on your local machine.
|
||||
|
||||
#### Create App Submission
|
||||
|
||||
1. Go to the [App Store Connect Site](https://appstoreconnect.apple.com/apps)
|
||||
2. Register a new application and link the bundle ID that you created in the previous step
|
||||
3. Populate your app with the correct screen shots, descriptions, etc. as required by Apple
|
||||
4. Create a new version of your app
|
||||
|
||||
|
||||
## Mac App Store Process
|
||||
|
||||
#### Enable Apple's App Sandbox
|
||||
|
||||
Apps submitted to the Mac App Store must run under Apple's [App Sandbox](https://developer.apple.com/app-sandboxing/). You must create an `entitlements.plist` file for this to work. The recommendation is to create this file under this path `{PROJECT_DIR}/build/darwin/entitlements.plist`.
|
||||
|
||||
**Example Entitlements File**
|
||||
|
||||
This is an example entitlements file from the [RiftShare](https://github.com/achhabra2/riftshare) app. For reference please put in the entitlements your app requires. Refer to [this site](https://developer.apple.com/documentation/bundleresources/entitlements) for more information.
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### Build and Sign the App Package
|
||||
|
||||
The following is an example script for building and signing your app for Mac App Store submission. It assumes you are running the script from your root project directory.
|
||||
|
||||
Note the certificates for signing the app and signing the installer are different. Please make sure both are imported into Keychain. Find the strings in Keychain and insert them below. Populate your certificate names, and app name below. Running the following script will generate a signed `app.pkg` file in the root directory of your app.
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### Upload App Bundle
|
||||
|
||||
You will need to upload the generated package file and associate it to your Application before you will be able to submit it for review.
|
||||
|
||||
1. Download the [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784) from the Mac App Store
|
||||
2. Open it and sign in with your Apple ID
|
||||
3. Click the + sign and select the `APP_NAME.pkg` file that you generated in the previous step. Upload it
|
||||
4. Go back to the [App Store Connect](https://appstoreconnect.apple.com/apps) site and navigate back into your app submission. Select the version that you are ready to make available on the App Store. Under `Build` select the package that you uploaded via Transporter.
|
||||
|
||||
That's it! You can now use the site to submit your App for review. After a few business days if all goes well you should see your App live on the Mac App Store.
|
@ -224,22 +224,21 @@ This defines AssetServer specific options. It allows to customize the AssetServe
|
||||
Not all features of an `http.Request` are currently supported, please see the following feature matrix:
|
||||
|
||||
| Feature | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
NOTE: Linux is currently very limited due to targeting a WebKit2GTK Version < 2.36.0. In the future some features will be supported by the introduction of WebKit2GTK 2.36.0+ support.
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
Name: AssetServer<br/> Type: `*assetserver.Options`
|
||||
|
||||
@ -734,3 +733,5 @@ Name: Debug<br/> Type: `options.Debug`
|
||||
Setting this to `true` will open the WebInspector on startup of the application.
|
||||
|
||||
Name: OpenInspectorOnStartup<br/> Type: `bool`
|
||||
|
||||
[^1]: This requires WebKit2GTK 2.36+ support and your app needs to be build with the build tag `webkit2_36` to activate support for this feature. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app.
|
||||
|
@ -19,11 +19,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports handling range-requests if the [Assets](/docs/reference/options/#assets-1) `fs.FS` provides an `io.ReadSeeker`. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2091)
|
||||
- Add new property for the `wails.json` config file - `bindings`. More information on the new property can be found in the updated [schema](/schemas/config.v2.json). Properties `prefix` and `suffix` allow you to control the generated TypeScript entity name in the `model.ts` file. Added by @OlegGulevskyy in [PR](https://github.com/wailsapp/wails/pull/2101)
|
||||
- The `WindowSetAlwaysOnTop` method is now exposed in the JS runtime. Fixed by @gotid in [PR](https://github.com/wailsapp/wails/pull/2128)
|
||||
- The [AssetServer](/docs/reference/options#assetserver) now supports serving the index.html file when requesting a directory. Added by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
- Added support for WebKit2GTK 2.36+ on Linux. This brings additional features for the [AssetServer](/docs/reference/options#assetserver), like support for HTTP methods and Headers. The app must be compiled with the Go build tag `webkit2_36` to activate support for this features. This also bumps the minimum requirement of WebKit2GTK to 2.36 for your app. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2151)
|
||||
|
||||
### Fixed
|
||||
- The `noreload` flag in wails dev wasn't applied. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2081)
|
||||
- `build/bin` folder was duplicating itself on each reload in `wails dev` mode. Fixed by @OlegGulevskyy in this [PR](https://github.com/wailsapp/wails/pull/2103)
|
||||
- Prevent a thin white line at the bottom of a frameless window on Windows. Fixed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2111)
|
||||
- Better signal handling for Linux. Fixed by @leaanthony in this [PR](https://github.com/wailsapp/wails/pull/2152)
|
||||
|
||||
### Changed
|
||||
- Improve error message if no `index.html` could be found in the assets and validate assetserver options. Changed by @stffabi in this [PR](https://github.com/wailsapp/wails/pull/2110)
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -116,7 +116,7 @@ v1 的一个巨大痛点是需要将整个应用程序压缩为单个 JS 和 CSS
|
||||
|
||||
除此之外,网络服务器将在端口 34115 上启动。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。
|
||||
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 这实现了两个世界之间数据模型的无缝交换。 这实现了两个世界之间数据模型的无缝交换。
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 我很高兴地宣布,在 v2 中,任何以开发模式运行的应用程序都会自动生成 TypeScript 作为绑定方法的输入或输出参数的所有结构的模型。 这实现了两个世界之间数据模型的无缝交换。
|
||||
|
||||
除此之外,还会动态生成另一个 JS 模块来包装您的所有绑定方法。 这为您的方法提供了 JSDoc,在您的 IDE 中提供代码完成和提示。 当您在自动生成的包含 Go 代码的模块中点击 Tab 时自动导入数据模型,这真的很酷!
|
||||
|
||||
|
@ -74,7 +74,7 @@ v1 的一个巨大痛点是需要将整个应用程序压缩为单个 JS 和 CSS
|
||||
|
||||
除此之外,网络服务器将在端口 34115 上启动。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。
|
||||
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 这实现了两个世界之间数据模型的无缝交换。 这实现了两个世界之间数据模型的无缝交换。
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 我很高兴地宣布,在 v2 中,任何以开发模式运行的应用程序都会自动生成 TypeScript 作为绑定方法的输入或输出参数的所有结构的模型。 这实现了两个世界之间数据模型的无缝交换。
|
||||
|
||||
除此之外,还会动态生成另一个 JS 模块来包装您的所有绑定方法。 这为您的方法提供了 JSDoc,在您的 IDE 中提供代码完成和提示。 当您在自动生成的包含 Go 代码的模块中点击 Tab 时自动导入数据模型,这真的很酷!
|
||||
|
||||
|
@ -61,7 +61,7 @@ v1 的一个巨大痛点是需要将整个应用程序压缩为单个 JS 和 CSS
|
||||
|
||||
除此之外,网络服务器将在端口 34115 上启动。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。 所有连接的 Web 浏览器都会响应系统事件,例如资源更改时的热重载。
|
||||
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 这实现了两个世界之间数据模型的无缝交换。 这实现了两个世界之间数据模型的无缝交换。
|
||||
在 Go 中,我们习惯于在应用程序中处理结构。 将结构发送到我们的前端并将它们用作我们应用程序中的状态通常很有用。 在 v1 中,这是一个非常需要手动的过程,对开发人员来说有点负担。 我很高兴地宣布,在 v2 中,任何以开发模式运行的应用程序都会自动生成 TypeScript 作为绑定方法的输入或输出参数的所有结构的模型。 这实现了两个世界之间数据模型的无缝交换。
|
||||
|
||||
除此之外,还会动态生成另一个 JS 模块来包装您的所有绑定方法。 这为您的方法提供了 JSDoc,在您的 IDE 中提供代码完成和提示。 当您在自动生成的包含 Go 代码的模块中点击 Tab 时自动导入数据模型,这真的很酷!
|
||||
|
||||
|
@ -0,0 +1,83 @@
|
||||
# Mac 应用商店指南
|
||||
|
||||
本页面简要概述了如何将您的 Wails 应用程序提交到 Mac 应用商店。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- 您需要有一个 Apple 开发者帐户。 请在 [Apple Developer Program](https://developer.apple.com/support/compare-memberships/) 网站上找到更多信息
|
||||
- 您需要在开发人员门户上创建证书(Certificates)、标识符(Identifiers)和应用程序。 更多内容请见下文
|
||||
- 你的本地机器上需要安装 Xcode 命令行工具
|
||||
|
||||
#### 创建证书和标识符
|
||||
|
||||
1. 前往您的 [Apple 开发者帐户](https://developer.apple.com/account/)
|
||||
2. 在 `证书(Certificates)、标识符(Identifiers)和个人资料(Profiles)` 下,单击 `标识符(Identifiers)` 并注册新的应用程序 ID。 使用格式 (com.example.app)
|
||||
3. 在同一页面下,单击 `证书(Certificates)`并为 Mac App Store 分发生成新证书(Certificates)。 下载它们并将证书导入本地计算机上的秘钥串。
|
||||
|
||||
#### 创建应用程序提交
|
||||
|
||||
1. 前往 [App Store Connect](https://appstoreconnect.apple.com/apps) 网站
|
||||
2. 注册一个新应用程序并链接您在上一步中创建的包 ID
|
||||
3. 根据 Apple 的要求,使用正确的屏幕截图、描述等填充您的应用程序
|
||||
4. 创建新版本的应用
|
||||
|
||||
|
||||
## Mac 应用商店流程
|
||||
|
||||
#### 启用 Apple 的 App Sandbox
|
||||
|
||||
提交到 Mac 应用商店的应用程序必须在 Apple 的 [App Sandbox](https://developer.apple.com/app-sandboxing/) 下运行。 您必须创建一个 `entitlements.plist` 文件才能使其工作。 建议在此路径 `{PROJECT_DIR}/build/darwin/entitlements.plist` 下创建此文件。
|
||||
|
||||
**示例授权文件**
|
||||
|
||||
这是来自 [RiftShare](https://github.com/achhabra2/riftshare) 应用程序的示例授权文件。 作为参考,请输入您的应用所需的权限。 有关详细信息,请参阅 [此站点](https://developer.apple.com/documentation/bundleresources/entitlements)。
|
||||
|
||||
```xml title="entitlements.plist"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-write</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.downloads.read-write</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
#### 构建并签署应用程序包
|
||||
|
||||
以下是用于构建和签署您的应用程序以提交 Mac 应用商店的示例脚本。 它假定您正在从根项目目录运行脚本。
|
||||
|
||||
请注意,用于签署应用程序和签署安装程序的证书是不同的。 请确保两者都导入到秘钥串中。 在秘钥串中找到字符串并将它们插入下面。 在下面填充您的证书名称和应用程序名称。 运行以下脚本将在您的应用程序的根目录中生成一个签名的 `app.pkg` 文件。
|
||||
|
||||
```bash title="macappstore-build.sh"
|
||||
#!/bin/bash
|
||||
|
||||
APP_CERTIFICATE="3rd Party Mac Developer Application: YOUR NAME (CODE)"
|
||||
PKG_CERTIFICATE="3rd Party Mac Developer Installer: YOUR NAME (CODE)"
|
||||
APP_NAME="YourApp"
|
||||
|
||||
wails build -platform darwin/universal -clean
|
||||
|
||||
codesign --timestamp --options=runtime -s "$APP_CERTIFICATE" -v --entitlements ./build/darwin/entitlements.plist ./build/bin/$APP_NAME.app
|
||||
|
||||
productbuild --sign "$PKG_CERTIFICATE" --component ./build/bin/$APP_NAME.app /Applications ./$APP_NAME.pkg
|
||||
```
|
||||
|
||||
#### 上传应用程序包
|
||||
|
||||
您需要上传生成的包文件并将其关联到您的应用程序,然后才能提交以供审核。
|
||||
|
||||
1. 从 Mac 应用商店下载 [Transporter App](https://apps.apple.com/us/app/transporter/id1450874784)
|
||||
2. 打开它并使用您的 Apple ID 登录
|
||||
3. 单击 + 号并选择您在上一步中生成的 `APP_NAME.pkg` 文件。 上传它
|
||||
4. 返回 [App Store Connect](https://appstoreconnect.apple.com/apps) 站点并导航回您的应用程序提交。 选择您准备在 App 商店上提供的版本。 在 `Build` 下选择您通过 Transporter 上传的包。
|
||||
|
||||
好了! 您现在可以使用该网站提交您的应用程序以供审核。 几个工作日后,如果一切顺利,您应该会在 Mac 应用商店上看到您的应用程序。
|
@ -242,7 +242,7 @@ export function Greet(arg1: string): Promise<string>;
|
||||
|
||||
:::
|
||||
|
||||
也可以将结构体发送回 Go。 为了使这个过程更容易,在 `开发` 模式下,会生成一个 TypeScript 模块,声明绑定方法中使用的所有结构体类型。 为了使这个过程更容易,在 `开发` 模式下,会生成一个 TypeScript 模块,声明绑定方法中使用的所有结构体类型。 使用此模块,可以构建原生 JavaScript 对象并将其发送到 Go 代码。
|
||||
也可以将结构体发送回 Go。 作为期望的结构体的参数传递的任何 JavaScript map/class 都将转换为该结构体类型。 为了使这个过程更容易,在 `开发` 模式下,会生成一个 TypeScript 模块,声明绑定方法中使用的所有结构体类型。 使用此模块,可以构建原生 JavaScript 对象并将其发送到 Go 代码。
|
||||
|
||||
还支持在其签名中使用结构的 Go 方法。 绑定方法(作为参数或返回类型)指定的所有 Go 结构体都将作为 Go 代码包装器模块的一部分自动生成 TypeScript 版本。 使用这些,可以在 Go 和 JavaScript 之间共享相同的数据模型。
|
||||
|
||||
|
@ -72,11 +72,11 @@ func main() {
|
||||
LightModeTitleText: windows.RGB(20, 20, 20),
|
||||
LightModeBorder: windows.RGB(200, 200, 200),
|
||||
},
|
||||
// 可自定义的用户消息
|
||||
// User messages that can be customised
|
||||
Messages *windows.Messages
|
||||
// Windows 进入低功耗模式时调用 OnSuspend
|
||||
// OnSuspend is called when Windows enters low power mode
|
||||
OnSuspend func()
|
||||
// Windows 从低功耗模式恢复时调用 OnResume
|
||||
// OnResume is called when Windows resumes from low power mode
|
||||
OnResume func()
|
||||
},
|
||||
Mac: &mac.Options{
|
||||
@ -224,22 +224,21 @@ func main() {
|
||||
并非当前支持 `http.Request` 的所有功能,请参阅以下功能矩阵:
|
||||
|
||||
| 功能 | Win | Mac | Lin |
|
||||
| ----------------------- | --- | --- | --- |
|
||||
| ----------------------- | --- | --- | ------ |
|
||||
| GET | ✅ | ✅ | ✅ |
|
||||
| POST | ✅ | ✅ | ❌ |
|
||||
| PUT | ✅ | ✅ | ❌ |
|
||||
| PATCH | ✅ | ✅ | ❌ |
|
||||
| DELETE | ✅ | ✅ | ❌ |
|
||||
| Request Headers | ✅ | ✅ | ❌ |
|
||||
| POST | ✅ | ✅ | ✅ [^1] |
|
||||
| PUT | ✅ | ✅ | ✅ [^1] |
|
||||
| PATCH | ✅ | ✅ | ✅ [^1] |
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ❌ |
|
||||
| Response Headers | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
|
||||
注意:Linux 当前非常有限,因为目标是 WebKit2GTK 版本 < 2.36.0。 将来,一些特性将通过引入 WebKit2GTK 2.36.0+ 支持来支持。
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
名称: AssetServer<br/> 类型: `*assetserver.Options`
|
||||
|
||||
@ -750,3 +749,5 @@ func main() {
|
||||
设置为 `true` 将在应用程序启动时打开 Web 检查器。
|
||||
|
||||
名称: OpenInspectorOnStartup<br/> 类型: `bool`
|
||||
|
||||
[^1]: 这需要 WebKit2GTK 2.36+ 支持,并且您的应用程序需要使用构建标签 `webkit2_36` 来构建以激活对此功能的支持。 这也会将您应用程序的 WebKit2GTK 最低要求提高到 2.36。
|
||||
|
@ -4,7 +4,7 @@ sidebar_position: 3
|
||||
|
||||
# 日志
|
||||
|
||||
Wails 运行时提供了一种可以从 Go 或 JavaScript 调用的日志记录机制。 像大多数记录器一样,有许多日志级别:
|
||||
Wails 运行时提供了一种可以从 Go 或 JavaScript 调用日志记录的机制。 像大多数记录器一样,有许多日志级别:
|
||||
|
||||
- Trace(追踪)
|
||||
- Debug(调试)
|
||||
|
@ -19,11 +19,17 @@
|
||||
- 如果 [Assets](/docs/reference/options/#资产-1) `fs.FS` 提供 `io.ReadSeeker`,[AssetServer](/docs/reference/options#资产服务器) 现在支持处理范围请求。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2091) 中添加。
|
||||
- 为 `wails.json` 配置文件添加新属性 - `bindings`。 关于新属性的更多信息可以在更新的 [schema](/schemas/config.v2.json) 中找到。 属性 `prefix` 和 `suffix` 允许您控制在 `model.ts` 文件中生成的 TypeScript 实体名称。 由 @OlegGulevskyy 在这个 [PR](https://github.com/wailsapp/wails/pull/2101) 中修复。
|
||||
- `WindowSetAlwaysOnTop` 方法现在在 JS 运行时中公开。 由 @gotid 在这个 [PR](https://github.com/wailsapp/wails/pull/2128) 中修复。
|
||||
- [AssetServer](/docs/reference/options#资产服务器) 现在支持在请求目录时提供 index.html 文件。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2110) 中添加
|
||||
- 在 Linux 上添加了对 WebKit2GTK 2.36+ 的支持。 这为 [AssetServer](/docs/reference/options#资产服务器) 带来了额外的特性,例如对 HTTP 方法和标头的支持。 该应用程序必须使用 Go 构建标签 `webkit2_36` 进行编译,以激活对此功能的支持。 这也会将您应用程序的 WebKit2GTK 最低要求提高到 2.36。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2151) 中修复
|
||||
|
||||
### 修复
|
||||
- wails dev 中 `noreload` 标志未被应用。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2081) 中修复。
|
||||
- `build/bin` 文件夹在 `wails dev` 模式下每次重新加载时都会复制自身。 由 @OlegGulevskyy 在这个 [PR](https://github.com/wailsapp/wails/pull/2103) 中修复。
|
||||
- 防止 Windows 上的无边框窗口底部出现细白线。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2111) 中修复。
|
||||
- 更好的 Linux 信号处理。 由 @leaanthony 在这个 [PR](https://github.com/wailsapp/wails/pull/2152) 中修复
|
||||
|
||||
### 变更
|
||||
- 如果在资产中找不到 `index.html` 并且验证资产服务器选项,则改进错误消息。 由 @stffabi 在这个 [PR](https://github.com/wailsapp/wails/pull/2110) 中变更
|
||||
|
||||
## v2.2.0 - 2022-11-09
|
||||
|
||||
|
@ -71,7 +71,7 @@ Wails 是一个开放源码、社区驱动的项目。 我们欢迎任何人加
|
||||
- 重现的步骤。 有时会打开不是Wails 问题的错误,报告者有责任用 [最小的可重现示例](https://stackoverflow.com/help/minimal-reproducible-example) 证明这是 Wails 问题
|
||||
- `wails doctor` 的输出
|
||||
- 一个可以重现错误的测试
|
||||
- 如果 Issue 没有包含此信息,请随时向打开 Issue 的 个人获取信息。
|
||||
- 如果 Issue 没有包含此信息,请随时向打开 Issue 的人获取信息。
|
||||
- 对 Issue 发表评论,说明您希望开发修复程序
|
||||
- 克隆存储库并使用 `bugfix/<ticket_number>_<ticket_title>` 格式创建一个分支
|
||||
- 一旦修复准备好进行测试,请创建 PR 草案。 请确保 PR 描述中列出了带有复选框标记的测试场景和测试用例,以便其他人知道需要测试什么。
|
||||
|
Loading…
Reference in New Issue
Block a user