Skip to content

Commit f2799d0

Browse files
committed
update html
1 parent 48e3d37 commit f2799d0

File tree

2 files changed

+121
-16
lines changed

2 files changed

+121
-16
lines changed

docs/Manual.html

Lines changed: 118 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,12 @@ <h1><a href="https://github.com/bloomberg/bucklescript">BuckleScript</a> User Ma
632632
</li>
633633
<li><a href="#_build_system_support">Build system support</a>
634634
<ul class="sectlevel2">
635-
<li><a href="#_build_with_bsb">Build with bsb</a></li>
635+
<li><a href="#_bucklescript_build_system_code_bsb_code">BuckleScript build system: <code>bsb</code></a>
636+
<ul class="sectlevel3">
637+
<li><a href="#_build_with_other_bucklescript_dependencies">Build with other BuckleScript dependencies</a></li>
638+
<li><a href="#_mark_your_directory_as_dev_only">Mark your directory as dev only</a></li>
639+
</ul>
640+
</li>
636641
<li><a href="#_build_using_make">Build using Make</a></li>
637642
</ul>
638643
</li>
@@ -3769,27 +3774,22 @@ <h2 id="_build_system_support"><a class="anchor" href="#_build_system_support"><
37693774
</table>
37703775
</div>
37713776
<div class="sect2">
3772-
<h3 id="_build_with_bsb"><a class="anchor" href="#_build_with_bsb"></a>Build with bsb</h3>
3777+
<h3 id="_bucklescript_build_system_code_bsb_code"><a class="anchor" href="#_bucklescript_build_system_code_bsb_code"></a>BuckleScript build system: <code>bsb</code></h3>
37733778
<div class="paragraph">
3774-
<p>BuckleScript proivdes a native build tool using <a href="https://github.com/ninja-build/ninja/releases">ninja</a>,
3775-
it is designed for fast feedback loop (typically 100ms feedback loop).</p>
3779+
<p>BuckleScript proivdes a native build tool on top of Google&#8217;s <a href="https://github.com/ninja-build/ninja/releases">ninja-build</a>,
3780+
it is designed for fast feedback loop (typically 100ms feedback loop) and works cross platform.</p>
37763781
</div>
3777-
<div class="admonitionblock note">
3778-
<table>
3779-
<tr>
3780-
<td class="icon">
3781-
<div class="title">Note</div>
3782-
</td>
3783-
<td class="content">
3782+
<div class="exampleblock">
3783+
<div class="content">
37843784
<div class="paragraph">
3785-
<p>Currently user needs install ninja first (version &gt;= 1.7.1)</p>
3785+
<p>Currently for non-Windows users, they needs install ninja first (version &gt;= 1.7.1),
3786+
please don&#8217;t be confused with the npm ninja,
3787+
we are using Google&#8217;s <a href="https://github.com/ninja-build/ninja/releases">ninja-build</a>.</p>
3788+
</div>
37863789
</div>
3787-
</td>
3788-
</tr>
3789-
</table>
37903790
</div>
37913791
<div class="paragraph">
3792-
<p>It is a schema based build tool, the schema is
3792+
<p><code>bsb</code> can be running in any subdirectory, it is a schema based build tool, the schema is
37933793
<a href="http://bloomberg.github.io/bucklescript/docson/#build-schema.json">available</a></p>
37943794
</div>
37953795
<div class="paragraph">
@@ -3870,9 +3870,111 @@ <h3 id="_build_with_bsb"><a class="anchor" href="#_build_with_bsb"></a>Build wit
38703870
<pre class="pygments highlight"><code data-lang="sh">bsb -w</code></pre>
38713871
</div>
38723872
</div>
3873+
<div class="sect3">
3874+
<h4 id="_build_with_other_bucklescript_dependencies"><a class="anchor" href="#_build_with_other_bucklescript_dependencies"></a>Build with other BuckleScript dependencies</h4>
3875+
<div class="paragraph">
3876+
<p>List your dependency in <code>bs-dependencies</code> and install it via <code>npm install</code> as below:</p>
3877+
</div>
3878+
<div class="listingblock">
3879+
<div class="title">bsconfig.json</div>
3880+
<div class="content">
3881+
<pre class="pygments highlight"><code data-lang="js"><span class="tok-p">{</span>
3882+
<span class="tok-s2">&quot;name&quot;</span><span class="tok-o">:</span> <span class="tok-s2">&quot;bs-string&quot;</span><span class="tok-p">,</span>
3883+
<span class="tok-s2">&quot;version&quot;</span><span class="tok-o">:</span> <span class="tok-s2">&quot;0.1.3&quot;</span><span class="tok-p">,</span>
3884+
<span class="tok-s2">&quot;bs-dependencies&quot;</span><span class="tok-o">:</span> <span class="tok-p">[</span>
3885+
<span class="tok-s2">&quot;bs-mocha&quot;</span> <b class="conum">(1)</b>
3886+
<span class="tok-p">],</span>
3887+
<span class="tok-s2">&quot;sources&quot;</span><span class="tok-o">:</span> <span class="tok-p">[</span>
3888+
<span class="tok-p">..</span> <span class="tok-p">.</span>
3889+
<span class="tok-p">],</span>
3890+
<span class="tok-s2">&quot;generate-merlin&quot;</span> <span class="tok-o">:</span> <span class="tok-kc">true</span> <b class="conum">(2)</b>
3891+
<span class="tok-p">}</span></code></pre>
3892+
</div>
3893+
</div>
3894+
<div class="colist arabic">
3895+
<ol>
3896+
<li>
3897+
<p>Yet another BuckleScript dependency</p>
3898+
</li>
3899+
<li>
3900+
<p>bsb will generate merlin file for you</p>
3901+
</li>
3902+
</ol>
3903+
</div>
3904+
<div class="listingblock">
3905+
<div class="title">package.json</div>
3906+
<div class="content">
3907+
<pre class="pygments highlight"><code data-lang="js"><span class="tok-p">{</span>
3908+
<span class="tok-s2">&quot;dependencies&quot;</span><span class="tok-o">:</span> <span class="tok-p">{</span>
3909+
<span class="tok-s2">&quot;bs-mocha&quot;</span><span class="tok-o">:</span> <span class="tok-s2">&quot;0.1.5&quot;</span>
3910+
<span class="tok-p">},</span>
3911+
<span class="tok-p">...</span>
3912+
<span class="tok-p">}</span></code></pre>
3913+
</div>
3914+
</div>
3915+
<div class="paragraph">
3916+
<p>After your <code>npm install</code>,</p>
3917+
</div>
3918+
<div class="listingblock">
3919+
<div class="content">
3920+
<pre class="pygments highlight"><code data-lang="sh">bsb -clean-world <b class="conum">(1)</b>
3921+
bsb -make-world <b class="conum">(2)</b></code></pre>
3922+
</div>
3923+
</div>
3924+
<div class="colist arabic">
3925+
<ol>
3926+
<li>
3927+
<p>Clean the binary artifact of current build and your dependency</p>
3928+
</li>
3929+
<li>
3930+
<p>Build dependencies and lib itself</p>
3931+
</li>
3932+
</ol>
3933+
</div>
3934+
</div>
3935+
<div class="sect3">
3936+
<h4 id="_mark_your_directory_as_dev_only"><a class="anchor" href="#_mark_your_directory_as_dev_only"></a>Mark your directory as dev only</h4>
3937+
<div class="paragraph">
3938+
<p>Note sometimes, you have directories which are just tests that you don&#8217;t need your dependent
3939+
to build in that case you can mark it as dev only</p>
3940+
</div>
3941+
<div class="listingblock">
3942+
<div class="title">bsconfig.json</div>
3943+
<div class="content">
3944+
<pre class="pygments highlight"><code data-lang="js"><span class="tok-p">{</span>
3945+
<span class="tok-s2">&quot;sources&quot;</span> <span class="tok-o">:</span> <span class="tok-p">{</span>
3946+
<span class="tok-s2">&quot;dir&quot;</span> <span class="tok-o">:</span> <span class="tok-s2">&quot;test&quot;</span><span class="tok-p">,</span>
3947+
<span class="tok-s2">&quot;type&quot;</span> <span class="tok-o">:</span> <span class="tok-s2">&quot;dev&quot;</span> <b class="conum">(1)</b>
3948+
<span class="tok-p">}</span>
3949+
<span class="tok-p">}</span></code></pre>
3950+
</div>
3951+
</div>
3952+
<div class="colist arabic">
3953+
<ol>
3954+
<li>
3955+
<p>directory <code>test</code> is in dev mode, it will not be built when used as a dependency</p>
3956+
</li>
3957+
</ol>
3958+
</div>
3959+
</div>
38733960
</div>
38743961
<div class="sect2">
38753962
<h3 id="_build_using_make"><a class="anchor" href="#_build_using_make"></a>Build using Make</h3>
3963+
<div class="admonitionblock warning">
3964+
<table>
3965+
<tr>
3966+
<td class="icon">
3967+
<div class="title">Warning</div>
3968+
</td>
3969+
<td class="content">
3970+
<div class="paragraph">
3971+
<p><code>bsb</code> is officialy recommended build system, this section is listed here only for people who
3972+
are curious about how the build works</p>
3973+
</div>
3974+
</td>
3975+
</tr>
3976+
</table>
3977+
</div>
38763978
<div class="paragraph">
38773979
<p>BuckleScript distribution has <code>bsdep.exe</code> which has the same interface as <code>ocamldep</code></p>
38783980
</div>

docs/docson/build-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"ppx-specs": {
5252
"$ref": "#/definitions/ppx-specs"
5353
},
54+
"type" : {
55+
"enum" : ["dev", "lib"]
56+
},
5457
"files": {
5558
"oneOf": [
5659
{

0 commit comments

Comments
 (0)