From 9b8cbed51236d32372706be7c2381df032c3dd88 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 12 Dec 2017 13:12:29 +0330 Subject: [PATCH] perf: remove rollup build Using native node 8.x for less transpilations --- .circleci/config.yml | 6 - .travis.yml | 1 - build/rollup.config.js | 113 --------------- index.js | 16 --- lib/builder/builder.js | 54 +++---- lib/builder/generator.js | 12 +- lib/builder/index.js | 6 +- lib/builder/webpack/base.config.js | 18 +-- lib/builder/webpack/client.config.js | 26 ++-- lib/builder/webpack/dll.config.js | 8 +- lib/builder/webpack/plugins/timefix.js | 2 +- lib/builder/webpack/plugins/warnfix.js | 2 +- lib/builder/webpack/server.config.js | 16 +-- lib/builder/webpack/style-loader.js | 6 +- lib/builder/webpack/vue-loader.config.js | 2 +- lib/common/cli/errors.js | 5 +- lib/common/index.js | 11 +- lib/common/options.js | 16 +-- lib/common/utils.js | 44 +++--- lib/core/index.js | 10 +- lib/core/meta.js | 10 +- lib/core/module.js | 14 +- lib/core/nuxt.js | 25 ++-- lib/core/renderer.js | 36 ++--- lib/index.js | 13 +- package.json | 19 +-- test/basic.config.defaults.test.js | 2 +- test/basic.csr.test.js | 2 +- test/basic.dev.test.js | 2 +- test/basic.fail.generate.test.js | 2 +- test/basic.generate.nosubfolders.test.js | 2 +- test/basic.generate.test.js | 2 +- test/basic.ssr.test.js | 2 +- test/children.patch.test.js | 2 +- test/children.test.js | 2 +- test/cli.test.js | 8 +- test/debug.test.js | 2 +- test/deprecate.test.js | 2 +- test/dll.test.js | 2 +- test/dynamic-routes.test.js | 2 +- test/error.test.js | 2 +- test/express.test.js | 2 +- test/fixtures/basic/nuxt.config.js | 3 - test/generator.test.js | 2 +- test/index.test.js | 2 +- test/module.test.js | 2 +- test/spa.test.js | 2 +- test/utils.test.js | 2 +- test/with-config.test.js | 2 +- yarn.lock | 170 ++++------------------- 50 files changed, 223 insertions(+), 491 deletions(-) delete mode 100755 build/rollup.config.js delete mode 100644 index.js diff --git a/.circleci/config.yml b/.circleci/config.yml index d62410aa63..7055520a9a 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,12 +23,6 @@ jobs: paths: - "node_modules" - # Build - - run: - name: Build - command: | - yarn build - # Test - run: name: Tests diff --git a/.travis.yml b/.travis.yml index 85b9e900b2..3a8d45dd6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ cache: - node_modules install: - yarn install - - yarn run build script: - yarn run test after_success: diff --git a/build/rollup.config.js b/build/rollup.config.js deleted file mode 100755 index 2bd2e1738c..0000000000 --- a/build/rollup.config.js +++ /dev/null @@ -1,113 +0,0 @@ -// Some parts brought from https://github.com/vuejs/vue/blob/dev/build/config.js -const { resolve } = require('path') -const rollupBabel = require('rollup-plugin-babel') -const rollupAlias = require('rollup-plugin-alias') -const rollupCommonJS = require('rollup-plugin-commonjs') -const rollupReplace = require('rollup-plugin-replace') -const rollupNodeResolve = require('rollup-plugin-node-resolve') -const packageJson = require('../package.json') - -const dependencies = Object.keys(packageJson.dependencies) -const version = packageJson.version || process.env.VERSION - -// ----------------------------- -// Banner -// ----------------------------- -const banner = - '/*!\n' + - ' * Nuxt.js v' + version + '\n' + - ' * Released under the MIT License.\n' + - ' */' - -// ----------------------------- -// Aliases -// ----------------------------- -const rootDir = resolve(__dirname, '..') -const libDir = resolve(rootDir, 'lib') -const distDir = resolve(rootDir, 'dist') - -const aliases = { - core: resolve(libDir, 'core/index.js'), - builder: resolve(libDir, 'builder/index.js'), - common: resolve(libDir, 'common/index.js'), - utils: resolve(libDir, 'common/utils.js'), - app: resolve(libDir, 'app') -} - -// ----------------------------- -// Builds -// ----------------------------- -const builds = { - nuxt: { - entry: resolve(libDir, 'index.js'), - file: resolve(distDir, 'nuxt.js') - }, - core: { - entry: resolve(libDir, 'core/index.js'), - file: resolve(distDir, 'core.js') - } -} - -// ----------------------------- -// Default config -// ----------------------------- -function genConfig(opts) { - const config = { - input: opts.entry, - output: { - file: opts.file, - format: 'cjs', - sourcemap: true - }, - external: ['fs', 'path', 'http', 'module', 'util', 'vue-server-renderer/server-plugin', 'vue-server-renderer/client-plugin'] - .concat(dependencies, opts.external), - banner: opts.banner || banner, - name: opts.modulename || 'Nuxt', - plugins: [ - rollupAlias(Object.assign({ - resolve: ['.js', '.json', '.jsx', '.ts'] - }, aliases, opts.alias)), - - rollupNodeResolve({ preferBuiltins: true }), - - rollupCommonJS(), - - rollupBabel(Object.assign({ - exclude: 'node_modules/**', - plugins: [ - 'array-includes' - ], - presets: [ - ['env', { - targets: { - node: '8.0.0' - }, - modules: false - }] - ], - 'env': { - 'test': { - 'plugins': [ 'istanbul' ] - } - } - }, opts.babel)), - - rollupReplace({ __VERSION__: version }) - ].concat(opts.plugins || []) - } - - if (opts.env) { - config.plugins.push(rollupReplace({ - 'process.env.NODE_ENV': JSON.stringify(opts.env) - })) - } - - return config -} - -if (process.env.TARGET) { - module.exports = genConfig(builds[process.env.TARGET]) -} else { - exports.getBuild = name => genConfig(builds[name]) - exports.getAllBuilds = () => Object.keys(builds).map(name => genConfig(builds[name])) -} diff --git a/index.js b/index.js deleted file mode 100644 index 24e035805e..0000000000 --- a/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * Nuxt.js - * (c) 2016-2017 Chopin Brothers - * Core maintainer: Pooya (@pi0) - * Released under the MIT License. - */ - -// Node Source Map Support -// https://github.com/evanw/node-source-map-support -require('source-map-support').install() - -// Fix babel flag -/* istanbul ignore else */ -process.noDeprecation = true - -module.exports = require('./dist/nuxt') diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 370564c9b6..98befdbfc1 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -1,30 +1,30 @@ -import { promisify } from 'util' -import _ from 'lodash' -import chokidar from 'chokidar' -import fs, { remove, readFile, writeFile, mkdirp, existsSync } from 'fs-extra' -import hash from 'hash-sum' -import webpack from 'webpack' -import serialize from 'serialize-javascript' -import { join, resolve, basename, extname, dirname } from 'path' -import MFS from 'memory-fs' -import webpackDevMiddleware from 'webpack-dev-middleware' -import webpackHotMiddleware from 'webpack-hot-middleware' -import { r, wp, wChunk, createRoutes, sequence, relativeTo, isPureObject, waitFor, rmCache } from 'utils' -import Debug from 'debug' -import Glob from 'glob' -import clientWebpackConfig from './webpack/client.config.js' -import serverWebpackConfig from './webpack/server.config.js' -import dllWebpackConfig from './webpack/dll.config.js' -import vueLoaderConfig from './webpack/vue-loader.config' -import styleLoader from './webpack/style-loader' -import { Options } from 'common' +const { promisify } = require('util') +const _ = require('lodash') +const chokidar = require('chokidar') +const { remove, readFile, writeFile, mkdirp, existsSync } = require('fs-extra') +const hash = require('hash-sum') +const webpack = require('webpack') +const serialize = require('serialize-javascript') +const { join, resolve, basename, extname, dirname } = require('path') +const MFS = require('memory-fs') +const webpackDevMiddleware = require('webpack-dev-middleware') +const webpackHotMiddleware = require('webpack-hot-middleware') +const { r, wp, wChunk, createRoutes, sequence, relativeTo, isPureObject, waitFor, rmCache } = require('../common/utils') +const Debug = require('debug') +const Glob = require('glob') +const clientWebpackConfig = require('./webpack/client.config.js') +const serverWebpackConfig = require('./webpack/server.config.js') +const dllWebpackConfig = require('./webpack/dll.config.js') +const vueLoaderConfig = require('./webpack/vue-loader.config') +const styleLoader = require('./webpack/style-loader') +const { Options } = require('../common') const debug = Debug('nuxt:build') debug.color = 2 // Force green color const glob = promisify(Glob) -export default class Builder { +module.exports = class Builder { constructor(nuxt) { this.nuxt = nuxt this.isStatic = false // Flag to know if the build is for a generated app @@ -145,9 +145,9 @@ export default class Builder { // Check if pages dir exists and warn if not this._nuxtPages = typeof this.options.build.createRoutes !== 'function' if (this._nuxtPages) { - if (!fs.existsSync(join(this.options.srcDir, 'pages'))) { + if (!existsSync(join(this.options.srcDir, 'pages'))) { let dir = this.options.srcDir - if (fs.existsSync(join(this.options.srcDir, '..', 'pages'))) { + if (existsSync(join(this.options.srcDir, '..', 'pages'))) { throw new Error(`No \`pages\` directory found in ${dir}. Did you mean to run \`nuxt\` in the parent (\`../\`) directory?`) } else { throw new Error(`Couldn't find a \`pages\` directory in ${dir}. Please create one under the project root`) @@ -247,7 +247,7 @@ export default class Builder { router: this.options.router, env: this.options.env, head: this.options.head, - middleware: fs.existsSync(join(this.options.srcDir, 'middleware')), + middleware: existsSync(join(this.options.srcDir, 'middleware')), store: this.options.store, css: this.options.css, plugins: this.plugins, @@ -262,7 +262,7 @@ export default class Builder { } // -- Layouts -- - if (fs.existsSync(resolve(this.options.srcDir, 'layouts'))) { + if (existsSync(resolve(this.options.srcDir, 'layouts'))) { const layoutsFiles = await glob('layouts/**/*.{vue,js}', { cwd: this.options.srcDir }) let hasErrorLayout = false layoutsFiles.forEach((file) => { @@ -326,7 +326,7 @@ export default class Builder { } // Allow override templates using a file with same name in ${srcDir}/app const customPath = r(this.options.srcDir, 'app', file) - const customFileExists = fs.existsSync(customPath) + const customFileExists = existsSync(customPath) return { src: customFileExists @@ -463,7 +463,7 @@ export default class Builder { compiler.plugin('done', async (stats) => { await this.nuxt.callHook('build:compiled', { name, compiler, stats }) // Reload renderer if available - this.nuxt.renderer.loadResources(sharedFS || fs) + this.nuxt.renderer.loadResources(sharedFS || require('fs')) // Resolve on next tick process.nextTick(resolve) }) diff --git a/lib/builder/generator.js b/lib/builder/generator.js index 5b743ecdf9..63b6268e80 100644 --- a/lib/builder/generator.js +++ b/lib/builder/generator.js @@ -1,10 +1,10 @@ -import { copy, remove, writeFile, mkdirp, removeSync, existsSync } from 'fs-extra' -import _ from 'lodash' -import { resolve, join, dirname, sep } from 'path' -import { minify } from 'html-minifier' -import { isUrl, promisifyRoute, waitFor, flatRoutes } from 'utils' +const { copy, remove, writeFile, mkdirp, removeSync, existsSync } = require('fs-extra') +const _ = require('lodash') +const { resolve, join, dirname, sep } = require('path') +const { minify } = require('html-minifier') +const { isUrl, promisifyRoute, waitFor, flatRoutes } = require('../common/utils') -export default class Generator { +module.exports = class Generator { constructor(nuxt, builder) { this.nuxt = nuxt this.options = nuxt.options diff --git a/lib/builder/index.js b/lib/builder/index.js index 7e52dab70a..fc3309238b 100755 --- a/lib/builder/index.js +++ b/lib/builder/index.js @@ -1,7 +1,7 @@ -import Builder from './builder' -import Generator from './generator' +const Builder = require('./builder') +const Generator = require('./generator') -export { +module.exports = { Builder, Generator } diff --git a/lib/builder/webpack/base.config.js b/lib/builder/webpack/base.config.js index 9d1402bcf5..194798a518 100644 --- a/lib/builder/webpack/base.config.js +++ b/lib/builder/webpack/base.config.js @@ -1,10 +1,10 @@ -import ExtractTextPlugin from 'extract-text-webpack-plugin' -import { cloneDeep } from 'lodash' -import { join, resolve } from 'path' -import webpack from 'webpack' -import { isUrl, urlJoin } from 'utils' -import TimeFixPlugin from './plugins/timefix' -import WarnFixPlugin from './plugins/warnfix' +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const { cloneDeep } = require('lodash') +const { join, resolve } = require('path') +const webpack = require('webpack') +const { isUrl, urlJoin } = require('../../common/utils') +const TimeFixPlugin = require('./plugins/timefix') +const WarnFixPlugin = require('./plugins/warnfix') /* |-------------------------------------------------------------------------- @@ -14,8 +14,8 @@ import WarnFixPlugin from './plugins/warnfix' | webpack config files |-------------------------------------------------------------------------- */ -export default function webpackBaseConfig({ name, isServer }) { - const nodeModulesDir = join(__dirname, '..', 'node_modules') +module.exports = function webpackBaseConfig({ name, isServer }) { + const nodeModulesDir = join(this.options.nuxtDir, 'node_modules') const config = { name, diff --git a/lib/builder/webpack/client.config.js b/lib/builder/webpack/client.config.js index 30abc64675..6541f79d32 100644 --- a/lib/builder/webpack/client.config.js +++ b/lib/builder/webpack/client.config.js @@ -1,15 +1,15 @@ -import { each } from 'lodash' -import webpack from 'webpack' -import VueSSRClientPlugin from 'vue-server-renderer/client-plugin' -import HTMLPlugin from 'html-webpack-plugin' -import FriendlyErrorsWebpackPlugin from 'friendly-errors-webpack-plugin' -import UglifyJSPlugin from 'uglifyjs-webpack-plugin' -import ProgressBarPlugin from 'progress-bar-webpack-plugin' -import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' -import { resolve } from 'path' -import { existsSync } from 'fs' -import Debug from 'debug' -import base from './base.config.js' +const { each } = require('lodash') +const webpack = require('webpack') +const VueSSRClientPlugin = require('vue-server-renderer/client-plugin') +const HTMLPlugin = require('html-webpack-plugin') +const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin') +const UglifyJSPlugin = require('uglifyjs-webpack-plugin') +const ProgressBarPlugin = require('progress-bar-webpack-plugin') +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') +const { resolve } = require('path') +const { existsSync } = require('fs') +const Debug = require('debug') +const base = require('./base.config.js') const debug = Debug('nuxt:build') debug.color = 2 // Force green color @@ -24,7 +24,7 @@ debug.color = 2 // Force green color | In production, will generate public/dist/style.css |-------------------------------------------------------------------------- */ -export default function webpackClientConfig() { +module.exports = function webpackClientConfig() { let config = base.call(this, { name: 'client', isServer: false }) // Entry points diff --git a/lib/builder/webpack/dll.config.js b/lib/builder/webpack/dll.config.js index 725015c7df..5ad19116b3 100644 --- a/lib/builder/webpack/dll.config.js +++ b/lib/builder/webpack/dll.config.js @@ -1,6 +1,6 @@ -import webpack from 'webpack' -import { resolve } from 'path' -import ClientConfig from './client.config' +const webpack = require('webpack') +const { resolve } = require('path') +const ClientConfig = require('./client.config') /* |-------------------------------------------------------------------------- @@ -8,7 +8,7 @@ import ClientConfig from './client.config' | https://github.com/webpack/webpack/tree/master/examples/dll |-------------------------------------------------------------------------- */ -export default function webpackDllConfig(_refConfig) { +module.exports = function webpackDllConfig(_refConfig) { const refConfig = _refConfig || new ClientConfig() const name = refConfig.name + '-dll' diff --git a/lib/builder/webpack/plugins/timefix.js b/lib/builder/webpack/plugins/timefix.js index 9c16918735..ddf6445648 100644 --- a/lib/builder/webpack/plugins/timefix.js +++ b/lib/builder/webpack/plugins/timefix.js @@ -1,6 +1,6 @@ // Taken from https://github.com/egoist/poi/blob/3e93c88c520db2d20c25647415e6ae0d3de61145/packages/poi/lib/webpack/timefix-plugin.js#L1-L16 // Thanks to @egoist -export default class TimeFixPlugin { +module.exports = class TimeFixPlugin { constructor(timefix = 11000) { this.timefix = timefix } diff --git a/lib/builder/webpack/plugins/warnfix.js b/lib/builder/webpack/plugins/warnfix.js index 2add942675..3f28913af6 100644 --- a/lib/builder/webpack/plugins/warnfix.js +++ b/lib/builder/webpack/plugins/warnfix.js @@ -1,4 +1,4 @@ -export default class WarnFixPlugin { +module.exports = class WarnFixPlugin { apply(compiler) /* istanbul ignore next */ { compiler.plugin('done', stats => { stats.compilation.warnings = stats.compilation.warnings.filter(warn => { diff --git a/lib/builder/webpack/server.config.js b/lib/builder/webpack/server.config.js index fcdd5bfc8b..e6a1ecf869 100644 --- a/lib/builder/webpack/server.config.js +++ b/lib/builder/webpack/server.config.js @@ -1,17 +1,17 @@ -import webpack from 'webpack' -import VueSSRServerPlugin from 'vue-server-renderer/server-plugin' -import nodeExternals from 'webpack-node-externals' -import { each } from 'lodash' -import { resolve } from 'path' -import { existsSync } from 'fs' -import base from './base.config.js' +const webpack = require('webpack') +const VueSSRServerPlugin = require('vue-server-renderer/server-plugin') +const nodeExternals = require('webpack-node-externals') +const { each } = require('lodash') +const { resolve } = require('path') +const { existsSync } = require('fs') +const base = require('./base.config.js') /* |-------------------------------------------------------------------------- | Webpack Server Config |-------------------------------------------------------------------------- */ -export default function webpackServerConfig() { +module.exports = function webpackServerConfig() { let config = base.call(this, { name: 'server', isServer: true }) // env object defined in nuxt.config.js diff --git a/lib/builder/webpack/style-loader.js b/lib/builder/webpack/style-loader.js index 90f29d57be..e528d423d7 100755 --- a/lib/builder/webpack/style-loader.js +++ b/lib/builder/webpack/style-loader.js @@ -1,7 +1,7 @@ -import ExtractTextPlugin from 'extract-text-webpack-plugin' -import { join } from 'path' +const ExtractTextPlugin = require('extract-text-webpack-plugin') +const { join } = require('path') -export default function styleLoader(ext, loaders = [], isVueLoader = false) { +module.exports = function styleLoader(ext, loaders = [], isVueLoader = false) { // Normalize loaders loaders = (Array.isArray(loaders) ? loaders : [loaders]).map(loader => { if (typeof loader === 'string') { diff --git a/lib/builder/webpack/vue-loader.config.js b/lib/builder/webpack/vue-loader.config.js index cb291f8960..af162b1869 100644 --- a/lib/builder/webpack/vue-loader.config.js +++ b/lib/builder/webpack/vue-loader.config.js @@ -1,4 +1,4 @@ -export default function vueLoader({ isServer }) { +module.exports = function vueLoader({ isServer }) { // https://vue-loader.vuejs.org/en const config = { postcss: this.options.build.postcss, diff --git a/lib/common/cli/errors.js b/lib/common/cli/errors.js index 6a95d886d5..8ec2230db6 100644 --- a/lib/common/cli/errors.js +++ b/lib/common/cli/errors.js @@ -8,10 +8,9 @@ pe.skipPackage('regenerator-runtime') pe.skipPackage('babel-runtime') pe.skipPackage('core-js') -// Skip dist artifacts and Node internals -const skipFiles = [ 'nuxt.js', 'core.js' ] +// Skip node internals pe.skip((traceLine, lineNumber) => { - if (!traceLine.file || skipFiles.indexOf(traceLine.file) !== -1) { + if (!traceLine.file) { return true } }) diff --git a/lib/common/index.js b/lib/common/index.js index 26a5ba474a..3a241c30d1 100755 --- a/lib/common/index.js +++ b/lib/common/index.js @@ -1,12 +1,7 @@ -import * as Utils from './utils' -import Options from './options' +const Utils = require('./utils') +const Options = require('./options') -export default { - Utils, - Options -} - -export { +module.exports = { Utils, Options } diff --git a/lib/common/options.js b/lib/common/options.js index 95bfcff16b..af70a0bc4b 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -1,15 +1,15 @@ -import _ from 'lodash' -import Debug from 'debug' -import { join, resolve } from 'path' -import { existsSync } from 'fs' -import { isUrl, isPureObject } from 'utils' +const _ = require('lodash') +const Debug = require('debug') +const { join, resolve } = require('path') +const { existsSync } = require('fs') +const { isUrl, isPureObject } = require('../common/utils') const debug = Debug('nuxt:build') debug.color = 2 // Force green color const Options = {} -export default Options +module.exports = Options Options.from = function (_options) { // Clone options to prevent unwanted side-effects @@ -203,8 +203,8 @@ Options.defaults = { debug: undefined, // Will be equal to dev if not provided buildDir: '.nuxt', cacheDir: '.cache', - nuxtDir: resolve(__dirname, '..'), // Relative to dist - nuxtAppDir: resolve(__dirname, '../lib/app/'), // Relative to dist + nuxtDir: resolve(__dirname, '../..'), + nuxtAppDir: resolve(__dirname, '../app'), build: { analyze: false, dll: false, diff --git a/lib/common/utils.js b/lib/common/utils.js index b8fd3c604b..11b434b1d0 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -1,15 +1,15 @@ -import { resolve, relative, sep } from 'path' -import _ from 'lodash' +const { resolve, relative, sep } = require('path') +const _ = require('lodash') -export function encodeHtml(str) { +exports.encodeHtml = function encodeHtml(str) { return str.replace(//g, '>') } -export function getContext(req, res) { +exports.getContext = function getContext(req, res) { return { req, res } } -export function setAnsiColors(ansiHTML) { +exports.setAnsiColors = function setAnsiColors(ansiHTML) { ansiHTML.setColors({ reset: ['efefef', 'a6004c'], darkgrey: '5a012b', @@ -22,19 +22,19 @@ export function setAnsiColors(ansiHTML) { }) } -export async function waitFor(ms) { +exports.waitFor = async function waitFor(ms) { return new Promise(resolve => setTimeout(resolve, (ms || 0))) } -export function urlJoin() { +exports.urlJoin = function urlJoin() { return [].slice.call(arguments).join('/').replace(/\/+/g, '/').replace(':/', '://') } -export function isUrl(url) { +exports.isUrl = function isUrl(url) { return (url.indexOf('http') === 0 || url.indexOf('//') === 0) } -export function promisifyRoute(fn, ...args) { +exports.promisifyRoute = function promisifyRoute(fn, ...args) { // If routes is an array if (Array.isArray(fn)) { return Promise.resolve(fn) @@ -57,15 +57,15 @@ export function promisifyRoute(fn, ...args) { return promise } -export function sequence(tasks, fn) { +exports.sequence = function sequence(tasks, fn) { return tasks.reduce((promise, task) => promise.then(() => fn(task)), Promise.resolve()) } -export function parallel(tasks, fn) { +exports.parallel = function parallel(tasks, fn) { return Promise.all(tasks.map(task => fn(task))) } -export function chainFn(base, fn) { +exports.chainFn = function chainFn(base, fn) { /* istanbul ignore if */ if (!(fn instanceof Function)) { return @@ -88,13 +88,13 @@ export function chainFn(base, fn) { } } -export function isPureObject(o) { +exports.isPureObject = function isPureObject(o) { return !Array.isArray(o) && typeof o === 'object' } -export const isWindows = /^win/.test(process.platform) +const isWindows = exports.isWindows = /^win/.test(process.platform) -export function wp(p = '') { +const wp = exports.wp = function wp(p = '') { /* istanbul ignore if */ if (isWindows) { return p.replace(/\\/g, '\\\\') @@ -102,7 +102,7 @@ export function wp(p = '') { return p } -export function wChunk(p = '') { +exports.wChunk = function wChunk(p = '') { /* istanbul ignore if */ if (isWindows) { return p.replace(/\//g, '_') @@ -114,7 +114,7 @@ const reqSep = /\//g const sysSep = _.escapeRegExp(sep) const normalize = string => string.replace(reqSep, sysSep) -export function r() { +const r = exports.r = function r() { let args = Array.prototype.slice.apply(arguments) let lastArg = _.last(args) @@ -125,7 +125,7 @@ export function r() { return wp(resolve(...args.map(normalize))) } -export function relativeTo() { +exports.relativeTo = function relativeTo() { let args = Array.prototype.slice.apply(arguments) let dir = args.shift() @@ -145,7 +145,7 @@ export function relativeTo() { return wp(rp) } -export function flatRoutes(router, path = '', routes = []) { +exports.flatRoutes = function flatRoutes(router, path = '', routes = []) { router.forEach((r) => { if (!r.path.includes(':') && !r.path.includes('*')) { /* istanbul ignore if */ @@ -163,7 +163,7 @@ export function flatRoutes(router, path = '', routes = []) { return routes } -export function cleanChildrenRoutes(routes, isChild = false) { +function cleanChildrenRoutes(routes, isChild = false) { let start = -1 let routesIndex = [] routes.forEach((route) => { @@ -209,7 +209,7 @@ export function cleanChildrenRoutes(routes, isChild = false) { return routes } -export function createRoutes(files, srcDir) { +exports.createRoutes = function createRoutes(files, srcDir) { let routes = [] files.forEach((file) => { let keys = file.replace(/^pages/, '').replace(/\.(vue|js)$/, '').replace(/\/{2,}/g, '/').split('/').slice(1) @@ -269,7 +269,7 @@ export function createRoutes(files, srcDir) { return cleanChildrenRoutes(routes) } -export function rmCache(path) { +exports.rmCache = function rmCache(path) { const mod = require.cache[path] delete require.cache[path] if (mod.parent && mod.parent.children) { diff --git a/lib/core/index.js b/lib/core/index.js index 3eee8a295c..b4e0d1399a 100755 --- a/lib/core/index.js +++ b/lib/core/index.js @@ -1,9 +1,9 @@ -import { Options, Utils } from 'common' -import Module from './module' -import Nuxt from './nuxt' -import Renderer from './renderer' +const { Options, Utils } = require('../common') +const Module = require('./module') +const Nuxt = require('./nuxt') +const Renderer = require('./renderer') -export { +module.exports = { Nuxt, Module, Renderer, diff --git a/lib/core/meta.js b/lib/core/meta.js index 1edd0c3d7f..0df24a9de4 100644 --- a/lib/core/meta.js +++ b/lib/core/meta.js @@ -1,10 +1,10 @@ -import Vue from 'vue' -import VueMeta from 'vue-meta' -import VueServerRenderer from 'vue-server-renderer' -import LRU from 'lru-cache' +const Vue = require('vue') +const VueMeta = require('vue-meta') +const VueServerRenderer = require('vue-server-renderer') +const LRU = require('lru-cache') -export default class MetaRenderer { +module.exports = class MetaRenderer { constructor(nuxt, renderer) { this.nuxt = nuxt this.renderer = renderer diff --git a/lib/core/module.js b/lib/core/module.js index 0ad7182279..2ce68de4e8 100755 --- a/lib/core/module.js +++ b/lib/core/module.js @@ -1,13 +1,13 @@ -import path from 'path' -import fs from 'fs' -import { uniq } from 'lodash' -import hash from 'hash-sum' -import { chainFn, sequence } from 'utils' -import Debug from 'debug' +const path = require('path') +const fs = require('fs') +const { uniq } = require('lodash') +const hash = require('hash-sum') +const { chainFn, sequence } = require('../common/utils') +const Debug = require('debug') const debug = Debug('nuxt:module') -export default class ModuleContainer { +module.exports = class ModuleContainer { constructor(nuxt) { this.nuxt = nuxt this.options = nuxt.options diff --git a/lib/core/nuxt.js b/lib/core/nuxt.js index f9a8f00f29..f25d213c20 100644 --- a/lib/core/nuxt.js +++ b/lib/core/nuxt.js @@ -1,18 +1,19 @@ -import chalk from 'chalk' -import { Options } from 'common' -import { sequence } from 'utils' -import ModuleContainer from './module' -import Renderer from './renderer' -import Debug from 'debug' -import enableDestroy from 'server-destroy' -import Module from 'module' -import { isPlainObject } from 'lodash' -import { join, resolve } from 'path' +const Debug = require('debug') +const enableDestroy = require('server-destroy') +const Module = require('module') +const { isPlainObject } = require('lodash') +const chalk = require('chalk') +const { Options } = require('../common') +const { sequence } = require('../common/utils') +const { join, resolve } = require('path') +const { version } = require('../../package.json') +const ModuleContainer = require('./module') +const Renderer = require('./renderer') const debug = Debug('nuxt:') debug.color = 5 -export default class Nuxt { +module.exports = class Nuxt { constructor(options = {}) { this.options = Options.from(options) @@ -45,7 +46,7 @@ export default class Nuxt { } static get version() { - return '__VERSION__' + return version } async ready() { diff --git a/lib/core/renderer.js b/lib/core/renderer.js index abfdee4fb5..16187ff93e 100644 --- a/lib/core/renderer.js +++ b/lib/core/renderer.js @@ -1,20 +1,20 @@ -import ansiHTML from 'ansi-html' -import serialize from 'serialize-javascript' -import generateETag from 'etag' -import fresh from 'fresh' -import serveStatic from 'serve-static' -import compression from 'compression' -import _ from 'lodash' -import { join, resolve } from 'path' -import fs from 'fs-extra' -import { createBundleRenderer } from 'vue-server-renderer' -import { getContext, setAnsiColors, isUrl, waitFor } from 'utils' -import Debug from 'debug' -import Youch from '@nuxtjs/youch' -import { SourceMapConsumer } from 'source-map' -import connect from 'connect' -import { Options } from 'common' -import MetaRenderer from './meta' +const ansiHTML = require('ansi-html') +const serialize = require('serialize-javascript') +const generateETag = require('etag') +const fresh = require('fresh') +const serveStatic = require('serve-static') +const compression = require('compression') +const _ = require('lodash') +const { join, resolve } = require('path') +const fs = require('fs-extra') +const { createBundleRenderer } = require('vue-server-renderer') +const { getContext, setAnsiColors, isUrl, waitFor } = require('../common/utils') +const Debug = require('debug') +const Youch = require('@nuxtjs/youch') +const { SourceMapConsumer } = require('source-map') +const connect = require('connect') +const { Options } = require('../common') +const MetaRenderer = require('./meta') const debug = Debug('nuxt:render') debug.color = 4 // Force blue color @@ -23,7 +23,7 @@ setAnsiColors(ansiHTML) let jsdom = null -export default class Renderer { +module.exports = class Renderer { constructor(nuxt) { this.nuxt = nuxt this.options = nuxt.options diff --git a/lib/index.js b/lib/index.js index aa7df41b13..f0b416e198 100755 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,11 @@ -import * as core from './core' -import * as builder from './builder' +/*! + * Nuxt.js + * (c) 2016-2017 Chopin Brothers + * Core maintainer: Pooya Parsa (@pi0) + * Released under the MIT License. + */ -export default Object.assign({}, core, builder) +const core = require('./core') +const builder = require('./builder') + +module.exports = Object.assign({}, core, builder) diff --git a/package.json b/package.json index 896c04ad24..b14a578e6d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "name": "Pooya Parsa (@pi0)" } ], - "main": "./index.js", + "main": "./lib/index.js", "license": "MIT", "repository": { "type": "git", @@ -21,7 +21,6 @@ }, "files": [ "bin", - "dist", "lib", "index.js" ], @@ -47,14 +46,9 @@ ] }, "scripts": { - "test": "npm run lint && cross-env NODE_ENV=test npm run build:nuxt && nyc ava --verbose --serial test/ -- && nyc report --reporter=html", + "test": "npm run lint && nyc ava --verbose --serial test/ -- && nyc report --reporter=html", "coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint --ext .js,.vue bin/* build/ lib/ test/ examples/", - "build": "rimraf dist/ && npm run build:nuxt && npm run build:core", - "build:nuxt": "rollup -c build/rollup.config.js --environment TARGET:nuxt", - "build:core": "rollup -c build/rollup.config.js --environment TARGET:core", - "watch": "npm run build:nuxt -- -w", - "make-start": "node ./build/start.js", "precommit": "npm run lint", "postinstall": "opencollective postinstall || exit 0", "release-next": "npm run build && node ./build/release-next && npm publish --tag next" @@ -106,7 +100,6 @@ "serve-static": "^1.13.1", "server-destroy": "^1.0.1", "source-map": "^0.6.1", - "source-map-support": "^0.5.0", "style-resources-loader": "^1.0.0", "uglifyjs-webpack-plugin": "^1.1.2", "url-loader": "^0.6.2", @@ -149,14 +142,6 @@ "puppeteer": "^0.13.0", "request": "^2.83.0", "request-promise-native": "^1.0.5", - "rimraf": "^2.6.2", - "rollup": "^0.52.1", - "rollup-plugin-alias": "^1.4.0", - "rollup-plugin-babel": "^3.0.2", - "rollup-plugin-commonjs": "^8.2.6", - "rollup-plugin-node-resolve": "^3.0.0", - "rollup-plugin-replace": "^2.0.0", - "rollup-watch": "^4.3.1", "std-mocks": "^1.0.1", "uglify-js": "^3.2.2" }, diff --git a/test/basic.config.defaults.test.js b/test/basic.config.defaults.test.js index d23ad57a1f..5f7136119c 100644 --- a/test/basic.config.defaults.test.js +++ b/test/basic.config.defaults.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Options } from '../index' +import { Nuxt, Options } from '..' import { version } from '../package.json' test('Nuxt.version is same as package', t => { diff --git a/test/basic.csr.test.js b/test/basic.csr.test.js index 83b57293ca..94fada4228 100644 --- a/test/basic.csr.test.js +++ b/test/basic.csr.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder } from '../index' +import { Nuxt, Builder } from '..' import * as browser from './helpers/browser' const port = 4003 diff --git a/test/basic.dev.test.js b/test/basic.dev.test.js index 1d046f00f8..53a46c6f6e 100644 --- a/test/basic.dev.test.js +++ b/test/basic.dev.test.js @@ -2,7 +2,7 @@ import test from 'ava' import { resolve } from 'path' import stdMocks from 'std-mocks' // import rp from 'request-promise-native' -import { Nuxt, Builder, Utils } from '../index.js' +import { Nuxt, Builder, Utils } from '..' import { truncateSync, readFileSync, writeFileSync } from 'fs' const port = 4001 diff --git a/test/basic.fail.generate.test.js b/test/basic.fail.generate.test.js index e5386e0bcf..79653d3593 100644 --- a/test/basic.fail.generate.test.js +++ b/test/basic.fail.generate.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder, Generator } from '../index.js' +import { Nuxt, Builder, Generator } from '..' test('Fail with routes() which throw an error', async t => { const options = { diff --git a/test/basic.generate.nosubfolders.test.js b/test/basic.generate.nosubfolders.test.js index ce9c1d813a..5aeb01a16f 100644 --- a/test/basic.generate.nosubfolders.test.js +++ b/test/basic.generate.nosubfolders.test.js @@ -5,7 +5,7 @@ import http from 'http' import serveStatic from 'serve-static' import finalhandler from 'finalhandler' import rp from 'request-promise-native' -import { Nuxt, Builder, Generator } from '../index.js' +import { Nuxt, Builder, Generator } from '..' const port = 4002 const url = (route) => 'http://localhost:' + port + route diff --git a/test/basic.generate.test.js b/test/basic.generate.test.js index 0e1020847e..877cd1c52a 100644 --- a/test/basic.generate.test.js +++ b/test/basic.generate.test.js @@ -5,7 +5,7 @@ import http from 'http' import serveStatic from 'serve-static' import finalhandler from 'finalhandler' import rp from 'request-promise-native' -import { Nuxt, Builder, Generator } from '../index.js' +import { Nuxt, Builder, Generator } from '..' const port = 4002 const url = (route) => 'http://localhost:' + port + route diff --git a/test/basic.ssr.test.js b/test/basic.ssr.test.js index a8abb58413..aae111b8c2 100755 --- a/test/basic.ssr.test.js +++ b/test/basic.ssr.test.js @@ -2,7 +2,7 @@ import test from 'ava' import { resolve } from 'path' import rp from 'request-promise-native' import stdMocks from 'std-mocks' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4003 const url = (route) => 'http://localhost:' + port + route diff --git a/test/children.patch.test.js b/test/children.patch.test.js index a66cfbf6ce..46bb123526 100644 --- a/test/children.patch.test.js +++ b/test/children.patch.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder, Utils } from '../index.js' +import { Nuxt, Builder, Utils } from '..' import * as browser from './helpers/browser' const port = 4005 diff --git a/test/children.test.js b/test/children.test.js index c648702798..25fddc71a9 100644 --- a/test/children.test.js +++ b/test/children.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4004 // const url = (route) => 'http://localhost:' + port + route diff --git a/test/cli.test.js b/test/cli.test.js index 3be4f4c846..4e47ba0227 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -2,10 +2,10 @@ import { promisify } from 'util' import test from 'ava' import { resolve, sep } from 'path' import rp from 'request-promise-native' -import { Utils } from '../index.js' import { exec, spawn } from 'child_process' +import { Utils } from '..' -const execify = promisify(exec, { multiArgs: true }) +const execify = promisify(exec) const rootDir = resolve(__dirname, 'fixtures/basic') const port = 4011 @@ -14,7 +14,7 @@ const url = (route) => 'http://localhost:' + port + route test('bin/nuxt-build', async t => { const binBuild = resolve(__dirname, '..', 'bin', 'nuxt-build') - const [ stdout, stderr ] = await execify(`node ${binBuild} ${rootDir}`) + const { stdout, stderr } = await execify(`node ${binBuild} ${rootDir}`) t.true(stdout.includes('server-bundle.json')) t.true(stderr.includes('Building done')) @@ -82,7 +82,7 @@ test('bin/nuxt-start', async t => { test('bin/nuxt-generate', async t => { const binGenerate = resolve(__dirname, '..', 'bin', 'nuxt-generate') - const [ stdout, stderr ] = await execify(`node ${binGenerate} ${rootDir}`) + const { stdout, stderr } = await execify(`node ${binGenerate} ${rootDir}`) t.true(stdout.includes('server-bundle.json')) t.true(stderr.includes('Destination folder cleaned')) diff --git a/test/debug.test.js b/test/debug.test.js index 559b68bdf4..e198c9642e 100644 --- a/test/debug.test.js +++ b/test/debug.test.js @@ -1,7 +1,7 @@ import test from 'ava' import { resolve } from 'path' import rp from 'request-promise-native' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4009 const url = (route) => 'http://localhost:' + port + route diff --git a/test/deprecate.test.js b/test/deprecate.test.js index e6ae186066..8cf3d1b71e 100755 --- a/test/deprecate.test.js +++ b/test/deprecate.test.js @@ -2,7 +2,7 @@ import test from 'ava' import stdMocks from 'std-mocks' import { resolve } from 'path' import rp from 'request-promise-native' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4010 const url = (route) => 'http://localhost:' + port + route diff --git a/test/dll.test.js b/test/dll.test.js index 20fdcc3b41..688534b125 100644 --- a/test/dll.test.js +++ b/test/dll.test.js @@ -3,7 +3,7 @@ import test from 'ava' import { resolve } from 'path' import fs from 'fs' import stdMocks from 'std-mocks' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const readFile = promisify(fs.readFile) const rootDir = resolve(__dirname, './fixtures/dll') diff --git a/test/dynamic-routes.test.js b/test/dynamic-routes.test.js index 2285fdb997..c705f5eb62 100644 --- a/test/dynamic-routes.test.js +++ b/test/dynamic-routes.test.js @@ -1,7 +1,7 @@ import test from 'ava' import { resolve } from 'path' import fs from 'fs' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' import { promisify } from 'util' const readFile = promisify(fs.readFile) diff --git a/test/error.test.js b/test/error.test.js index c5f55469ec..7a81f2d96a 100644 --- a/test/error.test.js +++ b/test/error.test.js @@ -1,7 +1,7 @@ import test from 'ava' import { resolve } from 'path' import rp from 'request-promise-native' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4005 const url = (route) => 'http://localhost:' + port + route diff --git a/test/express.test.js b/test/express.test.js index 531aa606a0..676e931ee3 100644 --- a/test/express.test.js +++ b/test/express.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' import express from 'express' import rp from 'request-promise-native' diff --git a/test/fixtures/basic/nuxt.config.js b/test/fixtures/basic/nuxt.config.js index 439bec51ea..7e6fd8b33a 100644 --- a/test/fixtures/basic/nuxt.config.js +++ b/test/fixtures/basic/nuxt.config.js @@ -1,5 +1,3 @@ -const path = require('path') - module.exports = { generate: { routes: [ @@ -10,7 +8,6 @@ module.exports = { interval: 200, subFolders: true }, - modulesDir: path.join(__dirname, '..', '..', '..', 'node_modules'), hooks: { ready(nuxt) { nuxt.__hook_called__ = true diff --git a/test/generator.test.js b/test/generator.test.js index 7fe1855e76..9ebbed4235 100644 --- a/test/generator.test.js +++ b/test/generator.test.js @@ -1,5 +1,5 @@ import test from 'ava' -import { Nuxt, Generator } from '../index.js' +import { Nuxt, Generator } from '..' test('initRoutes with routes (fn => array)', async t => { const array = ['/1', '/2', '/3', '/4'] diff --git a/test/index.test.js b/test/index.test.js index c30f96be7e..03632bdcb0 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,6 +1,6 @@ import test from 'ava' import { resolve } from 'path' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' test('Nuxt.js Class', t => { t.is(typeof Nuxt, 'function') diff --git a/test/module.test.js b/test/module.test.js index 109d279c09..d26d6c58d9 100755 --- a/test/module.test.js +++ b/test/module.test.js @@ -2,7 +2,7 @@ import test from 'ava' import stdMocks from 'std-mocks' import { resolve, normalize } from 'path' import rp from 'request-promise-native' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4006 const url = (route) => 'http://localhost:' + port + route diff --git a/test/spa.test.js b/test/spa.test.js index 6868a20c0c..661aa5cc8a 100755 --- a/test/spa.test.js +++ b/test/spa.test.js @@ -1,6 +1,6 @@ import test from 'ava' import stdMocks from 'std-mocks' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' let nuxt = null diff --git a/test/utils.test.js b/test/utils.test.js index ef834f2b89..c21244f7a6 100644 --- a/test/utils.test.js +++ b/test/utils.test.js @@ -1,6 +1,6 @@ import test from 'ava' import ansiHTML from 'ansi-html' -import { Utils } from '../index.js' +import { Utils } from '..' test('encodeHtml', t => { const html = '

