@rnx-kit/align-deps
Version:
Manage dependencies within a repository and across many repositories
32 lines • 2.15 kB
TypeScript
import type { Capability, KitType } from "@rnx-kit/config";
import type { PackageManifest } from "@rnx-kit/tools-node/package";
import type { DependencyType, Package, Preset } from "./types";
export declare function removeKeys(obj: Record<string, string> | undefined, keys: string[]): Record<string, string> | undefined;
export declare function updateDependencies(dependencies: Record<string, string> | undefined, packages: Record<string, Package[]>, dependencyType: DependencyType): Record<string, string>;
/**
* Updates the specified package manifest so that it will satisfy all declared
* capabilities, using the specified preset.
*
* When a kit is of type "library", it expects the consumer to be providing all
* the capabilites. This function will make sure that `peerDependencies` is
* correctly populated, and because `peerDependencies` don't get downloaded (at
* least with some package managers), it will also make sure that appropriate
* changes are made to `devDependencies`. To avoid version conflicts with the
* hosting app, and with other libraries, the packages that were added, will be
* removed from `dependencies` if found.
*
* This function behaves similarly when a kit is of type "app". But because it
* is now a provider of capabilities, it needs to have a direct dependency on
* packages. For the "app" type, packages are instead added to `dependencies`,
* and removed from `peerDependencies` and `devDependencies`.
*
* @param manifestPath The path to the package manifest to update
* @param manifest The package manifest to update
* @param capabilities The set of capabilities that the kit requires
* @param prodPreset The preset that the kit needs to conform to
* @param devPreset The preset that the kit will develop against
* @param packageType Whether the kit provides a feature or is an app
* @returns A package manifest that satisfies specified capabilities
*/
export declare function updatePackageManifest(manifestPath: string, manifest: PackageManifest, capabilities: Capability[], prodPreset: Preset, devPreset: Preset, packageType: KitType): PackageManifest;
//# sourceMappingURL=manifest.d.ts.map