Browse Source

Initial commit

Phyks (Lucas Verney) 3 years ago
commit
4580c5fb94
12 changed files with 174 additions and 0 deletions
  1. 5
    0
      .babelrc
  2. 11
    0
      .editorconfig
  3. 2
    0
      .gitignore
  4. 5
    0
      app/App.vue
  5. 25
    0
      app/index.js
  6. 12
    0
      app/routes.js
  7. 3
    0
      app/views/dashboardView.vue
  8. 4
    0
      app/views/index.js
  9. 5
    0
      app/views/publicView.vue
  10. 15
    0
      index.html
  11. 45
    0
      package.json
  12. 42
    0
      webpack.config.js

+ 5
- 0
.babelrc View File

@@ -0,0 +1,5 @@
1
+{
2
+  "presets": [
3
+      ["es2015", "stage-2"]
4
+  ]
5
+}

+ 11
- 0
.editorconfig View File

@@ -0,0 +1,11 @@
1
+# editorconfig.org
2
+# editorconfig is a unified configuration file that all editors can take
3
+# into account
4
+root = true
5
+
6
+[*]
7
+charset = utf-8
8
+end_of_line = lf
9
+trim_trailing_whitespace = true
10
+indent_style = space
11
+indent_size = 2

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
1
+dist/
2
+node_modules/

+ 5
- 0
app/App.vue View File

@@ -0,0 +1,5 @@
1
+<template>
2
+	<div class="rsvp-app" role="application">
3
+		<router-view></router-view>
4
+	</div>
5
+</template>

+ 25
- 0
app/index.js View File

@@ -0,0 +1,25 @@
1
+// NPM imports
2
+import Vue from 'vue'
3
+import VueRouter from 'vue-router'
4
+
5
+// Local imports
6
+import App from './App.vue'
7
+import routes from './routes'
8
+
9
+// Initialize Vue
10
+Vue.use(VueRouter)
11
+
12
+// Initialize router
13
+const router = new VueRouter({
14
+  routes
15
+})
16
+
17
+// Initialize application
18
+document.addEventListener('DOMContentLoaded', () => {
19
+    new Vue({
20
+        el: '[role=application]',
21
+        render: h => h(App),
22
+        router
23
+    })
24
+    console.log('App has been initialized.')
25
+})

+ 12
- 0
app/routes.js View File

@@ -0,0 +1,12 @@
1
+import { publicView, dashboardView } from './views';
2
+
3
+export default [
4
+  {
5
+    path: '/',
6
+    component: publicView
7
+  },
8
+  {
9
+    path: '/dashboard',
10
+    component: dashboardView
11
+  }
12
+]

+ 3
- 0
app/views/dashboardView.vue View File

@@ -0,0 +1,3 @@
1
+<template>
2
+  <div><p>Hello world 2</p></div>
3
+</template>

+ 4
- 0
app/views/index.js View File

@@ -0,0 +1,4 @@
1
+import publicView from './publicView.vue'
2
+import dashboardView from './dashboardView.vue'
3
+
4
+export { publicView, dashboardView }

+ 5
- 0
app/views/publicView.vue View File

@@ -0,0 +1,5 @@
1
+<template>
2
+  <div>
3
+    <p>Hello world</p>
4
+  </div>
5
+</template>

+ 15
- 0
index.html View File

@@ -0,0 +1,15 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <title>RSVP</title>
6
+    <meta name="mobile-web-app-capable" content="yes">
7
+    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
8
+  </head>
9
+  <body>
10
+    <div role="application"></div>
11
+
12
+    <script src="dist/commons.bundle.js"></script>
13
+    <script src="dist/app.bundle.js"></script>
14
+  </body>
15
+</html>

+ 45
- 0
package.json View File

@@ -0,0 +1,45 @@
1
+{
2
+  "name": "RSVP",
3
+  "version": "",
4
+  "cozy-type": "static",
5
+  "cozy-displayName": "RSVP",
6
+  "cozy-color": "",
7
+  "description": "",
8
+  "license": "",
9
+  "repository": {
10
+    "type": "git",
11
+    "url": ""
12
+  },
13
+  "icon-path": "",
14
+  "cozy-permissions": {
15
+    "event": {
16
+      "description": "Needed to hide conflicting time slots from the time slot selection."
17
+    }
18
+  },
19
+  "scripts": {
20
+    "build:prod": "cross-env NODE_ENV=production webpack -p",
21
+    "build:dev": "cross-env NODE_ENV=development webpack",
22
+    "lint": "standard 'app/**/*.js' 'webpack.config.js'",
23
+    "clean": "rimraf dist/*"
24
+  },
25
+  "contributors": [
26
+    "Phyks (Lucas Verney)"
27
+  ],
28
+  "dependencies": {
29
+    "vue": "^2.0.3",
30
+    "vue-router": "^2.0.1"
31
+  },
32
+  "devDependencies": {
33
+    "autoprefixer": "^6.5.1",
34
+    "babel-core": "^6.18.2",
35
+    "babel-loader": "^6.2.7",
36
+    "babel-preset-es2015": "^6.18.0",
37
+    "cross-env": "^3.1.3",
38
+    "css-loader": "^0.25.0",
39
+    "debug-loader": "0.0.1",
40
+    "rimraf": "^2.5.4",
41
+    "standard": "^8.5.0",
42
+    "vue-loader": "^9.7.0",
43
+    "webpack": "^1.13.3"
44
+  }
45
+}

+ 42
- 0
webpack.config.js View File

@@ -0,0 +1,42 @@
1
+'use strict'
2
+
3
+const path = require('path')
4
+const webpack = require('webpack')
5
+
6
+module.exports = {
7
+  context: path.join(__dirname, 'app'),
8
+  entry: {
9
+    app: './index.js'
10
+  },
11
+  output: {
12
+    path: path.join(__dirname, 'dist'),
13
+    filename: '[name].bundle.js'
14
+  },
15
+  module: {
16
+    loaders: [
17
+      {
18
+        test: /\.js$/,
19
+        exclude: /node_modules/,
20
+        loader: 'babel',
21
+      },
22
+      {
23
+        test: /\.vue$/,
24
+        loader: 'vue'
25
+      }
26
+    ]
27
+  },
28
+  vue: {
29
+    postcss: [
30
+      require('autoprefixer')({
31
+        browsers: ['last 3 versions']
32
+      })
33
+    ]
34
+  },
35
+  plugins: [
36
+    new webpack.optimize.CommonsChunkPlugin({
37
+      name: 'commons',
38
+      filename: 'commons.bundle.js',
39
+      minChunks: 2
40
+    })
41
+  ]
42
+}