workspace-tools
Advanced tools
Comparing version 0.7.6 to 0.8.0
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Tue, 26 May 2020 16:55:38 GMT", | ||
"date": "Fri, 19 Jun 2020 17:53:47 GMT", | ||
"tag": "workspace-tools_v0.8.0", | ||
"version": "0.8.0", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"comment": "adding getTransitiveProviders and renamed getTransitiveDependencies to getTransitiveConsumers", | ||
"author": "kchau@microsoft.com", | ||
"commit": "e2148df920bf05ac84425108e0ea3695b0743c9f", | ||
"package": "workspace-tools" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Tue, 26 May 2020 16:55:44 GMT", | ||
"tag": "workspace-tools_v0.7.6", | ||
@@ -8,0 +23,0 @@ "version": "0.7.6", |
# Change Log - workspace-tools | ||
This log was last generated on Tue, 26 May 2020 16:55:38 GMT and should not be manually modified. | ||
This log was last generated on Fri, 19 Jun 2020 17:53:47 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 0.8.0 | ||
Fri, 19 Jun 2020 17:53:47 GMT | ||
### Minor changes | ||
- adding getTransitiveProviders and renamed getTransitiveDependencies to getTransitiveConsumers (kchau@microsoft.com) | ||
## 0.7.6 | ||
Tue, 26 May 2020 16:55:38 GMT | ||
Tue, 26 May 2020 16:55:44 GMT | ||
@@ -11,0 +19,0 @@ ### Patches |
import { PackageInfo, PackageInfos } from "./types/PackageInfo"; | ||
export declare function getDependentMap(packages: PackageInfos): Map<string, Set<string>>; | ||
export declare function getTransitiveDependencies(scopedPackages: string[], packages: PackageInfos): string[]; | ||
/** | ||
* for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a) | ||
* @param targets | ||
* @param packages | ||
*/ | ||
export declare function getTransitiveConsumers(targets: string[], packages: PackageInfos): string[]; | ||
/** | ||
* for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c) | ||
* @param targets | ||
* @param packages | ||
*/ | ||
export declare function getTransitiveProviders(targets: string[], packages: PackageInfos): string[]; | ||
/** @deprecated use `getDownstreamDependencies()` instead */ | ||
export declare const getTransitiveDependencies: typeof getTransitiveConsumers; | ||
export declare function getInternalDeps(info: PackageInfo, packages: PackageInfos): string[]; |
@@ -30,5 +30,10 @@ "use strict"; | ||
exports.getDependentMap = getDependentMap; | ||
function getTransitiveDependencies(scopedPackages, packages) { | ||
/** | ||
* for a package graph of a->b->c (where b depends on a), transitive consumers of a are b & c and their consumers (or what are the consequences of a) | ||
* @param targets | ||
* @param packages | ||
*/ | ||
function getTransitiveConsumers(targets, packages) { | ||
const graph = getPackageGraph(packages); | ||
const pkgQueue = [...scopedPackages]; | ||
const pkgQueue = [...targets]; | ||
const visited = new Set(); | ||
@@ -46,5 +51,30 @@ while (pkgQueue.length > 0) { | ||
} | ||
return [...visited].filter((pkg) => !scopedPackages.includes(pkg)); | ||
return [...visited].filter((pkg) => !targets.includes(pkg)); | ||
} | ||
exports.getTransitiveDependencies = getTransitiveDependencies; | ||
exports.getTransitiveConsumers = getTransitiveConsumers; | ||
/** | ||
* for a package graph of a->b->c (where b depends on a), transitive providers of c are a & b and their providers (or what is needed to satisfy c) | ||
* @param targets | ||
* @param packages | ||
*/ | ||
function getTransitiveProviders(targets, packages) { | ||
const graph = getPackageGraph(packages); | ||
const pkgQueue = [...targets]; | ||
const visited = new Set(); | ||
while (pkgQueue.length > 0) { | ||
const pkg = pkgQueue.shift(); | ||
if (!visited.has(pkg)) { | ||
visited.add(pkg); | ||
for (const [from, to] of graph) { | ||
if (to === pkg) { | ||
pkgQueue.push(from); | ||
} | ||
} | ||
} | ||
} | ||
return [...visited].filter((pkg) => !targets.includes(pkg)); | ||
} | ||
exports.getTransitiveProviders = getTransitiveProviders; | ||
/** @deprecated use `getDownstreamDependencies()` instead */ | ||
exports.getTransitiveDependencies = getTransitiveConsumers; | ||
function getInternalDeps(info, packages) { | ||
@@ -51,0 +81,0 @@ const deps = Object.keys(Object.assign(Object.assign({}, info.dependencies), info.devDependencies)); |
{ | ||
"name": "workspace-tools", | ||
"version": "0.7.6", | ||
"version": "0.8.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
71996
69
1679