azion
Version:
Azion Packages for Edge Computing.
79 lines (72 loc) • 2.48 kB
TypeScript
/**
* @function
* @memberof Utils
* @description Recursively copies a directory to the target directory, excluding any files or directories
* that would result in the target directory being copied into itself.
* subdirectory of the source directory, this function will avoid copying the target directory into
* itself.
* @example
* // Copy a directory to the target directory
* copyDirectory('path/to/source', 'path/to/target');
* @example
* // If the target directory is a subdirectory
* of the source directory, this function will avoid copying the target directory into itself
* copyDirectory('path/to/source', 'path/to/source/subdirectory');
*/
declare function copyDirectory(source: string, target: string, ignoreFiles?: string[]): void;
interface Logger {
info(message: string): void;
error(message: string): void;
success(message: string): void;
warn(message: string): void;
debug(message: string): void;
pending(message: string): void;
complete(message: string): void;
start(message: string): void;
}
interface ProcessOutput {
stdout: string;
stderr: string;
}
interface ExecOptions {
verbose?: boolean;
interactive?: boolean;
}
interface ExecOptions {
scope?: string;
verbose?: boolean;
interactive?: boolean;
}
/**
* @function
* @description Execute a command asynchronously and retrieve the standard output and standard error.
* @example
* // Basic usage
* await exec('npm install', { scope: 'Install' });
*
* // With verbose output
* await exec('npm run build', {
* scope: 'Build',
* verbose: true
* });
*
* // With interactive mode
* await exec('npx vue create my-project', {
* scope: 'Vue',
* interactive: true
* });
*/
declare function exec(command: string, { scope, verbose, interactive }?: ExecOptions): Promise<ProcessOutput>;
declare function getAbsoluteDirPath(currentModuleFullPath?: string, path?: string): string;
type PackageManagerType = 'npm' | 'yarn' | 'pnpm' | 'npx';
interface PackageManagerOptions {
cwd?: string;
}
interface LockFileMap {
[key: string]: {
fileName: string;
pmType: PackageManagerType;
};
}
declare function getPackageVersion(packageName: string): any;
export { type ExecOptions as E, type Logger as L, type PackageManagerOptions as P, type PackageManagerType as a, getPackageVersion as b, copyDirectory as c, type ProcessOutput as d, exec as e, type LockFileMap as f, getAbsoluteDirPath as g };