Compare commits

..

121 Commits

Author SHA1 Message Date
Lea Anthony 00e165b139 Merge branch 'v0.13.0-pre' into v0.13.0 2019-05-12 14:20:40 +10:00
Lea Anthony 02199bbe9d fix: updating from pre to release 2019-05-12 14:20:04 +10:00
Lea Anthony d591a55140 docs: added changelog 2019-05-12 13:53:09 +10:00
Lea Anthony 508295b558 docs: updated contributors 2019-05-12 13:52:30 +10:00
Lea Anthony bdc33e1430 docs: update contributors 2019-05-12 13:37:31 +10:00
Lea Anthony d55dcb2dfb chore: update version 2019-05-12 13:37:19 +10:00
Lea Anthony 79ac4c1d45 Merge pull request #86 from fishfishfish2104/v0.13.0-pre
Added Dependancy check for redhat distros
2019-05-12 13:31:45 +10:00
Lea Anthony c6bfa85a1a Merge branch 'v0.13.0-pre' of github.com:wailsapp/wails into v0.13.0-pre 2019-05-12 13:00:55 +10:00
Lea Anthony 82289714ba chore: update go mod files 2019-05-12 13:00:34 +10:00
Lea Anthony 77142bd99e feat: support version flag 2019-05-12 12:59:35 +10:00
Lea Anthony 538f5c6501 fix: typo fixes 2019-05-12 12:51:14 +10:00
Lea Anthony 3ff02fb183 fix: better version checking 2019-05-12 12:50:50 +10:00
Lea Anthony 30298b4237 feat: add IsValidTag 2019-05-12 12:50:28 +10:00
fred2104 9f2c9a989f Added instructions for red hat distros 2019-05-12 09:06:23 +12:00
Lea Anthony 146147bed8 Merge branch 'pr/82' into v0.13.0-pre 2019-05-11 17:08:40 +10:00
Lea Anthony 76499b20c4 fix: windows template.json 2019-05-11 17:04:42 +10:00
Bryn Sinclair b21e79daf5 changed to use rpm instead of yum as its faster 2019-05-11 12:19:18 +12:00
Lea Anthony 71194108de feat: better version comparison 2019-05-10 23:01:50 +10:00
Lea Anthony 11fd50f78d fix: ensure GO111MODULE=on 2019-05-10 21:23:58 +10:00
Lea Anthony c08d1d7b3c fix: remove test data 2019-05-10 21:18:35 +10:00
Lea Anthony 2febf5a97a fix: set gomod=on when execing 2019-05-10 21:12:20 +10:00
Lea Anthony cea7b1e494 feat: new Github helper 2019-05-10 21:11:43 +10:00
Lea Anthony 25962e2e53 fix: set correct version 2019-05-10 21:11:20 +10:00
Bryn Sinclair 43f9b141fe removed unnecessary dependancies
changed logger.red to logger.error
2019-05-10 21:06:58 +12:00
Bryn Sinclair e1b729ea96 Merge commit 'f9a18817b74828ff8fae92a1a873087f9adc363b' of https://github.com/wailsapp/wails into v0.13.0-pre 2019-05-10 21:04:53 +12:00
Bryn Sinclair f9a18817b7 Added library checking support for red hat distros (Only tested on fedora)
Changed some Package help inconsistencies
2019-05-10 17:41:30 +12:00
Yasuhiro Matsumoto 23cb97d314 Fix windows paths 2019-05-10 09:31:10 +09:00
Lea Anthony 32e085b609 docs: remove -u 2019-05-09 22:07:56 +10:00
Lea Anthony 389dee8db9 docs: add MDH 2019-05-09 22:06:53 +10:00
Lea Anthony dba6fdf7e4 docs: add awesomego 2019-05-09 22:06:41 +10:00
Lea Anthony cc45dcf91e fix: leave win assets on -p flag 2019-05-09 22:06:27 +10:00
Lea Anthony 4aeb554f1b fix: remove debug output 2019-05-09 19:43:19 +10:00
Lea Anthony 3d2268420b fix: show prerequisite errors 2019-05-09 19:31:07 +10:00
Lea Anthony ca388be121 chore: update go.mod 2019-05-09 17:53:37 +10:00
Lea Anthony f9ca13ff30 fix: remove -u from go get 2019-05-09 13:58:49 +10:00
Lea Anthony 319dbcdc49 chore: lint fix 2019-05-08 22:42:13 +10:00
Lea Anthony bffbbd59ce fix: Windows 10 colour 2019-05-08 22:40:56 +10:00
Lea Anthony 8bd1d0ec92 fix: no need for windows separator 2019-05-08 22:32:04 +10:00
Lea Anthony 0daec29fab Updates to update command 2019-05-07 08:48:52 +10:00
Lea Anthony bb3dbe0510 update to mewn 0.10.5 2019-05-07 08:25:35 +10:00
Lea Anthony 2fa9e3b0ee Bump to v0.12.0 2019-05-03 19:21:39 +10:00
Lea Anthony 40d1750345 Updated contributors 2019-05-03 19:20:09 +10:00
Lea Anthony d2d4ea3033 Add Arch instructions 2019-05-03 19:09:36 +10:00
Lea Anthony ff55170002 chore: improve updateversion.sh 2019-05-02 20:15:50 +10:00
Lea Anthony 444db6a560 docs: add contributors 2019-05-02 20:15:31 +10:00
Adrian Lanzafame b015f27e14 add archlinux support 2019-05-02 13:35:34 +10:00
Lea Anthony 67a1f23b13 Merge pull request #72 from qaisjp/patch-1
Fix HTML spellings
2019-05-01 20:53:28 +10:00
Qais Patankar 9c98a7a9e3 Fix HTML spelling in README.md 2019-05-01 03:06:56 +01:00
Qais Patankar 5aa5ad8ad3 Fix HTML spelling in app_config.go 2019-05-01 03:06:19 +01:00
Lea Anthony ac203ec931 version bump 2019-04-30 08:30:46 +10:00
Lea Anthony 3fd73186f4 Version bump 2019-04-30 08:22:18 +10:00
Lea Anthony 46307469e5 Updated Readme 2019-04-29 23:23:29 +10:00
Lea Anthony 31a67f3aed Add Hound badge 2019-04-29 18:43:27 +10:00
Lea Anthony 44919d2750 dialog errors -> warnings 2019-04-27 10:16:12 +10:00
Lea Anthony cff87c641b update bridge warning messages 2019-04-27 10:14:08 +10:00
Lea Anthony abbd71d057 Merge pull request #71 from wailsapp/replace-wailsbridge-when-serving
always install bridge on serve
2019-04-27 09:30:33 +10:00
Lea Anthony aacfe8386a always install bridge on serve 2019-04-27 09:29:19 +10:00
Lea Anthony 97944d771a Bump to 0.11.6 2019-04-26 18:58:56 +10:00
Lea Anthony 3f1b616a5e Merge pull request #70 from wailsapp/update-webview
Update webview to 0.2.7
2019-04-26 18:56:38 +10:00
Lea Anthony fdcc2fd2e5 Update webview to 0.2.7 2019-04-26 18:54:06 +10:00
Lea Anthony 855032ed1e release 0.11.3 2019-04-25 20:14:10 +10:00
Lea Anthony 760e109aab create windows builds 2019-04-25 20:12:56 +10:00
Lea Anthony 4c799bca8f version bump 2019-04-25 20:08:42 +10:00
Lea Anthony 2d08ebc054 vscode settings 2019-04-25 20:08:07 +10:00
Lea Anthony 91ab2c2b31 Version bump 2019-04-25 20:06:11 +10:00
Lea Anthony 13ad57d49f fix: ensure errors are logged 2019-04-25 20:05:39 +10:00
Lea Anthony a109e3078d New dependency installation text 2019-04-23 08:46:39 +10:00
Lea Anthony 2e61a3c309 Set script type for injections 2019-04-23 08:46:11 +10:00
Lea Anthony 0373bea4e5 fix: destructure emit data 2019-04-23 08:44:47 +10:00
Lea Anthony 2d5825d73d Speed up Wails Serve 2019-04-20 12:15:19 +10:00
Lea Anthony c4a042cb1d Added Runtime.FileSystem 2019-04-20 12:13:55 +10:00
Lea Anthony 205f9476fa Change 'Headless' to 'Bridge' in logging 2019-04-20 12:12:30 +10:00
Lea Anthony a1230fcbb6 Badges! 2019-04-11 08:43:50 +10:00
Lea Anthony ba5c32a4a1 more linting fixes 2019-04-11 08:38:14 +10:00
Lea Anthony 58eee64326 more linting fixes 2019-04-11 08:26:57 +10:00
Lea Anthony 41d786a13c Add devtools to Vue config in template 2019-04-10 08:48:12 +10:00
Lea Anthony a2b7906c89 more linting fixes 2019-04-10 08:46:49 +10:00
Lea Anthony eeb6fa4677 linting fixes 2019-04-10 08:38:46 +10:00
Lea Anthony 6a36d75774 Use cropped logo 2019-04-08 19:33:44 +10:00
Lea Anthony 6078f3c780 Center subtitle 2019-04-08 19:29:17 +10:00
Lea Anthony fc11197725 Fix image 2019-04-08 19:24:20 +10:00
Lea Anthony 8c40b99194 Update license and readme 2019-04-08 19:18:39 +10:00
Lea Anthony de53fc6510 chore: remove unused files 2019-03-29 08:25:18 +11:00
Lea Anthony d4f4feb429 fix: better input during setup 2019-03-29 08:25:09 +11:00
Lea Anthony 02973c49ff fix: version output of built app 2019-03-29 08:24:46 +11:00
Lea Anthony 01dce9f139 Merge pull request #68 from wailsapp/fix-packaging
fix: call package when -p flag provided
2019-03-20 08:12:48 +11:00
Lea Anthony 6c0906e87d fix: call package when -p flag provided 2019-03-20 08:11:46 +11:00
Lea Anthony d7cfc4c71a Merge pull request #67 from wailsapp/fix-concurrent-websocket-writes
fix: use mutex to serialise websocket writes
2019-03-19 08:35:49 +11:00
Lea Anthony fec3e7eac5 fix: use mutex to serialise websocket writes 2019-03-19 08:35:09 +11:00
Lea Anthony 9f5e2c7dd4 Merge pull request #66 from wailsapp/handle-javascript-nulls
fix: convert js nulls to Go zero values
2019-03-19 08:21:31 +11:00
Lea Anthony c5276cca6c fix: convert js nulls to Go zero values 2019-03-19 08:20:45 +11:00
Lea Anthony 74dbbbed8a Merge pull request #65 from wailsapp/improved-ipc-encoding
Use hex encoded strings for callbacks
2019-03-17 16:57:50 +11:00
Lea Anthony 629ac4b93c Use hex encoded strings for callbacks 2019-03-17 16:56:41 +11:00
Lea Anthony 5ece7e84b3 Release 0.11.0 2019-03-10 17:03:55 +11:00
Lea Anthony eaba857676 Add frontend build back to serve 2019-03-10 17:02:57 +11:00
Lea Anthony db489a3cae Remove banner from application cli 2019-03-10 17:02:36 +11:00
Lea Anthony 4821ab8597 Automate version bumps 2019-03-10 17:02:12 +11:00
Lea Anthony 670b769f82 version bump 2019-03-09 05:18:23 +11:00
Lea Anthony eb53399824 add wails bridge assets 2019-03-08 20:39:09 +11:00
Lea Anthony 24e4fbfb68 ignore frontend files when using wails serve 2019-03-08 20:38:55 +11:00
Lea Anthony 7f54ca4ac3 version bump 2019-03-07 21:30:30 +11:00
Lea Anthony b224803e4d fix vue basic template 2019-03-07 21:29:55 +11:00
Lea Anthony 28b2025aaa Merge pull request #63 from wailsapp/0.9.9
0.9.9
2019-03-07 08:25:23 +11:00
Lea Anthony 77e85705d1 Version bump 2019-03-07 08:23:38 +11:00
Lea Anthony 9fd24595c7 fix asset imports in vue basic template 2019-03-07 08:23:29 +11:00
Lea Anthony 69067e85f5 Merge pull request #62 from wailsapp/Default-Prompts-not-populating
Default prompts not populating
2019-03-07 05:48:15 +11:00
Lea Anthony c8db58e00e Version bump 2019-03-07 05:47:13 +11:00
Lea Anthony e96e0e0999 fix default prompts 2019-03-07 05:46:20 +11:00
Lea Anthony 2da21ec528 Merge pull request #60 from wailsapp/0.9.97
0.9.7
2019-03-06 19:14:46 +11:00
Lea Anthony cda0b40414 Version bump 2019-03-06 19:12:38 +11:00
Lea Anthony 7f4229dd6b Add issue command 2019-03-06 19:12:12 +11:00
Lea Anthony 68651b77f4 use os specific path seperator 2019-03-06 19:11:46 +11:00
Lea Anthony bf001f5ad2 Improve prompt handling 2019-03-06 19:11:03 +11:00
Lea Anthony d1907b4ce5 Update issue templates 2019-03-06 07:59:24 +11:00
Lea Anthony 56363d193d Update issue templates 2019-03-04 22:36:00 +11:00
Lea Anthony 8553f43080 Misc linting fixes and version bump 2019-03-03 11:34:00 +11:00
Lea Anthony 587681bb8d Bump version 2019-03-02 12:56:56 +11:00
Lea Anthony afbf80ea4a Merge pull request #59 from wailsapp/0.9.5
use mewn for templates
2019-03-02 12:55:36 +11:00
Lea Anthony c180d7dccb use mewn for templates
massively improve template handling
2019-03-02 12:54:10 +11:00
Lea Anthony c20aabc8f8 Merge pull request #58 from wailsapp/update-command
initial update command
2019-02-23 10:23:32 +11:00
Lea Anthony 4cccb628c9 initial update command 2019-02-23 10:20:37 +11:00
59 changed files with 1386 additions and 475 deletions
+42
View File
@@ -0,0 +1,42 @@
{{ if .Versions -}}
<a name="unreleased"></a>
## [Unreleased]
{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
+27
View File
@@ -0,0 +1,27 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/wailsapp/wails
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^(\\w*)\\:\\s(.*)$"
pattern_maps:
- Type
- Subject
notes:
keywords:
- BREAKING CHANGE
+30
View File
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Description**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behaviour**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**System Details**
Please paste the output of `wails report` here.
**Additional context**
Add any other context about the problem here.
+2 -1
View File
@@ -15,4 +15,5 @@ examples/**/example*
!examples/**/*.*
cmd/wails/wails
.DS_Store
tmp
tmp
dist
+34
View File
@@ -0,0 +1,34 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
- linux
- darwin
goarch:
- 386
- amd64
ignore:
- goos: darwin
goarch: 386
main: ./cmd/wails/main.go
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
+3
View File
@@ -0,0 +1,3 @@
{
"go.formatTool": "goimports"
}
+19
View File
@@ -0,0 +1,19 @@
<a name="v0.13.0"></a>
## [v0.13.0] - 2019-05-12
### Feat
- revamped 'update' system
- no need for explicit GO111MODULE=on
### Fix
- documentation typo fixes
- windows init project
- windows 10 colour
- leave windows assets on -p flag
- show prerequisite errors
### Docs
- updated contributors
- added awesomego logo
- added Redhat distro
+12
View File
@@ -0,0 +1,12 @@
# Contributors
Wails is what it is because of the time and effort given by these great people. A huge thank you to each and every one!
* [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot)
* [Qais Patankar](https://github.com/qaisjp)
* [Anthony Lee](https://github.com/alee792)
* [Adrian Lanzafame](https://github.com/lanzafame)
* [0xflotus](https://github.com/0xflotus)
* [Michael D Henderson](https://github.com/mdhender)
* [fred2104] (https://github.com/fishfishfish2104)
* [intelwalk] (https://github.com/intelwalk)
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 wailsapp
Copyright (c) 2018-Present Lea Anthony
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+120 -1
View File
@@ -1 +1,120 @@
# Coming Soon
<p align="center" style="text-align: center">
<img src="https://github.com/wailsapp/docs/raw/master/.vuepress/public/media/logo_cropped.png" width="40%"><br/>
</p>
<p align="center">
A framework for building desktop applications using Go & Web Technologies.<br/><br/>
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
<a href="https://goreportcard.com/report/github.com/wailsapp/wails"><img src="https://goreportcard.com/badge/github.com/wailsapp/wails"/></a>
<a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a>
<a href="https://www.codefactor.io/repository/github/wailsapp/wails"><img src="https://www.codefactor.io/repository/github/wailsapp/wails/badge" alt="CodeFactor" /></a>
<a href="https://github.com/wailsapp/wails/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" /></a>
<a href="https://houndci.com"><img src="https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg"/></a>
<a href="https://github.com/sindresorhus/awesome" rel="nofollow"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome"></a>-
</p>
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
## Features
- Use standard Go libraries/frameworks for the backend
- Use any frontend technology to build your UI
- Expose Go methods/functions to the frontend via a single bind command
- Uses native rendering engines - no embedded browser
- Shared events system
- Native file dialogs
- Powerful cli tool
- Multiplatform
## Project Status
Wails is currently in Beta. Please make sure you read the [Project Status](https://wails.app/project_status.html) if you are interested in using this project.
## Installation
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:
- Go 1.11 or above
- npm
### MacOS
Make sure you have the xcode command line tools installed. This can be done by running:
`xcode-select --install`
### Linux
#### Ubuntu 18.04
`sudo apt install pkg-config build-essential libgtk-3-dev libwebkit2gtk-4.0-dev`
#### Arch Linux
`sudo pacman -S webkit2gtk gtk3`
#### Red Hat Based Distros
`sudo yum install webkit2gtk-devel gtk3-devel`
Note: If you have successfully installed these dependencies on a different flavour of Linux, please consider submitting a PR.
### Windows
Windows requires gcc and related tooling. The recommended download is from [http://tdm-gcc.tdragon.net/download](http://tdm-gcc.tdragon.net/download). Once this is installed, you are good to go.
## Installation
Installation is as simple as running the following command:
<pre style='color:white'>
go get github.com/wailsapp/wails/cmd/wails
</pre>
## Next Steps
It is recommended at this stage to read the comprehensive documentation at [https://wails.app](https://wails.app).
## FAQ
* Is this an alternative to Electron?
Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Whilst Wails does not currently offer hooks into native elements such as menus, this may change in the future.
* Who is this project aimed at?
Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a server and opening a browser to view it.
* What's with the name?
When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck.
## Shoulders of Giants
Without the following people, this project would never have existed:
* [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been immense. More patience than you can throw a stick at (Not long now Dustin!).
* [Serge Zaitsev](https://github.com/zserge) - Creator of [Webview](https://github.com/zserge/webview) which Wails uses for the windowing.
And without [these people](CONTRIBUTORS.md), it wouldn't be what it is today.
Special Mentions:
* [Bill Kennedy](https://twitter.com/goinggodotnet) - Go guru, encourager and all-round nice guy, whose infectious energy and inspiration powered me on when I had none left.
* [Mark Bates](https://github.com/markbates) - Creator of [Packr](https://github.com/gobuffalo/packr), inspiration for packing strategies which fed into some of the tooling.
This project was mainly coded to the following albums:
* [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
* [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
* [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
* [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
* [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
* [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
* [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
* [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
* [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
* [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
* [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
* [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
* [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
+6 -4
View File
@@ -70,7 +70,11 @@ func (a *App) Run() error {
}
a.logLevel = "error"
return a.start()
err := a.start()
if err != nil {
a.log.Error(err.Error())
}
return err
}
func (a *App) start() error {
@@ -114,9 +118,7 @@ func (a *App) start() error {
a.renderer.AddJSList(a.jsCache)
// Run the renderer
a.renderer.Run()
return nil
return a.renderer.Run()
}
// Bind allows the user to bind the given object
+1 -4
View File
@@ -1,8 +1,6 @@
package wails
import (
"fmt"
"github.com/wailsapp/wails/cmd"
)
@@ -11,6 +9,7 @@ func (app *App) setupCli() *cmd.Cli {
// Create a new cli
result := cmd.NewCli(app.config.Title, "Debug build")
result.Version(cmd.Version)
// Setup cli to handle loglevel and headless flags
result.
@@ -21,8 +20,6 @@ func (app *App) setupCli() *cmd.Cli {
// Banner
result.PreRun(func(cli *cmd.Cli) error {
log := cmd.NewLogger()
log.PrintSmallBanner()
fmt.Println()
log.YellowUnderline(app.config.Title + " - Debug Build")
return nil
})
+1 -1
View File
@@ -41,7 +41,7 @@ func (a *AppConfig) merge(in *AppConfig) error {
a.HTML = strings.TrimSpace(inlineHTML)
// Deduce whether this is a full html page or a fragment
// The document is determined to be a fragment if an HMTL
// The document is determined to be a fragment if an HTML
// tag exists and is located before the first div tag
HTMLTagIndex := strings.Index(a.HTML, "<html")
DivTagIndex := strings.Index(a.HTML, "<div")
+6 -3
View File
@@ -153,8 +153,11 @@ func (b *boundFunction) setInputValue(index int, typ reflect.Type, val interface
}
}()
// Do the conversion
result = reflect.ValueOf(val).Convert(typ)
// Translate javascript null values
if val == nil {
result = reflect.Zero(typ)
} else {
result = reflect.ValueOf(val).Convert(typ)
}
return result, err
}
+1 -4
View File
@@ -195,10 +195,7 @@ func (c *Command) Action(callback Action) *Command {
// PrintHelp - Output the help text for this command
func (c *Command) PrintHelp() {
c.log.PrintBanner()
versionString := c.AppVersion
if versionString != "" {
versionString = " " + versionString
}
commandTitle := c.CommandPath
if c.Shortdescription != "" {
commandTitle += " - " + c.Shortdescription
+31
View File
File diff suppressed because one or more lines are too long
+8
View File
@@ -41,6 +41,14 @@ func (fs *FSHelper) FileExists(path string) bool {
return fi.Mode().IsRegular()
}
// CreateFile creates a file at the given filename location with the contents
// set to the given data. It will create intermediary directories if needed.
func (fs *FSHelper) CreateFile(filename string, data []byte) error {
// Ensure directory exists
fs.MkDirs(filepath.Dir(filename))
return ioutil.WriteFile(filename, data, 0644)
}
// MkDirs creates the given nested directories.
// Returns error on failure
func (fs *FSHelper) MkDirs(fullPath string, mode ...os.FileMode) error {
+108
View File
@@ -0,0 +1,108 @@
package cmd
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sort"
)
// GitHubHelper is a utility class for interacting with GitHub
type GitHubHelper struct {
}
// NewGitHubHelper returns a new GitHub Helper
func NewGitHubHelper() *GitHubHelper {
return &GitHubHelper{}
}
// GetVersionTags gets the list of tags on the Wails repo
// It retuns a list of sorted tags in descending order
func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error) {
result := []*SemanticVersion{}
var err error
resp, err := http.Get("https://api.github.com/repos/wailsapp/wails/tags")
if err != nil {
return result, err
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return result, err
}
data := []map[string]interface{}{}
err = json.Unmarshal(body, &data)
if err != nil {
return result, err
}
// Convert tag data to Version structs
for _, tag := range data {
version := tag["name"].(string)
semver, err := NewSemanticVersion(version)
if err != nil {
return result, err
}
result = append(result, semver)
}
// Reverse Sort
sort.Sort(sort.Reverse(SemverCollection(result)))
return result, err
}
// GetLatestStableRelease gets the latest stable release on GitHub
func (g *GitHubHelper) GetLatestStableRelease() (result *SemanticVersion, err error) {
tags, err := g.GetVersionTags()
if err != nil {
return nil, err
}
for _, tag := range tags {
if tag.IsRelease() {
return tag, nil
}
}
return nil, fmt.Errorf("no release tag found")
}
// GetLatestPreRelease gets the latest prerelease on GitHub
func (g *GitHubHelper) GetLatestPreRelease() (result *SemanticVersion, err error) {
tags, err := g.GetVersionTags()
if err != nil {
return nil, err
}
for _, tag := range tags {
if tag.IsPreRelease() {
return tag, nil
}
}
return nil, fmt.Errorf("no prerelease tag found")
}
// IsValidTag returns true if the given string is a valid tag
func (g *GitHubHelper) IsValidTag(tagVersion string) (bool, error) {
if tagVersion[0] == 'v' {
tagVersion = tagVersion[1:]
}
tags, err := g.GetVersionTags()
if err != nil {
return false, err
}
for _, tag := range tags {
if tag.String() == tagVersion {
return true, nil
}
}
return false, nil
}
+43 -16
View File
@@ -5,15 +5,17 @@ import (
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"time"
mewn "github.com/leaanthony/mewn"
"github.com/leaanthony/slicer"
"github.com/leaanthony/spinner"
)
var fs = NewFSHelper()
// ValidateFrontendConfig checks if the frontend config is valid
func ValidateFrontendConfig(projectOptions *ProjectOptions) error {
if projectOptions.FrontEnd.Dir == "" {
@@ -34,7 +36,7 @@ func ValidateFrontendConfig(projectOptions *ProjectOptions) error {
// InstallGoDependencies will run go get in the current directory
func InstallGoDependencies() error {
depSpinner := spinner.New("Installing Dependencies...")
depSpinner := spinner.New("Ensuring Dependencies are up to date...")
depSpinner.SetSpinSpeed(50)
depSpinner.Start()
err := NewProgramHelper().RunCommand("go get")
@@ -75,7 +77,14 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
packSpinner.Start()
buildCommand := slicer.String()
buildCommand.AddSlice([]string{"mewn", "build"})
buildCommand.Add("mewn")
if buildMode == BuildModeBridge {
// Ignore errors
buildCommand.Add("-i")
}
buildCommand.Add("build")
if binaryName != "" {
buildCommand.Add("-o")
@@ -108,10 +117,18 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
}
packSpinner.Success()
// packageApp
if packageApp {
err = PackageApplication(projectOptions)
if err != nil {
return err
}
}
return nil
}
// PackageApplication will attempt to package the application in a pltform dependent way
// PackageApplication will attempt to package the application in a platform dependent way
func PackageApplication(projectOptions *ProjectOptions) error {
// Package app
message := "Generating .app"
@@ -172,7 +189,7 @@ func CheckWindres() (err error) {
}
programHelper := NewProgramHelper()
if !programHelper.IsInstalled("windres") {
return fmt.Errorf("windres not installed. It comes by default with mingw. Ensure you have installed mingw correctly.")
return fmt.Errorf("windres not installed. It comes by default with mingw. Ensure you have installed mingw correctly")
}
return nil
}
@@ -187,7 +204,7 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
}
// Check if frontend deps have been updated
feSpinner := spinner.New("Installing frontend dependencies (This may take a while)...")
feSpinner := spinner.New("Ensuring frontend dependencies are up to date (This may take a while)")
feSpinner.SetSpinSpeed(50)
feSpinner.Start()
@@ -232,16 +249,8 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
ioutil.WriteFile(md5sumFile, []byte(packageJSONMD5), 0644)
}
bridgeFile := "wailsbridge.prod.js"
if caller == "serve" {
bridgeFile = "wailsbridge.js"
}
// Copy bridge to project
_, filename, _, _ := runtime.Caller(1)
bridgeFileSource := filepath.Join(path.Dir(filename), "..", "..", "wailsruntimeassets", "bridge", bridgeFile)
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, projectOptions.FrontEnd.Bridge, "wailsbridge.js")
err = fs.CopyFile(bridgeFileSource, bridgeFileTarget)
// Install the bridge library
err = InstallBridge(caller, projectDir, projectOptions)
if err != nil {
return err
}
@@ -254,6 +263,24 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
return nil
}
// InstallBridge installs the relevant bridge javascript library
func InstallBridge(caller string, projectDir string, projectOptions *ProjectOptions) error {
bridgeFile := "wailsbridge.prod.js"
if caller == "serve" {
bridgeFile = "wailsbridge.js"
}
// Copy bridge to project
bridgeAssets := mewn.Group("../wailsruntimeassets/bridge/")
bridgeFileData := bridgeAssets.Bytes(bridgeFile)
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, projectOptions.FrontEnd.Bridge, "wailsbridge.js")
err := fs.CreateFile(bridgeFileTarget, bridgeFileData)
if err != nil {
return err
}
return nil
}
// ServeProject attempts to serve up the current project so that it may be connected to
// via the Wails bridge
func ServeProject(projectOptions *ProjectOptions, logger *Logger) error {
+47 -6
View File
@@ -2,6 +2,9 @@ package cmd
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
)
@@ -10,9 +13,13 @@ type LinuxDistribution int
const (
// Unknown is the catch-all distro
Unknown LinuxDistribution = 0
Unknown LinuxDistribution = iota
// Ubuntu distribution
Ubuntu LinuxDistribution = 1
Ubuntu
// Arch linux distribution
Arch
// RedHat linux distribution
RedHat
)
// DistroInfo contains all the information relating to a linux distribution
@@ -49,6 +56,8 @@ func GetLinuxDistroInfo() *DistroInfo {
switch value {
case "Ubuntu":
result.Distribution = Ubuntu
case "Arch":
result.Distribution = Arch
}
case "Description":
result.Description = value
@@ -60,20 +69,52 @@ func GetLinuxDistroInfo() *DistroInfo {
}
}
}
// check if /etc/os-release exists
} else if _, err := os.Stat("/etc/os-release"); !os.IsNotExist(err) {
// read /etc/os-release
osRelease, _ := ioutil.ReadFile("/etc/os-release")
// compile a regex to find NAME=distro
re := regexp.MustCompile(`^NAME=(.*)\n`)
// extract the distro name
osName := string(re.FindSubmatch(osRelease)[1])
// Check distro name against list of RedHat distros
if osName == "Fedora" || osName == "CentOS" {
//if it matches set result.Distribution to RedHat
result.Distribution = RedHat
}
}
return result
}
// DpkgInstalled uses dpkg to see if a package is installed
func DpkgInstalled(packageName string) (bool, error) {
result := false
program := NewProgramHelper()
dpkg := program.FindProgram("dpkg")
if dpkg == nil {
return false, fmt.Errorf("cannot check dependencies: dpkg not found")
}
_, _, exitCode, _ := dpkg.Run("-L", packageName)
result = exitCode == 0
return result, nil
return exitCode == 0, nil
}
// PacmanInstalled uses pacman to see if a package is installed.
func PacmanInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
pacman := program.FindProgram("pacman")
if pacman == nil {
return false, fmt.Errorf("cannot check dependencies: pacman not found")
}
_, _, exitCode, _ := pacman.Run("-Qs", packageName)
return exitCode == 0, nil
}
// RpmInstalled uses rpm to see if a package is installed
func RpmInstalled(packageName string) (bool, error) {
program := NewProgramHelper()
rpm := program.FindProgram("rpm")
if rpm == nil {
return false, fmt.Errorf("cannot check dependencies: rpm not found")
}
_, _, exitCode, _ := rpm.Run("--query", packageName)
return exitCode == 0, nil
}

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