roc
Version:
Build modern web applications easily
203 lines (192 loc) • 21.3 kB
HTML
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl">
<title data-ice="title">API Document</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
<script src="script/prettify/prettify.js"></script>
<script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">
<header>
<a href="./">Home</a>
<a href="identifiers.html">Reference</a>
<a href="source.html">Source</a>
<a data-ice="repoURL" href="https://github.com/vgno/roc.git" class="repo-url-github">Repository</a>
<div class="search-box">
<span>
<img src="./image/search.png">
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
</span>
<ul class="search-result"></ul>
</div>
</header>
<nav class="navigation" data-ice="nav"><div>
<ul>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">cli</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-execute">execute</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-buildCompleteConfig">buildCompleteConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateCommandDocumentation">generateCommandDocumentation</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateCommandsDocumentation">generateCommandsDocumentation</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getMappings">getMappings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getSuggestions">getSuggestions</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-parseArguments">parseArguments</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-parseOptions">parseOptions</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-runCli">runCli</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">commands</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-init">init</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">commands/helpers</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validRocProject">validRocProject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-get">get</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getVersions">getVersions</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-defaultPrompt">defaultPrompt</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">configuration</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getApplicationConfig">getApplicationConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-appendConfig">appendConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-appendSettings">appendSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getConfig">getConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getSettings">getSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-merge">merge</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">documentation</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-buildDocumentationObject">buildDocumentationObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateTable">generateTable</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-addPadding">addPadding</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getDefaultValue">getDefaultValue</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-pad">pad</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toCliFlag">toCliFlag</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateMarkdownDocumentation">generateMarkdownDocumentation</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-generateTextDocumentation">generateTextDocumentation</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">helpers</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-fileExists">fileExists</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getAbsolutePath">getAbsolutePath</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getPackageJson">getPackageJson</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getRocDependencies">getRocDependencies</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-error">error</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-errorLabel">errorLabel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-important">important</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-importantLabel">importantLabel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-ok">ok</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-okLabel">okLabel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-warning">warning</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-warningLabel">warningLabel</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">typedef</div><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-infoObject">infoObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocCommandObject">rocCommandObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocConfig">rocConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocDocumentationObject">rocDocumentationObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocMapObject">rocMapObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocMetaConfig">rocMetaConfig</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocMetaSettings">rocMetaSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocMetaSettings">rocMetaSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocOptions">rocOptions</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocSettings">rocSettings</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocTableHeader">rocTableHeader</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-typedef">T</span><span data-ice="name"><span><a href="typedef/index.html#static-typedef-rocTableSettings">rocTableSettings</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">validation</div><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isValid">isValid</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-throwError">throwError</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validate">validate</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-validateMightThrow">validateMightThrow</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isArray">isArray</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isArrayOrSingle">isArrayOrSingle</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isBoolean">isBoolean</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isInteger">isInteger</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isObject">isObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isPath">isPath</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isString">isString</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-oneOf">oneOf</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-required">required</a></span></span></li>
</ul>
</div>
</nav>
<div class="content" data-ice="content"><div data-ice="index" class="github-markdown"><h1 id="-roc-http-www-getroc-org-"><a href="http://www.getroc.org">Roc</a></h1>
<p>Roc enables you to focus on writing great software and away from juggling boilerplate, configuration files and ever changing dependencies.</p>
<p>Can be used to quickly prototype something with zero-setup to running applications in production.</p>
<p><img src="https://img.shields.io/badge/stability-beta-yellow.svg" alt="stability beta">
<a href="https://www.npmjs.com/package/roc"><img src="https://img.shields.io/npm/v/roc.svg" alt="roc"></a>
<a href="https://travis-ci.org/vgno/roc"><img src="https://travis-ci.org/vgno/roc.svg" alt="build status"></a>
<a href="https://coveralls.io/github/vgno/roc?branch=master"><img src="https://coveralls.io/repos/vgno/roc/badge.svg?branch=master&service=github" alt="Coverage Status"></a>
<a href="https://codeclimate.com/github/vgno/roc"><img src="https://codeclimate.com/github/vgno/roc/badges/gpa.svg" alt="Code Climate"></a>
<a href="https://codeclimate.com/github/vgno/roc"><img src="https://codeclimate.com/github/vgno/roc/badges/issue_count.svg" alt="Issue Count"></a>
<a href="https://david-dm.org/vgno/roc"><img src="https://david-dm.org/vgno/roc.svg" alt="Dependency Status"></a></p>
<h2 id="introduction">Introduction</h2>
<p>Roc is development tool that makes it easier to create web applications and components without the boilerplate fragmentation and complex setup processes. It does this in a modular and extendable way. </p>
<p>Roc makes it easy to; using existing extensions:</p>
<ul>
<li>Create production ready <a href="http://facebook.github.io/react/">React</a> applications featuring universal rendering.</li>
<li>Create general web applications running on a <a href="http://koajs.com/">Koa</a> server.</li>
<li>First class developer experience with hot reloading and <a href="http://browsersync.io">Browsersync</a>.</li>
<li>Best in class build setup using <a href="http://webpack.github.io/">Webpack</a> and <a href="http://babeljs.io">Babel</a>. </li>
</ul>
<p>Basically Roc composes some great open source tools and make them easy to use with a streamlined command line interface and configuration/extension system. If needed Roc allows for overriding of every aspect of it, so it does not limit you.</p>
<h2 id="get-started">Get started</h2>
<h3 id="install-roc">Install Roc</h3>
<pre><code><code class="source-code prettyprint">npm install -g roc</code>
</code></pre><p>This provides you with a really simple command line interface. Only Linux and OS X is <em>currently</em> supported.</p>
<h3 id="bootstrap-react-redux-application">Bootstrap React + Redux application</h3>
<pre><code><code class="source-code prettyprint">mkdir react-app && cd react-app</code>
</code></pre><pre><code><code class="source-code prettyprint">roc init web-react</code>
</code></pre><pre><code><code class="source-code prettyprint">roc dev</code>
</code></pre><p>This will:</p>
<ul>
<li>create a new directory</li>
<li>init a Roc project inside it that uses React and Redux</li>
<li>start the project in development mode</li>
</ul>
<h3 id="production-ready">Production ready</h3>
<p>To build and run in production just use:</p>
<pre><code><code class="source-code prettyprint">roc build</code>
</code></pre><pre><code><code class="source-code prettyprint">roc start</code>
</code></pre><h3 id="where-to-go-from-here">Where to go from here</h3>
<p>See the documentation for the particular extension that is used for more details on what it does. A very common use-case is to make modifications to your <code>roc.config.js</code>. To get a better understanding of all the possible options in the extension use the <code>roc list-settings</code> command or <code>--help</code> for a specific command.</p>
<h2 id="extensions">Extensions</h2>
<p>Roc is highly flexible and makes it easy to create new extensions. It does not enforce limits on what the extensions do or how they do it. It is trivial to both create new extensions and to extend existing ones. For example it would be possible to create a alternative to <code>roc-web</code> that uses <a href="http://browserify.org/">Browserify</a> instead of <a href="http://webpack.github.io/">Webpack</a>.</p>
<h3 id="current-extensions">Current Extensions</h3>
<table>
<thead>
<tr>
<th>Project</th>
<th>Github page</th>
</tr>
</thead>
<tbody>
<tr>
<td>Roc Web</td>
<td><a href="https://github.com/vgno/roc-web">https://github.com/vgno/roc-web</a></td>
</tr>
<tr>
<td>Roc Web React</td>
<td><a href="https://github.com/vgno/roc-web-react">https://github.com/vgno/roc-web-react</a></td>
</tr>
</tbody>
</table>
<h4 id="example-of-tasks-handled-by-these-extensions">Example of tasks handled by these extensions</h4>
<ul>
<li>Building and bundling through <a href="http://webpack.github.io/">Webpack</a>.</li>
<li>Web server through <a href="http://koajs.com/">Koa</a>.</li>
<li><a href="http://facebook.github.io/react/">React</a> (complete with <a href="https://github.com/rackt/redux">Redux</a> and server side rendering).</li>
<li>First class developer experience featuring hot code reloading and <a href="http://browsersync.io">Browsersync</a>.</li>
<li>Transpiling from ES2015 <em>(ES6)</em> and beyond using <a href="http://babeljs.io">Babel</a>.</li>
</ul>
<h2 id="documentation">Documentation</h2>
<p>See the <a href="/docs/README.md">documentation</a>.</p>
<h2 id="motivation">Motivation</h2>
<p>Roc was born out of the need to create modern applications following the correct conventions and using best practices consistently.</p>
<p>We quickly realized that keeping boilerplate updated within each project over time was unmanageable. It seems natural to have this <em>repeated complexity managed by separated semantically versioned packages</em>.</p>
<p>Development of Roc was started before these posts where created but they still describe in a good way what Roc aims to solve:</p>
<ul>
<li><a href="http://blog.vjeux.com/2015/javascript/challenge-best-javascript-setup-for-quick-prototyping.html">Challenge: Best JavaScript Setup for Quick Prototyping</a> by <a href="https://github.com/vjeux"><strong>@vjeux</strong></a></li>
<li><a href="https://medium.com/@ericclemmons/javascript-fatigue-48d4011b6fc4">Javascript Fatigue</a> by <a href="https://github.com/ericclemmons"><strong>@ericclemmons</strong></a></li>
</ul>
<h2 id="contribute">Contribute</h2>
<p>We are still working on getting the balance between flexibility and easy-of-use. Input here is valuable to us and please contribute if you want, we welcome you to interact.</p>
<h2 id="thanks">Thanks</h2>
<p>Thanks to <a href="https://github.com/jonathanong">Jongleberry</a> for letting us use the <code>roc</code> package name on npm.</p>
</div>
</div>
<footer class="footer">
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.4.3)</span></a>
</footer>
<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>