Compare commits

...

26 Commits

Author SHA1 Message Date
Lea Anthony
b7a59daee1 v1.8.1-pre6 2020-10-28 20:39:06 +11:00
Lea Anthony
3d4ea3918b Remove zero copy string conversion 2020-10-28 20:38:33 +11:00
Lea Anthony
4347d950d1 Updated Contributors 2020-10-28 08:41:07 +11:00
Lea Anthony
8e096ff0b0 Update issue templates (#541) 2020-10-27 21:08:10 +11:00
Lea Anthony
6a03a5f8eb Merge branch 'develop' of https://github.com/wailsapp/wails into develop 2020-10-26 20:02:59 +11:00
Lea Anthony
6116f5fc05 v1.8.1-pre5 2020-10-26 20:02:54 +11:00
Lea Anthony
c49192e847 Merge branch 'develop' of github.com:wailsapp/wails into develop 2020-10-26 20:00:48 +11:00
Lea Anthony
6fb2489dae v1.8.1-pre4 2020-10-26 19:55:55 +11:00
Balakrishna Prasad Ganne
c1acbed2c7 Replaced the old v-content tag with the new v-main (#536) 2020-10-26 18:44:51 +11:00
Lea Anthony
8f6275721a Update contributors 2020-10-26 18:43:47 +11:00
Balakrishna Prasad Ganne
ef40a2eb8e Update Vuetify in package.json (#537) 2020-10-26 18:43:04 +11:00
Lea Anthony
4f7b5c71d1 Merge branch 'develop' of github.com:wailsapp/wails into develop 2020-10-26 09:03:04 +11:00
Lea Anthony
49db62afd0 Add v2 artefacts 2020-10-26 09:02:56 +11:00
Lea Anthony
9098632aa3 Add tags to build 2020-10-25 20:44:44 +11:00
Lea Anthony
f87a0f039a Make vue 3 template linux/mac only 2020-10-25 20:33:04 +11:00
Lea Anthony
a03f5871bd Update contributors 2020-10-25 20:30:47 +11:00
Kyle Muchmore
46f026c04c Added semicolons and mocha import 2020-10-25 20:30:08 +11:00
Kyle Muchmore
5e2373acb1 single quotes and tabs
Converted vue.config.js to using single quotes
Converted example.spec.ts to tabs instead of spaces.
2020-10-25 20:30:08 +11:00
Kyle Muchmore
918d6240f2 converted spaces to tabs in vue.config.js 2020-10-25 20:30:08 +11:00
Kyle Muchmore
453a225427 feat: Vue3, Vue Router, Vuex, and Typescript Template 2020-10-25 20:30:08 +11:00
Lea Anthony
2795684d5c Update Contributors 2020-10-25 20:27:40 +11:00
Altynbek
e295a5abd9 delete escape tags 2020-10-25 20:26:29 +11:00
Altynbek
fdf18b7dfa add tags to func BuildDocker 2020-10-25 20:26:29 +11:00
Altynbek
1e95d0eb44 add args tags to func BuildNative 2020-10-25 20:26:29 +11:00
Altynbek
d7f2d800de add fields Tags to ProjectOptions 2020-10-25 20:26:29 +11:00
Lea Anthony
ef4d9ae97c Add warnings for windows builds 2020-10-25 13:57:22 +11:00
31 changed files with 484 additions and 11 deletions

View File

@@ -8,8 +8,12 @@ assignees: ''
---
#####################################################
If you have a technical issue, please do not open a bug this way!
Please use the `wails issue` command!
**If you have a technical issue, please do not open a bug this way!**
Please use the `wails issue` command!
If you do not do this then the issue may be closed automatically.
NOTE: If your bug is related to Windows, make sure you read
the [Windows Developer Guide](https://wails.app/guides/windows/)
#####################################################
**Description**
@@ -33,3 +37,5 @@ Please provide your platform, GO version and variables, etc
**Additional context**
Add any other context about the problem here.
- [ ] This issue is for Windows and I have read the [Windows Developer Guide](https://wails.app/guides/windows/)

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

7
.gitignore vendored
View File

@@ -16,4 +16,9 @@ examples/**/example*
cmd/wails/wails
.DS_Store
tmp
node_modules/
node_modules/
v2/test/kitchensink/frontend/public
v2/internal/ffenestri/runtime.c
v2/internal/runtime/assets/desktop.js
v2/test/kitchensink/build/darwin/desktop/kitchensink
v2/test/kitchensink/frontend/package.json.md5

View File

@@ -35,3 +35,7 @@ Wails is what it is because of the time and effort given by these great people.
* [Dmitry Gomzyakov](https://github.com/kyoto44)
* [Arthur Wiebe](https://github.com/artooro)
* [Ilgıt Yıldırım](https://github.com/ilgityildirim)
* [Altynbek](https://github.com/gelleson)
* [Kyle](https://github.com/kmuchmore)
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
* [Charaf Rezrazi](https://github.com/Rezrazi)

View File

@@ -143,6 +143,7 @@ func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOpt
"-v", fmt.Sprintf("%s:/build", filepath.Join(fs.Cwd(), "build")),
"-v", fmt.Sprintf("%s:/source", fs.Cwd()),
"-e", fmt.Sprintf("LOCAL_USER_ID=%v", userid),
"-e", fmt.Sprintf("FLAG_TAGS=%s", projectOptions.Tags),
"-e", fmt.Sprintf("FLAG_LDFLAGS=%s", ldFlags(projectOptions, buildMode)),
"-e", "FLAG_V=false",
"-e", "FLAG_X=false",
@@ -248,6 +249,10 @@ func BuildNative(binaryName string, forceRebuild bool, buildMode string, project
buildCommand.AddSlice([]string{"-ldflags", ldFlags(projectOptions, buildMode)})
if projectOptions.Tags != "" {
buildCommand.AddSlice([]string{"--tags", projectOptions.Tags})
}
if projectOptions.Verbose {
fmt.Printf("Command: %v\n", buildCommand.AsSlice())
}
@@ -535,6 +540,9 @@ func InstallProdRuntime(projectDir string, projectOptions *ProjectOptions) error
func ServeProject(projectOptions *ProjectOptions, logger *Logger) error {
go func() {
time.Sleep(2 * time.Second)
if projectOptions.Platform == "windows" {
logger.Yellow("*** Please note: Windows builds use mshtml which is only compatible with IE11. We strongly recommend only using IE11 when running 'wails serve'! For more information, please read https://wails.app/guides/windows/ ***")
}
logger.Green(">>>>> To connect, you will need to run '" + projectOptions.FrontEnd.Serve + "' in the '" + projectOptions.FrontEnd.Dir + "' directory <<<<<")
}()
location, err := filepath.Abs(filepath.Join("build", projectOptions.BinaryName))

View File

@@ -151,6 +151,7 @@ type ProjectOptions struct {
Template string `json:"-"`
BinaryName string `json:"binaryname"`
FrontEnd *frontend `json:"frontend,omitempty"`
Tags string `json:"tags"`
NPMProjectName string `json:"-"`
system *SystemHelper
log *Logger

View File

@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

View File

@@ -0,0 +1,29 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/typescript/recommended'
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
mocha: true
}
}
]
}

View File

@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

View File

@@ -0,0 +1,35 @@
# vue basic
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@@ -0,0 +1,37 @@
{
"name": "{{.NPMProjectName}}",
"author": "{{.Author.Name}}<{{.Author.Email}}>",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^3.0.0-0",
"vue-router": "^4.0.0-0",
"regenerator-runtime": "^0.13.7",
"@wailsapp/runtime": "^1.1.1"
},
"devDependencies": {
"@types/chai": "^4.2.12",
"@types/mocha": "^8.0.3",
"@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.3.0",
"@vue/cli-plugin-eslint": "~4.5.6",
"@vue/cli-plugin-router": "~4.5.6",
"@vue/cli-plugin-typescript": "~4.5.6",
"@vue/cli-plugin-unit-mocha": "~4.5.6",
"@vue/cli-service": "~4.5.6",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-typescript": "^5.1.0",
"@vue/test-utils": "^2.0.0-0",
"chai": "^4.2.0",
"eslint": "^7.10.0",
"eslint-plugin-vue": "^7.0.0",
"node-sass": "^4.14.1",
"sass-loader": "^10.0.2",
"typescript": "~4.0.3"
}
}

View File

@@ -0,0 +1,32 @@
<template>
<div id=app>
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</div>
</template>
<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -0,0 +1,34 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'HelloWorld',
props: {
msg: String,
},
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@@ -0,0 +1,8 @@
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import * as Wails from '@wailsapp/runtime';
Wails.Init(() => {
createApp(App).use(router).mount('#app');
});

View File

@@ -0,0 +1,27 @@
import { createRouter, createMemoryHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import About from '../views/About.vue'
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
component: About
}
]
const router = createRouter({
history: createMemoryHistory(),
routes
})
export default router

View File

@@ -0,0 +1,5 @@
declare module '*.vue' {
import { defineComponent } from 'vue'
const component: ReturnType<typeof defineComponent>
export default component
}

View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

View File

@@ -0,0 +1,40 @@
<template>
<div class="home">
<img @click="getMessage" alt="Vue logo" src="../assets/appicon.png" :style="{ height: '400px' }"/>
<HelloWorld :msg="message" />
</div>
</template>
<script lang="ts">
import { ref, defineComponent } from "vue";
import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src
interface Backend {
basic(): Promise<string>;
}
declare global {
interface Window {
backend: Backend;
}
}
export default defineComponent({
name: "Home",
components: {
HelloWorld,
},
setup() {
const message = ref("Click the Icon");
const getMessage = () => {
window.backend.basic().then(result => {
message.value = result;
});
}
return { message: message, getMessage: getMessage };
},
});
</script>

View File

@@ -0,0 +1,14 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallowMount } from '@vue/test-utils';
import HelloWorld from '@/components/HelloWorld.vue';
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message';
const wrapper = shallowMount(HelloWorld, {
props: { msg }
});
expect(wrapper.text()).to.include(msg);
});
});

View File

@@ -0,0 +1,41 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"mocha",
"chai"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}

View File

@@ -0,0 +1,42 @@
let cssConfig = {};
if (process.env.NODE_ENV == 'production') {
cssConfig = {
extract: {
filename: '[name].css',
chunkFilename: '[name].css'
}
};
}
module.exports = {
chainWebpack: config => {
let limit = 9999999999999999;
config.module
.rule('images')
.test(/\.(png|gif|jpg)(\?.*)?$/i)
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: limit }));
config.module
.rule('fonts')
.test(/\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/i)
.use('url-loader')
.loader('url-loader')
.options({
limit: limit
});
},
css: cssConfig,
configureWebpack: {
output: {
filename: '[name].js'
},
optimization: {
splitChunks: false
}
},
devServer: {
disableHostCheck: true
}
};

View File

@@ -0,0 +1,5 @@
module {{.BinaryName}}
require (
github.com/wailsapp/wails {{.WailsVersion}}
)

View File

@@ -0,0 +1,27 @@
package main
import (
"github.com/leaanthony/mewn"
"github.com/wailsapp/wails"
)
func basic() string {
return "Hello World!"
}
func main() {
js := mewn.String("./frontend/dist/app.js")
css := mewn.String("./frontend/dist/app.css")
app := wails.CreateApp(&wails.AppConfig{
Width: 1024,
Height: 768,
Title: "{{.Name}}",
JS: js,
CSS: css,
Colour: "#131313",
})
app.Bind(basic)
app.Run()
}

View File

@@ -0,0 +1,15 @@
{
"name": "Vue3 Full",
"version": "1.0.0",
"shortdescription": "Vue 3, Vuex, Vue-router, and Webpack4",
"description": "Vue3.0.0 Vuex, Vue-router, and Webpack 4",
"install": "npm install",
"build": "npm run build",
"author": "Kyle Muchmore <kmuchmor@gmail.com>",
"created": "2020-09-24 21:18:55.09417 +0000 UTC m=+90.125590001",
"frontenddir": "frontend",
"serve": "npm run serve",
"bridge": "src",
"wailsdir": "",
"platforms": ["linux", "darwin"]
}

