Comparing version 7.4.0 to 8.0.0-beta.0
{ | ||
"name": "sheetify", | ||
"version": "7.4.0", | ||
"version": "8.0.0-beta.0", | ||
"description": "Modular CSS bundler", | ||
@@ -58,2 +58,3 @@ "repository": "stackcss/sheetify", | ||
"from2-string": "^1.1.0", | ||
"hui": "^1.2.2", | ||
"jsdom": "^9.4.2", | ||
@@ -60,0 +61,0 @@ "nyc": "^11.9.0", |
@@ -41,1 +41,33 @@ const browserify = require('browserify') | ||
}) | ||
test('transform-package with a synonym for sheetify', function (t) { | ||
t.test('should transform CSS from package.json with options from a file with a synonym for sheetify ', function (t) { | ||
t.plan(1) | ||
const expath = path.join(__dirname, 'fixtures/transform-package/expected.css') | ||
const expected = fs.readFileSync(expath, 'utf8').trim() | ||
const ws = concat(function (buf) { | ||
const res = String(buf).trim() | ||
t.equal(res, expected, 'CSS was transformed') | ||
}) | ||
const bpath = path.join(__dirname, 'fixtures/transform-package/source-synonym.js') | ||
browserify(bpath) | ||
.transform(sheetify) | ||
.transform(function (file) { | ||
return through(function (buf, enc, next) { | ||
const str = buf.toString('utf8') | ||
this.push(str.replace(/sheetify\/insert/g, 'insert-css')) | ||
next() | ||
}) | ||
}) | ||
.plugin('css-extract', { out: outFn }) | ||
.bundle() | ||
function outFn () { | ||
return ws | ||
} | ||
}) | ||
}) |
@@ -13,2 +13,3 @@ const isMemberExpression = require('estree-is-member-expression') | ||
const sheetify = require('./index') | ||
const SUPPORTED_SYNONYMS = require('./lib/supported-synonyms') | ||
@@ -77,3 +78,4 @@ module.exports = transform | ||
if (src.indexOf('sheetify') === -1) { | ||
// Skip transforming any files that do not contain synonyms for sheetify | ||
if (!SUPPORTED_SYNONYMS.some(name => src.includes(name))) { | ||
self.push(src) | ||
@@ -115,3 +117,3 @@ self.push(null) | ||
node.arguments.length === 1 && | ||
node.arguments[0].value === 'sheetify') { | ||
SUPPORTED_SYNONYMS.includes(node.arguments[0].value)) { | ||
node.update('0') | ||
@@ -118,0 +120,0 @@ mname = node.parent.id.name |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
57061
46
1268
21
2
1