sass-graph
Advanced tools
Comparing version 2.2.4 to 3.0.0
@@ -5,2 +5,4 @@ # Change Log | ||
## [next] | ||
### BREAKING CHANGES | ||
### Features | ||
@@ -12,2 +14,27 @@ | ||
### Dependencies | ||
## [3.0.0] | ||
### BREAKING CHANGES | ||
- Drop support Node < 6 (@realityking, #88, @xzyfer 3b2ec74) | ||
- Don't add .css imports to the graph by default (@xzyfer, #91) | ||
### Features | ||
- Add option to exclude files based on regular expression (@Iambecomeroot, #86) | ||
### Fixes | ||
- Fix broken bounds check in CLI (@xzyfer, 5dd065e) | ||
### Dependencies | ||
- yargs@^10.0.3 (@realityking, #88) | ||
- chai@^4.1.2 (@realityking, #88) | ||
- coveralls@^3.0.0 (@realityking, #88) | ||
- mocha@^4.0.1 (@realityking, #88) | ||
- nyc@^11.2.1 (@realityking, #88) | ||
- scss-tokenizer@^0.3.0 (@xzyfer, 3b2ec74) | ||
## [2.2.4] | ||
@@ -14,0 +41,0 @@ ### Dependencies |
{ | ||
"name": "sass-graph", | ||
"version": "2.2.4", | ||
"version": "3.0.0", | ||
"description": "Parse sass files and extract a graph of imports", | ||
@@ -23,12 +23,15 @@ "license": "MIT", | ||
"lodash": "^4.0.0", | ||
"scss-tokenizer": "^0.2.3", | ||
"yargs": "^7.0.0" | ||
"scss-tokenizer": "^0.3.0", | ||
"yargs": "^10.0.3" | ||
}, | ||
"devDependencies": { | ||
"assert": "^1.3.0", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.13.0", | ||
"mocha": "^3.2.0", | ||
"nyc": "^10.2.0" | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.0", | ||
"mocha": "^4.0.1", | ||
"nyc": "^11.2.1" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
}, | ||
"files": [ | ||
@@ -35,0 +38,0 @@ "bin", |
@@ -85,2 +85,9 @@ # Sass Graph | ||
#### exclude | ||
Type: `RegExp` | ||
Default: `undefined` | ||
Exclude files matching regular expression. | ||
## Example | ||
@@ -87,0 +94,0 @@ |
@@ -45,2 +45,3 @@ 'use strict'; | ||
this.extensions = options.extensions || []; | ||
this.exclude = options.exclude instanceof RegExp ? options.exclude : null; | ||
this.index = {}; | ||
@@ -62,2 +63,4 @@ this.follow = options.follow || false; | ||
Graph.prototype.addFile = function(filepath, parent) { | ||
if (this.exclude !== null && this.exclude.test(filepath)) return; | ||
var entry = this.index[filepath] = this.index[filepath] || { | ||
@@ -80,2 +83,5 @@ imports: [], | ||
// check exclcude regex | ||
if (this.exclude !== null && this.exclude.test(resolved)) continue; | ||
// recurse into dependencies if not already enumerated | ||
@@ -98,3 +104,6 @@ if (!_.includes(entry.imports, resolved)) { | ||
entry.importedBy.push(resolvedParent); | ||
// check exclcude regex | ||
if (!(this.exclude !== null && this.exclude.test(resolvedParent))) { | ||
entry.importedBy.push(resolvedParent); | ||
} | ||
} | ||
@@ -139,5 +148,5 @@ }; | ||
function processOptions(options) { | ||
return _.assign({ | ||
return Object.assign({ | ||
loadPaths: [process.cwd()], | ||
extensions: ['scss', 'css', 'sass'], | ||
extensions: ['scss', 'sass'], | ||
}, options); | ||
@@ -144,0 +153,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
16362
201
131
+ Addedansi-regex@3.0.1(transitive)
+ Addedcamelcase@4.1.0(transitive)
+ Addedcliui@4.1.0(transitive)
+ Addedcross-spawn@5.1.0(transitive)
+ Addedexeca@0.7.0(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmem@1.1.0(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedos-locale@2.1.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedscss-tokenizer@0.3.0(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsource-map@0.7.4(transitive)
+ Addedstring-width@2.1.1(transitive)
+ Addedstrip-ansi@4.0.0(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyargs@10.1.2(transitive)
+ Addedyargs-parser@8.1.0(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcamelcase@3.0.0(transitive)
- Removedcliui@3.2.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedscss-tokenizer@0.2.3(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedwhich-module@1.0.0(transitive)
- Removedyargs@7.1.2(transitive)
- Removedyargs-parser@5.0.1(transitive)
Updatedscss-tokenizer@^0.3.0
Updatedyargs@^10.0.3