You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

630 lines
22 KiB

8 years ago
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Development Process · Neutrino</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
8 years ago
<link rel="next" href="code-of-conduct.html" />
8 years ago
8 years ago
<link rel="prev" href="./" />
8 years ago
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
Introduction
</a>
</li>
<li class="chapter " data-level="1.2" data-path="../installation.html">
<a href="../installation.html">
Installation
</a>
</li>
<li class="chapter " data-level="1.3" data-path="../usage.html">
<a href="../usage.html">
Usage
</a>
</li>
<li class="chapter " data-level="1.4" data-path="../project-layout.html">
<a href="../project-layout.html">
Project Layout
</a>
</li>
<li class="chapter " data-level="1.5" data-path="../presets/">
<a href="../presets/">
Presets
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../presets/neutrino-preset-web/">
<a href="../presets/neutrino-preset-web/">
8 years ago
Web
8 years ago
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="../presets/neutrino-preset-react/">
<a href="../presets/neutrino-preset-react/">
8 years ago
React
8 years ago
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="../presets/neutrino-preset-node/">
<a href="../presets/neutrino-preset-node/">
8 years ago
Node.js
8 years ago
</a>
</li>
8 years ago
<li class="chapter " data-level="1.5.4" data-path="../presets/neutrino-preset-airbnb-base/">
8 years ago
8 years ago
<a href="../presets/neutrino-preset-airbnb-base/">
8 years ago
8 years ago
Airbnb
8 years ago
</a>
</li>
8 years ago
<li class="chapter " data-level="1.5.5" data-path="../presets/neutrino-preset-karma/">
8 years ago
8 years ago
<a href="../presets/neutrino-preset-karma/">
8 years ago
8 years ago
Karma
8 years ago
</a>
</li>
8 years ago
<li class="chapter " data-level="1.5.6" data-path="../presets/neutrino-preset-mocha/">
8 years ago
8 years ago
<a href="../presets/neutrino-preset-mocha/">
8 years ago
8 years ago
Mocha
8 years ago
</a>
</li>
8 years ago
<li class="chapter " data-level="1.5.7" data-path="../presets/neutrino-preset-jest/">
8 years ago
8 years ago
<a href="../presets/neutrino-preset-jest/">
8 years ago
8 years ago
Jest
8 years ago
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../customization/">
<a href="../customization/">
Customization
</a>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="../customization/simple.html">
<a href="../customization/simple.html">
Simple
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="../customization/advanced.html">
<a href="../customization/advanced.html">
Advanced
</a>
</li>
</ul>
</li>
8 years ago
<li class="chapter " data-level="1.7" data-path="../creating-presets.html">
8 years ago
8 years ago
<a href="../creating-presets.html">
8 years ago
Creating presets
</a>
</li>
<li class="chapter " data-level="1.8" data-path="../api/">
<a href="../api/">
API
</a>
</li>
<li class="chapter " data-level="1.9" data-path="../cli/">
<a href="../cli/">
CLI
</a>
</li>
<li class="chapter " data-level="1.10" data-path="./">
<a href="./">
Contributing
</a>
<ul class="articles">
8 years ago
<li class="chapter active" data-level="1.10.1" data-path="development.html">
8 years ago
8 years ago
<a href="development.html">
8 years ago
8 years ago
Development Process
8 years ago
</a>
</li>
8 years ago
<li class="chapter " data-level="1.10.2" data-path="code-of-conduct.html">
8 years ago
8 years ago
<a href="code-of-conduct.html">
8 years ago
8 years ago
Code of Conduct
8 years ago
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >Development Process</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="developing-neutrino">Developing Neutrino</h1>
<p>Developing and contributing to Neutrino and its core presets is done through our monorepo located at
<a href="https://github.com/mozilla-neutrino/neutrino-dev" target="_blank">https://github.com/mozilla-neutrino/neutrino-dev</a>. The code is broken up into a couple different sections:
packages and documentation.</p>
<p><em>Note: In this guide, commands executable from the command line are prepended with <code>&#x276F;</code>. Lines not starting
with this symbol show sample console output from running the previous command.</em></p>
8 years ago
<h2 id="requirements">Requirements</h2>
<p>Developing for neutrino-dev requires:</p>
<ul>
<li>Node.js v6.9+</li>
<li>Yarn client, installation instructions at <a href="https://yarnpkg.com/en/docs/install" target="_blank">https://yarnpkg.com/en/docs/install</a></li>
<li>git, GitHub account</li>
</ul>
8 years ago
<h2 id="getting-started">Getting started</h2>
<p>The first step to start developing neutrino-dev is forking the repository to your own GitHub account.</p>
<p><a href="https://github.com/mozilla-neutrino/neutrino-dev/fork" target="_blank">Fork mozilla-neutrino/neutrino-dev on GitHub</a></p>
<p>Once that is done, you can clone your copy of the repository on your computer, replacing <code>USER</code> with the username
of the account you forked the repository to:</p>
<pre class="language-"><code class="lang-bash">&#x276F; <span class="token function">git</span> clone git@github.com:USER/neutrino-dev.git
&#x276F; <span class="token function">cd</span> neutrino-dev
</code></pre>
8 years ago
<p>Upon cloning, you should install dependencies and bootstrap the project:</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn
&#x276F; yarn bootstrap
</code></pre>
<p>This will create symlinks between the various packages, making local development much easier. It also creates yarn links
for testing out these packages elsewhere on your system.</p>
<h2 id="development-commands">Development commands</h2>
<p>The package.json for neutrino-dev defines several commands to assist in the development and deployment process.</p>
<hr>
<p><code>bootstrap</code></p>
<p>Installs all sub-package dependencies using yarn. External dependencies are installed normally, whereas those belonging
to the neutrino-dev monorepo itself are <code>yarn link</code>ed.</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn bootstrap
</code></pre>
<hr>
<p><code>deps:add [--dev] <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>package</span><span class="token punctuation">&gt;</span></span> &lt;...dependencies&gt;</code></p>
<p>Adds one or more new dependencies or development dependencies to a sub-package. Any flags used, such as <code>--dev</code> are
passed on to <code>yarn add</code>. For example, if you wanted to add &quot;lodash.clonedeep&quot; to the neutrino package:</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn deps:add neutrino lodash.clonedeep
</code></pre>
<hr>
<p><code>deps:remove <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>package</span><span class="token punctuation">&gt;</span></span> &lt;...dependencies&gt;</code></p>
<p>Removes one or more dependencies from a sub-package. Any flags used are
passed on to <code>yarn remove</code>. For example, if you wanted to remove &quot;lodash.clonedeep&quot; from the neutrino package:</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn deps:remove neutrino lodash.clonedeep
</code></pre>
<hr>
<p><code>deps:upgrade <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>package</span><span class="token punctuation">&gt;</span></span> &lt;...dependencies&gt;</code></p>
<p>Upgrades one or more dependencies in a sub-package. Any flags used are
passed on to <code>yarn upgrade</code>. For example, if you wanted to upgrade &quot;lodash.clonedeep&quot; in the neutrino package:</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn deps:upgrade neutrino lodash.clonedeep
</code></pre>
<hr>
<p><code>deps:clean</code></p>
<p>Removes the <code>node_modules</code> directory from all sub-packages. After running this you will need to re-bootstrap
neutrino-dev in order to continue development. Useful if you have somehow put your local development environment in an
unworkable state with regards to local inter-dependencies.</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn deps:clean
</code></pre>
<hr>
<p><code>docs:serve</code></p>
<p>Starts a local development server which builds the documentation in <code>docs</code> to a gitbook running on port 4000.</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn docs:serve
</code></pre>
<hr>
<p><code>docs:build</code></p>
<p>Generates a static site by building the documentation in <code>docs</code> to a gitbook to the <code>_book</code> directory.</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn docs:build
</code></pre>
<hr>
<p><code>docs:deploy</code></p>
<p>Generates a static site by building the documentation in <code>docs</code> to a gitbook to the <code>_book</code> directory, then pushing the
contents of <code>_book</code> to a <code>gh-pages</code> branch on GitHub. In order to run this command, you must have an <code>upstream</code> remote
configured pointing to the root neutrino-dev repo, and have sufficient rights to push to the repository.</p>
<pre class="language-"><code class="lang-bash">&#x276F; yarn docs:deploy
</code></pre>
8 years ago
<h2 id="making-changes">Making changes</h2>
<p>When you make changes to neutrino-dev, you should make them in a branch separate from <code>master</code>. Start from the
master branch and create a new branch for your changes.</p>
<p><em>Example: You want to create a core preset for JavaScript Standard Style. You need a new branch for this work.</em></p>
<pre class="language-"><code class="lang-bash">&#x276F; <span class="token function">git</span> checkout -b standard-style
Switched to a new branch <span class="token string">&apos;standard-style&apos;</span>
</code></pre>
<p>While making changes, be sure to test your code out for expected operation. If possible or applicable, write a
test that can verify these changes in the future.</p>
<h2 id="submitting-a-pull-request">Submitting a pull request</h2>
<p>Once you are satisified with your changes, you should commit them and submit a pull request. Use <code>git add</code>
8 years ago
in order to add files that should be committed. Give your changes a descriptive but not overly verbose message.</p>
8 years ago
<pre class="language-"><code class="lang-bash">&#x276F; <span class="token function">git</span> add <span class="token keyword">.</span>
&#x276F; <span class="token function">git</span> commit -m <span class="token string">&quot;Feature: Adding new core preset for JavaScript Standard Style&quot;</span>
&#x276F; <span class="token function">git</span> push origin standard-style
</code></pre>
<p>Now if you open the GitHub page for your repository, GitHub should display a button to open a pull request for
the branch and commit you just pushed. When filling out the details of the pull request, try to be as descriptive
as possible, following our detailed <a href="./">contribution guidelines</a>.</p>
8 years ago
<h3 id="congrats">Congrats!</h3>
<p>You just made a contribution to Neutrino! We are so happy to have your help! &#x1F389;</p>
8 years ago
<h2 id="receiving-updates">Receiving updates</h2>
<p>If you need to update your local copy of neutrino-dev to be in sync with the main neutrino-dev repository, you
will want to fetch upstream changes. Add the main neutrino-dev repo as an upstream to your local copy, then fetch
the latest changes from the master branch.</p>
<pre class="language-"><code class="lang-bash">&#x276F; <span class="token function">git</span> checkout master
&#x276F; <span class="token function">git</span> remote add upstream https://github.com/mozilla-neutrino/neutrino-dev.git
&#x276F; <span class="token function">git</span> pull upstream master
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
8 years ago
<a href="./" class="navigation navigation-prev " aria-label="Previous page: Contributing">
8 years ago
<i class="fa fa-angle-left"></i>
</a>
8 years ago
<a href="code-of-conduct.html" class="navigation navigation-next " aria-label="Next page: Code of Conduct">
<i class="fa fa-angle-right"></i>
</a>
8 years ago
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
8 years ago
gitbook.page.hasChanged({"page":{"title":"Development Process","level":"1.10.1","depth":2,"next":{"title":"Code of Conduct","level":"1.10.2","depth":2,"path":"contributing/code-of-conduct.md","ref":"contributing/code-of-conduct.md","articles":[]},"previous":{"title":"Contributing","level":"1.10","depth":1,"path":"contributing/README.md","ref":"contributing/README.md","articles":[{"title":"Development Process","level":"1.10.1","depth":2,"path":"contributing/development.md","ref":"contributing/development.md","articles":[]},{"title":"Code of Conduct","level":"1.10.2","depth":2,"path":"contributing/code-of-conduct.md","ref":"contributing/code-of-conduct.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","prism","-highlight","github","anchorjs"],"root":"./docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/mozilla-neutrino/neutrino-dev/"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit page","base":"https://github.com/mozilla-neutrino/neutrino-dev/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchorjs":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Neutrino","gitbook":"*"},"file":{"path":"contributing/development.md","mtime":"2017-02-19T15:34:23.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-02-20T14:57:53.010Z"},"basePath":"..","book":{"language":""}});
8 years ago
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.1.1/anchor.min.js"></script>
<script src="../gitbook/gitbook-plugin-anchorjs/anchor-style.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>