Skip to content

Commit

Permalink
🎉 Initial project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Feb 25, 2020
1 parent 6fca0db commit 8712a8b
Show file tree
Hide file tree
Showing 21 changed files with 10,772 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
'@vue/typescript',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'@typescript-eslint/no-unused-vars': 'error',
},
parserOptions: {
parser: '@typescript-eslint/parser',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

[![CircleCI](https://circleci.com/gh/slaweet/moving-motivators.svg?style=shield)](https://circleci.com/gh/slaweet/moving-motivators)
[![codecov](https://codecov.io/gh/slaweet/moving-motivators/branch/master/graph/badge.svg)](https://codecov.io/gh/slaweet/moving-motivators)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/slaweet/moving-motivators.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/slaweet/moving-motivators/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/slaweet/moving-motivators.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/slaweet/moving-motivators/context:javascript)
[![Dependencies Status](https://david-dm.org/slaweet/moving-motivators/status.svg)](https://david-dm.org/slaweet/moving-motivators)
[![devDependencies Status](https://david-dm.org/slaweet/moving-motivators/dev-status.svg)](https://david-dm.org/slaweet/moving-motivators?type=dev)
[![JavaScript Style Guide: AirBnB](https://img.shields.io/badge/code%20style-airbnb-brightgreen.svg)](https://github.com/airbnb/javascript "AirBnB Style guide")
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

# moving-motivators


![Sample screenshot](screenshot.png)


## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Run your unit tests
```
yarn test:unit
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
};
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
};
38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "moving-motivators",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "vue-cli-service test:unit",
"eslint": "vue-cli-service lint"
},
"dependencies": {
"@types/object-hash": "^1.3.1",
"core-js": "^3.4.4",
"object-hash": "^2.0.1",
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
"vue-property-decorator": "^8.3.0"
},
"devDependencies": {
"@types/jest": "^25.1.1",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-typescript": "^4.1.0",
"@vue/cli-plugin-unit-jest": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-airbnb": "^5.0.2",
"@vue/eslint-config-typescript": "^5.0.1",
"@vue/test-utils": "1.0.0-beta.29",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.1.2",
"sass": "^1.23.7",
"sass-loader": "^8.0.0",
"typescript": "~3.7.5",
"vue-template-compiler": "^2.6.10"
}
}
Binary file added public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>moving-motivators</title>
</head>
<body>
<noscript>
<strong>We're sorry but moving-motivators doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
27 changes: 27 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<div id="app">
<MovingMotivators/>
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import MovingMotivators from './components/MovingMotivators.vue';
@Component({
components: {
MovingMotivators,
},
})
export default class App extends Vue {}
</script>

<style lang="scss">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions src/cards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Card } from './types';

const cards:Card[] = [
{
name: 'Curiosity',
description: 'I have plenty of things to investigate and to think about',
}, {
name: 'Honor',
description: 'I feel proud that my personal values are reflected in how I work.',
}, {
name: 'Acceptance',
description: 'The people around me approve of what I do and who I am.',
}, {
name: 'Mastery',
description: 'My work challenges my competence but it is still within my abilities.',
}, {
name: 'Power',
description: 'There’s enough room for me to influence what happens around me.',
}, {
name: 'Freedom',
description: 'I am independent of others with my work and my responsibilities.',
}, {
name: 'Relatedness',
description: 'I have good social contacts with the people in my work.',
}, {
name: 'Order',
description: 'There are enough rules and policies for a stable environment.',
}, {
name: 'Goal',
description: 'My purpose in life is reflected in the work that I do.',
}, {
name: 'Status',
description: 'My position is good, and recognized by the people who work with me.',
},
];
export default cards;
56 changes: 56 additions & 0 deletions src/components/MovingMotivators.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<template>
<div class="app">
<div class="controls">
<h2>Moving Motivators</h2>
</div>
<div class="footer">
Built with <a href="https://vuejs.org/" target="_blank">Vue.js</a>
and ❤️ by <a href="https://github.com/slaweet" target="_blank">slaweet</a>
</div>
</div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { Card } from '../types';
import cards from '../cards';
@Component({
components: {
},
})
export default class CubeCrash extends Vue {
private cards:Card[] = [];
mounted() {
this.cards = cards;
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.app {
margin: 0 auto;
min-height: 98vh;
display: flex;
justify-content: space-between;
flex-direction: column;
align-items: center;
}

.controls {
display: flex;
width: 442px;
justify-content: space-between;
align-items: center;
}

h1 {
margin: 0;
}

h2 {
padding-right: 10px;
}
</style>
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Vue from 'vue';
import App from './App.vue';

Vue.config.productionTip = false;

new Vue({
render: (h) => h(App),
}).$mount('#app');
14 changes: 14 additions & 0 deletions src/shims-tsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import Vue, { VNode } from 'vue';

declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
[elem: string]: any
}
}
}
5 changes: 5 additions & 0 deletions src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare module '*.vue' {
import Vue from 'vue';

export default Vue;
}
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Card {
name: string
description: string
}
Empty file added src/utils.ts
Empty file.
7 changes: 7 additions & 0 deletions static.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": "dist",
"clean_urls": true,
"routes": {
"/**": "index.html"
}
}
12 changes: 12 additions & 0 deletions tests/unit/movingMotivators.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { mount } from '@vue/test-utils';
import MovingMotivators from '@/components/MovingMotivators.vue';

import cards from '../../src/cards';

describe('MovingMotivators.vue', () => {
it('renders 10 cards', async () => {
const wrapper = mount(MovingMotivators, { });
await wrapper.vm.$nextTick();
expect(wrapper.findAll('.card')).toHaveLength(cards.length);
});
});
41 changes: 41 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strictPropertyInitialization": false,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jest"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit 8712a8b

Please sign in to comment.