babel-watch
Advanced tools
Comparing version 7.0.0 to 7.1.0
@@ -10,3 +10,2 @@ #!/usr/bin/env node | ||
const os = require('os'); | ||
const util = require('util'); | ||
const fork = require('child_process').fork; | ||
@@ -17,3 +16,2 @@ const execSync = require('child_process').execSync; | ||
const isString = require('lodash.isstring'); | ||
const isArray = require('lodash.isarray'); | ||
const isRegExp = require('lodash.isregexp'); | ||
@@ -35,3 +33,3 @@ | ||
if (!val) return new RegExp; | ||
if (isArray(val)) val = val.join("|"); | ||
if (Array.isArray(val)) val = val.join("|"); | ||
if (isString(val)) return new RegExp(val || ""); | ||
@@ -45,3 +43,3 @@ if (isRegExp(val)) return val; | ||
if (isString(val)) return (val ? val.split(',') : []); | ||
if (isArray(val)) return val; | ||
if (Array.isArray(val)) return val; | ||
throw new TypeError("illegal type for arrayify"); | ||
@@ -140,7 +138,6 @@ }; | ||
const debouncedHandleChange = debounce(handleChange, DEBOUNCE_DURATION); | ||
watcher.on('change', debouncedHandleChange); | ||
watcher.on('add', debouncedHandleChange); | ||
watcher.on('unlink', debouncedHandleChange); | ||
watcher.on('change', handleChange); | ||
watcher.on('add', handleChange); | ||
watcher.on('unlink', handleChange); | ||
@@ -168,2 +165,4 @@ watcher.on('ready', () => { | ||
const debouncedRestartApp = debounce(restartApp, DEBOUNCE_DURATION) | ||
function handleChange(file) { | ||
@@ -175,3 +174,3 @@ const absoluteFile = file.startsWith('/') ? file : path.join(cwd, file); | ||
// file is in use by the app, let's restart! | ||
restartApp(); | ||
debouncedRestartApp(); | ||
} | ||
@@ -223,3 +222,2 @@ | ||
const currentPipeFd = pipeFd; | ||
const currentPipeFilename = pipeFilename; | ||
@@ -310,3 +308,3 @@ let hasRestarted = false; | ||
runnerExecArgv.push(typeof(program.debug) === 'boolean' | ||
? `--debug` | ||
? `--debug` | ||
: `--debug=${program.debug}` | ||
@@ -323,3 +321,3 @@ ) | ||
const inspectArg = typeof(program.inspect) === 'boolean' | ||
? `--inspect` | ||
? `--inspect` | ||
: `--inspect=${program.inspect}` | ||
@@ -330,4 +328,4 @@ runnerExecArgv.push(inspectArg); | ||
if (program.inspectBrk) { | ||
const inspectBrkArg = typeof(program.inspectBrk) === 'boolean' | ||
? `--inspect-brk` | ||
const inspectBrkArg = typeof(program.inspectBrk) === 'boolean' | ||
? `--inspect-brk` | ||
: `--inspect-brk=${program.inspectBrk}` | ||
@@ -348,5 +346,5 @@ runnerExecArgv.push(inspectBrkArg) | ||
handleFileLoad(filename, (source, sourceMap) => { | ||
const sourceBuf = new Buffer(source || 0); | ||
const mapBuf = new Buffer(sourceMap ? JSON.stringify(sourceMap) : 0); | ||
const lenBuf = new Buffer(4); | ||
const sourceBuf = new Buffer.from(source || ''); | ||
const mapBuf = new Buffer.from(sourceMap ? JSON.stringify(sourceMap) : []); | ||
const lenBuf = new Buffer.alloc(4); | ||
if (pipeFd) { | ||
@@ -353,0 +351,0 @@ try { |
{ | ||
"name": "babel-watch", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "Reload your babel-node app on JS source file changes. And do it *fast*.", | ||
@@ -9,2 +9,5 @@ "main": "babel-watch.js", | ||
}, | ||
"engines": { | ||
"node": ">= 8" | ||
}, | ||
"repository": { | ||
@@ -31,9 +34,8 @@ "type": "git", | ||
"dependencies": { | ||
"chokidar": "^1.4.3", | ||
"commander": "^2.9.0", | ||
"chokidar": "^3.4.3", | ||
"commander": "^6.2.0", | ||
"lodash.debounce": "^4.0.8", | ||
"lodash.isarray": "^4.0.0", | ||
"lodash.isregexp": "^4.0.1", | ||
"lodash.isstring": "^4.0.1", | ||
"source-map-support": "^0.4.0" | ||
"source-map-support": "^0.5.19" | ||
}, | ||
@@ -40,0 +42,0 @@ "peerDependencies": { |
@@ -102,3 +102,5 @@ # babel-watch | ||
* `babel-watch >= 2.0.7` is compatible with `@babel/core` version `7.0.0` and above | ||
`babel-watch`'s versions now mirror the major version range of the Babel version it is compatible with. Currently, that is `7.x`. | ||
* `babel-watch >= 2.0.7` (and now `7.x`) is compatible with `@babel/core` version `7.0.0` and above | ||
* `babel-watch < 2.0.7 && >= 2.0.2` is compatible with `babel-core` version `6.5.1` | ||
@@ -105,0 +107,0 @@ * `babel-watch <= 2.0.1` is compatible with `babel-core` from `6.4.x` up to `6.5.0` |
@@ -11,3 +11,3 @@ 'use strict'; | ||
let pipeFd; | ||
const BUFFER = new Buffer(10 * 1024); | ||
const BUFFER = new Buffer.alloc(10 * 1024); | ||
@@ -19,3 +19,3 @@ // Node by default uses '.js' loader to load all the files with unknown extensions | ||
let bytes = 0; | ||
while (bytes !== 4) { | ||
while (typeof bytes === 'number' && bytes !== 4) { | ||
bytes = fs.readSync(fd, BUFFER, 0, 4); | ||
@@ -28,3 +28,3 @@ } | ||
let length = readLength(fd); | ||
let result = new Buffer(0); | ||
let result = new Buffer.alloc(0); | ||
while (length > 0) { | ||
@@ -31,0 +31,0 @@ const newBytes = fs.readSync(fd, BUFFER, 0, Math.min(BUFFER.length, length)); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
701236
7
26924
145
3
6
4
+ Addedanymatch@3.1.3(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedcommander@6.2.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedlodash.isarray@^4.0.0
- Removedanymatch@1.3.2(transitive)
- Removedarr-diff@2.0.04.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-unique@0.2.10.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedasync-each@1.0.6(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbinary-extensions@1.13.1(transitive)
- Removedbindings@1.5.0(transitive)
- Removedbraces@1.8.52.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedchokidar@1.7.0(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removedexpand-brackets@0.1.52.1.4(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@0.3.22.0.4(transitive)
- Removedfile-uri-to-path@1.0.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.44.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfsevents@1.2.13(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-binary-path@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.03.0.04.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedlodash.isarray@4.0.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.113.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednan@2.22.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedreaddirp@2.2.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-support@0.4.18(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedchokidar@^3.4.3
Updatedcommander@^6.2.0
Updatedsource-map-support@^0.5.19