Wails v2の初期設定

Page content

wailsインストール

go install github.com/wailsapp/wails/v2/cmd/wails@latest

ツールのcheck

wails doctor 

初期設定

wails init -n [プロジェクトディレクトリ名] -t [テンプレート名または、url]

wails init -n tamatan -t svelte-ts 

現在バグなのか、フロントエンドの初期化がうまく行かないので yarnまたは、npm installを実行する。 (yarnの方がうまく行くような気がする。)

cd tamatan/frontend
yarn

テンプレートは、 リリースのv2.0.0-beta.35に書いてあった

TEMPLATESHORT NAMEDESCRIPTION
Lit + VitelitLit + Vite development server
Lit + Vite (Typescript)lit-tsLit + TS + Vite development server
Preact + VitepreactPreact + Vite development server
Preact + Vite (Typescript)preact-tsPreact + Vite development server
React + VitereactReact + Vite development server
React + Vite (Typescript)react-tsReact + Vite development server
Svelte + VitesvelteSvelte + Vite development server
Svelte + Vite (Typescript)svelte-tsSvelte + TS + Vite development server
Vanilla + VitevanillaVanilla + Vite development server
Vanilla + Vite (Typescript)vanilla-tsVanilla + Vite development server
Vue + VitevueVue + Vite development server
Vue + Vite (Typescript)vue-tsVue + Vite development server

Vue

SHORT NAMETEMPLATEDESCRIPTION
misitebao/wails-template-vuehttps://github.com/misitebao/wails-template-vueA template using Vite,Vue and Vue-Router(Support both JavaScript and TypeScript)
wails-vite-vue-tshttps://github.com/codydbentley/wails-vite-vue-tsVue 3 TypeScript with Vite (and instructions to add features)
codydbentley/wails-vite-vue-the-workshttps://github.com/codydbentley/wails-vite-vue-the-worksVue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier

Angular

SHORT NAMETEMPLATEDESCRIPTION
TAINCER / wails-angular-templatehttps://github.com/TAINCER/wails-angular-templateAngular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n

React

SHORT NAMETEMPLATEDESCRIPTION
AlienRecall / wails-react-templatehttps://github.com/AlienRecall/wails-react-templateA template using reactjs
flin7 / wails-react-templatehttps://github.com/flin7/wails-react-templateA minimal template for React that supports live development
LGiki / wails-template-nextjshttps://github.com/LGiki/wails-template-nextjsA template using Next.js and TypeScript

Svelte

SHORT NAMETEMPLATEDESCRIPTION
raitonoberu / wails-svelte-templatehttps://github.com/raitonoberu/wails-svelte-templateSvelteを使用したテンプレート
BillBuilt / wails-vite-svelte-templatehttps://github.com/BillBuilt/wails-vite-svelte-templateA template using Svelte and Vite
BillBuilt / wails-vite-svelte-tailwind-templatehttps://github.com/BillBuilt/wails-vite-svelte-tailwind-templateA template using Svelte and Vite with TailwindCSS v3

Elm

SHORT NAMETEMPLATEDESCRIPTION
benjamin-thomas / wails-elm-templatehttps://github.com/benjamin-thomas/wails-elm-templateDevelop your GUI app with functional programming and a snappy hot-reload setup 🎉 🚀

テスト起動

うまく行かないときは、 もう一度、yarn

wails dev

ビルド

wails build 
wails build  -platform <各プラットフォーム>
wails build -platform darwin/universal

wails build -platform windows
PlatformDescription
darwinMacOS + architecture of build machine
darwin/amd64MacOS 10.13+ AMD64
darwin/arm64MacOS 11.0+ ARM64
darwin/universalMacOS AMD64+ARM64 universal application
windowsWindows 10/11 + architecture of build machine
windows/amd64Windows 10/11 AMD64
windows/arm64Windows 10/11 ARM64
linuxLinux + architecture of build machine
linux/amd64Linux AMD64
linux/arm64Linux ARM64

こんな感じかな。