Skip to content

Commit c800b5b

Browse files
committed
chore: upgrade to vue-cli 3
1 parent 1092ea1 commit c800b5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+10187
-23416
lines changed

.babelrc

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
{
22
"presets": [
33
["env", {
4+
"modules": false,
45
"targets": {
5-
"browsers": ["last 2 versions", "> 5% in FR"],
6-
"uglify": true
7-
},
8-
"modules": false
9-
}]
10-
],
11-
"plugins": [
12-
"syntax-dynamic-import",
13-
"transform-object-rest-spread"
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
1410
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
1512
"env": {
1613
"test": {
17-
"presets": [
18-
["env", {
19-
"targets": {
20-
"node": "current"
21-
}
22-
}]
23-
]
14+
"presets": ["env", "stage-2"],
15+
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
2416
}
2517
}
2618
}

.editorconfig

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
root = true
22

33
[*]
4+
charset = utf-8
45
indent_style = space
56
indent_size = 2
6-
charset = utf-8
7-
trim_trailing_whitespace = true
8-
insert_final_newline = true
97
end_of_line = lf
10-
# editorconfig-tools is unable to ignore longs strings or urls
11-
max_line_length = null
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js
5+
/test/unit/coverage/

.eslintrc.js

+14-25
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
1-
// http://eslint.org/docs/user-guide/configuring
1+
// https://eslint.org/docs/user-guide/configuring
22

33
module.exports = {
44
root: true,
5-
parser: 'babel-eslint',
65
parserOptions: {
7-
sourceType: 'module'
6+
parser: 'babel-eslint'
87
},
98
env: {
109
browser: true,
1110
},
12-
extends: 'standard',
11+
extends: [
12+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14+
'plugin:vue/essential',
15+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
16+
'standard'
17+
],
1318
// required to lint *.vue files
1419
plugins: [
15-
'html'
20+
'vue'
1621
],
17-
// check if imports actually resolve
18-
'settings': {
19-
'import/resolver': {
20-
'webpack': {
21-
'config': 'build/webpack.base.conf.js'
22-
}
23-
}
24-
},
2522
// add your custom rules here
26-
'rules': {
27-
// // don't require .vue extension when importing
28-
// 'import/extensions': ['error', 'always', {
29-
// 'js': 'never',
30-
// 'vue': 'never'
31-
// }],
32-
// // allow optionalDependencies
33-
// 'import/no-extraneous-dependencies': ['error', {
34-
// 'optionalDependencies': ['test/unit/index.js']
35-
// }],
23+
rules: {
24+
// allow async-await
25+
'generator-star-spacing': 'off',
3626
// allow debugger during development
37-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
38-
'no-unused-expressions': process.env.NODE_ENV === 'production' ? 2 : 0
27+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
3928
}
4029
}

.gitignore

+12-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/bower_components
6-
7-
# Tooling Logs
1+
.DS_Store
2+
node_modules/
3+
/dist/
84
npm-debug.log*
95
yarn-debug.log*
106
yarn-error.log*
7+
/test/unit/coverage/
8+
/test/e2e/reports/
119
selenium-debug.log
12-
selenium-server.log
13-
14-
# IDEs and editors
15-
/.idea
16-
.project
17-
.classpath
18-
*.launch
19-
.settings/
20-
21-
# System Files
22-
.DS_Store
23-
Thumbs.db
2410

25-
# Generated Files
26-
dist/
27-
test/unit/coverage
28-
test/e2e/reports
11+
# Editor directories and files
12+
.idea
13+
.vscode
14+
*.suo
15+
*.ntvs*
16+
*.njsproj
17+
*.sln

.postcssrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
8+
"autoprefixer": {}
9+
}
10+
}

LICENSE

-21
This file was deleted.

README.md

+8-47
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,30 @@
1-
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
1+
# vue-realworld-example-app
22

3+
> A Vue.js project
34
4-
# ![RealWorld Example App](./static/rwv-logo.png)
5+
## Build Setup
56

