Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

opticss

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opticss - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

12

CHANGELOG.md

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

## [0.6.2](https://github.com/linkedin/opticss/compare/opticss@0.6.1...opticss@0.6.2) (2019-05-02)
### Bug Fixes
* Better support for legacy source map types. ([976d3d9](https://github.com/linkedin/opticss/commit/976d3d9))
* Linting issues. ([b605d9b](https://github.com/linkedin/opticss/commit/b605d9b))
## [0.6.1](https://github.com/linkedin/opticss/compare/opticss@0.6.0...opticss@0.6.1) (2019-04-30)

@@ -8,0 +20,0 @@

3

dist/src/CssFile.d.ts
import * as postcss from "postcss";
import { RawSourceMap } from "source-map";
import { LegacyRawSourceMap } from "./util/adaptSourceMap";
/**

@@ -23,3 +24,3 @@ * Represents a single CSS file and its associated meta-data.

*/
sourceMap?: RawSourceMap | string;
sourceMap?: LegacyRawSourceMap | RawSourceMap | string;
}

@@ -26,0 +27,0 @@ export interface ParsedCssFile {

@@ -12,7 +12,12 @@ "use strict";

if (!sourceMap && file.content.map) {
sourceMap = adaptSourceMap_1.adaptSourceMap(file.content.map.toJSON());
sourceMap = file.content.map.toJSON();
}
return sourceMap;
if (typeof sourceMap === "object") {
return adaptSourceMap_1.adaptFromLegacySourceMap(sourceMap);
}
else {
return sourceMap;
}
}
exports.sourceMapFromCssFile = sourceMapFromCssFile;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ3NzRmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Dc3NGaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0EsMERBQXVEO0FBcUN2RDs7OztHQUlHO0FBQ0gsU0FBZ0Isb0JBQW9CLENBQUMsSUFBYTtJQUNoRCxJQUFJLFNBQVMsR0FBc0MsSUFBSSxDQUFDLFNBQVMsQ0FBQztJQUNsRSxJQUFJLENBQUMsU0FBUyxJQUFxQixJQUFJLENBQUMsT0FBUSxDQUFDLEdBQUcsRUFBRTtRQUNwRCxTQUFTLEdBQUcsK0JBQWMsQ0FBa0IsSUFBSSxDQUFDLE9BQVEsQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQztLQUN6RTtJQUNELE9BQU8sU0FBUyxDQUFDO0FBQ25CLENBQUM7QUFORCxvREFNQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ3NzRmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Dc3NGaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBR0EsMERBQXFGO0FBcUNyRjs7OztHQUlHO0FBQ0gsU0FBZ0Isb0JBQW9CLENBQUMsSUFBYTtJQUNoRCxJQUFJLFNBQVMsR0FBMkQsSUFBSSxDQUFDLFNBQVMsQ0FBQztJQUN2RixJQUFJLENBQUMsU0FBUyxJQUFxQixJQUFJLENBQUMsT0FBUSxDQUFDLEdBQUcsRUFBRTtRQUNwRCxTQUFTLEdBQW9CLElBQUksQ0FBQyxPQUFRLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRSxDQUFDO0tBQ3pEO0lBQ0QsSUFBSSxPQUFPLFNBQVMsS0FBSyxRQUFRLEVBQUU7UUFDakMsT0FBTyx5Q0FBd0IsQ0FBQyxTQUFTLENBQUMsQ0FBQztLQUM1QztTQUFNO1FBQ0wsT0FBTyxTQUFTLENBQUM7S0FDbEI7QUFDSCxDQUFDO0FBVkQsb0RBVUMifQ==

@@ -9,2 +9,3 @@ import * as postcss from "postcss";

export * from "./parseSelector";
export * from "./util/adaptSourceMap";
export * from "./util/IdentGenerator";

@@ -11,0 +12,0 @@ export * from "./Actions";

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

__export(require("./parseSelector"));
__export(require("./util/adaptSourceMap"));
__export(require("./util/IdentGenerator"));

@@ -22,2 +23,2 @@ __export(require("./Actions"));

exports.Optimizer = Optimizer_1.Optimizer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxtQ0FBbUM7QUFpQmpDLDBCQUFPO0FBaEJULGlFQUFpRTtBQWlCL0Qsc0RBQXFCO0FBaEJ2Qix3REFBd0Q7QUFpQnRELHNDQUFhO0FBZmYsK0JBQTBCO0FBQzFCLDhCQUF5QjtBQUN6Qiw2QkFBd0I7QUFDeEIsc0NBQWlDO0FBQ2pDLHFDQUFnQztBQUNoQywyQ0FBc0M7QUFDdEMsK0JBQTBCO0FBQzFCLHlDQUlxQjtBQURuQixnQ0FBQSxTQUFTLENBQUEifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxtQ0FBbUM7QUFrQmpDLDBCQUFPO0FBakJULGlFQUFpRTtBQWtCL0Qsc0RBQXFCO0FBakJ2Qix3REFBd0Q7QUFrQnRELHNDQUFhO0FBaEJmLCtCQUEwQjtBQUMxQiw4QkFBeUI7QUFDekIsNkJBQXdCO0FBQ3hCLHNDQUFpQztBQUNqQyxxQ0FBZ0M7QUFDaEMsMkNBQXNDO0FBQ3RDLDJDQUFzQztBQUN0QywrQkFBMEI7QUFDMUIseUNBSXFCO0FBRG5CLGdDQUFBLFNBQVMsQ0FBQSJ9

@@ -154,3 +154,3 @@ "use strict";

let result = file.content.root.toResult(resultOpts);
output.add(file.filename || "optimized-input.css", result.css, adaptSourceMap_1.adaptSourceMap(result.map.toJSON()));
output.add(file.filename || "optimized-input.css", result.css, adaptSourceMap_1.adaptFromLegacySourceMap(result.map.toJSON()));
}

@@ -227,2 +227,2 @@ this.logTiming("concatenate", start, new Date());

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT3B0aW1pemVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL09wdGltaXplci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHdEQU0rQjtBQUMvQixpREFBa0Q7QUFDbEQsbUNBQW1DO0FBSW5DLGlEQUE0RDtBQUM1RCxxREFBbUU7QUFDbkUseURBQXNEO0FBQ3RELG1EQUt5QjtBQUN6QiwwREFBdUQ7QUFrQnZELE1BQWEsU0FBUztJQWdCcEI7Ozs7Ozs7OztPQVNHO0lBQ0gsWUFBWSxPQUFnQyxFQUFFLGVBQW9EO1FBRWhHLGtEQUFrRDtRQUNsRCxJQUFJLFFBQVEsQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRTtZQUN4QyxNQUFNLElBQUksS0FBSyxDQUFDLHVDQUF1QyxDQUFDLENBQUM7U0FDMUQ7UUFFRCxJQUFJLENBQUMsT0FBTyxHQUFHLEVBQUUsQ0FBQztRQUNsQixJQUFJLENBQUMsUUFBUSxHQUFHLEVBQUUsQ0FBQztRQUNuQix1RkFBdUY7UUFDdkYsSUFBSSxDQUFDLE9BQU8sR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxnQ0FBZSxFQUFFLE9BQU8sQ0FBQyxDQUFDO1FBQzNELElBQUksQ0FBQyxlQUFlLEdBQUcsdUNBQXdCLENBQUM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0FBMEI7Z0JBQ3ZDLElBQUksRUFBRSxJQUFJLENBQUMsUUFBUTtnQkFDbkIsR0FBRyxFQUFFO29CQUNILE1BQU0sRUFBRSxLQUFLO29CQUNiLElBQUksRUFBRSxJQUFJLENBQUMsU0FBUztvQkFDcEIsY0FBYyxFQUFFLElBQUk7b0JBQ3BCLFVBQVUsRUFBRSxLQUFLO2lCQUNsQjthQUNGLENBQUM7WUFDRixPQUFPLEVBQUUsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRSxXQUFXLENBQUMsQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLE1BQU0sQ0FBQyxDQUFDO1FBQ3JFLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRTtZQUNmLE9BQU87Z0JBQ0wsT0FBTyxFQUFFLE1BQU07Z0JBQ2YsUUFBUSxFQUFFLElBQUksQ0FBQyxRQUFRO2FBQ3hCLENBQUM7UUFDSixDQUFDLENBQUMsQ0FBQztLQUNKO1NBQU07UUFDTCxPQUFPLE9BQU8sQ0FBQyxPQUFPLENBQWdCLElBQUksQ0FBQyxDQUFDO0tBQzdDO0FBQ0gsQ0FBQyJ9

@@ -1,4 +0,23 @@

import * as postcss from "postcss";
import { RawSourceMap } from "source-map";
export declare function adaptSourceMap(sourceMap: ReturnType<postcss.ResultMap["toJSON"]>): RawSourceMap;
export interface LegacyRawSourceMap {
file?: string;
sourceRoot?: string;
version: string;
sources: string[];
names: string[];
sourcesContent?: string[];
mappings: string;
}
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might return an old version of the
* RawSourceMap to match the current definition.
*/
export declare function adaptFromLegacySourceMap(sourceMap: LegacyRawSourceMap | RawSourceMap): RawSourceMap;
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might require an old version of the
* RawSourceMap.
*/
export declare function adaptToLegacySourceMap(sourceMap: LegacyRawSourceMap | RawSourceMap): LegacyRawSourceMap;
//# sourceMappingURL=adaptSourceMap.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Adapts the older version of postcss's source map to the current version.
// if postcss upgrades this will still be valid, albeit, unnecessary.
function adaptSourceMap(sourceMap) {
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might return an old version of the
* RawSourceMap to match the current definition.
*/
function adaptFromLegacySourceMap(sourceMap) {
// The legacy version was a number even though the type said it was a string.
// But we handle strings here juuuust in case.
let version = typeof sourceMap.version === "string"
? parseInt(sourceMap.version)
: sourceMap.version;
let newMap = {
file: sourceMap.file || "",
sourceRoot: sourceMap.sourceRoot,
version: parseInt(sourceMap.version),
version,
sources: sourceMap.sources,

@@ -17,3 +25,23 @@ names: sourceMap.names,

}
exports.adaptSourceMap = adaptSourceMap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRhcHRTb3VyY2VNYXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbC9hZGFwdFNvdXJjZU1hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLDJFQUEyRTtBQUMzRSxxRUFBcUU7QUFDckUsU0FBZ0IsY0FBYyxDQUFDLFNBQWtEO0lBQy9FLElBQUksTUFBTSxHQUFHO1FBQ1gsSUFBSSxFQUFFLFNBQVMsQ0FBQyxJQUFJLElBQUksRUFBRTtRQUMxQixVQUFVLEVBQUUsU0FBUyxDQUFDLFVBQVU7UUFDaEMsT0FBTyxFQUFFLFFBQVEsQ0FBQyxTQUFTLENBQUMsT0FBTyxDQUFDO1FBQ3BDLE9BQU8sRUFBRSxTQUFTLENBQUMsT0FBTztRQUMxQixLQUFLLEVBQUUsU0FBUyxDQUFDLEtBQUs7UUFDdEIsY0FBYyxFQUFFLFNBQVMsQ0FBQyxjQUFjO1FBQ3hDLFFBQVEsRUFBRSxTQUFTLENBQUMsUUFBUTtLQUM3QixDQUFDO0lBQ0YsT0FBTyxNQUFNLENBQUM7QUFDaEIsQ0FBQztBQVhELHdDQVdDIn0=
exports.adaptFromLegacySourceMap = adaptFromLegacySourceMap;
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might require an old version of the
* RawSourceMap.
*/
function adaptToLegacySourceMap(sourceMap) {
let newMap = {
file: sourceMap.file || "",
sourceRoot: sourceMap.sourceRoot,
// The version was never actually a string, we cast through any to match the legacy behavior.
// tslint:disable-next-line:prefer-unknown-to-any
version: sourceMap.version,
sources: sourceMap.sources,
names: sourceMap.names,
sourcesContent: sourceMap.sourcesContent,
mappings: sourceMap.mappings,
};
return newMap;
}
exports.adaptToLegacySourceMap = adaptToLegacySourceMap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRhcHRTb3VyY2VNYXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdXRpbC9hZGFwdFNvdXJjZU1hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQWFBOzs7O0dBSUc7QUFDSCxTQUFnQix3QkFBd0IsQ0FBQyxTQUE0QztJQUNuRiw2RUFBNkU7SUFDN0UsOENBQThDO0lBQzlDLElBQUksT0FBTyxHQUNULE9BQU8sU0FBUyxDQUFDLE9BQU8sS0FBSyxRQUFRO1FBQ25DLENBQUMsQ0FBQyxRQUFRLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQztRQUM3QixDQUFDLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQztJQUN4QixJQUFJLE1BQU0sR0FBRztRQUNYLElBQUksRUFBRSxTQUFTLENBQUMsSUFBSSxJQUFJLEVBQUU7UUFDMUIsVUFBVSxFQUFFLFNBQVMsQ0FBQyxVQUFVO1FBQ2hDLE9BQU87UUFDUCxPQUFPLEVBQUUsU0FBUyxDQUFDLE9BQU87UUFDMUIsS0FBSyxFQUFFLFNBQVMsQ0FBQyxLQUFLO1FBQ3RCLGNBQWMsRUFBRSxTQUFTLENBQUMsY0FBYztRQUN4QyxRQUFRLEVBQUUsU0FBUyxDQUFDLFFBQVE7S0FDN0IsQ0FBQztJQUNGLE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUM7QUFqQkQsNERBaUJDO0FBRUQ7Ozs7R0FJRztBQUNILFNBQWdCLHNCQUFzQixDQUFDLFNBQTRDO0lBQ2pGLElBQUksTUFBTSxHQUFHO1FBQ1gsSUFBSSxFQUFFLFNBQVMsQ0FBQyxJQUFJLElBQUksRUFBRTtRQUMxQixVQUFVLEVBQUUsU0FBUyxDQUFDLFVBQVU7UUFDaEMsNkZBQTZGO1FBQzdGLGlEQUFpRDtRQUNqRCxPQUFPLEVBQUUsU0FBUyxDQUFDLE9BQWM7UUFDakMsT0FBTyxFQUFFLFNBQVMsQ0FBQyxPQUFPO1FBQzFCLEtBQUssRUFBRSxTQUFTLENBQUMsS0FBSztRQUN0QixjQUFjLEVBQUUsU0FBUyxDQUFDLGNBQWM7UUFDeEMsUUFBUSxFQUFFLFNBQVMsQ0FBQyxRQUFRO0tBQzdCLENBQUM7SUFDRixPQUFPLE1BQU0sQ0FBQztBQUNoQixDQUFDO0FBYkQsd0RBYUMifQ==
{
"name": "opticss",
"version": "0.6.1",
"version": "0.6.2",
"description": "A CSS Optimizer",

@@ -43,3 +43,3 @@ "main": "dist/src/index.js",

"@opticss/element-analysis": "^0.6.1",
"@opticss/template-api": "^0.6.1",
"@opticss/template-api": "^0.6.2",
"@opticss/util": "^0.6.1",

@@ -61,3 +61,3 @@ "@types/debug": "4.1.4",

"@opticss/code-style": "^0.6.0",
"@opticss/simple-template": "^0.6.1",
"@opticss/simple-template": "^0.6.2",
"@types/chai": "^4.0.4",

@@ -79,3 +79,3 @@ "@types/mocha": "^5.2.6",

},
"gitHead": "f6a1a9ef24d295ea5b5f6402298fe5663832741b"
"gitHead": "6d85fb098dba1918862362de2c41e2f8b4b9d3cb"
}
import * as postcss from "postcss";
import { RawSourceMap } from "source-map";
import { adaptSourceMap } from "./util/adaptSourceMap";
import { LegacyRawSourceMap, adaptFromLegacySourceMap } from "./util/adaptSourceMap";

@@ -28,3 +28,3 @@ /**

*/
sourceMap?: RawSourceMap | string;
sourceMap?: LegacyRawSourceMap | RawSourceMap | string;
}

@@ -48,7 +48,11 @@

export function sourceMapFromCssFile(file: CssFile): RawSourceMap | string | undefined {
let sourceMap: RawSourceMap | string | undefined = file.sourceMap;
let sourceMap: LegacyRawSourceMap | RawSourceMap | string | undefined = file.sourceMap;
if (!sourceMap && (<postcss.Result>file.content).map) {
sourceMap = adaptSourceMap((<postcss.Result>file.content).map.toJSON());
sourceMap = (<postcss.Result>file.content).map.toJSON();
}
return sourceMap;
if (typeof sourceMap === "object") {
return adaptFromLegacySourceMap(sourceMap);
} else {
return sourceMap;
}
}

@@ -10,2 +10,3 @@ import * as postcss from "postcss";

export * from "./parseSelector";
export * from "./util/adaptSourceMap";
export * from "./util/IdentGenerator";

@@ -12,0 +13,0 @@ export * from "./Actions";

@@ -22,3 +22,3 @@ import {

} from "./optimizations";
import { adaptSourceMap } from "./util/adaptSourceMap";
import { adaptFromLegacySourceMap } from "./util/adaptSourceMap";

@@ -208,3 +208,3 @@ export interface OptimizationResult {

let result = file.content.root!.toResult(resultOpts);
output.add(file.filename || "optimized-input.css", result.css, adaptSourceMap(result.map.toJSON()));
output.add(file.filename || "optimized-input.css", result.css, adaptFromLegacySourceMap(result.map.toJSON()));
}

@@ -211,0 +211,0 @@ this.logTiming("concatenate", start, new Date());

@@ -1,10 +0,30 @@

import * as postcss from "postcss";
import { RawSourceMap } from "source-map";
// Adapts the older version of postcss's source map to the current version.
// if postcss upgrades this will still be valid, albeit, unnecessary.
export function adaptSourceMap(sourceMap: ReturnType<postcss.ResultMap["toJSON"]>): RawSourceMap {
// This is the old version of RawSourceMap
export interface LegacyRawSourceMap {
file?: string;
sourceRoot?: string;
version: string;
sources: string[];
names: string[];
sourcesContent?: string[];
mappings: string;
}
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might return an old version of the
* RawSourceMap to match the current definition.
*/
export function adaptFromLegacySourceMap(sourceMap: LegacyRawSourceMap | RawSourceMap): RawSourceMap {
// The legacy version was a number even though the type said it was a string.
// But we handle strings here juuuust in case.
let version =
typeof sourceMap.version === "string"
? parseInt(sourceMap.version)
: sourceMap.version;
let newMap = {
file: sourceMap.file || "",
sourceRoot: sourceMap.sourceRoot,
version: parseInt(sourceMap.version),
version,
sources: sourceMap.sources,

@@ -17,1 +37,21 @@ names: sourceMap.names,

}
/**
* The type of RawSourceMap changed in a backwards incompatible way.
* This function adapts code that might require an old version of the
* RawSourceMap.
*/
export function adaptToLegacySourceMap(sourceMap: LegacyRawSourceMap | RawSourceMap): LegacyRawSourceMap {
let newMap = {
file: sourceMap.file || "",
sourceRoot: sourceMap.sourceRoot,
// The version was never actually a string, we cast through any to match the legacy behavior.
// tslint:disable-next-line:prefer-unknown-to-any
version: sourceMap.version as any,
sources: sourceMap.sources,
names: sourceMap.names,
sourcesContent: sourceMap.sourcesContent,
mappings: sourceMap.mappings,
};
return newMap;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc