diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..b709e0ef --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +open_collective: nodemon diff --git a/.github/stale.yml b/.github/stale.yml index 0d5c7a4e..9046dde3 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -6,6 +6,7 @@ daysUntilClose: 7 exemptLabels: - pinned - security + - not-stale # Label to use when marking an issue as stale staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 6a225619..e2a448b4 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -7,6 +7,7 @@ module.exports = { execMap: { py: 'python', rb: 'ruby', + ts: 'ts-node', // more can be added here such as ls: lsc - but please ensure it's cross // compatible with linux, mac and windows, or make the default.js // dynamically append the `.cmd` for node based utilities diff --git a/lib/monitor/run.js b/lib/monitor/run.js index e5493384..7084c6bf 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -91,7 +91,7 @@ function run(options) { const shouldFork = !config.options.spawn && !inBinPath && - firstArg.indexOf('-') === -1 && // don't fork if there's a node exec arg + !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg firstArg !== 'inspect' && // don't fork it's `inspect` debugger executable === 'node' && // only fork if node utils.version.major > 4 // only fork if node version > 4 @@ -133,6 +133,12 @@ function run(options) { bus.stdout = child.stdout; bus.stderr = child.stderr; } + + if (shouldFork) { + child.on('message', function (message, sendHandle) { + bus.emit('message', message, sendHandle); + }); + } } bus.emit('start'); diff --git a/lib/utils/index.js b/lib/utils/index.js index d49f8c5e..c4803383 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -69,7 +69,7 @@ var utils = (module.exports = { args.map(function (arg) { // if an argument contains a space, we want to show it with quotes // around it to indicate that it is a single argument - if (arg.indexOf(' ') === -1) { + if (arg.length > 0 && arg.indexOf(' ') === -1) { return arg; } // this should correctly escape nested quotes