live-guide
Advanced tools
Comparing version 0.10.2 to 0.11.0
@@ -13,2 +13,4 @@ #!/usr/bin/env node | ||
.describe('name', 'name for the style guide or product') | ||
.alias('syntax', 's') | ||
.describe('syntax', 'add or override syntax filters to our main parser, this preforms a deepmerge') | ||
//.alias('c', 'config') | ||
@@ -27,5 +29,6 @@ //.alias('t', 'template') | ||
resources: cliOptions.resource || [], | ||
name: cliOptions.name || 'Styleguide' | ||
name: cliOptions.name || 'Styleguide', | ||
syntax: cliOptions.syntax || undefined | ||
} | ||
require('../index.js')(options); |
'use strict'; | ||
const deepMerge = require('deepmerge'); | ||
const filterComments = (obj, syntax) => { | ||
syntax = syntax || require('./lib/syntax'); | ||
syntax = deepMerge(require('./lib/syntax'), syntax); | ||
@@ -6,0 +8,0 @@ let keys = Object.keys(syntax); |
@@ -5,5 +5,7 @@ 'use strict'; | ||
const filterRawString = (cssData) => { | ||
const filterRawString = function(cssData) { | ||
const options = this; | ||
cssData.forEach((obj) => { | ||
filterArray(obj); | ||
filterArray(obj, options.syntax); | ||
}); | ||
@@ -10,0 +12,0 @@ |
'use strict'; | ||
// Node / NPM Modules; | ||
const chalk = require('chalk'); | ||
const chalk = require('chalk'), | ||
fs = require('fs-extra'); | ||
@@ -28,2 +29,3 @@ // LOCAL MODULES | ||
options.resources = options.resources || []; | ||
options.syntax = options.syntax ? require(options.syntax) : {}; | ||
@@ -41,3 +43,3 @@ return Promise.resolve(resolveDirs(options.input)) | ||
.then(extractComments) | ||
.then(filterRawString) | ||
.then(filterRawString.bind(options)) | ||
.then(reduceObjects) | ||
@@ -44,0 +46,0 @@ .then(copyResources.bind(options)) |
{ | ||
"name": "live-guide", | ||
"version": "0.10.2", | ||
"version": "0.11.0", | ||
"description": "Generate style guides based on commented style sheets.", | ||
@@ -38,2 +38,3 @@ "author": { | ||
"concat": "^1.0.0", | ||
"deepmerge": "^0.2.10", | ||
"fs-extra": "^0.24.0", | ||
@@ -40,0 +41,0 @@ "glob": "^5.0.14", |
@@ -95,2 +95,13 @@ live-guide | ||
##### Syntax | ||
**type:** `Module` | ||
**description** Additional syntax parsers that will be merged with the default syntaxes. This preforms a `deepmerge` so you can override existing functionality. | ||
**required:** false | ||
**default:** `{}` | ||
--- | ||
## Use in command line: | ||
@@ -111,2 +122,3 @@ ```shell | ||
--name, -n name for the style guide or product | ||
--syntax, -s add or override syntax filters to our main parser, this preforms a deepmerge | ||
--help, -h Show help [boolean] | ||
@@ -113,0 +125,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40178
970
191
12
12
+ Addeddeepmerge@^0.2.10
+ Addeddeepmerge@0.2.10(transitive)