View File

@@ -11,7 +11,7 @@
"core-js": "^3.6.4",
"regenerator-runtime": "^0.13.3",
"vue": "^2.6.11",
"vuetify": "^2.2.15",
"vuetify": "^2.3.15",
"@wailsapp/runtime": "^1.0.10"
},
"devDependencies": {

View File

@@ -24,13 +24,13 @@
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>Application</v-toolbar-title>
</v-app-bar>
<v-content>
<v-main>
<v-container fluid class="px-0">
<v-layout justify-center align-center class="px-0">
<hello-world></hello-world>
</v-layout>
</v-container>
</v-content>
</v-main>
<v-footer app fixed>
<span style="margin-left:1em">&copy; You</span>
</v-footer>
@@ -57,4 +57,4 @@
.logo {
width: 16em;
}
</style>
</style>

View File

@@ -1,4 +1,4 @@
package cmd
// Version - Wails version
const Version = "v1.8.1-pre1"
const Version = "v1.8.1-pre6"

View File

@@ -31,6 +31,7 @@ func init() {
var verbose = false
var platform = ""
var ldflags = ""
var tags = ""
buildSpinner := spinner.NewSpinner()
buildSpinner.SetSpinSpeed(50)
@@ -44,7 +45,8 @@ func init() {
BoolFlag("verbose", "Verbose output", &verbose).
StringFlag("t", "Generate Typescript definitions to given file (at runtime)", &typescriptFilename).
StringFlag("ldflags", "Extra options for -ldflags", &ldflags).
StringFlag("gopath", "Specify your GOPATH location. Mounted to /go during cross-compilation.", &gopath)
StringFlag("gopath", "Specify your GOPATH location. Mounted to /go during cross-compilation.", &gopath).
StringFlag("tags", "Build tags to pass to the go compiler (quoted and space separated)", &tags)
var b strings.Builder
for _, plat := range getSupportedPlatforms() {
@@ -106,6 +108,9 @@ func init() {
projectOptions.LdFlags = ldflags
projectOptions.GoPath = gopath
// Add tags
projectOptions.Tags = tags
// Validate config
// Check if we have a frontend
err = cmd.ValidateFrontendConfig(projectOptions)
@@ -189,6 +194,10 @@ func init() {
return err
}
if projectOptions.Platform == "windows" {
logger.Yellow("*** Please note: Windows builds use mshtml which is only compatible with IE11. For more information, please read https://wails.app/guides/windows/ ***")
}
logger.Yellow("Awesome! Project '%s' built!", projectOptions.Name)
return nil

View File

@@ -70,6 +70,7 @@ func init() {
}
logger.Yellow("Awesome! Project '%s' built!", projectOptions.Name)
return cmd.ServeProject(projectOptions, logger)
})
}

View File

@@ -2,7 +2,6 @@ package renderer
import (
"time"
"unsafe"
"github.com/gorilla/websocket"
"github.com/leaanthony/mewn"
@@ -50,7 +49,7 @@ func (s *session) Identifier() string {
func (s *session) sendMessage(msg string) error {
if !s.done {
s.writeChan <- *(*[]byte)(unsafe.Pointer(&msg))
s.writeChan <- []byte(msg)
}
return nil
}