Skip to content

Commit

Permalink
chore: upgrade to vue-cli 3
Browse files Browse the repository at this point in the history
  • Loading branch information
igeligel committed Oct 7, 2018
1 parent 1092ea1 commit c800b5b
Show file tree
Hide file tree
Showing 55 changed files with 10,187 additions and 23,416 deletions.
24 changes: 8 additions & 16 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["last 2 versions", "> 5% in FR"],
"uglify": true
},
"modules": false
}]
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread"
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": [
["env", {
"targets": {
"node": "current"
}
}]
]
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
8 changes: 3 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = null
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
39 changes: 14 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
// http://eslint.org/docs/user-guide/configuring
// https://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: 'standard',
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'html'
'vue'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
'rules': {
// // don't require .vue extension when importing
// 'import/extensions': ['error', 'always', {
// 'js': 'never',
// 'vue': 'never'
// }],
// // allow optionalDependencies
// 'import/no-extraneous-dependencies': ['error', {
// 'optionalDependencies': ['test/unit/index.js']
// }],
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-unused-expressions': process.env.NODE_ENV === 'production' ? 2 : 0
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
35 changes: 12 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules
/bower_components

# Tooling Logs
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
selenium-server.log

# IDEs and editors
/.idea
.project
.classpath
*.launch
.settings/

# System Files
.DS_Store
Thumbs.db

# Generated Files
dist/
test/unit/coverage
test/e2e/reports
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
10 changes: 10 additions & 0 deletions .postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

55 changes: 8 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,30 @@
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
# vue-realworld-example-app

> A Vue.js project
# ![RealWorld Example App](./static/rwv-logo.png)
## Build Setup

### 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.

Project demo is available at https://vue-vuex-realworld.netlify.com/#/


This codebase was created to demonstrate a fully fledged fullstack application built with **Vue.js** including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the **Vue.js** community styleguides & best practices.

For more information on how to this works with other frontends/backends, head over to the [RealWorld](https://github.com/gothinkster/realworld) repo.


# Getting started

Before contributing please read the following:
1. [RealWorld guidelines](https://github.com/gothinkster/realworld/tree/master/spec) for implementing a new framework,
2. [RealWorld frontend instructions](https://github.com/gothinkster/realworld-starter-kit/blob/master/FRONTEND_INSTRUCTIONS.md)
3. [Realworld API endpoints](https://github.com/gothinkster/realworld/tree/master/api)
4. [Vue.js styleguide](https://vuejs.org/v2/style-guide/index.html). Priority A and B categories must be respected.


The stack is built using [vue-cli webpack](https://github.com/vuejs-templates/webpack) so to get started all you have to do is:
``` bash
# install dependencies
> npm install
npm install

# serve with hot reload at localhost:8080
> npm run dev
```
npm run dev

Other commands available are:
``` bash
# build for production with minification
npm run build

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

# run single unit tests
# run unit tests
npm run unit

# run continous unit tests
npm run units

# run e2e tests
npm run e2e

# run all tests
npm test
```

# To know

Current arbitrary choices are:
- Vuex modules for store
- Vue-axios for ajax requests
- Standard for linting
- 'rwv' as prefix for components

These can be changed when the contributors reach a consensus.


# Connect

Join us on [Discord](https://discord.gg/NE2jNmg)
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).
21 changes: 11 additions & 10 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
'use strict'
require('./check-versions')()

process.env.NODE_ENV = 'production'

var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')

var spinner = ora('building for production...')
const spinner = ora('building for production...')
spinner.start()

rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
Expand Down
26 changes: 16 additions & 10 deletions build/check-versions.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')

function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}

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

module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
const warnings = []

for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]

if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
Expand All @@ -38,10 +42,12 @@ module.exports = function () {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]

for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}

console.log()
process.exit(1)
}
Expand Down
9 changes: 0 additions & 9 deletions build/dev-client.js

This file was deleted.

Loading

0 comments on commit c800b5b

Please sign in to comment.