Skip to content

Commit 9097b2a

Browse files
committed
init
0 parents  commit 9097b2a

23 files changed

+7816
-0
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
/tests/e2e/reports/
6+
selenium-debug.log
7+
8+
# local env files
9+
.env.local
10+
.env.*.local
11+
12+
# Log files
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
17+
# Editor directories and files
18+
.idea
19+
.vscode
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw*

.postcssrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "show-v2.0",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint",
9+
"test:unit": "vue-cli-service test:unit",
10+
"test:e2e": "vue-cli-service test:e2e"
11+
},
12+
"dependencies": {
13+
"vue": "^2.5.16",
14+
"vue-class-component": "^6.0.0",
15+
"vue-property-decorator": "^7.0.0",
16+
"vue-router": "^3.0.1",
17+
"vuex": "^3.0.1"
18+
},
19+
"devDependencies": {
20+
"@types/chai": "^4.1.0",
21+
"@types/mocha": "^5.2.4",
22+
"@vue/cli-plugin-babel": "^3.0.0-rc.5",
23+
"@vue/cli-plugin-e2e-nightwatch": "^3.0.0-rc.5",
24+
"@vue/cli-plugin-typescript": "^3.0.0-rc.5",
25+
"@vue/cli-plugin-unit-mocha": "^3.0.0-rc.5",
26+
"@vue/cli-service": "^3.0.0-rc.5",
27+
"@vue/test-utils": "^1.0.0-beta.20",
28+
"chai": "^4.1.2",
29+
"less": "^3.0.4",
30+
"less-loader": "^4.1.0",
31+
"vue-template-compiler": "^2.5.16"
32+
}
33+
}

public/favicon.ico

1.12 KB
Binary file not shown.

public/index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title>show-v2.0</title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but show-v2.0 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

src/App.vue

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div id="app">
3+
<div id="nav">
4+
<router-link to="/">Home</router-link> |
5+
<router-link to="/about">About</router-link>
6+
</div>
7+
<router-view/>
8+
</div>
9+
</template>
10+
11+
<style lang="less">
12+
#app {
13+
font-family: 'Avenir', Helvetica, Arial, sans-serif;
14+
-webkit-font-smoothing: antialiased;
15+
-moz-osx-font-smoothing: grayscale;
16+
text-align: center;
17+
color: #2c3e50;
18+
}
19+
#nav {
20+
padding: 30px;
21+
a {
22+
font-weight: bold;
23+
color: #2c3e50;
24+
&.router-link-exact-active {
25+
color: #42b983;
26+
}
27+
}
28+
}
29+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/HelloWorld.vue

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
For guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://cli.vuejs.org" target="_blank">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank">babel</a></li>
12+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank">typescript</a></li>
13+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-mocha" target="_blank">unit-mocha</a></li>
14+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-e2e-nightwatch" target="_blank">e2e-nightwatch</a></li>
15+
</ul>
16+
<h3>Essential Links</h3>
17+
<ul>
18+
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
19+
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
20+
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
21+
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
22+
</ul>
23+
<h3>Ecosystem</h3>
24+
<ul>
25+
<li><a href="https://router.vuejs.org" target="_blank">vue-router</a></li>
26+
<li><a href="https://vuex.vuejs.org" target="_blank">vuex</a></li>
27+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
28+
<li><a href="https://vue-loader.vuejs.org" target="_blank">vue-loader</a></li>
29+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
30+
</ul>
31+
</div>
32+
</template>
33+
34+
<script lang="ts">
35+
import { Component, Prop, Vue } from 'vue-property-decorator';
36+
37+
@Component
38+
export default class HelloWorld extends Vue {
39+
@Prop() private msg!: string;
40+
}
41+
</script>
42+
43+
<!-- Add "scoped" attribute to limit CSS to this component only -->
44+
<style scoped lang="less">
45+
h3 {
46+
margin: 40px 0 0;
47+
}
48+
ul {
49+
list-style-type: none;
50+
padding: 0;
51+
}
52+
li {
53+
display: inline-block;
54+
margin: 0 10px;
55+
}
56+
a {
57+
color: #42b983;
58+
}
59+
</style>

src/main.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from 'vue';
2+
import App from './App.vue';
3+
import router from './router';
4+
import store from './store';
5+
6+
Vue.config.productionTip = false;
7+
8+
new Vue({
9+
router,
10+
store,
11+
render: (h) => h(App),
12+
}).$mount('#app');

src/router.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Vue from 'vue';
2+
import Router from 'vue-router';
3+
import Home from './views/Home.vue';
4+
import About from './views/About.vue';
5+
6+
Vue.use(Router);
7+
8+
export default new Router({
9+
routes: [
10+
{
11+
path: '/',
12+
name: 'home',
13+
component: Home,
14+
},
15+
{
16+
path: '/about',
17+
name: 'about',
18+
component: About,
19+
},
20+
],
21+
});

