├── .ackrc
├── eleform.jpg
├── public
├── favicon.ico
└── index.html
├── src
├── shims-vue.d.ts
├── views
│ ├── About.vue
│ └── Home.vue
├── store.ts
├── main.ts
├── components
│ └── Question.vue
├── shims-tsx.d.ts
├── router.ts
└── App.vue
├── vue.config.js
├── .gitignore
├── tests
├── unit
│ └── Question.spec.ts
└── e2e
│ ├── specs
│ └── test.js
│ └── custom-assertions
│ └── elementCount.js
├── tslint.json
├── tsconfig.json
├── .travis.yml
├── README.md
└── package.json
/.ackrc:
--------------------------------------------------------------------------------
1 | --ignore-file=is:yarn.lock
2 | --ignore-file=is:yarn-error.log
3 |
--------------------------------------------------------------------------------
/eleform.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MartinDelille/eleform/HEAD/eleform.jpg
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MartinDelille/eleform/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue';
3 | export default Vue;
4 | }
5 |
--------------------------------------------------------------------------------
/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is an about page
4 |
5 |
6 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | publicPath: process.env.NODE_ENV === 'production'
3 | ? '/eleform/'
4 | : '/'
5 | }
6 |
--------------------------------------------------------------------------------
/src/store.ts:
--------------------------------------------------------------------------------
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 | });
17 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
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');
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | coverage/
5 | npm-debug.log
6 | yarn-error.log
7 | yarn.lock
8 | package-lock.json
9 | selenium-debug.log
10 | tests/e2e/reports
11 |
12 | # Editor directories and files
13 | .idea
14 | *.suo
15 | *.ntvs*
16 | *.njsproj
17 | *.sln
18 | .vs/
19 |
--------------------------------------------------------------------------------
/src/components/Question.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/shims-tsx.d.ts:
--------------------------------------------------------------------------------
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 | }
14 |
--------------------------------------------------------------------------------
/tests/unit/Question.spec.ts:
--------------------------------------------------------------------------------
1 | import { shallowMount } from '@vue/test-utils';
2 | import Question from '@/components/Question.vue';
3 |
4 | describe('Question.vue', () => {
5 | it('renders props.msg when passed', () => {
6 | const msg = 'new message';
7 | const wrapper = shallowMount(Question, {
8 | propsData: { msg },
9 | });
10 | expect(wrapper.text()).toMatch(msg);
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
--------------------------------------------------------------------------------
/src/router.ts:
--------------------------------------------------------------------------------
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 | });
22 |
--------------------------------------------------------------------------------
/tests/e2e/specs/test.js:
--------------------------------------------------------------------------------
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('.question')
10 | .assert.elementCount('h1', 1)
11 | .assert.containsText('h1', 'Can you help me?')
12 | .end()
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
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 | }
20 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | eleform
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Home |
5 | About
6 |
7 |
8 |
9 |
10 |
11 |
30 |
--------------------------------------------------------------------------------
/tests/e2e/custom-assertions/elementCount.js:
--------------------------------------------------------------------------------
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 | }
20 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
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 | "jest"
17 | ],
18 | "paths": {
19 | "@/*": [
20 | "src/*"
21 | ]
22 | },
23 | "lib": [
24 | "es2015",
25 | "dom",
26 | "dom.iterable",
27 | "scripthost"
28 | ]
29 | },
30 | "include": [
31 | "src/**/*.ts",
32 | "src/**/*.tsx",
33 | "src/**/*.vue",
34 | "tests/**/*.ts",
35 | "tests/**/*.tsx"
36 | ],
37 | "exclude": [
38 | "node_modules"
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '10.5'
4 | script:
5 | - npm run build
6 | - npm run test:unit
7 | deploy:
8 | provider: pages
9 | skip-cleanup: true
10 | github-token: "$GH_TOKEN"
11 | keep-history: true
12 | local-dir: dist
13 | on:
14 | branch: master
15 | webhooks:
16 | email: false
17 | urls:
18 | - https://webhooks.gitter.im/e/1af305337aa41e422c46
19 | on_success: always
20 | on_failure: always
21 | on_start: false
22 | env:
23 | global:
24 | secure: WjZ8+fcMpzIKF3YoCXnXgjmJI47bS05s7DHEyxStQ6hLU7wInsCB+KPuhL7ngiykALH1b0u1ooxyego59ZJbSgd/+ywIn4y/JaF9h0R0nqs9ij0BOfjva1W5sUmSEjepEX1NvNUiD86MloKKH69KJ7q6aoaqNKSFwsRaCOhJB3bf5+cbN6Zte+bplATF8oRRYi68+5t84Moq4cVf6KiDU04OUDuyTGkNJB7V0BapVpa/b+wVdTKdCtXo5RQqGehvV2z9PsUXlVesERPzqM+//H0XmVgUA6APnVjvieJQF4oW3n2vWrm46/ZKuEM+QH66+3W7WZIxXvwq0kBup1phex3PpZu5iyIQjDjxjuA9QAKhzbUSxQnOYb0GkD+yIMbCj3JwnJZjjiCG25cRb3jmrf7Gf8HAY2F2Porcn+avmmSFzOiVEjFJNIqM354kd/2Ca2K+/SiWByj4e/zYCcnWGQn2hoJPGeWh3w2TaUrFgB5dlO5dPpAPp4rjPb0NlMNlQm4ZlnufWemccBQIruoLpSZbW8zKC75pU9pQT9mq9aMXcoAnq+vJQb3DObLG8xuJCqJYZxCQdbFPsKkwJd+pwdUoKTUt0qnuu3MC8T/JuNWxUHIGQlsS7f/XdnOdrNWlT5nkYqv11YfFUFO68LNvkvlSn0V0bI4fN1mRjSztiKE=
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # eleform
2 |
3 | [](https://gitter.im/eleform/Lobby?utm_source=badge)
4 | [](https://travis-ci.org/MartinDelille/eleform)
5 | [](https://liberapay.com/eleform/donate)
6 |
7 | 
8 |
9 | Welcome to the eleform project!
10 |
11 | The project eleform aims to create a form with a simplified UX (like http://typeform.com/ do).
12 |
13 | The stack is currently *VueJS/TypeScript* for the frontend. I'm thinking about using https://golang.org/ for the backend part which is not yet implemented.
14 |
15 | ## Project setup
16 |
17 | ```
18 | npm install
19 | ```
20 |
21 | ### Compiles and hot-reloads for development
22 |
23 | ```
24 | npm run serve
25 | ```
26 |
27 | ### Compiles and minifies for production
28 |
29 | ```
30 | npm run build
31 | ```
32 |
33 | ### Lints and fixes files
34 |
35 | ```
36 | npm run lint
37 | ```
38 |
39 | ### Run your unit tests
40 |
41 | ```
42 | npm run test:unit
43 | ```
44 |
45 | ### Run your end-to-end tests
46 |
47 | ```
48 | npm run test:e2e
49 | ```
50 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eleform",
3 | "version": "0.1.0",
4 | "homepage": "https://martindelille.github.io/eleform",
5 | "private": true,
6 | "scripts": {
7 | "serve": "vue-cli-service serve",
8 | "build": "vue-cli-service build",
9 | "lint": "vue-cli-service lint",
10 | "test:unit": "vue-cli-service test:unit",
11 | "test:e2e": "vue-cli-service test:e2e",
12 | "deploy": "npm run build; push-dir --dir=dist --branch=gh-pages --cleanup"
13 | },
14 | "dependencies": {
15 | "sass": "^1.13.0",
16 | "typescript": "^3.0.1",
17 | "vue": "^2.5.17",
18 | "vue-class-component": "^6.0.0",
19 | "vue-property-decorator": "^7.0.0",
20 | "vue-router": "^3.0.1",
21 | "vuex": "^3.0.1",
22 | "@types/jest": "^23.1.4",
23 | "@vue/cli": "^3.0.0",
24 | "@vue/cli-plugin-e2e-nightwatch": "^3.0.0",
25 | "@vue/cli-plugin-typescript": "^3.0.0",
26 | "@vue/cli-plugin-unit-jest": "^3.0.0",
27 | "@vue/cli-service": "^3.0.0",
28 | "@vue/test-utils": "^1.0.0-beta.24",
29 | "node-sass": "^4.9.3",
30 | "push-dir": "^0.4.1",
31 | "sass-loader": "^7.1.0",
32 | "ts-jest": "^23.0.0",
33 | "vue-template-compiler": "^2.5.17"
34 | },
35 | "postcss": {
36 | "plugins": {
37 | "autoprefixer": {}
38 | }
39 | },
40 | "browserslist": [
41 | "> 1%",
42 | "last 2 versions",
43 | "not ie <= 8"
44 | ],
45 | "jest": {
46 | "moduleFileExtensions": [
47 | "ts",
48 | "tsx",
49 | "js",
50 | "jsx",
51 | "json",
52 | "vue"
53 | ],
54 | "transform": {
55 | "^.+\\.vue$": "vue-jest",
56 | ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
57 | "^.+\\.tsx?$": "ts-jest"
58 | },
59 | "moduleNameMapper": {
60 | "^@/(.*)$": "/src/$1"
61 | },
62 | "snapshotSerializers": [
63 | "jest-serializer-vue"
64 | ],
65 | "testMatch": [
66 | "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
67 | ]
68 | }
69 | }
70 |
--------------------------------------------------------------------------------