@modular-css/processor
Advanced tools
Comparing version 28.1.3 to 28.1.4
{ | ||
"name": "@modular-css/processor", | ||
"version": "28.1.3", | ||
"version": "28.1.4", | ||
"description": "A streamlined reinterpretation of CSS Modules", | ||
@@ -37,4 +37,3 @@ "main": "./processor.js", | ||
"postcss": "^8.0.0" | ||
}, | ||
"gitHead": "8dc538bffc4217d5c532f7b8f74ee2bba2ce8cd6" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// Generated by Peggy 2.0.0. | ||
// Generated by Peggy 2.0.1. | ||
// | ||
@@ -3,0 +3,0 @@ // https://peggyjs.org/ |
@@ -1,2 +0,2 @@ | ||
// Generated by Peggy 2.0.0. | ||
// Generated by Peggy 2.0.1. | ||
// | ||
@@ -3,0 +3,0 @@ // https://peggyjs.org/ |
@@ -1,2 +0,2 @@ | ||
// Generated by Peggy 2.0.0. | ||
// Generated by Peggy 2.0.1. | ||
// | ||
@@ -3,0 +3,0 @@ // https://peggyjs.org/ |
@@ -1,2 +0,2 @@ | ||
// Generated by Peggy 2.0.0. | ||
// Generated by Peggy 2.0.1. | ||
// | ||
@@ -3,0 +3,0 @@ // https://peggyjs.org/ |
@@ -47,3 +47,3 @@ "use strict"; | ||
if(rule.type !== "decl") { | ||
// eslint-disable-next-line consistent-return | ||
// eslint-disable-next-line consistent-return -- this seems fine | ||
return processor._addDependency({ | ||
@@ -50,0 +50,0 @@ dependency, |
@@ -17,3 +17,3 @@ "use strict"; | ||
AtRule : { | ||
// eslint-disable-next-line max-statements | ||
// eslint-disable-next-line max-statements -- too much state passing to extract | ||
value(rule) { | ||
@@ -20,0 +20,0 @@ const parsed = parser.parse(rule.params); |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
"use strict"; | ||
@@ -37,2 +36,3 @@ | ||
FILE_PREFIX, | ||
SELECTOR_PREFIX, | ||
} = keys; | ||
@@ -87,3 +87,2 @@ | ||
constructor(opts = {}) { | ||
/* eslint max-statements: [ "warn", 25 ] */ | ||
const options = { | ||
@@ -112,7 +111,4 @@ __proto__ : null, | ||
this._log = options.verbose ? | ||
// eslint-disable-next-line no-console | ||
console.log.bind(console, "[processor]") : | ||
// eslint-disable-next-line no-empty-function | ||
() => {}; | ||
// eslint-disable-next-line no-console, no-empty-function -- logging! | ||
this._log = options.verbose ? console.log.bind(console, "[processor]") : () => {}; | ||
@@ -240,5 +236,4 @@ this._loadFile = options.loadFile; | ||
// Mark the file & all files that depend on it invalid | ||
[ ...filterByPrefix(FILE_PREFIX, this._graph.dependantsOf(key)), normalized ].forEach((file) => { | ||
this._log("invalidate()", file); | ||
this._files[file].valid = false; | ||
@@ -248,2 +243,13 @@ | ||
}); | ||
// Mark all selectors in the file invalid | ||
filterByPrefix(SELECTOR_PREFIX, this._graph.dependenciesOf(key), { clean : false }).forEach((sKey) => { | ||
const data = this._graph.getNodeData(sKey); | ||
if(data.file !== normalized) { | ||
return; | ||
} | ||
data.valid = false; | ||
}); | ||
} | ||
@@ -303,4 +309,6 @@ | ||
// eslint-disable-next-line no-await-in-loop -- we're ok | ||
await this._files[dep].walked; | ||
// eslint-disable-next-line no-await-in-loop -- we got this | ||
const result = await this._after.process( | ||
@@ -430,2 +438,3 @@ // NOTE: the call to .clone() is really important here, otherwise this call | ||
selector, | ||
valid : true, | ||
}); | ||
@@ -435,2 +444,4 @@ | ||
this._graph.addDependency(fKey, sKey); | ||
} else { | ||
this._graph.getNodeData(sKey).valid = true; | ||
} | ||
@@ -498,4 +509,4 @@ | ||
// Remove any existing dependencies for the selector | ||
if(graph.hasNode(selectorId)) { | ||
// Remove any existing dependencies for the selector if it is invalid | ||
if(graph.hasNode(selectorId) && !graph.getNodeData(selectorId).valid) { | ||
graph.dependenciesOf(selectorId).forEach((other) => { | ||
@@ -525,3 +536,3 @@ graph.removeDependency(selectorId, other); | ||
if(other && other !== id) { | ||
// eslint-disable-next-line no-console | ||
// eslint-disable-next-line no-console -- warning | ||
console.warn(`POTENTIAL DUPLICATE FILES:\n\t${relative(this._options.cwd, other)}\n\t${relative(this._options.cwd, id)}`); | ||
@@ -554,2 +565,3 @@ } | ||
// eslint-disable-next-line no-await-in-loop -- it's cool | ||
file.result = await file.processed; | ||
@@ -556,0 +568,0 @@ |
164160
4998