Hello

' diff --git a/test/with-config.test.js b/test/with-config.test.js index b04e56c8ed..d794df2d47 100644 --- a/test/with-config.test.js +++ b/test/with-config.test.js @@ -1,7 +1,7 @@ import test from 'ava' import { resolve } from 'path' import rp from 'request-promise-native' -import { Nuxt, Builder } from '../index.js' +import { Nuxt, Builder } from '..' const port = 4007 const url = (route) => 'http://localhost:' + port + route diff --git a/yarn.lock b/yarn.lock index 19469e320b..3a13a1509e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,8 +110,8 @@ resolved "https://registry.yarnpkg.com/@std/esm/-/esm-0.16.0.tgz#2a7a33ecb7f1701cebd4c87df6d0d945ed51f730" "@types/node@*": - version "8.0.57" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.57.tgz#e5d8b4dc112763e35cfc51988f4f38da3c486d99" + version "8.0.58" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.58.tgz#5b3881c0be3a646874803fee3197ea7f1ed6df90" abab@^1.0.3: version "1.0.4" @@ -1222,12 +1222,6 @@ browser-process-hrtime@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" -browser-resolve@^1.11.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - dependencies: - resolve "1.1.7" - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.1.1" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" @@ -1310,7 +1304,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -builtin-modules@^1.0.0, builtin-modules@^1.1.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1416,14 +1410,10 @@ caniuse-api@^2.0.0: lodash.uniq "^4.5.0" caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: - version "1.0.30000780" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000780.tgz#8d1977561d00ff0f0ed2b6b66140328ab4504c0a" + version "1.0.30000782" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000782.tgz#d8815bce1578c350aced1132507301205e0fab53" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000780: - version "1.0.30000780" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000780.tgz#1f9095f2efd4940e0ba6c5992ab7a9b64cc35ba4" - -caniuse-lite@^1.0.30000782: +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000780, caniuse-lite@^1.0.30000782: version "1.0.30000782" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000782.tgz#5b82b8c385f25348745c471ca51320afb1b7f254" @@ -1829,8 +1819,8 @@ core-js@^1.0.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" core-js@^2.0.0, core-js@^2.4.0, core-js@^2.5.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" + version "2.5.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -2376,10 +2366,10 @@ equal-length@^1.0.0: resolved "https://registry.yarnpkg.com/equal-length/-/equal-length-1.0.1.tgz#21ca112d48ab24b4e1e7ffc0e5339d31fdfc274c" errno@^0.1.3, errno@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + version "0.1.5" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.5.tgz#a563781a6052bc2c9ccd89e8cef0eb9506e0c321" dependencies: - prr "~0.0.0" + prr "~1.0.1" error-ex@^1.2.0: version "1.3.1" @@ -2674,18 +2664,6 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" - -estree-walker@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" - -estree-walker@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.1.tgz#64fc375053abc6f57d73e9bd2f004644ad3c5854" - esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -3159,8 +3137,8 @@ globals@^10.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-10.4.0.tgz#5c477388b128a9e4c5c5d01c7a2aca68c68b2da7" globals@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.0.1.tgz#12a87bb010e5154396acc535e1e43fc753b0e5e8" + version "11.1.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" globals@^9.18.0: version "9.18.0" @@ -3719,10 +3697,6 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" -is-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" - is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" @@ -4244,12 +4218,6 @@ macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" -magic-string@^0.22.4: - version "0.22.4" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff" - dependencies: - vlq "^0.2.1" - make-dir@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" @@ -5577,8 +5545,8 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" prettier@^1.7.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70" + version "1.9.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827" pretty-error@^2.0.2, pretty-error@^2.1.1: version "2.1.1" @@ -5657,9 +5625,9 @@ proxy-from-env@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" -prr@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" pseudomap@^1.0.2: version "1.0.2" @@ -6065,10 +6033,6 @@ require-precompiled@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/require-precompiled/-/require-precompiled-0.1.0.tgz#5a1b52eb70ebed43eb982e974c85ab59571e56fa" -require-relative@0.8.7: - version "0.8.7" - resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" - require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -6094,11 +6058,7 @@ resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.3, resolve@^1.4.0: +resolve@^1.1.7, resolve@^1.2.0, resolve@^1.3.3, resolve@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: @@ -6125,7 +6085,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -6138,71 +6098,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" -rollup-plugin-alias@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9" - dependencies: - slash "^1.0.0" - -rollup-plugin-babel@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-3.0.2.tgz#a2765dea0eaa8aece351c983573300d17497495b" - dependencies: - rollup-pluginutils "^1.5.0" - -rollup-plugin-commonjs@^8.2.6: - version "8.2.6" - resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.6.tgz#27e5b9069ff94005bb01e01bb46a1e4873784677" - dependencies: - acorn "^5.2.1" - estree-walker "^0.5.0" - magic-string "^0.22.4" - resolve "^1.4.0" - rollup-pluginutils "^2.0.1" - -rollup-plugin-node-resolve@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0" - dependencies: - browser-resolve "^1.11.0" - builtin-modules "^1.1.0" - is-module "^1.0.0" - resolve "^1.1.6" - -rollup-plugin-replace@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz#19074089c8ed57184b8cc64e967a03d095119277" - dependencies: - magic-string "^0.22.4" - minimatch "^3.0.2" - rollup-pluginutils "^2.0.1" - -rollup-pluginutils@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" - dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" - -rollup-pluginutils@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0" - dependencies: - estree-walker "^0.3.0" - micromatch "^2.3.11" - -rollup-watch@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-4.3.1.tgz#5aa1eaeab787addf368905d102b39d6fc5ce4a8b" - dependencies: - chokidar "^1.7.0" - require-relative "0.8.7" - rollup-pluginutils "^2.0.1" - -rollup@^0.52.1: - version "0.52.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.52.1.tgz#610e8e1be432f18fcfbfa865408a1cd7618cd707" - run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -6627,8 +6522,8 @@ supports-color@^4.0.0, supports-color@^4.2.1, supports-color@^4.4.0: has-flag "^2.0.0" supports-color@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.0.1.tgz#1c5331f22250c84202805b2f17adf16699f3a39a" + version "5.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.1.0.tgz#058a021d1b619f7ddf3980d712ea3590ce7de3d5" dependencies: has-flag "^2.0.0" @@ -6840,15 +6735,15 @@ ua-parser-js@^0.7.9: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" uglify-es@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.2.1.tgz#93de0aad8a1bb629c8a316f686351bc4d6ece687" + version "3.2.2" + resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.2.2.tgz#15c62b7775002c81b7987a1c49ecd3f126cace73" dependencies: commander "~2.12.1" source-map "~0.6.1" -uglify-js@3.2.x: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.2.1.tgz#d6427fd45a25fefc5d196689c0c772a6915e10fe" +uglify-js@3.2.x, uglify-js@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.2.2.tgz#870e4b34ed733d179284f9998efd3293f7fd73f6" dependencies: commander "~2.12.1" source-map "~0.6.1" @@ -6862,13 +6757,6 @@ uglify-js@^2.6, uglify-js@^2.8.29: optionalDependencies: uglify-to-browserify "~1.0.0" -uglify-js@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.2.2.tgz#870e4b34ed733d179284f9998efd3293f7fd73f6" - dependencies: - commander "~2.12.1" - source-map "~0.6.1" - uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" @@ -7060,10 +6948,6 @@ viewport-dimensions@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/viewport-dimensions/-/viewport-dimensions-0.2.0.tgz#de740747db5387fd1725f5175e91bac76afdf36c" -vlq@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" - vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73"