postcss-prefixwrap
Advanced tools
Comparing version 1.15.0 to 1.16.0
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -22,3 +34,3 @@ const postcss_1 = __importDefault(require("postcss")); | ||
return postcss_1.default.plugin(PostCSSPrefixWrap_1.PLUGIN_NAME, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -25,0 +37,0 @@ (prefixSelector, options) => { |
@@ -6,14 +6,15 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PLUGIN_NAME = void 0; | ||
const Selector_1 = __importDefault(require("./Selector")); | ||
const Hash_1 = __importDefault(require("./Hash")); | ||
exports.PLUGIN_NAME = "postcss-prefixwrap"; | ||
class PostCSSPrefixWrap { | ||
constructor(prefixSelector, options = {}) { | ||
this.blacklist = Hash_1.default.value(options, "blacklist", []); | ||
this.ignoredSelectors = Hash_1.default.value(options, "ignoredSelectors", []); | ||
var _a, _b, _c, _d; | ||
this.blacklist = (_a = options.blacklist) !== null && _a !== void 0 ? _a : []; | ||
this.ignoredSelectors = (_b = options.ignoredSelectors) !== null && _b !== void 0 ? _b : []; | ||
// eslint-disable-next-line security-node/non-literal-reg-expr | ||
this.isPrefixSelector = new RegExp(`^s*${prefixSelector}.*$`); | ||
this.prefixRootTags = Hash_1.default.value(options, "prefixRootTags", false); | ||
this.prefixRootTags = (_c = options.prefixRootTags) !== null && _c !== void 0 ? _c : false; | ||
this.prefixSelector = prefixSelector; | ||
this.whitelist = Hash_1.default.value(options, "whitelist", []); | ||
this.whitelist = (_d = options.whitelist) !== null && _d !== void 0 ? _d : []; | ||
} | ||
@@ -71,2 +72,3 @@ prefixWrapCSSSelector(cssSelector, cssRule) { | ||
} | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
prefix() { | ||
@@ -73,0 +75,0 @@ return (css) => { |
@@ -48,3 +48,3 @@ "use strict"; | ||
selector: selector, | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -62,3 +62,3 @@ parent: parent, | ||
assert_1.default.strictEqual( | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -69,6 +69,6 @@ plugin.includeRule({ | ||
assert_1.default.strictEqual(plugin.includeRule({ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
source: { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -86,3 +86,3 @@ input: { | ||
assert_1.default.strictEqual( | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -93,6 +93,6 @@ plugin.includeRule({ | ||
assert_1.default.strictEqual(plugin.includeRule({ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
source: { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
@@ -99,0 +99,0 @@ input: { |
@@ -5,2 +5,8 @@ # [PostCSS Prefix Wrap](./README.md) / Changelog | ||
## [1.16.0](https://github.com/dbtedman/postcss-prefixwrap/releases/tag/1.16.0) | ||
### Bug Fixes | ||
- Dependency updates | ||
## [1.15.0](https://github.com/dbtedman/postcss-prefixwrap/releases/tag/1.15.0) | ||
@@ -7,0 +13,0 @@ |
{ | ||
"name": "postcss-prefixwrap", | ||
"version": "1.15.0", | ||
"version": "1.16.0", | ||
"description": "A PostCSS plugin that is used to wrap css styles with a css selector to constrain their affect on parent elements in a page.", | ||
@@ -38,21 +38,21 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "25.2.1", | ||
"@types/node": "13.13.0", | ||
"@typescript-eslint/eslint-plugin": "2.28.0", | ||
"@typescript-eslint/parser": "2.28.0", | ||
"codecov": "3.6.5", | ||
"eslint": "6.8.0", | ||
"eslint-config-prettier": "6.10.1", | ||
"eslint-plugin-import": "2.20.2", | ||
"eslint-plugin-jest": "23.8.2", | ||
"@types/jest": "26.0.0", | ||
"@types/node": "14.0.13", | ||
"@typescript-eslint/eslint-plugin": "3.2.0", | ||
"@typescript-eslint/parser": "3.2.0", | ||
"codecov": "3.7.0", | ||
"eslint": "7.2.0", | ||
"eslint-config-prettier": "6.11.0", | ||
"eslint-plugin-import": "2.21.2", | ||
"eslint-plugin-jest": "23.13.2", | ||
"eslint-plugin-promise": "4.2.1", | ||
"eslint-plugin-security-node": "1.0.12", | ||
"husky": "4.2.5", | ||
"jest": "25.3.0", | ||
"jest": "26.0.1", | ||
"postcss": "7.0.21", | ||
"prettier": "2.0.4", | ||
"ts-jest": "25.4.0", | ||
"ts-node": "8.8.2", | ||
"typescript": "3.8.3" | ||
"prettier": "2.0.5", | ||
"ts-jest": "26.1.0", | ||
"ts-node": "8.10.2", | ||
"typescript": "3.9.5" | ||
} | ||
} |
@@ -39,2 +39,4 @@ # [PostCSS Prefix Wrap](https://github.com/dbtedman/postcss-prefixwrap) | ||
#### With Gulp | ||
```javascript | ||
@@ -52,2 +54,30 @@ const Gulp = require("gulp"); | ||
#### With WebPack | ||
```javascript | ||
const PrefixWrap = require("postcss-prefixwrap"); | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
"style-loader", | ||
{ loader: "css-loader", options: { importLoaders: 1 } }, | ||
{ | ||
loader: "postcss-loader", | ||
options: { | ||
plugins: [PrefixWrap(".my-custom-wrap")], | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}; | ||
``` | ||
> Based on example from [https://webpack.js.org/loaders/postcss-loader/](https://webpack.js.org/loaders/postcss-loader/). | ||
### Container | ||
@@ -54,0 +84,0 @@ |
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
29586
183
12
279