├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── .prettierrc.json ├── README.md ├── babel.config.js ├── jest.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html └── src ├── App.vue ├── assets └── logo.png ├── components └── Users.vue ├── main.js ├── mocks └── products.json ├── router └── index.js ├── server.js ├── store └── index.js └── views ├── About.vue └── Home.vue /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | extends: ["plugin:vue/essential", "@vue/prettier"], 7 | rules: { 8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off", 9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" 10 | }, 11 | parserOptions: { 12 | parser: "babel-eslint" 13 | }, 14 | overrides: [ 15 | { 16 | files: [ 17 | "**/__tests__/*.{j,t}s?(x)", 18 | "**/tests/unit/**/*.spec.{j,t}s?(x)" 19 | ], 20 | env: { 21 | jest: true 22 | } 23 | } 24 | ] 25 | }; 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "printWidth": 100 5 | } 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Screencast Mirage JS 2 | 3 | Assista ao screencast: [https://youtu.be/TtHhIAQ6T-c](https://youtu.be/TtHhIAQ6T-c) 4 | 5 | Download do video: [https://www.dropbox.com/s/bwxwho2qprrlxiv/Mirage%20JS-%20uma%20api%20dentro%20do%20seu%20projeto%20front%20end.mp4.zip?dl=0](https://www.dropbox.com/s/bwxwho2qprrlxiv/Mirage%20JS-%20uma%20api%20dentro%20do%20seu%20projeto%20front%20end.mp4.zip?dl=0) 6 | 7 | ## Project setup 8 | 9 | ``` 10 | npm install 11 | ``` 12 | 13 | ### Compiles and hot-reloads for development 14 | 15 | ``` 16 | npm run serve 17 | ``` 18 | 19 | ### Compiles and minifies for production 20 | 21 | ``` 22 | npm run build 23 | ``` 24 | 25 | ### Run your unit tests 26 | 27 | ``` 28 | npm run test:unit 29 | ``` 30 | 31 | ### Lints and fixes files 32 | 33 | ``` 34 | npm run lint 35 | ``` 36 | 37 | ### Customize configuration 38 | 39 | See [Configuration Reference](https://cli.vuejs.org/config/). 40 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ["@vue/cli-plugin-babel/preset"] 3 | }; 4 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: "@vue/cli-plugin-unit-jest" 3 | }; 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "miragejs-rehearsal-second", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "test:unit": "vue-cli-service test:unit", 9 | "lint": "vue-cli-service lint" 10 | }, 11 | "dependencies": { 12 | "axios": "^0.19.2", 13 | "core-js": "^3.4.4", 14 | "vue": "^2.6.10", 15 | "vue-router": "^3.1.3", 16 | "vuex": "^3.1.2" 17 | }, 18 | "devDependencies": { 19 | "@vue/cli-plugin-babel": "^4.1.0", 20 | "@vue/cli-plugin-eslint": "^4.1.0", 21 | "@vue/cli-plugin-router": "^4.1.0", 22 | "@vue/cli-plugin-unit-jest": "^4.1.0", 23 | "@vue/cli-plugin-vuex": "^4.1.0", 24 | "@vue/cli-service": "^4.1.0", 25 | "@vue/eslint-config-prettier": "^5.0.0", 26 | "@vue/test-utils": "1.0.0-beta.29", 27 | "babel-eslint": "^10.0.3", 28 | "eslint": "^5.16.0", 29 | "eslint-plugin-prettier": "^3.1.1", 30 | "eslint-plugin-vue": "^5.0.0", 31 | "faker": "^4.1.0", 32 | "miragejs": "^0.1.33", 33 | "node-sass": "^4.12.0", 34 | "prettier": "^1.19.1", 35 | "sass-loader": "^8.0.0", 36 | "vue-template-compiler": "^2.6.10" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vedovelli/screencast-miragejs/c2bc377d24800fd45a051d769d70d9ab8b11ad94/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |
7 | {{ user.name }}
8 |
9 | {{ user.email }}
10 |
11 | Active: {{ user.active }}
12 |