Skip to content

Commit

Permalink
feat: support libc field for package.json (#4605)
Browse files Browse the repository at this point in the history
close #4454
  • Loading branch information
fireairforce committed May 10, 2022
1 parent 325ed5c commit 52b0576
Show file tree
Hide file tree
Showing 23 changed files with 471 additions and 43 deletions.
9 changes: 9 additions & 0 deletions .changeset/red-feet-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@pnpm/cli-utils": patch
"@pnpm/filter-lockfile": patch
"@pnpm/lockfile-file": patch
"@pnpm/package-is-installable": patch
"@pnpm/resolve-dependencies": patch
---

feat: support libc filed
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"hosted-git-info@4": "npm:@zkochan/hosted-git-info@^4.0.2",
"http-errors": "^1.7.3",
"istanbul-reports": "npm:@zkochan/istanbul-reports",
"js-yaml@^4.0.0": "npm:@zkochan/js-yaml@0.0.5",
"js-yaml@^4.0.0": "npm:@zkochan/js-yaml@0.0.6",
"lodash@<4.17.19": "^4.17.9",
"nopt@5": "npm:@pnpm/nopt@^0.2.1",
"pkg-fetch": "3.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/cli-utils/src/packageIsInstallable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function packageIsInstallable (
engines?: WantedEngine
cpu?: string[]
os?: string[]
libc?: string[]
},
opts: {
engineStrict?: boolean
Expand Down
1 change: 1 addition & 0 deletions packages/exportable-manifest/src/overridePublishConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const PUBLISH_CONFIG_WHITELIST = new Set([
// These are useful to hide in order to avoid warnings during local development
'os',
'cpu',
'libc',
// https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions
'typesVersions',
])
Expand Down
3 changes: 2 additions & 1 deletion packages/filter-lockfile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"@types/ramda": "0.27.39",
"tempy": "^1.0.0",
"write-yaml-file": "^4.2.0",
"yaml-tag": "1.1.0"
"yaml-tag": "1.1.0",
"detect-libc": "^2.0.1"
},
"dependencies": {
"@pnpm/constants": "workspace:6.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function pkgAllDeps (
cpu: pkgSnapshot.cpu,
engines: pkgSnapshot.engines,
os: pkgSnapshot.os,
libc: pkgSnapshot.libc,
}
// TODO: depPath is not the package ID. Should be fixed
installable = opts.includeIncompatiblePackages || packageIsInstallable(pkgSnapshot.id ?? depPath, pkg, {
Expand Down

0 comments on commit 52b0576

Please sign in to comment.