From cba0da4a43f96a72817ab438d9da84ddb0c1a7cc Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sun, 8 Jul 2018 00:43:53 -0500 Subject: [PATCH 1/8] Initial stages of major refactor --- .npmrc | 1 - index.js | 289 +- lib/clone-splice-parent-onto-node-when.js | 67 - lib/find-node-ancestor-with-selector.js | 32 - lib/gather-variable-dependencies.js | 50 - ...enerate-descendant-pieces-from-selector.js | 23 - ...-direct-descendant-pieces-from-selector.js | 21 - lib/generate-scope-list.js | 71 - lib/is-node-under-scope.js | 11 - lib/is-piece-always-ancestor-selector.js | 12 - lib/is-under-scope.js | 151 - lib/resolve-decl.js | 166 - lib/resolve-value.js | 114 - lib/shallow-clone-node.js | 46 - package-lock.json | 4079 +++++++++++++++++ package.json | 6 +- test/fixtures/pseudo-multi.css | 16 + test/fixtures/pseudo-multi.expected.css | 15 + test/test.js | 2 +- 19 files changed, 4197 insertions(+), 975 deletions(-) delete mode 100644 .npmrc delete mode 100644 lib/clone-splice-parent-onto-node-when.js delete mode 100644 lib/find-node-ancestor-with-selector.js delete mode 100644 lib/gather-variable-dependencies.js delete mode 100644 lib/generate-descendant-pieces-from-selector.js delete mode 100644 lib/generate-direct-descendant-pieces-from-selector.js delete mode 100644 lib/generate-scope-list.js delete mode 100644 lib/is-node-under-scope.js delete mode 100644 lib/is-piece-always-ancestor-selector.js delete mode 100644 lib/is-under-scope.js delete mode 100644 lib/resolve-decl.js delete mode 100644 lib/resolve-value.js delete mode 100644 lib/shallow-clone-node.js create mode 100644 package-lock.json create mode 100644 test/fixtures/pseudo-multi.css create mode 100644 test/fixtures/pseudo-multi.expected.css diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 43c97e7..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock=false diff --git a/index.js b/index.js index 61230a2..1ccf994 100644 --- a/index.js +++ b/index.js @@ -1,25 +1,26 @@ -// PostCSS CSS Variables (postcss-css-variables) -// v0.5.0 -// -// https://github.com/MadLittleMods/postcss-css-variables - -// For Debugging -//var nomo = require('node-monkey').start({port: 50501}); - -var postcss = require('postcss'); -var extend = require('extend'); - -var shallowCloneNode = require('./lib/shallow-clone-node'); -var resolveValue = require('./lib/resolve-value'); -var resolveDecl = require('./lib/resolve-decl'); - +const debug = require('debug')('postcss-css-variables:plugin'); +const postcss = require('postcss'); +const specificityLib = require('specificity'); +const generateSelectorBranchesFromPostcssNode = require('postcss-node-scope-utility/lib/generate-branches'); +const isSelectorBranchUnderScope = require('postcss-node-scope-utility/lib/is-branch-under-scope'); // A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS) // `--foo` // See: http://dev.w3.org/csswg/css-variables/#custom-property -var RE_VAR_PROP = (/(--(.+))/); +const RE_VAR_PROP = (/(--(.+))/); +const RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/); +function getSpecificity(selector) { + // We only care about the first piece because we have already split the comma-separated pieces before we use this + return specificityLib.calculate(selector)[0].specificityArray; +} + +function compareSpecificity(specificityArrayA, specificityArrayB) { + if(!specificityArrayA) return -1; + if(!specificityArrayB) return 1; + return specificityLib.compare(specificityArrayA, specificityArrayB); +} function eachCssVariableDeclaration(css, cb) { @@ -33,28 +34,6 @@ function eachCssVariableDeclaration(css, cb) { } - -function cleanUpNode(node) { - // If we removed all of the declarations in the rule(making it empty), - // then just remove it - var nodeToPossiblyCleanUp = node; - while(nodeToPossiblyCleanUp && nodeToPossiblyCleanUp.nodes.length <= 0) { - var nodeToRemove = nodeToPossiblyCleanUp.type !== 'root' ? nodeToPossiblyCleanUp : null; - - if(nodeToRemove) { - // Get a reference to it before we remove - // and lose reference to the child after removing it - nodeToPossiblyCleanUp = nodeToRemove.parent; - - nodeToRemove.remove(); - } - else { - nodeToPossiblyCleanUp = null; - } - } -} - - var defaults = { // Allows you to preserve custom properties & var() usage in output. // `true`, `false`, or `'computed'` @@ -70,113 +49,46 @@ var defaults = { module.exports = postcss.plugin('postcss-css-variables', function(options) { - var opts = extend({}, defaults, options); + var opts = Object.assign({}, defaults, options); // Work with opts here return function (css, result) { - // Transform CSS AST here - - /* * / - try { - /* */ - - // List of nodes that if empty, will be removed - // We use this because we don't want to modify the AST when we still need to reference these later on - var nodesToRemoveAtEnd = []; - - // Keep track of the injected from `opts.variables` to remove at the end - // if user passes `opts.preserveInjectedVariables = false` - var injectedDeclsToRemoveAtEnd = []; - // Map of variable names to a list of declarations - var map = {}; + let map = {}; // Add the js defined variables `opts.variables` to the map - map = extend( - map, - Object.keys(opts.variables).reduce(function(prevVariableMap, variableName) { - var variableEntry = opts.variables[variableName]; - // Automatically prefix any variable with `--` (CSS custom property syntax) if it doesn't have it already - variableName = variableName.slice(0, 2) === '--' ? variableName : '--' + variableName; - var variableValue = (variableEntry || {}).value || variableEntry; - var isImportant = (variableEntry || {}).isImportant || false; - - - // Add a root node to the AST - var variableRootRule = postcss.rule({ selector: ':root' }); - css.root().prepend(variableRootRule); - // Add the variable decl to the root node - var varDecl = postcss.decl({ - prop: variableName, - value: variableValue - }); - variableRootRule.append(varDecl); - - // Collect JS-injected variables for removal if `opts.preserveInjectedVariables = false` - if (!opts.preserveInjectedVariables) { - injectedDeclsToRemoveAtEnd.push(varDecl); - } - - // Add the entry to the map - prevVariableMap[variableName] = (prevVariableMap[variableName] || []).concat({ - decl: varDecl, - prop: variableName, - calculatedInPlaceValue: variableValue, - isImportant: isImportant, - variablesUsed: [], - parent: variableRootRule, - isUnderAtRule: false - }); - - return prevVariableMap; - }, {}) - ); - - - // Chainable helper function to log any messages (warnings) - var logResolveValueResult = function(valueResult) { - // Log any warnings that might of popped up - var warningList = [].concat(valueResult.warnings); - warningList.forEach(function(warningArgs) { - warningArgs = [].concat(warningArgs); - result.warn.apply(result, warningArgs); + Object.keys(opts.variables).forEach(function(prevVariableMap, variableKey) { + const variableEntry = opts.variables[variableKey]; + // Automatically prefix any variable with `--` (CSS custom property syntax) if it doesn't have it already + const variableName = variableKey.slice(0, 2) === '--' ? variableKey : '--' + variableKey; + const variableValue = (variableEntry || {}).value || variableEntry; + const isImportant = (variableEntry || {}).isImportant || false; + + // Add the entry to the map + map[variableName] = (map[variableName] || []).concat({ + name: variableName, + value: variableValue, + isImportant, + selectorBranches: [':root'] }); + }); - // Keep the chain going - return valueResult; - }; // Collect all of the variables defined // --------------------------------------------------------- // --------------------------------------------------------- - //console.log('Collecting variables defined START'); eachCssVariableDeclaration(css, function(decl) { - var declParentRule = decl.parent; - - var valueResults = logResolveValueResult(resolveValue(decl, map)); - // Split out each selector piece into its own declaration for easier logic down the road - decl.parent.selectors.forEach(function(selector) { - // Create a detached clone - var splitOutRule = shallowCloneNode(decl.parent); - splitOutRule.selector = selector; - splitOutRule.parent = decl.parent.parent; - - var declClone = decl.clone(); - splitOutRule.append(declClone); - - var prop = decl.prop; - map[prop] = (map[prop] || []).concat({ - decl: declClone, - prop: prop, - calculatedInPlaceValue: valueResults.value, - isImportant: decl.important || false, - variablesUsed: valueResults.variablesUsed, - parent: splitOutRule, - // variables inside root or at-rules (eg. @media, @support) - isUnderAtRule: splitOutRule.parent.type === 'atrule' - }); + // We cache the parent rule because after decl removal, it will be undefined + const declParentRule = decl.parent; + const variableName = decl.prop; + + map[variableName] = (map[variableName] || []).concat({ + name: variableName, + value: decl.value, + isImportant: decl.important || false, + selectorBranches: generateSelectorBranchesFromPostcssNode(declParentRule) }); // Remove the variable declaration because they are pretty much useless after we resolve them @@ -185,99 +97,62 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { } // Or we can also just show the computed value used for that variable else if(opts.preserve === 'computed') { - decl.value = valueResults.value; + // TODO: put computed value here } - // Otherwise just keep them as var declarations - //else {} - // We add to the clean up list if we removed some variable declarations to make it become an empty rule - // We clean up later on because we don't want to modify the AST when we still need to reference these later on + // Clean up the rule that declared them if it doesn't have anything left after we potentially remove the variable decl if(declParentRule.nodes.length <= 0) { - nodesToRemoveAtEnd.push(declParentRule); + declParentRule.remove(); } }); - //console.log('Collecting variables defined END'); - + debug('map', map); // Resolve variables everywhere // --------------------------------------------------------- // --------------------------------------------------------- - - // Collect all the rules that have declarations that use variables - var rulesThatHaveDeclarationsWithVariablesList = []; - css.walkRules(function(rule) { - var doesRuleUseVariables = rule.nodes.some(function(node) { - if(node.type === 'decl') { - var decl = node; - // If it uses variables - // and is not a variable declarations that we may be preserving from earlier - if(resolveValue.RE_VAR_FUNC.test(decl.value) && !RE_VAR_PROP.test(decl.prop)) { - return true; - } - } - - return false; - }); - - if(doesRuleUseVariables) { - rulesThatHaveDeclarationsWithVariablesList.push(rule); - } - }); - - rulesThatHaveDeclarationsWithVariablesList.forEach(function(rule) { - var rulesToWorkOn = [].concat(rule); - // Split out the rule into each comma separated selector piece - // We only need to split if is actually comma separted(selectors > 1) - if(rule.selectors.length > 1) { - // Reverse the selectors so that we can cloneAfter in the same comma separated order - rulesToWorkOn = rule.selectors.reverse().map(function(selector) { - var ruleClone = rule.cloneAfter(); - ruleClone.selector = selector; - - return ruleClone; + css.walkDecls(function(decl) { + // If it uses variables + // and is not a variable declarations that we may be preserving from earlier + if(!RE_VAR_PROP.test(decl.prop)) { + const selectorBranches = generateSelectorBranchesFromPostcssNode(decl.parent); + + decl.value = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName) => { + debug('usage', variableName); + const variableEntries = map[variableName] || []; + + let currentGreatestSpecificity = null; + let currentGreatestVariableEntry = null; + + // Go through all of the variables and find the one with the highest specificity + variableEntries.forEach((variableEntry) => { + // We only need to find one branch that matches + variableEntry.selectorBranches.some((variableSelectorBranch) => { + return selectorBranches.some((selectorBranch) => { + const isUnderScope = isSelectorBranchUnderScope(variableSelectorBranch, selectorBranch); + const specificity = getSpecificity(variableSelectorBranch.selector.toString()); + + debug(`isUnderScope=${isUnderScope} compareSpecificity=${compareSpecificity(specificity, currentGreatestSpecificity)} specificity=${specificity}`, variableSelectorBranch.selector.toString(), selectorBranch.selector.toString()) + + if(isUnderScope && compareSpecificity(specificity, currentGreatestSpecificity) >= 0) { + currentGreatestSpecificity = specificity; + currentGreatestVariableEntry = variableEntry; + } + + return isUnderScope; + }); + }); + }); + + debug('currentGreatestVariableEntry', currentGreatestVariableEntry); + + return currentGreatestVariableEntry.value; }); - - rule.remove(); } - - // Resolve the declarations - rulesToWorkOn.forEach(function(ruleToWorkOn) { - ruleToWorkOn.nodes.slice(0).forEach(function(node) { - if(node.type === 'decl') { - var decl = node; - resolveDecl(decl, map, opts.preserve, logResolveValueResult); - } - }); - }); - - }); - - - - - - // Clean up any nodes we don't want anymore - // We clean up at the end because we don't want to modify the AST when we still need to reference these later on - nodesToRemoveAtEnd.forEach(cleanUpNode); - - // Clean up JS-injected variables marked for removal - injectedDeclsToRemoveAtEnd.forEach(function(injectedDecl) { - injectedDecl.remove(); }); - //console.log('map', map); - - /* * / - } - catch(e) { - //console.log('e', e.message); - console.log('e', e.message, e.stack); - } - /* */ - }; }); diff --git a/lib/clone-splice-parent-onto-node-when.js b/lib/clone-splice-parent-onto-node-when.js deleted file mode 100644 index 4868aa8..0000000 --- a/lib/clone-splice-parent-onto-node-when.js +++ /dev/null @@ -1,67 +0,0 @@ - -var shallowCloneNode = require('./shallow-clone-node'); - -// Splice on a parent scope onto a node -// And return a detached clone -var cloneSpliceParentOntoNodeWhen = function(node, parent, /*optional*/whenCb) { - whenCb = whenCb || function() { - return true; - }; - - var cloneList = []; - - // Gather node ancestors and clone along the way - var current = node; - var isWhenNow = false; - while(current && !isWhenNow) { - if(current.type === 'decl') { - cloneList.push(current.clone()); - } - else { - cloneList.push(shallowCloneNode(current)); - } - - isWhenNow = whenCb(current); - current = current.parent; - } - - - // Gather parent ancestors all the way up and clone along the way - // The list goes from lowest to highest ancestor - var cloneParentList = []; - var currentParent = parent; - while(currentParent) { - cloneParentList.push(shallowCloneNode(currentParent)); - - currentParent = currentParent.parent; - } - // Assign parents to our parent clones - cloneParentList.forEach(function(parentClone, index, cloneParentList) { - // Keep assigning parents detached until just very end - if(index + 1 < cloneParentList.length) { - //parentClone.moveTo(cloneParentList[index+1]); - parentClone.parent = cloneParentList[index + 1]; - } - }); - - - // Assign parents to our node clones - cloneList.forEach(function(clone, index, cloneList) { - // Keep assigning parents detached until just very end - if(index + 1 < cloneList.length) { - //clone.moveTo(cloneList[index+1]); - clone.parent = cloneList[index + 1]; - // Then splice on the new parent scope - } else { - // Set the highest parent ancestor to back to where we should splice in - cloneParentList.slice(-1)[0].parent = current; - // Set the node clone to the lowest parent ancestor to finish off the splice - //clone.moveTo(cloneParentList[0]); - clone.parent = cloneParentList[0]; - } - }); - - return cloneList[0]; -}; - -module.exports = cloneSpliceParentOntoNodeWhen; diff --git a/lib/find-node-ancestor-with-selector.js b/lib/find-node-ancestor-with-selector.js deleted file mode 100644 index caa9765..0000000 --- a/lib/find-node-ancestor-with-selector.js +++ /dev/null @@ -1,32 +0,0 @@ -var generateScopeList = require('./generate-scope-list'); - -// Find a node starting from the given node that matches -// Works on a PostCSS AST tree -var findNodeAncestorWithSelector = function(selector, node) { - var matchingNode; - - // Keep going until we run out of parents to search - // or we found the node - var currentNode = node; - while(currentNode.parent && !matchingNode) { - // A trick to get the selector split up. Generate a scope list on a clone(clean parent) - var currentNodeScopeList = generateScopeList(currentNode.clone(), true); - - currentNodeScopeList.some(function(scopePieces) { - return scopePieces.some(function(scopePiece) { - if(scopePiece === selector) { - matchingNode = currentNode; - return true; - } - - return false; - }); - }); - - currentNode = currentNode.parent; - } - - return matchingNode; -}; - -module.exports = findNodeAncestorWithSelector; diff --git a/lib/gather-variable-dependencies.js b/lib/gather-variable-dependencies.js deleted file mode 100644 index 08b295b..0000000 --- a/lib/gather-variable-dependencies.js +++ /dev/null @@ -1,50 +0,0 @@ -// Variables that referenced in some way by the target variable -// -// `variablesUsed`: Array of string variable names that may be in the map -// -// Returns: `object` -// - `deps`: array of complete dependecies recursively gathered (entries from the `map`) -// - `hasCircularOrSelfReference`: bool of whether there is some circular or self reference of dependencies. -// - If true, the variable can't be deduced -var gatherVariableDependencies = function(variablesUsed, map, _dependencyVariablesList) { - _dependencyVariablesList = _dependencyVariablesList || []; - var hasCircularOrSelfReference = false; - - if(variablesUsed) { - _dependencyVariablesList = variablesUsed.reduce(function(dependencyVariablesList, variableUsedName) { - var isVariableInMap = !!map[variableUsedName]; - var doesThisVarHaveCircularOrSelfReference = !isVariableInMap ? false : dependencyVariablesList.some(function(dep) { - return map[variableUsedName].some(function(mapItem) { - // If already in the list, we got a circular reference - if(dep === mapItem) { - return true; - } - - return false; - }); - }); - // Update the overall state of dependency health - hasCircularOrSelfReference = hasCircularOrSelfReference || doesThisVarHaveCircularOrSelfReference; - - - if(isVariableInMap && !hasCircularOrSelfReference) { - dependencyVariablesList = dependencyVariablesList.concat(map[variableUsedName]); - - (map[variableUsedName] || []).forEach(function(mapItem) { - var result = gatherVariableDependencies(mapItem.variablesUsed, map, dependencyVariablesList); - dependencyVariablesList = result.deps; - hasCircularOrSelfReference = hasCircularOrSelfReference || result.hasCircularOrSelfReference; - }); - } - - return dependencyVariablesList; - }, _dependencyVariablesList); - } - - return { - deps: _dependencyVariablesList, - hasCircularOrSelfReference: hasCircularOrSelfReference - }; -}; - -module.exports = gatherVariableDependencies; diff --git a/lib/generate-descendant-pieces-from-selector.js b/lib/generate-descendant-pieces-from-selector.js deleted file mode 100644 index 42ddcdf..0000000 --- a/lib/generate-descendant-pieces-from-selector.js +++ /dev/null @@ -1,23 +0,0 @@ -// Unit Tests: https://regex101.com/r/oP0fM9/15 -// -// It is a shame the regex has to be this long. Maybe a CSS selector parser would be better. -// We could almost use `/\b\s(?![><+~][\s]+?)/` to split the selector but this doesn't work with attribute selectors -var RE_SELECTOR_DESCENDANT_SPLIT = (/(.*?(?:(?:\([^\)]+\)|\[[^\]]+\]|(?![><+~\s]).)+)(?:(?:(?:\s(?!>>))|(?:\t(?!>>))|(?:\s?>>\s?))(?!\s+))(?![><+~][\s]+?))/); - - -var generateDescendantPiecesFromSelector = function(selector) { - return selector.split(RE_SELECTOR_DESCENDANT_SPLIT) - .filter(function(piece) { - if(piece.length > 0) { - return true; - } - return false; - }) - .map(function(piece) { - // Trim whitespace which would be a normal descendant selector - // and trim off the CSS4 descendant `>>` into a normal descendant selector - return piece.trim().replace(/\s*?>>\s*?/g, ''); - }); -}; - -module.exports = generateDescendantPiecesFromSelector; diff --git a/lib/generate-direct-descendant-pieces-from-selector.js b/lib/generate-direct-descendant-pieces-from-selector.js deleted file mode 100644 index 3bafdb0..0000000 --- a/lib/generate-direct-descendant-pieces-from-selector.js +++ /dev/null @@ -1,21 +0,0 @@ -// Unit Tests: https://regex101.com/r/oS4zJ8/3 - -var RE_SELECTOR_DIRECT_DESCENDANT_SPLIT = (/(.*?(?:(?:\([^\)]+\)|\[[^\]]+\]|(?!>>|<|\+|~|\s).)+)(?:(?:(?:>(?!>))|(?:\s?>(?!>)\s?))(?!\s+))(?!(?:>>|<|\+|~)[\s]+?))/); - - -var generateDirectDescendantPiecesFromSelector = function(selector) { - return selector.split(RE_SELECTOR_DIRECT_DESCENDANT_SPLIT) - .filter(function(piece) { - if(piece.length > 0) { - return true; - } - return false; - }) - .map(function(piece) { - // Trim whitespace which would be a normal descendant selector - // and trim off the CSS4 descendant `>>` into a normal descendant selector - return piece.trim().replace(/\s*?>\s*?/g, ''); - }); -}; - -module.exports = generateDirectDescendantPiecesFromSelector; diff --git a/lib/generate-scope-list.js b/lib/generate-scope-list.js deleted file mode 100644 index 18ffeb2..0000000 --- a/lib/generate-scope-list.js +++ /dev/null @@ -1,71 +0,0 @@ - -var generateDescendantPiecesFromSelector = require('./generate-descendant-pieces-from-selector'); - - -var generateScopeList = function(node, /*optional*/includeSelf) { - includeSelf = includeSelf || false; - - var selectorScopeList = [ - // Start off with one branch - [] - ]; - var currentNodeParent = includeSelf ? node : node.parent; - while(currentNodeParent) { - - // `currentNodeParent.selectors` is a list of each comma separated piece of the selector - var scopePieces = (currentNodeParent.selectors || []).map(function(selectorPiece) { - return { - value: selectorPiece, - type: 'selector' - }; - }); - - // If it is a at-rule, then we need to construct the proper piece - if(currentNodeParent.type === 'atrule') { - scopePieces = [].concat(currentNodeParent.params).map(function(param) { - return { - value: '@' + currentNodeParent.name + ' ' + param, - type: 'atrule' - }; - }); - } - - // Branch each current scope for each comma separated selector - // Otherwise just keep the [1] branch going - var branches = (scopePieces.length > 0 ? scopePieces : [1]).map(function() { - return selectorScopeList.map(function(scopePieces) { - return scopePieces.slice(0); - }); - }); - - scopePieces.forEach(function(scopeObject, index) { - // Update each selector string with the new piece - branches[index] = branches[index].map(function(scopeStringPieces) { - - var descendantPieces = [scopeObject.value]; - // Split at any descendant combinators to properly make the scope list - if(scopeObject.type === 'selector') { - descendantPieces = generateDescendantPiecesFromSelector(scopeObject.value); - } - - // Add to the front of the array - scopeStringPieces.unshift.apply(scopeStringPieces, descendantPieces); - - return scopeStringPieces; - }); - }); - - // Start from a new list so we can - // Flatten out the branches a bit and and merge back into the list - selectorScopeList = []; - branches.forEach(function(branch) { - selectorScopeList = selectorScopeList.concat(branch); - }); - - currentNodeParent = currentNodeParent.parent; - } - - return selectorScopeList; -}; - -module.exports = generateScopeList; diff --git a/lib/is-node-under-scope.js b/lib/is-node-under-scope.js deleted file mode 100644 index 02bab38..0000000 --- a/lib/is-node-under-scope.js +++ /dev/null @@ -1,11 +0,0 @@ -var isUnderScope = require('./is-under-scope'); -var generateScopeList = require('./generate-scope-list'); - -var isNodeUnderScope = function(node, scopeNode, /*optional*/ignorePseudo) { - var nodeScopeList = generateScopeList(node, true); - var scopeNodeScopeList = generateScopeList(scopeNode, true); - - return isUnderScope(nodeScopeList, scopeNodeScopeList, ignorePseudo); -}; - -module.exports = isNodeUnderScope; diff --git a/lib/is-piece-always-ancestor-selector.js b/lib/is-piece-always-ancestor-selector.js deleted file mode 100644 index 00df95a..0000000 --- a/lib/is-piece-always-ancestor-selector.js +++ /dev/null @@ -1,12 +0,0 @@ -var alwaysAncestorSelector = { - '*': true, - ':root': true, - 'html': true -}; - -// This means it will be always be an ancestor of any other selector -var isPieceIsAlwaysAncestorSelector = function(piece) { - return !!alwaysAncestorSelector[piece]; -}; - -module.exports = isPieceIsAlwaysAncestorSelector; diff --git a/lib/is-under-scope.js b/lib/is-under-scope.js deleted file mode 100644 index 7ce0baf..0000000 --- a/lib/is-under-scope.js +++ /dev/null @@ -1,151 +0,0 @@ -var escapeStringRegexp = require('escape-string-regexp'); - -var isPieceAlwaysAncestorSelector = require('./is-piece-always-ancestor-selector'); -var generateDirectDescendantPiecesFromSelector = require('./generate-direct-descendant-pieces-from-selector'); - -var RE_AT_RULE_SCOPE_PIECE = (/^@.*/); -// This will match pseudo selectors that have a base part -// ex. .foo:hover -// It will NOT match `:root` -var RE_PSEUDO_SELECTOR = (/([^\s:]+)((?::|::)[^\s]*?)(\s+|$)/); - - -function getScopeMatchResults(nodeScopeList, scopeNodeScopeList) { - var currentPieceOffset; - var scopePieceIndex; - - // Check each comma separated piece of the complex selector - var doesMatchScope = scopeNodeScopeList.some(function(scopeNodeScopePieces) { - return nodeScopeList.some(function(nodeScopePieces) { - - //console.log('sp', scopeNodeScopePieces); - //console.log('np', nodeScopePieces); - - currentPieceOffset = null; - var wasEveryPieceFound = true; - for(scopePieceIndex = 0; scopePieceIndex < scopeNodeScopePieces.length; scopePieceIndex++) { - var scopePiece = scopeNodeScopePieces[scopePieceIndex]; - var pieceOffset = currentPieceOffset || 0; - - var foundIndex = -1; - // Look through the remaining pieces(start from the offset) - var piecesWeCanMatch = nodeScopePieces.slice(pieceOffset); - for(var nodeScopePieceIndex = 0; nodeScopePieceIndex < piecesWeCanMatch.length; nodeScopePieceIndex++) { - var nodeScopePiece = piecesWeCanMatch[nodeScopePieceIndex]; - var overallIndex = pieceOffset + nodeScopePieceIndex; - - // Find the scope piece at the end of the node selector - // Last-occurence - if( - // If the part on the end of the piece itself matches: - // scopePiece `.bar` matches node `.bar` - // scopePiece `.bar` matches node `.foo + .bar` - new RegExp(escapeStringRegexp(scopePiece) + '$').test(nodeScopePiece) - ) { - foundIndex = overallIndex; - break; - } - - - // If the scope piece is a always-ancestor, then it is valid no matter what - // - // Or the node scope piece could be an always-ancestor selector itself - // And we only want the first occurence so we can keep matching future scope pieces - if(isPieceAlwaysAncestorSelector(scopePiece) || isPieceAlwaysAncestorSelector(nodeScopePiece)) { - foundIndex = overallIndex; - - break; - } - - - // Handle any direct descendant operators in each piece - var directDescendantPieces = generateDirectDescendantPiecesFromSelector(nodeScopePiece); - // Only try to work out direct descendants if there was the `>` combinator, meaning multiple pieces - if(directDescendantPieces.length > 1) { - - var ddNodeScopeList = [].concat([directDescendantPieces]); - // Massage into a direct descendant separated list - var ddScopeList = [].concat([ - scopeNodeScopePieces - .slice(scopePieceIndex) - .reduce(function(prevScopePieces, scopePiece) { - return prevScopePieces.concat(generateDirectDescendantPiecesFromSelector(scopePiece)); - }, []) - ]); - var result = getScopeMatchResults(ddNodeScopeList, ddScopeList); - - // If it matches completely - // or there are still more pieces to match in the future - if(result.doesMatchScope || scopePieceIndex + 1 < scopeNodeScopePieces.length) { - foundIndex = overallIndex; - // Move the scope forward the amount that piece consumed - // -1 because the of for-loop increments at each iteration - scopePieceIndex += result.scopePieceIndex - 1; - } - - break; - } - } - - - var isFurther = foundIndex >= pieceOffset; - - currentPieceOffset = foundIndex + 1; - - // Mimicing a `[].every` with a for-loop - wasEveryPieceFound = wasEveryPieceFound && isFurther; - if(!wasEveryPieceFound) { - break; - } - } - - return wasEveryPieceFound; - }); - }); - - return { - doesMatchScope: doesMatchScope, - nodeScopePieceIndex: currentPieceOffset - 1, - scopePieceIndex: scopePieceIndex - }; -} - - - -var stripPseudoSelectorsFromScopeList = function(scopeList) { - return scopeList.map(function(scopePieces) { - return scopePieces.map(function(descendantPiece) { - // If not an at-rule piece, remove the pseudo selector part `@media (max-width: 300px)` - if(!RE_AT_RULE_SCOPE_PIECE.test(descendantPiece)) { - return descendantPiece.replace(new RegExp(RE_PSEUDO_SELECTOR.source, 'g'), function(whole, baseSelector, pseudo, trailingWhitespace) { - return baseSelector + trailingWhitespace; - }); - } - return descendantPiece; - }); - }); -}; - - -// Given the nodes scope, and the target scope, -// Is the node in the same or under the target scope (cascade wise) -// -// Another way to think about it: Can the target scope cascade properties to the node? -// -// For scope-lists see: `generateScopeList` -var isUnderScope = function(nodeScopeList, scopeNodeScopeList, /*optional*/ignorePseudo) { - // Because we only care about the scopeNodeScope matching to the nodeScope - // Remove the pseudo selectors from the nodeScope so it can match a broader version - // ex. `.foo:hover` can resolve variables from `.foo` - nodeScopeList = stripPseudoSelectorsFromScopeList(nodeScopeList); - - if(ignorePseudo) { - scopeNodeScopeList = stripPseudoSelectorsFromScopeList(scopeNodeScopeList); - } - - return getScopeMatchResults(nodeScopeList, scopeNodeScopeList).doesMatchScope; -}; - -isUnderScope.RE_PSEUDO_SELECTOR = RE_PSEUDO_SELECTOR; - -module.exports = isUnderScope; diff --git a/lib/resolve-decl.js b/lib/resolve-decl.js deleted file mode 100644 index cae8e03..0000000 --- a/lib/resolve-decl.js +++ /dev/null @@ -1,166 +0,0 @@ -var resolveValue = require('./resolve-value'); -var generateScopeList = require('./generate-scope-list'); -var gatherVariableDependencies = require('./gather-variable-dependencies'); - -var isUnderScope = require('./is-under-scope'); -var isNodeUnderScope = require('./is-node-under-scope'); - -var shallowCloneNode = require('./shallow-clone-node'); -var findNodeAncestorWithSelector = require('./find-node-ancestor-with-selector'); -var cloneSpliceParentOntoNodeWhen = require('./clone-splice-parent-onto-node-when'); - - - -function eachMapItemDependencyOfDecl(variablesUsedList, map, decl, cb) { - // Now find any at-rule declarations that pertains to each rule - // Loop through the variables used - variablesUsedList.forEach(function(variableUsedName) { - - // Find anything in the map that corresponds to that variable - gatherVariableDependencies(variablesUsedList, map).deps.forEach(function(mapItem) { - - var mimicDecl; - if(mapItem.isUnderAtRule) { - - // Get the inner-most selector of the at-rule scope variable declaration we are matching - // Because the inner-most selector will be the same for each branch, we can look at the first one [0] or any of the others - var varDeclScopeList = generateScopeList(mapItem.parent, true); - var innerMostAtRuleSelector = varDeclScopeList[0].slice(-1)[0]; - var nodeToSpliceParentOnto = findNodeAncestorWithSelector(innerMostAtRuleSelector, decl.parent); - - // Splice on where the selector starts matching the selector inside at-rule - // See: `test/fixtures/cascade-on-nested-rules.css` - var varDeclAtRule = mapItem.parent.parent; - mimicDecl = cloneSpliceParentOntoNodeWhen(decl, varDeclAtRule, function(ancestor) { - return ancestor === nodeToSpliceParentOnto; - }); - - - //console.log('amd og', generateScopeList(decl.parent, true)); - //console.log('amd', generateScopeList(mimicDecl.parent, true)); - //console.log(generateScopeList(mapItem.parent, true)); - //console.log('amd isNodeUnderScope', isNodeUnderScope(mimicDecl.parent, mapItem.parent), mapItem.decl.value); - } - // TODO: use regex from `isUnderScope` - else if(isUnderScope.RE_PSEUDO_SELECTOR.test(mapItem.parent.selector)) { - // Create a detached clone - var ruleClone = shallowCloneNode(decl.parent); - ruleClone.parent = decl.parent.parent; - - // Add the declaration to it - mimicDecl = decl.clone(); - ruleClone.append(mimicDecl); - - var lastPseudoSelectorMatches = mapItem.parent.selector.match(new RegExp(isUnderScope.RE_PSEUDO_SELECTOR.source + '$')); - var lastPseudoSelector = lastPseudoSelectorMatches ? lastPseudoSelectorMatches[2] : ''; - - ruleClone.selector += lastPseudoSelector; - } - - // If it is under the proper scope, - // we need to check because we are iterating over all map entries - if(mimicDecl && isNodeUnderScope(mimicDecl, mapItem.parent, true)) { - cb(mimicDecl, mapItem); - } - }); - }); -} - - - - -// Resolve the decl with the computed value -// Also add in any media queries that change the value as necessary -function resolveDecl(decl, map, /*optional*/shouldPreserve, /*optional*/logResolveValueResult) { - shouldPreserve = shouldPreserve || false; - - // Make it chainable - var _logResolveValueResult = function(valueResults) { - if(logResolveValueResult) { - logResolveValueResult(valueResults); - } - - return valueResults; - }; - - - - // Grab the balue for this declarations - //console.log('resolveDecl 1'); - var valueResults = _logResolveValueResult(resolveValue(decl, map)); - - - // Resolve the cascade dependencies - // Now find any at-rule declarations that need to be added below each rule - //console.log('resolveDecl 2'); - eachMapItemDependencyOfDecl(valueResults.variablesUsed, map, decl, function(mimicDecl, mapItem) { - var ruleClone = shallowCloneNode(decl.parent); - var declClone = decl.clone(); - // Add the declaration to our new rule - ruleClone.append(declClone); - - if(shouldPreserve === true) { - declClone.cloneAfter(); - } - - // No mangle resolve - declClone.value = _logResolveValueResult(resolveValue(mimicDecl, map, true)).value; - - if(mapItem.isUnderAtRule) { - // Create the clean atRule for which we place the declaration under - var atRuleNode = shallowCloneNode(mapItem.parent.parent); - - // Add the rule to the atRule - atRuleNode.append(ruleClone); - - - // Since that atRuleNode can be nested in other atRules, we need to make the appropriate structure - var parentAtRuleNode = atRuleNode; - var currentAtRuleNode = mapItem.parent.parent; - while(currentAtRuleNode.parent.type === 'atrule') { - // Create a new clean clone of that at rule to nest under - var newParentAtRuleNode = shallowCloneNode(currentAtRuleNode.parent); - - // Append the old parent - newParentAtRuleNode.append(parentAtRuleNode); - // Then set the new one as the current for next iteration - parentAtRuleNode = newParentAtRuleNode; - - currentAtRuleNode = currentAtRuleNode.parent; - } - - // Put the atRuleStructure after the declaration's rule - decl.parent.parent.insertAfter(decl.parent, parentAtRuleNode); - } - else { - ruleClone.selector = mimicDecl.parent.selector; - - // Put the atRuleStructure after the declaration's rule - decl.parent.parent.insertAfter(decl.parent, ruleClone); - } - }); - - - // If we are preserving var(...) usage and the value changed meaning it had some - if(shouldPreserve === true && decl.value !== valueResults.value) { - decl.cloneAfter(); - } - - - // Set 'undefined' value as a string to avoid making other plugins down the line unhappy - // See #22 - if (valueResults.value === undefined) { - valueResults.value = 'undefined'; - } - - - // Set the new value after we are done dealing with at-rule stuff - decl.value = valueResults.value; -} - - - - - - -module.exports = resolveDecl; diff --git a/lib/resolve-value.js b/lib/resolve-value.js deleted file mode 100644 index f3a756b..0000000 --- a/lib/resolve-value.js +++ /dev/null @@ -1,114 +0,0 @@ -var generateScopeList = require('./generate-scope-list'); -var isNodeUnderScope = require('./is-node-under-scope'); -var gatherVariableDependencies = require('./gather-variable-dependencies'); - -var findNodeAncestorWithSelector = require('./find-node-ancestor-with-selector'); -var cloneSpliceParentOntoNodeWhen = require('./clone-splice-parent-onto-node-when'); - - - -// var() = var( [, ]? ) -// matches `name[, fallback]`, captures "name" and "fallback" -// See: http://dev.w3.org/csswg/css-variables/#funcdef-var -var RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/); - -// Pass in a value string to parse/resolve and a map of available values -// and we can figure out the final value -// -// `ignorePseudoScope`: Optional bool to determine whether the scope resolution should be left alone or not -// -// Note: We do not modify the declaration -// Note: Resolving a declaration value without any `var(...)` does not harm the final value. -// This means, feel free to run everything through this function -var resolveValue = function(decl, map, /*optional*/ignorePseudoScope, /*internal debugging*/_debugIsInternal) { - var debugIndent = _debugIsInternal ? '\t' : ''; - - var resultantValue = decl.value; - var warnings = []; - - var variablesUsedInValueMap = {}; - // Use `replace` as a loop to go over all occurrences with the `g` flag - resultantValue.replace(new RegExp(RE_VAR_FUNC.source, 'g'), function(match, variableName, fallback) { - variablesUsedInValueMap[variableName] = true; - }); - var variablesUsedInValue = Object.keys(variablesUsedInValueMap); - - //console.log(debugIndent, (_debugIsInternal ? '' : 'Try resolving'), generateScopeList(decl.parent, true), `ignorePseudoScope=${ignorePseudoScope}`, '------------------------'); - - // Resolve any var(...) substitutons - var isResultantValueUndefined = false; - resultantValue = resultantValue.replace(new RegExp(RE_VAR_FUNC.source, 'g'), function(match, variableName, fallback) { - // Loop through the list of declarations for that value and find the one that best matches - // By best match, we mean, the variable actually applies. Criteria: - // - is under the same scope - // - The latest defined `!important` if any - var matchingVarDeclMapItem; - (map[variableName] || []).forEach(function(varDeclMapItem) { - // Make sure the variable declaration came from the right spot - // And if the current matching variable is already important, a new one to replace it has to be important - var isRoot = varDeclMapItem.parent.type === 'root' || varDeclMapItem.parent.selectors[0] === ':root'; - - var underScope = isNodeUnderScope(decl.parent, varDeclMapItem.parent); - var underScsopeIgnorePseudo = isNodeUnderScope(decl.parent, varDeclMapItem.parent, ignorePseudoScope); - - //console.log(debugIndent, 'isNodeUnderScope', underScope, underScsopeIgnorePseudo, generateScopeList(varDeclMapItem.parent, true), varDeclMapItem.decl.value); - - if( - underScsopeIgnorePseudo && - // And if the currently matched declaration is `!important`, it will take another `!important` to override it - (!(matchingVarDeclMapItem || {}).isImportant || varDeclMapItem.isImportant) - ) { - matchingVarDeclMapItem = varDeclMapItem; - } - }); - - // Default to the calculatedInPlaceValue which might be a previous fallback, then try this declarations fallback - var replaceValue = (matchingVarDeclMapItem || {}).calculatedInPlaceValue || (function() { - // Resolve `var` values in fallback - var fallbackValue = fallback; - if(fallback) { - var fallbackDecl = decl.clone({ parent: decl.parent, value: fallback }); - fallbackValue = resolveValue(fallbackDecl, map, false, /*internal*/true).value; - } - - return fallbackValue; - })(); - // Otherwise if the dependency health is good(no circular or self references), dive deeper and resolve - if(matchingVarDeclMapItem !== undefined && !gatherVariableDependencies(variablesUsedInValue, map).hasCircularOrSelfReference) { - // Splice the declaration parent onto the matching entry - - var varDeclScopeList = generateScopeList(decl.parent.parent, true); - var innerMostAtRuleSelector = varDeclScopeList[0].slice(-1)[0]; - var nodeToSpliceParentOnto = findNodeAncestorWithSelector(innerMostAtRuleSelector, matchingVarDeclMapItem.decl.parent); - // See: `test/fixtures/cascade-with-calc-expression-on-nested-rules` - var matchingMimicDecl = cloneSpliceParentOntoNodeWhen(matchingVarDeclMapItem.decl, decl.parent.parent, function(ancestor) { - return ancestor === nodeToSpliceParentOnto; - }); - - replaceValue = resolveValue(matchingMimicDecl, map, false, /*internal*/true).value; - } - - isResultantValueUndefined = replaceValue === undefined; - if(isResultantValueUndefined) { - warnings.push(['variable ' + variableName + ' is undefined and used without a fallback', { node: decl }]); - } - - //console.log(debugIndent, 'replaceValue', replaceValue); - - return replaceValue; - }); - - return { - // The resolved value - value: !isResultantValueUndefined ? resultantValue : undefined, - // Array of variable names used in resolving this value - variablesUsed: variablesUsedInValue, - // Any warnings generated from parsing this value - warnings: warnings - }; -}; - -resolveValue.RE_VAR_FUNC = RE_VAR_FUNC; - - -module.exports = resolveValue; diff --git a/lib/shallow-clone-node.js b/lib/shallow-clone-node.js deleted file mode 100644 index 9f8c7c7..0000000 --- a/lib/shallow-clone-node.js +++ /dev/null @@ -1,46 +0,0 @@ -// Inspired by the PostCSS clone: https://github.com/postcss/postcss/blob/caba908d0f4e362466252202e6be84660c33d8a5/lib/node.js#L17 -var shallowCloneNode = function(obj, parent) { - var cloned = new obj.constructor(); - - Object.keys(obj).forEach(function(i) { - if (!obj.hasOwnProperty(i)) { - return; - } - - var value = obj[i]; - var type = typeof value; - - if (i === 'parent' && type === 'object') { - if (parent) { - cloned[i] = parent; - } - } - else if(i === 'source') { - cloned[i] = value; - } - else if (value instanceof Array) { - if(i === 'nodes') { - cloned[i] = []; - } - else { - cloned[i] = value.map(function(j) { - shallowCloneNode(j, cloned); - }); - } - } - else if ( - i !== 'before' && i !== 'after' && - i !== 'between' && i !== 'semicolon' - ) { - if(type === 'object') { - value = shallowCloneNode(value); - } - - cloned[i] = value; - } - }); - - return cloned; -}; - -module.exports = shallowCloneNode; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..72dd344 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4079 @@ +{ + "name": "postcss-css-variables", + "version": "0.9.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.2" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.12.0" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "browserslist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.0.0.tgz", + "integrity": "sha512-fJq4izbUYHHNdQd/5Mco31HeL8U8dg5sSaj5boaDP17+aAe41CrxSZbQifIjaWw27iIilmy48z9PrVtelNJhbw==", + "dev": true, + "requires": { + "caniuse-lite": "1.0.30000864", + "electron-to-chromium": "1.3.51", + "node-releases": "1.0.0-alpha.10" + } + }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "caniuse-api": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-2.0.0.tgz", + "integrity": "sha1-sd21pZZrFvSNxJmERNS7xsfZ2DQ=", + "dev": true, + "requires": { + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000864", + "lodash.memoize": "4.1.2", + "lodash.uniq": "4.5.0" + }, + "dependencies": { + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "dev": true, + "requires": { + "caniuse-lite": "1.0.30000864", + "electron-to-chromium": "1.3.51" + } + } + } + }, + "caniuse-lite": { + "version": "1.0.30000864", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000864.tgz", + "integrity": "sha512-8fuGh8n3MIQ7oBkO/ck7J4LXhV5Sz5aLyFmfpChWpK+rJhqYrOsGDdbBVDdyKIRBWamZpy6iM4OmLCFVudOOhg==", + "dev": true + }, + "chai": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", + "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "dev": true, + "requires": { + "assertion-error": "1.1.0", + "check-error": "1.0.2", + "deep-eql": "3.0.1", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.8" + } + }, + "chai-as-promised": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", + "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "dev": true, + "requires": { + "check-error": "1.0.2" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "coa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.1.tgz", + "integrity": "sha512-5wfTTO8E2/ja4jFSxePXlG5nRu5bBtL/r1HCIpJW/lzT6yDtKl0u0Z4o/Vpz32IpKmBn7HerheEZQgA9N2DarQ==", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "color": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", + "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", + "dev": true, + "requires": { + "color-convert": "1.9.2", + "color-string": "1.5.2" + } + }, + "color-convert": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", + "requires": { + "color-name": "1.1.1" + } + }, + "color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=" + }, + "color-string": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz", + "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=", + "dev": true, + "requires": { + "color-name": "1.1.1", + "simple-swizzle": "0.2.2" + } + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.1.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cosmiconfig": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.5.tgz", + "integrity": "sha512-94j37OtvxS5w7qr7Ta6dt67tWdnOxigBVN4VnSxNXFez9o18PGQ0D33SchKP17r9LAcWVTYV72G6vDayAUBFIg==", + "dev": true, + "requires": { + "is-directory": "0.3.1", + "js-yaml": "3.12.0", + "parse-json": "4.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true + }, + "css-declaration-sorter": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-3.0.1.tgz", + "integrity": "sha512-jH4024SHZ3e0M7ann9VxpFpH3moplRXNz9ZBqvFMZqi09Yo5ARbs2wdPH8GqN9iRTlQynrbGbraNbBxBLei85Q==", + "dev": true, + "requires": { + "postcss": "6.0.23", + "timsort": "0.3.0" + } + }, + "css-select": { + "version": "1.3.0-rc0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.3.0-rc0.tgz", + "integrity": "sha1-b5MZaqrnN2ZuoQNqjLFKj8t6kjE=", + "dev": true, + "requires": { + "boolbase": "1.0.0", + "css-what": "2.1.0", + "domutils": "1.5.1", + "nth-check": "1.0.1" + } + }, + "css-select-base-adapter": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.0.tgz", + "integrity": "sha1-AQKz0UYw34bD65+p9UVicBBs+ZA=", + "dev": true + }, + "css-tree": { + "version": "1.0.0-alpha25", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha25.tgz", + "integrity": "sha512-XC6xLW/JqIGirnZuUWHXCHRaAjje2b3OIB0Vj5RIJo6mIi/AdJo30quQl5LxUl0gkXDIrTrFGbMlcZjyFplz1A==", + "dev": true, + "requires": { + "mdn-data": "1.1.4", + "source-map": "0.5.7" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "css-unit-converter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", + "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=", + "dev": true + }, + "css-url-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/css-url-regex/-/css-url-regex-1.1.0.tgz", + "integrity": "sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w=", + "dev": true + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "cssnano": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.0.0.tgz", + "integrity": "sha1-4aQWHxfYLf9fuhepCnv9l63Xmhs=", + "dev": true, + "requires": { + "cosmiconfig": "5.0.5", + "cssnano-preset-default": "4.0.0", + "is-resolvable": "1.1.0", + "postcss": "6.0.23" + } + }, + "cssnano-preset-default": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.0.tgz", + "integrity": "sha1-wzQoe099SfstFwqS+SFGVXiOO2s=", + "dev": true, + "requires": { + "css-declaration-sorter": "3.0.1", + "cssnano-util-raw-cache": "4.0.0", + "postcss": "6.0.23", + "postcss-calc": "6.0.1", + "postcss-colormin": "4.0.0", + "postcss-convert-values": "4.0.0", + "postcss-discard-comments": "4.0.0", + "postcss-discard-duplicates": "4.0.0", + "postcss-discard-empty": "4.0.0", + "postcss-discard-overridden": "4.0.0", + "postcss-merge-longhand": "4.0.0", + "postcss-merge-rules": "4.0.0", + "postcss-minify-font-values": "4.0.0", + "postcss-minify-gradients": "4.0.0", + "postcss-minify-params": "4.0.0", + "postcss-minify-selectors": "4.0.0", + "postcss-normalize-charset": "4.0.0", + "postcss-normalize-display-values": "4.0.0", + "postcss-normalize-positions": "4.0.0", + "postcss-normalize-repeat-style": "4.0.0", + "postcss-normalize-string": "4.0.0", + "postcss-normalize-timing-functions": "4.0.0", + "postcss-normalize-unicode": "4.0.0", + "postcss-normalize-url": "4.0.0", + "postcss-normalize-whitespace": "4.0.0", + "postcss-ordered-values": "4.0.0", + "postcss-reduce-initial": "4.0.0", + "postcss-reduce-transforms": "4.0.0", + "postcss-svgo": "4.0.0", + "postcss-unique-selectors": "4.0.0" + } + }, + "cssnano-util-get-arguments": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", + "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=", + "dev": true + }, + "cssnano-util-get-match": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz", + "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=", + "dev": true + }, + "cssnano-util-raw-cache": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.0.tgz", + "integrity": "sha1-vgooVuJfGF9feivMBiTii38Xmp8=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "cssnano-util-same-parent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.0.tgz", + "integrity": "sha1-0qPeEDmqmLxOwlAB+gUDMMKhbaw=", + "dev": true + }, + "csso": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz", + "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==", + "dev": true, + "requires": { + "css-tree": "1.0.0-alpha.29" + }, + "dependencies": { + "css-tree": { + "version": "1.0.0-alpha.29", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz", + "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==", + "dev": true, + "requires": { + "mdn-data": "1.1.4", + "source-map": "0.5.7" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.12" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + }, + "electron-to-chromium": { + "version": "1.3.51", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.51.tgz", + "integrity": "sha1-akK0nar38ipbN7mR2vlJ8029ubU=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.7.0", + "ignore": "3.3.10", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.12.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.10", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + } + }, + "eslint-plugin-react": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.10.0.tgz", + "integrity": "sha512-18rzWn4AtbSUxFKKM7aCVcj5LXOhOKdwBino3KKWy4psxfPW0YtIbE8WNRDUdyHFL50BeLb6qFd4vpvNYyp7hw==", + "dev": true, + "requires": { + "doctrine": "2.1.0", + "has": "1.0.3", + "jsx-ast-utils": "2.0.1", + "prop-types": "15.6.2" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.7.1", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "flatten": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", + "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", + "dev": true + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hex-color-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", + "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", + "dev": true + }, + "hsl-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz", + "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=", + "dev": true + }, + "hsla-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz", + "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=", + "dev": true + }, + "html-comment-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", + "integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-color-stop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz", + "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=", + "dev": true, + "requires": { + "css-color-names": "0.0.4", + "hex-color-regex": "1.1.0", + "hsl-regex": "1.0.0", + "hsla-regex": "1.0.0", + "rgb-regex": "1.0.1", + "rgba-regex": "1.0.0" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.3" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-svg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz", + "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==", + "dev": true, + "requires": { + "html-comment-regex": "1.1.1" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "jsx-ast-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", + "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", + "dev": true, + "requires": { + "array-includes": "3.0.3" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true, + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "mdn-data": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", + "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", + "dev": true + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node-releases": { + "version": "1.0.0-alpha.10", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.10.tgz", + "integrity": "sha512-BSQrRgOfN6L/MoKIa7pRUc7dHvflCXMcqyTBvphixcSsgJTuUd24vAFONuNfVsuwTyz28S1HEc9XN6ZKylk4Hg==", + "dev": true, + "requires": { + "semver": "5.5.0" + } + }, + "normalize-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.1.0.tgz", + "integrity": "sha512-y7nyoGsYRm0hUhAxKFabfkVIoD89c6K5q8GoVALjPEOWfWfnz+ZUUmaQaKUKaEed1Fr+AOXaoEO8Q9jpum719A==", + "dev": true + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "1.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.12.0" + } + }, + "object.values": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.0.4.tgz", + "integrity": "sha1-5STaCbT2b/Bd9FdUbscqyZ8TBpo=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.12.0", + "function-bind": "1.1.1", + "has": "1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.2", + "json-parse-better-errors": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "postcss-calc": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-6.0.1.tgz", + "integrity": "sha1-PSQXG79udinUIqQ26/5t2VEfQzA=", + "dev": true, + "requires": { + "css-unit-converter": "1.1.1", + "postcss": "6.0.23", + "postcss-selector-parser": "2.2.3", + "reduce-css-calc": "2.1.4" + } + }, + "postcss-colormin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.0.tgz", + "integrity": "sha1-iiHxCzhDWQ0YHu3ypqEJYXtlU+w=", + "dev": true, + "requires": { + "browserslist": "4.0.0", + "color": "3.0.0", + "has": "1.0.3", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-convert-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.0.tgz", + "integrity": "sha1-d9d9mu0dxOaVbmUcw0nVMwWHb2I=", + "dev": true, + "requires": { + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-discard-comments": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.0.tgz", + "integrity": "sha1-loSimedrPpMmPvj9KtvxocCP2I0=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "postcss-discard-duplicates": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.0.tgz", + "integrity": "sha1-QvPCZ/hfqQngQsNXZ+z9Zcsr1yw=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "postcss-discard-empty": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.0.tgz", + "integrity": "sha1-VeGKWcdBKOOMfSgEvPpAVmEfuX8=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "postcss-discard-overridden": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.0.tgz", + "integrity": "sha1-Sgv4WXh4TPH4HtLBwf2dlkodofo=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "postcss-merge-longhand": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.0.tgz", + "integrity": "sha1-pFQbZooKasJaoh2TAUL9ArQacXw=", + "dev": true, + "requires": { + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0", + "stylehacks": "4.0.0" + } + }, + "postcss-merge-rules": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.0.tgz", + "integrity": "sha1-q0Z4Msv/SyLPk1D+2SU2Z36tTs8=", + "dev": true, + "requires": { + "browserslist": "4.0.0", + "caniuse-api": "2.0.0", + "cssnano-util-same-parent": "4.0.0", + "postcss": "6.0.23", + "postcss-selector-parser": "3.1.1", + "vendors": "1.0.2" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + } + } + }, + "postcss-minify-font-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.0.tgz", + "integrity": "sha1-TMM9KD1qgXWQNudX75gdksvYW+0=", + "dev": true, + "requires": { + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-minify-gradients": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.0.tgz", + "integrity": "sha1-P8ORZDnSepu4Bm23za2AFlDrCQ4=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "4.0.0", + "is-color-stop": "1.1.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-minify-params": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.0.tgz", + "integrity": "sha1-BekWbuSMBa9lGYnOhNOcG015BnQ=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "cssnano-util-get-arguments": "4.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0", + "uniqs": "2.0.0" + } + }, + "postcss-minify-selectors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.0.tgz", + "integrity": "sha1-sen2xGNBbT/Nyybnt4XZX2FXiq0=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "has": "1.0.3", + "postcss": "6.0.23", + "postcss-selector-parser": "3.1.1" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + } + } + }, + "postcss-node-scope-utility": { + "version": "0.1.0", + "requires": { + "debug": "3.1.0", + "postcss": "5.2.18", + "postcss-selector-parser": "1.3.3" + }, + "dependencies": { + "acorn": { + "version": "5.7.1", + "bundled": true + }, + "acorn-jsx": { + "version": "3.0.1", + "bundled": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "bundled": true + } + } + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ajv-keywords": { + "version": "1.5.1", + "bundled": true + }, + "ansi-escapes": { + "version": "1.4.0", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true + }, + "argparse": { + "version": "1.0.10", + "bundled": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-union": { + "version": "1.0.2", + "bundled": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "bundled": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "js-tokens": { + "version": "3.0.2", + "bundled": true + } + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "1.1.0", + "bundled": true + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true + }, + "caller-path": { + "version": "0.1.0", + "bundled": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "bundled": true + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "bundled": true + } + } + }, + "circular-json": { + "version": "0.3.3", + "bundled": true + }, + "cli-cursor": { + "version": "1.0.2", + "bundled": true, + "requires": { + "restore-cursor": "1.0.1" + } + }, + "cli-width": { + "version": "2.2.0", + "bundled": true + }, + "co": { + "version": "4.6.0", + "bundled": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "concat-stream": { + "version": "1.6.2", + "bundled": true, + "requires": { + "buffer-from": "1.1.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true + }, + "d": { + "version": "1.0.0", + "bundled": true, + "requires": { + "es5-ext": "0.10.45" + } + }, + "debug": { + "version": "3.1.0", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "bundled": true + }, + "deep-equal": { + "version": "1.0.1", + "bundled": true + }, + "deep-is": { + "version": "0.1.3", + "bundled": true + }, + "define-properties": { + "version": "1.1.2", + "bundled": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.12" + } + }, + "defined": { + "version": "1.0.0", + "bundled": true + }, + "del": { + "version": "2.2.2", + "bundled": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "doctrine": { + "version": "2.1.0", + "bundled": true, + "requires": { + "esutils": "2.0.2" + } + }, + "duplexer": { + "version": "0.1.1", + "bundled": true + }, + "error-ex": { + "version": "1.3.2", + "bundled": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "bundled": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.3", + "is-callable": "1.1.4", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "bundled": true, + "requires": { + "is-callable": "1.1.4", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "es5-ext": { + "version": "0.10.45", + "bundled": true, + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "next-tick": "1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "escope": { + "version": "3.6.0", + "bundled": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint": { + "version": "3.19.0", + "bundled": true, + "requires": { + "babel-code-frame": "6.26.0", + "chalk": "1.1.3", + "concat-stream": "1.6.2", + "debug": "2.6.9", + "doctrine": "2.1.0", + "escope": "3.6.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "glob": "7.1.2", + "globals": "9.18.0", + "ignore": "3.3.10", + "imurmurhash": "0.1.4", + "inquirer": "0.12.0", + "is-my-json-valid": "2.17.2", + "is-resolvable": "1.1.0", + "js-yaml": "3.12.0", + "json-stable-stringify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.10", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "1.2.1", + "progress": "1.1.8", + "require-uncached": "1.0.3", + "shelljs": "0.7.8", + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1", + "table": "3.8.3", + "text-table": "0.2.0", + "user-home": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globals": { + "version": "9.18.0", + "bundled": true + }, + "lodash": { + "version": "4.17.10", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "user-home": { + "version": "2.0.0", + "bundled": true, + "requires": { + "os-homedir": "1.0.2" + } + } + } + }, + "espree": { + "version": "3.5.4", + "bundled": true, + "requires": { + "acorn": "5.7.1", + "acorn-jsx": "3.0.1" + } + }, + "esquery": { + "version": "1.0.1", + "bundled": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "bundled": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "bundled": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true + }, + "event-emitter": { + "version": "0.3.5", + "bundled": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.45" + } + }, + "exit-hook": { + "version": "1.1.1", + "bundled": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "bundled": true + }, + "figures": { + "version": "1.7.0", + "bundled": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "bundled": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "find-up": { + "version": "1.1.2", + "bundled": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "path-exists": { + "version": "2.1.0", + "bundled": true, + "requires": { + "pinkie-promise": "2.0.1" + } + } + } + }, + "flat-cache": { + "version": "1.3.0", + "bundled": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "flatten": { + "version": "1.0.2", + "bundled": true + }, + "for-each": { + "version": "0.3.3", + "bundled": true, + "requires": { + "is-callable": "1.1.4" + } + }, + "foreach": { + "version": "2.0.5", + "bundled": true + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "function-bind": { + "version": "1.1.1", + "bundled": true + }, + "generate-function": { + "version": "2.0.0", + "bundled": true + }, + "generate-object-property": { + "version": "1.2.0", + "bundled": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true + }, + "globby": { + "version": "5.0.0", + "bundled": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "has": { + "version": "1.0.3", + "bundled": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true + }, + "hosted-git-info": { + "version": "2.7.1", + "bundled": true + }, + "ignore": { + "version": "3.3.10", + "bundled": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true + }, + "indexes-of": { + "version": "1.0.1", + "bundled": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "inquirer": { + "version": "0.12.0", + "bundled": true, + "requires": { + "ansi-escapes": "1.4.0", + "ansi-regex": "2.1.1", + "chalk": "1.1.3", + "cli-cursor": "1.0.2", + "cli-width": "2.2.0", + "figures": "1.7.0", + "lodash": "4.17.10", + "readline2": "1.0.1", + "run-async": "0.1.0", + "rx-lite": "3.1.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "through": "2.3.8" + }, + "dependencies": { + "lodash": { + "version": "4.17.10", + "bundled": true + } + } + }, + "interpret": { + "version": "1.1.0", + "bundled": true + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.4", + "bundled": true + }, + "is-date-object": { + "version": "1.0.1", + "bundled": true + }, + "is-finite": { + "version": "1.0.2", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-my-ip-valid": { + "version": "1.0.0", + "bundled": true + }, + "is-my-json-valid": { + "version": "2.17.2", + "bundled": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "bundled": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "bundled": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "bundled": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-property": { + "version": "1.0.2", + "bundled": true + }, + "is-regex": { + "version": "1.0.4", + "bundled": true, + "requires": { + "has": "1.0.3" + } + }, + "is-resolvable": { + "version": "1.1.0", + "bundled": true + }, + "is-symbol": { + "version": "1.0.1", + "bundled": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "js-base64": { + "version": "2.4.5", + "bundled": true + }, + "js-yaml": { + "version": "3.12.0", + "bundled": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "bundled": true + } + } + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "jsonify": { + "version": "0.0.0", + "bundled": true + }, + "jsonpointer": { + "version": "4.0.1", + "bundled": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "levn": { + "version": "0.3.0", + "bundled": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "lodash": { + "version": "4.17.10", + "bundled": true + }, + "minimist": { + "version": "1.2.0", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true + } + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "mute-stream": { + "version": "0.0.5", + "bundled": true + }, + "natural-compare": { + "version": "1.4.0", + "bundled": true + }, + "next-tick": { + "version": "1.0.0", + "bundled": true + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "requires": { + "hosted-git-info": "2.7.1", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "object-inspect": { + "version": "1.6.0", + "bundled": true + }, + "object-keys": { + "version": "1.0.12", + "bundled": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "1.1.0", + "bundled": true + }, + "optionator": { + "version": "0.8.2", + "bundled": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "bundled": true + } + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-locale": { + "version": "1.4.0", + "bundled": true, + "requires": { + "lcid": "1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "requires": { + "error-ex": "1.3.2" + } + }, + "parse-ms": { + "version": "1.0.1", + "bundled": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "path-is-inside": { + "version": "1.0.2", + "bundled": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "plur": { + "version": "1.0.0", + "bundled": true + }, + "pluralize": { + "version": "1.2.1", + "bundled": true + }, + "postcss": { + "version": "5.2.18", + "bundled": true, + "requires": { + "chalk": "1.1.3", + "js-base64": "2.4.5", + "source-map": "0.5.7", + "supports-color": "3.2.3" + } + }, + "postcss-selector-parser": { + "version": "1.3.3", + "bundled": true, + "requires": { + "flatten": "1.0.2", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, + "prelude-ls": { + "version": "1.1.2", + "bundled": true + }, + "pretty-ms": { + "version": "2.1.0", + "bundled": true, + "requires": { + "is-finite": "1.0.2", + "parse-ms": "1.0.1", + "plur": "1.0.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true + }, + "progress": { + "version": "1.1.8", + "bundled": true + }, + "re-emitter": { + "version": "1.1.3", + "bundled": true + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "readline2": { + "version": "1.0.1", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "mute-stream": "0.0.5" + } + }, + "rechoir": { + "version": "0.6.2", + "bundled": true, + "requires": { + "resolve": "1.8.1" + } + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true + }, + "require-directory": { + "version": "2.1.1", + "bundled": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true + }, + "require-uncached": { + "version": "1.0.3", + "bundled": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve": { + "version": "1.8.1", + "bundled": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "bundled": true + }, + "restore-cursor": { + "version": "1.0.1", + "bundled": true, + "requires": { + "exit-hook": "1.1.1", + "onetime": "1.1.0" + } + }, + "resumer": { + "version": "0.0.0", + "bundled": true, + "requires": { + "through": "2.3.8" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "requires": { + "glob": "7.1.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + } + } + }, + "run-async": { + "version": "0.1.0", + "bundled": true, + "requires": { + "once": "1.4.0" + } + }, + "rx-lite": { + "version": "3.1.2", + "bundled": true + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "semver": { + "version": "5.5.0", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "shelljs": { + "version": "0.7.8", + "bundled": true, + "requires": { + "glob": "7.1.2", + "interpret": "1.1.0", + "rechoir": "0.6.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + } + } + }, + "slice-ansi": { + "version": "0.0.4", + "bundled": true + }, + "source-map": { + "version": "0.5.7", + "bundled": true + }, + "spdx-correct": { + "version": "3.0.0", + "bundled": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "bundled": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "bundled": true + }, + "split": { + "version": "1.0.1", + "bundled": true, + "requires": { + "through": "2.3.8" + } + }, + "sprintf-js": { + "version": "1.0.3", + "bundled": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string.prototype.trim": { + "version": "1.1.2", + "bundled": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.12.0", + "function-bind": "1.1.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true + }, + "supports-color": { + "version": "3.2.3", + "bundled": true, + "requires": { + "has-flag": "1.0.0" + } + }, + "table": { + "version": "3.8.3", + "bundled": true, + "requires": { + "ajv": "4.11.8", + "ajv-keywords": "1.5.1", + "chalk": "1.1.3", + "lodash": "4.17.10", + "slice-ansi": "0.0.4", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "lodash": { + "version": "4.17.10", + "bundled": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "tap-out": { + "version": "1.4.2", + "bundled": true, + "requires": { + "re-emitter": "1.1.3", + "readable-stream": "2.3.6", + "split": "1.0.1", + "trim": "0.0.1" + } + }, + "tap-spec": { + "version": "4.1.2", + "bundled": true, + "requires": { + "chalk": "1.1.3", + "duplexer": "0.1.1", + "figures": "1.7.0", + "lodash": "3.10.1", + "pretty-ms": "2.1.0", + "repeat-string": "1.6.1", + "tap-out": "1.4.2", + "through2": "2.0.3" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "bundled": true + } + } + }, + "tape": { + "version": "4.9.1", + "bundled": true, + "requires": { + "deep-equal": "1.0.1", + "defined": "1.0.0", + "for-each": "0.3.3", + "function-bind": "1.1.1", + "glob": "7.1.2", + "has": "1.0.3", + "inherits": "2.0.3", + "minimist": "1.2.0", + "object-inspect": "1.6.0", + "resolve": "1.7.1", + "resumer": "0.0.0", + "string.prototype.trim": "1.1.2", + "through": "2.3.8" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "resolve": { + "version": "1.7.1", + "bundled": true, + "requires": { + "path-parse": "1.0.5" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "bundled": true + }, + "through": { + "version": "2.3.8", + "bundled": true + }, + "through2": { + "version": "2.0.3", + "bundled": true, + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, + "trim": { + "version": "0.0.1", + "bundled": true + }, + "type-check": { + "version": "0.3.2", + "bundled": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "bundled": true + }, + "uniq": { + "version": "1.0.1", + "bundled": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "bundled": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "bundled": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "write": { + "version": "0.2.1", + "bundled": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "xtend": { + "version": "4.0.1", + "bundled": true + }, + "y18n": { + "version": "3.2.1", + "bundled": true + }, + "yargs": { + "version": "6.6.0", + "bundled": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "4.2.1" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "bundled": true + }, + "cliui": { + "version": "3.2.0", + "bundled": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + } + } + }, + "yargs-parser": { + "version": "4.2.1", + "bundled": true, + "requires": { + "camelcase": "3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "bundled": true + } + } + } + } + }, + "postcss-normalize-charset": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.0.tgz", + "integrity": "sha1-JFJyknAtXoEp6vo9HeSe1RpqtzA=", + "dev": true, + "requires": { + "postcss": "6.0.23" + } + }, + "postcss-normalize-display-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.0.tgz", + "integrity": "sha1-lQ4Me+NEV3ChYP/9a2ZEw8DNj4k=", + "dev": true, + "requires": { + "cssnano-util-get-match": "4.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-positions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.0.tgz", + "integrity": "sha1-7pNDq5gbgixjq3JhXszNCFZERaM=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "4.0.0", + "has": "1.0.3", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-repeat-style": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.0.tgz", + "integrity": "sha1-txHFks8W+vn/V15C+hALZ5kIPv8=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "4.0.0", + "cssnano-util-get-match": "4.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.0.tgz", + "integrity": "sha1-cYy20wpvrGrGqDDjLAbAfbxm/l0=", + "dev": true, + "requires": { + "has": "1.0.3", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-timing-functions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.0.tgz", + "integrity": "sha1-A1HymIaqmB1D2RssK9GuptCvbSM=", + "dev": true, + "requires": { + "cssnano-util-get-match": "4.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-unicode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.0.tgz", + "integrity": "sha1-Ws1dR7rqXRdnSyzMSuUWb6iM35c=", + "dev": true, + "requires": { + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-url": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.0.tgz", + "integrity": "sha1-t6nIrSbPJmlMFG6y1ovQz0mVbw0=", + "dev": true, + "requires": { + "is-absolute-url": "2.1.0", + "normalize-url": "3.1.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-normalize-whitespace": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.0.tgz", + "integrity": "sha1-HafnaxCuY8EYJ/oE/Du0oe/pnMA=", + "dev": true, + "requires": { + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-ordered-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.0.0.tgz", + "integrity": "sha1-WLQMdPcuAi6zQVLBLksPk1RIL8I=", + "dev": true, + "requires": { + "cssnano-util-get-arguments": "4.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-reduce-initial": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.0.tgz", + "integrity": "sha1-CvvbDnOZlgqdBstFtGnYEhEItFs=", + "dev": true, + "requires": { + "browserslist": "4.0.0", + "caniuse-api": "2.0.0", + "has": "1.0.3", + "postcss": "6.0.23" + } + }, + "postcss-reduce-transforms": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.0.tgz", + "integrity": "sha1-9kX8dEDDUnT0DegQThStcWPt8Yg=", + "dev": true, + "requires": { + "cssnano-util-get-match": "4.0.0", + "has": "1.0.3", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-selector-parser": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz", + "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", + "dev": true, + "requires": { + "flatten": "1.0.2", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, + "postcss-svgo": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.0.tgz", + "integrity": "sha1-wLutAlIPxjbJ14sOhAPi5RXDIoU=", + "dev": true, + "requires": { + "is-svg": "3.0.0", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0", + "svgo": "1.0.5" + } + }, + "postcss-unique-selectors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.0.tgz", + "integrity": "sha1-BMHpdkx1h0JhMDQCxB8Ol2n8VQE=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "postcss": "6.0.23", + "uniqs": "2.0.0" + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "prop-types": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", + "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", + "dev": true, + "requires": { + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "reduce-css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz", + "integrity": "sha512-i/vWQbyd3aJRmip9OVSN9V6nIjLf/gg/ctxb0CpvHWtcRysFl/ngDBQD+rqavxdw/doScA3GMBXhzkHQ4GCzFQ==", + "dev": true, + "requires": { + "css-unit-converter": "1.1.1", + "postcss-value-parser": "3.3.0" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rgb-regex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", + "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=", + "dev": true + }, + "rgba-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz", + "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "0.3.2" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true + } + } + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "specificity": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz", + "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "stylehacks": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.0.tgz", + "integrity": "sha1-ZLMjlRxKJOX8ey7AbBN78y0VXoo=", + "dev": true, + "requires": { + "browserslist": "4.0.0", + "postcss": "6.0.23", + "postcss-selector-parser": "3.1.1" + }, + "dependencies": { + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + } + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "requires": { + "has-flag": "3.0.0" + } + }, + "svgo": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.0.5.tgz", + "integrity": "sha512-nYrifviB77aNKDNKKyuay3M9aYiK6Hv5gJVDdjj2ZXTQmI8WZc8+UPLR5IpVlktJfSu3co/4XcWgrgI6seGBPg==", + "dev": true, + "requires": { + "coa": "2.0.1", + "colors": "1.1.2", + "css-select": "1.3.0-rc0", + "css-select-base-adapter": "0.1.0", + "css-tree": "1.0.0-alpha25", + "css-url-regex": "1.1.0", + "csso": "3.5.1", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "object.values": "1.0.4", + "sax": "1.2.4", + "stable": "0.1.8", + "unquote": "1.1.1", + "util.promisify": "1.0.0" + }, + "dependencies": { + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + } + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.10", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "object.getownpropertydescriptors": "2.0.3" + } + }, + "vendors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", + "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 641cc8d..00316f8 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,11 @@ "url": "https://github.com/MadLittleMods/postcss-css-variables.git" }, "dependencies": { + "debug": "^3.1.0", "escape-string-regexp": "^1.0.3", - "extend": "^3.0.1", - "postcss": "^6.0.8" + "postcss": "^6.0.23", + "postcss-node-scope-utility": "0.1.0", + "specificity": "^0.3.2" }, "devDependencies": { "bluebird": "^3.5.0", diff --git a/test/fixtures/pseudo-multi.css b/test/fixtures/pseudo-multi.css new file mode 100644 index 0000000..944526d --- /dev/null +++ b/test/fixtures/pseudo-multi.css @@ -0,0 +1,16 @@ +.bar { + --color: pink; + color: var(--color); +} + +.bar:focus { + --color: green; +} + +.bar:hover { + --color: red; +} + +.bar:active { + --color: blue; +} diff --git a/test/fixtures/pseudo-multi.expected.css b/test/fixtures/pseudo-multi.expected.css new file mode 100644 index 0000000..ee7d8d5 --- /dev/null +++ b/test/fixtures/pseudo-multi.expected.css @@ -0,0 +1,15 @@ +.bar { + color: pink; +} + +.bar:active { + color: blue; +} + +.bar:hover { + color: red; +} + +.bar:focus { + color: green; +} diff --git a/test/test.js b/test/test.js index 66a6d6d..fe529de 100644 --- a/test/test.js +++ b/test/test.js @@ -100,7 +100,7 @@ describe('postcss-css-variables', function() { test('should work with pseudo selectors', 'pseudo-selector'); - //test('should work with multiple pseudo selectors', 'pseudo-multi'); + test('should work with multiple pseudo selectors', 'pseudo-multi'); test('should work with variables declared in pseudo selectors', 'pseudo-selector-declare-variable'); From 79c05ffd735aea23d2d5379ead865255949837be Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sun, 8 Jul 2018 03:00:34 -0500 Subject: [PATCH 2/8] Add in variable expansion/unroll for defining new variable value where usage could apply --- index.js | 84 +++++++++++++++---- .../missing-variable-should-fallback-calc.css | 4 +- ...variable-should-fallback-calc.expected.css | 4 +- .../missing-variable-should-fallback-var.css | 10 +-- ...-variable-should-fallback-var.expected.css | 6 +- .../pseudo-selector-declare-variable.css | 5 +- ...udo-selector-declare-variable.expected.css | 4 + test/test.js | 10 ++- 8 files changed, 95 insertions(+), 32 deletions(-) diff --git a/index.js b/index.js index 1ccf994..76d6934 100644 --- a/index.js +++ b/index.js @@ -76,24 +76,71 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { + // Collect all of the variables defined // --------------------------------------------------------- // --------------------------------------------------------- - eachCssVariableDeclaration(css, function(decl) { + eachCssVariableDeclaration(css, function(variableDecl) { // We cache the parent rule because after decl removal, it will be undefined - const declParentRule = decl.parent; - const variableName = decl.prop; + const variableDeclParentRule = variableDecl.parent; + const variableName = variableDecl.prop; + const variableValue = variableDecl.value; + const isImportant = variableDecl.important || false; + const variableSelectorBranchs = generateSelectorBranchesFromPostcssNode(variableDeclParentRule); + + debug(`Collecting ${variableName}=${variableValue} isImportant=${isImportant} from ${variableDeclParentRule.selector.toString()}`); map[variableName] = (map[variableName] || []).concat({ name: variableName, - value: decl.value, - isImportant: decl.important || false, - selectorBranches: generateSelectorBranchesFromPostcssNode(declParentRule) + value: variableValue, + isImportant, + selectorBranches: variableSelectorBranchs + }); + + + // Expand/rollout/unroll variable usage + // Where we define variables, also add in any usage that falls under scope + // ex. + // Before: + // .foo { --color: #f00; color: var(--color); } + // .foo:hover { --color: #0f0; }; + // After: + // .foo { color: #f00; } + // .foo:hover { color: #0f0; } + // -------------------------------- + css.walkDecls(function(usageDecl) { + // Avoid duplicating the usage decl on itself + if(variableDeclParentRule === usageDecl.parent) { + return; + } + + const usageSelectorBranches = generateSelectorBranchesFromPostcssNode(usageDecl.parent); + + variableSelectorBranchs.some((variableSelectorBranch) => { + return usageSelectorBranches.some((usageSelectorBranch) => { + // In this case, we look whether the usage is under the scope of the definition + const isUnderScope = isSelectorBranchUnderScope(usageSelectorBranch, variableSelectorBranch); + + debug(`Should expand usage? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) + + if(isUnderScope) { + usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { + if(matchedVariableName === variableName) { + variableDecl.after(usageDecl.clone()); + } + }); + } + + return isUnderScope; + }); + }); }); + + // Remove the variable declaration because they are pretty much useless after we resolve them if(!opts.preserve) { - decl.remove(); + variableDecl.remove(); } // Or we can also just show the computed value used for that variable else if(opts.preserve === 'computed') { @@ -101,25 +148,27 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { } // Clean up the rule that declared them if it doesn't have anything left after we potentially remove the variable decl - if(declParentRule.nodes.length <= 0) { - declParentRule.remove(); + if(variableDeclParentRule.nodes.length <= 0) { + variableDeclParentRule.remove(); } }); debug('map', map); + debug('After collecting variables ------'); + debug(css.toString()); + debug('---------------------------------'); // Resolve variables everywhere // --------------------------------------------------------- // --------------------------------------------------------- css.walkDecls(function(decl) { - // If it uses variables - // and is not a variable declarations that we may be preserving from earlier + // Avoid any variable decls, `--foo: var(--bar);`, that may have been preserved if(!RE_VAR_PROP.test(decl.prop)) { const selectorBranches = generateSelectorBranchesFromPostcssNode(decl.parent); - decl.value = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName) => { + decl.value = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName, fallback) => { debug('usage', variableName); const variableEntries = map[variableName] || []; @@ -131,10 +180,11 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // We only need to find one branch that matches variableEntry.selectorBranches.some((variableSelectorBranch) => { return selectorBranches.some((selectorBranch) => { + // Look whether the variable definition is under the scope of the usage const isUnderScope = isSelectorBranchUnderScope(variableSelectorBranch, selectorBranch); const specificity = getSpecificity(variableSelectorBranch.selector.toString()); - debug(`isUnderScope=${isUnderScope} compareSpecificity=${compareSpecificity(specificity, currentGreatestSpecificity)} specificity=${specificity}`, variableSelectorBranch.selector.toString(), selectorBranch.selector.toString()) + debug(`isUnderScope=${isUnderScope} compareSpecificity=${compareSpecificity(specificity, currentGreatestSpecificity)} specificity=${specificity}`, variableSelectorBranch.selector.toString(), '|', selectorBranch.selector.toString()) if(isUnderScope && compareSpecificity(specificity, currentGreatestSpecificity) >= 0) { currentGreatestSpecificity = specificity; @@ -148,7 +198,13 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { debug('currentGreatestVariableEntry', currentGreatestVariableEntry); - return currentGreatestVariableEntry.value; + const resultantValue = (currentGreatestVariableEntry && currentGreatestVariableEntry.value) || fallback; + + if(!resultantValue) { + result.warn(['variable ' + variableName + ' is undefined and used without a fallback', { node: decl }]); + } + + return resultantValue || 'undefined'; }); } }); diff --git a/test/fixtures/missing-variable-should-fallback-calc.css b/test/fixtures/missing-variable-should-fallback-calc.css index 6eb804d..92d452b 100644 --- a/test/fixtures/missing-variable-should-fallback-calc.css +++ b/test/fixtures/missing-variable-should-fallback-calc.css @@ -1,7 +1,7 @@ :root { - --foo1: 150px; + --foo1: 150px; } .box-bar { - width: var(--missing,calc(var(--foo1) + 100px)); + width: var(--missing,calc(var(--foo1) + 100px)); } diff --git a/test/fixtures/missing-variable-should-fallback-calc.expected.css b/test/fixtures/missing-variable-should-fallback-calc.expected.css index 1fdc6e1..fe3c117 100644 --- a/test/fixtures/missing-variable-should-fallback-calc.expected.css +++ b/test/fixtures/missing-variable-should-fallback-calc.expected.css @@ -1,3 +1,3 @@ .box-bar { - width: calc(150px + 100px); -} \ No newline at end of file + width: calc(150px + 100px); +} diff --git a/test/fixtures/missing-variable-should-fallback-var.css b/test/fixtures/missing-variable-should-fallback-var.css index a1ba533..0c515b8 100644 --- a/test/fixtures/missing-variable-should-fallback-var.css +++ b/test/fixtures/missing-variable-should-fallback-var.css @@ -1,12 +1,12 @@ :root { - --foo-default: 100px; - --foo-width: 150px; + --foo-default: 100px; + --foo-width: 150px; } .box-foo { - width: var(--missing); + width: var(--missing); } .box-bar { - width: var(--missing, var(--foo-default)); -} \ No newline at end of file + width: var(--missing, var(--foo-default)); +} diff --git a/test/fixtures/missing-variable-should-fallback-var.expected.css b/test/fixtures/missing-variable-should-fallback-var.expected.css index 693f012..0ee8389 100644 --- a/test/fixtures/missing-variable-should-fallback-var.expected.css +++ b/test/fixtures/missing-variable-should-fallback-var.expected.css @@ -1,7 +1,7 @@ .box-foo { - width: undefined; + width: undefined; } .box-bar { - width: 100px; -} \ No newline at end of file + width: 100px; +} diff --git a/test/fixtures/pseudo-selector-declare-variable.css b/test/fixtures/pseudo-selector-declare-variable.css index e9fbf9d..4f16a0a 100644 --- a/test/fixtures/pseudo-selector-declare-variable.css +++ b/test/fixtures/pseudo-selector-declare-variable.css @@ -7,11 +7,10 @@ --foo-color: #00ff00; } - -/* This should add nothing to `.foo`, wrong scope */ .bar:hover + .foo { --foo-color: #f0f000; } + /* This should add nothing to `.foo`, wrong scope */ .foo:hover + .bar { --foo-color: #0000ff; @@ -19,4 +18,4 @@ /* This should add nothing to `.foo`, wrong scope */ .foo:hover + .bar:focus { --foo-color: #000f0f; -} \ No newline at end of file +} diff --git a/test/fixtures/pseudo-selector-declare-variable.expected.css b/test/fixtures/pseudo-selector-declare-variable.expected.css index e74e941..7172442 100644 --- a/test/fixtures/pseudo-selector-declare-variable.expected.css +++ b/test/fixtures/pseudo-selector-declare-variable.expected.css @@ -5,3 +5,7 @@ .foo:hover { color: #00ff00; } + +.bar:hover + .foo { + color: #f0f000; +} diff --git a/test/test.js b/test/test.js index fe529de..2c1f65f 100644 --- a/test/test.js +++ b/test/test.js @@ -35,14 +35,18 @@ var testPlugin = function(filePath, expectedFilePath, options) { preset: { plugins: [normalizeWhitespace, discardComments] } }) ]) - .process(String(actualBuffer)); + .process(String(actualBuffer), { + from: filePath, + }); var expectedResult = postcss([ cssnano({ preset: { plugins: [normalizeWhitespace, discardComments] } }) ]) - .process(String(expectedBuffer)); + .process(String(expectedBuffer), { + from: expectedFilePath, + }); return Promise.props({ actualResult: actualResult, @@ -56,7 +60,7 @@ var testPlugin = function(filePath, expectedFilePath, options) { var fixtureBasePath = './test/fixtures/'; var test = function(message, fixtureName, options) { - it(message, function() { + it(`${message} (${fixtureName})`, function() { return testPlugin( path.join(fixtureBasePath, fixtureName + '.css'), path.join(fixtureBasePath, fixtureName + '.expected.css'), From ac72f50568b688c81b7175a652f04dfc378e94b2 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sun, 8 Jul 2018 23:54:57 -0500 Subject: [PATCH 3/8] Add opts.preserve (still need to tackle 'computed') and opts.preserveInjectedVariables support --- CHANGELOG.md | 7 +++ index.js | 61 ++++++++++++++++--- .../cascade-on-nested-rules.expected.css | 2 - .../js-defined-preserve-injected.expected.css | 7 --- .../fixtures/js-defined-preserve.expected.css | 8 +-- test/fixtures/media-query.expected.css | 3 +- test/fixtures/pseudo-multi.expected.css | 8 +-- test/test.js | 2 +- 8 files changed, 68 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b384bfa..f0dc7aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.0.0 - *upcoming* + + - Complete rewrite of the codebase using `postcss-node-scope-utility` + - Order is preserved instead of reversed, https://github.com/MadLittleMods/postcss-css-variables/issues/30 + - Fix variable only used from last pseudo-element, https://github.com/MadLittleMods/postcss-css-variables/issues/46 + - Variables supplied by `opts.variables` now live a single `:root` rule and don't leave empty `:root` around + # v0.9.0 - 2018-6-26 diff --git a/index.js b/index.js index 76d6934..0bf58a9 100644 --- a/index.js +++ b/index.js @@ -57,8 +57,16 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // Map of variable names to a list of declarations let map = {}; + // Add the js defined variables `opts.variables` to the map - Object.keys(opts.variables).forEach(function(prevVariableMap, variableKey) { + // --------------------------------------------------------- + // --------------------------------------------------------- + const rootNode = postcss.rule({ selector: ':root' }); + if(opts.variables && Object.keys(opts.variables).length > 0 && opts.preserve && opts.preserveInjectedVariables) { + css.prepend(rootNode); + } + + Object.keys(opts.variables).forEach(function(variableKey) { const variableEntry = opts.variables[variableKey]; // Automatically prefix any variable with `--` (CSS custom property syntax) if it doesn't have it already const variableName = variableKey.slice(0, 2) === '--' ? variableKey : '--' + variableKey; @@ -70,14 +78,19 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { name: variableName, value: variableValue, isImportant, - selectorBranches: [':root'] + selectorBranches: generateSelectorBranchesFromPostcssNode(rootNode) }); + + if(opts.preserve && opts.preserveInjectedVariables) { + const variableDecl = postcss.decl({ prop: variableName, value: variableValue }); + rootNode.append(variableDecl); + } }); - // Collect all of the variables defined + // Collect all of the variables defined `--foo: #f00;` // --------------------------------------------------------- // --------------------------------------------------------- eachCssVariableDeclaration(css, function(variableDecl) { @@ -105,8 +118,8 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // .foo { --color: #f00; color: var(--color); } // .foo:hover { --color: #0f0; }; // After: - // .foo { color: #f00; } - // .foo:hover { color: #0f0; } + // .foo { --color: #f00; color: var(--color); } + // .foo:hover { --color: #0f0; color: var(--color); } // -------------------------------- css.walkDecls(function(usageDecl) { // Avoid duplicating the usage decl on itself @@ -120,8 +133,10 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { return usageSelectorBranches.some((usageSelectorBranch) => { // In this case, we look whether the usage is under the scope of the definition const isUnderScope = isSelectorBranchUnderScope(usageSelectorBranch, variableSelectorBranch); + //const isUnderScope = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); debug(`Should expand usage? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) + //debug(`Should expand usage? isUnderScope=${isUnderScope}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) if(isUnderScope) { usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { @@ -137,7 +152,6 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { }); - // Remove the variable declaration because they are pretty much useless after we resolve them if(!opts.preserve) { variableDecl.remove(); @@ -146,6 +160,8 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { else if(opts.preserve === 'computed') { // TODO: put computed value here } + // Otherwise just leave them alone + // else {} // Clean up the rule that declared them if it doesn't have anything left after we potentially remove the variable decl if(variableDeclParentRule.nodes.length <= 0) { @@ -160,7 +176,17 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { debug('---------------------------------'); - // Resolve variables everywhere + + + // Resolve variable values + // --------------------------------------------------------- + // --------------------------------------------------------- + // TODO + + + + + // Resolve variable usage everywhere `var(--foo)` // --------------------------------------------------------- // --------------------------------------------------------- css.walkDecls(function(decl) { @@ -168,7 +194,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { if(!RE_VAR_PROP.test(decl.prop)) { const selectorBranches = generateSelectorBranchesFromPostcssNode(decl.parent); - decl.value = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName, fallback) => { + const newDeclValue = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName, fallback) => { debug('usage', variableName); const variableEntries = map[variableName] || []; @@ -204,11 +230,30 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { result.warn(['variable ' + variableName + ' is undefined and used without a fallback', { node: decl }]); } + // We use 'undefined' value as a string to avoid making other plugins down the line unhappy, see #22 return resultantValue || 'undefined'; }); + + + if(newDeclValue !== decl.value) { + let potentialClone = decl; + if(opts.preserve === true) { + potentialClone = decl.cloneBefore(); + } + + // We `cloneBefore` and put the value on the clone so that + // `walkDecl` doesn't try to iterate on the new decl + potentialClone.value = newDeclValue; + } + } }); + + debug('postcss-css-variables completed -'); + debug(css.toString()); + debug('---------------------------------'); + }; }); diff --git a/test/fixtures/cascade-on-nested-rules.expected.css b/test/fixtures/cascade-on-nested-rules.expected.css index 72cc644..e8aad42 100644 --- a/test/fixtures/cascade-on-nested-rules.expected.css +++ b/test/fixtures/cascade-on-nested-rules.expected.css @@ -6,7 +6,6 @@ } @media (max-width: 800px) { - .box-bar { width: 300px; } @@ -14,7 +13,6 @@ } @media (max-width: 800px) { - .box-foo { width: 300px; } diff --git a/test/fixtures/js-defined-preserve-injected.expected.css b/test/fixtures/js-defined-preserve-injected.expected.css index 477c361..c217850 100644 --- a/test/fixtures/js-defined-preserve-injected.expected.css +++ b/test/fixtures/js-defined-preserve-injected.expected.css @@ -1,10 +1,3 @@ -:root { -} -:root { -} -:root { -} - .box1 { width: 75px; width: var(--js-defined1); diff --git a/test/fixtures/js-defined-preserve.expected.css b/test/fixtures/js-defined-preserve.expected.css index ad4a6eb..ac898e8 100644 --- a/test/fixtures/js-defined-preserve.expected.css +++ b/test/fixtures/js-defined-preserve.expected.css @@ -1,11 +1,7 @@ -:root { - --js-defined-no-prefix: #ff0000; -} -:root { - --js-defined2: 80px; -} :root { --js-defined1: 75px; + --js-defined2: 80px; + --js-defined-no-prefix: #ff0000; } .box1 { diff --git a/test/fixtures/media-query.expected.css b/test/fixtures/media-query.expected.css index c1649c7..158a48f 100644 --- a/test/fixtures/media-query.expected.css +++ b/test/fixtures/media-query.expected.css @@ -3,8 +3,7 @@ } @media (max-width: 1000px) { - .box { width: 200px; } -} \ No newline at end of file +} diff --git a/test/fixtures/pseudo-multi.expected.css b/test/fixtures/pseudo-multi.expected.css index ee7d8d5..f969386 100644 --- a/test/fixtures/pseudo-multi.expected.css +++ b/test/fixtures/pseudo-multi.expected.css @@ -2,14 +2,14 @@ color: pink; } -.bar:active { - color: blue; +.bar:focus { + color: green; } .bar:hover { color: red; } -.bar:focus { - color: green; +.bar:active { + color: blue; } diff --git a/test/test.js b/test/test.js index 2c1f65f..0e743a6 100644 --- a/test/test.js +++ b/test/test.js @@ -54,7 +54,7 @@ var testPlugin = function(filePath, expectedFilePath, options) { }); }) .then(({ actualResult, expectedResult }) => { - expect(actualResult.css.replace(/\r?\n/g, '')).to.equal(expectedResult.css.replace(/\r?\n/g, '')); + expect(actualResult.css.replace(/(\r?\n)|\s/g, '')).to.equal(expectedResult.css.replace(/(\r?\n)|\s/g, '')); }); }; From e82198b93c7d41a5cfe7f497139dc2ca4533fd0c Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 9 Jul 2018 01:53:24 -0500 Subject: [PATCH 4/8] Add support for atrule/@media-query expansion --- index.js | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 0bf58a9..c1e3645 100644 --- a/index.js +++ b/index.js @@ -33,6 +33,30 @@ function eachCssVariableDeclaration(css, cb) { }); } +function cloneParentAncestry(node) { + const clone = node.clone(); + clone.removeAll(); + + if(node.parent && node.parent.type !== 'root') { + const parentClone = node.parent.clone(); + parentClone.removeAll(); + parentClone.append(clone); + + return cloneParentAncestry(parentClone); + } + + return clone; +} + +function insertNodeIntoAncestry(ancestry, insertNode) { + let deepestNode = ancestry; + while(!deepestNode.nodes || deepestNode.nodes.length > 0) { + deepestNode = deepestNode.nodes[0]; + } + + deepestNode.append(insertNode); +} + var defaults = { // Allows you to preserve custom properties & var() usage in output. @@ -123,7 +147,8 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // -------------------------------- css.walkDecls(function(usageDecl) { // Avoid duplicating the usage decl on itself - if(variableDeclParentRule === usageDecl.parent) { + // And make sure this decl has `var()` usage + if(variableDeclParentRule === usageDecl.parent || !RE_VAR_FUNC.test(usageDecl.value)) { return; } @@ -133,10 +158,8 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { return usageSelectorBranches.some((usageSelectorBranch) => { // In this case, we look whether the usage is under the scope of the definition const isUnderScope = isSelectorBranchUnderScope(usageSelectorBranch, variableSelectorBranch); - //const isUnderScope = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); - debug(`Should expand usage? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) - //debug(`Should expand usage? isUnderScope=${isUnderScope}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) + debug(`Should unroll decl? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) if(isUnderScope) { usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { @@ -145,6 +168,36 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { } }); } + else { + // If there is a conditional like a atrule/media-query, then we should check whether + // the variable can apply and put our usage within that same context + // Before: + // :root { --color: #f00; } + // @media (max-width: 1000px) { :root { --color: #0f0; } } + // .box { color: var(--color); } + // After: + // .box { color: #f00; } + // @media (max-width: 1000px) {.box { color: #0f0; } } + const hasAtRule = (variableSelectorBranch.conditionals || []).some((conditional) => { + return conditional.type === 'atrule'; + }) + if(hasAtRule) { + const doesVariableApplyToUsage = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); + debug(`Should expand usage? doesVariableApplyToUsage=${doesVariableApplyToUsage}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) + + // Create a new usage clone with only the usage decl + const newUsageRule = usageDecl.parent.clone(); + newUsageRule.removeAll(); + newUsageRule.append(usageDecl.clone()); + + const variableAncestry = cloneParentAncestry(variableDecl.parent.parent); + insertNodeIntoAncestry(variableAncestry, newUsageRule); + + usageDecl.parent.cloneBefore(); + usageDecl.parent.replaceWith(variableAncestry); + } + } + return isUnderScope; }); @@ -164,8 +217,11 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // else {} // Clean up the rule that declared them if it doesn't have anything left after we potentially remove the variable decl - if(variableDeclParentRule.nodes.length <= 0) { - variableDeclParentRule.remove(); + let currentNodeToCheckEmpty = variableDeclParentRule; + while(currentNodeToCheckEmpty.nodes.length === 0) { + const nodeToRemove = currentNodeToCheckEmpty; + currentNodeToCheckEmpty = nodeToRemove.parent; + nodeToRemove.remove(); } }); From 71950b8f5f3aec0ac972702a87c69038d5534ba4 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 9 Jul 2018 02:04:34 -0500 Subject: [PATCH 5/8] Fix not checking atrule/media query actually applying for all cases --- index.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index c1e3645..8bcc087 100644 --- a/index.js +++ b/index.js @@ -161,6 +161,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { debug(`Should unroll decl? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) + // For general cases, we can put variable usage right-below the variable definition if(isUnderScope) { usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { if(matchedVariableName === variableName) { @@ -168,6 +169,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { } }); } + // For at-rules else { // If there is a conditional like a atrule/media-query, then we should check whether // the variable can apply and put our usage within that same context @@ -183,18 +185,20 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { }) if(hasAtRule) { const doesVariableApplyToUsage = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); - debug(`Should expand usage? doesVariableApplyToUsage=${doesVariableApplyToUsage}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) + debug(`Should expand atrule? doesVariableApplyToUsage=${doesVariableApplyToUsage}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) - // Create a new usage clone with only the usage decl - const newUsageRule = usageDecl.parent.clone(); - newUsageRule.removeAll(); - newUsageRule.append(usageDecl.clone()); + if(doesVariableApplyToUsage) { + // Create a new usage clone with only the usage decl + const newUsageRule = usageDecl.parent.clone(); + newUsageRule.removeAll(); + newUsageRule.append(usageDecl.clone()); - const variableAncestry = cloneParentAncestry(variableDecl.parent.parent); - insertNodeIntoAncestry(variableAncestry, newUsageRule); + const variableAncestry = cloneParentAncestry(variableDecl.parent.parent); + insertNodeIntoAncestry(variableAncestry, newUsageRule); - usageDecl.parent.cloneBefore(); - usageDecl.parent.replaceWith(variableAncestry); + usageDecl.parent.cloneBefore(); + usageDecl.parent.replaceWith(variableAncestry); + } } } From 42e45a466b2ee676197bab26cf2700985b34cfa8 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 9 Jul 2018 03:58:35 -0500 Subject: [PATCH 6/8] Fix dynimically added variable usage from expanding causing extra expansion See `npm test -- --grep="variable-reference-other-variable-media-query2"` --- .eslintrc | 1 + index.js | 120 +++++------------- lib/clone-parent-ancestry.js | 20 +++ lib/expand-var-usage-from-var-definition.js | 79 ++++++++++++ lib/var-regex.js | 10 ++ test/clone-parent-ancestry-test.js | 64 ++++++++++ test/fixtures/media-query-nested.css | 2 +- test/fixtures/media-query-nested.expected.css | 7 +- ...e-other-variable-media-query2.expected.css | 3 +- test/test.js | 1 + 10 files changed, 207 insertions(+), 100 deletions(-) create mode 100644 lib/clone-parent-ancestry.js create mode 100644 lib/expand-var-usage-from-var-definition.js create mode 100644 lib/var-regex.js create mode 100644 test/clone-parent-ancestry-test.js diff --git a/.eslintrc b/.eslintrc index b06f486..b060a61 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,6 +3,7 @@ "es6": true, "node": true, "browser": true, + "mocha": true, }, "parserOptions": { "ecmaVersion": 6, diff --git a/index.js b/index.js index 8bcc087..a4c36e1 100644 --- a/index.js +++ b/index.js @@ -4,11 +4,13 @@ const specificityLib = require('specificity'); const generateSelectorBranchesFromPostcssNode = require('postcss-node-scope-utility/lib/generate-branches'); const isSelectorBranchUnderScope = require('postcss-node-scope-utility/lib/is-branch-under-scope'); -// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS) -// `--foo` -// See: http://dev.w3.org/csswg/css-variables/#custom-property -const RE_VAR_PROP = (/(--(.+))/); -const RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/); +const { + RE_VAR_PROP, + RE_VAR_FUNC +} = require('./lib/var-regex'); +const expandVarUsageFromVarDefinition = require('./lib/expand-var-usage-from-var-definition'); + + function getSpecificity(selector) { // We only care about the first piece because we have already split the comma-separated pieces before we use this @@ -33,30 +35,6 @@ function eachCssVariableDeclaration(css, cb) { }); } -function cloneParentAncestry(node) { - const clone = node.clone(); - clone.removeAll(); - - if(node.parent && node.parent.type !== 'root') { - const parentClone = node.parent.clone(); - parentClone.removeAll(); - parentClone.append(clone); - - return cloneParentAncestry(parentClone); - } - - return clone; -} - -function insertNodeIntoAncestry(ancestry, insertNode) { - let deepestNode = ancestry; - while(!deepestNode.nodes || deepestNode.nodes.length > 0) { - deepestNode = deepestNode.nodes[0]; - } - - deepestNode.append(insertNode); -} - var defaults = { // Allows you to preserve custom properties & var() usage in output. @@ -117,22 +95,25 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // Collect all of the variables defined `--foo: #f00;` // --------------------------------------------------------- // --------------------------------------------------------- + const usageDeclsToSkip = []; eachCssVariableDeclaration(css, function(variableDecl) { // We cache the parent rule because after decl removal, it will be undefined const variableDeclParentRule = variableDecl.parent; const variableName = variableDecl.prop; const variableValue = variableDecl.value; const isImportant = variableDecl.important || false; - const variableSelectorBranchs = generateSelectorBranchesFromPostcssNode(variableDeclParentRule); + const variableSelectorBranches = generateSelectorBranchesFromPostcssNode(variableDeclParentRule); debug(`Collecting ${variableName}=${variableValue} isImportant=${isImportant} from ${variableDeclParentRule.selector.toString()}`); - map[variableName] = (map[variableName] || []).concat({ + const variableEntry = { name: variableName, value: variableValue, isImportant, - selectorBranches: variableSelectorBranchs - }); + selectorBranches: variableSelectorBranches + }; + + map[variableName] = (map[variableName] || []).concat(variableEntry); // Expand/rollout/unroll variable usage @@ -146,69 +127,26 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // .foo:hover { --color: #0f0; color: var(--color); } // -------------------------------- css.walkDecls(function(usageDecl) { - // Avoid duplicating the usage decl on itself - // And make sure this decl has `var()` usage - if(variableDeclParentRule === usageDecl.parent || !RE_VAR_FUNC.test(usageDecl.value)) { + if( + // Avoid iterating a var declaration `--var: #f00` + RE_VAR_PROP.test(usageDecl.prop) || + // Make sure this decl has `var()` usage + !RE_VAR_FUNC.test(usageDecl.value) || + // Avoid duplicating the usage decl on itself + variableDeclParentRule === usageDecl.parent || + // Avoid iterating a clone we may have just added before + usageDeclsToSkip.some((skipDecl) => skipDecl === usageDecl) + ) { return; } - const usageSelectorBranches = generateSelectorBranchesFromPostcssNode(usageDecl.parent); - - variableSelectorBranchs.some((variableSelectorBranch) => { - return usageSelectorBranches.some((usageSelectorBranch) => { - // In this case, we look whether the usage is under the scope of the definition - const isUnderScope = isSelectorBranchUnderScope(usageSelectorBranch, variableSelectorBranch); - - debug(`Should unroll decl? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) - - // For general cases, we can put variable usage right-below the variable definition - if(isUnderScope) { - usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { - if(matchedVariableName === variableName) { - variableDecl.after(usageDecl.clone()); - } - }); - } - // For at-rules - else { - // If there is a conditional like a atrule/media-query, then we should check whether - // the variable can apply and put our usage within that same context - // Before: - // :root { --color: #f00; } - // @media (max-width: 1000px) { :root { --color: #0f0; } } - // .box { color: var(--color); } - // After: - // .box { color: #f00; } - // @media (max-width: 1000px) {.box { color: #0f0; } } - const hasAtRule = (variableSelectorBranch.conditionals || []).some((conditional) => { - return conditional.type === 'atrule'; - }) - if(hasAtRule) { - const doesVariableApplyToUsage = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); - debug(`Should expand atrule? doesVariableApplyToUsage=${doesVariableApplyToUsage}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) - - if(doesVariableApplyToUsage) { - // Create a new usage clone with only the usage decl - const newUsageRule = usageDecl.parent.clone(); - newUsageRule.removeAll(); - newUsageRule.append(usageDecl.clone()); - - const variableAncestry = cloneParentAncestry(variableDecl.parent.parent); - insertNodeIntoAncestry(variableAncestry, newUsageRule); - - usageDecl.parent.cloneBefore(); - usageDecl.parent.replaceWith(variableAncestry); - } - } - } - - - return isUnderScope; - }); - }); + const newUsageDecl = expandVarUsageFromVarDefinition(variableEntry, variableDecl, usageDecl); + // Keep track of the cloned decls we should skip over + usageDeclsToSkip.push(newUsageDecl); }); + // Remove the variable declaration because they are pretty much useless after we resolve them if(!opts.preserve) { variableDecl.remove(); @@ -270,7 +208,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { const isUnderScope = isSelectorBranchUnderScope(variableSelectorBranch, selectorBranch); const specificity = getSpecificity(variableSelectorBranch.selector.toString()); - debug(`isUnderScope=${isUnderScope} compareSpecificity=${compareSpecificity(specificity, currentGreatestSpecificity)} specificity=${specificity}`, variableSelectorBranch.selector.toString(), '|', selectorBranch.selector.toString()) + debug(`isUnderScope=${isUnderScope} compareSpecificity=${compareSpecificity(specificity, currentGreatestSpecificity)} specificity=${specificity}`, variableSelectorBranch.selector.toString(), '|', selectorBranch.selector.toString(), '-->', variableEntry.value) if(isUnderScope && compareSpecificity(specificity, currentGreatestSpecificity) >= 0) { currentGreatestSpecificity = specificity; diff --git a/lib/clone-parent-ancestry.js b/lib/clone-parent-ancestry.js new file mode 100644 index 0000000..2c78395 --- /dev/null +++ b/lib/clone-parent-ancestry.js @@ -0,0 +1,20 @@ +function cloneParentAncestry(node) { + let ancestry = null; + + let currentNode = node; + while(currentNode.parent && currentNode.parent.type !== 'root') { + const parentClone = currentNode.parent.clone(); + parentClone.removeAll(); + + if(ancestry) { + parentClone.append(ancestry); + } + + ancestry = parentClone; + currentNode = currentNode.parent; + } + + return ancestry; +} + +module.exports = cloneParentAncestry; diff --git a/lib/expand-var-usage-from-var-definition.js b/lib/expand-var-usage-from-var-definition.js new file mode 100644 index 0000000..51777df --- /dev/null +++ b/lib/expand-var-usage-from-var-definition.js @@ -0,0 +1,79 @@ +const debug = require('debug')('postcss-css-variables:plugin:expand-var-usage'); +const generateSelectorBranchesFromPostcssNode = require('postcss-node-scope-utility/lib/generate-branches'); +const isSelectorBranchUnderScope = require('postcss-node-scope-utility/lib/is-branch-under-scope'); + +const { + RE_VAR_FUNC +} = require('./var-regex'); +const cloneParentAncestry = require('./clone-parent-ancestry'); + +function insertNodeIntoAncestry(ancestry, insertNode) { + let deepestNode = ancestry; + while(!deepestNode.nodes || deepestNode.nodes.length > 0) { + deepestNode = deepestNode.nodes[0]; + } + + deepestNode.append(insertNode); +} + + +function expandVarUsageFromVarDefinition(variableEntry, variableDecl, usageDecl) { + const newUsageDecl = usageDecl.clone(); + const usageSelectorBranches = generateSelectorBranchesFromPostcssNode(usageDecl.parent); + + variableEntry.selectorBranches.some((variableSelectorBranch) => { + return usageSelectorBranches.some((usageSelectorBranch) => { + // In this case, we look whether the usage is under the scope of the definition + const isUnderScope = isSelectorBranchUnderScope(usageSelectorBranch, variableSelectorBranch); + + debug(`Should unroll decl? isUnderScope=${isUnderScope}`, usageSelectorBranch.selector.toString(), '|', variableSelectorBranch.selector.toString()) + + // For general cases, we can put variable usage right-below the variable definition + if(isUnderScope) { + usageDecl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, matchedVariableName) => { + if(matchedVariableName === variableEntry.name) { + variableDecl.after(newUsageDecl); + } + }); + } + // For at-rules + else { + // If there is a conditional like a atrule/media-query, then we should check whether + // the variable can apply and put our usage within that same context + // Before: + // :root { --color: #f00; } + // @media (max-width: 1000px) { :root { --color: #0f0; } } + // .box { color: var(--color); } + // After: + // .box { color: #f00; } + // @media (max-width: 1000px) {.box { color: #0f0; } } + const hasAtRule = (variableSelectorBranch.conditionals || []).some((conditional) => { + return conditional.type === 'atrule'; + }) + if(hasAtRule) { + const doesVariableApplyToUsage = isSelectorBranchUnderScope(variableSelectorBranch, usageSelectorBranch, { ignoreConditionals: true }); + debug(`Should expand atrule? doesVariableApplyToUsage=${doesVariableApplyToUsage}`, variableSelectorBranch.selector.toString(), '|', usageSelectorBranch.selector.toString()) + + if(doesVariableApplyToUsage) { + // Create a new usage clone with only the usage decl + const newUsageRule = usageDecl.parent.clone(); + newUsageRule.removeAll(); + newUsageRule.append(newUsageDecl); + + const variableAncestry = cloneParentAncestry(variableDecl.parent); + insertNodeIntoAncestry(variableAncestry, newUsageRule); + + usageDecl.parent.cloneBefore(); + usageDecl.parent.replaceWith(variableAncestry); + } + } + } + + return isUnderScope; + }); + }); + + return newUsageDecl; +} + +module.exports = expandVarUsageFromVarDefinition; diff --git a/lib/var-regex.js b/lib/var-regex.js new file mode 100644 index 0000000..5dcff43 --- /dev/null +++ b/lib/var-regex.js @@ -0,0 +1,10 @@ +// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS) +// `--foo` +// See: http://dev.w3.org/csswg/css-variables/#custom-property +const RE_VAR_PROP = (/(--(.+))/); +const RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/); + +module.exports = { + RE_VAR_PROP, + RE_VAR_FUNC +}; diff --git a/test/clone-parent-ancestry-test.js b/test/clone-parent-ancestry-test.js new file mode 100644 index 0000000..51e9f1d --- /dev/null +++ b/test/clone-parent-ancestry-test.js @@ -0,0 +1,64 @@ + +var chai = require('chai'); +var expect = chai.expect; +var chaiAsPromised = require('chai-as-promised'); +chai.use(chaiAsPromised); + +var postcss = require('postcss'); +var cloneParentAncestry = require('../lib/clone-parent-ancestry'); + +let getDeepestChildRule = function(css) { + let deepestNode; + let currentNode = postcss.parse(css); + while(currentNode) { + //console.log(currentNode); + let child = currentNode.first; + if(child && child.type === 'rule') { + deepestNode = child; + } + + currentNode = child; + } + + return deepestNode; +}; + + +var test = function(message, css, expected) { + it(message, function() { + const node = getDeepestChildRule(css); + + const ancestry = cloneParentAncestry(node); + + expect(ancestry && ancestry.toString().replace(/(\r?\n)|\s/g, '')).to.equal(expected); + }); +}; + + +describe('cloneParentAncestry', () => { + test('should work with 1 rule', `.foo{}`, null); + + test('should work with nested rules', `.foo{.bar{}}`, '.foo{}'); + + test('should work with nested at-rules and rules', `@media print { .foo {} }`, '@mediaprint{}'); + + test('should with at-rules', `@media print { .foo { .bar{} } }`, '@mediaprint{.foo{}}'); + + test('should work with 2 levels of at-rules', ` + @media print { + @media (max-width: 1250px) { + .foo {} + } + } + `, '@mediaprint{@media(max-width:1250px){}}'); + + test('should work with 3 levels of at-rules', ` + @media print { + @media (max-width: 1250px) { + @media (max-width: 1000px) { + .foo {} + } + } + } + `, '@mediaprint{@media(max-width:1250px){@media(max-width:1000px){}}}'); +}); diff --git a/test/fixtures/media-query-nested.css b/test/fixtures/media-query-nested.css index 89ca3eb..84edb5c 100644 --- a/test/fixtures/media-query-nested.css +++ b/test/fixtures/media-query-nested.css @@ -18,4 +18,4 @@ .box { width: var(--width); -} \ No newline at end of file +} diff --git a/test/fixtures/media-query-nested.expected.css b/test/fixtures/media-query-nested.expected.css index f17544f..51810cd 100644 --- a/test/fixtures/media-query-nested.expected.css +++ b/test/fixtures/media-query-nested.expected.css @@ -3,11 +3,8 @@ } @media print { - @media (max-width: 1250px) { - @media (max-width: 1000px) { - .box { width: 450px; } @@ -16,11 +13,9 @@ } @media print { - @media (max-width: 1250px) { - .box { width: 300px; } } -} \ No newline at end of file +} diff --git a/test/fixtures/variable-reference-other-variable-media-query2.expected.css b/test/fixtures/variable-reference-other-variable-media-query2.expected.css index 90194ca..6755f75 100644 --- a/test/fixtures/variable-reference-other-variable-media-query2.expected.css +++ b/test/fixtures/variable-reference-other-variable-media-query2.expected.css @@ -3,8 +3,7 @@ } @media (max-width: 960px) { - .foo { width: 300px; } -} \ No newline at end of file +} diff --git a/test/test.js b/test/test.js index 0e743a6..458bd76 100644 --- a/test/test.js +++ b/test/test.js @@ -54,6 +54,7 @@ var testPlugin = function(filePath, expectedFilePath, options) { }); }) .then(({ actualResult, expectedResult }) => { + // TODO: Investigate why we need this to actually remove whitespace expect(actualResult.css.replace(/(\r?\n)|\s/g, '')).to.equal(expectedResult.css.replace(/(\r?\n)|\s/g, '')); }); }; From b7b165b1448378564a5bd598d2000742cfaceb85 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sun, 15 Jul 2018 16:11:29 -0500 Subject: [PATCH 7/8] Fix NPE when removing the only rule --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index a4c36e1..b977659 100644 --- a/index.js +++ b/index.js @@ -49,12 +49,10 @@ var defaults = { preserveInjectedVariables: true }; -module.exports = postcss.plugin('postcss-css-variables', function(options) { +const cssvariables = postcss.plugin('postcss-css-variables', function(options) { var opts = Object.assign({}, defaults, options); - // Work with opts here - return function (css, result) { // Map of variable names to a list of declarations let map = {}; @@ -140,6 +138,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { return; } + // TODO: Is there a way to walk the decls backwards so we can get the @media queries in the correct order const newUsageDecl = expandVarUsageFromVarDefinition(variableEntry, variableDecl, usageDecl); // Keep track of the cloned decls we should skip over usageDeclsToSkip.push(newUsageDecl); @@ -160,7 +159,7 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { // Clean up the rule that declared them if it doesn't have anything left after we potentially remove the variable decl let currentNodeToCheckEmpty = variableDeclParentRule; - while(currentNodeToCheckEmpty.nodes.length === 0) { + while(currentNodeToCheckEmpty && currentNodeToCheckEmpty.nodes.length === 0) { const nodeToRemove = currentNodeToCheckEmpty; currentNodeToCheckEmpty = nodeToRemove.parent; nodeToRemove.remove(); @@ -255,3 +254,6 @@ module.exports = postcss.plugin('postcss-css-variables', function(options) { }; }); + + +module.exports = cssvariables; From 7ee009ed5f8ec30b5205ed4a3d69deb10bb6473e Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 24 Jul 2018 17:55:56 -0500 Subject: [PATCH 8/8] Plan to split comma separated rules and add new test case --- index.js | 10 ++++++++++ .../comma-separated-variable-nested-usage.css | 14 ++++++++++++++ ...a-separated-variable-nested-usage.expected.css | 15 +++++++++++++++ test/test.js | 3 ++- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/comma-separated-variable-nested-usage.css create mode 100644 test/fixtures/comma-separated-variable-nested-usage.expected.css diff --git a/index.js b/index.js index b977659..8d38f38 100644 --- a/index.js +++ b/index.js @@ -183,6 +183,15 @@ const cssvariables = postcss.plugin('postcss-css-variables', function(options) { + + // Split comma separated selectors into separate rules + // --------------------------------------------------------- + // --------------------------------------------------------- + // TODO + + + + // Resolve variable usage everywhere `var(--foo)` // --------------------------------------------------------- // --------------------------------------------------------- @@ -190,6 +199,7 @@ const cssvariables = postcss.plugin('postcss-css-variables', function(options) { // Avoid any variable decls, `--foo: var(--bar);`, that may have been preserved if(!RE_VAR_PROP.test(decl.prop)) { const selectorBranches = generateSelectorBranchesFromPostcssNode(decl.parent); + console.log('selectorBranches', selectorBranches.map((branch) => branch.selector.toString())); const newDeclValue = decl.value.replace(new RegExp(RE_VAR_FUNC.source, 'g'), (match, variableName, fallback) => { debug('usage', variableName); diff --git a/test/fixtures/comma-separated-variable-nested-usage.css b/test/fixtures/comma-separated-variable-nested-usage.css new file mode 100644 index 0000000..194b744 --- /dev/null +++ b/test/fixtures/comma-separated-variable-nested-usage.css @@ -0,0 +1,14 @@ +.bar { + --color: red; +} +.baz { + --color: blue; +} + +.foo { + .bar, .baz { + .qux { + color: var(--color); + } + } +} diff --git a/test/fixtures/comma-separated-variable-nested-usage.expected.css b/test/fixtures/comma-separated-variable-nested-usage.expected.css new file mode 100644 index 0000000..7607533 --- /dev/null +++ b/test/fixtures/comma-separated-variable-nested-usage.expected.css @@ -0,0 +1,15 @@ +.foo { + .bar { + .qux { + color: red; + } + } +} + +.foo { + .baz { + .qux { + color: blue; + } + } +} diff --git a/test/test.js b/test/test.js index 458bd76..409082a 100644 --- a/test/test.js +++ b/test/test.js @@ -113,7 +113,8 @@ describe('postcss-css-variables', function() { test('should work with variables defined in comma separated selector', 'comma-separated-variable-declaration'); - test('should work use the correct variable in comma separated selector', 'comma-separated-variable-usage'); + test('should use the correct variable in comma separated selector', 'comma-separated-variable-usage'); + test('should use the correct variable in nested comma separated selector', 'comma-separated-variable-nested-usage'); test('should work with star selector', 'star-selector-scope');