chore: move overrides to pnpm-workspace.yaml

This commit is contained in:
Zoltan Kochan
2025-02-26 13:16:43 +01:00
parent 2d47f2ecff
commit d3591aae02
3 changed files with 29 additions and 33 deletions

View File

@@ -14,7 +14,6 @@ const CLI_PKG_NAME = 'pnpm'
export default async (workspaceDir: string) => { // eslint-disable-line
const workspaceManifest = await readWorkspaceManifest(workspaceDir)!
const rootManifest = loadJsonFile.sync<ProjectManifest>(path.join(workspaceDir, 'package.json'))
const pnpmManifest = loadJsonFile.sync<ProjectManifest>(path.join(workspaceDir, 'pnpm/package.json'))
const pnpmVersion = pnpmManifest!.version!
const pnpmMajorNumber = pnpmVersion.split('.')[0]
@@ -63,7 +62,7 @@ export default async (workspaceDir: string) => { // eslint-disable-line
}
} else {
manifest.pnpm = manifest.pnpm ?? {}
manifest.pnpm.overrides = { ...rootManifest.pnpm!.overrides }
manifest.pnpm.overrides = { ...workspaceManifest!.overrides }
for (const selector in manifest.pnpm.overrides) {
if (manifest.pnpm.overrides[selector] === 'catalog:') {
const { targetPkg } = parsePkgAndParentSelector(selector)

View File

@@ -61,36 +61,5 @@
},
"engines": {
"pnpm": ">=9.6.0"
},
"pnpm": {
"overrides": {
"@yarnpkg/fslib@2": "3",
"body-parser@<1.20.3": "^1.20.3",
"clipanion": "3.2.0-rc.6",
"cookie@<0.7.0": ">=0.7.0",
"cross-spawn@<7.0.5": ">=7.0.5",
"debug@<3.1.0": ">=3.1.0",
"express@<4.20.0": "^4.20.0",
"follow-redirects@<=1.15.5": ">=1.15.6",
"glob-parent@<5.1.2": ">=5.1.2",
"hosted-git-info@1": "catalog:",
"http-proxy-middleware@<2.0.7": "^2.0.7",
"istanbul-reports": "npm:@zkochan/istanbul-reports",
"js-yaml@^4.0.0": "catalog:",
"json5@<2.2.2": "catalog:",
"jsonwebtoken@<=8.5.1": ">=9.0.0",
"nopt@5": "npm:@pnpm/nopt@^0.2.1",
"path-to-regexp@<0.1.12": "^0.1.12",
"path-to-regexp@>=4.0.0 <6.3.0": ">=6.3.0",
"path-to-regexp@>=7.0.0 <8.0.0": ">=8.0.0",
"request": "npm:postman-request@2.88.1-postman.40",
"semver@<7.5.2": "catalog:",
"send@<0.19.0": "^0.19.0",
"serve-static@<1.16.0": "^1.16.0",
"socks@2": "^2.8.1",
"tough-cookie@<4.1.3": ">=4.1.3",
"verdaccio": "5.20.1",
"yaml@<2.2.2": ">=2.2.2"
}
}
}

View File

@@ -255,6 +255,34 @@ catalog:
write-pkg: 4.0.0
write-yaml-file: ^5.0.0
yaml-tag: 1.1.0
overrides:
"@yarnpkg/fslib@2": "3"
"body-parser@<1.20.3": "^1.20.3"
"clipanion": "3.2.0-rc.6"
"cookie@<0.7.0": ">=0.7.0"
"cross-spawn@<7.0.5": ">=7.0.5"
"debug@<3.1.0": ">=3.1.0"
"express@<4.20.0": "^4.20.0"
"follow-redirects@<=1.15.5": ">=1.15.6"
"glob-parent@<5.1.2": ">=5.1.2"
"hosted-git-info@1": "catalog:"
"http-proxy-middleware@<2.0.7": "^2.0.7"
"istanbul-reports": "npm:@zkochan/istanbul-reports"
"js-yaml@^4.0.0": "catalog:"
"json5@<2.2.2": "catalog:"
"jsonwebtoken@<=8.5.1": ">=9.0.0"
"nopt@5": "npm:@pnpm/nopt@^0.2.1"
"path-to-regexp@<0.1.12": "^0.1.12"
"path-to-regexp@>=4.0.0 <6.3.0": ">=6.3.0"
"path-to-regexp@>=7.0.0 <8.0.0": ">=8.0.0"
"request": "npm:postman-request@2.88.1-postman.40"
"semver@<7.5.2": "catalog:"
"send@<0.19.0": "^0.19.0"
"serve-static@<1.16.0": "^1.16.0"
"socks@2": "^2.8.1"
"tough-cookie@<4.1.3": ">=4.1.3"
"verdaccio": "5.20.1"
"yaml@<2.2.2": ">=2.2.2"
packageExtensions:
"@babel/parser":
peerDependencies: