|
1 |
| -# skeleton-vue-typescript |
2 |
| -A skeleton project with Vue.js, TypeScript, Bootstrap, Less, Webpack, and Jest. |
| 1 | +# Vue.js TypeScript Frontend Skeleton Project |
| 2 | + |
| 3 | +> A skeleton project with Vue.js, TypeScript, Bootstrap, Less, Webpack, and Jest. |
| 4 | +
|
| 5 | +## Structure |
| 6 | + |
| 7 | +- `src/app.ts`: main file of the app that loads and configures all dependencies and kickstarts the parent Vue component |
| 8 | +- `src/routes.ts`: configuration of routes (`route`: binding a `component` to a certain `path`) |
| 9 | +- `src/common/`: directory for shared functionality that is not specific to a certain Vue or domain concept |
| 10 | +- `src/components/`: directory for all Vues; should be structured according to domain concepts |
| 11 | +- `src/components/App.vue`: basic app skeleton with header/nav, body, and footer |
| 12 | +- `src/conf/config.ts`: configuration file with app or environment specific properties |
| 13 | +- `test/`: directory for all tests |
| 14 | + |
| 15 | +## Build Setup |
| 16 | + |
| 17 | +``` bash |
| 18 | +# install dependencies |
| 19 | +npm install |
| 20 | + |
| 21 | +# serve locally with hot reload (localhost:9000, adjustable in webpack.dev.config.js) |
| 22 | +npm start |
| 23 | + |
| 24 | +# build for production with minification |
| 25 | +npm run build |
| 26 | + |
| 27 | +# run TypeScript linter |
| 28 | +npm run lint |
| 29 | + |
| 30 | +# run tests and create coverage reports |
| 31 | +npm test |
| 32 | +``` |
| 33 | + |
| 34 | +## Useful VSCode Extensions |
| 35 | + |
| 36 | +- Vetur (helps with Vue SFCs) |
| 37 | +- TSLint (enforces coding rules in `tslint.json`) |
| 38 | +- Prettier (formats Vue files) |
| 39 | +- EditorConfig (enforces code formatting in `.editorconfig`) |
| 40 | + |
| 41 | +## VSCode Settings |
| 42 | + |
| 43 | +```json |
| 44 | +{ |
| 45 | + "editor.formatOnSave": true, |
| 46 | + "prettier.disableLanguages": [ |
| 47 | + "markdown" |
| 48 | + ], |
| 49 | + "tslint.alwaysShowRuleFailuresAsWarnings": true, |
| 50 | + "tslint.autoFixOnSave": true, |
| 51 | + "vetur.format.defaultFormatter.html": "js-beautify-html" |
| 52 | +} |
| 53 | +``` |
0 commit comments