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

Commit

Permalink
[fixed] updated to Flow v0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thealjey committed Sep 29, 2015
1 parent 1ecb8ab commit d6a7c07
Show file tree
Hide file tree
Showing 44 changed files with 112 additions and 106 deletions.
2 changes: 1 addition & 1 deletion bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {join} from 'path';
import JS from '../lib/JS';
import NativeProcess from '../lib/NativeProcess';

var rootDir = join(__dirname, '..'),
const rootDir = join(__dirname, '..'),
buildDir = join(rootDir, 'build'),
libDir = join(rootDir, 'lib'),
docsDir = join(rootDir, 'docs'),
Expand Down
2 changes: 1 addition & 1 deletion build/DevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _path = require('path');
* import {DevServer} from 'webcompiler';
* import {join} from 'path';
*
* var rootDir = join(__dirname, '..'),
* let rootDir = join(__dirname, '..'),
* devDir = join(rootDir, 'development'),
* server = new DevServer(join(devDir, 'script.js'), join(devDir, 'app.scss'), devDir);
*
Expand Down
2 changes: 1 addition & 1 deletion build/JS.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var i = 0;
* @example
* import {JS} from 'webcompiler';
*
* var js = new JS();
* let js = new JS();
*/

var JS = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/JSLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var _path = require('path');
* import {JSLint} from 'webcompiler';
* import {join} from 'path';
*
* var linter = new JSLint();
* let linter = new JSLint();
*/

var JSLint = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/NativeProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var _child_process = require('child_process');
* @example
* import {NativeProcess} from 'webcompiler';
*
* var mkdir = new NativeProcess('mkdir');
* let mkdir = new NativeProcess('mkdir');
*/

var NativeProcess = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/SASS.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var i = 0;
* @example
* import {SASS} from 'webcompiler';
*
* var sass = new SASS();
* let sass = new SASS();
*/

