Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable node debugger with debug flag #450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ a project setup from scratch :sparkles:.

Options:

-d, --debug output lots of logs
-d, --debug start node debugger
-h, --help print usage
-q, --quiet don't output any logs
-v, --version print version
Expand Down
18 changes: 12 additions & 6 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var USAGE = `

Options:

-d, --debug output lots of logs
-d, --debug start node debugger
-h, --help print usage
-q, --quiet don't output any logs
-v, --version print version
Expand Down Expand Up @@ -60,18 +60,18 @@ var CONFIG_USAGE = `
${clr('Configuration', 'bold')}


Bankai is built on top of compilers for scripts, styles and documents.
Each of them can be configured by adding a field to your project's
Bankai is built on top of compilers for scripts, styles and documents.
Each of them can be configured by adding a field to your project's
package.json file.

These three fields are, respectively: ${clr('"browserify"', 'cyan')}, ${clr('"sheetify"', 'cyan')} and
These three fields are, respectively: ${clr('"browserify"', 'cyan')}, ${clr('"sheetify"', 'cyan')} and
${clr('"documentify"', 'cyan')}. Each one should have a configuration object as it's value.

There is currently one possible configuration field: "transform".

It can be one of either:

1. An array of transform names.
1. An array of transform names.
ie: ${clr('[ "vueify" ]', 'cyan')}
2. An array of tuples transform name + configuration object.
ie: ${clr('[[ "vueify", { "sass": { "includePaths": [ "src/assets/css" ] } } ]]', 'cyan')}
Expand Down Expand Up @@ -103,7 +103,8 @@ var argv = minimist(process.argv.slice(2), {
help: 'h',
quiet: 'q',
version: 'v',
base: 'b'
base: 'b',
debug: 'd'
},
boolean: [
'help',
Expand All @@ -122,6 +123,11 @@ var argv = minimist(process.argv.slice(2), {
entry = process.cwd()
}

if (argv.debug) {
if (typeof argv.debug === 'number') process.debugPort = argv.debug
process.kill(process.pid, 'SIGUSR1')
}

if (argv.help) {
if (cmd === 'config') return console.log(CONFIG_USAGE)
console.log(USAGE)
Expand Down