[
  {
    "__docId__": 0,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/app/server/index.js",
    "memberof": null,
    "longname": "src/app/server/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "/* global USE_DEFAULT_KOA_MIDDLEWARES HAS_KOA_MIDDLEWARES KOA_MIDDLEWARES ROC_PATH __DEV__  */\n\nimport { readFileSync } from 'fs';\nimport debug from 'debug';\nimport http from 'http';\nimport https from 'https';\nimport koa from 'koa';\nimport serve from 'koa-static';\nimport mount from 'koa-mount';\n\nimport addTrailingSlash from 'koa-add-trailing-slashes';\nimport normalizePath from 'koa-normalize-path';\nimport lowercasePath from 'koa-lowercase-path';\nimport removeTrailingSlash from 'koa-remove-trailing-slashes';\n\nimport { merge, getSettings, getAbsolutePath } from 'roc';\n\n/**\n * Creates a server instance.\n *\n * @example\n * import { createServer } from 'roc-web/app';\n *\n * const server = createServer({\n *    serve: 'static',\n *    favicon: 'static/favicon.png'\n * });\n *\n * server.start();\n *\n * @param {rocServerOptions} options - Options for the server. Will override configuration in roc.config.js.\n * @param {Function[]} beforeUserMiddlewares - Middlewares that should be added before the user middlewares.\n * @returns {rocServer} server - Roc server instace.\n */\nexport default function createServer(options = {}, beforeUserMiddlewares = []) {\n    const logger = debug('roc:server');\n\n    const server = koa();\n    const settings = merge(getSettings('runtime'), options);\n\n    if (USE_DEFAULT_KOA_MIDDLEWARES) {\n        const middlewares = require('./middlewares')(settings);\n        middlewares.forEach((middleware) => server.use(middleware));\n    }\n\n    if (beforeUserMiddlewares.length) {\n        beforeUserMiddlewares.forEach((middleware) => server.use(middleware));\n    }\n\n    if (HAS_KOA_MIDDLEWARES) {\n        const middlewares = require(KOA_MIDDLEWARES)(settings);\n        middlewares.forEach((middleware) => server.use(middleware));\n    }\n\n    const makeServe = (toServe = []) => {\n        toServe = [].concat(toServe);\n        for (const path of toServe) {\n            // We use defer here to no try to fetch a file if we have set something on body, something that is done in\n            // redirect. This because https://github.com/koajs/send/issues/51\n            server.use(serve(path, { defer: true }));\n        }\n    };\n\n    if (settings.koa.normalize.enabled) {\n        server.use(normalizePath({ defer: settings.koa.normalize.defer }));\n    }\n\n    if (settings.koa.lowercase.enabled) {\n        server.use(lowercasePath({ defer: settings.koa.lowercase.defer }));\n    }\n\n    if (settings.koa.trailingSlashes.enabled === true) {\n        server.use(addTrailingSlash({ defer: settings.koa.trailingSlashes.defer }));\n    } else if (settings.koa.trailingSlashes.enabled === false) {\n        server.use(removeTrailingSlash());\n    }\n\n    // Serve folders\n    makeServe(settings.serve);\n\n    function start(port, httpsPort) {\n        port = port || process.env.PORT || settings.port;\n        httpsPort = httpsPort || process.env.HTTPS_PORT || settings.https.port;\n\n        const app = koa();\n        app.use(mount(ROC_PATH, server));\n\n        // Start the server on HTTP\n        http.createServer(app.callback()).listen(port);\n        logger(`Server started on port ${port} (HTTP) and served from ${ROC_PATH}`);\n\n        // If a HTTPS port is defined we will try to start the application with SSL/TLS\n        if (httpsPort) {\n            let key = getAbsolutePath(settings.https.key);\n            let cert = getAbsolutePath(settings.https.cert);\n\n            // Add a self-signed certificate for development purposes if non is provided.\n            if (__DEV__ && !key && !cert) {\n                key = require('roc-web/certificate').getKey();\n                cert = require('roc-web/certificate').getCert();\n            }\n\n            if (key && cert) {\n                const httpsOptions = {\n                    key: readFileSync(key),\n                    cert: readFileSync(cert)\n                };\n\n                https.createServer(httpsOptions, app.callback()).listen(httpsPort);\n                logger(`Server started on port ${httpsPort} (HTTPS) and served from ${ROC_PATH}`);\n            } else {\n                logger('You have defined a HTTPS port but not given any certificate files to use…');\n            }\n        }\n\n        if (process.send) {\n            process.send('online');\n        }\n    }\n\n    return {\n        server,\n        start\n    };\n}\n"
  },
  {
    "__docId__": 1,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "createServer",
    "memberof": "src/app/server/index.js",
    "longname": "src/app/server/index.js~createServer",
    "access": null,
    "export": true,
    "importPath": "roc-web/src/app/server/index.js",
    "importStyle": "createServer",
    "description": "Creates a server instance.",
    "examples": [
      "import { createServer } from 'roc-web/app';\n\nconst server = createServer({\n   serve: 'static',\n   favicon: 'static/favicon.png'\n});\n\nserver.start();"
    ],
    "lineNumber": 35,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{rocServer} server - Roc server instace."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "rocServerOptions"
        ],
        "spread": false,
        "optional": false,
        "name": "options",
        "description": "Options for the server. Will override configuration in roc.config.js."
      },
      {
        "nullable": null,
        "types": [
          "Function[]"
        ],
        "spread": false,
        "optional": false,
        "name": "beforeUserMiddlewares",
        "description": "Middlewares that should be added before the user middlewares."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "rocServer"
      ],
      "spread": false,
      "description": "server - Roc server instace."
    },
    "generator": false
  },
  {
    "__docId__": 2,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/app/server/middlewares.js",
    "memberof": null,
    "longname": "src/app/server/middlewares.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "/* global __DEV__ __DIST__ */\n\nimport koaErrors from 'koa-errors';\nimport helmet from 'koa-helmet';\nimport koaEtag from 'koa-etag';\nimport koaCompressor from 'koa-compressor';\nimport koaFavicon from 'koa-favicon';\nimport koaAccesslog from 'koa-accesslog';\nimport koaLogger from 'koa-logger';\n\n/**\n * Returns the middlewares to be used\n *\n * @param {object} config - A roc config object.\n * @returns {array} A array with middlewares to use.\n */\nexport default function middlewares(config) {\n    const middlewaresList = [];\n\n    if (__DEV__) {\n        middlewaresList.push(koaErrors());\n    }\n\n    // Security headers\n    middlewaresList.push(helmet());\n\n    middlewaresList.push(koaEtag());\n\n    // We only enable gzip in dist\n    if (__DIST__) {\n        middlewaresList.push(koaCompressor());\n    }\n\n    const favicon = config.favicon;\n    if (favicon) {\n        middlewaresList.push(koaFavicon(favicon));\n    }\n\n    if (__DIST__) {\n        middlewaresList.push(koaAccesslog());\n    } else {\n        middlewaresList.push(koaLogger());\n    }\n\n    return middlewaresList;\n}\n"
  },
  {
    "__docId__": 3,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "middlewares",
    "memberof": "src/app/server/middlewares.js",
    "longname": "src/app/server/middlewares.js~middlewares",
    "access": null,
    "export": true,
    "importPath": "roc-web/src/app/server/middlewares.js",
    "importStyle": "middlewares",
    "description": "Returns the middlewares to be used",
    "lineNumber": 17,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{array} A array with middlewares to use."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "config",
        "description": "A roc config object."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "array"
      ],
      "spread": false,
      "description": "A array with middlewares to use."
    },
    "generator": false
  },
  {
    "__docId__": 4,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/app/server-entry.js",
    "memberof": null,
    "longname": "src/app/server-entry.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "/* global ROC_PATH_RESOLVER ROC_SERVER_ENTRY */\n\nconst getResolvePath = require(ROC_PATH_RESOLVER);\n\n// Init NODE_PATH if not set\nif (!process.env.NODE_PATH) {\n    process.env.NODE_PATH = '';\n}\n\n// This will only work on non Windows machines\nprocess.env.NODE_PATH += `:${getResolvePath()}`;\n\n// Re-init Nodes module package with the new Node Path from above\n/* eslint-disable no-underscore-dangle */\nrequire('module').Module._initPaths();\n/* eslint-enable */\n\n// Get source map support\nrequire('source-map-support').install();\n\n// Disable warnings from missing config in a application\nprocess.env.SUPPRESS_NO_CONFIG_WARNING = true;\n\nconst settings = require('roc').getSettings('runtime');\n\n// Enable debug based on roc.config.js settings\nrequire('debug').enable(settings.debug.server);\n\n// Start the real entry point\nrequire(ROC_SERVER_ENTRY);\n"
  },
  {
    "__docId__": 5,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "getResolvePath",
    "memberof": "src/app/server-entry.js",
    "longname": "src/app/server-entry.js~getResolvePath",
    "access": null,
    "export": false,
    "importPath": "roc-web/src/app/server-entry.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 3,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 6,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "settings",
    "memberof": "src/app/server-entry.js",
    "longname": "src/app/server-entry.js~settings",
    "access": null,
    "export": false,
    "importPath": "roc-web/src/app/server-entry.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 24,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 7,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/bin/index.js",
    "memberof": null,
    "longname": "src/roc/bin/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "#! /usr/bin/env node\n\nimport 'source-map-support/register';\n\nimport { runCli } from 'roc';\n\nconst pkg = require('../../package.json');\n\nrunCli({\n    version: pkg.version,\n    name: pkg.name\n});\n"
  },
  {
    "__docId__": 8,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "pkg",
    "memberof": "src/roc/bin/index.js",
    "longname": "src/roc/bin/index.js~pkg",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/bin/index.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 7,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 9,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/builder/index.js",
    "memberof": null,
    "longname": "src/roc/builder/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport fs from 'fs';\nimport path from 'path';\nimport autoprefixer from 'autoprefixer';\nimport ExtractTextPlugin from 'extract-text-webpack-plugin';\nimport { getSettings, getAbsolutePath } from 'roc';\n\nimport { getDevPath, removeTrailingSlash, addTrailingSlash } from '../helpers/general';\nimport { writeStats } from './utils/stats';\n\nconst bourbon = './node_modules/bourbon/app/assets/stylesheets/';\nconst neat = './node_modules/bourbon-neat/app/assets/stylesheets/';\n\n/**\n * Creates a builder.\n *\n * @param {!string} target - a target: should be either \"client\" or \"server\"\n * @param {rocBuilder} rocBuilder - A rocBuilder to base everything on.\n * @param {!string} [resolver=roc-web/lib/helpers/get-resolve-path] - Path to the resolver for the server side\n * {@link getResolvePath}\n * @returns {rocBuilder}\n */\nexport default function createBuilder(target, { buildConfig = {}, builder = require('webpack') },\n    resolver = 'roc-web/lib/helpers/get-resolve-path') {\n    const allowedTargets = ['server', 'client'];\n\n    if (allowedTargets.indexOf(target) === -1) {\n        throw new Error(`Invalid target, must be one of ${allowedTargets}. Was instead ${target}.`);\n    }\n\n    const settings = getSettings('build');\n\n    const DEV = (settings.mode === 'dev');\n    const TEST = (settings.mode === 'test');\n    const DIST = (settings.mode === 'dist');\n\n    const SERVER = (target === 'server');\n    const CLIENT = (target === 'client');\n\n    const COMPONENT_BUILD = !!settings.moduleBuild;\n\n    const ENV = DIST ? 'production' : 'development';\n\n    const entry = getAbsolutePath(settings.entry[target]);\n    const outputPath = getAbsolutePath(settings.outputPath[target]);\n    const componentStyle = getAbsolutePath(settings.moduleStyle);\n\n    if (DIST) {\n        buildConfig.bail = true;\n    }\n\n    /**\n    * Entry\n    */\n    if (SERVER) {\n        buildConfig.entry = {\n            [settings.outputName]: [\n                require.resolve('../../src/app/server-entry')\n            ]\n        };\n    } else if (TEST) {\n        buildConfig.entry = {};\n    } else if (CLIENT && DEV) {\n        buildConfig.entry = {\n            [settings.outputName]: [\n                `webpack-hot-middleware/client?path=${getDevPath()}__webpack_hmr`,\n                entry\n            ]\n        };\n    } else if (CLIENT) {\n        buildConfig.entry = {\n            [settings.outputName]: [\n                entry\n            ]\n        };\n    }\n\n    if (CLIENT) {\n        const makeAllPathsAbsolute = (input) => input.map((elem) => getAbsolutePath(elem));\n\n        const assets = makeAllPathsAbsolute(settings.assets);\n        buildConfig.entry[settings.outputName] = buildConfig.entry[settings.outputName].concat(assets);\n    }\n\n    /**\n    * Target\n    */\n    if (SERVER) {\n        buildConfig.target = 'node';\n    }\n\n    if (SERVER) {\n        buildConfig.externals = [\n            {\n                [resolver]: true,\n                ['roc-web/lib/helpers/config']: true\n            },\n            function(context, request, callback) {\n                const regexp = /roc-[^\\/]+\\/([^\\/]+)/;\n                const match = regexp.exec(request);\n\n                // If a roc module include it if app is the next on the path\n                // Will include for example \"roc-web/app\" & \"roc-web-react/app/server\" but not \"roc-web/lib\" & \"roc-web\"\n                if (match && match[1] === 'app') {\n                    return callback();\n                }\n\n                // If a normal node_module mark it as external\n                if (/^[a-zA-Z\\-0-9]{1}.*$/.test(request)) {\n                    return callback(null, true);\n                }\n\n                // Everything else should be included, that will be relative and absolute paths\n                callback();\n            }\n        ];\n    }\n\n    /**\n    * Devtool\n    *\n    * TODO\n    * Consider tweaking this option & handle production correct\n    * We want the source map files to be stored on a seperate server.\n    */\n    if (CLIENT && DEV) {\n        buildConfig.devtool = 'cheap-module-inline-source-map';\n    } else if (CLIENT && TEST) {\n        buildConfig.devtool = 'inline-source-map';\n    } else {\n        buildConfig.devtool = 'source-map';\n    }\n\n    /**\n    * Output\n    */\n    if (TEST) {\n        buildConfig.output = {};\n    } else {\n        buildConfig.output = {\n            path: outputPath,\n            publicPath: DIST ? addTrailingSlash(settings.path) : getDevPath(),\n            filename: (DIST && CLIENT) ? '[name].[hash].roc.js' : '[name].roc.js',\n            chunkFilename: (DIST && CLIENT) ? '[name].[hash].roc.js' : '[name].roc.js'\n        };\n    }\n\n    if (SERVER) {\n        buildConfig.output.libraryTarget = 'commonjs2';\n    }\n\n    /**\n    * Loaders\n    */\n\n    // Base\n    buildConfig.module = {\n        preLoaders: [],\n        loaders: []\n    };\n\n    // ISPARTA LOADER\n    if (TEST) {\n        buildConfig.module.loaders.push({\n            test: /\\.js$/,\n            loader: 'babel-loader',\n            // FIXME\n            include: [\n                /tests/,\n                /karma/\n            ]\n        });\n        buildConfig.module.preLoaders.push({\n            test: /\\.js$/,\n            loader: 'isparta-loader',\n            // FIXME\n            exclude: [\n                /node_modules/,\n                /tests/,\n                /karma/,\n                /src\\/vendor/\n            ]\n        });\n    }\n\n    // JS LOADER\n    const jsLoader = {\n        test: /\\.js$/,\n        loader: 'babel-loader',\n        include: function(absPath) {\n            /* This function will look at the absolute path for the current file\n             * to determine if it should be processed by babel-loader.\n             *\n             * What this does exactly is that it finds the last match of \"roc-X/SOMETHING\".\n             * If SOMETHING is \"node_modules\" it will ignore it otherwise process it using\n             * babel. Additionally if there is a match for node_modules in general after that\n             * check it will ignore that as well.\n             */\n            const regexp = /(node_modules)|(roc-[^/]*)\\/([^/]*)/g;\n            let match, matches = [];\n            while ((match = regexp.exec(absPath))) {\n                matches.push({ roc: match[0], next: match[1] });\n            }\n            const last = matches[matches.length - 1];\n            if (last && last.next !== 'node_modules') {\n                // We want to process this with babel-loader.\n                // This is something in a roc module.\n                // Would like to avoid this, see issue https://github.com/webpack/webpack/issues/1071\n                return true;\n            } else if (!last) {\n                // No match for node_modules, we will include this path.\n                return true;\n            }\n\n            // We should come here in the case that there is a node_modules in the path\n            return false;\n        }\n    };\n\n    if (!TEST) {\n        buildConfig.module.loaders.push(jsLoader);\n    }\n\n    const getScssLoader = (base = 'css-loader', modules = false) => {\n        let moduleSettings = '';\n        if (modules) {\n            moduleSettings = '&module&localIdentName=';\n\n            // Define how the class names should be defined\n            if (DIST) {\n                moduleSettings += '[hash:base64:5]';\n            } else {\n                moduleSettings += '[path]_[name]__[local]___[hash:base64:5]';\n            }\n        }\n\n        return `${base}?sourceMap?importLoaders=2${moduleSettings}` +\n        '!postcss!sass?sourceMap&' +\n        'includePaths[]=' + bourbon + '&' +\n        'includePaths[]=' + neat;\n    };\n\n    const flattenAssetsStyles = (input, regexp) => {\n        return input.reduce((prev, curr) => {\n            if (regexp.test(curr)) {\n                return prev.concat(getAbsolutePath(curr));\n            }\n            return prev;\n        }, []);\n    };\n\n    const scssStyles = flattenAssetsStyles(settings.assets, /\\.scss$|\\.css$/);\n\n    // GLOBAL STYLE LOADER\n    const globalStyleLoader = {\n        test: (absPath) => {\n            if (scssStyles.indexOf(absPath) !== -1) {\n                return true;\n            }\n        },\n        loader: ExtractTextPlugin.extract('style', getScssLoader())\n    };\n\n    // STYLE LOADER\n    const styleLoader = {\n        test: (absPath) => {\n            if (scssStyles.indexOf(absPath) === -1 && /\\.scss$|\\.css$/.test(absPath)) {\n                return true;\n            }\n        }\n    };\n\n    // JSON LOADER\n    const jsonLoader = {\n        test: /\\.json$/,\n        loader: 'json-loader'\n    };\n\n    let styleLoaders = 'css-loader';\n\n    if (SERVER) {\n        styleLoaders += '/locals';\n    }\n\n    styleLoaders = getScssLoader(styleLoaders, true);\n\n    if (CLIENT) {\n        styleLoaders = ExtractTextPlugin.extract('style', styleLoaders);\n    }\n\n    styleLoader.loader = styleLoaders;\n\n    buildConfig.module.loaders.push(styleLoader);\n\n    if (CLIENT) {\n        buildConfig.module.loaders.push(globalStyleLoader);\n    }\n\n    // Post CSS buildConfig\n    buildConfig.postcss = [\n        autoprefixer({\n            browsers: ['last 2 version']\n        })\n    ];\n\n    // FILE LOADERS\n    buildConfig.module.loaders.push({\n        test: /\\.(png|svg)$/,\n        loader: 'url-loader?limit=100000'\n    });\n\n    buildConfig.module.loaders.push({\n        test: /\\.(jpg)$/,\n        loader: 'file-loader'\n    });\n\n    buildConfig.module.loaders.push(jsonLoader);\n\n    /**\n    * Resolve\n    */\n    buildConfig.resolve = {\n        fallback: [\n            path.join(__dirname, '../../node_modules')\n        ],\n        extensions: ['', '.js', '.css', '.scss']\n    };\n\n    buildConfig.resolveLoader = {\n        root: [\n            path.join(process.cwd(), 'node_modules'),\n            path.join(__dirname, '../../node_modules')\n        ]\n    };\n\n    /**\n    * Plugins\n    */\n    buildConfig.plugins = [];\n\n    if (CLIENT) {\n        buildConfig.plugins.push(\n            new builder.IgnorePlugin(/^config$/)\n        );\n    }\n\n    const styleName = COMPONENT_BUILD ? '[name].component.css' : '[name].[hash].css';\n\n    buildConfig.plugins.push(\n        new ExtractTextPlugin(styleName, {\n            disable: CLIENT && DEV\n        })\n    );\n\n    buildConfig.plugins.push(\n        // process.env.NODE_ENV is used by React and some other libs to determine what to run\n        new builder.DefinePlugin({\n            'process.env.NODE_ENV': JSON.stringify(ENV),\n            '__DEV__': DEV,\n            '__TEST__': TEST,\n            '__DIST__': DIST,\n            '__SERVER__': SERVER,\n            '__CLIENT__': CLIENT,\n            'ROC_SERVER_ENTRY': JSON.stringify(entry),\n            'ROC_PATH_RESOLVER': JSON.stringify(resolver),\n            // We need to do this since it effects the build\n            'ROC_PATH': JSON.stringify(removeTrailingSlash(settings.path))\n        })\n    );\n\n    if (DIST) {\n        buildConfig.plugins.push(function() {\n            this.plugin('done', writeStats);\n        });\n    }\n\n    if (DEV && CLIENT) {\n        buildConfig.plugins.push(\n            new builder.optimize.OccurenceOrderPlugin(),\n            new builder.HotModuleReplacementPlugin(),\n            new builder.NoErrorsPlugin()\n        );\n    }\n\n    if (DEV && SERVER) {\n        buildConfig.plugins.push(\n            new builder.NoErrorsPlugin()\n        );\n    }\n\n    if (DIST) {\n        buildConfig.plugins.push(\n            new builder.optimize.DedupePlugin(),\n            new builder.optimize.OccurenceOrderPlugin()\n        );\n    }\n\n    if (DIST && CLIENT) {\n        buildConfig.plugins.push(\n            new builder.optimize.UglifyJsPlugin({\n                /* eslint-disable */\n                compress: {\n                    warnings: false,\n                    screw_ie8: true,\n                    drop_debugger: true\n                }\n                /* eslint-enable */\n            })\n        );\n    }\n\n    if (COMPONENT_BUILD) {\n        buildConfig.output.libraryTarget = 'umd';\n        buildConfig.output.filename = '[name].component.js';\n        buildConfig.entry = {\n            app: [\n                require.resolve('../../component/entry')\n            ]\n        };\n\n        buildConfig.plugins.push(\n            new builder.DefinePlugin({\n                COMPONENT_ENTRY: JSON.stringify(entry),\n                COMPONENT_STYLE: JSON.stringify(componentStyle)\n            })\n        );\n    }\n\n    // TODO Refactor this into a common helper\n    const fileExists = (filepath) => {\n        filepath = getAbsolutePath(filepath);\n        try {\n            return fs.statSync(filepath).isFile();\n        } catch (error) {\n            return false;\n        }\n    };\n\n    const hasMiddlewares = !!(settings.koaMiddlewares && fileExists(settings.koaMiddlewares));\n\n    if (hasMiddlewares) {\n        const middlewares = getAbsolutePath(settings.koaMiddlewares);\n\n        buildConfig.plugins.push(\n            new builder.DefinePlugin({\n                KOA_MIDDLEWARES: JSON.stringify(middlewares)\n            })\n        );\n    }\n\n    buildConfig.plugins.push(\n        new builder.DefinePlugin({\n            USE_DEFAULT_KOA_MIDDLEWARES: settings.useDefaultKoaMiddlewares,\n            HAS_KOA_MIDDLEWARES: hasMiddlewares\n        })\n    );\n\n    return {\n        buildConfig,\n        builder\n    };\n}\n"
  },
  {
    "__docId__": 10,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "bourbon",
    "memberof": "src/roc/builder/index.js",
    "longname": "src/roc/builder/index.js~bourbon",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/builder/index.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 12,
    "undocument": true,
    "type": {
      "types": [
        "string"
      ]
    }
  },
  {
    "__docId__": 11,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "neat",
    "memberof": "src/roc/builder/index.js",
    "longname": "src/roc/builder/index.js~neat",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/builder/index.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 13,
    "undocument": true,
    "type": {
      "types": [
        "string"
      ]
    }
  },
  {
    "__docId__": 12,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "createBuilder",
    "memberof": "src/roc/builder/index.js",
    "longname": "src/roc/builder/index.js~createBuilder",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/builder/index.js",
    "importStyle": "createBuilder",
    "description": "Creates a builder.",
    "lineNumber": 24,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{rocBuilder}"
      }
    ],
    "params": [
      {
        "nullable": false,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "target",
        "description": "a target: should be either \"client\" or \"server\""
      },
      {
        "nullable": null,
        "types": [
          "rocBuilder"
        ],
        "spread": false,
        "optional": false,
        "name": "rocBuilder",
        "description": "A rocBuilder to base everything on."
      },
      {
        "nullable": false,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "roc-web/lib/helpers/get-resolve-path",
        "defaultRaw": "roc-web/lib/helpers/get-resolve-path",
        "name": "resolver",
        "description": "Path to the resolver for the server side\n{@link getResolvePath}"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "rocBuilder"
      ],
      "spread": false,
      "description": ""
    },
    "generator": false
  },
  {
    "__docId__": 13,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/builder/utils/clean.js",
    "memberof": null,
    "longname": "src/roc/builder/utils/clean.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport rimraf from 'rimraf';\n\nimport { getAbsolutePath } from 'roc';\n\n/**\n * Cleans a directory\n *\n * @param {string} path - A directory that should be cleaned\n * @returns {Promise} A promise that either resolves when done or rejects if there is an error\n */\nexport default function clean(path) {\n    return new Promise((resolve, reject) => {\n        rimraf(getAbsolutePath(path), (err) => {\n            if (err) {\n                return reject(err);\n            }\n\n            return resolve();\n        });\n    });\n}\n"
  },
  {
    "__docId__": 14,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "clean",
    "memberof": "src/roc/builder/utils/clean.js",
    "longname": "src/roc/builder/utils/clean.js~clean",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/builder/utils/clean.js",
    "importStyle": "clean",
    "description": "Cleans a directory",
    "lineNumber": 13,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{Promise} A promise that either resolves when done or rejects if there is an error"
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "path",
        "description": "A directory that should be cleaned"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise"
      ],
      "spread": false,
      "description": "A promise that either resolves when done or rejects if there is an error"
    },
    "generator": false
  },
  {
    "__docId__": 15,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/builder/utils/stats.js",
    "memberof": null,
    "longname": "src/roc/builder/utils/stats.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport fs from 'fs';\nimport path from 'path';\n\n/**\n * A Webpack plugin that writes stats after a completed build.\n *\n * Will create two files:\n *  * `webpack-stats.json` - Containes what files that was created for CSS and JS.\n *  * `webpack-analysis.json` - Containes all stats from the Webpack build. Analyse with webpack.github.io/analyse\n * @param {!object} stats - Webpack stats object.\n * @private\n */\nexport function writeStats(stats) {\n    const publicPath = this.options.output.publicPath;\n    const statsFilepath = path.join(this.options.output.path, 'webpack-stats.json');\n    const analysisFilepath = path.join(this.options.output.path, 'webpack-analysis.json');\n\n    const json = stats.toJson();\n\n    const content = parseStats(json, publicPath);\n\n    fs.writeFileSync(statsFilepath, JSON.stringify(content));\n    fs.writeFileSync(analysisFilepath, JSON.stringify(json));\n}\n\n/**\n * A parser for stats that find all JS and CSS files\n *\n * @param {!object} stats - Webpack stats object as JSON.\n * @param {string} publicPath - A path that the files should be prefixed with\n * @returns {object} A object with keys for 'script' and 'css'\n * @private\n */\nexport function parseStats(stats, publicPath = '') {\n    // get chunks by name and extensions\n    const getChunks = (name, ext = 'js') => {\n        let chunk = stats.assetsByChunkName[name];\n\n        // a chunk could be a string or an array, so make sure it is an array\n        if (!(Array.isArray(chunk))) {\n            chunk = [chunk];\n        }\n\n        return chunk\n            .filter((chunkName) => path.extname(chunkName) === `.${ext}`)\n            .map((chunkName) => publicPath + chunkName);\n    };\n\n    const script = getChunks('app', 'js');\n    const css = getChunks('app', 'css');\n\n    return {\n        script,\n        css\n    };\n}\n"
  },
  {
    "__docId__": 16,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "writeStats",
    "memberof": "src/roc/builder/utils/stats.js",
    "longname": "src/roc/builder/utils/stats.js~writeStats",
    "access": "private",
    "export": true,
    "importPath": "roc-web/lib/builder/utils/stats.js",
    "importStyle": "{writeStats}",
    "description": "A Webpack plugin that writes stats after a completed build.\n\nWill create two files:\n * `webpack-stats.json` - Containes what files that was created for CSS and JS.\n * `webpack-analysis.json` - Containes all stats from the Webpack build. Analyse with webpack.github.io/analyse",
    "lineNumber": 15,
    "params": [
      {
        "nullable": false,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "stats",
        "description": "Webpack stats object."
      }
    ],
    "generator": false
  },
  {
    "__docId__": 17,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "parseStats",
    "memberof": "src/roc/builder/utils/stats.js",
    "longname": "src/roc/builder/utils/stats.js~parseStats",
    "access": "private",
    "export": true,
    "importPath": "roc-web/lib/builder/utils/stats.js",
    "importStyle": "{parseStats}",
    "description": "A parser for stats that find all JS and CSS files",
    "lineNumber": 36,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{object} A object with keys for 'script' and 'css'"
      }
    ],
    "params": [
      {
        "nullable": false,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "stats",
        "description": "Webpack stats object as JSON."
      },
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "publicPath",
        "description": "A path that the files should be prefixed with"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "object"
      ],
      "spread": false,
      "description": "A object with keys for 'script' and 'css'"
    },
    "generator": false
  },
  {
    "__docId__": 18,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/commands/build.js",
    "memberof": null,
    "longname": "src/roc/commands/build.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "/* eslint-disable no-console */\n\nimport 'source-map-support/register';\n\nimport MultiProgress from 'multi-progress';\nimport pretty from 'prettysize';\nimport colors from 'colors/safe';\n\nimport clean from '../builder/utils/clean';\nimport { getBuilder } from '../helpers/plugin-managment';\n\nconst multi = new MultiProgress();\n\nconst handleCompletion = (results) => {\n    console.log(colors.green('\\nBuild completed!\\n'));\n\n    for (const result of results) {\n        if (result) {\n            const { stats, target } = result;\n            const { time, assets } = stats.toJson({assets: true});\n            console.log(colors.bold(target) + ` ${time} ms`);\n            for (const asset of assets) {\n                console.log(`${asset.name} ${pretty(asset.size)}`);\n            }\n            console.log();\n        }\n    }\n};\n\nconst handleError = (debug) => (error) => {\n    const errorMessage = error.target ? ' for ' + colors.bold(error.target) : '';\n\n    console.log(colors.red(`\\n\\nBuild failed${errorMessage}\\n`));\n\n    console.log(colors.red(error.message));\n\n    if (debug) {\n        console.log(error.stack);\n    } else {\n        console.log('\\nRun with debug for more output.\\n');\n    }\n    /* eslint-disable no-process-exit */\n    // Make sure we do not continue trying to build other targets since we need everything to complete\n    process.exit(1);\n    /* eslint-enable */\n};\n\nconst build = ({ buildConfig, builder }, target, config, debug) => {\n    return new Promise((resolve, reject) => {\n        clean(config.build.outputPath[target])\n            .then(() => {\n                const compiler = builder(buildConfig);\n\n                if (!config.build.disableProgressbar) {\n                    const bar = multi.newBar(`Building ${target} [:bar] :percent :elapsed s :webpackInfo`, {\n                        complete: '=',\n                        incomplete: ' ',\n                        total: 100,\n                        // Some \"magic\" math to make sure that the progress bar fits in the terminal window\n                        // Based on the lenght of various strings used in the output\n                        width: (process.stdout.columns - 52)\n                    });\n\n                    compiler.apply(new builder.ProgressPlugin(function(percentage, msg) {\n                        bar.update(percentage, {\n                            // Only use 20 characters for output to make sure it fits in the window\n                            webpackInfo: msg.substring(0, 20)\n                        });\n                    }));\n                }\n\n                compiler.run((error, stats) => {\n                    if (error) {\n                        // Extend the error with what target that failed\n                        error.target = target;\n                        return reject(error);\n                    }\n\n                    // FIXME Handle this better\n                    const options = debug ? null : {errorDetails: false};\n                    const statsJson = stats.toJson(options);\n                    if (statsJson.errors.length > 0) {\n                        statsJson.errors.map(err => console.log(err));\n                    }\n\n                    if (statsJson.warnings.length > 0) {\n                        statsJson.warnings.map(wrn => console.log(wrn));\n                    }\n\n                    return resolve({stats, target});\n                });\n            })\n        .catch(err => console.log(err, err.stack));\n    });\n};\n\n/**\n * Build runner.\n *\n * Helper for building an application.\n *\n * @param {object} rocCommandObject - A command object\n * @returns {Promise} A promise that will be resolved when the build is completed\n */\nexport default function runBuild({\n    debug,\n    configObject: { settings, plugins },\n    extensionConfig: { plugins: extensionPlugins }\n}) {\n    if (!plugins || !plugins.createBuilder) {\n        throw new Error('No createBuilder defined in plugins in roc.config.js!');\n    }\n\n    /* eslint-disable no-console */\n    console.log(colors.cyan(`Starting the builder using \"${settings.build.mode}\" as the mode.\\n`));\n    /* eslint-enable */\n\n    const promises = settings.build.target.map((target) => {\n        const builder = getBuilder(debug, target, plugins.createBuilder, extensionPlugins.createBuilder);\n        return build(builder, target, settings, debug);\n    });\n\n    return Promise.all(promises)\n        .then(handleCompletion)\n        .catch(handleError(debug));\n}\n"
  },
  {
    "__docId__": 19,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "multi",
    "memberof": "src/roc/commands/build.js",
    "longname": "src/roc/commands/build.js~multi",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/build.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 12,
    "undocument": true,
    "type": {
      "types": [
        "multi-progress~MultiProgress"
      ]
    }
  },
  {
    "__docId__": 20,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "handleCompletion",
    "memberof": "src/roc/commands/build.js",
    "longname": "src/roc/commands/build.js~handleCompletion",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/build.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 14,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 21,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "handleError",
    "memberof": "src/roc/commands/build.js",
    "longname": "src/roc/commands/build.js~handleError",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/build.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 30,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 22,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "build",
    "memberof": "src/roc/commands/build.js",
    "longname": "src/roc/commands/build.js~build",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/build.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 48,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 23,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "runBuild",
    "memberof": "src/roc/commands/build.js",
    "longname": "src/roc/commands/build.js~runBuild",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/commands/build.js",
    "importStyle": "runBuild",
    "description": "Build runner.\n\nHelper for building an application.",
    "lineNumber": 105,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{Promise} A promise that will be resolved when the build is completed"
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "rocCommandObject",
        "description": "A command object"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise"
      ],
      "spread": false,
      "description": "A promise that will be resolved when the build is completed"
    },
    "generator": false
  },
  {
    "__docId__": 24,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/commands/dev.js",
    "memberof": null,
    "longname": "src/roc/commands/dev.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport fs from 'fs';\nimport path from 'path';\nimport colors from 'colors/safe';\nimport mkdirp from 'mkdirp';\n\nimport { getSettings, appendSettings } from 'roc';\n\nimport clean from '../builder/utils/clean';\nimport { baseConfig } from '../helpers/config';\nimport { getBuilder } from '../helpers/plugin-managment';\n\nimport watchClient from '../runtime/watch-client';\nimport watchServer from '../runtime/watch-server';\n\nconst writeStatsFile = (buildPath, scriptPath) => {\n    fs.stat(buildPath, (err) => {\n        if (err) {\n            mkdirp.sync(buildPath);\n        }\n\n        fs.writeFileSync(path.join(buildPath, 'webpack-stats.json'), JSON.stringify({\n            script: [`${scriptPath}`],\n            css: ''\n        }));\n    });\n};\n\nconst startWatcher = (target, compiler, buildConfig, watcher, outputName) => {\n    if (target === 'client') {\n        writeStatsFile(buildConfig.output.path, buildConfig.output.publicPath + outputName + '.roc.js');\n    }\n\n    return watcher[target](compiler);\n};\n\nconst createWatcher = (debug, settings, target, { buildConfig, builder }, watcher) => {\n    return clean(settings.build.outputPath[target])\n        .then(() => {\n            const compiler = builder(buildConfig);\n            return startWatcher(target, compiler, buildConfig, watcher, settings.build.outputName);\n        })\n        .catch((error) => {\n            /* eslint-disable no-console */\n            console.log(colors.red('\\nWatch failed!\\n'));\n            console.log(`A error occoured while starting the ${target} watcher`);\n            console.log(error.stack);\n            /* eslint-enable */\n        });\n};\n\n/**\n * Development runner.\n *\n * Helper for starting an application in watch mode.\n *\n * @param {object} rocCommandObject - A command object\n */\nexport default function runDev({\n    debug,\n    configObject: { settings, plugins },\n    extensionConfig: { plugins: extensionPlugins }\n}) {\n    if (!plugins || !plugins.createBuilder) {\n        throw new Error('No createBuilder defined in plugins in roc.config.js!');\n    }\n\n    const watcher = {\n        client: watchClient,\n        server: watchServer\n    };\n\n    // Make sure that we are in dev mode\n    if (settings.build.mode !== 'dev') {\n        if (settings.build.mode && settings.build.mode !== baseConfig.settings.build.mode) {\n            /* eslint-disable no-console */\n            console.log(colors.yellow(`The mode in the configuration was ${settings.build.mode} but it needs ` +\n                `to be \"dev\". It has been automatically set to \"dev\" during this watch run.`));\n            /* eslint-enable */\n        }\n\n        appendSettings({build: {mode: 'dev'}});\n        settings = getSettings();\n    }\n\n    // If the targets are both client and server we make sure the client is completed before continuing with the server\n    if (settings.build.target.indexOf('client') > -1 && settings.build.target.indexOf('server') > -1) {\n        const clientBuilder = getBuilder(debug, 'client', plugins.createBuilder, extensionPlugins.createBuilder);\n        createWatcher(debug, settings, 'client', clientBuilder, watcher).then(() => {\n            const serverBuilder = getBuilder(debug, 'server', plugins.createBuilder, extensionPlugins.createBuilder);\n            createWatcher(debug, settings, 'server', serverBuilder, watcher);\n        });\n    } else {\n        settings.build.target.map((target) => {\n            const builder = getBuilder(debug, target, plugins.createBuilder, extensionPlugins.createBuilder);\n            createWatcher(debug, settings, target, builder, watcher);\n        });\n    }\n}\n"
  },
  {
    "__docId__": 25,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "writeStatsFile",
    "memberof": "src/roc/commands/dev.js",
    "longname": "src/roc/commands/dev.js~writeStatsFile",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/dev.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 17,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 26,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "startWatcher",
    "memberof": "src/roc/commands/dev.js",
    "longname": "src/roc/commands/dev.js~startWatcher",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/dev.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 30,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 27,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "createWatcher",
    "memberof": "src/roc/commands/dev.js",
    "longname": "src/roc/commands/dev.js~createWatcher",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/commands/dev.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 38,
    "undocument": true,
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 28,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "runDev",
    "memberof": "src/roc/commands/dev.js",
    "longname": "src/roc/commands/dev.js~runDev",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/commands/dev.js",
    "importStyle": "runDev",
    "description": "Development runner.\n\nHelper for starting an application in watch mode.",
    "lineNumber": 60,
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "rocCommandObject",
        "description": "A command object"
      }
    ],
    "generator": false
  },
  {
    "__docId__": 29,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/commands/index.js",
    "memberof": null,
    "longname": "src/roc/commands/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport { generateTextDocumentation, generateMarkdownDocumentation } from 'roc';\n\nexport build from './build';\nexport dev from './dev';\nexport start from './start';\n\n/**\n * List the settings that are possible with the current extensions.\n *\n * @param {object} rocCommandObject - A command object\n */\nexport function listSettings({ metaObject, extensionConfig }) {\n    console.log(generateTextDocumentation(extensionConfig, metaObject));\n}\n\n/**\n * List the settings that are possible with the current extensions in a markdown format.\n *\n * @param {object} rocCommandObject - A command object\n */\nexport function markdownSettings({ metaObject, extensionConfig }) {\n    console.log(generateMarkdownDocumentation(extensionConfig, metaObject));\n}\n"
  },
  {
    "__docId__": 30,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "listSettings",
    "memberof": "src/roc/commands/index.js",
    "longname": "src/roc/commands/index.js~listSettings",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/commands/index.js",
    "importStyle": "{listSettings}",
    "description": "List the settings that are possible with the current extensions.",
    "lineNumber": 14,
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "rocCommandObject",
        "description": "A command object"
      }
    ],
    "generator": false
  },
  {
    "__docId__": 31,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "markdownSettings",
    "memberof": "src/roc/commands/index.js",
    "longname": "src/roc/commands/index.js~markdownSettings",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/commands/index.js",
    "importStyle": "{markdownSettings}",
    "description": "List the settings that are possible with the current extensions in a markdown format.",
    "lineNumber": 23,
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "rocCommandObject",
        "description": "A command object"
      }
    ],
    "generator": false
  },
  {
    "__docId__": 32,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/commands/start.js",
    "memberof": null,
    "longname": "src/roc/commands/start.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport path from 'path';\nimport debug from 'debug';\n\n/**\n * Starts a Roc application.\n *\n * @param {object} rocCommandObject - A command object\n */\nexport default function start({ configObject: { settings }, parsedOptions }) {\n    debug.enable(settings.dev.debug);\n\n    const artifact = parsedOptions.options.artifact ||\n        settings.runtime.startBundle && path.join(process.cwd(), settings.runtime.startBundle) ||\n        path.join(process.cwd(), settings.build.outputPath.server, `${settings.build.outputName}.roc.js`);\n\n    debug('roc:start')(`Starting Roc application…`);\n    require(artifact);\n}\n"
  },
  {
    "__docId__": 33,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "start",
    "memberof": "src/roc/commands/start.js",
    "longname": "src/roc/commands/start.js~start",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/commands/start.js",
    "importStyle": "start",
    "description": "Starts a Roc application.",
    "lineNumber": 11,
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "rocCommandObject",
        "description": "A command object"
      }
    ],
    "generator": false
  },
  {
    "__docId__": 34,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/config/roc.config.js",
    "memberof": null,
    "longname": "src/roc/config/roc.config.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport createBuilder from '../builder';\nimport {\n    build,\n    start,\n    dev,\n    listSettings,\n    markdownSettings\n} from '../commands';\n\nconst config = {\n    settings: {\n        runtime: {\n            port: 3000,\n            https: {\n                port: '',\n                key: '',\n                cert: ''\n            },\n            debug: {\n                server: 'roc:*'\n            },\n            serve: [\n                'build/client'\n            ],\n            favicon: '',\n            startBundle: '',\n            koa: {\n                lowercase: {\n                    enabled: true,\n                    defer: true\n                },\n                normalize: {\n                    enabled: true,\n                    defer: false\n                },\n                trailingSlashes: {\n                    enabled: true,\n                    defer: true\n                }\n            }\n        },\n\n        dev: {\n            debug: 'roc:*',\n            port: 3001,\n            watch: [\n                'config/',\n                'roc.config.js'\n            ],\n            reloadOnServerChange: false,\n            open: false,\n            devMiddleware: {\n                noInfo: true,\n                quiet: false\n            },\n            hotMiddleware: {\n                reload: false,\n                noInfo: false,\n                quiet: false\n            }\n        },\n\n        build: {\n            path: '/',\n            assets: [],\n            mode: 'dist',\n            target: ['client', 'server'],\n            disableProgressbar: false,\n            entry: { client: 'src/client/index.js', server: 'src/server/index.js'},\n            outputName: 'app',\n            outputPath: { client: 'build/client', server: 'build/server'},\n            moduleBuild: false,\n            moduleStyle: '',\n            koaMiddlewares: 'koa-middlewares.js',\n            useDefaultKoaMiddlewares: true\n        }\n    },\n\n    commands: {\n        build,\n        start,\n        dev,\n        'list-settings': listSettings,\n        'markdown-settings': markdownSettings\n    },\n\n    plugins: {\n        createBuilder: {\n            default: createBuilder\n        }\n    },\n\n    extensions: []\n};\n\n/**\n * Exports the default `roc.config.js`.\n *\n * @return {object} The default `roc.config.js`.\n */\nexport default config;\n"
  },
  {
    "__docId__": 35,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "config",
    "memberof": "src/roc/config/roc.config.js",
    "longname": "src/roc/config/roc.config.js~config",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/config/roc.config.js",
    "importStyle": "config",
    "description": "Exports the default `roc.config.js`.",
    "lineNumber": 12,
    "return": {
      "nullable": null,
      "types": [
        "object"
      ],
      "spread": false,
      "description": "The default `roc.config.js`."
    },
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 36,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/config/roc.config.meta.js",
    "memberof": null,
    "longname": "src/roc/config/roc.config.meta.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport {\n    isInteger,\n    isString,\n    isBoolean,\n    isPath,\n    isArray,\n    isArrayOrSingle\n} from 'roc/validators';\n\nconst configMeta = {\n    settings: {\n        groups: {\n            runtime: {\n                koa: 'Settings for how Koa should handle paths'\n            }\n        },\n        descriptions: {\n            runtime: {\n                port: 'Port for the server to use for HTTP.',\n                https: {\n                    port: 'Port for the server to use for HTTPS. If none is defined it will not launch in HTTPS.',\n                    key: 'The key file to use when using HTTPS. If none is provided and if running in dev a file ' +\n                        'will be provided automatically.',\n                    cert: 'The certificate file to use when using HTTPS. If none is provided and if running in dev a ' +\n                        'file will be provided automatically.'\n                },\n                debug: {\n                    server: 'Filter for debug messages that should be shown for the server, see ' +\n                        'https://npmjs.com/package/debug'\n                },\n                serve: 'What folder the server should expose',\n                favicon: 'Path to the favicon file, specially handled on the server',\n                startBundle: 'Relative path to a bundle to start when calling \"start\", is not needed in most cases',\n                koa: {\n                    lowercase: {\n                        enabled: 'If paths should be transformed to lowercase',\n                        defer: 'If this should be performed after looking for a file on disk'\n                    },\n                    normalize: {\n                        enabled: 'If paths should be normalized, that is remove extra slashes',\n                        defer: 'If this should be performed after looking for a file on disk'\n                    },\n                    trailingSlashes: {\n                        enabled: 'Set to true to enforce trailing slashes, false to remove them and null for no rule',\n                        defer: 'If this should be performed after looking for a file on disk'\n                    }\n                }\n            },\n\n            dev: {\n                debug: 'Filter for debug messages that should be shown for the server, see ' +\n                    'https://npmjs.com/package/debug',\n                port: 'Port for the dev server, will need to be a free range of at least 3',\n                watch: 'Files/folders that should trigger a restart of the server',\n                reloadOnServerChange: 'If Browsersync should reload the browser when the server is rebuilt',\n                open: 'If Browsersync should open the server when it has started',\n                devMiddleware: {\n                    noInfo: 'If no info should be sent to the console',\n                    quiet: 'If nothing should be sent to the console'\n                },\n                hotMiddleware: {\n                    reload: 'If the browser should be reloaded if it fails to hot update the code',\n                    noInfo: 'If no info should be sent to the console',\n                    quiet: 'If nothing should be sent to the console'\n                }\n            },\n\n            build: {\n                path: 'The basepath for the application',\n                assets: 'An array of files to include into the build process',\n                verbose: 'If verbose mode should be used, returns more output during build',\n                mode: 'What mode the application should be built for. Possible values are \"dev\", \"dist\" and \"test\"',\n                target: 'For what target the application should be built for. Possible values are \"client\" & \"server\"',\n                disableProgressbar: 'Should the progress bar be disabled for builds',\n                entry: {\n                    client: 'The client entry point file',\n                    server: 'The server entry point file'\n                },\n                outputName: 'The name of the generated application bundle, will be appended \"roc.js\"',\n                outputPath: {\n                    client: 'The output directory for the client build',\n                    server: 'The output directory for the server build'\n                },\n                moduleBuild: 'NOT IMPLEMENTED YET',\n                moduleStyle: 'NOT IMPLEMENTED YET',\n                koaMiddlewares: 'The koa middlewares to add to the server instance, will be added after the default ' +\n                    ' middlewares',\n                useDefaultKoaMiddlewares: 'If Roc should use internally defined koa middlewares, please look at the ' +\n                    ' documentation for what middlewares that are included'\n            }\n        },\n\n        validations: {\n            runtime: {\n                port: isInteger,\n                https: {\n                    key: isPath,\n                    cert: isPath\n                },\n                debug: {\n                    server: isString\n                },\n                serve: isArrayOrSingle(isPath),\n                favicon: isString,\n                startBundle: isPath,\n                koa: {\n                    lowercase: {\n                        enabled: isBoolean,\n                        defer: isBoolean\n                    },\n                    normalize: {\n                        enabled: isBoolean,\n                        defer: isBoolean\n                    },\n                    trailingSlashes: {\n                        enabled: isBoolean,\n                        defer: isBoolean\n                    }\n                }\n            },\n\n            dev: {\n                debug: isString,\n                port: isInteger,\n                watch: isArrayOrSingle(isPath),\n                reloadOnServerChange: isBoolean,\n                open: isBoolean,\n                devMiddleware: {\n                    noInfo: isBoolean,\n                    quiet: isBoolean\n                },\n                hotMiddleware: {\n                    reload: isBoolean,\n                    noInfo: isBoolean,\n                    quiet: isBoolean\n                }\n            },\n\n            build: {\n                path: isPath,\n                assets: isArray(isPath),\n                mode: /^dev|dist|test$/i,\n                target: isArray(/^client|server$/i),\n                disableProgressbar: isBoolean,\n                entry: {\n                    client: isPath,\n                    server: isPath\n                },\n                outputName: isString,\n                outputPath: {\n                    client: isPath,\n                    server: isPath\n                },\n                koaMiddlewares: isPath,\n                useDefaultKoaMiddlewares: isBoolean\n            }\n        }\n    },\n\n    commands: {\n        'build': {\n            settings: ['build'],\n            description: 'Build the current project.'\n        },\n        'start': {\n            settings: ['runtime'],\n            description: 'Starts the current project.',\n            options: [{\n                name: 'artifact',\n                validation: isPath\n            }]\n        },\n        'dev': {\n            settings: true,\n            description: 'Starts the current project in dev mode.'\n        },\n        'list-settings': {\n            description: 'Prints all the available settings can be changed.'\n        },\n        'markdown-settings': {\n            description: 'Prints all the available settings can be changed in a markdown format.'\n        }\n    },\n\n    plugins: {\n        createBuilder: 'Used to define and extend the internal builder. See documentation for more information.'\n    }\n};\n\n/**\n * Exports the `roc.config.meta.js`.\n *\n * @return {object} The `roc.config.meta.js`.\n */\nexport default configMeta;\n"
  },
  {
    "__docId__": 37,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "configMeta",
    "memberof": "src/roc/config/roc.config.meta.js",
    "longname": "src/roc/config/roc.config.meta.js~configMeta",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/config/roc.config.meta.js",
    "importStyle": "configMeta",
    "description": "Exports the `roc.config.meta.js`.",
    "lineNumber": 12,
    "return": {
      "nullable": null,
      "types": [
        "object"
      ],
      "spread": false,
      "description": "The `roc.config.meta.js`."
    },
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 38,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/helpers/config.js",
    "memberof": null,
    "longname": "src/roc/helpers/config.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\n/**\n * Gives the base configuration.\n *\n * @returns {object} Returns the base configuration\n */\nexport const baseConfig = require('../config/roc.config.js');\n\n/**\n * Gives the meta configuration.\n *\n * @returns {object} Returns the meta configuration\n */\nexport const metaConfig = require('../config/roc.config.meta.js');\n"
  },
  {
    "__docId__": 39,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "baseConfig",
    "memberof": "src/roc/helpers/config.js",
    "longname": "src/roc/helpers/config.js~baseConfig",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/config.js",
    "importStyle": "{baseConfig}",
    "description": "Gives the base configuration.",
    "lineNumber": 8,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{object} Returns the base configuration"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "object"
      ],
      "spread": false,
      "description": "Returns the base configuration"
    },
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 40,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "metaConfig",
    "memberof": "src/roc/helpers/config.js",
    "longname": "src/roc/helpers/config.js~metaConfig",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/config.js",
    "importStyle": "{metaConfig}",
    "description": "Gives the meta configuration.",
    "lineNumber": 15,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{object} Returns the meta configuration"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "object"
      ],
      "spread": false,
      "description": "Returns the meta configuration"
    },
    "type": {
      "types": [
        "*"
      ]
    }
  },
  {
    "__docId__": 41,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/helpers/general.js",
    "memberof": null,
    "longname": "src/roc/helpers/general.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport devip from 'dev-ip';\nimport colors from 'colors/safe';\n\nimport { getSettings } from 'roc';\n\nimport { baseConfig } from './config';\n\nlet oncePort = true;\nlet onceDevPort = true;\n\n/**\n * Returns the current dev path.\n *\n * Will use {@link getDevPort} for getting the port.\n *\n * @param {string} [relativeBuildPath] - Relative path to where the build is saved.\n * @returns {string} The complete dev path on the server including the port.\n */\nexport function getDevPath(relativeBuildPath = '') {\n    const devIp = devip() ? devip()[0] : 'localhost';\n    const buildPath = relativeBuildPath && relativeBuildPath.slice(-1) !== '/' ?\n        relativeBuildPath + '/' :\n        relativeBuildPath;\n\n    return `http://${devIp}:${getDevPort()}/${buildPath}`;\n}\n\n/**\n * Returns the current dev port.\n *\n *It will first default to the environment variable `DEV_PORT` and after that `roc.config.js`.\n *\n * Will give a warning if `DEV_PORT` is defined and the value in the configuration is something other than default.\n *\n * @returns {number} The final port for the dev server.\n */\nexport function getDevPort() {\n    const settings = getSettings('dev');\n\n    if (settings.port !== baseConfig.settings.dev.port && process.env.DEV_PORT && onceDevPort) {\n        onceDevPort = false;\n        /* eslint-disable no-console */\n        console.log(colors.red('You have configured a dev port but the environment ' +\n            'variable DEV_PORT is set and that will be used instead. The port that will be used is ' +\n            process.env.DEV_PORT\n        ));\n        /* eslint-enable */\n    }\n    return process.env.DEV_PORT || settings.port;\n}\n\n/**\n* Returns the current port.\n*\n* It will first default to the environment variable `PORT` and after that `roc.config.js`.\n*\n* Will give a warning if `PORT` is defined and the value in the configuration is something other than default.\n*\n* @returns {number} The final port for the server.\n*/\nexport function getPort() {\n    const settings = getSettings('runtime');\n\n    if (settings.port && process.env.PORT && oncePort) {\n        oncePort = false;\n        /* eslint-disable no-console */\n        console.log(colors.red('You have configured a port but the environment ' +\n            'variable PORT is set and that will be used instead. The port that will be used is ' +\n            process.env.PORT\n        ));\n        /* eslint-enable */\n    }\n\n    return process.env.PORT || settings.port;\n}\n\n/**\n* Removes possible trailing slashes from a path.\n*\n* @param {string} path - Path to remove possible trailing slashes.\n*\n* @returns {string} - Path without trailing slashes.\n*/\nexport function removeTrailingSlash(path) {\n    const newPath = path.replace(/\\/+$/, '');\n\n    if (!newPath) {\n        return '/';\n    }\n\n    return newPath;\n}\n\n/**\n* Adds a trailing slashes to a path.\n*\n* Runs {@link removeTrailingSlash} internally first.\n*\n* @param {string} path - Path to add a trailing slashes to.\n*\n* @returns {string} - Path with trailing slash.\n*/\nexport function addTrailingSlash(path) {\n    const newPath = removeTrailingSlash(path);\n\n    if (newPath !== '/') {\n        return newPath + '/';\n    }\n\n    return newPath;\n}\n"
  },
  {
    "__docId__": 42,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "oncePort",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~oncePort",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 10,
    "undocument": true,
    "type": {
      "types": [
        "boolean"
      ]
    }
  },
  {
    "__docId__": 43,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "onceDevPort",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~onceDevPort",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 11,
    "undocument": true,
    "type": {
      "types": [
        "boolean"
      ]
    }
  },
  {
    "__docId__": 44,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getDevPath",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~getDevPath",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": "{getDevPath}",
    "description": "Returns the current dev path.\n\nWill use {@link getDevPort} for getting the port.",
    "lineNumber": 21,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{string} The complete dev path on the server including the port."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": true,
        "name": "relativeBuildPath",
        "description": "Relative path to where the build is saved."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "string"
      ],
      "spread": false,
      "description": "The complete dev path on the server including the port."
    },
    "generator": false
  },
  {
    "__docId__": 45,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getDevPort",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~getDevPort",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": "{getDevPort}",
    "description": "Returns the current dev port.\n\nIt will first default to the environment variable `DEV_PORT` and after that `roc.config.js`.\n\nWill give a warning if `DEV_PORT` is defined and the value in the configuration is something other than default.",
    "lineNumber": 39,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{number} The final port for the dev server."
      }
    ],
    "params": [],
    "return": {
      "nullable": null,
      "types": [
        "number"
      ],
      "spread": false,
      "description": "The final port for the dev server."
    },
    "generator": false
  },
  {
    "__docId__": 46,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getPort",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~getPort",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": "{getPort}",
    "description": "Returns the current port.\n\nIt will first default to the environment variable `PORT` and after that `roc.config.js`.\n\nWill give a warning if `PORT` is defined and the value in the configuration is something other than default.",
    "lineNumber": 63,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{number} The final port for the server."
      }
    ],
    "params": [],
    "return": {
      "nullable": null,
      "types": [
        "number"
      ],
      "spread": false,
      "description": "The final port for the server."
    },
    "generator": false
  },
  {
    "__docId__": 47,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "removeTrailingSlash",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~removeTrailingSlash",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": "{removeTrailingSlash}",
    "description": "Removes possible trailing slashes from a path.",
    "lineNumber": 86,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{string} - Path without trailing slashes."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "path",
        "description": "Path to remove possible trailing slashes."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "string"
      ],
      "spread": false,
      "description": "Path without trailing slashes."
    },
    "generator": false
  },
  {
    "__docId__": 48,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "addTrailingSlash",
    "memberof": "src/roc/helpers/general.js",
    "longname": "src/roc/helpers/general.js~addTrailingSlash",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/general.js",
    "importStyle": "{addTrailingSlash}",
    "description": "Adds a trailing slashes to a path.\n\nRuns {@link removeTrailingSlash} internally first.",
    "lineNumber": 105,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{string} - Path with trailing slash."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "path",
        "description": "Path to add a trailing slashes to."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "string"
      ],
      "spread": false,
      "description": "Path with trailing slash."
    },
    "generator": false
  },
  {
    "__docId__": 49,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/helpers/get-resolve-path.js",
    "memberof": null,
    "longname": "src/roc/helpers/get-resolve-path.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport path from 'path';\n\n/**\n * Used on the server to find all dependecies.\n *\n * When creating a extension of this project this needs to be extended.\n *\n * @example\n * import path from 'path';\n * import { getResolvePath } from 'roc-web';\n *\n * export default function(...resolvePaths) {\n *     return getResolvePath(path.join(__dirname, '..', 'node_modules'), ...resolvePaths);\n * }\n *\n * @param {...string} resolvePaths - Paths to be resolved.\n * @returns {string} Path that can be used with `Module._initPaths()`.\n */\nexport default function getResolvePath(...resolvePaths) {\n    return resolvePaths.reduce(\n        (previousValue, currentValue) => `${previousValue}:${currentValue}`,\n        path.join(__dirname, '..', '..', 'node_modules')\n    );\n}\n"
  },
  {
    "__docId__": 50,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getResolvePath",
    "memberof": "src/roc/helpers/get-resolve-path.js",
    "longname": "src/roc/helpers/get-resolve-path.js~getResolvePath",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/get-resolve-path.js",
    "importStyle": "getResolvePath",
    "description": "Used on the server to find all dependecies.\n\nWhen creating a extension of this project this needs to be extended.",
    "examples": [
      "import path from 'path';\nimport { getResolvePath } from 'roc-web';\n\nexport default function(...resolvePaths) {\n    return getResolvePath(path.join(__dirname, '..', 'node_modules'), ...resolvePaths);\n}"
    ],
    "lineNumber": 21,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{string} Path that can be used with `Module._initPaths()`."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "...string"
        ],
        "spread": true,
        "optional": false,
        "name": "resolvePaths",
        "description": "Paths to be resolved."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "string"
      ],
      "spread": false,
      "description": "Path that can be used with `Module._initPaths()`."
    },
    "generator": false
  },
  {
    "__docId__": 51,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/helpers/plugin-managment.js",
    "memberof": null,
    "longname": "src/roc/helpers/plugin-managment.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import isPlainObject from 'lodash.isplainobject';\nimport isFunction from 'lodash.isfunction';\n\nlet once = true;\n/**\n * Gets the final rocBuilder object..\n *\n * @param {boolean} debug - If the command should run in debug mode\n * @param {string} target - What target the builder should be configured against\n * @param {function|array|object} createBuilders - The createBuilders defined in the configuration.\n    See documentation for more information on what it can be.\n * @param  {object|array} extensionCreateBuilders - The createBuilders defined in the extensions. Should most often be\n    an object.\n * @returns {rocBuilder}\n */\nexport function getBuilder(debug, target, createBuilders, extensionCreateBuilders) {\n    if (isPlainObject(createBuilders)) {\n        const rocBuilder = getBuildersFromObject(debug, target, createBuilders);\n        once = false;\n        return rocBuilder;\n    } else if (Array.isArray(createBuilders)) {\n        let rocBuilder = { buildConfig: {}, builder: require('webpack')};\n        createBuilders.forEach((builder) => {\n            rocBuilder = builder(target, rocBuilder);\n        });\n        if (debug && once) {\n            once = false;\n            console.log('createBuilder overridden in roc.config.js with an array, will use that.');\n        }\n\n        return rocBuilder;\n    } else if (isFunction(createBuilders)) {\n        let rocBuilder = getBuildersFromObject(debug, target, extensionCreateBuilders);\n\n        if (debug) {\n            once = false;\n            console.log('Will also use the createBuilder defined in roc.config.js.');\n        }\n\n        return createBuilders(target, rocBuilder);\n    }\n}\n\nfunction getBuildersFromObject(debug, target, createBuilders) {\n    const info = [];\n    // We we have a default run it first\n    const { default: def, ...rest } = createBuilders;\n    let rocBuilder = { buildConfig: {}, builder: require('webpack')};\n\n    if (def) {\n        info.push('default');\n        rocBuilder = def(target, rocBuilder);\n    }\n\n    Object.keys(rest).forEach((builder) => {\n        info.push(builder);\n        rocBuilder = createBuilders[builder](target, rocBuilder);\n    });\n    if (debug && once) {\n        console.log('Will use the following for createBuilder: ', info);\n    }\n\n    return rocBuilder;\n}\n"
  },
  {
    "__docId__": 52,
    "kind": "variable",
    "static": true,
    "variation": null,
    "name": "once",
    "memberof": "src/roc/helpers/plugin-managment.js",
    "longname": "src/roc/helpers/plugin-managment.js~once",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/helpers/plugin-managment.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 4,
    "undocument": true,
    "type": {
      "types": [
        "boolean"
      ]
    }
  },
  {
    "__docId__": 53,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getBuilder",
    "memberof": "src/roc/helpers/plugin-managment.js",
    "longname": "src/roc/helpers/plugin-managment.js~getBuilder",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/helpers/plugin-managment.js",
    "importStyle": "{getBuilder}",
    "description": "Gets the final rocBuilder object..",
    "lineNumber": 16,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{rocBuilder}"
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "boolean"
        ],
        "spread": false,
        "optional": false,
        "name": "debug",
        "description": "If the command should run in debug mode"
      },
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "target",
        "description": "What target the builder should be configured against"
      },
      {
        "nullable": null,
        "types": [
          "function",
          "array",
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "createBuilders",
        "description": "The createBuilders defined in the configuration.\nSee documentation for more information on what it can be."
      },
      {
        "nullable": null,
        "types": [
          "object",
          "array"
        ],
        "spread": false,
        "optional": false,
        "name": "extensionCreateBuilders",
        "description": "The createBuilders defined in the extensions. Should most often be\nan object."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "rocBuilder"
      ],
      "spread": false,
      "description": ""
    },
    "generator": false
  },
  {
    "__docId__": 54,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "getBuildersFromObject",
    "memberof": "src/roc/helpers/plugin-managment.js",
    "longname": "src/roc/helpers/plugin-managment.js~getBuildersFromObject",
    "access": null,
    "export": false,
    "importPath": "roc-web/lib/helpers/plugin-managment.js",
    "importStyle": null,
    "description": null,
    "lineNumber": 44,
    "undocument": true,
    "params": [
      {
        "name": "debug",
        "types": [
          "*"
        ]
      },
      {
        "name": "target",
        "types": [
          "*"
        ]
      },
      {
        "name": "createBuilders",
        "types": [
          "*"
        ]
      }
    ],
    "return": {
      "types": [
        "*"
      ]
    },
    "generator": false
  },
  {
    "__docId__": 55,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/index.js",
    "memberof": null,
    "longname": "src/roc/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\n// Builder\nexport createBuilder from './builder';\n\n// Helpers\nexport getResolvePath from './helpers/get-resolve-path';\n\n// Runtime\nexport watchClient from './runtime/watch-client';\nexport watchServer from './runtime/watch-server';\n\n// Configuration\nexport { baseConfig } from './helpers/config';\nexport { metaConfig } from './helpers/config';\n\n// Runners\nexport start from './commands/start';\nexport build from './commands/build';\nexport dev from './commands/dev';\n"
  },
  {
    "__docId__": 56,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/runtime/watch-client.js",
    "memberof": null,
    "longname": "src/roc/runtime/watch-client.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport debug from 'debug';\nimport koa from 'koa';\nimport koaWebpackDevMiddleware from 'koa-webpack-dev-middleware';\nimport koaWebpackHotMiddleware from 'koa-webpack-hot-middleware';\nimport { getSettings } from 'roc';\n\nimport { getDevPort } from '../helpers/general';\n\n/**\n * Client watcher.\n *\n * @param {object} compiler - Webpack compiler instance.\n * @returns {Promise} Resolves after it has completed.\n */\nexport default function watchClient(compiler) {\n    const settings = getSettings('dev');\n    debug.enable(settings.debug);\n\n    return new Promise((resolve, reject) => {\n        if (!compiler) {\n            return reject(new Error('A compiler instance must be passed in order to watch client!'));\n        }\n        const devPort = getDevPort();\n\n        const server = koa();\n\n        server.use(\n            koaWebpackDevMiddleware(compiler, {\n                // Let the publicPath be / since we want it to be based on the root of the dev server\n                publicPath: '/',\n                noInfo: settings.devMiddleware.noInfo,\n                quiet: settings.devMiddleware.quiet\n            })\n        );\n\n        server.use(\n            koaWebpackHotMiddleware(compiler, {\n                reload: settings.hotMiddleware.reload,\n                noInfo: settings.hotMiddleware.noInfo,\n                quiet: settings.hotMiddleware.quiet\n            })\n        );\n\n        server.listen(devPort);\n        debug('roc:dev:client')(`Dev server started on port ${devPort}`);\n\n        resolve(server);\n    });\n}\n"
  },
  {
    "__docId__": 57,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "watchClient",
    "memberof": "src/roc/runtime/watch-client.js",
    "longname": "src/roc/runtime/watch-client.js~watchClient",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/runtime/watch-client.js",
    "importStyle": "watchClient",
    "description": "Client watcher.",
    "lineNumber": 17,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{Promise} Resolves after it has completed."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "compiler",
        "description": "Webpack compiler instance."
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise"
      ],
      "spread": false,
      "description": "Resolves after it has completed."
    },
    "generator": false
  },
  {
    "__docId__": 58,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/roc/runtime/watch-server.js",
    "memberof": null,
    "longname": "src/roc/runtime/watch-server.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "import 'source-map-support/register';\n\nimport path from 'path';\nimport debug from 'debug';\nimport watch from 'node-watch';\nimport browserSync from 'browser-sync';\nimport childProcess from 'child_process';\n\nimport { getSettings } from 'roc';\n\nimport { getDevPort, getPort } from '../helpers/general';\nimport { parseStats } from '../builder/utils/stats';\n\n/**\n * Server watcher.\n *\n * @param {object} compiler - a Webpack compiler instance\n * @returns {Promise} Resolves after it has completed.\n */\nexport default function watchServer(compiler) {\n    const settings = getSettings('dev');\n    debug.enable(settings.debug);\n\n    const watcherLogger = debug('roc:dev:server:watcher');\n    const builderLogger = debug('roc:dev:server:builder');\n\n    let initiated = false;\n\n    /*\n    * We only want to init this function once, however it will be called everytime the builder has created a new build.\n    * Because of this reason we have a flag that makes sure the function only runs once, the first time we have a\n    * completed build.\n    */\n    const initServer = (bundlePath) => {\n        if (initiated) {\n            return;\n        }\n\n        initiated = true;\n\n        let server;\n        let startServer;\n        let once = false;\n\n        const restartServer = () => {\n            server.kill('SIGTERM');\n            return startServer();\n        };\n\n        const initBrowsersync = () => {\n            const basePath = getSettings('build').path;\n            browserSync({\n                port: parseInt(getDevPort(), 10) + 1,\n                // This proxy will remove extra slashes from the path, important to note\n                proxy: `0.0.0.0:${getPort()}${basePath}`,\n                snippetOptions: {\n                    rule: {\n                        match: /<\\/body>/i,\n                        fn: (snippet, match) => {\n                            // The logic here is to make sure we don't override options set by something else\n                            // We merge if the debug option has changed since we touched it last\n                            const debugOptions = (\n                                `<script>\n                                    if (localStorage.debugTemp === localStorage.debug) {\n                                        localStorage.debug = '${settings.debug}';\n                                    } else {\n                                        localStorage.debug = localStorage.debug + ',${settings.debug}';\n                                    }\n                                    localStorage.debugTemp = localStorage.debug;\n                                </script>`\n                            );\n                            return debugOptions + snippet + match;\n                        }\n                    }\n                },\n                open: settings.open,\n                ui: {\n                    port: parseInt(getDevPort(), 10) + 2\n                }\n            });\n        };\n\n        const watchForChanges = () => {\n            watch([bundlePath].concat(settings.watch), (file) => {\n                watcherLogger('Server restarting due to: ', file);\n                restartServer();\n            });\n        };\n\n        const listenForInput = (key = 'rs') => {\n            watcherLogger(`You can restart the server by entering \"${key}\" and pressing enter\"`);\n            process.stdin.resume();\n            process.stdin.setEncoding('utf8');\n            process.stdin.on('data', function(data) {\n                const parsedData = (data + '').trim().toLowerCase();\n                if (parsedData === key) {\n                    watcherLogger(`Server restarting due to user input [${key}]`);\n                    restartServer();\n                }\n            });\n        };\n\n        /*\n        * This function runs everytime the server is restarted, which could be because of user input or a file that has\n        * been changed. To make sure we only start Browsersync once along with only one input listner and one file\n        * watcher we have a flag, once.\n        */\n        startServer = () => {\n            const env = {\n                ...process.env,\n                ROC_CONFIG_SETTINGS: JSON.stringify(getSettings())\n            };\n            server = childProcess.fork(bundlePath, { env });\n            process.on('exit', () => server.kill('SIGTERM'));\n\n            server.once('message', (message) => {\n                if (message.match(/^online$/)) {\n                    if (!once) {\n                        once = true;\n                        initBrowsersync();\n                        listenForInput();\n                        watchForChanges();\n                    } else if (settings.reloadOnServerChange) {\n                        browserSync.reload();\n                    }\n                }\n            });\n        };\n\n        startServer();\n    };\n\n    return new Promise((resolve, reject) => {\n        compiler.watch({\n            poll: false\n        }, (serverErr, serverStats) => {\n            if (serverErr) {\n                return reject(serverErr);\n            }\n\n            if (!compiler) {\n                return reject(new Error('A compiler instance must be defined in order to start watch!'));\n            }\n\n            const statsJson = serverStats.toJson();\n            builderLogger(`Server rebuilt ${statsJson.time} ms`);\n\n            // FIXME\n            if (statsJson.errors.length > 0) {\n                statsJson.errors.map(err => console.log(err));\n            }\n\n            // FIXME\n            if (statsJson.warnings.length > 0) {\n                statsJson.warnings.map(wrn => console.log(wrn));\n            }\n\n            let bundleName = 'app.server.bundle.js';\n\n            if (statsJson.assets && statsJson.assets.length > 0) {\n                const stats = parseStats(statsJson);\n                bundleName = stats.script[0];\n            }\n\n            const artifact = path.join(compiler.outputPath, '/', bundleName);\n\n            // start first time\n            initServer(artifact);\n            return resolve();\n        });\n    });\n}\n"
  },
  {
    "__docId__": 59,
    "kind": "function",
    "static": true,
    "variation": null,
    "name": "watchServer",
    "memberof": "src/roc/runtime/watch-server.js",
    "longname": "src/roc/runtime/watch-server.js~watchServer",
    "access": null,
    "export": true,
    "importPath": "roc-web/lib/runtime/watch-server.js",
    "importStyle": "watchServer",
    "description": "Server watcher.",
    "lineNumber": 20,
    "unknown": [
      {
        "tagName": "@returns",
        "tagValue": "{Promise} Resolves after it has completed."
      }
    ],
    "params": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "compiler",
        "description": "a Webpack compiler instance"
      }
    ],
    "return": {
      "nullable": null,
      "types": [
        "Promise"
      ],
      "spread": false,
      "description": "Resolves after it has completed."
    },
    "generator": false
  },
  {
    "__docId__": 60,
    "kind": "file",
    "static": true,
    "variation": null,
    "name": "src/typedef/index.js",
    "memberof": null,
    "longname": "src/typedef/index.js",
    "access": null,
    "description": null,
    "lineNumber": 1,
    "content": "/**\n * Roc builder object.\n *\n * @typedef {Object} rocBuilder\n * @property {object} buildConfig - Webpack config object, can be used to extend the configuration.\n * @property {object} builder - Webpack instance.\n * @see https://webpack.github.io/\n */\n\n/**\n * Output path object.\n *\n * @typedef {Object} outputPath\n * @property {!string} absolute - Absolute path to where the build should be saved on disk.\n * @property {!string} relative - Relative path to where the build should be saved on disk, based on from where the\n * command is run from.\n */\n\n/**\n * Roc server.\n *\n * @typedef {Object} rocServer\n * @property {object} server - Koa instance.\n * @property {startServer} start - Starts the server.\n */\n\n /**\n * Starts a server.\n *\n * The port for the server to start on can be selected in 3 ways and has priority in the same order.\n * 1. The param for the function, `port`\n * 2. Environment variable, `PORT`\n * 3. The port from `roc.config.js`\n *\n * @typedef {function} startServer\n * @param {number} [port=PORT/roc.config.js] - the port to start the server on.\n */\n\n/**\n * Roc server options.\n *\n * Used in {@link createServer}.\n *\n * Both of these options can also be set in `roc.config.js` however these values will override them if provided.\n *\n * @typedef {Object} rocServerOptions\n * @property {string|string[]} [serve] - The folders to serve from the server. Paths will be based from where the\n * application is started.\n * @property {string} [favicon] - The path to the favicon. This file will be handled in the server in a special way.\n */\n"
  },
  {
    "__docId__": 61,
    "kind": "typedef",
    "static": true,
    "variation": null,
    "name": "rocBuilder",
    "memberof": "src/typedef/index.js",
    "longname": "src/typedef/index.js~rocBuilder",
    "access": null,
    "description": "Roc builder object.",
    "see": [
      "https://webpack.github.io/"
    ],
    "properties": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "buildConfig",
        "description": "Webpack config object, can be used to extend the configuration."
      },
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "builder",
        "description": "Webpack instance."
      }
    ],
    "type": {
      "types": [
        "Object"
      ],
      "optional": false,
      "name": "rocBuilder"
    }
  },
  {
    "__docId__": 62,
    "kind": "typedef",
    "static": true,
    "variation": null,
    "name": "outputPath",
    "memberof": "src/typedef/index.js",
    "longname": "src/typedef/index.js~outputPath",
    "access": null,
    "description": "Output path object.",
    "properties": [
      {
        "nullable": false,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "absolute",
        "description": "Absolute path to where the build should be saved on disk."
      },
      {
        "nullable": false,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": false,
        "name": "relative",
        "description": "Relative path to where the build should be saved on disk, based on from where the\ncommand is run from."
      }
    ],
    "type": {
      "types": [
        "Object"
      ],
      "optional": false,
      "name": "outputPath"
    }
  },
  {
    "__docId__": 63,
    "kind": "typedef",
    "static": true,
    "variation": null,
    "name": "rocServer",
    "memberof": "src/typedef/index.js",
    "longname": "src/typedef/index.js~rocServer",
    "access": null,
    "description": "Roc server.",
    "properties": [
      {
        "nullable": null,
        "types": [
          "object"
        ],
        "spread": false,
        "optional": false,
        "name": "server",
        "description": "Koa instance."
      },
      {
        "nullable": null,
        "types": [
          "startServer"
        ],
        "spread": false,
        "optional": false,
        "name": "start",
        "description": "Starts the server."
      }
    ],
    "type": {
      "types": [
        "Object"
      ],
      "optional": false,
      "name": "rocServer"
    }
  },
  {
    "__docId__": 64,
    "kind": "typedef",
    "static": true,
    "variation": null,
    "name": "startServer",
    "memberof": "src/typedef/index.js",
    "longname": "src/typedef/index.js~startServer",
    "access": null,
    "description": "Starts a server.\n\nThe port for the server to start on can be selected in 3 ways and has priority in the same order.\n1. The param for the function, `port`\n2. Environment variable, `PORT`\n3. The port from `roc.config.js`",
    "params": [
      {
        "nullable": null,
        "types": [
          "number"
        ],
        "spread": false,
        "optional": true,
        "defaultValue": "PORT/roc.config.js",
        "defaultRaw": "PORT/roc.config.js",
        "name": "port",
        "description": "the port to start the server on."
      }
    ],
    "type": {
      "types": [
        "function"
      ],
      "optional": false,
      "name": "startServer"
    }
  },
  {
    "__docId__": 65,
    "kind": "typedef",
    "static": true,
    "variation": null,
    "name": "rocServerOptions",
    "memberof": "src/typedef/index.js",
    "longname": "src/typedef/index.js~rocServerOptions",
    "access": null,
    "description": "Roc server options.\n\nUsed in {@link createServer}.\n\nBoth of these options can also be set in `roc.config.js` however these values will override them if provided.",
    "properties": [
      {
        "nullable": null,
        "types": [
          "string",
          "string[]"
        ],
        "spread": false,
        "optional": true,
        "name": "serve",
        "description": "The folders to serve from the server. Paths will be based from where the\napplication is started."
      },
      {
        "nullable": null,
        "types": [
          "string"
        ],
        "spread": false,
        "optional": true,
        "name": "favicon",
        "description": "The path to the favicon. This file will be handled in the server in a special way."
      }
    ],
    "type": {
      "types": [
        "Object"
      ],
      "optional": false,
      "name": "rocServerOptions"
    }
  },
  {
    "__docId__": 67,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Infinity",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Infinity",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 68,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "NaN",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~NaN",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 69,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "undefined",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~undefined",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 70,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "null",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~null",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 71,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Object",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 72,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "object",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~object",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 73,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Function",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 74,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "function",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~function",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 75,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Boolean",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 76,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "boolean",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~boolean",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 77,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Symbol",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Symbol",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 78,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Error",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Error",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 79,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "EvalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~EvalError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 80,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "InternalError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~InternalError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 81,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "RangeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~RangeError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 82,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "ReferenceError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~ReferenceError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 83,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "SyntaxError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~SyntaxError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 84,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "TypeError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~TypeError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 85,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "URIError",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~URIError",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 86,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Number",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 87,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "number",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~number",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 88,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Date",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Date",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 89,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "String",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~String",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 90,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "string",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~string",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 91,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "RegExp",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~RegExp",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 92,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 93,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Int8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int8Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 94,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Uint8Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 95,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Uint8ClampedArray",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 96,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Int16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int16Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 97,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Uint16Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint16Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 98,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Int32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Int32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 99,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Uint32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 100,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Float32Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Float32Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 101,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Float64Array",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Float64Array",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 102,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Map",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Map",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 103,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Set",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Set",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 104,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "WeakMap",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakMap",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 105,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "WeakSet",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakSet",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 106,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "ArrayBuffer",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 107,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "DataView",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~DataView",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 108,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "JSON",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~JSON",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 109,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Promise",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Promise",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 110,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Generator",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Generator",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 111,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "GeneratorFunction",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 112,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Reflect",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Reflect",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 113,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Proxy",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
    "memberof": "BuiltinExternal/ECMAScriptExternal.js",
    "longname": "BuiltinExternal/ECMAScriptExternal.js~Proxy",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 115,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "CanvasRenderingContext2D",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 116,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "DocumentFragment",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~DocumentFragment",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 117,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Element",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Element",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~Element",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 118,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Event",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Event",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~Event",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 119,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "Node",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Node",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~Node",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 120,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "NodeList",
    "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/NodeList",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~NodeList",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 121,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "XMLHttpRequest",
    "externalLink": "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest",
    "access": null,
    "description": "",
    "builtinExternal": true
  },
  {
    "__docId__": 122,
    "kind": "external",
    "static": true,
    "variation": null,
    "name": "AudioContext",
    "externalLink": "https://developer.mozilla.org/en/docs/Web/API/AudioContext",
    "memberof": "BuiltinExternal/WebAPIExternal.js",
    "longname": "BuiltinExternal/WebAPIExternal.js~AudioContext",
    "access": null,
    "description": "",
    "builtinExternal": true
  }
]