/** * Helper functions for updating dependencies within a [monorepo](https://monorepo.tools/). * * @module */ /** * Helper function to: * * - Check if all of the dependencies in the monorepo children "package.json" files are up to date. * - Check if all of the dependencies in the monorepo children "package.json" files are non-exact. * - Check if any dependencies in the monorepo root "package.json" are unused. * * This is intended to be called in a monorepo lint script. It will exit the program with an error * code of 1 if discrepancies are found. * * This function attempts to find the monorepo root directory automatically based on searching * backwards from the file of the calling function. * * Note that this function is not needed if the monorepo is using the pnpm or bun "catalog" feature, * since that will automatically keep package dependencies in-sync. * * @throws If one or more child "package.json" files are out of sync. */ export declare function lintMonorepoPackageJSONs(monorepoRoot: string): Promise; /** * Helper function to update the dependencies in all of the monorepo "package.json" files. If there * are any updates, the package manager used in the project will be automatically invoked to install * them. * * (This is only useful in monorepos that do not use the "catalog" feature to consolidate dependency * versions. For those cases, the `updatePackageJSONDependencies` function should be used, since it * properly handles workspaces.) * * This function attempts to find the monorepo root directory automatically based on searching * backwards from the file of the calling function. * * Under the hood, this function calls the `updatePackageJSONDependencies` and * `updatePackageJSONDependenciesMonorepoChildren` helper functions. * * If you need to check to see if the monorepo dependencies are up to date in a lint script, then * use the `lintMonorepoPackageJSONs` function instead. * * @param importMetaDirname The value of `import.meta.dirname` (so that this function can find the * package root). * @param packagesWithoutCooldown Optional. Package names that should be updated without applying * the dependency cooldown. * @returns Whether any "package.json" files were changed. */ export declare function updatePackageJSONDependenciesMonorepo(importMetaDirname: string, packagesWithoutCooldown?: readonly string[]): Promise; /** * Helper function to only update the dependencies in the "package.json" files of the sub-packages * of a monorepo. * * This will update both the normal dependencies (to match what is in the monorepo root * "package.json") and the monorepo dependencies (to be what is listed in the "version" field of the * respective "package.json" file). * * This function is called by the `updatePackageJSONDependenciesMonorepo` script. * * If you need to check to see if the monorepo dependencies are up to date in a lint script, then * use the `lintMonorepoPackageJSONs` function instead. * * Note that this function will be a no-op if the "package.json" file is found to contain a catalog. * * @param monorepoRoot The full path to the monorepo root directory. * @param dryRun Optional. If true, will not modify the "package.json" files. Defaults to false. * @returns Whether all of the "package.json" files were valid. * @throws If one or more monorepo dependencies are unused. */ export declare function updatePackageJSONDependenciesMonorepoChildren(monorepoRoot: string, dryRun?: boolean): Promise; //# sourceMappingURL=monorepoUpdate.d.ts.map