@rxap/plugin-utilities
Version:
Provides utility functions for Nx plugins, such as retrieving project dependencies, determining output paths, and interacting with package.json files. It simplifies common tasks within Nx executors and generators. This package helps streamline plugin deve
16 lines (15 loc) • 898 B
TypeScript
import { ExecutorContext } from '@nx/devkit';
import { PackageJson } from '@rxap/workspace-utilities';
export interface ProjectPackageJson extends PackageJson {
funding?: string | {
type: string;
url: string;
} | string[] | {
type: string;
url: string;
}[];
}
export declare function readPackageJsonForProject(context: ExecutorContext, projectName?: string): ProjectPackageJson;
export declare function readPackageJsonForProjectWithRetry(context: ExecutorContext, projectName?: string, retries?: number, sleep?: number): Promise<ProjectPackageJson>;
export declare function readRootPackageJson(context: ExecutorContext, retries?: number, sleep?: number): Promise<ProjectPackageJson>;
export declare function writePackageJsonFormProject<T extends ProjectPackageJson = ProjectPackageJson>(context: ExecutorContext, content: T, projectName?: string): void;