diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..a1fd69fc --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + root: true, + env: { + node: true + }, + 'extends': [ + 'plugin:vue/essential', + '@vue/standard' + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + }, + parserOptions: { + parser: 'babel-eslint' + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..185e6631 --- /dev/null +++ b/.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/.postcssrc.js b/.postcssrc.js new file mode 100644 index 00000000..100cc012 --- /dev/null +++ b/.postcssrc.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +} \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..ba179669 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..40186da6 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,22 @@ +module.exports = { + moduleFileExtensions: [ + 'js', + 'jsx', + 'json', + 'vue' + ], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: [ + 'jest-serializer-vue' + ], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ] +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..98c51196 --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "d2", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint", + "test:unit": "vue-cli-service test:unit" + }, + "dependencies": { + "vue": "^2.5.16", + "vue-router": "^3.0.1", + "vuex": "^3.0.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.0.0-rc.4", + "@vue/cli-plugin-eslint": "^3.0.0-rc.4", + "@vue/cli-plugin-unit-jest": "^3.0.0-rc.4", + "@vue/cli-service": "^3.0.0-rc.4", + "@vue/eslint-config-standard": "^3.0.0-rc.4", + "@vue/test-utils": "^1.0.0-beta.20", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "^23.0.1", + "node-sass": "^4.9.0", + "sass-loader": "^7.0.1", + "vue-template-compiler": "^2.5.16" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ] +} \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..c7b9a43c Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 00000000..59293660 --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + d2 + + + +
+ + + diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 00000000..f300d4b4 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue new file mode 100644 index 00000000..347413ce --- /dev/null +++ b/src/components/HelloWorld.vue @@ -0,0 +1,58 @@ + + + + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 00000000..f2534569 --- /dev/null +++ b/src/main.js @@ -0,0 +1,12 @@ +import Vue from 'vue' +import App from './App.vue' +import router from './router' +import store from './store' + +Vue.config.productionTip = false + +new Vue({ + router, + store, + render: h => h(App) +}).$mount('#app') diff --git a/src/router.js b/src/router.js new file mode 100644 index 00000000..9e03a620 --- /dev/null +++ b/src/router.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import Router from 'vue-router' +import Home from './views/Home.vue' +import About from './views/About.vue' + +Vue.use(Router) + +export default new Router({ + routes: [ + { + path: '/', + name: 'home', + component: Home + }, + { + path: '/about', + name: 'about', + component: About + } + ] +}) diff --git a/src/store.js b/src/store.js new file mode 100644 index 00000000..3c7424ed --- /dev/null +++ b/src/store.js @@ -0,0 +1,16 @@ +import Vue from 'vue' +import Vuex from 'vuex' + +Vue.use(Vuex) + +export default new Vuex.Store({ + state: { + + }, + mutations: { + + }, + actions: { + + } +}) diff --git a/src/views/About.vue b/src/views/About.vue new file mode 100644 index 00000000..3fa28070 --- /dev/null +++ b/src/views/About.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/Home.vue b/src/views/Home.vue new file mode 100644 index 00000000..a808facc --- /dev/null +++ b/src/views/Home.vue @@ -0,0 +1,18 @@ + + + diff --git a/tests/unit/.eslintrc.js b/tests/unit/.eslintrc.js new file mode 100644 index 00000000..4e51c63f --- /dev/null +++ b/tests/unit/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + env: { + jest: true + }, + rules: { + 'import/no-extraneous-dependencies': 'off' + } +} \ No newline at end of file diff --git a/tests/unit/HelloWorld.spec.js b/tests/unit/HelloWorld.spec.js new file mode 100644 index 00000000..f84fb39d --- /dev/null +++ b/tests/unit/HelloWorld.spec.js @@ -0,0 +1,12 @@ +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, { + propsData: { msg } + }) + expect(wrapper.text()).toMatch(msg) + }) +}) diff --git a/yarn.lock.REMOVED.git-id b/yarn.lock.REMOVED.git-id new file mode 100644 index 00000000..df942698 --- /dev/null +++ b/yarn.lock.REMOVED.git-id @@ -0,0 +1 @@ +f86be2ff240e43e97e65b73fe64bd79f71780d17 \ No newline at end of file