Skip to content

Commit ad64689

Browse files
committed
remove vueVersion templating and fix to vue@^1.0.28
1 parent ab34937 commit ad64689

File tree

12 files changed

+23
-85
lines changed

12 files changed

+23
-85
lines changed

meta.js

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ module.exports = {
1313
message: 'Project description',
1414
default: 'An electron-vue project'
1515
},
16-
vueVersion: {
17-
type: 'list',
18-
required: true,
19-
message: 'Which version of Vue.js would you like installed?',
20-
choices: ['2.x', '1.x']
21-
},
2216
plugins: {
2317
type: 'checkbox',
2418
message: 'Select which Vue plugins to install',
@@ -75,13 +69,13 @@ module.exports = {
7569
if (list[check]) return opts.fn(this)
7670
else return opts.inverse(this)
7771
},
78-
deps (plugins, version) {
72+
deps (plugins) {
7973
let output = ''
8074
let dependencies = {
8175
'vue-electron': '^1.0.0',
8276
'vue-resource': '^1.0.3',
83-
'vue-router': version === '2.x' ? '^2.0.0' : '^0.7.13',
84-
'vuex': version === '2.x' ? '^2.0.0' : '^1.0.0'
77+
'vue-router':'^0.7.13',
78+
'vuex': '^1.0.0'
8579
}
8680

8781
if (Object.keys(plugins).length > 0) output += ',\n'
@@ -93,21 +87,21 @@ module.exports = {
9387

9488
return output
9589
},
96-
ver (version, module) {
97-
let output = ''
90+
// ver (version, module) {
91+
// let output = ''
9892

99-
if (module === 'core') {
100-
output += '"vue": "'
101-
output += (version === '2.x') ? '^2.0.1' : '^1.0.28'
102-
output += '"'
103-
} else {
104-
output += '"vue-loader": "'
105-
output += (version === '2.x') ? '^9.5.1' : '^8.5.2'
106-
output += '",'
107-
}
93+
// if (module === 'core') {
94+
// output += '"vue": "'
95+
// output += (version === '2.x') ? '^2.0.1' : '^1.0.28'
96+
// output += '"'
97+
// } else {
98+
// output += '"vue-loader": "'
99+
// output += (version === '2.x') ? '^9.5.1' : '^8.5.2'
100+
// output += '",'
101+
// }
108102

109-
return output
110-
},
103+
// return output
104+
// },
111105
testing (unit, e2e, opts) {
112106
if (unit || e2e) {
113107
return opts.fn(this)

template/app/index.ejs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
<title><%= htmlWebpackPlugin.options.title %></title>
66
</head>
77
<body>
8-
{{#if_eq vueVersion '2.x'}}
9-
<div id="app"></div>
10-
{{else}}
118
<app></app>
12-
{{/if_eq}}
139
<!-- webpack builds are automatically injected -->
1410
</body>
1511
</html>

template/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "{{ description }}",
55
"main": "electron.js",
66
"dependencies": {
7-
{{ver vueVersion 'core'}}{{deps plugins vueVersion}}
7+
"vue": "^1.0.28"{{deps plugins}}
88
},
99
"devDependencies": {},
1010
"author": "{{ author }}"

template/app/src/components/LandingPageView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<template>
99
<div>
10-
<img src="{{#if_eq vueVersion '2.x'}}./{{/if_eq}}LandingPageView/assets/logo.png" alt="electron-vue">
10+
<img src="LandingPageView/assets/logo.png" alt="electron-vue">
1111
<h1>Welcome.</h1>
1212
{{#isEnabled plugins 'vue-router'}}
1313
<current-page></current-page>

template/app/src/main.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@ Vue.use(Router)
2424
Vue.config.debug = true
2525

2626
{{#isEnabled plugins 'vue-router'}}
27-
{{#if_eq vueVersion '2.x'}}
28-
const router = new Router({
29-
scrollBehavior: () => ({ y: 0 }),
30-
routes
31-
})
32-
33-
/* eslint-disable no-new */
34-
new Vue({
35-
router,
36-
...App
37-
}).$mount('#app')
38-
{{else}}
3927
const router = new Router()
4028

4129
router.map(routes)
@@ -47,19 +35,12 @@ router.redirect({
4735
})
4836

4937
router.start(App, 'app')
50-
{{/if_eq}}
5138
{{else}}
5239
import App from './App'
5340

5441
/* eslint-disable no-new */
55-
{{#if_eq vueVersion '2.x'}}
56-
new Vue({
57-
...App
58-
}).$mount('#app')
59-
{{else}}
6042
new Vue({
6143
el: 'body',
6244
components: { App }
6345
})
64-
{{/if_eq}}
6546
{{/isEnabled}}

template/app/src/routes.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
{{#if_eq vueVersion '2.x'}}
2-
export default [
3-
{
4-
path: '/',
5-
name: 'landing-page',
6-
component: require('components/LandingPageView')
7-
},
8-
{
9-
path: '*',
10-
redirect: '/'
11-
}
12-
]
13-
{{else}}
141
import Vue from 'vue'
152

163
export default {
@@ -19,4 +6,3 @@ export default {
196
name: 'landing-page'
207
}
218
}
22-
{{/if_eq}}

template/app/src/vuex/actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as types from './mutation-types'
22

3-
export const decrementMain = ({ {{#if_eq vueVersion '2.x'}}commit{{else}}dispatch{{/if_eq}} }) => {
4-
{{#if_eq vueVersion '2.x'}}commit{{else}}dispatch{{/if_eq}}(types.DECREMENT_MAIN_COUNTER)
3+
export const decrementMain = ({ dispatch }) => {
4+
dispatch(types.DECREMENT_MAIN_COUNTER)
55
}
66

7-
export const incrementMain = ({ {{#if_eq vueVersion '2.x'}}commit{{else}}dispatch{{/if_eq}} }) => {
8-
{{#if_eq vueVersion '2.x'}}commit{{else}}dispatch{{/if_eq}}(types.INCREMENT_MAIN_COUNTER)
7+
export const incrementMain = ({ dispatch }) => {
8+
dispatch(types.INCREMENT_MAIN_COUNTER)
99
}

template/app/src/vuex/getters.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
{{#if_eq vueVersion '2.x'}}
2-
export const mainCounter = state => state.counters.main
3-
{{else}}
41
export function mainCounter (state) {
52
return state.counters.main
63
}
7-
{{/if_eq}}

template/app/src/vuex/store.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import Vue from 'vue'
22
import Vuex from 'vuex'
3-
{{#if_eq vueVersion '2.x'}}
4-
import * as actions from './actions'
5-
import * as getters from './getters'
6-
{{/if_eq}}
73
import modules from './modules'
84

95
Vue.use(Vuex)
106

117
export default new Vuex.Store({
12-
{{#if_eq vueVersion '2.x'}}
13-
actions,
14-
getters,
15-
{{/if_eq}}
168
modules,
179
strict: true
1810
})

template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"url-loader": "^0.5.7",
9797
"vue-hot-reload-api": "^1.3.2",
9898
"vue-html-loader": "^1.2.2",
99-
{{ver vueVersion 'loader'}}
99+
"vue-loader": "^8.5.2",
100100
"vue-style-loader": "^1.0.0",
101101
"webpack": "^1.13.0",
102102
"webpack-dev-server": "^1.14.1"

template/test/unit/specs/LandingPageView.spec.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ import LandingPageView from 'src/components/LandingPageView'
44
describe('LandingPageView.vue', () => {
55
it('should render correct contents', () => {
66
const vm = new Vue({
7-
{{#if_eq vueVersion '2.x'}}
8-
el: document.createElement('div'),
9-
render: h => h(LandingPageView)
10-
{{else}}
117
components: { LandingPageView },
128
template: `
139
<div>
1410
<landing-page-view></landing-page-view>
1511
</div>
1612
`
17-
{{/if_eq}}
1813
}).$mount()
1914

2015
expect(vm.$el.querySelector('h1').textContent).to.contain('Welcome.')

template/webpack.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,9 @@ let config = {
8888
},
8989
target: 'electron-renderer',
9090
vue: {
91-
{{#if_eq vueVersion '1.x'}}
9291
autoprefixer: {
9392
browsers: ['last 2 Chrome versions']
9493
},
95-
{{/if_eq}}
9694
loaders: {
9795
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
9896
scss: 'vue-style-loader!css-loader!sass-loader'

0 commit comments

Comments
 (0)