@ms-cloudpack/package-utilities
Advanced tools
Comparing version 7.5.1 to 7.5.2
@@ -7,2 +7,3 @@ import type { PackageDefinitionsCache, PackageJson } from '@ms-cloudpack/common-types'; | ||
* preferring packageMap dependencies over linkedMap dependencies. | ||
* Returns a list of duplicated packages that were added to the packageMap. | ||
*/ | ||
@@ -16,3 +17,5 @@ export declare function addLinkedEntryDependencies(options: { | ||
packages: PackageDefinitionsCache; | ||
}): Promise<void>; | ||
}): Promise<{ | ||
duplicates: string[]; | ||
}>; | ||
//# sourceMappingURL=addLinkedEntryDependencies.d.ts.map |
@@ -6,2 +6,3 @@ import { satisfies } from 'semver'; | ||
* preferring packageMap dependencies over linkedMap dependencies. | ||
* Returns a list of duplicated packages that were added to the packageMap. | ||
*/ | ||
@@ -12,2 +13,3 @@ export async function addLinkedEntryDependencies(options, context) { | ||
const visitedEntryPaths = new Set(linkedEntry.path); | ||
const duplicates = []; | ||
const entriesToVisit = [linkedEntry]; | ||
@@ -74,2 +76,3 @@ function enqueue(newEntry) { | ||
dependencyEntry.requiredBy = { [`${name}@${version}`]: versionRequirement }; | ||
duplicates.push(`${dependencyName}@${dependencyEntry.version}`); | ||
// Recursive through the dependency's dependencies. | ||
@@ -82,3 +85,4 @@ enqueue(dependencyEntry); | ||
} | ||
return { duplicates }; | ||
} | ||
//# sourceMappingURL=addLinkedEntryDependencies.js.map |
@@ -6,2 +6,3 @@ import { addLinkedEntryDependencies } from './addLinkedEntryDependencies.js'; | ||
import { slash } from '@ms-cloudpack/path-string-parsing'; | ||
import { dedupeLinkedPackages } from './dedupeLinkedPackages.js'; | ||
/** | ||
@@ -78,6 +79,11 @@ * Given a linked path, an appMap, find packages from the linked path and add them to the appMap. | ||
} | ||
const allDuplicates = []; | ||
// Once all linked entries have been added, ensure their dependencies are resolved. | ||
for (const linkedEntry of entriesToLink) { | ||
await addLinkedEntryDependencies({ linkedEntry, appMap: appMap, linkMap, resolutions }, context); | ||
const { duplicates } = await addLinkedEntryDependencies({ linkedEntry, appMap: appMap, linkMap, resolutions }, context); | ||
allDuplicates.push(...duplicates); | ||
} | ||
if (linkedPath.resolveStrategy !== 'duplicate') { | ||
dedupeLinkedPackages({ appMap, allDuplicates: new Set(allDuplicates) }); | ||
} | ||
} | ||
@@ -84,0 +90,0 @@ function isContainedInPath(path, basePath) { |
@@ -25,3 +25,5 @@ /** | ||
ignoreResolutions?: boolean; | ||
/** The strategy to use when resolving linked packages. Defaults to "dedupe". */ | ||
resolveStrategy?: 'dedupe' | 'duplicate'; | ||
} | ||
//# sourceMappingURL=LinkedPath.d.ts.map |
{ | ||
"name": "@ms-cloudpack/package-utilities", | ||
"version": "7.5.1", | ||
"version": "7.5.2", | ||
"description": "Utilities for resolving/parsing packages and their imports.", | ||
@@ -17,7 +17,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@ms-cloudpack/common-types": "^0.7.0", | ||
"@ms-cloudpack/common-types": "^0.7.1", | ||
"@ms-cloudpack/json-utilities": "^0.1.4", | ||
"@ms-cloudpack/package-overrides": "^0.9.0", | ||
"@ms-cloudpack/package-overrides": "^0.9.1", | ||
"@ms-cloudpack/path-string-parsing": "^1.2.3", | ||
"@ms-cloudpack/path-utilities": "^2.7.15", | ||
"@ms-cloudpack/path-utilities": "^2.7.16", | ||
"@ms-cloudpack/task-reporter": "^0.14.1", | ||
@@ -24,0 +24,0 @@ "acorn": "^8.11.2", |
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
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
300036
175
2528