diff --git a/cmd/templates/vuetify2-basic/.jshint b/cmd/templates/vuetify2-basic/.jshint new file mode 100644 index 00000000..0557edf1 --- /dev/null +++ b/cmd/templates/vuetify2-basic/.jshint @@ -0,0 +1,3 @@ +{ + "esversion": 6 +} \ No newline at end of file diff --git a/cmd/templates/vuetify2-basic/frontend/.gitignore b/cmd/templates/vuetify2-basic/frontend/.gitignore new file mode 100644 index 00000000..185e6631 --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/.gitignore @@ -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* diff --git a/cmd/templates/vuetify2-basic/frontend/babel.config.js b/cmd/templates/vuetify2-basic/frontend/babel.config.js new file mode 100644 index 00000000..ba179669 --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/cmd/templates/vuetify2-basic/frontend/package.json.template b/cmd/templates/vuetify2-basic/frontend/package.json.template new file mode 100644 index 00000000..42555b90 --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/package.json.template @@ -0,0 +1,53 @@ +{ + "name": "{{.NPMProjectName}}", + "author": "{{.Author.Name}}<{{.Author.Email}}>", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "babel-polyfill": "^6.26.0", + "core-js": "^2.6.4", + "material-design-icons-iconfont": "^5.0.1", + "vue": "^2.5.22", + "vuetify": "^1.5.14", + "@wailsapp/runtime": "^1.0.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.4.0", + "@vue/cli-plugin-eslint": "^3.4.0", + "@vue/cli-service": "^3.4.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.8.0", + "eslint-plugin-vue": "^5.0.0", + "eventsource-polyfill": "^0.9.6", + "vue-template-compiler": "^2.5.21", + "webpack-hot-middleware": "^2.24.3" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/essential", + "eslint:recommended" + ], + "rules": {}, + "parserOptions": { + "parser": "babel-eslint" + } + }, + "postcss": { + "plugins": { + "autoprefixer": {} + } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} \ No newline at end of file diff --git a/cmd/templates/vuetify2-basic/frontend/src/App.vue b/cmd/templates/vuetify2-basic/frontend/src/App.vue new file mode 100644 index 00000000..6522b31e --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/src/App.vue @@ -0,0 +1,60 @@ + + + + + + + dashboard + + + Dashboard + + + + + settings + + + Settings + + + + + + + Application + + + + + + + + + + © You + + + + + + + \ No newline at end of file diff --git a/cmd/templates/vuetify2-basic/frontend/src/assets/images/logo.png b/cmd/templates/vuetify2-basic/frontend/src/assets/images/logo.png new file mode 100644 index 00000000..31fc8249 Binary files /dev/null and b/cmd/templates/vuetify2-basic/frontend/src/assets/images/logo.png differ diff --git a/cmd/templates/vuetify2-basic/frontend/src/components/HelloWorld.vue b/cmd/templates/vuetify2-basic/frontend/src/components/HelloWorld.vue new file mode 100644 index 00000000..28487aa0 --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/src/components/HelloWorld.vue @@ -0,0 +1,83 @@ + + + + + + + + + + + Press Me + + + + + + + + + Message from Go + {{message}} + + + + Awesome + + + + + + + + + + + diff --git a/cmd/templates/vuetify2-basic/frontend/src/main.js b/cmd/templates/vuetify2-basic/frontend/src/main.js new file mode 100644 index 00000000..0061ba31 --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/src/main.js @@ -0,0 +1,21 @@ +import 'babel-polyfill'; +import Vue from 'vue'; + +// Setup Vuetify +import Vuetify from 'vuetify'; +Vue.use(Vuetify); +import 'vuetify/dist/vuetify.min.css'; +import 'material-design-icons-iconfont'; + +import App from './App.vue'; + +Vue.config.productionTip = false; +Vue.config.devtools = true; + +import Wails from '@wailsapp/runtime'; + +Wails.Init(() => { + new Vue({ + render: h => h(App) + }).$mount('#app'); +}); diff --git a/cmd/templates/vuetify2-basic/frontend/vue.config.js b/cmd/templates/vuetify2-basic/frontend/vue.config.js new file mode 100644 index 00000000..471d578f --- /dev/null +++ b/cmd/templates/vuetify2-basic/frontend/vue.config.js @@ -0,0 +1,43 @@ +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, + host: "localhost" + } +}; diff --git a/cmd/templates/vuetify2-basic/go.mod.template b/cmd/templates/vuetify2-basic/go.mod.template new file mode 100644 index 00000000..78038106 --- /dev/null +++ b/cmd/templates/vuetify2-basic/go.mod.template @@ -0,0 +1,5 @@ +module {{.BinaryName}} + +require ( + github.com/wailsapp/wails {{.WailsVersion}} +) \ No newline at end of file diff --git a/cmd/templates/vuetify2-basic/main.go.template b/cmd/templates/vuetify2-basic/main.go.template new file mode 100644 index 00000000..e2262bd1 --- /dev/null +++ b/cmd/templates/vuetify2-basic/main.go.template @@ -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() +} diff --git a/cmd/templates/vuetify2-basic/template.json b/cmd/templates/vuetify2-basic/template.json new file mode 100755 index 00000000..a33450fe --- /dev/null +++ b/cmd/templates/vuetify2-basic/template.json @@ -0,0 +1,14 @@ +{ + "name": "Vuetify2/Webpack Basic", + "version": "1.0.0", + "shortdescription": "A basic Vuetify2/Webpack4 template", + "description": "Basic template using Vuetify v2 and bundled using Webpack", + "install": "npm install", + "build": "npm run build", + "author": "Michael Hipp ", + "created": "2019-09-06", + "frontenddir": "frontend", + "serve": "npm run serve", + "bridge": "src", + "wailsdir": "" +}