Comparing version 0.4.0 to 0.4.1
@@ -0,1 +1,5 @@ | ||
# v0.4.1 | ||
- Re-process files when a dependency is deleted | ||
# v0.4.0 | ||
@@ -2,0 +6,0 @@ |
@@ -80,3 +80,3 @@ 'use strict'; | ||
this._customGenerators = new Map(); | ||
this._dependencies = new Map(); | ||
this.dependents = new Map(); | ||
@@ -192,14 +192,4 @@ this._processing = false; | ||
this.on('file', origPath => { | ||
let origins = new Set(); | ||
for (let [origin, deps] of this._dependencies.entries()) { | ||
if (deps.has(origPath)) { | ||
origins.add(origin); | ||
this._dependencies.delete(origin); | ||
} | ||
} | ||
for (let originPath of origins) { | ||
this.refile(originPath); | ||
} | ||
}); | ||
this.on('file', origPath => this._processDependents(origPath)); | ||
this.on('deleted', origPath => this._processDependents(origPath)); | ||
@@ -222,6 +212,6 @@ this._filePromises = null; | ||
if (from) { | ||
if (this._dependencies.has(from)) { | ||
this._dependencies.get(from).add(path$$1); | ||
if (this.dependents.has(from)) { | ||
this.dependents.get(from).add(path$$1); | ||
} else { | ||
this._dependencies.set(from, new Set([path$$1])); | ||
this.dependents.set(from, new Set([path$$1])); | ||
} | ||
@@ -359,2 +349,15 @@ } | ||
_processDependents(origPath) { | ||
let origins = new Set(); | ||
for (let [origin, deps] of this.dependents.entries()) { | ||
if (deps.has(origPath)) { | ||
origins.add(origin); | ||
this.dependents.delete(origin); | ||
} | ||
} | ||
for (let originPath of origins) { | ||
this.refile(originPath); | ||
} | ||
} | ||
static _relativePath(rootPath, absolutePath) { | ||
@@ -361,0 +364,0 @@ return path.relative(rootPath, absolutePath).replace(/\\/g, '/') |
@@ -76,3 +76,3 @@ import EventEmitter from 'events'; | ||
this._customGenerators = new Map(); | ||
this._dependencies = new Map(); | ||
this.dependents = new Map(); | ||
@@ -188,14 +188,4 @@ this._processing = false; | ||
this.on('file', origPath => { | ||
let origins = new Set(); | ||
for (let [origin, deps] of this._dependencies.entries()) { | ||
if (deps.has(origPath)) { | ||
origins.add(origin); | ||
this._dependencies.delete(origin); | ||
} | ||
} | ||
for (let originPath of origins) { | ||
this.refile(originPath); | ||
} | ||
}); | ||
this.on('file', origPath => this._processDependents(origPath)); | ||
this.on('deleted', origPath => this._processDependents(origPath)); | ||
@@ -218,6 +208,6 @@ this._filePromises = null; | ||
if (from) { | ||
if (this._dependencies.has(from)) { | ||
this._dependencies.get(from).add(path$$1); | ||
if (this.dependents.has(from)) { | ||
this.dependents.get(from).add(path$$1); | ||
} else { | ||
this._dependencies.set(from, new Set([path$$1])); | ||
this.dependents.set(from, new Set([path$$1])); | ||
} | ||
@@ -355,2 +345,15 @@ } | ||
_processDependents(origPath) { | ||
let origins = new Set(); | ||
for (let [origin, deps] of this.dependents.entries()) { | ||
if (deps.has(origPath)) { | ||
origins.add(origin); | ||
this.dependents.delete(origin); | ||
} | ||
} | ||
for (let originPath of origins) { | ||
this.refile(originPath); | ||
} | ||
} | ||
static _relativePath(rootPath, absolutePath) { | ||
@@ -357,0 +360,0 @@ return relative(rootPath, absolutePath).replace(/\\/g, '/') |
{ | ||
"name": "defiler", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A small, strange building block", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
60809
613