Socket
Socket
Sign inDemoInstall

@modular-css/processor

Package Overview
Dependencies
23
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 23.0.4 to 24.0.0

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

# [24.0.0](https://github.com/tivac/modular-css/compare/v23.0.6...v24.0.0) (2019-05-08)
### Code Refactoring
* **processor:** add dupewarn option and no longer resolve path case ([#582](https://github.com/tivac/modular-css/issues/582)) ([01581f9](https://github.com/tivac/modular-css/commit/01581f9)), closes [#581](https://github.com/tivac/modular-css/issues/581)
### BREAKING CHANGES
* **processor:**
## [23.0.4](https://github.com/tivac/modular-css/compare/v23.0.3...v23.0.4) (2019-04-03)

@@ -8,0 +24,0 @@

9

lib/normalize.js
"use strict";
const path = require("path");
const filecase = require("true-case-path");

@@ -10,8 +9,4 @@ module.exports = (cwd, file) => {

}
file = path.normalize(file);
// If the file doesn't exist filecase() returns undefined, so in that
// instance just use whatever was sent
return filecase(file) || file;
return path.normalize(file);
};

@@ -5,3 +5,2 @@ "use strict";

const resolve = require("resolve-from").silent;
const pathcase = require("true-case-path");

@@ -20,8 +19,4 @@ exports.resolve = (src, file) => resolve(path.dirname(src), file);

if(!result) {
throw new Error(`Unable to locate "${file}" from "${src}"`);
}
return pathcase(result);
return result;
};
};
{
"name": "@modular-css/processor",
"version": "23.0.4",
"version": "24.0.0",
"description": "A streamlined reinterpretation of CSS Modules",

@@ -28,3 +28,3 @@ "main": "./processor.js",

"dependency-graph": "^0.8.0",
"escape-string-regexp": "^1.0.5",
"escape-string-regexp": "^2.0.0",
"lodash": "^4.17.0",

@@ -35,4 +35,3 @@ "postcss": "^7.0.0",

"postcss-value-parser": "^3.3.0",
"resolve-from": "^4.0.0",
"true-case-path": "^1.0.2",
"resolve-from": "^5.0.0",
"unique-slug": "^2.0.0"

@@ -43,3 +42,3 @@ },

},
"gitHead": "643955c26f6b9dc485d437b385f5e9f557c5c669"
"gitHead": "68b2bc0d3ecf962dae6e543e4cab39537e4046e2"
}

@@ -46,2 +46,3 @@ /* eslint-disable no-await-in-loop */

postcss : {},
dupewarn : true,
},

@@ -78,2 +79,3 @@ opts

this._graph = new Graph();
this._ids = new Map();

@@ -179,6 +181,8 @@ this._before = postcss([

deps.concat(source).forEach((file) => {
[ ...deps, source ].forEach((file) => {
this._log("invalidate()", file);
this._files[file].valid = false;
this._ids.delete(file.toLowerCase());
});

@@ -286,3 +290,3 @@ }

root.append([ comment ].concat(result.root.nodes));
root.append([ comment, ...result.root.nodes ]);

@@ -340,2 +344,15 @@ const idx = root.index(comment);

async _add(id, text) {
const check = id.toLowerCase();
// Warn about potential dupes if an ID goes past we've seen before
if(this._options.dupewarn) {
const other = this._ids.get(check);
if(other && other !== id) {
console.warn(`POTENTIAL DUPLICATE FILES:\n\t${relative(this._options.cwd, other)}\n\t${relative(this._options.cwd, id)}`);
}
}
this._ids.set(check, id);
this._log("_add()", id);

@@ -345,3 +362,3 @@

const deps = this._graph.dependenciesOf(id).concat(id);
const deps = [ ...this._graph.dependenciesOf(id), id ];

@@ -348,0 +365,0 @@ for(const dep of deps) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc