import { type Constraint, type ConstraintFactory } from './utils'; /** * The `constraintPackageName` variable is a constraint function that performs * validation and modification on package names within a monorepo managed by Yarn. * * This function ensures that each workspace within the root workspace has a * valid package name, and enforces a naming convention where the namespace (scope) * of the root package is applied to any workspace whose package name lacks a namespace. * * Behavior: * - Validates that the root package has a defined name in its `package.json` file. * If the name is missing, an error is logged. * - Extracts the namespace (scope) from the root package's name, if one exists. * - Iterates over all Yarn workspaces and checks each workspace's package name: * - If a workspace has no name defined in its `package.json`, an error is logged. * - If a workspace's package name lacks a namespace, the root's namespace is * applied to it as a prefix, and the name is updated accordingly. * * @param Yarn - The Yarn API instance, which provides access to the root workspace * and all associated workspaces for validation and name modifications. */ export declare const constraintPackageName: Constraint; /** * A function that creates a constraint to enforce specific fields in the package manifests across multiple workspaces. * This ensures the consistency of `sharedFields` in all workspace manifests by aligning them with the root workspace's manifest * and validates that `requiredFields` are present in each workspace manifest. If a required field is missing and a default * value is provided, it will be added. Otherwise, an error will be reported. * * @param options - The options object of constraint. * @param options.sharedFields - A list of fields that need to be shared across all workspace manifests. Each workspace will inherit the * corresponding values from the root workspace's manifest for these fields. * @param options.requiredFields - An optional list of fields that must be present in each workspace manifest. Each field can either * be: * - A string indicating just the field name, in which case it is checked for existence and an error is raised if it is missing. * - A tuple where the first element is the field name and the second element is the default value to be added if the field is missing. * @returns A constraint function that can be applied to validate and enforce the specified manifest fields in all workspaces. */ export declare const createManifestFieldsConstraint: ConstraintFactory<{ readonly sharedFields: readonly string[]; readonly requiredFields?: ReadonlyArray; }>; //# sourceMappingURL=base.d.ts.map