Comparing version 0.6.14 to 0.7.0
@@ -5,2 +5,6 @@ # History | ||
## 0.7.0 | ||
**Change** option: ignore -> skip | ||
## 0.6.14 | ||
@@ -7,0 +11,0 @@ |
@@ -24,4 +24,4 @@ 'use strict'; | ||
// ignore file or package when parseFiles | ||
ignore: [] | ||
// skip file or package when parseFiles, and won't exist in deps | ||
skip: [] | ||
}; | ||
@@ -182,2 +182,6 @@ | ||
var fileDeps = getFileDeps(data, ext, options) | ||
.filter(function(item) { | ||
// skip file or package | ||
return options.skip.indexOf(item) === -1; | ||
}) | ||
.map(function(item) { | ||
@@ -192,8 +196,6 @@ if (!util.isRelative(item)) return item; | ||
fileDeps.forEach(function(name) { | ||
deps.push(name); | ||
// dependent packages | ||
if (!util.isRelative(name)) { | ||
var pkg_ = pkg.dependencies[name]; | ||
if (!~options.ignore.indexOf(name) && !pkg_) { | ||
if (!pkg.dependencies[name]) { | ||
throw new Error(name + ' not found but required'); | ||
@@ -204,2 +206,4 @@ } | ||
deps.push(name); | ||
// relative files | ||
@@ -206,0 +210,0 @@ name = util.resolvePath(name, src); |
{ | ||
"name": "father", | ||
"version": "0.6.14", | ||
"version": "0.7.0", | ||
"description": "A package parser that can resolve self and dependencies, supporting spm, component.", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -166,3 +166,3 @@ # father [![Build Status](https://travis-ci.org/popomore/father.png?branch=master)](https://travis-ci.org/popomore/father) [![Coverage Status](https://coveralls.io/repos/popomore/father/badge.png?branch=master)](https://coveralls.io/r/popomore/father?branch=master) | ||
### ignore | ||
### skip | ||
@@ -174,10 +174,18 @@ ``` | ||
If you don't want to parse package b, you can specify ignore. And it won't parse the dependencies of b. | ||
If you want to skip file or package, you can specify skip. And it won't parse b and won't exist in dependencies. | ||
``` | ||
new Package('path/to/package', { | ||
ignore: ['b'] | ||
skip: ['b'] | ||
}); | ||
``` | ||
yield | ||
``` | ||
define('a', [], function(require) { | ||
require('b') | ||
}); | ||
``` | ||
## Custom | ||
@@ -184,0 +192,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19709
461
227