watch-dependency-graph
Advanced tools
Comparing version 0.1.0 to 0.2.0
26
index.js
@@ -96,14 +96,2 @@ const path = require('path') | ||
init() | ||
// const pointer = ids.indexOf(f) | ||
// // delete from ids and register | ||
// ids.splice(pointer, 1) | ||
// delete register[f] | ||
// // remove any references | ||
// for (const filepath of Object.keys(register)) { | ||
// const { entries, children } = register[filepath] | ||
// entries.splice(entries.indexOf(pointer), 1) | ||
// children.splice(children.indexOf(pointer), 1) | ||
// } | ||
} else { | ||
@@ -114,5 +102,5 @@ watcher.unwatch(f) | ||
const updatedFilepath = require.resolve(f) | ||
const { entries } = register[updatedFilepath] | ||
const { entries, children } = register[updatedFilepath] | ||
const prev = require.cache[updatedFilepath] | ||
const prev = require.cache[updatedFilepath] || require(updatedFilepath) | ||
delete require.cache[updatedFilepath] | ||
@@ -123,4 +111,4 @@ require(updatedFilepath) | ||
// diff prev/next | ||
const removedModuleIds = prev.children | ||
.filter(c => !next.children.find(_c => _c.id === c.id)) | ||
const removedModuleIds = (prev.children || []) | ||
.filter(c => !(next.children || []).find(_c => _c.id === c.id)) | ||
.map(c => c.id) | ||
@@ -130,3 +118,3 @@ | ||
next.children | ||
.filter(c => !prev.children.find(_c => _c.id === c.id)) | ||
.filter(c => !(prev.children || []).find(_c => _c.id === c.id)) | ||
.forEach(c => watcher.add(c.id)) | ||
@@ -179,2 +167,6 @@ | ||
const parentFile = ids[entryPointer] | ||
// clear entries so users can re-require | ||
delete require.cache[parentFile] | ||
walk( | ||
@@ -181,0 +173,0 @@ next.children, |
{ | ||
"name": "watch-dependency-graph", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -17,5 +17,12 @@ "main": "index.js", | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/sure-thing/watch-dependency-graph.git" | ||
}, | ||
"author": "estrattonbailey", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sure-thing/watch-dependency-graph/issues" | ||
}, | ||
"homepage": "https://github.com/sure-thing/watch-dependency-graph#readme", | ||
"dependencies": { | ||
@@ -22,0 +29,0 @@ "@arr/unique": "^1.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
1
0
13724
6
372