|
|
|
|
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html lang="" >
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
|
|
<title>Project Layout · 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">
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="next" href="presets/" />
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="prev" href="usage.html" />
|
|
|
|
|
|
|
|
|
|
|
|
</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 active" 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/">
|
|
|
|
|
|
|
|
|
|
|
|
Web
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.2" data-path="presets/neutrino-preset-react/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-react/">
|
|
|
|
|
|
|
|
|
|
|
|
React
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.3" data-path="presets/neutrino-preset-node/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-node/">
|
|
|
|
|
|
|
|
|
|
|
|
Node.js
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.4" data-path="presets/neutrino-preset-airbnb-base/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-airbnb-base/">
|
|
|
|
|
|
|
|
|
|
|
|
Airbnb
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.5" data-path="presets/neutrino-preset-karma/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-karma/">
|
|
|
|
|
|
|
|
|
|
|
|
Karma
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.6" data-path="presets/neutrino-preset-mocha/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-mocha/">
|
|
|
|
|
|
|
|
|
|
|
|
Mocha
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.5.7" data-path="presets/neutrino-preset-jest/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-preset-jest/">
|
|
|
|
|
|
|
|
|
|
|
|
Jest
|
|
|
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.7" data-path="creating-presets.html">
|
|
|
|
|
|
|
|
<a href="creating-presets.html">
|
|
|
|
|
|
|
|
|
|
|
|
Creating presets
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.7.1" data-path="presets/neutrino-lint-base/">
|
|
|
|
|
|
|
|
<a href="presets/neutrino-lint-base/">
|
|
|
|
|
|
|
|
|
|
|
|
Creating linting presets
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.8" data-path="learning-resources.html">
|
|
|
|
|
|
|
|
<a href="learning-resources.html">
|
|
|
|
|
|
|
|
|
|
|
|
Learning Resources
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.9" data-path="api/">
|
|
|
|
|
|
|
|
<a href="api/">
|
|
|
|
|
|
|
|
|
|
|
|
API
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.10" data-path="cli/">
|
|
|
|
|
|
|
|
<a href="cli/">
|
|
|
|
|
|
|
|
|
|
|
|
CLI
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.11" data-path="contributing/">
|
|
|
|
|
|
|
|
<a href="contributing/">
|
|
|
|
|
|
|
|
|
|
|
|
Contributing
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.11.1" data-path="contributing/development.html">
|
|
|
|
|
|
|
|
<a href="contributing/development.html">
|
|
|
|
|
|
|
|
|
|
|
|
Development Process
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.11.2" data-path="contributing/code-of-conduct.html">
|
|
|
|
|
|
|
|
<a href="contributing/code-of-conduct.html">
|
|
|
|
|
|
|
|
|
|
|
|
Code of Conduct
|
|
|
|
|
|
|
|
</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="." >Project Layout</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="project-layout">Project Layout</h1>
|
|
|
|
<p>Out of the box, Neutrino presets expect a project to have a particular structure to make the
|
|
|
|
development process for new projects as quick as possible. This is broken up into three directories:</p>
|
|
|
|
<ul>
|
|
|
|
<li>Source code</li>
|
|
|
|
<li>Build assets</li>
|
|
|
|
<li>Testing</li>
|
|
|
|
</ul>
|
|
|
|
<p>Each of these directories is set up via convention by a Neutrino preset, but each can be customized as
|
|
|
|
desired by overriding the preset's configuration or using a different preset. See
|
|
|
|
<a href="custom-configuration.md">Custom Configuration</a> for detailed instructions.</p>
|
|
|
|
<h2 id="source-code">Source Code</h2>
|
|
|
|
<p>By default, Neutrino presets expect all project source code to live in a directory named <code>src</code> in the
|
|
|
|
root of the project. This includes JavaScript files, CSS stylesheets, images, and any other assets
|
|
|
|
that would be available to your compiled project.</p>
|
|
|
|
<p>When running your project or creating a build bundle, a preset will look for this <code>src</code> directory for
|
|
|
|
the entry point(s) to your application and use this as the relative location for finding other assets
|
|
|
|
necessary for creating your builds.</p>
|
|
|
|
<h2 id="build-assets">Build Assets</h2>
|
|
|
|
<p>When creating a build bundle, a preset will put the compiled assets, including any generated
|
|
|
|
JavaScript files, into a directory named <code>build</code> by default. Typically your Neutrino preset will copy
|
|
|
|
any non-JavaScript files from the source directory over to the build directory, allowing you to maintain
|
|
|
|
the same relative path structure for static assets as is used for the source files.</p>
|
|
|
|
<p>Normally most projects will exclude checking in this build directory to source control.
|
|
|
|
Be sure to add this directory to your project's <code>.gitignore</code>, <code>.hgignore</code>, or similar file.</p>
|
|
|
|
<h2 id="testing">Testing</h2>
|
|
|
|
<p>Neutrino presets by default expect all tests to be located in a directory named <code>test</code>. In order to make the
|
|
|
|
separation between tests and test fixtures or harnesses easier to differentiate, Neutrino presets also
|
|
|
|
usually look for test files ending in <code>_test.js</code> or <code>.test.js</code>. See your specific test preset for more
|
|
|
|
detailed information about running tests and other conventions.</p>
|
|
|
|
|
|
|
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="usage.html" class="navigation navigation-prev " aria-label="Previous page: Usage">
|
|
|
|
<i class="fa fa-angle-left"></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
<a href="presets/" class="navigation navigation-next " aria-label="Next page: Presets">
|
|
|
|
<i class="fa fa-angle-right"></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var gitbook = gitbook || [];
|
|
|
|
gitbook.push(function() {
|
|
|
|
gitbook.page.hasChanged({"page":{"title":"Project Layout","level":"1.4","depth":1,"next":{"title":"Presets","level":"1.5","depth":1,"path":"presets/README.md","ref":"presets/README.md","articles":[{"title":"Web","level":"1.5.1","depth":2,"path":"presets/neutrino-preset-web/README.md","ref":"presets/neutrino-preset-web/README.md","articles":[]},{"title":"React","level":"1.5.2","depth":2,"path":"presets/neutrino-preset-react/README.md","ref":"presets/neutrino-preset-react/README.md","articles":[]},{"title":"Node.js","level":"1.5.3","depth":2,"path":"presets/neutrino-preset-node/README.md","ref":"presets/neutrino-preset-node/README.md","articles":[]},{"title":"Airbnb","level":"1.5.4","depth":2,"path":"presets/neutrino-preset-airbnb-base/README.md","ref":"presets/neutrino-preset-airbnb-base/README.md","articles":[]},{"title":"Karma","level":"1.5.5","depth":2,"path":"presets/neutrino-preset-karma/README.md","ref":"presets/neutrino-preset-karma/README.md","articles":[]},{"title":"Mocha","level":"1.5.6","depth":2,"path":"presets/neutrino-preset-mocha/README.md","ref":"presets/neutrino-preset-mocha/README.md","articles":[]},{"title":"Jest","level":"1.5.7","depth":2,"path":"presets/neutrino-preset-jest/README.md","ref":"presets/neutrino-preset-jest/README.md","articles":[]}]},"previous":{"title":"Usage","level":"1.3","depth":1,"path":"usage.md","ref":"usage.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":"project-layout.md","mtime":"2017-02-20T16:07:00.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-02-24T16:49:00.681Z"},"basePath":".","book":{"language":""}});
|
|
|
|
});
|
|
|
|
</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>
|
|
|
|
|