Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
[fixed] merge the Babel options manually instead of using the OptionM…
Browse files Browse the repository at this point in the history
…anager because webpack can only pass primitive values as query parameters
  • Loading branch information
thealjey committed Jan 27, 2016
1 parent 177b51c commit 9a3b6e5
Show file tree
Hide file tree
Showing 24 changed files with 505 additions and 1,891 deletions.
26 changes: 13 additions & 13 deletions docs/Compiler.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ <h3 class="subsection-title">Methods</h3>

<hr>
<dt>
<h4 class="name" id="done"><span class="type-signature">&lt;protected> </span>done(inPath, callback)</h4>
<h4 class="name" id=".done"><span class="type-signature">&lt;static> </span>done(inPath, callback)</h4>


</dt>
Expand Down Expand Up @@ -508,7 +508,7 @@ <h5>Parameters:</h5>

<h5>Example</h5>

<pre class="sunlight-highlight-javascript">compiler.done(&#x27;/path/to/an/input/file&#x27;, callback);</pre>
<pre class="sunlight-highlight-javascript">Compiler.done(&#x27;/path/to/an/input/file&#x27;, callback);</pre>



Expand All @@ -518,7 +518,7 @@ <h5>Example</h5>

<hr>
<dt>
<h4 class="name" id="fsWrite"><span class="type-signature">&lt;protected> </span>fsWrite(path, data, callback)</h4>
<h4 class="name" id=".fsWrite"><span class="type-signature">&lt;static> </span>fsWrite(path, data, callback)</h4>


</dt>
Expand Down Expand Up @@ -671,7 +671,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="Compiler.js.html">Compiler.js</a>,
<a href="Compiler.js.html#sunlight-1-line-99">line 99</a>
<a href="Compiler.js.html#sunlight-1-line-98">line 98</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -700,7 +700,7 @@ <h5>Parameters:</h5>

<h5>Example</h5>

<pre class="sunlight-highlight-javascript">compiler.fsWrite(&#x27;/path/to/an/output/file&#x27;, data, callback);</pre>
<pre class="sunlight-highlight-javascript">Compiler.fsWrite(&#x27;/path/to/an/output/file&#x27;, data, callback);</pre>



Expand All @@ -710,15 +710,15 @@ <h5>Example</h5>

<hr>
<dt>
<h4 class="name" id="gzip"><span class="type-signature"></span>gzip(data, callback)</h4>
<h4 class="name" id=".gzip"><span class="type-signature">&lt;static> </span>gzip(data, callback)</h4>


</dt>
<dd>


<div class="description">
<p>Z-zips the compiled code</p>
<p>G-zips the compiled code</p>
</div>


Expand Down Expand Up @@ -839,7 +839,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="Compiler.js.html">Compiler.js</a>,
<a href="Compiler.js.html#sunlight-1-line-152">line 152</a>
<a href="Compiler.js.html#sunlight-1-line-149">line 149</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -868,7 +868,7 @@ <h5>Parameters:</h5>

<h5>Example</h5>

<pre class="sunlight-highlight-javascript">compiler.gzip(data, callback);</pre>
<pre class="sunlight-highlight-javascript">Compiler.gzip(data, callback);</pre>



Expand All @@ -878,7 +878,7 @@ <h5>Example</h5>

<hr>
<dt>
<h4 class="name" id="mkdir"><span class="type-signature">&lt;protected> </span>mkdir(path, callback)</h4>
<h4 class="name" id=".mkdir"><span class="type-signature">&lt;static> </span>mkdir(path, callback)</h4>


</dt>
Expand Down Expand Up @@ -1007,7 +1007,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="Compiler.js.html">Compiler.js</a>,
<a href="Compiler.js.html#sunlight-1-line-131">line 131</a>
<a href="Compiler.js.html#sunlight-1-line-129">line 129</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -1036,7 +1036,7 @@ <h5>Parameters:</h5>

<h5>Example</h5>

<pre class="sunlight-highlight-javascript">compiler.mkdir(&#x27;/path/to/a/file&#x27;, callback);</pre>
<pre class="sunlight-highlight-javascript">Compiler.mkdir(&#x27;/path/to/a/file&#x27;, callback);</pre>



Expand Down Expand Up @@ -1223,7 +1223,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="Compiler.js.html">Compiler.js</a>,
<a href="Compiler.js.html#sunlight-1-line-172">line 172</a>
<a href="Compiler.js.html#sunlight-1-line-169">line 169</a>
</li>
</ul>
</dd>
Expand Down
47 changes: 22 additions & 25 deletions docs/Compiler.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,14 @@ <h1 class="page-title">Source: Compiler.js</h1>
* Executed when the compilation is complete
*
* @memberOf Compiler
* @instance
* @protected
* @static
* @method done
* @param {string} inPath - the input path
* @param {Function} callback - a callback function
* @example
* compiler.done('/path/to/an/input/file', callback);
* Compiler.done('/path/to/an/input/file', callback);
*/
done(inPath: string, callback: () => void) {
static done(inPath: string, callback: () => void) {
console.log('\x1b[32m%s. Compiled %s\x1b[0m', ++i, inPath);
callback();
}
Expand All @@ -156,37 +155,36 @@ <h1 class="page-title">Source: Compiler.js</h1>
* Writes the data to disk and then calls `done`.
*
* @memberOf Compiler
* @instance
* @static
* @private
* @method writeAndCallDone
* @param {string} inPath - the input path
* @param {string} outPath - the output path
* @param {ProgramData} data - processed application code with source maps
* @param {Function} callback - a callback function
* @example
* compiler.writeAndCallDone('/path/to/an/input/file', '/path/to/the/output/file', data, callback);
* Compiler.writeAndCallDone('/path/to/an/input/file', '/path/to/the/output/file', data, callback);
*/
writeAndCallDone(inPath: string, outPath: string, data: ProgramData, callback: () => void) {
this.fsWrite(outPath, data, () => {
this.done(inPath, callback);
static writeAndCallDone(inPath: string, outPath: string, data: ProgramData, callback: () => void) {
Compiler.fsWrite(outPath, data, () => {
Compiler.done(inPath, callback);
});
}

/**
* Writes the data to disk
*
* @memberOf Compiler
* @instance
* @protected
* @static
* @method fsWrite
* @param {string} path - the output path
* @param {ProgramData} data - the data to write
* @param {Function} callback - a callback function
* @example
* compiler.fsWrite('/path/to/an/output/file', data, callback);
* Compiler.fsWrite('/path/to/an/output/file', data, callback);
*/
fsWrite(path: string, data: ProgramData, callback: () => void) {
this.mkdir(path, () => {
static fsWrite(path: string, data: ProgramData, callback: () => void) {
Compiler.mkdir(path, () => {
writeFile(path, data.code, scriptErr => {
if (scriptErr) {
return console.error(scriptErr);
Expand All @@ -208,15 +206,14 @@ <h1 class="page-title">Source: Compiler.js</h1>
* Recursively creates a directory containing a file specified by `path`.
*
* @memberOf Compiler
* @instance
* @protected
* @static
* @method mkdir
* @param {string} path - a path to a file
* @param {Function} callback - a callback function
* @example
* compiler.mkdir('/path/to/a/file', callback);
* Compiler.mkdir('/path/to/a/file', callback);
*/
mkdir(path: string, callback: () => void) {
static mkdir(path: string, callback: () => void) {
mkdirp(dirname(path), mkdirpErr => {
if (mkdirpErr) {
return console.error(mkdirpErr);
Expand All @@ -226,17 +223,17 @@ <h1 class="page-title">Source: Compiler.js</h1>
}

/**
* Z-zips the compiled code
* G-zips the compiled code
*
* @memberOf Compiler
* @instance
* @static
* @method gzip
* @param {ProgramData} data - the actual program data to auto-prefix
* @param {GzipCallback} callback - a callback function
* @example
* compiler.gzip(data, callback);
* Compiler.gzip(data, callback);
*/
gzip(data: ProgramData, callback: GzipCallback) {
static gzip(data: ProgramData, callback: GzipCallback) {
gzip(data.code, (err, code) => {
if (err) {
return console.error(err);
Expand All @@ -261,11 +258,11 @@ <h1 class="page-title">Source: Compiler.js</h1>
*/
optimize(inPath: string, outPath: string, data: ProgramData, callback: () => void) {
if (!this.compress) {
this.writeAndCallDone(inPath, outPath, data, callback);
Compiler.writeAndCallDone(inPath, outPath, data, callback);
return;
}
this.gzip(data, result => {
this.writeAndCallDone(inPath, outPath, result, callback);
Compiler.gzip(data, result => {
Compiler.writeAndCallDone(inPath, outPath, result, callback);
});
}

Expand Down
2 changes: 1 addition & 1 deletion docs/Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="Documentation.js.html">Documentation.js</a>,
<a href="Documentation.js.html#sunlight-1-line-132">line 132</a>
<a href="Documentation.js.html#sunlight-1-line-195">line 195</a>
</li>
</ul>
</dd>
Expand Down
Loading

0 comments on commit 9a3b6e5

Please sign in to comment.