-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d325cd
commit 73c65b4
Showing
11 changed files
with
662 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
node_modules | ||
.eslintrc | ||
.flowconfig | ||
.travis.yml | ||
test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
|
||
module.exports = function createNodemonArgs(argv) { | ||
var options = [] | ||
var args = [] | ||
var stopSlurping = false | ||
for (var i = 0; i < argv.length; i++) { | ||
if (stopSlurping) { | ||
args.push(argv[i]) | ||
continue | ||
} | ||
switch (argv[i]) { | ||
case '-e': | ||
case '--ext': | ||
case '-w': | ||
case '--watch': | ||
case '-i': | ||
case '--ignore': | ||
case '--delay': | ||
case '--signal': | ||
options.push(argv[i]) | ||
options.push(argv[++i]) | ||
break | ||
case '-q': | ||
case '--quiet': | ||
case '-L': | ||
case '--legacy-watch': | ||
case '-V': | ||
case '--verbose': | ||
options.push(argv[i]) | ||
break | ||
case '--': | ||
stopSlurping = true | ||
break | ||
default: | ||
args.push(argv[i]) | ||
} | ||
} | ||
if (!options.length) { | ||
options.push( | ||
'--ignore', 'node_modules/', | ||
'--watch', '*.js', | ||
'--watch', '*.jsx', | ||
'--watch', '*.js.flow', | ||
'--watch', '.flowconfig', | ||
'--ext', 'js,mjs,jsx,json' | ||
) | ||
} | ||
if (args.length) args.unshift('--') | ||
return options.concat([require.resolve('./runFlow')], args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict' | ||
|
||
var spawn = require('cross-spawn') | ||
var createNodemonArgs = require('./createNodemonArgs') | ||
|
||
spawn( | ||
process.execPath, | ||
[ | ||
require.resolve('nodemon/bin/nodemon'), | ||
].concat(createNodemonArgs(process.argv.slice(2))), | ||
{ | ||
stdio: 'inherit' | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict' | ||
|
||
var createNodemonArgs = require('../createNodemonArgs') | ||
var expect = require('chai').expect | ||
|
||
describe('createNodemonArgs', function () { | ||
it('with no input args', function () { | ||
expect(createNodemonArgs([])).to.deep.equal([ | ||
'--ignore', 'node_modules/', | ||
'--watch', '*.js', | ||
'--watch', '*.jsx', | ||
'--watch', '*.js.flow', | ||
'--watch', '.flowconfig', | ||
'--ext', 'js,mjs,jsx,json', | ||
require.resolve('../runFlow') | ||
]) | ||
}) | ||
it('with no nodemon-specific input args', function () { | ||
expect(createNodemonArgs(['--foo'])).to.deep.equal([ | ||
'--ignore', 'node_modules/', | ||
'--watch', '*.js', | ||
'--watch', '*.jsx', | ||
'--watch', '*.js.flow', | ||
'--watch', '.flowconfig', | ||
'--ext', 'js,mjs,jsx,json', | ||
require.resolve('../runFlow'), | ||
'--', | ||
'--foo' | ||
]) | ||
}) | ||
it('with nodemon-specific input args', function () { | ||
expect(createNodemonArgs(['--watch', '*.js.flow', '--foo'])).to.deep.equal([ | ||
'--watch', '*.js.flow', | ||
require.resolve('../runFlow'), | ||
'--', | ||
'--foo' | ||
]) | ||
}) | ||
it('with nodemon-specific input args and --', function () { | ||
expect(createNodemonArgs(['--watch', '*.js.flow', '--', '--verbose', '--foo'])).to.deep.equal([ | ||
'--watch', '*.js.flow', | ||
require.resolve('../runFlow'), | ||
'--', | ||
'--verbose', | ||
'--foo' | ||
]) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--reporter spec |
Oops, something went wrong.