src/shims-tsx.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Vue, { VNode } from 'vue';
2+
3+
declare global {
4+
namespace JSX {
5+
// tslint:disable no-empty-interface
6+
interface Element extends VNode {}
7+
// tslint:disable no-empty-interface
8+
interface ElementClass extends Vue {}
9+
interface IntrinsicElements {
10+
[elem: string]: any;
11+
}
12+
}
13+
}

src/shims-vue.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.vue' {
2+
import Vue from 'vue';
3+
export default Vue;
4+
}

src/store.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Vue from 'vue';
2+
import Vuex from 'vuex';
3+
4+
Vue.use(Vuex);
5+
6+
export default new Vuex.Store({
7+
state: {
8+
9+
},
10+
mutations: {
11+
12+
},
13+
actions: {
14+
15+
},
16+
});

src/views/About.vue

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="about">
3+
<h1>This is an about page</h1>
4+
</div>
5+
</template>

src/views/Home.vue

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="home">
3+
<img src="../assets/logo.png">
4+
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
5+
</div>
6+
</template>
7+
8+
<script lang="ts">
9+
import { Component, Vue } from 'vue-property-decorator';
10+
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
11+
12+
@Component({
13+
components: {
14+
HelloWorld,
15+
},
16+
})
17+
export default class Home extends Vue {}
18+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// A custom Nightwatch assertion.
2+
// The assertion name is the filename.
3+
// Example usage:
4+
//
5+
// browser.assert.elementCount(selector, count)
6+
//
7+
// For more information on custom assertions see:
8+
// http://nightwatchjs.org/guide#writing-custom-assertions
9+
10+
exports.assertion = function elementCount (selector, count) {
11+
this.message = `Testing if element <${selector}> has count: ${count}`
12+
this.expected = count
13+
this.pass = val => val === count
14+
this.value = res => res.value
15+
function evaluator (_selector) {
16+
return document.querySelectorAll(_selector).length
17+
}
18+
this.command = cb => this.api.execute(evaluator, [selector], cb)
19+
}

tests/e2e/specs/test.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// For authoring Nightwatch tests, see
2+
// http://nightwatchjs.org/guide#usage
3+
4+
module.exports = {
5+
'default e2e tests': browser => {
6+
browser
7+
.url(process.env.VUE_DEV_SERVER_URL)
8+
.waitForElementVisible('#app', 5000)
9+
.assert.elementPresent('.hello')
10+
.assert.containsText('h1', 'Welcome to Your Vue.js + TypeScript App')
11+
.assert.elementCount('img', 1)
12+
.end()
13+
}
14+
}

tests/unit/HelloWorld.spec.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { expect } from 'chai';
2+
import { shallowMount } from '@vue/test-utils';
3+
import HelloWorld from '@/components/HelloWorld.vue';
4+
5+
describe('HelloWorld.vue', () => {
6+
it('renders props.msg when passed', () => {
7+
const msg = 'new message';
8+
const wrapper = shallowMount(HelloWorld, {
9+
propsData: { msg },
10+
});
11+
expect(wrapper.text()).to.include(msg);
12+
});
13+
});

tsconfig.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"module": "esnext",
5+
"strict": true,
6+
"jsx": "preserve",
7+
"importHelpers": true,
8+
"moduleResolution": "node",
9+
"experimentalDecorators": true,
10+
"emitDecoratorMetadata": true,
11+
"allowSyntheticDefaultImports": true,
12+
"sourceMap": true,
13+
"baseUrl": ".",
14+
"types": [
15+
"node",
16+
"mocha",
17+
"chai"
18+
],
19+
"paths": {
20+
"@/*": [
21+
"src/*"
22+
]
23+
},
24+
"lib": [
25+
"es2015",
26+
"dom",
27+
"dom.iterable",
28+
"scripthost"
29+
]
30+
},
31+
"include": [
32+
"src/**/*.ts",
33+
"src/**/*.tsx",
34+
"src/**/*.vue",
35+
"tests/**/*.ts",
36+
"tests/**/*.tsx"
37+
],
38+
"exclude": [
39+
"node_modules"
40+
]
41+
}

tslint.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"defaultSeverity": "warning",
3+
"extends": [
4+
"tslint:recommended"
5+
],
6+
"linterOptions": {
7+
"exclude": [
8+
"node_modules/**"
9+
]
10+
},
11+
"rules": {
12+
"quotemark": [true, "single"],
13+
"indent": [true, "spaces", 2],
14+
"interface-name": false,
15+
"ordered-imports": false,
16+
"object-literal-sort-keys": false,
17+
"no-consecutive-blank-lines": false
18+
}
19+
}

0 commit comments

Comments
 (0)