From 8d5d74710e0333321e47361bbfa698f6177ff2b0 Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau <302891+christophehurpeau@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:02:28 +0100 Subject: [PATCH] build: dist --- dist/index-node22.mjs | 68 +++++++++++++++++++-------------------- dist/index-node22.mjs.map | 2 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/dist/index-node22.mjs b/dist/index-node22.mjs index 15bbe72e..7339ce81 100644 --- a/dist/index-node22.mjs +++ b/dist/index-node22.mjs @@ -135,7 +135,7 @@ function checkDuplicateDependencies(reportError, pkg, isPkgLibrary, depType, sea } } -async function checkDirectDuplicateDependencies(pkg, pkgPathName, isPackageALibrary, depType, getDependencyPackageJson, onlyWarnsForCheck, reportErrorNamePrefix = "", customCreateReportError = createReportError) { +function checkDirectDuplicateDependencies(pkg, pkgPathName, isPackageALibrary, depType, getDependencyPackageJson, onlyWarnsForCheck, reportErrorNamePrefix = "", customCreateReportError = createReportError) { const reportError = customCreateReportError( `${reportErrorNamePrefix}Direct Duplicate Dependencies`, pkgPathName @@ -288,33 +288,31 @@ const getAllowedPeerInFromType = (depPkgType, isLibrary) => { return isLibrary ? ["dependencies", "optionalDependencies", "peerDependencies"] : ["devDependencies", "dependencies"]; } }; -async function checkDirectPeerDependencies(isLibrary, pkg, pkgPathName, getDependencyPackageJson, missingOnlyWarnsForCheck, invalidOnlyWarnsForCheck, customCreateReportError = createReportError) { +function checkDirectPeerDependencies(isLibrary, pkg, pkgPathName, getDependencyPackageJson, missingOnlyWarnsForCheck, invalidOnlyWarnsForCheck, customCreateReportError = createReportError) { const reportError = customCreateReportError("Peer Dependencies", pkgPathName); const allDepPkgs = []; const allDirectDependenciesDependencies = []; - await Promise.all( - regularDependencyTypes.map(async (depType) => { - const dependencies = pkg[depType]; - if (!dependencies) return; - for (const depName of getKeys(dependencies)) { - const depPkg = getDependencyPackageJson(depName); - allDepPkgs.push({ - name: depName, - type: depType, - pkg: depPkg, - hasDirectMatchingPeerDependency: pkg.peerDependencies?.[depName] ? semver.intersects( - dependencies[depName], - pkg.peerDependencies[depName] - ) : false - }); - if (depPkg.dependencies && !isLibrary) { - allDirectDependenciesDependencies.push( - ...Object.entries(depPkg.dependencies) - ); - } + regularDependencyTypes.forEach((depType) => { + const dependencies = pkg[depType]; + if (!dependencies) return; + for (const depName of getKeys(dependencies)) { + const depPkg = getDependencyPackageJson(depName); + allDepPkgs.push({ + name: depName, + type: depType, + pkg: depPkg, + hasDirectMatchingPeerDependency: pkg.peerDependencies?.[depName] ? semver.intersects( + dependencies[depName], + pkg.peerDependencies[depName] + ) : false + }); + if (depPkg.dependencies && !isLibrary) { + allDirectDependenciesDependencies.push( + ...Object.entries(depPkg.dependencies) + ); } - }) - ); + } + }); for (const { name: depName, type: depType, @@ -1017,7 +1015,7 @@ function createCheckPackage({ internalInvalidConfigName = "invalidOnlyWarnsFor" } = {}) { jobs.push( - new Job(this.checkDirectPeerDependencies.name, async () => { + new Job(this.checkDirectPeerDependencies.name, () => { const missingOnlyWarnsForCheck = createOnlyWarnsForMappingCheck( internalMissingConfigName, missingOnlyWarnsFor @@ -1026,7 +1024,7 @@ function createCheckPackage({ internalInvalidConfigName, invalidOnlyWarnsFor ); - await checkDirectPeerDependencies( + checkDirectPeerDependencies( isPkgLibrary, pkg, pkgPathName, @@ -1043,8 +1041,8 @@ function createCheckPackage({ internalConfigName = "onlyWarnsFor" } = {}) { jobs.push( - new Job(this.checkDirectDuplicateDependencies.name, async () => { - await checkDirectDuplicateDependencies( + new Job(this.checkDirectDuplicateDependencies.name, () => { + checkDirectDuplicateDependencies( pkg, pkgPathName, isPkgLibrary, @@ -1119,7 +1117,7 @@ function createCheckPackage({ }, checkIdenticalVersionsThanDependency(depName, { resolutions, dependencies, devDependencies }) { jobs.push( - new Job(this.checkIdenticalVersionsThanDependency.name, async () => { + new Job(this.checkIdenticalVersionsThanDependency.name, () => { const depPkg = getDependencyPackageJson(depName); if (resolutions) { checkIdenticalVersionsThanDependency( @@ -1157,7 +1155,7 @@ function createCheckPackage({ }, checkIdenticalVersionsThanDevDependencyOfDependency(depName, { resolutions, dependencies, devDependencies }) { jobs.push( - new Job(this.checkSatisfiesVersionsFromDependency.name, async () => { + new Job(this.checkSatisfiesVersionsFromDependency.name, () => { const depPkg = getDependencyPackageJson(depName); if (resolutions) { checkIdenticalVersionsThanDependency( @@ -1208,7 +1206,7 @@ function createCheckPackage({ }, checkSatisfiesVersionsFromDependency(depName, { resolutions, dependencies, devDependencies }) { jobs.push( - new Job(this.checkSatisfiesVersionsFromDependency.name, async () => { + new Job(this.checkSatisfiesVersionsFromDependency.name, () => { const depPkg = getDependencyPackageJson(depName); if (resolutions) { checkSatisfiesVersionsFromDependency( @@ -1251,7 +1249,7 @@ function createCheckPackage({ jobs.push( new Job( this.checkSatisfiesVersionsInDevDependenciesOfDependency.name, - async () => { + () => { const depPkg = getDependencyPackageJson(depName); if (resolutions) { checkSatisfiesVersionsFromDependency( @@ -1346,7 +1344,7 @@ function createCheckPackage({ }, checkSatisfiesVersionsInDependency(depName, dependenciesRanges) { jobs.push( - new Job(this.checkSatisfiesVersionsInDependency.name, async () => { + new Job(this.checkSatisfiesVersionsInDependency.name, () => { const depPkg = getDependencyPackageJson(depName); checkSatisfiesVersionsInDependency( pkgPathName, @@ -1359,7 +1357,7 @@ function createCheckPackage({ }, checkMinRangeDependenciesSatisfiesDevDependencies() { jobs.push( - new Job(this.checkSatisfiesVersionsInDependency.name, async () => { + new Job(this.checkSatisfiesVersionsInDependency.name, () => { checkMinRangeSatisfies( pkgPathName, pkg, @@ -1373,7 +1371,7 @@ function createCheckPackage({ }, checkMinRangePeerDependenciesSatisfiesDependencies() { jobs.push( - new Job(this.checkSatisfiesVersionsInDependency.name, async () => { + new Job(this.checkSatisfiesVersionsInDependency.name, () => { checkMinRangeSatisfies( pkgPathName, pkg, diff --git a/dist/index-node22.mjs.map b/dist/index-node22.mjs.map index 50adcb83..7f631385 100644 --- a/dist/index-node22.mjs.map +++ b/dist/index-node22.mjs.map @@ -1 +1 @@ -{"version":3,"file":"index-node22.mjs","sources":["../src/utils/object.ts","../src/utils/createReportError.ts","../src/checks/checkDuplicateDependencies.ts","../src/checks/checkDirectDuplicateDependencies.ts","../src/utils/semverUtils.ts","../src/checks/checkPeerDependencies.ts","../src/checks/checkDirectPeerDependencies.ts","../src/checks/checkExactVersions.ts","../src/checks/checkIdenticalVersions.ts","../src/checks/checkIdenticalVersionsThanDependency.ts","../src/checks/checkMinRangeSatisfies.ts","../src/checks/checkNoDependencies.ts","../src/checks/checkResolutionsHasExplanation.ts","../src/checks/checkResolutionsVersionsMatch.ts","../src/checks/checkSatisfiesVersions.ts","../src/checks/checkSatisfiesVersionsFromDependency.ts","../src/checks/checkSatisfiesVersionsInDependency.ts","../src/utils/pkgJsonUtils.ts","../src/utils/createGetDependencyPackageJson.ts","../src/utils/warnForUtils.ts","../src/check-package.ts","../src/check-package-with-workspaces.ts"],"sourcesContent":["export const getKeys = (o: T): (keyof T)[] =>\n Object.keys(o) as (keyof T)[];\n\nexport const getEntries = (o: T): [keyof T, T[keyof T]][] =>\n Object.entries(o) as unknown as [keyof T, T[keyof T]][];\n","/* eslint-disable no-console */\n\nimport chalk from \"chalk\";\nimport { getEntries } from \"./object\";\nimport type {\n OnlyWarnsForCheck,\n OnlyWarnsForMappingCheck,\n} from \"./warnForUtils\";\n\nexport type ReportError = (\n msgTitle: string,\n msgInfo?: string,\n onlyWarns?: boolean,\n autoFixable?: boolean,\n) => void;\n\nlet titleDisplayed: string | null = null;\nlet pkgPathDisplayed: string | null = null;\n\nlet totalWarnings = 0;\nlet totalErrors = 0;\nlet totalFixable = 0;\n\nexport function displayConclusion(): void {\n if (!totalWarnings && !totalErrors) {\n console.log(`\\n${chalk.green(\"✅ No errors or warnings found\")}.`);\n } else if (!totalErrors) {\n console.log(`\\nFound ${chalk.yellow(`${totalWarnings} warnings`)}.`);\n } else if (!totalWarnings) {\n console.log(`\\nFound ${chalk.red(`${totalErrors} errors`)}.`);\n } else {\n console.log(\n `\\nFound ${chalk.red(`${totalErrors} errors`)} and ${chalk.yellow(\n `${totalWarnings} warnings`,\n )}.`,\n );\n }\n\n if (totalFixable) {\n console.log(\n `Found ${chalk.green(\n `${totalFixable} auto-fixable`,\n )} errors or warnings, run the command with \"--fix\" to fix them.`,\n );\n }\n}\n\nexport function logMessage(\n msgTitle: string,\n msgInfo?: string,\n onlyWarns?: boolean,\n autoFixable?: boolean,\n): void {\n if (onlyWarns) totalWarnings++;\n else totalErrors++;\n if (autoFixable) totalFixable++;\n console.error(\n `${\n onlyWarns ? chalk.yellow(`⚠ ${msgTitle}`) : chalk.red(`❌ ${msgTitle}`)\n }${msgInfo ? `: ${msgInfo}` : \"\"}${\n autoFixable ? ` ${chalk.bgGreenBright(chalk.black(\"auto-fixable\"))}` : \"\"\n }`,\n );\n}\n\nexport function createReportError(\n title: string,\n pkgPathName: string,\n): ReportError {\n return function reportError(\n msgTitle,\n msgInfo,\n onlyWarns,\n autoFixable = false,\n ): void {\n if (titleDisplayed !== title || pkgPathName !== pkgPathDisplayed) {\n if (titleDisplayed) console.error();\n console.error(chalk.cyan(`== ${title} in ${pkgPathName} ==`));\n titleDisplayed = title;\n pkgPathDisplayed = pkgPathName;\n }\n logMessage(msgTitle, msgInfo, onlyWarns, autoFixable);\n\n if (!onlyWarns) {\n // console.trace();\n process.exitCode = 1;\n }\n };\n}\n\nexport function reportNotWarnedFor(\n reportError: ReportError,\n onlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const notWarnedFor = onlyWarnsForCheck.getNotWarnedFor();\n if (notWarnedFor.length > 0) {\n reportError(\n `Invalid config in \"${onlyWarnsForCheck.configName}\"`,\n `no warning was raised for ${notWarnedFor\n .map((depName) => `\"${depName}\"`)\n .join(\", \")}`,\n false,\n );\n }\n}\n\nexport function reportNotWarnedForMapping(\n reportError: ReportError,\n onlyWarnsForMappingCheck: OnlyWarnsForMappingCheck,\n): void {\n const notWarnedForMapping = onlyWarnsForMappingCheck.getNotWarnedFor();\n getEntries(notWarnedForMapping).forEach(([depNameOrStar, notWarnedFor]) => {\n reportError(\n `Invalid config in \"${onlyWarnsForMappingCheck.configName}\" for \"${depNameOrStar}\"`,\n `no warning was raised for ${notWarnedFor\n .map((depName) => `\"${depName}\"`)\n .join(\", \")}`,\n );\n });\n}\n","import semver from \"semver\";\nimport type { ReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkDuplicateDependencies(\n reportError: ReportError,\n pkg: PackageJson,\n isPkgLibrary: boolean,\n depType: DependencyTypes,\n searchIn: DependencyTypes[],\n depPkg: PackageJson,\n onlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const dependencies = depPkg[depType];\n if (!dependencies) return;\n\n const searchInExisting = searchIn.filter((type) => pkg[type]);\n\n for (const [depKey, range] of Object.entries(dependencies)) {\n const versionsIn = searchInExisting.filter((type) => pkg[type]![depKey]);\n\n let allowDuplicated = false;\n if (\n versionsIn.length === 2 &&\n isPkgLibrary &&\n versionsIn.includes(\"dependencies\") &&\n versionsIn.includes(\"devDependencies\")\n ) {\n const depVersion = pkg.dependencies![depKey];\n const devDepVersion = pkg.devDependencies![depKey];\n\n if (depVersion && depVersion === devDepVersion) {\n reportError(\n `Invalid \"${depKey}\" has same version in dependencies and devDependencies`,\n \"please place it only in dependencies or use range in dependencies\",\n );\n continue;\n }\n allowDuplicated = true;\n }\n\n if (\n versionsIn.length > 2 ||\n (versionsIn.length === 2 && !allowDuplicated)\n ) {\n reportError(\n `Invalid \"${depKey}\" present in ${versionsIn.join(\" and \")}`,\n \"please place it only in dependencies\",\n );\n } else {\n const versions = versionsIn.map((type) => pkg[type]![depKey]);\n\n versions.forEach((version, index) => {\n if (version.startsWith(\"file:\") || range.startsWith(\"file:\")) return;\n // https://yarnpkg.com/features/workspaces#workspace-ranges-workspace\n if (\n version.startsWith(\"workspace:\") ||\n range.startsWith(\"workspace:\")\n ) {\n return;\n }\n\n if (\n semver.satisfies(version, range, {\n includePrerelease: true,\n }) ||\n semver.intersects(version, range, {\n includePrerelease: true,\n })\n ) {\n return;\n }\n\n // Ignore reporting duplicate when there's a resolution for it\n if (pkg.resolutions?.[depKey]) {\n return;\n }\n\n const versionInType = versionsIn[index];\n\n reportError(\n `Invalid duplicate dependency \"${depKey}\"`,\n `\"${versions[0]}\" (in ${versionInType}) should satisfies \"${range}\" from \"${depPkg.name}\" ${depType}.`,\n onlyWarnsForCheck.shouldWarnsFor(depKey),\n );\n });\n }\n }\n}\n","import type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n reportNotWarnedForMapping,\n createReportError,\n} from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForMappingCheck } from \"../utils/warnForUtils\";\nimport { checkDuplicateDependencies } from \"./checkDuplicateDependencies\";\n\nexport async function checkDirectDuplicateDependencies(\n pkg: PackageJson,\n pkgPathName: string,\n isPackageALibrary: boolean,\n depType: DependencyTypes,\n getDependencyPackageJson: GetDependencyPackageJson,\n onlyWarnsForCheck: OnlyWarnsForMappingCheck,\n reportErrorNamePrefix = \"\",\n customCreateReportError = createReportError,\n): Promise {\n const reportError = customCreateReportError(\n `${reportErrorNamePrefix}Direct Duplicate Dependencies`,\n pkgPathName,\n );\n\n const checks: {\n type: DependencyTypes;\n searchIn: DependencyTypes[];\n }[] = [\n {\n type: \"devDependencies\",\n searchIn: [\"devDependencies\", \"dependencies\"],\n },\n { type: \"dependencies\", searchIn: [\"devDependencies\", \"dependencies\"] },\n ];\n\n checks.forEach(({ type, searchIn }) => {\n const dependencies = pkg[type];\n\n if (!dependencies) return;\n for (const depName of getKeys(dependencies)) {\n const depPkg = getDependencyPackageJson(depName);\n checkDuplicateDependencies(\n reportError,\n pkg,\n isPackageALibrary,\n depType,\n searchIn,\n depPkg,\n onlyWarnsForCheck.createFor(depName),\n );\n }\n });\n\n reportNotWarnedForMapping(reportError, onlyWarnsForCheck);\n}\n","import type { SemVer } from \"semver-utils\";\nimport semverUtils from \"semver-utils\";\n\nexport const parse = semverUtils.parse;\nexport const parseRange = semverUtils.parseRange;\n\n// semverUtils.stringify does not support the operator\nfunction stringify(semver: SemVer): string {\n let str = \"\";\n if (semver.operator) {\n str += semver.operator;\n }\n str += semver.major || \"0\";\n str += \".\";\n str += semver.minor || \"0\";\n str += \".\";\n str += semver.patch || \"0\";\n if (semver.release) {\n str += `-${semver.release}`;\n }\n if (semver.build) {\n str += `+${semver.build}`;\n }\n return str;\n}\n\nexport function getOperator(range: string): string | null {\n const parsedRange = parseRange(range);\n if (parsedRange.length !== 1) return null;\n return parsedRange[0].operator || \"\";\n}\n\nexport function changeOperator(\n range: string,\n operator: string | null,\n): string | null {\n if (operator === null) return range;\n const parsedRange = parseRange(range);\n if (parsedRange.length !== 1) return null;\n const parsed = parsedRange[0];\n parsed.operator = operator === \"\" ? undefined : operator;\n return stringify(parsed);\n}\n\nexport function isExactParsedRange(\n parsedRange: ReturnType,\n): boolean {\n return parsedRange.length === 1 && parsedRange[0].operator === undefined;\n}\n\nexport function isExactRange(range: string): boolean {\n return isExactParsedRange(parseRange(range));\n}\n\nexport function getRealVersion(version: string): string {\n if (version.startsWith(\"npm:\")) {\n const match = /^npm:.*@(.*)$/.exec(version);\n if (!match) throw new Error(`Invalid version match: ${version}`);\n const [, realVersion] = match;\n return realVersion;\n }\n if (version.startsWith(\"workspace:\")) {\n return version.slice(\"workspace:\".length);\n }\n\n return version;\n}\n","import semver from \"semver\";\nimport type { ReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport { getRealVersion } from \"../utils/semverUtils\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkPeerDependencies(\n pkg: PackageJson,\n reportError: ReportError,\n type: DependencyTypes,\n allowedPeerIn: DependencyTypes[],\n allowMissing: boolean,\n providedDependencies: [string, string][],\n depPkg: PackageJson,\n missingOnlyWarnsForCheck: OnlyWarnsForCheck,\n invalidOnlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const { peerDependencies, peerDependenciesMeta } = depPkg;\n if (!peerDependencies) return;\n\n const allowedPeerInExisting = allowedPeerIn.filter(\n (allowedPeerInType) => pkg[allowedPeerInType],\n );\n\n for (const [peerDepName, range] of Object.entries(peerDependencies)) {\n const versionsIn = allowedPeerInExisting.filter(\n (allowedPeerInExistingType) =>\n pkg[allowedPeerInExistingType]?.[peerDepName],\n );\n if (versionsIn.length === 0) {\n if (allowMissing) {\n continue;\n }\n\n const peerDependenciesMetaPeerDep = peerDependenciesMeta?.[peerDepName];\n if (peerDependenciesMetaPeerDep?.optional) {\n continue;\n }\n\n let additionalDetails = \"\";\n // satisfied by another direct dependency\n const providedDependenciesForDepName = providedDependencies.filter(\n ([depName]) => depName === peerDepName,\n );\n if (providedDependenciesForDepName.length > 0) {\n if (\n providedDependenciesForDepName.every(([, depRange]) =>\n semver.intersects(range, depRange),\n )\n ) {\n continue;\n }\n\n additionalDetails +=\n \" (required as some dependencies have non-satisfying range too)\";\n }\n\n reportError(\n `Missing \"${peerDepName}\" peer dependency from \"${depPkg.name}\" in ${type}`,\n `it should satisfies \"${range}\" and be in ${allowedPeerIn.join(\n \" or \",\n )}${additionalDetails}`,\n missingOnlyWarnsForCheck.shouldWarnsFor(peerDepName),\n );\n } else {\n const versions = versionsIn.map(\n (versionsInType) => pkg[versionsInType]![peerDepName],\n );\n\n versions.forEach((versionValue, index) => {\n const version = getRealVersion(versionValue);\n\n if (version === \"*\") {\n return;\n }\n\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${peerDepName}\" peer dependency`,\n `\"${version}\" (in ${allowedPeerInExisting[index]}) should satisfies \"${range}\" from \"${depPkg.name}\" ${type}`,\n invalidOnlyWarnsForCheck.shouldWarnsFor(peerDepName),\n );\n }\n });\n }\n }\n}\n","import semver from \"semver\";\nimport type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n createReportError,\n reportNotWarnedForMapping,\n} from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type {\n DependencyTypes,\n PackageJson,\n RegularDependencyTypes,\n} from \"../utils/packageTypes\";\nimport type { OnlyWarnsForMappingCheck } from \"../utils/warnForUtils\";\nimport { checkPeerDependencies } from \"./checkPeerDependencies\";\n\nconst regularDependencyTypes: RegularDependencyTypes[] = [\n \"devDependencies\",\n \"dependencies\",\n \"optionalDependencies\",\n];\n\nconst getAllowedPeerInFromType = (\n depPkgType: RegularDependencyTypes,\n isLibrary: boolean,\n): DependencyTypes[] => {\n switch (depPkgType) {\n case \"devDependencies\":\n return [\"devDependencies\", \"dependencies\"];\n case \"dependencies\":\n return isLibrary\n ? [\"dependencies\", \"peerDependencies\"]\n : [\"devDependencies\", \"dependencies\"];\n case \"optionalDependencies\":\n return isLibrary\n ? [\"dependencies\", \"optionalDependencies\", \"peerDependencies\"]\n : [\"devDependencies\", \"dependencies\"];\n\n // no default\n }\n};\n\nexport async function checkDirectPeerDependencies(\n isLibrary: boolean,\n pkg: PackageJson,\n pkgPathName: string,\n getDependencyPackageJson: GetDependencyPackageJson,\n missingOnlyWarnsForCheck: OnlyWarnsForMappingCheck,\n invalidOnlyWarnsForCheck: OnlyWarnsForMappingCheck,\n customCreateReportError = createReportError,\n): Promise {\n const reportError = customCreateReportError(\"Peer Dependencies\", pkgPathName);\n\n const allDepPkgs: {\n name: string;\n type: RegularDependencyTypes;\n pkg: PackageJson;\n hasDirectMatchingPeerDependency: boolean;\n }[] = [];\n const allDirectDependenciesDependencies: [string, string][] = [];\n\n await Promise.all(\n regularDependencyTypes.map(async (depType) => {\n const dependencies = pkg[depType];\n if (!dependencies) return;\n for (const depName of getKeys(dependencies)) {\n const depPkg = getDependencyPackageJson(depName);\n allDepPkgs.push({\n name: depName,\n type: depType,\n pkg: depPkg,\n hasDirectMatchingPeerDependency: pkg.peerDependencies?.[depName]\n ? semver.intersects(\n dependencies[depName],\n pkg.peerDependencies[depName],\n )\n : false,\n });\n\n if (depPkg.dependencies && !isLibrary) {\n allDirectDependenciesDependencies.push(\n ...Object.entries(depPkg.dependencies),\n );\n }\n }\n }),\n );\n\n for (const {\n name: depName,\n type: depType,\n pkg: depPkg,\n hasDirectMatchingPeerDependency,\n } of allDepPkgs) {\n if (depPkg.peerDependencies) {\n checkPeerDependencies(\n pkg,\n reportError,\n depType,\n getAllowedPeerInFromType(depType, isLibrary),\n hasDirectMatchingPeerDependency,\n allDirectDependenciesDependencies,\n depPkg,\n missingOnlyWarnsForCheck.createFor(depName),\n invalidOnlyWarnsForCheck.createFor(depName),\n );\n }\n }\n\n reportNotWarnedForMapping(reportError, missingOnlyWarnsForCheck);\n if (missingOnlyWarnsForCheck !== invalidOnlyWarnsForCheck) {\n reportNotWarnedForMapping(reportError, invalidOnlyWarnsForCheck);\n }\n}\n","import semver from \"semver\";\nimport type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n createReportError,\n reportNotWarnedFor,\n} from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport { getRealVersion } from \"../utils/semverUtils\";\nimport type { OnlyWarnsFor, OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckExactVersionsOptions {\n getDependencyPackageJson?: GetDependencyPackageJson;\n onlyWarnsForCheck: OnlyWarnsForCheck;\n internalExactVersionsIgnore?: OnlyWarnsFor;\n tryToAutoFix?: boolean;\n customCreateReportError?: typeof createReportError;\n}\n\nconst isVersionRange = (version: string): boolean =>\n version.startsWith(\"^\") ||\n version.startsWith(\"~\") ||\n version.startsWith(\">\") ||\n version.startsWith(\"<\");\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function checkExactVersions(\n pkg: PackageJson,\n pkgPathName: string,\n types: DependencyTypes[],\n {\n getDependencyPackageJson,\n onlyWarnsForCheck,\n internalExactVersionsIgnore,\n tryToAutoFix = false,\n customCreateReportError = createReportError,\n }: CheckExactVersionsOptions,\n): Promise {\n const reportError = customCreateReportError(\"Exact versions\", pkgPathName);\n\n for (const type of types) {\n const pkgDependencies = pkg[type];\n if (!pkgDependencies) continue;\n\n for (const [dependencyName, versionValue] of Object.entries(\n pkgDependencies,\n )) {\n const version = getRealVersion(versionValue);\n\n if (isVersionRange(version)) {\n if (internalExactVersionsIgnore?.includes(dependencyName)) {\n continue;\n }\n const shouldOnlyWarn = onlyWarnsForCheck.shouldWarnsFor(dependencyName);\n if (!shouldOnlyWarn && getDependencyPackageJson) {\n let resolvedDep;\n try {\n resolvedDep = getDependencyPackageJson(dependencyName);\n } catch {\n resolvedDep = null;\n }\n if (!resolvedDep?.version) {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact${\n tryToAutoFix\n ? `, autofix failed to resolve \"${dependencyName}\".`\n : \"\"\n }`,\n shouldOnlyWarn,\n false,\n );\n } else if (\n !semver.satisfies(resolvedDep.version, version, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact${\n tryToAutoFix\n ? `, autofix failed as \"${dependencyName}\"'s resolved version is \"${resolvedDep.version}\" and doesn't satisfies \"${version}\".`\n : \"\"\n }`,\n shouldOnlyWarn,\n false,\n );\n } else if (tryToAutoFix) {\n pkgDependencies[dependencyName] = resolvedDep.version;\n } else {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact \"${resolvedDep.version}\".`,\n shouldOnlyWarn,\n true,\n );\n }\n } else {\n let exactVersion = version.slice(version[1] === \"=\" ? 2 : 1);\n if (exactVersion.split(\".\").length < 3) {\n if (exactVersion.split(\".\").length === 1) {\n exactVersion = `${exactVersion}.0.0`;\n } else {\n exactVersion = `${exactVersion}.0`;\n }\n }\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact \"${exactVersion}\".`,\n shouldOnlyWarn,\n false,\n );\n }\n }\n }\n }\n\n reportNotWarnedFor(reportError, onlyWarnsForCheck);\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkIdenticalVersions(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n deps: Record> | string[]>,\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n \"Identical Versions\",\n pkgPathName,\n );\n\n getKeys(deps).forEach((depKey) => {\n const version = pkgDependencies[depKey];\n if (!version) {\n reportError(`Unexpected missing ${type} for \"${depKey}\".`);\n return;\n }\n\n const depConfigArrayOrObject = deps[depKey];\n const depConfig = Array.isArray(depConfigArrayOrObject)\n ? { [type]: depConfigArrayOrObject }\n : depConfigArrayOrObject;\n\n getKeys(depConfig).forEach((depKeyType) => {\n const pkgDependenciesType = pkg[depKeyType] || {};\n depConfig[depKeyType]?.forEach((depKeyIdentical) => {\n const value = pkgDependenciesType[depKeyIdentical];\n if (!value) {\n reportError(\n `Missing \"${depKeyIdentical}\" in ${depKeyType}`,\n `it should be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n\n if (value !== version) {\n reportError(\n `Invalid \"${depKeyIdentical}\" in ${depKeyType}`,\n `expecting \"${value}\" be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n });\n });\n });\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkIdenticalVersionsThanDependency(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n depKeys: string[],\n depPkg: PackageJson,\n dependencies: PackageJson[DependencyTypes] = {},\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n `Same Versions than ${depPkg.name}`,\n pkgPathName,\n );\n\n depKeys.forEach((depKey) => {\n const version = dependencies[depKey];\n if (!version) {\n reportError(\n `Unexpected missing dependency \"${depKey}\" in \"${depPkg.name}\".`,\n );\n return;\n }\n\n if (version.startsWith(\"^\") || version.startsWith(\"~\")) {\n reportError(\n `Unexpected range dependency in \"${depPkg.name}\" for \"${depKey}\"`,\n \"perhaps use checkSatisfiesVersionsFromDependency() instead.\",\n );\n return;\n }\n\n const value = pkgDependencies[depKey];\n\n if (!value) {\n reportError(\n `Missing \"${depKey}\" in ${type}`,\n `expecting to be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n\n if (value !== version) {\n reportError(\n `Invalid \"${depKey}\" in ${type}`,\n `expecting \"${value}\" to be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n });\n}\n","import semver from \"semver\";\nimport semverUtils from \"semver-utils\";\nimport type { PackageJson } from \"type-fest\";\nimport { createReportError } from \"../utils/createReportError\";\nimport { getEntries } from \"../utils/object\";\nimport type { DependencyTypes } from \"../utils/packageTypes\";\n\nexport interface CheckMinRangeSatisfiesOptions {\n customCreateReportError?: typeof createReportError;\n tryToAutoFix?: boolean;\n}\n\nexport function checkMinRangeSatisfies(\n pkgPathName: string,\n pkg: PackageJson,\n type1: DependencyTypes = \"dependencies\",\n type2: DependencyTypes = \"devDependencies\",\n {\n tryToAutoFix = false,\n customCreateReportError = createReportError,\n }: CheckMinRangeSatisfiesOptions = {},\n): void {\n const dependencies1 = pkg[type1];\n const dependencies2 = pkg[type2];\n\n if (!dependencies1 || !dependencies2) {\n return;\n }\n\n const reportError = customCreateReportError(\n `\"${type1}\" minimum range satisfies \"${type2}\"`,\n pkgPathName,\n );\n\n for (const [depName, depRange1] of getEntries(dependencies1)) {\n if (depRange1 === \"*\") continue;\n\n const depRange2 = dependencies2[depName];\n if (!depRange2 || !depRange1) continue;\n\n const minDepRange1 = semver.minVersion(depRange1)?.version || depRange1;\n\n if (\n !semver.satisfies(minDepRange1, depRange2, {\n includePrerelease: true,\n })\n ) {\n if (tryToAutoFix) {\n const depRange1Parsed = semverUtils.parseRange(depRange1);\n dependencies1[depName] =\n (depRange1Parsed[0]?.operator || \"\") +\n (semver.minVersion(depRange2)?.version || depRange2);\n } else {\n reportError(\n `Invalid \"${depName}\" in ${type1}`,\n `\"${depRange1}\" should satisfies \"${depRange2}\" from \"${type2}\".`,\n false,\n true,\n );\n }\n }\n }\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\n\nexport function checkNoDependencies(\n pkg: PackageJson,\n pkgPath: string,\n type: DependencyTypes = \"dependencies\",\n moveToSuggestion: DependencyTypes = \"devDependencies\",\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type];\n if (!pkgDependencies) return;\n\n const reportError = customCreateReportError(\"No dependencies\", pkgPath);\n reportError(\n `Unexpected ${type}`,\n `you should move them in ${moveToSuggestion}`,\n );\n}\n","import type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson } from \"../utils/packageTypes\";\n\nexport type CheckResolutionMessage = (\n depKey: string,\n resolutionExplainedMessage: string,\n checkMessageHelpers: {\n getDependencyPackageJson: GetDependencyPackageJson;\n },\n) => string | undefined;\n\nexport function checkResolutionsHasExplanation(\n pkg: PackageJson,\n pkgPathName: string,\n checkMessage: CheckResolutionMessage,\n getDependencyPackageJson: GetDependencyPackageJson,\n customCreateReportError = createReportError,\n): void {\n const pkgResolutions = pkg.resolutions || {};\n const pkgResolutionsExplained = pkg.resolutionsExplained || {};\n const reportError = customCreateReportError(\n \"Resolutions has explanation\",\n pkgPathName,\n );\n\n Object.keys(pkgResolutions).forEach((depKey) => {\n if (!pkgResolutionsExplained[depKey]) {\n reportError(`Missing \"${depKey}\" in resolutionsExplained.`);\n }\n });\n\n Object.keys(pkgResolutionsExplained).forEach((depKey) => {\n if (!pkgResolutions[depKey]) {\n reportError(\n `Found \"${depKey}\" in resolutionsExplained but not in resolutions.`,\n );\n } else {\n const error = checkMessage(depKey, pkgResolutionsExplained[depKey], {\n getDependencyPackageJson,\n });\n if (error) {\n reportError(\n `Invalid message for \"${depKey}\" in resolutionsExplained`,\n `${error}.`,\n );\n }\n }\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson } from \"../utils/packageTypes\";\n\nexport interface CheckResolutionsVersionsMatchOptions {\n tryToAutoFix?: boolean;\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkResolutionsVersionsMatch(\n pkg: PackageJson,\n pkgPathName: string,\n {\n tryToAutoFix,\n customCreateReportError = createReportError,\n }: CheckResolutionsVersionsMatchOptions = {},\n): void {\n const pkgResolutions = pkg.resolutions || {};\n const reportError = customCreateReportError(\n \"Resolutions match other dependencies\",\n pkgPathName,\n );\n\n Object.entries(pkgResolutions).forEach(([resolutionKey, resolutionValue]) => {\n let depName = resolutionKey;\n let resolutionDepVersion = resolutionValue;\n if (resolutionValue.startsWith(\"patch:\")) {\n const matchResolutionInKey = /^(.+)@npm:(.+)$/.exec(resolutionKey);\n if (matchResolutionInKey) {\n [, depName, resolutionDepVersion] = matchResolutionInKey;\n }\n }\n ([\"dependencies\", \"devDependencies\"] as const).forEach((depType) => {\n const range = pkg?.[depType]?.[depName];\n\n if (!range) return;\n\n if (\n !semver.satisfies(resolutionDepVersion, range, {\n includePrerelease: true,\n })\n ) {\n if (tryToAutoFix) {\n pkg[depType]![depName] = resolutionDepVersion;\n } else {\n reportError(\n `Invalid \"${depName}\" in ${depType}`,\n `expecting \"${range}\" be \"${resolutionDepVersion}\" from resolutions.`,\n false,\n true,\n );\n }\n }\n });\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckSatisfiesVersionsOptions {\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersions(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n dependenciesRanges: Record,\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n {\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsOptions = {},\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n \"Satisfies Versions\",\n pkgPathName,\n );\n\n Object.entries(dependenciesRanges).forEach(([depKey, range]) => {\n const version = pkgDependencies[depKey];\n\n if (!version) {\n reportError(\n `Missing \"${depKey}\" in ${type}`,\n `should satisfies \"${range}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n } else {\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${depKey}\" in ${type}`,\n `\"${version}\" (in \"${depKey}\") should satisfies \"${range}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n }\n });\n}\n","import semver from \"semver\";\nimport type { ShouldHaveExactVersions } from \"../check-package\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport { changeOperator, getOperator } from \"../utils/semverUtils\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckSatisfiesVersionsFromDependencyOptions {\n tryToAutoFix?: boolean;\n shouldHaveExactVersions: ShouldHaveExactVersions;\n onlyWarnsForCheck?: OnlyWarnsForCheck;\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersionsFromDependency(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n depKeys: string[],\n depPkg: PackageJson,\n depType: DependencyTypes,\n {\n tryToAutoFix,\n shouldHaveExactVersions,\n onlyWarnsForCheck,\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsFromDependencyOptions,\n): void {\n const pkgDependencies = pkg[type] || {};\n const dependencies = depPkg[depType] || {};\n\n const reportError = customCreateReportError(\n `Satisfies Versions from \"${depPkg.name}\"`,\n pkgPathName,\n );\n\n depKeys.forEach((depKey) => {\n const range = dependencies[depKey];\n\n if (!range) {\n reportError(\n `Unexpected missing dependency \"${depKey}\" in \"${depPkg.name}\"`,\n `config expects \"${depKey}\" in \"${depType}\" of \"${depPkg.name}\".`,\n undefined,\n false,\n );\n return;\n }\n\n const version = pkgDependencies[depKey];\n\n const getAutoFixIfExists = (): string | null | undefined => {\n const existingOperator = version ? getOperator(version) : null;\n const expectedOperator = (() => {\n if (existingOperator !== null) {\n return existingOperator;\n }\n return shouldHaveExactVersions(type) ? \"\" : null;\n })();\n\n return expectedOperator === \"\"\n ? semver.minVersion(range)?.version\n : changeOperator(range, expectedOperator);\n };\n\n const autoFix = (versionToApply: string): void => {\n pkg[type] = {\n ...pkg[type],\n [depKey]: versionToApply,\n };\n };\n\n if (!version) {\n const fix = getAutoFixIfExists();\n if (!fix || !tryToAutoFix) {\n reportError(\n `Missing \"${depKey}\" in \"${type}\" of \"${pkg.name}\"`,\n `should satisfies \"${range}\" from \"${depPkg.name}\" in \"${depType}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n !!fix,\n );\n } else {\n autoFix(fix);\n }\n } else {\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n const fix = getAutoFixIfExists();\n if (!fix || !tryToAutoFix) {\n reportError(\n `Invalid \"${depKey}\" in \"${type}\" of \"${pkg.name}\"`,\n `\"${version}\" should satisfies \"${range}\" from \"${depPkg.name}\"'s \"${depType}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n !!fix,\n );\n } else {\n autoFix(fix);\n }\n }\n }\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport { getEntries } from \"../utils/object\";\nimport type { DependenciesRanges, PackageJson } from \"../utils/packageTypes\";\n\ninterface CheckSatisfiesVersionsInDependencyOptions {\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersionsInDependency(\n pkgPathName: string,\n depPkg: PackageJson,\n dependenciesRanges: DependenciesRanges,\n {\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsInDependencyOptions = {},\n): void {\n const reportError = customCreateReportError(\n `Satisfies Versions In Dependency \"${depPkg.name}\"`,\n pkgPathName,\n );\n\n for (const [dependenciesType, dependenciesTypeRanges] of getEntries(\n dependenciesRanges,\n )) {\n if (!dependenciesTypeRanges) return;\n const dependencies = depPkg[dependenciesType];\n\n for (const [dependencyName, dependencyRange] of getEntries(\n dependenciesTypeRanges,\n )) {\n if (dependencyRange == null) {\n if (dependencies?.[dependencyName]) {\n reportError(\n `Invalid \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n \"it should not be present\",\n );\n }\n } else if (!dependencies) {\n reportError(\n `Missing \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependenciesType}\" is missing in \"${depPkg.name}\"`,\n );\n } else if (!dependencies[dependencyName]) {\n reportError(\n `Missing \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependencyName}\" is missing in ${dependenciesType}`,\n );\n } else if (\n !semver.satisfies(dependencies[dependencyName], dependencyRange, {\n includePrerelease: true,\n }) &&\n !semver.intersects(dependencies[dependencyName], dependencyRange, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependencies[dependencyName]}\" does not satisfies \"${dependencyRange}\"`,\n );\n }\n }\n }\n}\n","import { readFileSync, writeFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolve as importResolve } from \"import-meta-resolve\";\nimport type { PackageJson } from \"./packageTypes\";\n\nexport function readPkgJson(packagePath: string): PackageJson {\n return JSON.parse(readFileSync(packagePath, \"utf8\")) as PackageJson;\n}\n\nexport function writePkgJson(packagePath: string, pkg: PackageJson): void {\n writeFileSync(packagePath, `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/** @internal */\nexport function internalLoadPackageJsonFromNodeModules(\n pkgDepName: string,\n pkgDirname: string,\n): PackageJson {\n const packageUrl = importResolve(\n `${pkgDepName}/package.json`,\n `file://${pkgDirname}/package.json`,\n );\n return readPkgJson(fileURLToPath(packageUrl));\n}\n","import type { PackageJson } from \"./packageTypes\";\nimport {\n internalLoadPackageJsonFromNodeModules,\n readPkgJson,\n} from \"./pkgJsonUtils\";\n\nexport type GetDependencyPackageJson = (pkgDepName: string) => PackageJson;\n\ntype NodeModulesPackagePathCache = Map;\n\ninterface CreateGetDependencyPackageJsonOptions {\n pkgDirname: string;\n nodeModulesPackagePathCache?: NodeModulesPackagePathCache;\n /** @internal */\n internalCustomLoadPackageJsonFromNodeModules?: typeof internalLoadPackageJsonFromNodeModules;\n /** @internal */\n internalReadPkgJson?: typeof readPkgJson;\n}\n\nexport function createGetDependencyPackageJson({\n pkgDirname,\n nodeModulesPackagePathCache = new Map(),\n internalCustomLoadPackageJsonFromNodeModules = internalLoadPackageJsonFromNodeModules,\n internalReadPkgJson = readPkgJson,\n}: CreateGetDependencyPackageJsonOptions): GetDependencyPackageJson {\n return (pkgDepName) => {\n const existing = nodeModulesPackagePathCache.get(pkgDepName);\n if (existing) return existing;\n let pkg: PackageJson;\n if (pkgDepName.startsWith(\".\")) {\n const packagePath = `${pkgDirname}/${pkgDepName}/package.json`;\n pkg = internalReadPkgJson(packagePath);\n } else {\n try {\n pkg = internalCustomLoadPackageJsonFromNodeModules(\n pkgDepName,\n pkgDirname,\n );\n } catch (error: unknown) {\n if (!(error instanceof Error)) throw error;\n\n if (\n (error as NodeJS.ErrnoException).code !==\n \"ERR_PACKAGE_PATH_NOT_EXPORTED\"\n ) {\n throw error;\n }\n\n const match = / in (.*[/\\\\]package\\.json)\\s+imported from/.exec(\n error.message,\n );\n\n if (match) {\n const [, matchPackageJson] = match;\n pkg = internalReadPkgJson(matchPackageJson);\n } else {\n throw error;\n }\n }\n }\n nodeModulesPackagePathCache.set(pkgDepName, pkg);\n return pkg;\n };\n}\n","import { getEntries } from \"./object\";\n\nexport type OnlyWarnsFor = string[];\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nexport type OnlyWarnsForDependencyMapping = Record;\nexport type OnlyWarnsForOptionalDependencyMapping =\n | OnlyWarnsFor\n | OnlyWarnsForDependencyMapping\n | undefined;\n\nexport interface OnlyWarnsForCheck {\n configName: string;\n getNotWarnedFor: () => string[];\n shouldWarnsFor: (dependencyName: string) => boolean;\n}\n\nexport interface OnlyWarnsForMappingCheck {\n configName: string;\n getNotWarnedFor: () => Record;\n createFor: (dependencyName: string) => OnlyWarnsForCheck;\n}\n\nexport const createOnlyWarnsForArrayCheck = (\n configName: string,\n onlyWarnsFor: OnlyWarnsFor = [],\n): OnlyWarnsForCheck => {\n const notWarnedFor = new Set(onlyWarnsFor);\n return {\n configName,\n getNotWarnedFor: () => [...notWarnedFor],\n shouldWarnsFor(dependencyName) {\n if (onlyWarnsFor.includes(dependencyName)) {\n notWarnedFor.delete(dependencyName);\n return true;\n }\n return false;\n },\n };\n};\n\nconst isMapping = (\n onlyWarnsFor: OnlyWarnsForOptionalDependencyMapping,\n): onlyWarnsFor is OnlyWarnsForDependencyMapping => {\n return typeof onlyWarnsFor === \"object\" && !Array.isArray(onlyWarnsFor);\n};\n\nexport const createOnlyWarnsForMappingCheck = (\n configName: string,\n onlyWarnsFor: OnlyWarnsForOptionalDependencyMapping,\n): OnlyWarnsForMappingCheck => {\n if (isMapping(onlyWarnsFor)) {\n const notWarnedFor = Object.fromEntries(\n getEntries(onlyWarnsFor).map(([entryKey, entryValue]) => [\n entryKey,\n new Set(entryValue),\n ]),\n );\n return {\n configName,\n getNotWarnedFor: () =>\n Object.fromEntries(\n getEntries(notWarnedFor)\n .filter(([key, set]) => set.size > 0)\n .map(([key, set]) => [key, [...set]]),\n ),\n createFor(dependencyNameLevel1) {\n return {\n configName,\n getNotWarnedFor() {\n throw new Error(\"Invalid call to getNotWarnedFor()\");\n },\n shouldWarnsFor(dependencyName) {\n if (onlyWarnsFor[\"*\"]?.includes(dependencyName)) {\n notWarnedFor[\"*\"].delete(dependencyName);\n return true;\n }\n if (onlyWarnsFor[dependencyNameLevel1]?.includes(dependencyName)) {\n notWarnedFor[dependencyNameLevel1].delete(dependencyName);\n return true;\n }\n return false;\n },\n };\n },\n };\n }\n\n const arrayOnlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n configName,\n onlyWarnsFor,\n );\n return {\n configName,\n getNotWarnedFor: (): Record => {\n const notWarnedFor = arrayOnlyWarnsForCheck.getNotWarnedFor();\n if (notWarnedFor.length > 0) {\n return { \"*\": notWarnedFor };\n }\n return {};\n },\n createFor() {\n return {\n configName,\n getNotWarnedFor() {\n throw new Error(\"Invalid call to getNotWarnedFor()\");\n },\n shouldWarnsFor(dependencyName) {\n return arrayOnlyWarnsForCheck.shouldWarnsFor(dependencyName);\n },\n };\n },\n };\n};\n","import path from \"node:path\";\nimport util from \"node:util\";\nimport { checkDirectDuplicateDependencies } from \"./checks/checkDirectDuplicateDependencies\";\nimport { checkDirectPeerDependencies } from \"./checks/checkDirectPeerDependencies\";\nimport { checkExactVersions } from \"./checks/checkExactVersions\";\nimport { checkIdenticalVersions } from \"./checks/checkIdenticalVersions\";\nimport { checkIdenticalVersionsThanDependency } from \"./checks/checkIdenticalVersionsThanDependency\";\nimport { checkMinRangeSatisfies } from \"./checks/checkMinRangeSatisfies\";\nimport { checkNoDependencies } from \"./checks/checkNoDependencies\";\nimport type { CheckResolutionMessage } from \"./checks/checkResolutionsHasExplanation\";\nimport { checkResolutionsHasExplanation } from \"./checks/checkResolutionsHasExplanation\";\nimport { checkResolutionsVersionsMatch } from \"./checks/checkResolutionsVersionsMatch\";\nimport { checkSatisfiesVersions } from \"./checks/checkSatisfiesVersions\";\nimport { checkSatisfiesVersionsFromDependency } from \"./checks/checkSatisfiesVersionsFromDependency\";\nimport { checkSatisfiesVersionsInDependency } from \"./checks/checkSatisfiesVersionsInDependency\";\nimport type { GetDependencyPackageJson } from \"./utils/createGetDependencyPackageJson\";\nimport { createGetDependencyPackageJson } from \"./utils/createGetDependencyPackageJson\";\nimport { displayConclusion } from \"./utils/createReportError\";\nimport { getEntries } from \"./utils/object\";\nimport type {\n DependenciesRanges,\n DependencyName,\n DependencyTypes,\n PackageJson,\n} from \"./utils/packageTypes\";\nimport { readPkgJson, writePkgJson } from \"./utils/pkgJsonUtils\";\nimport type {\n OnlyWarnsForOptionalDependencyMapping,\n OnlyWarnsFor,\n OnlyWarnsForDependencyMapping,\n} from \"./utils/warnForUtils\";\nimport {\n createOnlyWarnsForArrayCheck,\n createOnlyWarnsForMappingCheck,\n} from \"./utils/warnForUtils\";\n\nexport interface CreateCheckPackageOptions {\n packageDirectoryPath?: string;\n isLibrary?: boolean | ((pkg: PackageJson) => boolean);\n /** @internal */\n internalWorkspacePkgDirectoryPath?: string;\n}\n\nexport interface CheckDirectPeerDependenciesOptions {\n missingOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n invalidOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n internalMissingConfigName?: string;\n internalInvalidConfigName?: string;\n}\n\nexport interface CheckDirectDuplicateDependenciesOptions {\n onlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n internalConfigName?: string;\n}\n\nexport interface OnlyWarnsForInPackageCheckPackageRecommendedOption {\n exactVersions: OnlyWarnsFor;\n}\n\nexport interface OnlyWarnsForInDependencyCheckPackageRecommendedOption {\n duplicateDirectDependency: OnlyWarnsFor;\n missingPeerDependency: OnlyWarnsFor;\n invalidPeerDependencyVersion: OnlyWarnsFor;\n}\n\nexport type OnlyWarnsForInDependenciesCheckPackageRecommendedOption = Record<\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/sort-type-constituents\n \"*\" | string,\n OnlyWarnsForInDependencyCheckPackageRecommendedOption\n>;\n\nexport interface CheckRecommendedOptions {\n /** default is true for libraries, false otherwise */\n allowRangeVersionsInDependencies?: boolean;\n onlyWarnsForInPackage?: OnlyWarnsForInPackageCheckPackageRecommendedOption;\n onlyWarnsForInDependencies?: OnlyWarnsForInDependenciesCheckPackageRecommendedOption;\n /** @internal */\n internalExactVersionsIgnore?: OnlyWarnsFor;\n /** function to check the value in the \"resolutionExplained\" key in package.json */\n checkResolutionMessage?: CheckResolutionMessage;\n}\n\nexport interface CheckExactVersionsOptions {\n allowRangeVersionsInDependencies?: boolean;\n onlyWarnsFor?: OnlyWarnsFor;\n /** @internal */\n internalExactVersionsIgnore?: OnlyWarnsFor;\n}\n\nexport interface CheckPackageApiRunOptions {\n /** @internal */\n skipDisplayConclusion?: boolean;\n}\n\nexport interface CheckPackageApi {\n run: (options?: CheckPackageApiRunOptions) => Promise;\n\n /** @internal */\n pkg: PackageJson;\n /** @internal */\n pkgDirname: string;\n /** @internal */\n pkgPathName: string;\n /** @internal */\n isPkgLibrary: boolean;\n /** @internal */\n getDependencyPackageJson: GetDependencyPackageJson;\n\n checkExactVersions: (options?: CheckExactVersionsOptions) => CheckPackageApi;\n\n checkResolutionsVersionsMatch: () => CheckPackageApi;\n\n checkExactDevVersions: (\n options?: CheckExactVersionsOptions,\n ) => CheckPackageApi;\n\n checkNoDependencies: (\n type?: DependencyTypes,\n moveToSuggestion?: DependencyTypes,\n ) => CheckPackageApi;\n\n /**\n * @example\n * ```\n * .checkDirectPeerDependencies({\n * invalidOnlyWarnsFor: ['semver'],\n * })\n * ```\n */\n checkDirectPeerDependencies: (\n options?: CheckDirectPeerDependenciesOptions,\n ) => CheckPackageApi;\n\n /**\n * @example\n * ```\n * .checkDirectDuplicateDependencies({\n * invalidOnlyWarnsFor: { '*': 'type-fest' },\n * })\n * ```\n */\n checkDirectDuplicateDependencies: (\n options?: CheckDirectDuplicateDependenciesOptions,\n ) => CheckPackageApi;\n\n checkResolutionsHasExplanation: (\n checkMessage?: CheckResolutionMessage,\n ) => CheckPackageApi;\n\n checkRecommended: (options?: CheckRecommendedOptions) => CheckPackageApi;\n\n /**\n * @example\n * Check that your package.json contains the same version of @babel/core than react-scripts, both in resolutions and devDependencies\n * ```\n * .checkIdenticalVersionsThanDependency('react-scripts', {\n * resolutions: ['@babel/core'],\n * devDependencies: ['@babel/core'],\n * })\n * ```\n */\n checkIdenticalVersionsThanDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n checkIdenticalVersionsThanDevDependencyOfDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies specifically satisfies the range passed in config\n *\n * @example\n * ```\n * .checkSatisfiesVersions({\n * devDependencies: {\n * eslint: '^8.0.0'\n * },\n * })\n * ```\n */\n checkSatisfiesVersions: (\n dependencies: Partial<\n Record>\n >,\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies specifically satisfies the range set in another dependencies\n * @example\n * ```\n * .checkSatisfiesVersionsFromDependency('@pob/eslint-config-typescript', {\n * devDependencies: [\n * '@typescript-eslint/eslint-plugin',\n * '@typescript-eslint/parser',\n * ],\n * })\n * ```\n */\n checkSatisfiesVersionsFromDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n checkSatisfiesVersionsInDevDependenciesOfDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies have the exact same version that another dependency also present in your package.json\n * @example\n * The react-dom version should match react, so this check will ensure it does\n * ```\n * .checkIdenticalVersions({\n * dependencies: {\n * react: {\n * dependencies: ['react-dom'],\n * devDependencies: ['react-test-renderer'],\n * },\n * },\n * })\n * ```\n */\n checkIdenticalVersions: (dependencies: {\n resolutions?: Record;\n dependencies?: Record;\n devDependencies?: Record;\n }) => CheckPackageApi;\n\n checkSatisfiesVersionsBetweenDependencies: (\n depName1: string,\n depName2: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check versions in a dependency\n * Also useable to check if a dependency is not present\n *\n * @example\n * Checking if `@lerna/version` has no dependency `@nrwl/devkit`\n * ```\n * .checkSatisfiesVersionsInDependency('@lerna/version', {\n * dependencies: {\n * '@nrwl/devkit': null,\n * },\n * })\n * ```\n */\n checkSatisfiesVersionsInDependency: (\n depName: string,\n dependenciesRanges: DependenciesRanges,\n ) => CheckPackageApi;\n\n checkMinRangeDependenciesSatisfiesDevDependencies: () => CheckPackageApi;\n checkMinRangePeerDependenciesSatisfiesDependencies: () => CheckPackageApi;\n}\n\nexport type ShouldHaveExactVersions = (depType: DependencyTypes) => boolean;\n\nexport function createCheckPackage({\n packageDirectoryPath = \".\",\n internalWorkspacePkgDirectoryPath,\n isLibrary = false,\n}: CreateCheckPackageOptions = {}): CheckPackageApi {\n const pkgDirname = path.resolve(packageDirectoryPath);\n const pkgPath = `${pkgDirname}/package.json`;\n const pkgPathName = `${packageDirectoryPath}/package.json`;\n const pkg = readPkgJson(pkgPath);\n const copyPkg: PackageJson = JSON.parse(JSON.stringify(pkg)) as PackageJson;\n const isPkgLibrary =\n typeof isLibrary === \"function\" ? isLibrary(pkg) : isLibrary;\n const shouldHaveExactVersions: ShouldHaveExactVersions = (depType) =>\n !isPkgLibrary ? true : depType === \"devDependencies\";\n\n let tryToAutoFix = false;\n\n if (process.argv.slice(2).includes(\"--fix\")) {\n tryToAutoFix = true;\n }\n\n const writePackageIfChanged = (): void => {\n if (!tryToAutoFix) return;\n if (util.isDeepStrictEqual(pkg, copyPkg)) return;\n writePkgJson(pkgPath, pkg);\n };\n\n const getDependencyPackageJson = createGetDependencyPackageJson({\n pkgDirname,\n });\n\n let runCalled = false;\n\n if (!internalWorkspacePkgDirectoryPath) {\n process.on(\"beforeExit\", () => {\n if (!runCalled) {\n throw new Error(\"Call .run() and await the result.\");\n }\n });\n }\n\n class Job {\n name: string;\n\n fn: () => Promise;\n\n constructor(name: string, fn: () => Promise) {\n this.name = name;\n this.fn = fn;\n }\n\n async run(): Promise {\n try {\n await this.fn();\n } catch (error) {\n throw new Error(`${this.name} failed: ${(error as Error).message}`);\n }\n }\n }\n\n const jobs: Job[] = [];\n\n return {\n async run({\n skipDisplayConclusion = false,\n }: CheckPackageApiRunOptions = {}) {\n runCalled = true;\n // TODO parallel\n for (const job of jobs) {\n await job.run();\n }\n writePackageIfChanged();\n if (!skipDisplayConclusion) {\n displayConclusion();\n }\n },\n\n pkg,\n pkgDirname,\n pkgPathName,\n isPkgLibrary,\n getDependencyPackageJson,\n checkExactVersions({\n onlyWarnsFor,\n internalExactVersionsIgnore,\n allowRangeVersionsInDependencies = true,\n } = {}) {\n jobs.push(\n new Job(this.checkExactVersions.name, async () => {\n const onlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n \"checkExactVersions.onlyWarnsFor\",\n onlyWarnsFor,\n );\n await checkExactVersions(\n pkg,\n pkgPathName,\n !allowRangeVersionsInDependencies\n ? [\"dependencies\", \"devDependencies\", \"resolutions\"]\n : [\"devDependencies\", \"resolutions\"],\n {\n onlyWarnsForCheck,\n internalExactVersionsIgnore,\n getDependencyPackageJson,\n tryToAutoFix,\n },\n );\n }),\n );\n return this;\n },\n\n checkResolutionsVersionsMatch() {\n checkResolutionsVersionsMatch(pkg, pkgPathName, {\n tryToAutoFix,\n });\n return this;\n },\n\n checkExactDevVersions({ onlyWarnsFor } = {}) {\n jobs.push(\n new Job(this.checkExactDevVersions.name, async () => {\n const onlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n \"checkExactDevVersions.onlyWarnsFor\",\n onlyWarnsFor,\n );\n await checkExactVersions(pkg, pkgPathName, [\"devDependencies\"], {\n onlyWarnsForCheck,\n tryToAutoFix,\n getDependencyPackageJson,\n });\n }),\n );\n return this;\n },\n\n checkNoDependencies(\n type = \"dependencies\",\n moveToSuggestion = \"devDependencies\",\n ) {\n checkNoDependencies(pkg, pkgPathName, type, moveToSuggestion);\n return this;\n },\n\n checkDirectPeerDependencies({\n missingOnlyWarnsFor,\n invalidOnlyWarnsFor,\n internalMissingConfigName = \"missingOnlyWarnsFor\",\n internalInvalidConfigName = \"invalidOnlyWarnsFor\",\n } = {}) {\n jobs.push(\n new Job(this.checkDirectPeerDependencies.name, async () => {\n const missingOnlyWarnsForCheck = createOnlyWarnsForMappingCheck(\n internalMissingConfigName,\n missingOnlyWarnsFor,\n );\n const invalidOnlyWarnsForCheck =\n internalInvalidConfigName === internalMissingConfigName\n ? missingOnlyWarnsForCheck\n : createOnlyWarnsForMappingCheck(\n internalInvalidConfigName,\n invalidOnlyWarnsFor,\n );\n await checkDirectPeerDependencies(\n isPkgLibrary,\n pkg,\n pkgPathName,\n getDependencyPackageJson,\n missingOnlyWarnsForCheck,\n invalidOnlyWarnsForCheck,\n );\n }),\n );\n return this;\n },\n\n checkDirectDuplicateDependencies({\n onlyWarnsFor,\n internalConfigName = \"onlyWarnsFor\",\n } = {}) {\n jobs.push(\n new Job(this.checkDirectDuplicateDependencies.name, async () => {\n await checkDirectDuplicateDependencies(\n pkg,\n pkgPathName,\n isPkgLibrary,\n \"dependencies\",\n getDependencyPackageJson,\n createOnlyWarnsForMappingCheck(internalConfigName, onlyWarnsFor),\n );\n }),\n );\n return this;\n },\n\n checkResolutionsHasExplanation(\n checkMessage: CheckResolutionMessage = (depKey, message) => undefined,\n ) {\n checkResolutionsHasExplanation(\n pkg,\n pkgPathName,\n checkMessage,\n getDependencyPackageJson,\n );\n return this;\n },\n\n checkRecommended({\n onlyWarnsForInPackage,\n onlyWarnsForInDependencies,\n allowRangeVersionsInDependencies = isPkgLibrary,\n internalExactVersionsIgnore,\n checkResolutionMessage,\n } = {}) {\n let internalMissingPeerDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n let internalInvalidPeerDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n let internalDirectDuplicateDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n\n const exactVersionsOnlyWarnsFor =\n onlyWarnsForInPackage?.exactVersions || [];\n\n if (onlyWarnsForInDependencies) {\n internalDirectDuplicateDependenciesOnlyWarnsFor = {};\n internalMissingPeerDependenciesOnlyWarnsFor = {};\n internalInvalidPeerDependenciesOnlyWarnsFor = {};\n\n getEntries(onlyWarnsForInDependencies).forEach(\n ([dependencyNameOrSpecialKey, onlyWarnsForValue]) => {\n if (onlyWarnsForValue.duplicateDirectDependency) {\n (\n internalDirectDuplicateDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.duplicateDirectDependency;\n }\n if (onlyWarnsForValue.missingPeerDependency) {\n (\n internalMissingPeerDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.missingPeerDependency;\n }\n if (onlyWarnsForValue.invalidPeerDependencyVersion) {\n (\n internalInvalidPeerDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.invalidPeerDependencyVersion;\n }\n },\n );\n }\n\n this.checkExactVersions({\n allowRangeVersionsInDependencies,\n onlyWarnsFor: exactVersionsOnlyWarnsFor,\n internalExactVersionsIgnore,\n });\n\n this.checkResolutionsVersionsMatch();\n this.checkResolutionsHasExplanation(checkResolutionMessage);\n\n this.checkDirectPeerDependencies({\n missingOnlyWarnsFor: internalMissingPeerDependenciesOnlyWarnsFor,\n invalidOnlyWarnsFor: internalInvalidPeerDependenciesOnlyWarnsFor,\n internalMissingConfigName:\n \"onlyWarnsForInDependencies.missingPeerDependency\",\n internalInvalidConfigName:\n \"onlyWarnsForInDependencies.invalidPeerDependencyVersion\",\n });\n\n this.checkDirectDuplicateDependencies({\n onlyWarnsFor: internalDirectDuplicateDependenciesOnlyWarnsFor,\n internalConfigName:\n \"onlyWarnsForInDependencies.duplicateDirectDependency\",\n });\n\n if (isPkgLibrary) {\n this.checkMinRangeDependenciesSatisfiesDevDependencies();\n this.checkMinRangePeerDependenciesSatisfiesDependencies();\n }\n\n return this;\n },\n\n checkIdenticalVersionsThanDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkIdenticalVersionsThanDependency.name, async () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n depPkg.dependencies,\n );\n }\n if (dependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n depPkg.dependencies,\n );\n }\n if (devDependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n depPkg.dependencies,\n );\n }\n }),\n );\n return this;\n },\n\n checkIdenticalVersionsThanDevDependencyOfDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsFromDependency.name, async () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n depPkg.devDependencies,\n );\n }\n if (dependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n depPkg.devDependencies,\n );\n }\n if (devDependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n depPkg.devDependencies,\n );\n }\n }),\n );\n return this;\n },\n\n checkSatisfiesVersions(dependencies) {\n Object.entries(dependencies).forEach(\n ([dependencyType, dependenciesRanges]) => {\n checkSatisfiesVersions(\n pkg,\n pkgPathName,\n dependencyType as DependencyTypes,\n dependenciesRanges,\n );\n },\n );\n return this;\n },\n\n checkSatisfiesVersionsFromDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsFromDependency.name, async () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n }),\n );\n return this;\n },\n\n checkSatisfiesVersionsInDevDependenciesOfDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(\n this.checkSatisfiesVersionsInDevDependenciesOfDependency.name,\n async () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n },\n ),\n );\n return this;\n },\n\n checkIdenticalVersions({ resolutions, dependencies, devDependencies }) {\n if (resolutions) {\n checkIdenticalVersions(pkg, pkgPathName, \"resolutions\", resolutions);\n }\n if (dependencies) {\n checkIdenticalVersions(pkg, pkgPathName, \"dependencies\", dependencies);\n }\n if (devDependencies) {\n checkIdenticalVersions(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n );\n }\n return this;\n },\n\n checkSatisfiesVersionsBetweenDependencies(\n depName1,\n depName2,\n { dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(\n this.checkSatisfiesVersionsBetweenDependencies.name,\n async () => {\n const [depPkg1, depPkg2] = await Promise.all([\n getDependencyPackageJson(depName1),\n getDependencyPackageJson(depName2),\n ]);\n\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n depPkg2,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg1,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n depPkg2,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg1,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n },\n ),\n );\n return this;\n },\n\n checkSatisfiesVersionsInDependency(depName, dependenciesRanges) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, async () => {\n const depPkg = getDependencyPackageJson(depName);\n checkSatisfiesVersionsInDependency(\n pkgPathName,\n depPkg,\n dependenciesRanges,\n );\n }),\n );\n return this;\n },\n\n checkMinRangeDependenciesSatisfiesDevDependencies() {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, async () => {\n checkMinRangeSatisfies(\n pkgPathName,\n pkg,\n \"dependencies\",\n \"devDependencies\",\n { tryToAutoFix },\n );\n }),\n );\n return this;\n },\n\n checkMinRangePeerDependenciesSatisfiesDependencies() {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, async () => {\n checkMinRangeSatisfies(\n pkgPathName,\n pkg,\n \"peerDependencies\",\n \"dependencies\",\n { tryToAutoFix },\n );\n }),\n );\n return this;\n },\n };\n}\n","import fs, { constants } from \"node:fs\";\nimport path from \"node:path\";\nimport type { Except } from \"type-fest\";\nimport type {\n CreateCheckPackageOptions,\n CheckPackageApi,\n OnlyWarnsForInDependenciesCheckPackageRecommendedOption,\n OnlyWarnsForInDependencyCheckPackageRecommendedOption,\n OnlyWarnsForInPackageCheckPackageRecommendedOption,\n} from \"./check-package\";\nimport { createCheckPackage } from \"./check-package\";\nimport { checkDuplicateDependencies } from \"./checks/checkDuplicateDependencies\";\nimport type { CheckResolutionMessage } from \"./checks/checkResolutionsHasExplanation\";\nimport {\n createReportError,\n displayConclusion,\n reportNotWarnedForMapping,\n} from \"./utils/createReportError\";\nimport type { PackageJson } from \"./utils/packageTypes\";\nimport type { OnlyWarnsForOptionalDependencyMapping } from \"./utils/warnForUtils\";\nimport { createOnlyWarnsForMappingCheck } from \"./utils/warnForUtils\";\n\ninterface OnlyWarnsForInMonorepoPackageCheckPackageRecommendedOption\n extends OnlyWarnsForInPackageCheckPackageRecommendedOption {\n duplicateDirectDependency: OnlyWarnsForInDependencyCheckPackageRecommendedOption[\"duplicateDirectDependency\"];\n}\n\ntype OnlyWarnsForInMonorepoPackagesCheckPackageRecommendedOption = Record<\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/sort-type-constituents\n \"*\" | string,\n OnlyWarnsForInMonorepoPackageCheckPackageRecommendedOption\n>;\n\ntype OnlyWarnsForInMonorepoPackagesDependenciesCheckPackageRecommendedOption =\n Record;\n\nexport interface CheckPackageWithWorkspacesRecommendedOptions {\n allowRangeVersionsInLibraries?: boolean;\n monorepoDirectDuplicateDependenciesOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n onlyWarnsForInRootPackage?: OnlyWarnsForInPackageCheckPackageRecommendedOption;\n onlyWarnsForInMonorepoPackages?: OnlyWarnsForInMonorepoPackagesCheckPackageRecommendedOption;\n onlyWarnsForInRootDependencies?: OnlyWarnsForInDependenciesCheckPackageRecommendedOption;\n onlyWarnsForInMonorepoPackagesDependencies?: OnlyWarnsForInMonorepoPackagesDependenciesCheckPackageRecommendedOption;\n checkResolutionMessage?: CheckResolutionMessage;\n}\n\nexport interface CheckPackageWithWorkspacesApi {\n run: () => Promise;\n\n checkRecommended: (\n options?: CheckPackageWithWorkspacesRecommendedOptions,\n ) => CheckPackageWithWorkspacesApi;\n\n forRoot: (\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n forEach: (\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n for: (\n id: string,\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n}\n\ninterface CreateCheckPackageWithWorkspacesOptions\n extends Except {\n isLibrary?: (pkg: PackageJson) => boolean;\n}\n\nexport function createCheckPackageWithWorkspaces(\n createCheckPackageOptions: CreateCheckPackageWithWorkspacesOptions = {},\n): CheckPackageWithWorkspacesApi {\n const checkPackage = createCheckPackage({\n ...createCheckPackageOptions,\n isLibrary: false,\n });\n const { pkg, pkgDirname } = checkPackage;\n\n const pkgWorkspaces: string[] | undefined =\n pkg.workspaces && !Array.isArray(pkg.workspaces)\n ? pkg.workspaces.packages\n : pkg.workspaces;\n\n if (!pkgWorkspaces) {\n throw new Error('Package is missing \"workspaces\"');\n }\n\n const workspacePackagesPaths: string[] = [];\n\n const match = fs.globSync(pkgWorkspaces, { cwd: pkgDirname });\n for (const pathMatch of match) {\n try {\n fs.accessSync(path.join(pathMatch, \"package.json\"), constants.R_OK);\n } catch {\n console.log(\n `Ignored potential directory, no package.json found: ${pathMatch}`,\n );\n continue;\n }\n\n const subPkgDirectoryPath = path.relative(process.cwd(), pathMatch);\n workspacePackagesPaths.push(subPkgDirectoryPath);\n }\n\n const checksWorkspaces = new Map(\n workspacePackagesPaths.map((subPkgDirectoryPath) => {\n const checkPkg = createCheckPackage({\n ...createCheckPackageOptions,\n packageDirectoryPath: subPkgDirectoryPath,\n internalWorkspacePkgDirectoryPath:\n createCheckPackageOptions.packageDirectoryPath || \".\",\n });\n return [checkPkg.pkg.name, checkPkg];\n }),\n );\n\n return {\n async run() {\n for (const checksWorkspace of [\n checkPackage,\n ...checksWorkspaces.values(),\n ]) {\n await checksWorkspace.run({ skipDisplayConclusion: true });\n }\n\n displayConclusion();\n },\n\n checkRecommended({\n allowRangeVersionsInLibraries = true,\n onlyWarnsForInRootPackage,\n onlyWarnsForInMonorepoPackages,\n onlyWarnsForInRootDependencies,\n onlyWarnsForInMonorepoPackagesDependencies = {},\n monorepoDirectDuplicateDependenciesOnlyWarnsFor,\n checkResolutionMessage,\n } = {}) {\n checkPackage.checkNoDependencies();\n checkPackage.checkRecommended({\n onlyWarnsForInPackage: onlyWarnsForInRootPackage,\n onlyWarnsForInDependencies: onlyWarnsForInRootDependencies,\n checkResolutionMessage,\n });\n\n const monorepoDirectDuplicateDependenciesOnlyWarnsForCheck =\n createOnlyWarnsForMappingCheck(\n \"monorepoDirectDuplicateDependenciesOnlyWarnsFor\",\n monorepoDirectDuplicateDependenciesOnlyWarnsFor,\n );\n\n const previousCheckedWorkspaces = new Map();\n checksWorkspaces.forEach((checkSubPackage, id) => {\n checkSubPackage.checkRecommended({\n allowRangeVersionsInDependencies: checkSubPackage.isPkgLibrary\n ? allowRangeVersionsInLibraries\n : false,\n onlyWarnsForInPackage: onlyWarnsForInMonorepoPackages\n ? {\n ...onlyWarnsForInMonorepoPackages[\"*\"],\n ...onlyWarnsForInMonorepoPackages[checkSubPackage.pkg.name],\n }\n : undefined,\n onlyWarnsForInDependencies: {\n ...onlyWarnsForInMonorepoPackagesDependencies[\"*\"],\n ...onlyWarnsForInMonorepoPackagesDependencies[\n checkSubPackage.pkg.name\n ],\n },\n internalExactVersionsIgnore: [...checksWorkspaces.keys()],\n checkResolutionMessage,\n });\n\n const reportMonorepoDDDError = createReportError(\n \"Monorepo Direct Duplicate Dependencies\",\n checkSubPackage.pkgPathName,\n );\n // Root\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"devDependencies\",\n [\"dependencies\", \"devDependencies\"],\n pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n // previous packages\n previousCheckedWorkspaces.forEach((previousCheckSubPackage) => {\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"devDependencies\",\n [\"dependencies\", \"devDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"dependencies\",\n [\"dependencies\", \"devDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"peerDependencies\",\n [\"peerDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n });\n\n previousCheckedWorkspaces.set(id, checkSubPackage);\n });\n reportNotWarnedForMapping(\n createReportError(\n \"Monorepo Direct Duplicate Dependencies\",\n checkPackage.pkgPathName,\n ),\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck,\n );\n\n return this;\n },\n\n forRoot(callback) {\n callback(checkPackage);\n return this;\n },\n\n forEach(callback) {\n checksWorkspaces.forEach((checkSubPackage) => {\n callback(checkSubPackage);\n });\n return this;\n },\n\n for(id, callback) {\n const packageCheck = checksWorkspaces.get(id);\n if (!packageCheck) {\n throw new Error(\n `Invalid package name: ${id}. Known package names: \"${[\n ...checksWorkspaces.keys(),\n ].join('\",\"')}\"`,\n );\n }\n callback(packageCheck);\n return this;\n },\n };\n}\n"],"names":["importResolve"],"mappings":";;;;;;;;;AAAO,MAAM,OAAU,GAAA,CAAmB,CACxC,KAAA,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAER,MAAM,UAAa,GAAA,CAAmB,CAC3C,KAAA,MAAA,CAAO,QAAQ,CAAC,CAAA;;ACYlB,IAAI,cAAgC,GAAA,IAAA,CAAA;AACpC,IAAI,gBAAkC,GAAA,IAAA,CAAA;AAEtC,IAAI,aAAgB,GAAA,CAAA,CAAA;AACpB,IAAI,WAAc,GAAA,CAAA,CAAA;AAClB,IAAI,YAAe,GAAA,CAAA,CAAA;AAEZ,SAAS,iBAA0B,GAAA;AACxC,EAAI,IAAA,CAAC,aAAiB,IAAA,CAAC,WAAa,EAAA;AAClC,IAAA,OAAA,CAAQ,GAAI,CAAA,CAAA;AAAA,EAAK,KAAM,CAAA,KAAA,CAAM,oCAA+B,CAAC,CAAG,CAAA,CAAA,CAAA,CAAA;AAAA,GAClE,MAAA,IAAW,CAAC,WAAa,EAAA;AACvB,IAAA,OAAA,CAAQ,GAAI,CAAA,CAAA;AAAA,MAAA,EAAW,MAAM,MAAO,CAAA,CAAA,EAA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,CAAS,eAAe,CAAA,CAAA;AAAA,OACzB,CAAA,CAAA;AACD,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAAA,IAEA,GAAA,CAAI,IAAI,QAAU,EAAA;AAChB,MAAM,MAAA,YAAA,GAAe,gBAAiB,CAAA,GAAA,CAAI,EAAE,CAAA,CAAA;AAC5C,MAAA,IAAI,CAAC,YAAc,EAAA;AACjB,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,CAAA,sBAAA,EAAyB,EAAE,CAA2B,wBAAA,EAAA;AAAA,YACpD,GAAG,iBAAiB,IAAK,EAAA;AAAA,WAC3B,CAAE,IAAK,CAAA,KAAK,CAAC,CAAA,CAAA,CAAA;AAAA,SACf,CAAA;AAAA,OACF;AACA,MAAA,QAAA,CAAS,YAAY,CAAA,CAAA;AACrB,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAAA,GACF,CAAA;AACF;;;;"} \ No newline at end of file +{"version":3,"file":"index-node22.mjs","sources":["../src/utils/object.ts","../src/utils/createReportError.ts","../src/checks/checkDuplicateDependencies.ts","../src/checks/checkDirectDuplicateDependencies.ts","../src/utils/semverUtils.ts","../src/checks/checkPeerDependencies.ts","../src/checks/checkDirectPeerDependencies.ts","../src/checks/checkExactVersions.ts","../src/checks/checkIdenticalVersions.ts","../src/checks/checkIdenticalVersionsThanDependency.ts","../src/checks/checkMinRangeSatisfies.ts","../src/checks/checkNoDependencies.ts","../src/checks/checkResolutionsHasExplanation.ts","../src/checks/checkResolutionsVersionsMatch.ts","../src/checks/checkSatisfiesVersions.ts","../src/checks/checkSatisfiesVersionsFromDependency.ts","../src/checks/checkSatisfiesVersionsInDependency.ts","../src/utils/pkgJsonUtils.ts","../src/utils/createGetDependencyPackageJson.ts","../src/utils/warnForUtils.ts","../src/check-package.ts","../src/check-package-with-workspaces.ts"],"sourcesContent":["export const getKeys = (o: T): (keyof T)[] =>\n Object.keys(o) as (keyof T)[];\n\nexport const getEntries = (o: T): [keyof T, T[keyof T]][] =>\n Object.entries(o) as unknown as [keyof T, T[keyof T]][];\n","/* eslint-disable no-console */\n\nimport chalk from \"chalk\";\nimport { getEntries } from \"./object\";\nimport type {\n OnlyWarnsForCheck,\n OnlyWarnsForMappingCheck,\n} from \"./warnForUtils\";\n\nexport type ReportError = (\n msgTitle: string,\n msgInfo?: string,\n onlyWarns?: boolean,\n autoFixable?: boolean,\n) => void;\n\nlet titleDisplayed: string | null = null;\nlet pkgPathDisplayed: string | null = null;\n\nlet totalWarnings = 0;\nlet totalErrors = 0;\nlet totalFixable = 0;\n\nexport function displayConclusion(): void {\n if (!totalWarnings && !totalErrors) {\n console.log(`\\n${chalk.green(\"✅ No errors or warnings found\")}.`);\n } else if (!totalErrors) {\n console.log(`\\nFound ${chalk.yellow(`${totalWarnings} warnings`)}.`);\n } else if (!totalWarnings) {\n console.log(`\\nFound ${chalk.red(`${totalErrors} errors`)}.`);\n } else {\n console.log(\n `\\nFound ${chalk.red(`${totalErrors} errors`)} and ${chalk.yellow(\n `${totalWarnings} warnings`,\n )}.`,\n );\n }\n\n if (totalFixable) {\n console.log(\n `Found ${chalk.green(\n `${totalFixable} auto-fixable`,\n )} errors or warnings, run the command with \"--fix\" to fix them.`,\n );\n }\n}\n\nexport function logMessage(\n msgTitle: string,\n msgInfo?: string,\n onlyWarns?: boolean,\n autoFixable?: boolean,\n): void {\n if (onlyWarns) totalWarnings++;\n else totalErrors++;\n if (autoFixable) totalFixable++;\n console.error(\n `${\n onlyWarns ? chalk.yellow(`⚠ ${msgTitle}`) : chalk.red(`❌ ${msgTitle}`)\n }${msgInfo ? `: ${msgInfo}` : \"\"}${\n autoFixable ? ` ${chalk.bgGreenBright(chalk.black(\"auto-fixable\"))}` : \"\"\n }`,\n );\n}\n\nexport function createReportError(\n title: string,\n pkgPathName: string,\n): ReportError {\n return function reportError(\n msgTitle,\n msgInfo,\n onlyWarns,\n autoFixable = false,\n ): void {\n if (titleDisplayed !== title || pkgPathName !== pkgPathDisplayed) {\n if (titleDisplayed) console.error();\n console.error(chalk.cyan(`== ${title} in ${pkgPathName} ==`));\n titleDisplayed = title;\n pkgPathDisplayed = pkgPathName;\n }\n logMessage(msgTitle, msgInfo, onlyWarns, autoFixable);\n\n if (!onlyWarns) {\n // console.trace();\n process.exitCode = 1;\n }\n };\n}\n\nexport function reportNotWarnedFor(\n reportError: ReportError,\n onlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const notWarnedFor = onlyWarnsForCheck.getNotWarnedFor();\n if (notWarnedFor.length > 0) {\n reportError(\n `Invalid config in \"${onlyWarnsForCheck.configName}\"`,\n `no warning was raised for ${notWarnedFor\n .map((depName) => `\"${depName}\"`)\n .join(\", \")}`,\n false,\n );\n }\n}\n\nexport function reportNotWarnedForMapping(\n reportError: ReportError,\n onlyWarnsForMappingCheck: OnlyWarnsForMappingCheck,\n): void {\n const notWarnedForMapping = onlyWarnsForMappingCheck.getNotWarnedFor();\n getEntries(notWarnedForMapping).forEach(([depNameOrStar, notWarnedFor]) => {\n reportError(\n `Invalid config in \"${onlyWarnsForMappingCheck.configName}\" for \"${depNameOrStar}\"`,\n `no warning was raised for ${notWarnedFor\n .map((depName) => `\"${depName}\"`)\n .join(\", \")}`,\n );\n });\n}\n","import semver from \"semver\";\nimport type { ReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkDuplicateDependencies(\n reportError: ReportError,\n pkg: PackageJson,\n isPkgLibrary: boolean,\n depType: DependencyTypes,\n searchIn: DependencyTypes[],\n depPkg: PackageJson,\n onlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const dependencies = depPkg[depType];\n if (!dependencies) return;\n\n const searchInExisting = searchIn.filter((type) => pkg[type]);\n\n for (const [depKey, range] of Object.entries(dependencies)) {\n const versionsIn = searchInExisting.filter((type) => pkg[type]![depKey]);\n\n let allowDuplicated = false;\n if (\n versionsIn.length === 2 &&\n isPkgLibrary &&\n versionsIn.includes(\"dependencies\") &&\n versionsIn.includes(\"devDependencies\")\n ) {\n const depVersion = pkg.dependencies![depKey];\n const devDepVersion = pkg.devDependencies![depKey];\n\n if (depVersion && depVersion === devDepVersion) {\n reportError(\n `Invalid \"${depKey}\" has same version in dependencies and devDependencies`,\n \"please place it only in dependencies or use range in dependencies\",\n );\n continue;\n }\n allowDuplicated = true;\n }\n\n if (\n versionsIn.length > 2 ||\n (versionsIn.length === 2 && !allowDuplicated)\n ) {\n reportError(\n `Invalid \"${depKey}\" present in ${versionsIn.join(\" and \")}`,\n \"please place it only in dependencies\",\n );\n } else {\n const versions = versionsIn.map((type) => pkg[type]![depKey]);\n\n versions.forEach((version, index) => {\n if (version.startsWith(\"file:\") || range.startsWith(\"file:\")) return;\n // https://yarnpkg.com/features/workspaces#workspace-ranges-workspace\n if (\n version.startsWith(\"workspace:\") ||\n range.startsWith(\"workspace:\")\n ) {\n return;\n }\n\n if (\n semver.satisfies(version, range, {\n includePrerelease: true,\n }) ||\n semver.intersects(version, range, {\n includePrerelease: true,\n })\n ) {\n return;\n }\n\n // Ignore reporting duplicate when there's a resolution for it\n if (pkg.resolutions?.[depKey]) {\n return;\n }\n\n const versionInType = versionsIn[index];\n\n reportError(\n `Invalid duplicate dependency \"${depKey}\"`,\n `\"${versions[0]}\" (in ${versionInType}) should satisfies \"${range}\" from \"${depPkg.name}\" ${depType}.`,\n onlyWarnsForCheck.shouldWarnsFor(depKey),\n );\n });\n }\n }\n}\n","import type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n reportNotWarnedForMapping,\n createReportError,\n} from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForMappingCheck } from \"../utils/warnForUtils\";\nimport { checkDuplicateDependencies } from \"./checkDuplicateDependencies\";\n\nexport function checkDirectDuplicateDependencies(\n pkg: PackageJson,\n pkgPathName: string,\n isPackageALibrary: boolean,\n depType: DependencyTypes,\n getDependencyPackageJson: GetDependencyPackageJson,\n onlyWarnsForCheck: OnlyWarnsForMappingCheck,\n reportErrorNamePrefix = \"\",\n customCreateReportError = createReportError,\n): void {\n const reportError = customCreateReportError(\n `${reportErrorNamePrefix}Direct Duplicate Dependencies`,\n pkgPathName,\n );\n\n const checks: {\n type: DependencyTypes;\n searchIn: DependencyTypes[];\n }[] = [\n {\n type: \"devDependencies\",\n searchIn: [\"devDependencies\", \"dependencies\"],\n },\n { type: \"dependencies\", searchIn: [\"devDependencies\", \"dependencies\"] },\n ];\n\n checks.forEach(({ type, searchIn }) => {\n const dependencies = pkg[type];\n\n if (!dependencies) return;\n for (const depName of getKeys(dependencies)) {\n const depPkg = getDependencyPackageJson(depName);\n checkDuplicateDependencies(\n reportError,\n pkg,\n isPackageALibrary,\n depType,\n searchIn,\n depPkg,\n onlyWarnsForCheck.createFor(depName),\n );\n }\n });\n\n reportNotWarnedForMapping(reportError, onlyWarnsForCheck);\n}\n","import type { SemVer } from \"semver-utils\";\nimport semverUtils from \"semver-utils\";\n\nexport const parse = semverUtils.parse;\nexport const parseRange = semverUtils.parseRange;\n\n// semverUtils.stringify does not support the operator\nfunction stringify(semver: SemVer): string {\n let str = \"\";\n if (semver.operator) {\n str += semver.operator;\n }\n str += semver.major || \"0\";\n str += \".\";\n str += semver.minor || \"0\";\n str += \".\";\n str += semver.patch || \"0\";\n if (semver.release) {\n str += `-${semver.release}`;\n }\n if (semver.build) {\n str += `+${semver.build}`;\n }\n return str;\n}\n\nexport function getOperator(range: string): string | null {\n const parsedRange = parseRange(range);\n if (parsedRange.length !== 1) return null;\n return parsedRange[0].operator || \"\";\n}\n\nexport function changeOperator(\n range: string,\n operator: string | null,\n): string | null {\n if (operator === null) return range;\n const parsedRange = parseRange(range);\n if (parsedRange.length !== 1) return null;\n const parsed = parsedRange[0];\n parsed.operator = operator === \"\" ? undefined : operator;\n return stringify(parsed);\n}\n\nexport function isExactParsedRange(\n parsedRange: ReturnType,\n): boolean {\n return parsedRange.length === 1 && parsedRange[0].operator === undefined;\n}\n\nexport function isExactRange(range: string): boolean {\n return isExactParsedRange(parseRange(range));\n}\n\nexport function getRealVersion(version: string): string {\n if (version.startsWith(\"npm:\")) {\n const match = /^npm:.*@(.*)$/.exec(version);\n if (!match) throw new Error(`Invalid version match: ${version}`);\n const [, realVersion] = match;\n return realVersion;\n }\n if (version.startsWith(\"workspace:\")) {\n return version.slice(\"workspace:\".length);\n }\n\n return version;\n}\n","import semver from \"semver\";\nimport type { ReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport { getRealVersion } from \"../utils/semverUtils\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkPeerDependencies(\n pkg: PackageJson,\n reportError: ReportError,\n type: DependencyTypes,\n allowedPeerIn: DependencyTypes[],\n allowMissing: boolean,\n providedDependencies: [string, string][],\n depPkg: PackageJson,\n missingOnlyWarnsForCheck: OnlyWarnsForCheck,\n invalidOnlyWarnsForCheck: OnlyWarnsForCheck,\n): void {\n const { peerDependencies, peerDependenciesMeta } = depPkg;\n if (!peerDependencies) return;\n\n const allowedPeerInExisting = allowedPeerIn.filter(\n (allowedPeerInType) => pkg[allowedPeerInType],\n );\n\n for (const [peerDepName, range] of Object.entries(peerDependencies)) {\n const versionsIn = allowedPeerInExisting.filter(\n (allowedPeerInExistingType) =>\n pkg[allowedPeerInExistingType]?.[peerDepName],\n );\n if (versionsIn.length === 0) {\n if (allowMissing) {\n continue;\n }\n\n const peerDependenciesMetaPeerDep = peerDependenciesMeta?.[peerDepName];\n if (peerDependenciesMetaPeerDep?.optional) {\n continue;\n }\n\n let additionalDetails = \"\";\n // satisfied by another direct dependency\n const providedDependenciesForDepName = providedDependencies.filter(\n ([depName]) => depName === peerDepName,\n );\n if (providedDependenciesForDepName.length > 0) {\n if (\n providedDependenciesForDepName.every(([, depRange]) =>\n semver.intersects(range, depRange),\n )\n ) {\n continue;\n }\n\n additionalDetails +=\n \" (required as some dependencies have non-satisfying range too)\";\n }\n\n reportError(\n `Missing \"${peerDepName}\" peer dependency from \"${depPkg.name}\" in ${type}`,\n `it should satisfies \"${range}\" and be in ${allowedPeerIn.join(\n \" or \",\n )}${additionalDetails}`,\n missingOnlyWarnsForCheck.shouldWarnsFor(peerDepName),\n );\n } else {\n const versions = versionsIn.map(\n (versionsInType) => pkg[versionsInType]![peerDepName],\n );\n\n versions.forEach((versionValue, index) => {\n const version = getRealVersion(versionValue);\n\n if (version === \"*\") {\n return;\n }\n\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${peerDepName}\" peer dependency`,\n `\"${version}\" (in ${allowedPeerInExisting[index]}) should satisfies \"${range}\" from \"${depPkg.name}\" ${type}`,\n invalidOnlyWarnsForCheck.shouldWarnsFor(peerDepName),\n );\n }\n });\n }\n }\n}\n","import semver from \"semver\";\nimport type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n createReportError,\n reportNotWarnedForMapping,\n} from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type {\n DependencyTypes,\n PackageJson,\n RegularDependencyTypes,\n} from \"../utils/packageTypes\";\nimport type { OnlyWarnsForMappingCheck } from \"../utils/warnForUtils\";\nimport { checkPeerDependencies } from \"./checkPeerDependencies\";\n\nconst regularDependencyTypes: RegularDependencyTypes[] = [\n \"devDependencies\",\n \"dependencies\",\n \"optionalDependencies\",\n];\n\nconst getAllowedPeerInFromType = (\n depPkgType: RegularDependencyTypes,\n isLibrary: boolean,\n): DependencyTypes[] => {\n switch (depPkgType) {\n case \"devDependencies\":\n return [\"devDependencies\", \"dependencies\"];\n case \"dependencies\":\n return isLibrary\n ? [\"dependencies\", \"peerDependencies\"]\n : [\"devDependencies\", \"dependencies\"];\n case \"optionalDependencies\":\n return isLibrary\n ? [\"dependencies\", \"optionalDependencies\", \"peerDependencies\"]\n : [\"devDependencies\", \"dependencies\"];\n\n // no default\n }\n};\n\nexport function checkDirectPeerDependencies(\n isLibrary: boolean,\n pkg: PackageJson,\n pkgPathName: string,\n getDependencyPackageJson: GetDependencyPackageJson,\n missingOnlyWarnsForCheck: OnlyWarnsForMappingCheck,\n invalidOnlyWarnsForCheck: OnlyWarnsForMappingCheck,\n customCreateReportError = createReportError,\n): void {\n const reportError = customCreateReportError(\"Peer Dependencies\", pkgPathName);\n\n const allDepPkgs: {\n name: string;\n type: RegularDependencyTypes;\n pkg: PackageJson;\n hasDirectMatchingPeerDependency: boolean;\n }[] = [];\n const allDirectDependenciesDependencies: [string, string][] = [];\n\n regularDependencyTypes.forEach((depType) => {\n const dependencies = pkg[depType];\n if (!dependencies) return;\n for (const depName of getKeys(dependencies)) {\n const depPkg = getDependencyPackageJson(depName);\n allDepPkgs.push({\n name: depName,\n type: depType,\n pkg: depPkg,\n hasDirectMatchingPeerDependency: pkg.peerDependencies?.[depName]\n ? semver.intersects(\n dependencies[depName],\n pkg.peerDependencies[depName],\n )\n : false,\n });\n\n if (depPkg.dependencies && !isLibrary) {\n allDirectDependenciesDependencies.push(\n ...Object.entries(depPkg.dependencies),\n );\n }\n }\n });\n\n for (const {\n name: depName,\n type: depType,\n pkg: depPkg,\n hasDirectMatchingPeerDependency,\n } of allDepPkgs) {\n if (depPkg.peerDependencies) {\n checkPeerDependencies(\n pkg,\n reportError,\n depType,\n getAllowedPeerInFromType(depType, isLibrary),\n hasDirectMatchingPeerDependency,\n allDirectDependenciesDependencies,\n depPkg,\n missingOnlyWarnsForCheck.createFor(depName),\n invalidOnlyWarnsForCheck.createFor(depName),\n );\n }\n }\n\n reportNotWarnedForMapping(reportError, missingOnlyWarnsForCheck);\n if (missingOnlyWarnsForCheck !== invalidOnlyWarnsForCheck) {\n reportNotWarnedForMapping(reportError, invalidOnlyWarnsForCheck);\n }\n}\n","import semver from \"semver\";\nimport type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport {\n createReportError,\n reportNotWarnedFor,\n} from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport { getRealVersion } from \"../utils/semverUtils\";\nimport type { OnlyWarnsFor, OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckExactVersionsOptions {\n getDependencyPackageJson?: GetDependencyPackageJson;\n onlyWarnsForCheck: OnlyWarnsForCheck;\n internalExactVersionsIgnore?: OnlyWarnsFor;\n tryToAutoFix?: boolean;\n customCreateReportError?: typeof createReportError;\n}\n\nconst isVersionRange = (version: string): boolean =>\n version.startsWith(\"^\") ||\n version.startsWith(\"~\") ||\n version.startsWith(\">\") ||\n version.startsWith(\"<\");\n\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function checkExactVersions(\n pkg: PackageJson,\n pkgPathName: string,\n types: DependencyTypes[],\n {\n getDependencyPackageJson,\n onlyWarnsForCheck,\n internalExactVersionsIgnore,\n tryToAutoFix = false,\n customCreateReportError = createReportError,\n }: CheckExactVersionsOptions,\n): Promise {\n const reportError = customCreateReportError(\"Exact versions\", pkgPathName);\n\n for (const type of types) {\n const pkgDependencies = pkg[type];\n if (!pkgDependencies) continue;\n\n for (const [dependencyName, versionValue] of Object.entries(\n pkgDependencies,\n )) {\n const version = getRealVersion(versionValue);\n\n if (isVersionRange(version)) {\n if (internalExactVersionsIgnore?.includes(dependencyName)) {\n continue;\n }\n const shouldOnlyWarn = onlyWarnsForCheck.shouldWarnsFor(dependencyName);\n if (!shouldOnlyWarn && getDependencyPackageJson) {\n let resolvedDep;\n try {\n resolvedDep = getDependencyPackageJson(dependencyName);\n } catch {\n resolvedDep = null;\n }\n if (!resolvedDep?.version) {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact${\n tryToAutoFix\n ? `, autofix failed to resolve \"${dependencyName}\".`\n : \"\"\n }`,\n shouldOnlyWarn,\n false,\n );\n } else if (\n !semver.satisfies(resolvedDep.version, version, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact${\n tryToAutoFix\n ? `, autofix failed as \"${dependencyName}\"'s resolved version is \"${resolvedDep.version}\" and doesn't satisfies \"${version}\".`\n : \"\"\n }`,\n shouldOnlyWarn,\n false,\n );\n } else if (tryToAutoFix) {\n pkgDependencies[dependencyName] = resolvedDep.version;\n } else {\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact \"${resolvedDep.version}\".`,\n shouldOnlyWarn,\n true,\n );\n }\n } else {\n let exactVersion = version.slice(version[1] === \"=\" ? 2 : 1);\n if (exactVersion.split(\".\").length < 3) {\n if (exactVersion.split(\".\").length === 1) {\n exactVersion = `${exactVersion}.0.0`;\n } else {\n exactVersion = `${exactVersion}.0`;\n }\n }\n reportError(\n `Unexpected range dependency in \"${type}\" for \"${dependencyName}\"`,\n `expecting \"${version}\" to be exact \"${exactVersion}\".`,\n shouldOnlyWarn,\n false,\n );\n }\n }\n }\n }\n\n reportNotWarnedFor(reportError, onlyWarnsForCheck);\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport { getKeys } from \"../utils/object\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkIdenticalVersions(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n deps: Record> | string[]>,\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n \"Identical Versions\",\n pkgPathName,\n );\n\n getKeys(deps).forEach((depKey) => {\n const version = pkgDependencies[depKey];\n if (!version) {\n reportError(`Unexpected missing ${type} for \"${depKey}\".`);\n return;\n }\n\n const depConfigArrayOrObject = deps[depKey];\n const depConfig = Array.isArray(depConfigArrayOrObject)\n ? { [type]: depConfigArrayOrObject }\n : depConfigArrayOrObject;\n\n getKeys(depConfig).forEach((depKeyType) => {\n const pkgDependenciesType = pkg[depKeyType] || {};\n depConfig[depKeyType]?.forEach((depKeyIdentical) => {\n const value = pkgDependenciesType[depKeyIdentical];\n if (!value) {\n reportError(\n `Missing \"${depKeyIdentical}\" in ${depKeyType}`,\n `it should be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n\n if (value !== version) {\n reportError(\n `Invalid \"${depKeyIdentical}\" in ${depKeyType}`,\n `expecting \"${value}\" be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n });\n });\n });\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport function checkIdenticalVersionsThanDependency(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n depKeys: string[],\n depPkg: PackageJson,\n dependencies: PackageJson[DependencyTypes] = {},\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n `Same Versions than ${depPkg.name}`,\n pkgPathName,\n );\n\n depKeys.forEach((depKey) => {\n const version = dependencies[depKey];\n if (!version) {\n reportError(\n `Unexpected missing dependency \"${depKey}\" in \"${depPkg.name}\".`,\n );\n return;\n }\n\n if (version.startsWith(\"^\") || version.startsWith(\"~\")) {\n reportError(\n `Unexpected range dependency in \"${depPkg.name}\" for \"${depKey}\"`,\n \"perhaps use checkSatisfiesVersionsFromDependency() instead.\",\n );\n return;\n }\n\n const value = pkgDependencies[depKey];\n\n if (!value) {\n reportError(\n `Missing \"${depKey}\" in ${type}`,\n `expecting to be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n\n if (value !== version) {\n reportError(\n `Invalid \"${depKey}\" in ${type}`,\n `expecting \"${value}\" to be \"${version}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n });\n}\n","import semver from \"semver\";\nimport semverUtils from \"semver-utils\";\nimport type { PackageJson } from \"type-fest\";\nimport { createReportError } from \"../utils/createReportError\";\nimport { getEntries } from \"../utils/object\";\nimport type { DependencyTypes } from \"../utils/packageTypes\";\n\nexport interface CheckMinRangeSatisfiesOptions {\n customCreateReportError?: typeof createReportError;\n tryToAutoFix?: boolean;\n}\n\nexport function checkMinRangeSatisfies(\n pkgPathName: string,\n pkg: PackageJson,\n type1: DependencyTypes = \"dependencies\",\n type2: DependencyTypes = \"devDependencies\",\n {\n tryToAutoFix = false,\n customCreateReportError = createReportError,\n }: CheckMinRangeSatisfiesOptions = {},\n): void {\n const dependencies1 = pkg[type1];\n const dependencies2 = pkg[type2];\n\n if (!dependencies1 || !dependencies2) {\n return;\n }\n\n const reportError = customCreateReportError(\n `\"${type1}\" minimum range satisfies \"${type2}\"`,\n pkgPathName,\n );\n\n for (const [depName, depRange1] of getEntries(dependencies1)) {\n if (depRange1 === \"*\") continue;\n\n const depRange2 = dependencies2[depName];\n if (!depRange2 || !depRange1) continue;\n\n const minDepRange1 = semver.minVersion(depRange1)?.version || depRange1;\n\n if (\n !semver.satisfies(minDepRange1, depRange2, {\n includePrerelease: true,\n })\n ) {\n if (tryToAutoFix) {\n const depRange1Parsed = semverUtils.parseRange(depRange1);\n dependencies1[depName] =\n (depRange1Parsed[0]?.operator || \"\") +\n (semver.minVersion(depRange2)?.version || depRange2);\n } else {\n reportError(\n `Invalid \"${depName}\" in ${type1}`,\n `\"${depRange1}\" should satisfies \"${depRange2}\" from \"${type2}\".`,\n false,\n true,\n );\n }\n }\n }\n}\n","import { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson, DependencyTypes } from \"../utils/packageTypes\";\n\nexport function checkNoDependencies(\n pkg: PackageJson,\n pkgPath: string,\n type: DependencyTypes = \"dependencies\",\n moveToSuggestion: DependencyTypes = \"devDependencies\",\n customCreateReportError = createReportError,\n): void {\n const pkgDependencies = pkg[type];\n if (!pkgDependencies) return;\n\n const reportError = customCreateReportError(\"No dependencies\", pkgPath);\n reportError(\n `Unexpected ${type}`,\n `you should move them in ${moveToSuggestion}`,\n );\n}\n","import type { GetDependencyPackageJson } from \"../utils/createGetDependencyPackageJson\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson } from \"../utils/packageTypes\";\n\nexport type CheckResolutionMessage = (\n depKey: string,\n resolutionExplainedMessage: string,\n checkMessageHelpers: {\n getDependencyPackageJson: GetDependencyPackageJson;\n },\n) => string | undefined;\n\nexport function checkResolutionsHasExplanation(\n pkg: PackageJson,\n pkgPathName: string,\n checkMessage: CheckResolutionMessage,\n getDependencyPackageJson: GetDependencyPackageJson,\n customCreateReportError = createReportError,\n): void {\n const pkgResolutions = pkg.resolutions || {};\n const pkgResolutionsExplained = pkg.resolutionsExplained || {};\n const reportError = customCreateReportError(\n \"Resolutions has explanation\",\n pkgPathName,\n );\n\n Object.keys(pkgResolutions).forEach((depKey) => {\n if (!pkgResolutionsExplained[depKey]) {\n reportError(`Missing \"${depKey}\" in resolutionsExplained.`);\n }\n });\n\n Object.keys(pkgResolutionsExplained).forEach((depKey) => {\n if (!pkgResolutions[depKey]) {\n reportError(\n `Found \"${depKey}\" in resolutionsExplained but not in resolutions.`,\n );\n } else {\n const error = checkMessage(depKey, pkgResolutionsExplained[depKey], {\n getDependencyPackageJson,\n });\n if (error) {\n reportError(\n `Invalid message for \"${depKey}\" in resolutionsExplained`,\n `${error}.`,\n );\n }\n }\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { PackageJson } from \"../utils/packageTypes\";\n\nexport interface CheckResolutionsVersionsMatchOptions {\n tryToAutoFix?: boolean;\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkResolutionsVersionsMatch(\n pkg: PackageJson,\n pkgPathName: string,\n {\n tryToAutoFix,\n customCreateReportError = createReportError,\n }: CheckResolutionsVersionsMatchOptions = {},\n): void {\n const pkgResolutions = pkg.resolutions || {};\n const reportError = customCreateReportError(\n \"Resolutions match other dependencies\",\n pkgPathName,\n );\n\n Object.entries(pkgResolutions).forEach(([resolutionKey, resolutionValue]) => {\n let depName = resolutionKey;\n let resolutionDepVersion = resolutionValue;\n if (resolutionValue.startsWith(\"patch:\")) {\n const matchResolutionInKey = /^(.+)@npm:(.+)$/.exec(resolutionKey);\n if (matchResolutionInKey) {\n [, depName, resolutionDepVersion] = matchResolutionInKey;\n }\n }\n ([\"dependencies\", \"devDependencies\"] as const).forEach((depType) => {\n const range = pkg?.[depType]?.[depName];\n\n if (!range) return;\n\n if (\n !semver.satisfies(resolutionDepVersion, range, {\n includePrerelease: true,\n })\n ) {\n if (tryToAutoFix) {\n pkg[depType]![depName] = resolutionDepVersion;\n } else {\n reportError(\n `Invalid \"${depName}\" in ${depType}`,\n `expecting \"${range}\" be \"${resolutionDepVersion}\" from resolutions.`,\n false,\n true,\n );\n }\n }\n });\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckSatisfiesVersionsOptions {\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersions(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n dependenciesRanges: Record,\n onlyWarnsForCheck?: OnlyWarnsForCheck,\n {\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsOptions = {},\n): void {\n const pkgDependencies = pkg[type] || {};\n const reportError = customCreateReportError(\n \"Satisfies Versions\",\n pkgPathName,\n );\n\n Object.entries(dependenciesRanges).forEach(([depKey, range]) => {\n const version = pkgDependencies[depKey];\n\n if (!version) {\n reportError(\n `Missing \"${depKey}\" in ${type}`,\n `should satisfies \"${range}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n } else {\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${depKey}\" in ${type}`,\n `\"${version}\" (in \"${depKey}\") should satisfies \"${range}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n );\n }\n }\n });\n}\n","import semver from \"semver\";\nimport type { ShouldHaveExactVersions } from \"../check-package\";\nimport { createReportError } from \"../utils/createReportError\";\nimport type { DependencyTypes, PackageJson } from \"../utils/packageTypes\";\nimport { changeOperator, getOperator } from \"../utils/semverUtils\";\nimport type { OnlyWarnsForCheck } from \"../utils/warnForUtils\";\n\nexport interface CheckSatisfiesVersionsFromDependencyOptions {\n tryToAutoFix?: boolean;\n shouldHaveExactVersions: ShouldHaveExactVersions;\n onlyWarnsForCheck?: OnlyWarnsForCheck;\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersionsFromDependency(\n pkg: PackageJson,\n pkgPathName: string,\n type: DependencyTypes,\n depKeys: string[],\n depPkg: PackageJson,\n depType: DependencyTypes,\n {\n tryToAutoFix,\n shouldHaveExactVersions,\n onlyWarnsForCheck,\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsFromDependencyOptions,\n): void {\n const pkgDependencies = pkg[type] || {};\n const dependencies = depPkg[depType] || {};\n\n const reportError = customCreateReportError(\n `Satisfies Versions from \"${depPkg.name}\"`,\n pkgPathName,\n );\n\n depKeys.forEach((depKey) => {\n const range = dependencies[depKey];\n\n if (!range) {\n reportError(\n `Unexpected missing dependency \"${depKey}\" in \"${depPkg.name}\"`,\n `config expects \"${depKey}\" in \"${depType}\" of \"${depPkg.name}\".`,\n undefined,\n false,\n );\n return;\n }\n\n const version = pkgDependencies[depKey];\n\n const getAutoFixIfExists = (): string | null | undefined => {\n const existingOperator = version ? getOperator(version) : null;\n const expectedOperator = (() => {\n if (existingOperator !== null) {\n return existingOperator;\n }\n return shouldHaveExactVersions(type) ? \"\" : null;\n })();\n\n return expectedOperator === \"\"\n ? semver.minVersion(range)?.version\n : changeOperator(range, expectedOperator);\n };\n\n const autoFix = (versionToApply: string): void => {\n pkg[type] = {\n ...pkg[type],\n [depKey]: versionToApply,\n };\n };\n\n if (!version) {\n const fix = getAutoFixIfExists();\n if (!fix || !tryToAutoFix) {\n reportError(\n `Missing \"${depKey}\" in \"${type}\" of \"${pkg.name}\"`,\n `should satisfies \"${range}\" from \"${depPkg.name}\" in \"${depType}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n !!fix,\n );\n } else {\n autoFix(fix);\n }\n } else {\n const minVersionOfVersion = semver.minVersion(version);\n if (\n !minVersionOfVersion ||\n !semver.satisfies(minVersionOfVersion, range, {\n includePrerelease: true,\n })\n ) {\n const fix = getAutoFixIfExists();\n if (!fix || !tryToAutoFix) {\n reportError(\n `Invalid \"${depKey}\" in \"${type}\" of \"${pkg.name}\"`,\n `\"${version}\" should satisfies \"${range}\" from \"${depPkg.name}\"'s \"${depType}\".`,\n onlyWarnsForCheck?.shouldWarnsFor(depKey),\n !!fix,\n );\n } else {\n autoFix(fix);\n }\n }\n }\n });\n}\n","import semver from \"semver\";\nimport { createReportError } from \"../utils/createReportError\";\nimport { getEntries } from \"../utils/object\";\nimport type { DependenciesRanges, PackageJson } from \"../utils/packageTypes\";\n\ninterface CheckSatisfiesVersionsInDependencyOptions {\n customCreateReportError?: typeof createReportError;\n}\n\nexport function checkSatisfiesVersionsInDependency(\n pkgPathName: string,\n depPkg: PackageJson,\n dependenciesRanges: DependenciesRanges,\n {\n customCreateReportError = createReportError,\n }: CheckSatisfiesVersionsInDependencyOptions = {},\n): void {\n const reportError = customCreateReportError(\n `Satisfies Versions In Dependency \"${depPkg.name}\"`,\n pkgPathName,\n );\n\n for (const [dependenciesType, dependenciesTypeRanges] of getEntries(\n dependenciesRanges,\n )) {\n if (!dependenciesTypeRanges) return;\n const dependencies = depPkg[dependenciesType];\n\n for (const [dependencyName, dependencyRange] of getEntries(\n dependenciesTypeRanges,\n )) {\n if (dependencyRange == null) {\n if (dependencies?.[dependencyName]) {\n reportError(\n `Invalid \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n \"it should not be present\",\n );\n }\n } else if (!dependencies) {\n reportError(\n `Missing \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependenciesType}\" is missing in \"${depPkg.name}\"`,\n );\n } else if (!dependencies[dependencyName]) {\n reportError(\n `Missing \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependencyName}\" is missing in ${dependenciesType}`,\n );\n } else if (\n !semver.satisfies(dependencies[dependencyName], dependencyRange, {\n includePrerelease: true,\n }) &&\n !semver.intersects(dependencies[dependencyName], dependencyRange, {\n includePrerelease: true,\n })\n ) {\n reportError(\n `Invalid \"${dependencyName}\" in ${dependenciesType} of \"${depPkg.name}\"`,\n `\"${dependencies[dependencyName]}\" does not satisfies \"${dependencyRange}\"`,\n );\n }\n }\n }\n}\n","import { readFileSync, writeFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolve as importResolve } from \"import-meta-resolve\";\nimport type { PackageJson } from \"./packageTypes\";\n\nexport function readPkgJson(packagePath: string): PackageJson {\n return JSON.parse(readFileSync(packagePath, \"utf8\")) as PackageJson;\n}\n\nexport function writePkgJson(packagePath: string, pkg: PackageJson): void {\n writeFileSync(packagePath, `${JSON.stringify(pkg, null, 2)}\\n`);\n}\n\n/** @internal */\nexport function internalLoadPackageJsonFromNodeModules(\n pkgDepName: string,\n pkgDirname: string,\n): PackageJson {\n const packageUrl = importResolve(\n `${pkgDepName}/package.json`,\n `file://${pkgDirname}/package.json`,\n );\n return readPkgJson(fileURLToPath(packageUrl));\n}\n","import type { PackageJson } from \"./packageTypes\";\nimport {\n internalLoadPackageJsonFromNodeModules,\n readPkgJson,\n} from \"./pkgJsonUtils\";\n\nexport type GetDependencyPackageJson = (pkgDepName: string) => PackageJson;\n\ntype NodeModulesPackagePathCache = Map;\n\ninterface CreateGetDependencyPackageJsonOptions {\n pkgDirname: string;\n nodeModulesPackagePathCache?: NodeModulesPackagePathCache;\n /** @internal */\n internalCustomLoadPackageJsonFromNodeModules?: typeof internalLoadPackageJsonFromNodeModules;\n /** @internal */\n internalReadPkgJson?: typeof readPkgJson;\n}\n\nexport function createGetDependencyPackageJson({\n pkgDirname,\n nodeModulesPackagePathCache = new Map(),\n internalCustomLoadPackageJsonFromNodeModules = internalLoadPackageJsonFromNodeModules,\n internalReadPkgJson = readPkgJson,\n}: CreateGetDependencyPackageJsonOptions): GetDependencyPackageJson {\n return (pkgDepName) => {\n const existing = nodeModulesPackagePathCache.get(pkgDepName);\n if (existing) return existing;\n let pkg: PackageJson;\n if (pkgDepName.startsWith(\".\")) {\n const packagePath = `${pkgDirname}/${pkgDepName}/package.json`;\n pkg = internalReadPkgJson(packagePath);\n } else {\n try {\n pkg = internalCustomLoadPackageJsonFromNodeModules(\n pkgDepName,\n pkgDirname,\n );\n } catch (error: unknown) {\n if (!(error instanceof Error)) throw error;\n\n if (\n (error as NodeJS.ErrnoException).code !==\n \"ERR_PACKAGE_PATH_NOT_EXPORTED\"\n ) {\n throw error;\n }\n\n const match = / in (.*[/\\\\]package\\.json)\\s+imported from/.exec(\n error.message,\n );\n\n if (match) {\n const [, matchPackageJson] = match;\n pkg = internalReadPkgJson(matchPackageJson);\n } else {\n throw error;\n }\n }\n }\n nodeModulesPackagePathCache.set(pkgDepName, pkg);\n return pkg;\n };\n}\n","import { getEntries } from \"./object\";\n\nexport type OnlyWarnsFor = string[];\n// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\nexport type OnlyWarnsForDependencyMapping = Record;\nexport type OnlyWarnsForOptionalDependencyMapping =\n | OnlyWarnsFor\n | OnlyWarnsForDependencyMapping\n | undefined;\n\nexport interface OnlyWarnsForCheck {\n configName: string;\n getNotWarnedFor: () => string[];\n shouldWarnsFor: (dependencyName: string) => boolean;\n}\n\nexport interface OnlyWarnsForMappingCheck {\n configName: string;\n getNotWarnedFor: () => Record;\n createFor: (dependencyName: string) => OnlyWarnsForCheck;\n}\n\nexport const createOnlyWarnsForArrayCheck = (\n configName: string,\n onlyWarnsFor: OnlyWarnsFor = [],\n): OnlyWarnsForCheck => {\n const notWarnedFor = new Set(onlyWarnsFor);\n return {\n configName,\n getNotWarnedFor: () => [...notWarnedFor],\n shouldWarnsFor(dependencyName) {\n if (onlyWarnsFor.includes(dependencyName)) {\n notWarnedFor.delete(dependencyName);\n return true;\n }\n return false;\n },\n };\n};\n\nconst isMapping = (\n onlyWarnsFor: OnlyWarnsForOptionalDependencyMapping,\n): onlyWarnsFor is OnlyWarnsForDependencyMapping => {\n return typeof onlyWarnsFor === \"object\" && !Array.isArray(onlyWarnsFor);\n};\n\nexport const createOnlyWarnsForMappingCheck = (\n configName: string,\n onlyWarnsFor: OnlyWarnsForOptionalDependencyMapping,\n): OnlyWarnsForMappingCheck => {\n if (isMapping(onlyWarnsFor)) {\n const notWarnedFor = Object.fromEntries(\n getEntries(onlyWarnsFor).map(([entryKey, entryValue]) => [\n entryKey,\n new Set(entryValue),\n ]),\n );\n return {\n configName,\n getNotWarnedFor: () =>\n Object.fromEntries(\n getEntries(notWarnedFor)\n .filter(([key, set]) => set.size > 0)\n .map(([key, set]) => [key, [...set]]),\n ),\n createFor(dependencyNameLevel1) {\n return {\n configName,\n getNotWarnedFor() {\n throw new Error(\"Invalid call to getNotWarnedFor()\");\n },\n shouldWarnsFor(dependencyName) {\n if (onlyWarnsFor[\"*\"]?.includes(dependencyName)) {\n notWarnedFor[\"*\"].delete(dependencyName);\n return true;\n }\n if (onlyWarnsFor[dependencyNameLevel1]?.includes(dependencyName)) {\n notWarnedFor[dependencyNameLevel1].delete(dependencyName);\n return true;\n }\n return false;\n },\n };\n },\n };\n }\n\n const arrayOnlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n configName,\n onlyWarnsFor,\n );\n return {\n configName,\n getNotWarnedFor: (): Record => {\n const notWarnedFor = arrayOnlyWarnsForCheck.getNotWarnedFor();\n if (notWarnedFor.length > 0) {\n return { \"*\": notWarnedFor };\n }\n return {};\n },\n createFor() {\n return {\n configName,\n getNotWarnedFor() {\n throw new Error(\"Invalid call to getNotWarnedFor()\");\n },\n shouldWarnsFor(dependencyName) {\n return arrayOnlyWarnsForCheck.shouldWarnsFor(dependencyName);\n },\n };\n },\n };\n};\n","import path from \"node:path\";\nimport util from \"node:util\";\nimport { checkDirectDuplicateDependencies } from \"./checks/checkDirectDuplicateDependencies\";\nimport { checkDirectPeerDependencies } from \"./checks/checkDirectPeerDependencies\";\nimport { checkExactVersions } from \"./checks/checkExactVersions\";\nimport { checkIdenticalVersions } from \"./checks/checkIdenticalVersions\";\nimport { checkIdenticalVersionsThanDependency } from \"./checks/checkIdenticalVersionsThanDependency\";\nimport { checkMinRangeSatisfies } from \"./checks/checkMinRangeSatisfies\";\nimport { checkNoDependencies } from \"./checks/checkNoDependencies\";\nimport type { CheckResolutionMessage } from \"./checks/checkResolutionsHasExplanation\";\nimport { checkResolutionsHasExplanation } from \"./checks/checkResolutionsHasExplanation\";\nimport { checkResolutionsVersionsMatch } from \"./checks/checkResolutionsVersionsMatch\";\nimport { checkSatisfiesVersions } from \"./checks/checkSatisfiesVersions\";\nimport { checkSatisfiesVersionsFromDependency } from \"./checks/checkSatisfiesVersionsFromDependency\";\nimport { checkSatisfiesVersionsInDependency } from \"./checks/checkSatisfiesVersionsInDependency\";\nimport type { GetDependencyPackageJson } from \"./utils/createGetDependencyPackageJson\";\nimport { createGetDependencyPackageJson } from \"./utils/createGetDependencyPackageJson\";\nimport { displayConclusion } from \"./utils/createReportError\";\nimport { getEntries } from \"./utils/object\";\nimport type {\n DependenciesRanges,\n DependencyName,\n DependencyTypes,\n PackageJson,\n} from \"./utils/packageTypes\";\nimport { readPkgJson, writePkgJson } from \"./utils/pkgJsonUtils\";\nimport type {\n OnlyWarnsForOptionalDependencyMapping,\n OnlyWarnsFor,\n OnlyWarnsForDependencyMapping,\n} from \"./utils/warnForUtils\";\nimport {\n createOnlyWarnsForArrayCheck,\n createOnlyWarnsForMappingCheck,\n} from \"./utils/warnForUtils\";\n\nexport interface CreateCheckPackageOptions {\n packageDirectoryPath?: string;\n isLibrary?: boolean | ((pkg: PackageJson) => boolean);\n /** @internal */\n internalWorkspacePkgDirectoryPath?: string;\n}\n\nexport interface CheckDirectPeerDependenciesOptions {\n missingOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n invalidOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n internalMissingConfigName?: string;\n internalInvalidConfigName?: string;\n}\n\nexport interface CheckDirectDuplicateDependenciesOptions {\n onlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n internalConfigName?: string;\n}\n\nexport interface OnlyWarnsForInPackageCheckPackageRecommendedOption {\n exactVersions: OnlyWarnsFor;\n}\n\nexport interface OnlyWarnsForInDependencyCheckPackageRecommendedOption {\n duplicateDirectDependency: OnlyWarnsFor;\n missingPeerDependency: OnlyWarnsFor;\n invalidPeerDependencyVersion: OnlyWarnsFor;\n}\n\nexport type OnlyWarnsForInDependenciesCheckPackageRecommendedOption = Record<\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/sort-type-constituents\n \"*\" | string,\n OnlyWarnsForInDependencyCheckPackageRecommendedOption\n>;\n\nexport interface CheckRecommendedOptions {\n /** default is true for libraries, false otherwise */\n allowRangeVersionsInDependencies?: boolean;\n onlyWarnsForInPackage?: OnlyWarnsForInPackageCheckPackageRecommendedOption;\n onlyWarnsForInDependencies?: OnlyWarnsForInDependenciesCheckPackageRecommendedOption;\n /** @internal */\n internalExactVersionsIgnore?: OnlyWarnsFor;\n /** function to check the value in the \"resolutionExplained\" key in package.json */\n checkResolutionMessage?: CheckResolutionMessage;\n}\n\nexport interface CheckExactVersionsOptions {\n allowRangeVersionsInDependencies?: boolean;\n onlyWarnsFor?: OnlyWarnsFor;\n /** @internal */\n internalExactVersionsIgnore?: OnlyWarnsFor;\n}\n\nexport interface CheckPackageApiRunOptions {\n /** @internal */\n skipDisplayConclusion?: boolean;\n}\n\nexport interface CheckPackageApi {\n run: (options?: CheckPackageApiRunOptions) => Promise;\n\n /** @internal */\n pkg: PackageJson;\n /** @internal */\n pkgDirname: string;\n /** @internal */\n pkgPathName: string;\n /** @internal */\n isPkgLibrary: boolean;\n /** @internal */\n getDependencyPackageJson: GetDependencyPackageJson;\n\n checkExactVersions: (options?: CheckExactVersionsOptions) => CheckPackageApi;\n\n checkResolutionsVersionsMatch: () => CheckPackageApi;\n\n checkExactDevVersions: (\n options?: CheckExactVersionsOptions,\n ) => CheckPackageApi;\n\n checkNoDependencies: (\n type?: DependencyTypes,\n moveToSuggestion?: DependencyTypes,\n ) => CheckPackageApi;\n\n /**\n * @example\n * ```\n * .checkDirectPeerDependencies({\n * invalidOnlyWarnsFor: ['semver'],\n * })\n * ```\n */\n checkDirectPeerDependencies: (\n options?: CheckDirectPeerDependenciesOptions,\n ) => CheckPackageApi;\n\n /**\n * @example\n * ```\n * .checkDirectDuplicateDependencies({\n * invalidOnlyWarnsFor: { '*': 'type-fest' },\n * })\n * ```\n */\n checkDirectDuplicateDependencies: (\n options?: CheckDirectDuplicateDependenciesOptions,\n ) => CheckPackageApi;\n\n checkResolutionsHasExplanation: (\n checkMessage?: CheckResolutionMessage,\n ) => CheckPackageApi;\n\n checkRecommended: (options?: CheckRecommendedOptions) => CheckPackageApi;\n\n /**\n * @example\n * Check that your package.json contains the same version of @babel/core than react-scripts, both in resolutions and devDependencies\n * ```\n * .checkIdenticalVersionsThanDependency('react-scripts', {\n * resolutions: ['@babel/core'],\n * devDependencies: ['@babel/core'],\n * })\n * ```\n */\n checkIdenticalVersionsThanDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n checkIdenticalVersionsThanDevDependencyOfDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies specifically satisfies the range passed in config\n *\n * @example\n * ```\n * .checkSatisfiesVersions({\n * devDependencies: {\n * eslint: '^8.0.0'\n * },\n * })\n * ```\n */\n checkSatisfiesVersions: (\n dependencies: Partial<\n Record>\n >,\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies specifically satisfies the range set in another dependencies\n * @example\n * ```\n * .checkSatisfiesVersionsFromDependency('@pob/eslint-config-typescript', {\n * devDependencies: [\n * '@typescript-eslint/eslint-plugin',\n * '@typescript-eslint/parser',\n * ],\n * })\n * ```\n */\n checkSatisfiesVersionsFromDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n checkSatisfiesVersionsInDevDependenciesOfDependency: (\n depName: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check that your package.json dependencies have the exact same version that another dependency also present in your package.json\n * @example\n * The react-dom version should match react, so this check will ensure it does\n * ```\n * .checkIdenticalVersions({\n * dependencies: {\n * react: {\n * dependencies: ['react-dom'],\n * devDependencies: ['react-test-renderer'],\n * },\n * },\n * })\n * ```\n */\n checkIdenticalVersions: (dependencies: {\n resolutions?: Record;\n dependencies?: Record;\n devDependencies?: Record;\n }) => CheckPackageApi;\n\n checkSatisfiesVersionsBetweenDependencies: (\n depName1: string,\n depName2: string,\n dependencies: {\n resolutions?: string[];\n dependencies?: string[];\n devDependencies?: string[];\n },\n ) => CheckPackageApi;\n\n /**\n * Check versions in a dependency\n * Also useable to check if a dependency is not present\n *\n * @example\n * Checking if `@lerna/version` has no dependency `@nrwl/devkit`\n * ```\n * .checkSatisfiesVersionsInDependency('@lerna/version', {\n * dependencies: {\n * '@nrwl/devkit': null,\n * },\n * })\n * ```\n */\n checkSatisfiesVersionsInDependency: (\n depName: string,\n dependenciesRanges: DependenciesRanges,\n ) => CheckPackageApi;\n\n checkMinRangeDependenciesSatisfiesDevDependencies: () => CheckPackageApi;\n checkMinRangePeerDependenciesSatisfiesDependencies: () => CheckPackageApi;\n}\n\nexport type ShouldHaveExactVersions = (depType: DependencyTypes) => boolean;\n\nexport function createCheckPackage({\n packageDirectoryPath = \".\",\n internalWorkspacePkgDirectoryPath,\n isLibrary = false,\n}: CreateCheckPackageOptions = {}): CheckPackageApi {\n const pkgDirname = path.resolve(packageDirectoryPath);\n const pkgPath = `${pkgDirname}/package.json`;\n const pkgPathName = `${packageDirectoryPath}/package.json`;\n const pkg = readPkgJson(pkgPath);\n const copyPkg: PackageJson = JSON.parse(JSON.stringify(pkg)) as PackageJson;\n const isPkgLibrary =\n typeof isLibrary === \"function\" ? isLibrary(pkg) : isLibrary;\n const shouldHaveExactVersions: ShouldHaveExactVersions = (depType) =>\n !isPkgLibrary ? true : depType === \"devDependencies\";\n\n let tryToAutoFix = false;\n\n if (process.argv.slice(2).includes(\"--fix\")) {\n tryToAutoFix = true;\n }\n\n const writePackageIfChanged = (): void => {\n if (!tryToAutoFix) return;\n if (util.isDeepStrictEqual(pkg, copyPkg)) return;\n writePkgJson(pkgPath, pkg);\n };\n\n const getDependencyPackageJson = createGetDependencyPackageJson({\n pkgDirname,\n });\n\n let runCalled = false;\n\n if (!internalWorkspacePkgDirectoryPath) {\n process.on(\"beforeExit\", () => {\n if (!runCalled) {\n throw new Error(\"Call .run() and await the result.\");\n }\n });\n }\n\n class Job {\n name: string;\n\n fn: () => Promise | void;\n\n constructor(name: string, fn: () => Promise | void) {\n this.name = name;\n this.fn = fn;\n }\n\n async run(): Promise {\n try {\n await this.fn();\n } catch (error) {\n throw new Error(`${this.name} failed: ${(error as Error).message}`);\n }\n }\n }\n\n const jobs: Job[] = [];\n\n return {\n async run({\n skipDisplayConclusion = false,\n }: CheckPackageApiRunOptions = {}) {\n runCalled = true;\n // TODO parallel\n for (const job of jobs) {\n await job.run();\n }\n writePackageIfChanged();\n if (!skipDisplayConclusion) {\n displayConclusion();\n }\n },\n\n pkg,\n pkgDirname,\n pkgPathName,\n isPkgLibrary,\n getDependencyPackageJson,\n checkExactVersions({\n onlyWarnsFor,\n internalExactVersionsIgnore,\n allowRangeVersionsInDependencies = true,\n } = {}) {\n jobs.push(\n new Job(this.checkExactVersions.name, async () => {\n const onlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n \"checkExactVersions.onlyWarnsFor\",\n onlyWarnsFor,\n );\n await checkExactVersions(\n pkg,\n pkgPathName,\n !allowRangeVersionsInDependencies\n ? [\"dependencies\", \"devDependencies\", \"resolutions\"]\n : [\"devDependencies\", \"resolutions\"],\n {\n onlyWarnsForCheck,\n internalExactVersionsIgnore,\n getDependencyPackageJson,\n tryToAutoFix,\n },\n );\n }),\n );\n return this;\n },\n\n checkResolutionsVersionsMatch() {\n checkResolutionsVersionsMatch(pkg, pkgPathName, {\n tryToAutoFix,\n });\n return this;\n },\n\n checkExactDevVersions({ onlyWarnsFor } = {}) {\n jobs.push(\n new Job(this.checkExactDevVersions.name, async () => {\n const onlyWarnsForCheck = createOnlyWarnsForArrayCheck(\n \"checkExactDevVersions.onlyWarnsFor\",\n onlyWarnsFor,\n );\n await checkExactVersions(pkg, pkgPathName, [\"devDependencies\"], {\n onlyWarnsForCheck,\n tryToAutoFix,\n getDependencyPackageJson,\n });\n }),\n );\n return this;\n },\n\n checkNoDependencies(\n type = \"dependencies\",\n moveToSuggestion = \"devDependencies\",\n ) {\n checkNoDependencies(pkg, pkgPathName, type, moveToSuggestion);\n return this;\n },\n\n checkDirectPeerDependencies({\n missingOnlyWarnsFor,\n invalidOnlyWarnsFor,\n internalMissingConfigName = \"missingOnlyWarnsFor\",\n internalInvalidConfigName = \"invalidOnlyWarnsFor\",\n } = {}) {\n jobs.push(\n new Job(this.checkDirectPeerDependencies.name, () => {\n const missingOnlyWarnsForCheck = createOnlyWarnsForMappingCheck(\n internalMissingConfigName,\n missingOnlyWarnsFor,\n );\n const invalidOnlyWarnsForCheck =\n internalInvalidConfigName === internalMissingConfigName\n ? missingOnlyWarnsForCheck\n : createOnlyWarnsForMappingCheck(\n internalInvalidConfigName,\n invalidOnlyWarnsFor,\n );\n checkDirectPeerDependencies(\n isPkgLibrary,\n pkg,\n pkgPathName,\n getDependencyPackageJson,\n missingOnlyWarnsForCheck,\n invalidOnlyWarnsForCheck,\n );\n }),\n );\n return this;\n },\n\n checkDirectDuplicateDependencies({\n onlyWarnsFor,\n internalConfigName = \"onlyWarnsFor\",\n } = {}) {\n jobs.push(\n new Job(this.checkDirectDuplicateDependencies.name, () => {\n checkDirectDuplicateDependencies(\n pkg,\n pkgPathName,\n isPkgLibrary,\n \"dependencies\",\n getDependencyPackageJson,\n createOnlyWarnsForMappingCheck(internalConfigName, onlyWarnsFor),\n );\n }),\n );\n return this;\n },\n\n checkResolutionsHasExplanation(\n checkMessage: CheckResolutionMessage = (depKey, message) => undefined,\n ) {\n checkResolutionsHasExplanation(\n pkg,\n pkgPathName,\n checkMessage,\n getDependencyPackageJson,\n );\n return this;\n },\n\n checkRecommended({\n onlyWarnsForInPackage,\n onlyWarnsForInDependencies,\n allowRangeVersionsInDependencies = isPkgLibrary,\n internalExactVersionsIgnore,\n checkResolutionMessage,\n } = {}) {\n let internalMissingPeerDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n let internalInvalidPeerDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n let internalDirectDuplicateDependenciesOnlyWarnsFor: OnlyWarnsForOptionalDependencyMapping =\n {};\n\n const exactVersionsOnlyWarnsFor =\n onlyWarnsForInPackage?.exactVersions || [];\n\n if (onlyWarnsForInDependencies) {\n internalDirectDuplicateDependenciesOnlyWarnsFor = {};\n internalMissingPeerDependenciesOnlyWarnsFor = {};\n internalInvalidPeerDependenciesOnlyWarnsFor = {};\n\n getEntries(onlyWarnsForInDependencies).forEach(\n ([dependencyNameOrSpecialKey, onlyWarnsForValue]) => {\n if (onlyWarnsForValue.duplicateDirectDependency) {\n (\n internalDirectDuplicateDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.duplicateDirectDependency;\n }\n if (onlyWarnsForValue.missingPeerDependency) {\n (\n internalMissingPeerDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.missingPeerDependency;\n }\n if (onlyWarnsForValue.invalidPeerDependencyVersion) {\n (\n internalInvalidPeerDependenciesOnlyWarnsFor as OnlyWarnsForDependencyMapping\n )[dependencyNameOrSpecialKey] =\n onlyWarnsForValue.invalidPeerDependencyVersion;\n }\n },\n );\n }\n\n this.checkExactVersions({\n allowRangeVersionsInDependencies,\n onlyWarnsFor: exactVersionsOnlyWarnsFor,\n internalExactVersionsIgnore,\n });\n\n this.checkResolutionsVersionsMatch();\n this.checkResolutionsHasExplanation(checkResolutionMessage);\n\n this.checkDirectPeerDependencies({\n missingOnlyWarnsFor: internalMissingPeerDependenciesOnlyWarnsFor,\n invalidOnlyWarnsFor: internalInvalidPeerDependenciesOnlyWarnsFor,\n internalMissingConfigName:\n \"onlyWarnsForInDependencies.missingPeerDependency\",\n internalInvalidConfigName:\n \"onlyWarnsForInDependencies.invalidPeerDependencyVersion\",\n });\n\n this.checkDirectDuplicateDependencies({\n onlyWarnsFor: internalDirectDuplicateDependenciesOnlyWarnsFor,\n internalConfigName:\n \"onlyWarnsForInDependencies.duplicateDirectDependency\",\n });\n\n if (isPkgLibrary) {\n this.checkMinRangeDependenciesSatisfiesDevDependencies();\n this.checkMinRangePeerDependenciesSatisfiesDependencies();\n }\n\n return this;\n },\n\n checkIdenticalVersionsThanDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkIdenticalVersionsThanDependency.name, () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n depPkg.dependencies,\n );\n }\n if (dependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n depPkg.dependencies,\n );\n }\n if (devDependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n depPkg.dependencies,\n );\n }\n }),\n );\n return this;\n },\n\n checkIdenticalVersionsThanDevDependencyOfDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsFromDependency.name, () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n depPkg.devDependencies,\n );\n }\n if (dependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n depPkg.devDependencies,\n );\n }\n if (devDependencies) {\n checkIdenticalVersionsThanDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n depPkg.devDependencies,\n );\n }\n }),\n );\n return this;\n },\n\n checkSatisfiesVersions(dependencies) {\n Object.entries(dependencies).forEach(\n ([dependencyType, dependenciesRanges]) => {\n checkSatisfiesVersions(\n pkg,\n pkgPathName,\n dependencyType as DependencyTypes,\n dependenciesRanges,\n );\n },\n );\n return this;\n },\n\n checkSatisfiesVersionsFromDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsFromDependency.name, () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n }),\n );\n return this;\n },\n\n checkSatisfiesVersionsInDevDependenciesOfDependency(\n depName,\n { resolutions, dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(\n this.checkSatisfiesVersionsInDevDependenciesOfDependency.name,\n () => {\n const depPkg = getDependencyPackageJson(depName);\n if (resolutions) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"resolutions\",\n resolutions,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg,\n \"devDependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n },\n ),\n );\n return this;\n },\n\n checkIdenticalVersions({ resolutions, dependencies, devDependencies }) {\n if (resolutions) {\n checkIdenticalVersions(pkg, pkgPathName, \"resolutions\", resolutions);\n }\n if (dependencies) {\n checkIdenticalVersions(pkg, pkgPathName, \"dependencies\", dependencies);\n }\n if (devDependencies) {\n checkIdenticalVersions(\n pkg,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n );\n }\n return this;\n },\n\n checkSatisfiesVersionsBetweenDependencies(\n depName1,\n depName2,\n { dependencies, devDependencies },\n ) {\n jobs.push(\n new Job(\n this.checkSatisfiesVersionsBetweenDependencies.name,\n async () => {\n const [depPkg1, depPkg2] = await Promise.all([\n getDependencyPackageJson(depName1),\n getDependencyPackageJson(depName2),\n ]);\n\n if (dependencies) {\n checkSatisfiesVersionsFromDependency(\n depPkg2,\n pkgPathName,\n \"dependencies\",\n dependencies,\n depPkg1,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n if (devDependencies) {\n checkSatisfiesVersionsFromDependency(\n depPkg2,\n pkgPathName,\n \"devDependencies\",\n devDependencies,\n depPkg1,\n \"dependencies\",\n { tryToAutoFix, shouldHaveExactVersions },\n );\n }\n },\n ),\n );\n return this;\n },\n\n checkSatisfiesVersionsInDependency(depName, dependenciesRanges) {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, () => {\n const depPkg = getDependencyPackageJson(depName);\n checkSatisfiesVersionsInDependency(\n pkgPathName,\n depPkg,\n dependenciesRanges,\n );\n }),\n );\n return this;\n },\n\n checkMinRangeDependenciesSatisfiesDevDependencies() {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, () => {\n checkMinRangeSatisfies(\n pkgPathName,\n pkg,\n \"dependencies\",\n \"devDependencies\",\n { tryToAutoFix },\n );\n }),\n );\n return this;\n },\n\n checkMinRangePeerDependenciesSatisfiesDependencies() {\n jobs.push(\n new Job(this.checkSatisfiesVersionsInDependency.name, () => {\n checkMinRangeSatisfies(\n pkgPathName,\n pkg,\n \"peerDependencies\",\n \"dependencies\",\n { tryToAutoFix },\n );\n }),\n );\n return this;\n },\n };\n}\n","import fs, { constants } from \"node:fs\";\nimport path from \"node:path\";\nimport type { Except } from \"type-fest\";\nimport type {\n CreateCheckPackageOptions,\n CheckPackageApi,\n OnlyWarnsForInDependenciesCheckPackageRecommendedOption,\n OnlyWarnsForInDependencyCheckPackageRecommendedOption,\n OnlyWarnsForInPackageCheckPackageRecommendedOption,\n} from \"./check-package\";\nimport { createCheckPackage } from \"./check-package\";\nimport { checkDuplicateDependencies } from \"./checks/checkDuplicateDependencies\";\nimport type { CheckResolutionMessage } from \"./checks/checkResolutionsHasExplanation\";\nimport {\n createReportError,\n displayConclusion,\n reportNotWarnedForMapping,\n} from \"./utils/createReportError\";\nimport type { PackageJson } from \"./utils/packageTypes\";\nimport type { OnlyWarnsForOptionalDependencyMapping } from \"./utils/warnForUtils\";\nimport { createOnlyWarnsForMappingCheck } from \"./utils/warnForUtils\";\n\ninterface OnlyWarnsForInMonorepoPackageCheckPackageRecommendedOption\n extends OnlyWarnsForInPackageCheckPackageRecommendedOption {\n duplicateDirectDependency: OnlyWarnsForInDependencyCheckPackageRecommendedOption[\"duplicateDirectDependency\"];\n}\n\ntype OnlyWarnsForInMonorepoPackagesCheckPackageRecommendedOption = Record<\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/sort-type-constituents\n \"*\" | string,\n OnlyWarnsForInMonorepoPackageCheckPackageRecommendedOption\n>;\n\ntype OnlyWarnsForInMonorepoPackagesDependenciesCheckPackageRecommendedOption =\n Record;\n\nexport interface CheckPackageWithWorkspacesRecommendedOptions {\n allowRangeVersionsInLibraries?: boolean;\n monorepoDirectDuplicateDependenciesOnlyWarnsFor?: OnlyWarnsForOptionalDependencyMapping;\n onlyWarnsForInRootPackage?: OnlyWarnsForInPackageCheckPackageRecommendedOption;\n onlyWarnsForInMonorepoPackages?: OnlyWarnsForInMonorepoPackagesCheckPackageRecommendedOption;\n onlyWarnsForInRootDependencies?: OnlyWarnsForInDependenciesCheckPackageRecommendedOption;\n onlyWarnsForInMonorepoPackagesDependencies?: OnlyWarnsForInMonorepoPackagesDependenciesCheckPackageRecommendedOption;\n checkResolutionMessage?: CheckResolutionMessage;\n}\n\nexport interface CheckPackageWithWorkspacesApi {\n run: () => Promise;\n\n checkRecommended: (\n options?: CheckPackageWithWorkspacesRecommendedOptions,\n ) => CheckPackageWithWorkspacesApi;\n\n forRoot: (\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n forEach: (\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n for: (\n id: string,\n callback: (checkPackage: CheckPackageApi) => void,\n ) => CheckPackageWithWorkspacesApi;\n}\n\ninterface CreateCheckPackageWithWorkspacesOptions\n extends Except {\n isLibrary?: (pkg: PackageJson) => boolean;\n}\n\nexport function createCheckPackageWithWorkspaces(\n createCheckPackageOptions: CreateCheckPackageWithWorkspacesOptions = {},\n): CheckPackageWithWorkspacesApi {\n const checkPackage = createCheckPackage({\n ...createCheckPackageOptions,\n isLibrary: false,\n });\n const { pkg, pkgDirname } = checkPackage;\n\n const pkgWorkspaces: string[] | undefined =\n pkg.workspaces && !Array.isArray(pkg.workspaces)\n ? pkg.workspaces.packages\n : pkg.workspaces;\n\n if (!pkgWorkspaces) {\n throw new Error('Package is missing \"workspaces\"');\n }\n\n const workspacePackagesPaths: string[] = [];\n\n const match = fs.globSync(pkgWorkspaces, { cwd: pkgDirname });\n for (const pathMatch of match) {\n try {\n fs.accessSync(path.join(pathMatch, \"package.json\"), constants.R_OK);\n } catch {\n console.log(\n `Ignored potential directory, no package.json found: ${pathMatch}`,\n );\n continue;\n }\n\n const subPkgDirectoryPath = path.relative(process.cwd(), pathMatch);\n workspacePackagesPaths.push(subPkgDirectoryPath);\n }\n\n const checksWorkspaces = new Map(\n workspacePackagesPaths.map((subPkgDirectoryPath) => {\n const checkPkg = createCheckPackage({\n ...createCheckPackageOptions,\n packageDirectoryPath: subPkgDirectoryPath,\n internalWorkspacePkgDirectoryPath:\n createCheckPackageOptions.packageDirectoryPath || \".\",\n });\n return [checkPkg.pkg.name, checkPkg];\n }),\n );\n\n return {\n async run() {\n for (const checksWorkspace of [\n checkPackage,\n ...checksWorkspaces.values(),\n ]) {\n await checksWorkspace.run({ skipDisplayConclusion: true });\n }\n\n displayConclusion();\n },\n\n checkRecommended({\n allowRangeVersionsInLibraries = true,\n onlyWarnsForInRootPackage,\n onlyWarnsForInMonorepoPackages,\n onlyWarnsForInRootDependencies,\n onlyWarnsForInMonorepoPackagesDependencies = {},\n monorepoDirectDuplicateDependenciesOnlyWarnsFor,\n checkResolutionMessage,\n } = {}) {\n checkPackage.checkNoDependencies();\n checkPackage.checkRecommended({\n onlyWarnsForInPackage: onlyWarnsForInRootPackage,\n onlyWarnsForInDependencies: onlyWarnsForInRootDependencies,\n checkResolutionMessage,\n });\n\n const monorepoDirectDuplicateDependenciesOnlyWarnsForCheck =\n createOnlyWarnsForMappingCheck(\n \"monorepoDirectDuplicateDependenciesOnlyWarnsFor\",\n monorepoDirectDuplicateDependenciesOnlyWarnsFor,\n );\n\n const previousCheckedWorkspaces = new Map();\n checksWorkspaces.forEach((checkSubPackage, id) => {\n checkSubPackage.checkRecommended({\n allowRangeVersionsInDependencies: checkSubPackage.isPkgLibrary\n ? allowRangeVersionsInLibraries\n : false,\n onlyWarnsForInPackage: onlyWarnsForInMonorepoPackages\n ? {\n ...onlyWarnsForInMonorepoPackages[\"*\"],\n ...onlyWarnsForInMonorepoPackages[checkSubPackage.pkg.name],\n }\n : undefined,\n onlyWarnsForInDependencies: {\n ...onlyWarnsForInMonorepoPackagesDependencies[\"*\"],\n ...onlyWarnsForInMonorepoPackagesDependencies[\n checkSubPackage.pkg.name\n ],\n },\n internalExactVersionsIgnore: [...checksWorkspaces.keys()],\n checkResolutionMessage,\n });\n\n const reportMonorepoDDDError = createReportError(\n \"Monorepo Direct Duplicate Dependencies\",\n checkSubPackage.pkgPathName,\n );\n // Root\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"devDependencies\",\n [\"dependencies\", \"devDependencies\"],\n pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n // previous packages\n previousCheckedWorkspaces.forEach((previousCheckSubPackage) => {\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"devDependencies\",\n [\"dependencies\", \"devDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"dependencies\",\n [\"dependencies\", \"devDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n checkDuplicateDependencies(\n reportMonorepoDDDError,\n checkSubPackage.pkg,\n checkSubPackage.isPkgLibrary,\n \"peerDependencies\",\n [\"peerDependencies\"],\n previousCheckSubPackage.pkg,\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck.createFor(\n checkSubPackage.pkg.name,\n ),\n );\n });\n\n previousCheckedWorkspaces.set(id, checkSubPackage);\n });\n reportNotWarnedForMapping(\n createReportError(\n \"Monorepo Direct Duplicate Dependencies\",\n checkPackage.pkgPathName,\n ),\n monorepoDirectDuplicateDependenciesOnlyWarnsForCheck,\n );\n\n return this;\n },\n\n forRoot(callback) {\n callback(checkPackage);\n return this;\n },\n\n forEach(callback) {\n checksWorkspaces.forEach((checkSubPackage) => {\n callback(checkSubPackage);\n });\n return this;\n },\n\n for(id, callback) {\n const packageCheck = checksWorkspaces.get(id);\n if (!packageCheck) {\n throw new Error(\n `Invalid package name: ${id}. Known package names: \"${[\n ...checksWorkspaces.keys(),\n ].join('\",\"')}\"`,\n );\n }\n callback(packageCheck);\n return this;\n },\n };\n}\n"],"names":["importResolve"],"mappings":";;;;;;;;;AAAO,MAAM,OAAU,GAAA,CAAmB,CACxC,KAAA,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAER,MAAM,UAAa,GAAA,CAAmB,CAC3C,KAAA,MAAA,CAAO,QAAQ,CAAC,CAAA;;ACYlB,IAAI,cAAgC,G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