var SASS = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/SASSCompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var options = {
* @example
* import {SASSCompile} from 'webcompiler';
*
* var compiler = new SASSCompile();
* let compiler = new SASSCompile();
*/

var SASSCompile = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/SASSLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var config = (0, _path.join)(__dirname, '..', 'config', 'scsslint.yml');
* import {SASSLint} from 'webcompiler';
* import {join} from 'path';
*
* var linter = new SASSLint();
* let linter = new SASSLint();
*/

var SASSLint = (function () {
Expand Down
2 changes: 1 addition & 1 deletion build/cssMin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _cleanCss2 = _interopRequireDefault(_cleanCss);
* @example
* import {cssMin} from 'webcompiler';
*
* var minified = cssMin({code: 'some css rules', map: 'source map contents'});
* let minified = cssMin({code: 'some css rules', map: 'source map contents'});
* // minified -> {code: string, map: string}
*/

Expand Down
2 changes: 1 addition & 1 deletion build/jsMin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var config = { mangle: false, output: { space_colon: false }, inSourceMap: '', o
* @example
* import {jsMin} from 'webcompiler';
*
* var minified = jsMin('/path/to/a/script/file.js');
* let minified = jsMin('/path/to/a/script/file.js');
* // minified -> {code: string, map: string}
*/

Expand Down
3 changes: 2 additions & 1 deletion build/jsWebCompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ function jsWebCompile(inPath, outPath, callback) {
config.output.filename = parsed.base;
config.devtool = (devMode ? 'eval-' : '') + 'source-map';
(0, _webpack2['default'])(config, function (e, stats) {
var jsonStats, errors;
var jsonStats = undefined,
errors = undefined;

if (e) {
return callback([e]);
Expand Down
2 changes: 1 addition & 1 deletion docs/DevServer.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ <h5>Example</h5>
<pre class="prettyprint"><code>import {DevServer} from 'webcompiler';
import {join} from 'path';

var rootDir = join(__dirname, '..'),
let rootDir = join(__dirname, '..'),
devDir = join(rootDir, 'development'),
server = new DevServer(join(devDir, 'script.js'), join(devDir, 'app.scss'), devDir);

Expand Down
2 changes: 1 addition & 1 deletion docs/JS.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {JS} from 'webcompiler';

var js = new JS();</code></pre>
let js = new JS();</code></pre>



Expand Down
2 changes: 1 addition & 1 deletion docs/JSLint.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h5>Example</h5>
<pre class="prettyprint"><code>import {JSLint} from 'webcompiler';
import {join} from 'path';

var linter = new JSLint();</code></pre>
let linter = new JSLint();</code></pre>



Expand Down
2 changes: 1 addition & 1 deletion docs/NativeProcess.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {NativeProcess} from 'webcompiler';

var mkdir = new NativeProcess('mkdir');</code></pre>
let mkdir = new NativeProcess('mkdir');</code></pre>



Expand Down
2 changes: 1 addition & 1 deletion docs/SASS.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {SASS} from 'webcompiler';

var sass = new SASS();</code></pre>
let sass = new SASS();</code></pre>



Expand Down
2 changes: 1 addition & 1 deletion docs/SASSCompile.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {SASSCompile} from 'webcompiler';

var compiler = new SASSCompile();</code></pre>
let compiler = new SASSCompile();</code></pre>



Expand Down
2 changes: 1 addition & 1 deletion docs/SASSLint.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h5>Example</h5>
<pre class="prettyprint"><code>import {SASSLint} from 'webcompiler';
import {join} from 'path';

var linter = new SASSLint();</code></pre>
let linter = new SASSLint();</code></pre>



Expand Down
4 changes: 2 additions & 2 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {cssMin} from 'webcompiler';

var minified = cssMin({code: 'some css rules', map: 'source map contents'});
let minified = cssMin({code: 'some css rules', map: 'source map contents'});
// minified -> {code: string, map: string}</code></pre>


Expand Down Expand Up @@ -637,7 +637,7 @@ <h5>Example</h5>

<pre class="prettyprint"><code>import {jsMin} from 'webcompiler';

var minified = jsMin('/path/to/a/script/file.js');
let minified = jsMin('/path/to/a/script/file.js');
// minified -> {code: string, map: string}</code></pre>


Expand Down
4 changes: 2 additions & 2 deletions lib/DevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {join} from 'path';
* import {DevServer} from 'webcompiler';
* import {join} from 'path';
*
* var rootDir = join(__dirname, '..'),
* let rootDir = join(__dirname, '..'),
* devDir = join(rootDir, 'development'),
* server = new DevServer(join(devDir, 'script.js'), join(devDir, 'app.scss'), devDir);
*
Expand All @@ -43,7 +43,7 @@ export default class DevServer {
server: WebpackDevServer;

constructor(script: string, style: string, devDir: string, port: number = 3000, react: boolean = true) {
var sass = new SASS(), loaders = [];
const sass = new SASS(), loaders = [];

if (react) {
loaders.push('react-hot');
Expand Down
16 changes: 8 additions & 8 deletions lib/JS.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {writeFile} from 'fs';
import {dirname} from 'path';
import mkdirp from 'mkdirp';

var i = 0;
let i = 0;

/**
* A JavaScript compiler
Expand All @@ -21,7 +21,7 @@ var i = 0;
* @example
* import {JS} from 'webcompiler';
*
* var js = new JS();
* let js = new JS();
*/
export default class JS {

Expand Down Expand Up @@ -104,7 +104,7 @@ export default class JS {
* // compiled successfully
* }, true);
*/
webCompile(inPath: string, outPath: string, callback: any, devMode: boolean) {
webCompile(inPath: string, outPath: string, callback: Function, devMode: boolean) {
jsWebCompile(inPath, outPath, function (compileErr) {
if (compileErr) {
compileErr.forEach(function (err) {
Expand All @@ -131,7 +131,7 @@ export default class JS {
* // compiled successfully
* });
*/
feDev(inPath: string, outPath: string, callback: any) {
feDev(inPath: string, outPath: string, callback: Function) {
this.webCompile(inPath, outPath, callback, true);
}

Expand All @@ -150,10 +150,10 @@ export default class JS {
* // compiled successfully
* }, '/lint/this/directory/too');
*/
feProd(inPath: string, outPath: string, callback: any, ...lintPaths: Array<string>) {
feProd(inPath: string, outPath: string, callback: Function, ...lintPaths: Array<string>) {
this.validate(inPath, lintPaths, () => {
this.webCompile(inPath, outPath, function () {
var minified = jsMin(outPath);
const minified = jsMin(outPath);

gzip(minified.code, function (gzipErr, code) {
if (gzipErr) {
Expand Down Expand Up @@ -191,7 +191,7 @@ export default class JS {
* // compiled successfully
* }, '/lint/this/directory/too');
*/
beFile(inPath: string, outPath: string, callback: any, ...lintPaths: Array<string>) {
beFile(inPath: string, outPath: string, callback: Function, ...lintPaths: Array<string>) {
this.validate(inPath, lintPaths, function () {
jsNodeCompileFile(inPath, function (compileErr, code) {
if (compileErr) {
Expand Down Expand Up @@ -228,7 +228,7 @@ export default class JS {
* // compiled successfully
* }, '/lint/this/directory/too');
*/
beDir(inPath: string, outPath: string, callback: any, ...lintPaths: Array<string>) {
beDir(inPath: string, outPath: string, callback: Function, ...lintPaths: Array<string>) {
this.validate(inPath, lintPaths, function () {
jsNodeCompileDir(inPath, outPath, function (compileErr) {
if (compileErr) {
Expand Down
4 changes: 2 additions & 2 deletions lib/JSLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {join} from 'path';
* import {JSLint} from 'webcompiler';
* import {join} from 'path';
*
* var linter = new JSLint();
* let linter = new JSLint();
*/
export default class JSLint {

Expand Down Expand Up @@ -52,7 +52,7 @@ export default class JSLint {
* });
*/
run(paths: Array<string>, callback: any) {
var report = this.linter.executeOnFiles(paths), errors = [];
const report = this.linter.executeOnFiles(paths), errors = [];

report.results.forEach(function (f) {
f.messages.forEach(function (e) {
Expand Down
4 changes: 2 additions & 2 deletions lib/NativeProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {spawn} from 'child_process';
* @example
* import {NativeProcess} from 'webcompiler';
*
* var mkdir = new NativeProcess('mkdir');
* let mkdir = new NativeProcess('mkdir');
*/
export default class NativeProcess {

Expand Down Expand Up @@ -50,7 +50,7 @@ export default class NativeProcess {
* }, ['example']);
*/
run(callback: any, args: Array<string> = [], opts: Object = {}) {
var stdout = '', stderr = '';
let stdout = '', stderr = '';

if (this.proc) {
this.proc.kill();
Expand Down
10 changes: 5 additions & 5 deletions lib/SASS.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {writeFile} from 'fs';
import {dirname} from 'path';
import mkdirp from 'mkdirp';

var i = 0;
let i = 0;

/**
* A SASS compiler
Expand All @@ -22,7 +22,7 @@ var i = 0;
* @example
* import {SASS} from 'webcompiler';
*
* var sass = new SASS();
* let sass = new SASS();
*/
export default class SASS {

Expand Down Expand Up @@ -160,7 +160,7 @@ export default class SASS {
* // compiled successfully
* });
*/
feDev(inPath: string, outPath: string, callback: any) {
feDev(inPath: string, outPath: string, callback: Function) {
this.webCompile(inPath, outPath, result => {
this.fsWrite(inPath, outPath, result, callback);
});
Expand All @@ -181,10 +181,10 @@ export default class SASS {
* // compiled successfully
* }, '/lint/this/directory/too');
*/
feProd(inPath: string, outPath: string, callback: any, ...lintPaths: Array<string>) {
feProd(inPath: string, outPath: string, callback: Function, ...lintPaths: Array<string>) {
this.validate(inPath, lintPaths, () => {
this.webCompile(inPath, outPath, result => {
var minified = cssMin(result);
const minified = cssMin(result);

gzip(minified.code, (gzipErr, code) => {
if (gzipErr) {
Expand Down
4 changes: 2 additions & 2 deletions lib/SASSCompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {render} from 'node-sass';
import importer from 'node-sass-import-once';

var options = {
const options = {
file: null,
outFile: null,
importer,
Expand All @@ -24,7 +24,7 @@ var options = {
* @example
* import {SASSCompile} from 'webcompiler';
*
* var compiler = new SASSCompile();
* let compiler = new SASSCompile();
*/
export default class SASSCompile {

Expand Down
6 changes: 3 additions & 3 deletions lib/SASSLint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import NativeProcess from './NativeProcess';
import {join} from 'path';

var config = join(__dirname, '..', 'config', 'scsslint.yml');
const config = join(__dirname, '..', 'config', 'scsslint.yml');

/**
* A SASS linter
Expand All @@ -14,7 +14,7 @@ var config = join(__dirname, '..', 'config', 'scsslint.yml');
* import {SASSLint} from 'webcompiler';
* import {join} from 'path';
*
* var linter = new SASSLint();
* let linter = new SASSLint();
*/
export default class SASSLint {

Expand Down Expand Up @@ -63,7 +63,7 @@ export default class SASSLint {
* });
*/
run(paths: Array<string>, callback: Function) {
var args = paths.concat(['-c', config]);
const args = paths.concat(['-c', config]);

if (this.excludeLinter) {
args.push('-x', this.excludeLinter);
Expand Down
2 changes: 1 addition & 1 deletion lib/cssAutoprefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function cssAutoprefix(data: Object, styleFile: string, callback:
to: styleFile,
map: {prev: data.map}
}).then(function (result) {
var warnings = result.warnings();
const warnings = result.warnings();

if (warnings.length) {
return callback(warnings.map(item => item.toString()));
Expand Down
Loading

0 comments on commit d6a7c07

Please sign in to comment.