@ts-common/azure-js-dev-tools
Version:
Developer dependencies for TypeScript related projects
76 lines • 2.97 kB
TypeScript
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
import { Logger } from "@azure/logger-js";
import { StringMap } from "./common";
export declare type DepedencyType = "local" | "latest";
export interface PackageFolder {
/**
* The path to the package folder.
*/
path: string;
/**
* Whether or not NPM install will be run when this PackageFolder changes its dependencies.
* Undefined will be treated the same as true.
*/
runNPMInstall?: boolean;
/**
* If the package is not found (such as when updating to the latest version of an unpublished
* package), then set the target package version to this default version.
*/
defaultVersion?: string;
/**
* A list of dependencies to not update, even if they are found locally.
*/
dependenciesToIgnore?: string[];
}
export interface ClonedPackage extends PackageFolder {
updated?: boolean;
targetVersion?: string;
}
/**
* The optional arguments that can be provided to changeClonedDependenciesTo().
*/
export interface ChangeClonedDependenciesToOptions {
/**
* The logger that will be used while changing cloned dependency versions. If not defined, this
* will default to the console logger.
*/
logger?: Logger;
/**
* Whether or not changing a cloned dependency will recursively change the cloned dependency's
* dependencies as well. If not defined, this will default to true.
*/
recursive?: boolean;
/**
* Whether or not packages will have "npm install" invoked, even if they don't have any dependency
* changes. Any packages that are marked as "runNPMInstall: false" will still not have
* "npm install" run.
*/
forceInstall?: boolean;
/**
* Whether or not the function will set process.exitCode in addition to returning the exit code.
* If not defined, this will default to true.
*/
setProcessExitCode?: boolean;
/**
* The package folders that will be processed by changeClonedDependenciesTo().
*/
packageFolders?: (string | PackageFolder)[];
/**
* An extra set of files that will have dependency references updated.
*/
extraFilesToUpdate?: string[];
}
/**
* Find the path to the folder that contains a package.json file with the provided package name.
*/
export declare function findPackage(packageName: string, startPath: string, clonedPackages?: StringMap<ClonedPackage | undefined>, logger?: Logger): Promise<ClonedPackage | undefined>;
/**
* Change all of the cloned dependencies in the package found at the provided package path to the
* provided dependency type.
*/
export declare function changeClonedDependenciesTo(packagePath: string, dependencyType: DepedencyType, options?: ChangeClonedDependenciesToOptions): Promise<number>;
//# sourceMappingURL=dependencies.d.ts.map