UNPKG

@rxap/plugin-library

Version:

This package provides generators and executors for managing and maintaining Nx plugin libraries. It includes functionality for generating index exports, fixing dependencies, generating JSON schemas, and more. It helps streamline the development process fo

30 lines (29 loc) 1.98 kB
import { Tree } from '@nx/devkit'; import { ProjectPackageJson } from '@rxap/plugin-utilities'; import { Dependency } from '@rxap/workspace-utilities'; import { FixDependenciesGeneratorSchema } from './schema'; import 'colors'; export declare function resolveLatestPackageVersion(packageName: string): Promise<string | null>; export declare function replaceLatestPackageVersionForProject(tree: Tree, projectName: string): Promise<void>; export declare function removePackageFromDependencies(packageName: string, dependencies: Dependency | undefined): void; export declare function removeSelfReferenceFromDependencies(projectName: string, { dependencies, peerDependencies, devDependencies, optionalDependencies, }: ProjectPackageJson): void; /** * This generator tries to fix the dependencies in the project.json of the project * * 1. Load all not-test typescript files from the project * 1.1. Find all import statements * a. If a project with the package name exists add it to the peerDependencies with version '*'. (skip if the package is already in the dependencies) * b. If external package add it to the peerDependencies with the version from a parent package.json or 'latest' if not found. * 2. Load all test typescript files from the project * 2.1. Find all import statements * a. If a project with the package name exists add it to the devDependencies with version '*'. (skip if the package is already in the dependencies) * - for each project that is use in the test files add it direct and indirect dependencies to the devDependencies TODO : check if that is required * b. If external package add it to the devDependencies with the version from a parent package.json or 'latest' if not found. * * 3. print a report about the changes * * @param tree * @param options */ export declare function fixDependenciesGenerator(tree: Tree, options: FixDependenciesGeneratorSchema): Promise<void>; export default fixDependenciesGenerator;