├── .babelrc
├── .eslintrc
├── .gitignore
├── CHANGELOG.md
├── app
├── api
│ └── auth.js
├── assets
│ └── index.html
├── components
│ ├── app.vue
│ └── error.vue
├── config
│ └── routes.js
├── initialize.js
└── state
│ ├── modules
│ └── auth.js
│ ├── mutations.js
│ └── store.js
├── brunch-config.js
├── license.md
├── package.json
└── readme.md
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015"
4 | ]
5 | }
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "es6": true
4 | },
5 | "parserOptions": {
6 | "sourceType": "module"
7 | },
8 | "extends": "eslint:recommended"
9 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Folders
2 |
3 | .idea/
4 | public/
5 | node_modules/
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 0.2.3
4 |
5 | - Added babelrc
6 | - Added eslintrc
7 |
8 | ## 0.2.0
9 |
10 | - Improved comments
11 | - Added vue-validator
12 | - Added config
13 | - Added build scripts
14 |
15 | ## 0.1.3
16 |
17 | - Added babel-polyfill
18 | - Updated dependencies
19 |
20 | ## 0.1.0
21 |
22 | - Initial release
--------------------------------------------------------------------------------
/app/api/auth.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import State from '../state/store';
3 | import VueResource from 'vue-resource';
4 |
5 | Vue.use(VueResource);
6 |
7 | export default {
8 |
9 | signin: function(username, password) {
10 | State.dispatch('AUTH_TOKEN', 'Q6SnSk2N5wGbXsEllqG6hSx7vRmxcz');
11 | },
12 |
13 | signout: function() {
14 | State.dispatch('AUTH_TOKEN', null);
15 | }
16 | }
--------------------------------------------------------------------------------
/app/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Brunch with Vue
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/components/app.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Hello World!
5 |
You are authenticated with the following token {{ token }}
6 |
7 |
8 |
9 |
10 |
30 |
--------------------------------------------------------------------------------
/app/components/error.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Page not found
5 |
It would appear that {{ path }} could not be found.
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/config/routes.js:
--------------------------------------------------------------------------------
1 | import app from '../components/app.vue';
2 | import error from '../components/error.vue';
3 |
4 | export default {
5 |
6 | '*': {
7 | name: 'error',
8 | component: error
9 | },
10 |
11 | '/': {
12 | name: 'app',
13 | component: app
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/app/initialize.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import 'babel-polyfill';
3 | import store from './state/store';
4 | import VueRouter from 'vue-router';
5 | import routes from './config/routes';
6 | import VueResource from 'vue-resource';
7 | import VueValidator from 'vue-validator';
8 |
9 | //
10 | // Vue extensions
11 | // Here we tell Vue that we want to add extra functionality to the application.
12 | //
13 |
14 | Vue.use(VueRouter);
15 | Vue.use(VueResource);
16 | Vue.use(VueValidator);
17 |
18 | //
19 | // Enviromnment
20 | //
21 |
22 | const environment = process.env.NODE_ENV;
23 |
24 | //
25 | // Configure Vue
26 | // Here we will configure Vue based on the environment we are running in.
27 | //
28 |
29 | Vue.config.debug = (environment === 'development');
30 | Vue.config.devtools = (environment === 'development');
31 |
32 | //
33 | // Application
34 | // Here we will create the application instance.
35 | //
36 |
37 | let application = {
38 | store
39 | };
40 |
41 | //
42 | // Router
43 | // Here we will create the router instance.
44 | //
45 |
46 | let router = new VueRouter({
47 | history: true
48 | });
49 |
50 | //
51 | // Router mapping.
52 | // Here we will tell VueRouter what routes the application will be using.
53 | //
54 |
55 | router.map(routes);
56 |
57 | //
58 | // Start the application
59 | // Finally, we can start the application.
60 | //
61 |
62 | router.start(application, '#content', function() {
63 |
64 | if (window) {
65 | window.App = router.app;
66 | }
67 |
68 | });
69 |
--------------------------------------------------------------------------------
/app/state/modules/auth.js:
--------------------------------------------------------------------------------
1 | import {
2 | AUTH_TOKEN,
3 | } from '../mutations';
4 |
5 | const state = {
6 | token: null
7 | };
8 |
9 | const mutations = {
10 |
11 | [AUTH_TOKEN](state, token) {
12 | state.token = token;
13 | }
14 | };
15 |
16 | export default {
17 | state,
18 | mutations
19 | }
--------------------------------------------------------------------------------
/app/state/mutations.js:
--------------------------------------------------------------------------------
1 | export const AUTH_TOKEN = 'AUTH_TOKEN';
--------------------------------------------------------------------------------
/app/state/store.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 | import Logger from 'vuex/logger';
4 |
5 | import auth from './modules/auth';
6 |
7 | Vue.use(Vuex);
8 | Vue.config.debug = true;
9 |
10 | export default new Vuex.Store({
11 |
12 | strict: true,
13 |
14 | modules: {
15 | auth
16 | },
17 |
18 | middlewares: [
19 | Logger()
20 | ]
21 |
22 | });
--------------------------------------------------------------------------------
/brunch-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | files: {
3 | javascripts: {
4 | joinTo: 'app.js'
5 | },
6 | templates: {
7 | joinTo: 'app.js'
8 | }
9 | },
10 | plugins: {
11 | babel: {
12 | presets: ['es2015']
13 | }
14 | }
15 | };
--------------------------------------------------------------------------------
/license.md:
--------------------------------------------------------------------------------
1 | # The MIT License (MIT)
2 |
3 | Copyright © 2016 Nathaniel Blackburn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "brunch-with-vue",
3 | "description": "A skeleton application utilizing vue, vuex, vue-resource and vue-router.",
4 | "version": "0.2.2",
5 | "license": "MIT",
6 | "repository": {
7 | "type": "git",
8 | "url": "http://github.com/nblackburn/brunch-with-vue.git"
9 | },
10 | "scripts": {
11 | "watch": "brunch watch --server",
12 | "build": "brunch build --production"
13 | },
14 | "author": {
15 | "url": "http://nblackburn.uk",
16 | "name": "Nathaniel Blackburn",
17 | "email": "support@nblackburn.uk"
18 | },
19 | "keywords": [
20 | "vue",
21 | "brunch"
22 | ],
23 | "dependencies": {
24 | "vue": "^1.0.21",
25 | "vuex": "^0.6.3",
26 | "vue-router": "^0.7.13",
27 | "vue-resource": "^0.7.0",
28 | "vue-validator": "^2.1.1"
29 | },
30 | "devDependencies": {
31 | "brunch": "2.7.5",
32 | "vue-brunch": "^1.0.0",
33 | "babel-brunch": "^6.0.4",
34 | "babel-polyfill": "6.7.4",
35 | "babel-preset-es2015": "^6.6.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Brunch with Vue
2 |
3 | A skeleton application utilizing vue, vuex, vue-resource and vue-router.
4 |
5 | > **NOTE**: This package is no longer maintained.
6 |
7 | ## Instructions
8 |
9 | To get started, simply run the following command in your terminal...
10 |
11 | ```bash
12 | brunch new --skeleton nblackburn/brunch-with-vue
13 | ```
14 |
15 | ## Donations
16 |
17 | If you found this plugin to be useful, please consider [donating](https://paypal.me/nblackburn).
18 |
19 | ## License
20 |
21 | This component is licensed under [MIT](), see [license.md](license.md) for details.
22 |
--------------------------------------------------------------------------------