6-
### Vue.js codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld) spec and API.
7-
8-
Project demo is available at https://vue-vuex-realworld.netlify.com/#/
9-
10-
11-
This codebase was created to demonstrate a fully fledged fullstack application built with **Vue.js** including CRUD operations, authentication, routing, pagination, and more.
12-
13-
We've gone to great lengths to adhere to the **Vue.js** community styleguides & best practices.
14-
15-
For more information on how to this works with other frontends/backends, head over to the [RealWorld](https://github.com/gothinkster/realworld) repo.
16-
17-
18-
# Getting started
19-
20-
Before contributing please read the following:
21-
1. [RealWorld guidelines](https://github.com/gothinkster/realworld/tree/master/spec) for implementing a new framework,
22-
2. [RealWorld frontend instructions](https://github.com/gothinkster/realworld-starter-kit/blob/master/FRONTEND_INSTRUCTIONS.md)
23-
3. [Realworld API endpoints](https://github.com/gothinkster/realworld/tree/master/api)
24-
4. [Vue.js styleguide](https://vuejs.org/v2/style-guide/index.html). Priority A and B categories must be respected.
25-
26-
27-
The stack is built using [vue-cli webpack](https://github.com/vuejs-templates/webpack) so to get started all you have to do is:
287
``` bash
298
# install dependencies
30-
> npm install
9+
npm install
10+
3111
# serve with hot reload at localhost:8080
32-
> npm run dev
33-
```
12+
npm run dev
3413

35-
Other commands available are:
36-
``` bash
3714
# build for production with minification
3815
npm run build
3916

4017
# build for production and view the bundle analyzer report
4118
npm run build --report
4219

43-
# run single unit tests
20+
# run unit tests
4421
npm run unit
4522

46-
# run continous unit tests
47-
npm run units
48-
4923
# run e2e tests
5024
npm run e2e
5125

5226
# run all tests
5327
npm test
5428
```
5529

56-
# To know
57-
58-
Current arbitrary choices are:
59-
- Vuex modules for store
60-
- Vue-axios for ajax requests
61-
- Standard for linting
62-
- 'rwv' as prefix for components
63-
64-
These can be changed when the contributors reach a consensus.
65-
66-
67-
# Connect
68-
69-
Join us on [Discord](https://discord.gg/NE2jNmg)
30+
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

build/build.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
'use strict'
12
require('./check-versions')()
23

34
process.env.NODE_ENV = 'production'
45

5-
var ora = require('ora')
6-
var rm = require('rimraf')
7-
var path = require('path')
8-
var chalk = require('chalk')
9-
var webpack = require('webpack')
10-
var config = require('../config')
11-
var webpackConfig = require('./webpack.prod.conf')
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
1213

13-
var spinner = ora('building for production...')
14+
const spinner = ora('building for production...')
1415
spinner.start()
1516

1617
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
1718
if (err) throw err
18-
webpack(webpackConfig, function (err, stats) {
19+
webpack(webpackConfig, (err, stats) => {
1920
spinner.stop()
2021
if (err) throw err
2122
process.stdout.write(stats.toString({
2223
colors: true,
2324
modules: false,
24-
children: false,
25+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
2526
chunks: false,
2627
chunkModules: false
2728
}) + '\n\n')

build/check-versions.js

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
var chalk = require('chalk')
2-
var semver = require('semver')
3-
var packageConfig = require('../package.json')
4-
var shell = require('shelljs')
1+
'use strict'
2+
const chalk = require('chalk')
3+
const semver = require('semver')
4+
const packageConfig = require('../package.json')
5+
const shell = require('shelljs')
6+
57
function exec (cmd) {
68
return require('child_process').execSync(cmd).toString().trim()
79
}
810

9-
var versionRequirements = [
11+
const versionRequirements = [
1012
{
1113
name: 'node',
1214
currentVersion: semver.clean(process.version),
@@ -23,9 +25,11 @@ if (shell.which('npm')) {
2325
}
2426

2527
module.exports = function () {
26-
var warnings = []
27-
for (var i = 0; i < versionRequirements.length; i++) {
28-
var mod = versionRequirements[i]
28+
const warnings = []
29+
30+
for (let i = 0; i < versionRequirements.length; i++) {
31+
const mod = versionRequirements[i]
32+
2933
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
3034
warnings.push(mod.name + ': ' +
3135
chalk.red(mod.currentVersion) + ' should be ' +
@@ -38,10 +42,12 @@ module.exports = function () {
3842
console.log('')
3943
console.log(chalk.yellow('To use this template, you must update following to modules:'))
4044
console.log()
41-
for (var i = 0; i < warnings.length; i++) {
42-
var warning = warnings[i]
45+
46+
for (let i = 0; i < warnings.length; i++) {
47+
const warning = warnings[i]
4348
console.log(' ' + warning)
4449
}
50+
4551
console.log()
4652
process.exit(1)
4753
}

build/dev-client.js

-9
This file was deleted.

0 commit comments

Comments
 (0)