mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
Upgrade dependencies & lint
This commit is contained in:
parent
b05a66bda8
commit
a81862e77f
@ -1,6 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const debug = require('debug')('nuxt:build')
|
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import co from 'co'
|
import co from 'co'
|
||||||
import chokidar from 'chokidar'
|
import chokidar from 'chokidar'
|
||||||
@ -16,6 +15,7 @@ import clientWebpackConfig from './webpack/client.config.js'
|
|||||||
import serverWebpackConfig from './webpack/server.config.js'
|
import serverWebpackConfig from './webpack/server.config.js'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import PostCompilePlugin from 'post-compile-webpack-plugin'
|
import PostCompilePlugin from 'post-compile-webpack-plugin'
|
||||||
|
const debug = require('debug')('nuxt:build')
|
||||||
const remove = pify(fs.remove)
|
const remove = pify(fs.remove)
|
||||||
const readFile = pify(fs.readFile)
|
const readFile = pify(fs.readFile)
|
||||||
const writeFile = pify(fs.writeFile)
|
const writeFile = pify(fs.writeFile)
|
||||||
@ -428,7 +428,7 @@ function webpackRunClient () {
|
|||||||
serverCompiler.run((err, stats) => {
|
serverCompiler.run((err, stats) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
console.log('[nuxt:build:client]\n', stats.toString(webpackStats)) // eslint-disable-line no-console
|
console.log('[nuxt:build:client]\n', stats.toString(webpackStats)) // eslint-disable-line no-console
|
||||||
if (stats.hasErrors()) return reject('Webpack build exited with errors')
|
if (stats.hasErrors()) return reject(new Error('Webpack build exited with errors'))
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -441,7 +441,7 @@ function webpackRunServer () {
|
|||||||
serverCompiler.run((err, stats) => {
|
serverCompiler.run((err, stats) => {
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
console.log('[nuxt:build:server]\n', stats.toString(webpackStats)) // eslint-disable-line no-console
|
console.log('[nuxt:build:server]\n', stats.toString(webpackStats)) // eslint-disable-line no-console
|
||||||
if (stats.hasErrors()) return reject('Webpack build exited with errors')
|
if (stats.hasErrors()) return reject(new Error('Webpack build exited with errors'))
|
||||||
const bundlePath = join(serverConfig.output.path, serverConfig.output.filename)
|
const bundlePath = join(serverConfig.output.path, serverConfig.output.filename)
|
||||||
readFile(bundlePath, 'utf8')
|
readFile(bundlePath, 'utf8')
|
||||||
.then((bundle) => {
|
.then((bundle) => {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const debug = require('debug')('nuxt:generate')
|
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import co from 'co'
|
import co from 'co'
|
||||||
import pify from 'pify'
|
import pify from 'pify'
|
||||||
@ -8,6 +7,7 @@ import _ from 'lodash'
|
|||||||
import { resolve, join, dirname, sep } from 'path'
|
import { resolve, join, dirname, sep } from 'path'
|
||||||
import { isUrl, promisifyRoute } from './utils'
|
import { isUrl, promisifyRoute } from './utils'
|
||||||
import { minify } from 'html-minifier'
|
import { minify } from 'html-minifier'
|
||||||
|
const debug = require('debug')('nuxt:generate')
|
||||||
const copy = pify(fs.copy)
|
const copy = pify(fs.copy)
|
||||||
const remove = pify(fs.remove)
|
const remove = pify(fs.remove)
|
||||||
const writeFile = pify(fs.writeFile)
|
const writeFile = pify(fs.writeFile)
|
||||||
@ -57,7 +57,6 @@ export default function () {
|
|||||||
console.error('Could not resolve routes') // eslint-disable-line no-console
|
console.error('Could not resolve routes') // eslint-disable-line no-console
|
||||||
console.error(e) // eslint-disable-line no-console
|
console.error(e) // eslint-disable-line no-console
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
throw e
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then((generateRoutes) => {
|
.then((generateRoutes) => {
|
||||||
|
@ -14,7 +14,6 @@ import { resolve, join } from 'path'
|
|||||||
import * as utils from './utils'
|
import * as utils from './utils'
|
||||||
|
|
||||||
class Nuxt {
|
class Nuxt {
|
||||||
|
|
||||||
constructor (options = {}) {
|
constructor (options = {}) {
|
||||||
var defaults = {
|
var defaults = {
|
||||||
dev: true,
|
dev: true,
|
||||||
@ -131,7 +130,6 @@ class Nuxt {
|
|||||||
if (typeof callback === 'function') callback()
|
if (typeof callback === 'function') callback()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Nuxt
|
export default Nuxt
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const debug = require('debug')('nuxt:render')
|
|
||||||
import ansiHTML from 'ansi-html'
|
import ansiHTML from 'ansi-html'
|
||||||
import co from 'co'
|
import co from 'co'
|
||||||
import serialize from 'serialize-javascript'
|
import serialize from 'serialize-javascript'
|
||||||
import { getContext, setAnsiColors, encodeHtml } from './utils'
|
import { getContext, setAnsiColors, encodeHtml } from './utils'
|
||||||
|
const debug = require('debug')('nuxt:render')
|
||||||
// force blue color
|
// force blue color
|
||||||
debug.color = 4
|
debug.color = 4
|
||||||
setAnsiColors(ansiHTML)
|
setAnsiColors(ansiHTML)
|
||||||
@ -148,10 +148,10 @@ export function renderAndGetWindow (url, opts = {}) {
|
|||||||
window.scrollTo = function () {}
|
window.scrollTo = function () {}
|
||||||
// If Nuxt could not be loaded (error from the server-side)
|
// If Nuxt could not be loaded (error from the server-side)
|
||||||
if (!window.__NUXT__) {
|
if (!window.__NUXT__) {
|
||||||
return reject({
|
return reject(new Error({
|
||||||
message: 'Could not load the nuxt app',
|
message: 'Could not load the nuxt app',
|
||||||
body: window.document.getElementsByTagName('body')[0].innerHTML
|
body: window.document.getElementsByTagName('body')[0].innerHTML
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
// Used by nuxt.js to say when the components are loaded and the app ready
|
// Used by nuxt.js to say when the components are loaded and the app ready
|
||||||
window.onNuxtReady(() => {
|
window.onNuxtReady(() => {
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
const http = require('http')
|
const http = require('http')
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
|
|
||||||
constructor (nuxt) {
|
constructor (nuxt) {
|
||||||
this.nuxt = nuxt
|
this.nuxt = nuxt
|
||||||
this.server = http.createServer(this.render.bind(this))
|
this.server = http.createServer(this.render.bind(this))
|
||||||
@ -27,7 +26,6 @@ class Server {
|
|||||||
close (cb) {
|
close (cb) {
|
||||||
return this.server.close(cb)
|
return this.server.close(cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Server
|
export default Server
|
||||||
|
56
package.json
56
package.json
@ -52,22 +52,22 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-html": "^0.0.7",
|
"ansi-html": "^0.0.7",
|
||||||
"autoprefixer": "^6.7.2",
|
"autoprefixer": "^6.7.7",
|
||||||
"babel-core": "^6.22.1",
|
"babel-core": "^6.24.0",
|
||||||
"babel-loader": "^6.2.10",
|
"babel-loader": "^6.4.1",
|
||||||
"babel-preset-vue-app": "^0.5.0",
|
"babel-preset-vue-app": "^0.5.0",
|
||||||
"chalk": "^1.1.3",
|
"chalk": "^1.1.3",
|
||||||
"chokidar": "^1.6.1",
|
"chokidar": "^1.6.1",
|
||||||
"co": "^4.6.0",
|
"co": "^4.6.0",
|
||||||
"compression": "^1.6.2",
|
"compression": "^1.6.2",
|
||||||
"css-loader": "^0.27.3",
|
"css-loader": "^0.27.3",
|
||||||
"debug": "^2.6.1",
|
"debug": "^2.6.3",
|
||||||
"extract-text-webpack-plugin": "2.1.0",
|
"extract-text-webpack-plugin": "2.1.0",
|
||||||
"file-loader": "^0.10.0",
|
"file-loader": "^0.10.1",
|
||||||
"fs-extra": "^2.0.0",
|
"fs-extra": "^2.1.2",
|
||||||
"glob": "^7.1.1",
|
"glob": "^7.1.1",
|
||||||
"hash-sum": "^1.0.2",
|
"hash-sum": "^1.0.2",
|
||||||
"html-minifier": "^3.3.1",
|
"html-minifier": "^3.4.2",
|
||||||
"html-webpack-plugin": "^2.28.0",
|
"html-webpack-plugin": "^2.28.0",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"lru-cache": "^4.0.2",
|
"lru-cache": "^4.0.2",
|
||||||
@ -78,41 +78,43 @@
|
|||||||
"progress-bar-webpack-plugin": "^1.9.3",
|
"progress-bar-webpack-plugin": "^1.9.3",
|
||||||
"script-ext-html-webpack-plugin": "^1.7.1",
|
"script-ext-html-webpack-plugin": "^1.7.1",
|
||||||
"serialize-javascript": "^1.3.0",
|
"serialize-javascript": "^1.3.0",
|
||||||
"serve-static": "^1.11.2",
|
"serve-static": "^1.12.1",
|
||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.8",
|
||||||
"vue": "^2.2.1",
|
"vue": "^2.2.4",
|
||||||
"vue-loader": "^11.0.0",
|
"vue-loader": "^11.1.4",
|
||||||
"vue-meta": "^0.5.5",
|
"vue-meta": "^0.5.5",
|
||||||
"vue-router": "^2.3.0",
|
"vue-router": "^2.3.0",
|
||||||
"vue-server-renderer": "^2.2.0",
|
"vue-server-renderer": "^2.2.4",
|
||||||
"vue-ssr-html-stream": "^2.2.0",
|
"vue-ssr-html-stream": "^2.2.0",
|
||||||
"vue-template-compiler": "^2.2.0",
|
"vue-template-compiler": "^2.2.4",
|
||||||
"vuex": "^2.2.0",
|
"vuex": "^2.2.1",
|
||||||
"webpack": "^2.2.1",
|
"webpack": "^2.2.1",
|
||||||
"webpack-bundle-analyzer": "^2.3.0",
|
"webpack-bundle-analyzer": "^2.3.1",
|
||||||
"webpack-dev-middleware": "^1.10.0",
|
"webpack-dev-middleware": "^1.10.1",
|
||||||
"webpack-hot-middleware": "^2.17.0"
|
"webpack-hot-middleware": "^2.17.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^0.18.1",
|
"ava": "^0.18.2",
|
||||||
"babel-eslint": "^7.1.1",
|
"babel-eslint": "^7.1.1",
|
||||||
"babel-plugin-array-includes": "^2.0.3",
|
"babel-plugin-array-includes": "^2.0.3",
|
||||||
"babel-plugin-transform-async-to-generator": "^6.22.0",
|
"babel-plugin-transform-async-to-generator": "^6.22.0",
|
||||||
"babel-plugin-transform-runtime": "^6.22.0",
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
"babel-preset-es2015": "^6.22.0",
|
"babel-preset-es2015": "^6.22.0",
|
||||||
"babel-preset-stage-2": "^6.22.0",
|
"babel-preset-stage-2": "^6.22.0",
|
||||||
"codecov": "^2.1.0",
|
"codecov": "^2.1.0",
|
||||||
"copy-webpack-plugin": "^4.0.1",
|
"copy-webpack-plugin": "^4.0.1",
|
||||||
"eslint": "^3.15.0",
|
"eslint": "^3.18.0",
|
||||||
"eslint-config-standard": "^7.1.0",
|
"eslint-config-standard": "^8.0.0-beta.2",
|
||||||
"eslint-plugin-html": "^2.0.0",
|
"eslint-plugin-html": "^2.0.1",
|
||||||
"eslint-plugin-promise": "^3.4.1",
|
"eslint-plugin-import": "^2.2.0",
|
||||||
"eslint-plugin-standard": "^2.0.1",
|
"eslint-plugin-node": "^4.2.1",
|
||||||
|
"eslint-plugin-promise": "^3.5.0",
|
||||||
|
"eslint-plugin-standard": "^2.1.1",
|
||||||
"finalhandler": "^1.0.0",
|
"finalhandler": "^1.0.0",
|
||||||
"jsdom": "^9.10.0",
|
"jsdom": "^9.12.0",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"nyc": "^10.1.2",
|
"nyc": "^10.2.0-candidate.0",
|
||||||
"request": "^2.79.0",
|
"request": "^2.81.0",
|
||||||
"request-promise-native": "^1.0.3",
|
"request-promise-native": "^1.0.3",
|
||||||
"webpack-node-externals": "^1.5.4"
|
"webpack-node-externals": "^1.5.4"
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ test('Fail with routes() which throw an error', t => {
|
|||||||
generate: {
|
generate: {
|
||||||
routes: function () {
|
routes: function () {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
reject('Not today!')
|
reject(new Error('Not today!'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ test('Fail with routes() which throw an error', t => {
|
|||||||
}
|
}
|
||||||
nuxt.generate()
|
nuxt.generate()
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
t.true(e === 'Not today!')
|
t.true(e.message === 'Not today!')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -77,13 +77,13 @@ test('promisifyRoute (fn => promise)', t => {
|
|||||||
|
|
||||||
test('promisifyRoute (fn(cb) with error)', t => {
|
test('promisifyRoute (fn(cb) with error)', t => {
|
||||||
const fn = function (cb) {
|
const fn = function (cb) {
|
||||||
cb('Error here')
|
cb(new Error('Error here'))
|
||||||
}
|
}
|
||||||
const promise = utils.promisifyRoute(fn)
|
const promise = utils.promisifyRoute(fn)
|
||||||
t.is(typeof promise, 'object')
|
t.is(typeof promise, 'object')
|
||||||
return promise
|
return promise
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
t.is(e, 'Error here')
|
t.is(e.message, 'Error here')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user