neuron-tree
Advanced tools
Comparing version 0.1.2 to 1.0.0
22
index.js
@@ -23,3 +23,4 @@ 'use strict'; | ||
exports._each(shrinked, function (name, version, deps) { | ||
var merged_deps = {}; | ||
var merged_sync_deps = {}; | ||
var merged_async_deps = {}; | ||
@@ -29,7 +30,13 @@ // Maintains order, and the latter one has higher priority. | ||
if (~types.indexOf(type) && (type in deps)) { | ||
exports._merge(merged_deps, deps[type]); | ||
var dest = IS_ASYNC[type] | ||
? merged_async_deps | ||
: merged_sync_deps; | ||
exports._merge(dest, deps[type]); | ||
} | ||
}); | ||
if (exports._is_empty(merged_deps)) { | ||
if ( | ||
exports._is_empty(merged_sync_deps) | ||
&& exports._is_empty(merged_async_deps) | ||
) { | ||
return; | ||
@@ -39,3 +46,3 @@ } | ||
var versions = parsed[name] || (parsed[name] = {}); | ||
versions[version] = merged_deps; | ||
versions[version] = [merged_sync_deps, merged_async_deps]; | ||
}); | ||
@@ -54,2 +61,9 @@ | ||
var IS_ASYNC = { | ||
"devDependencies": false, | ||
"asyncDependencies": true, | ||
"dependencies": false, | ||
"engines": false | ||
}; | ||
var DEFAULT_TYPES = [ | ||
@@ -56,0 +70,0 @@ "asyncDependencies", |
{ | ||
"name": "neuron-tree", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "Generates the config.tree of neuron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,7 +9,17 @@ # neuron-tree [![NPM version](https://badge.fury.io/js/neuron-tree.svg)](http://badge.fury.io/js/neuron-tree) [![Build Status](https://travis-ci.org/cortexjs/neuron-tree.svg?branch=master)](https://travis-ci.org/cortexjs/neuron-tree) [![Dependency Status](https://gemnasium.com/cortexjs/neuron-tree.svg)](https://gemnasium.com/cortexjs/neuron-tree) | ||
// dependencies and async dependencies | ||
<dep-name>: { | ||
<dep-range>: <dep-version> | ||
} | ||
<dep-name>: [ | ||
// synchronous dependencies | ||
{ | ||
<sync-dep-range>: <sync-dep-version> | ||
... | ||
}, | ||
// asynchronous dependencies | ||
{ | ||
<async-dep-range>: <async-dep-version> | ||
... | ||
} | ||
] | ||
} | ||
} | ||
... | ||
``` | ||
@@ -16,0 +26,0 @@ |
exports.full = { | ||
"unit-m-customer": { | ||
"0.0.0": { | ||
"zepto": { | ||
"~1.2.0": "1.2.0", | ||
"~1.1.3": "1.1.3" | ||
"0.0.0": [ | ||
{ | ||
"zepto": { | ||
"~1.2.0": "1.2.0", | ||
"~1.1.3": "1.1.3" | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15", | ||
"^2.0.3": "2.100.444444" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
}, | ||
"neuron": { | ||
"~5.1.0": "5.1.0" | ||
} | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15", | ||
"^2.0.3": "2.100.444444" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
}, | ||
"neuron": { | ||
"~5.1.0": "5.1.0" | ||
} | ||
} | ||
{} | ||
] | ||
}, | ||
"zepto": { | ||
"1.1.3": { | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
"1.1.3": [ | ||
{ | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
} | ||
}, | ||
{ | ||
"efte": { | ||
"~0.1.6": "0.1.25" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
@@ -31,24 +41,34 @@ }; | ||
"unit-m-customer": { | ||
"0.0.0": { | ||
"zepto": { | ||
"~1.1.3": "1.1.3" | ||
"0.0.0": [ | ||
{ | ||
"zepto": { | ||
"~1.1.3": "1.1.3" | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15", | ||
"^2.0.3": "2.100.444444" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
}, | ||
"neuron": { | ||
"~5.1.0": "5.1.0" | ||
} | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15", | ||
"^2.0.3": "2.100.444444" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
}, | ||
"neuron": { | ||
"~5.1.0": "5.1.0" | ||
} | ||
} | ||
{} | ||
] | ||
}, | ||
"zepto": { | ||
"1.1.3": { | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
"1.1.3": [ | ||
{ | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
} | ||
}, | ||
{ | ||
"efte": { | ||
"~0.1.6": "0.1.25" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
@@ -59,21 +79,27 @@ }; | ||
"unit-m-customer": { | ||
"0.0.0": { | ||
"zepto": { | ||
"~1.1.3": "1.1.3" | ||
"0.0.0": [ | ||
{ | ||
"zepto": { | ||
"~1.1.3": "1.1.3" | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
} | ||
}, | ||
"efte": { | ||
"~0.1.6": "0.1.15" | ||
}, | ||
"underscore": { | ||
"~1.5.3": "1.5.3" | ||
} | ||
} | ||
{} | ||
] | ||
}, | ||
"zepto": { | ||
"1.1.3": { | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
} | ||
} | ||
"1.1.3": [ | ||
{ | ||
"foo": { | ||
"~100.0.32": "100.0.2-actually-wrong-version" | ||
} | ||
}, | ||
{} | ||
] | ||
} | ||
}; |
@@ -21,3 +21,7 @@ { | ||
"a": "bad data", | ||
"b": ["bad data"] | ||
"b": ["bad data"], | ||
"efte": { | ||
"from": "efte@~0.1.6", | ||
"version": "0.1.25" | ||
} | ||
}, | ||
@@ -24,0 +28,0 @@ "dependencies": { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
9660
295
1
58