Comparing version 1.1.0 to 1.1.1
@@ -64,3 +64,3 @@ "use strict"; | ||
this.name = json.name; | ||
this.depNames = (json.dependencies && Object.keys(json.dependencies)) || []; | ||
this.depNames = lodash_1.uniq(((json.dependencies && Object.keys(json.dependencies)) || []).concat((json.devDependencies && Object.keys(json.devDependencies)) || [])); | ||
this.list = list; | ||
@@ -110,12 +110,11 @@ this.cycle = false; | ||
const orders = []; | ||
while (pkgs.length > 0) { | ||
const newStuff = new PackageMap(pkgs).topoMap; | ||
orders.push(newStuff); | ||
const cycled = newStuff.reduce((acc, el) => { | ||
acc[el.name] = el.cycle; | ||
return acc; | ||
}, {}); | ||
pkgs = pkgs.filter(p => cycled[p.name]); | ||
} | ||
if (orders.length > 1) { | ||
const newStuff = new PackageMap(pkgs).topoMap; | ||
orders.push(newStuff); | ||
const cycled = newStuff.reduce((acc, el) => { | ||
acc[el.name] = el.cycle; | ||
return acc; | ||
}, {}); | ||
pkgs = pkgs.filter(p => cycled[p.name]); | ||
if (pkgs.length > 0) { | ||
console.error('Cycles detected', pkgs); | ||
throw new Error('Found cyclic deps'); | ||
@@ -122,0 +121,0 @@ } |
@@ -51,2 +51,25 @@ "use strict"; | ||
}); | ||
let pkgs2 = [ | ||
{ | ||
name: 'backend', | ||
version: '1.0.0', | ||
dependencies: { | ||
lodash: '3.10.1' | ||
}, | ||
devDependencies: { 'h4-format': '*' } | ||
}, | ||
{ | ||
name: 'h4-format', | ||
version: '1.0.0' | ||
} | ||
]; | ||
describe('topomap devdeps', () => { | ||
it('should create full build order', () => { | ||
let fbo = topomap_1.buildOrder(pkgs2).sort((p1, p2) => p1.order - p2.order); | ||
expect(fbo[0].name).toEqual('h4-format'); | ||
expect(fbo[0].order).toEqual(1); | ||
expect(fbo[1].name).toEqual('backend'); | ||
expect(fbo[1].order).toEqual(2); | ||
}); | ||
}); | ||
//# sourceMappingURL=topomap.spec.js.map |
@@ -6,3 +6,4 @@ export declare type Dict<T> = { | ||
name: string; | ||
dependencies: Dict<string>; | ||
dependencies?: Dict<string>; | ||
devDependencies?: Dict<string>; | ||
} | ||
@@ -9,0 +10,0 @@ export declare type Packages = Dict<{ |
{ | ||
"name": "wsrun", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "executes commands on packages in parallel, but is aware of the dependencies between them", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
35772
543