@vltpkg/pick-manifest 1.0.0-rc.13 → 1.0.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -7,8 +7,9 @@ export type PickManifestOptions = {
7
7
  'node-version'?: string;
8
8
  os?: string;
9
9
  arch?: string;
10
+ libc?: string;
10
11
  };
11
- export type Manifestish = Pick<Manifest, 'engines' | 'os' | 'cpu'> | Pick<RevDocEntry, 'engines' | 'os' | 'cpu'>;
12
+ export type Manifestish = Pick<Manifest, 'engines' | 'os' | 'cpu' | 'libc'> | Pick<RevDocEntry, 'engines' | 'os' | 'cpu' | 'libc'>;
12
13
  export type Packumentish = Packument | RevDoc;
13
14
  export type PickManifestish<T extends Packumentish> = T extends RevDoc ? RevDocEntry : Manifest;
14
15
  export type ManiCheck<T extends Packumentish> = {
@@ -19,10 +20,34 @@ export type ManiCheck<T extends Packumentish> = {
19
20
  mani: PickManifestish<T>;
20
21
  };
21
22
  /**
22
- * Call with a manifest and the node version and process platform/arch
23
+ * Path to the ldd binary used for filesystem-based libc detection.
24
+ */
25
+ export declare const LDD_PATH = "/usr/bin/ldd";
26
+ /**
27
+ * Detect libc family by reading the /usr/bin/ldd file.
28
+ * Returns 'glibc', 'musl', null (detection ran but unknown)
29
+ * or undefined (file not readable).
30
+ */
31
+ export declare const getFamilyFromFilesystem: () => string | null | undefined;
32
+ /**
33
+ * Detect libc family by using process.report.getReport().
34
+ * Returns 'glibc', 'musl', or null if detection fails.
35
+ */
36
+ export declare const getFamilyFromReport: () => string | null;
37
+ /** Reset the cached libc detection result. For testing only. */
38
+ export declare const resetLibcCache: () => void;
39
+ /**
40
+ * Detect the libc family (glibc or musl) on Linux systems.
41
+ * First tries filesystem-based detection (/usr/bin/ldd),
42
+ * then falls back to process.report.
43
+ * Returns undefined on non-Linux platforms or if detection fails.
44
+ */
45
+ export declare const detectLibc: () => string | undefined;
46
+ /**
47
+ * Call with a manifest and the node version and process platform/arch/libc
23
48
  * to check whether a version is suitable for the current platform.
24
49
  */
25
- export declare const platformCheck: (mani: Manifestish, nodeVersion: Version | string, wantOs?: string, wantArch?: string) => boolean;
50
+ export declare const platformCheck: (mani: Manifestish, nodeVersion: Version | string, wantOs?: string, wantArch?: string, wantLibc?: string) => boolean;
26
51
  /**
27
52
  * Choose the most appropriate manifest from a packument.
28
53
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,EAEL,OAAO,EAER,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACZ,MAAM,eAAe,CAAA;AAItB,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,WAAW,GACnB,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,GACxC,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,CAAA;AAC/C,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,CAAA;AAC7C,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,YAAY,IAChD,CAAC,SAAS,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC3C,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,YAAY,IAAI;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EA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MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,YAAY,IAChD,CAAC,SAAS,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAC3C,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,YAAY,IAAI;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;CACzB,CAAA;AA6CD;;GAEG;AACH,eAAO,MAAM,QAAQ,iBAAiB,CAAA;AAEtC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAChC,MAAM,GACN,IAAI,GACJ,SAiBH,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,MAAM,GAAG,IA8B/C,CAAA;AASD,gEAAgE;AAChE,eAAO,MAAM,cAAc,QAAO,IAEjC,CAAA;AAGD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAO,MAAM,GAAG,SAwBtC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,SAClB,WAAW,eACJ,OAAO,GAAG,MAAM,WACpB,MAAM,aACJ,MAAM,aACN,MAAM,KAChB,OAqBF,CAAA;AAqBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,YAAY,EACjD,SAAS,EAAE,CAAC,EACZ,MAAM,EAAE,KAAK,GAAG,IAAI,GAAG,MAAM,EAC7B,IAAI,GAAE,mBAAwB,GAC7B,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAsJhC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { error } from '@vltpkg/error-cause';
2
2
  import { parse, Range, satisfies, Version, isRange, } from '@vltpkg/semver';
3
3
  import { Spec } from '@vltpkg/spec';
4
4
  import { isSpec } from '@vltpkg/spec/browser';
5
+ import { readFileSync } from 'node:fs';
5
6
  const parsedNodeVersion = Version.parse(process.version);
6
7
  const isBefore = (version, before, verTimes) => {
7
8
  if (!verTimes || !version || !before)
@@ -38,12 +39,107 @@ const checkList = (value, list) => {
38
39
  }
39
40
  return match || negated === list.length;
40
41
  };
42
+ /* c8 ignore start - Linux-only helper */
43
+ const isMusl = (file) => file.includes('libc.musl-') || file.includes('ld-musl-');
44
+ /* c8 ignore stop */
41
45
  /**
42
- * Call with a manifest and the node version and process platform/arch
46
+ * Path to the ldd binary used for filesystem-based libc detection.
47
+ */
48
+ export const LDD_PATH = '/usr/bin/ldd';
49
+ /**
50
+ * Detect libc family by reading the /usr/bin/ldd file.
51
+ * Returns 'glibc', 'musl', null (detection ran but unknown)
52
+ * or undefined (file not readable).
53
+ */
54
+ export const getFamilyFromFilesystem = () => {
55
+ /* c8 ignore start - Linux-only detection */
56
+ try {
57
+ const content = readFileSync(LDD_PATH, 'utf-8');
58
+ if (content.includes('musl')) {
59
+ return 'musl';
60
+ }
61
+ if (content.includes('GNU C Library')) {
62
+ return 'glibc';
63
+ }
64
+ // File exists but content unrecognized
65
+ return null;
66
+ }
67
+ catch {
68
+ // File not readable, return undefined to signal fallback needed
69
+ return undefined;
70
+ }
71
+ /* c8 ignore stop */
72
+ };
73
+ /**
74
+ * Detect libc family by using process.report.getReport().
75
+ * Returns 'glibc', 'musl', or null if detection fails.
76
+ */
77
+ export const getFamilyFromReport = () => {
78
+ /* c8 ignore start - Linux-only detection */
79
+ try {
80
+ const processReport = process.report;
81
+ const originalExclude = processReport.excludeNetwork === true;
82
+ processReport.excludeNetwork = true;
83
+ const report = processReport.getReport();
84
+ processReport.excludeNetwork = originalExclude;
85
+ if (report?.header?.glibcRuntimeVersion) {
86
+ return 'glibc';
87
+ }
88
+ if (Array.isArray(report?.sharedObjects) &&
89
+ report.sharedObjects.some(isMusl)) {
90
+ return 'musl';
91
+ }
92
+ }
93
+ catch {
94
+ // detection failed
95
+ }
96
+ return null;
97
+ /* c8 ignore stop */
98
+ };
99
+ /**
100
+ * Cached libc family detection result.
101
+ * null means detection ran but couldn't determine, undefined means not cached yet.
102
+ */
103
+ let cachedLibcFamily = undefined;
104
+ /* c8 ignore start - test helper */
105
+ /** Reset the cached libc detection result. For testing only. */
106
+ export const resetLibcCache = () => {
107
+ cachedLibcFamily = undefined;
108
+ };
109
+ /* c8 ignore stop */
110
+ /**
111
+ * Detect the libc family (glibc or musl) on Linux systems.
112
+ * First tries filesystem-based detection (/usr/bin/ldd),
113
+ * then falls back to process.report.
114
+ * Returns undefined on non-Linux platforms or if detection fails.
115
+ */
116
+ export const detectLibc = () => {
117
+ /* c8 ignore start - Linux-only detection */
118
+ // Return cached result if available (null means detection ran but failed)
119
+ if (cachedLibcFamily !== undefined) {
120
+ return cachedLibcFamily ?? undefined;
121
+ }
122
+ // libc checks only work on linux
123
+ if (process.platform !== 'linux') {
124
+ cachedLibcFamily = null;
125
+ return undefined;
126
+ }
127
+ // Try filesystem detection first
128
+ let family = getFamilyFromFilesystem();
129
+ // If filesystem detection didn't work, fall back to process.report
130
+ if (!family) {
131
+ family = getFamilyFromReport();
132
+ }
133
+ cachedLibcFamily = family;
134
+ return family ?? undefined;
135
+ /* c8 ignore stop */
136
+ };
137
+ /**
138
+ * Call with a manifest and the node version and process platform/arch/libc
43
139
  * to check whether a version is suitable for the current platform.
44
140
  */
45
- export const platformCheck = (mani, nodeVersion, wantOs, wantArch) => {
46
- const { engines, os, cpu } = mani;
141
+ export const platformCheck = (mani, nodeVersion, wantOs, wantArch, wantLibc) => {
142
+ const { engines, os, cpu, libc } = mani;
47
143
  if (engines) {
48
144
  const { node } = engines;
49
145
  if (node && !satisfies(nodeVersion, node, true)) {
@@ -54,16 +150,28 @@ export const platformCheck = (mani, nodeVersion, wantOs, wantArch) => {
54
150
  return false;
55
151
  if (wantArch && !checkList(wantArch, cpu))
56
152
  return false;
153
+ // libc checks only apply when the package specifies libc requirements
154
+ if (libc) {
155
+ /* c8 ignore start - system specific */
156
+ // if wantLibc is not provided, detect it
157
+ const libcFamily = wantLibc ?? detectLibc();
158
+ // if libc can't be determined, fail the check (can't install libc-specific packages)
159
+ if (!libcFamily)
160
+ return false;
161
+ if (!checkList(libcFamily, libc))
162
+ return false;
163
+ /* c8 ignore stop */
164
+ }
57
165
  return true;
58
166
  };
59
- const versionOk = (packument, version, nodeVersion, os, arch, before) => {
167
+ const versionOk = (packument, version, nodeVersion, os, arch, libc, before) => {
60
168
  const mani = packument.versions[version];
61
169
  /* c8 ignore next */
62
170
  if (!mani)
63
171
  return false;
64
172
  const { time } = packument;
65
173
  return (isBefore(version, before, time) &&
66
- platformCheck(mani, nodeVersion, os, arch));
174
+ platformCheck(mani, nodeVersion, os, arch, libc));
67
175
  };
68
176
  /**
69
177
  * Choose the most appropriate manifest from a packument.
@@ -73,10 +181,12 @@ const versionOk = (packument, version, nodeVersion, os, arch, before) => {
73
181
  * is fine.
74
182
  */
75
183
  export function pickManifest(packument, wanted, opts = {}) {
76
- const { tag = 'latest', before, 'node-version': nodeVersion, os = process.platform, arch = process.arch, } = opts;
184
+ const { tag = 'latest', before, 'node-version': nodeVersion, os = process.platform, arch = process.arch, libc, } = opts;
77
185
  const nv = !nodeVersion ? parsedNodeVersion : Version.parse(nodeVersion);
186
+ // detect libc if not provided
187
+ const libcFamily = libc ?? detectLibc();
78
188
  // cast since 'time' might not be present on minified packuments
79
- const { name, time: verTimes, versions = {}, 'dist-tags': distTags = {}, } = packument;
189
+ const { name, time: verTimes, versions, 'dist-tags': distTags, } = packument;
80
190
  const time = before && verTimes ? +new Date(before) : Infinity;
81
191
  let range = undefined;
82
192
  let spec = undefined;
@@ -106,7 +216,8 @@ export function pickManifest(packument, wanted, opts = {}) {
106
216
  // we use that. Otherwise, we get the highest precedence version
107
217
  // prior to the dist-tag.
108
218
  const mani = versions[ver];
109
- if (mani && versionOk(packument, ver, nv, os, arch, time)) {
219
+ if (mani &&
220
+ versionOk(packument, ver, nv, os, arch, libcFamily, time)) {
110
221
  return mani;
111
222
  }
112
223
  else {
@@ -122,7 +233,7 @@ export function pickManifest(packument, wanted, opts = {}) {
122
233
  const defTagVersion = defaultVer ? Version.parse(defaultVer) : undefined;
123
234
  if (defaultVer &&
124
235
  (range.isAny || defTagVersion?.satisfies(range)) &&
125
- versionOk(packument, defaultVer, nv, os, arch, time)) {
236
+ versionOk(packument, defaultVer, nv, os, arch, libcFamily, time)) {
126
237
  return versions[defaultVer];
127
238
  }
128
239
  // ok, actually have to scan the list
@@ -143,7 +254,7 @@ export function pickManifest(packument, wanted, opts = {}) {
143
254
  const mc = {
144
255
  version,
145
256
  deprecated: !!mani.deprecated,
146
- platform: platformCheck(mani, nv, os, arch),
257
+ platform: platformCheck(mani, nv, os, arch, libcFamily),
147
258
  prerelease: !!version.prerelease?.length,
148
259
  mani,
149
260
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,GACR,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAQ7C,MAAM,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AAwBxD,MAAM,QAAQ,GAAG,CACf,OAAe,EACf,MAAe,EACf,QAAiC,EACxB,EAAE;IACX,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IACjD,MAAM,IAAI,GAAG,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAA;IACzC,OAAO,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAA;AAC7C,CAAC,CAAA;AAED,M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rD,CAAC;QACH,CAAC;aAAM,IAAI,EAAE,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,EAAE,CAAC;YAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;gBACnB,KAAK,GAAG,EAAE,CAAA;gBACV,oBAAoB;gBACpB,aAAa,GAAG,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,UAAU,KAAK,EAAE,CAAC,UAAU,EAAE,CAAC;YAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;gBACnB,KAAK,GAAG,EAAE,CAAA;gBACV,oBAAoB;gBACpB,aAAa,GAAG,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;aAAM,IAAI,aAAa,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,KAAK,GAAG,EAAE,CAAA;YACV,aAAa,GAAG,IAAI,CAAA;QACtB,CAAC;aAAM,IACL,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;YACrC,CAAC,aAAa,EACd,CAAC;YACD,KAAK,GAAG,EAAE,CAAA;QACZ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,EAAE,IAAI,CAAA;AACpB,CAAC","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport {\n parse,\n Range,\n satisfies,\n Version,\n isRange,\n} from '@vltpkg/semver'\nimport { Spec } from '@vltpkg/spec'\nimport { isSpec } from '@vltpkg/spec/browser'\nimport type {\n Manifest,\n Packument,\n RevDoc,\n RevDocEntry,\n} from '@vltpkg/types'\n\nconst parsedNodeVersion = Version.parse(process.version)\n\nexport type PickManifestOptions = {\n tag?: string\n before?: Date | number | string\n 'node-version'?: string\n os?: string\n arch?: string\n}\n\nexport type Manifestish =\n | Pick<Manifest, 'engines' | 'os' | 'cpu'>\n | Pick<RevDocEntry, 'engines' | 'os' | 'cpu'>\nexport type Packumentish = Packument | RevDoc\nexport type PickManifestish<T extends Packumentish> =\n T extends RevDoc ? RevDocEntry : Manifest\nexport type ManiCheck<T extends Packumentish> = {\n version: Version\n deprecated: boolean\n platform: boolean\n prerelease: boolean\n mani: PickManifestish<T>\n}\n\nconst isBefore = (\n version: string,\n before?: number,\n verTimes?: Record<string, string>,\n): boolean => {\n if (!verTimes || !version || !before) return true\n const time = version && verTimes[version]\n return !!time && Date.parse(time) <= before\n}\n\nconst checkList = (value: string, list?: string[] | string) => {\n if (typeof list === 'string') {\n list = [list]\n }\n // invalid list is equivalent to 'any'\n if (!Array.isArray(list)) return true\n if (list.length === 1 && list[0] === 'any') {\n return true\n }\n // match none of the negated values, and at least one of the\n // non-negated values, if any are present.\n let negated = 0\n let match = false\n for (const entry of list) {\n const negate = entry.startsWith('!')\n const test = negate ? entry.slice(1) : entry\n if (negate) {\n negated++\n if (value === test) {\n return false\n }\n } else {\n match = match || value === test\n }\n }\n return match || negated === list.length\n}\n\n/**\n * Call with a manifest and the node version and process platform/arch\n * to check whether a version is suitable for the current platform.\n */\nexport const platformCheck = (\n mani: Manifestish,\n nodeVersion: Version | string,\n wantOs?: string,\n wantArch?: string,\n): boolean => {\n const { engines, os, cpu } = mani\n if (engines) {\n const { node } = engines\n if (node && !satisfies(nodeVersion, node, true)) {\n return false\n }\n }\n if (wantOs && !checkList(wantOs, os)) return false\n if (wantArch && !checkList(wantArch, cpu)) return false\n return true\n}\n\nconst versionOk = (\n packument: Packumentish,\n version: string,\n nodeVersion: Version,\n os: string,\n arch: string,\n before?: number,\n) => {\n const mani = packument.versions[version]\n /* c8 ignore next */\n if (!mani) return false\n const { time } = packument\n return (\n isBefore(version, before, time) &&\n platformCheck(mani, nodeVersion, os, arch)\n )\n}\n\n/**\n * Choose the most appropriate manifest from a packument.\n *\n * If `before` is set in the options, then the packument MUST\n * be a full non-minified Packument object. Otherwise, a minified packument\n * is fine.\n */\nexport function pickManifest<T extends Packumentish>(\n packument: T,\n wanted: Range | Spec | string,\n opts: PickManifestOptions = {},\n): PickManifestish<T> | undefined {\n const {\n tag = 'latest',\n before,\n 'node-version': nodeVersion,\n os = process.platform,\n arch = process.arch,\n } = opts\n const nv =\n !nodeVersion ? parsedNodeVersion : Version.parse(nodeVersion)\n\n // cast since 'time' might not be present on minified packuments\n const {\n name,\n time: verTimes,\n versions = {},\n 'dist-tags': distTags = {},\n } = packument\n\n const time = before && verTimes ? +new Date(before) : Infinity\n let range: Range | undefined = undefined\n let spec: Spec | undefined = undefined\n if (typeof wanted === 'object') {\n if (isSpec(wanted)) {\n const f = wanted.final\n range = f.range\n spec = f\n } else if (isRange(wanted)) {\n range = wanted\n }\n } else {\n spec = Spec.parse(`${name}@${wanted}`).final\n range = spec.range\n }\n\n if (!range) {\n if (!spec?.distTag) {\n throw error(\n 'Only dist-tag or semver range specs are supported',\n { spec },\n )\n }\n // if there is an explicit dist tag, we must get that version.\n const ver = distTags[spec.distTag]\n if (!ver) return undefined\n // if the version in the dist-tags is before the before date, then\n // we use that. Otherwise, we get the highest precedence version\n // prior to the dist-tag.\n const mani = versions[ver]\n if (mani && versionOk(packument, ver, nv, os, arch, time)) {\n return mani as PickManifestish<T>\n } else {\n range = new Range(`<=${ver}`)\n }\n }\n\n if (range.isAny) range = new Range('*', true)\n\n // if the range is *, then we prefer the 'latest' if available\n // but skip this if it should be avoided, in that case we have\n // to try a little harder.\n const defaultVer = distTags[tag]\n const defTagVersion =\n defaultVer ? Version.parse(defaultVer) : undefined\n if (\n defaultVer &&\n (range.isAny || defTagVersion?.satisfies(range)) &&\n versionOk(packument, defaultVer, nv, os, arch, time)\n ) {\n return versions[defaultVer] as PickManifestish<T>\n }\n\n // ok, actually have to scan the list\n const entries = Object.entries(versions) as [\n string,\n PickManifestish<T>,\n ][]\n\n if (!entries.length) {\n return undefined\n }\n\n let found: ManiCheck<T> | undefined = undefined\n let foundIsDefTag = false\n\n for (const [ver, mani] of entries) {\n if (time && verTimes && !isBefore(ver, time, verTimes)) {\n continue\n }\n const version = parse(ver)\n if (!version?.satisfies(range)) {\n continue\n }\n const mc = {\n version,\n deprecated: !!mani.deprecated,\n platform: platformCheck(mani, nv, os, arch),\n prerelease: !!version.prerelease?.length,\n mani,\n }\n if (!found) {\n found = mc\n if (defTagVersion?.equals(found.version)) {\n foundIsDefTag = true\n }\n continue\n }\n\n const mok = !mc.deprecated && mc.platform\n const fok = !found.deprecated && found.platform\n\n if (mok !== fok) {\n if (mok) {\n found = mc\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (mc.platform !== found.platform) {\n if (mc.platform) {\n found = mc\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (mc.deprecated !== found.deprecated) {\n if (!mc.deprecated) {\n found = mc\n /* c8 ignore next */\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (found.prerelease !== mc.prerelease) {\n if (!mc.prerelease) {\n found = mc\n /* c8 ignore next */\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (defTagVersion?.equals(mc.version)) {\n found = mc\n foundIsDefTag = true\n } else if (\n mc.version.greaterThan(found.version) &&\n !foundIsDefTag\n ) {\n found = mc\n }\n }\n return found?.mani\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,GACR,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAO7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,iBAAiB,GAAG,OAAO,CAAC,KAA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AAE,CAAA;YACV,aAAa,GAAG,IAAI,CAAA;QACtB,CAAC;aAAM,IACL,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;YACrC,CAAC,aAAa,EACd,CAAC;YACD,KAAK,GAAG,EAAE,CAAA;QACZ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,EAAE,IAAI,CAAA;AACpB,CAAC","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport {\n parse,\n Range,\n satisfies,\n Version,\n isRange,\n} from '@vltpkg/semver'\nimport { Spec } from '@vltpkg/spec'\nimport { isSpec } from '@vltpkg/spec/browser'\nimport type {\n Manifest,\n Packument,\n RevDoc,\n RevDocEntry,\n} from '@vltpkg/types'\nimport { readFileSync } from 'node:fs'\n\nconst parsedNodeVersion = Version.parse(process.version)\n\nexport type PickManifestOptions = {\n tag?: string\n before?: Date | number | string\n 'node-version'?: string\n os?: string\n arch?: string\n libc?: string\n}\n\nexport type Manifestish =\n | Pick<Manifest, 'engines' | 'os' | 'cpu' | 'libc'>\n | Pick<RevDocEntry, 'engines' | 'os' | 'cpu' | 'libc'>\nexport type Packumentish = Packument | RevDoc\nexport type PickManifestish<T extends Packumentish> =\n T extends RevDoc ? RevDocEntry : Manifest\nexport type ManiCheck<T extends Packumentish> = {\n version: Version\n deprecated: boolean\n platform: boolean\n prerelease: boolean\n mani: PickManifestish<T>\n}\n\nconst isBefore = (\n version: string,\n before?: number,\n verTimes?: Record<string, string>,\n): boolean => {\n if (!verTimes || !version || !before) return true\n const time = version && verTimes[version]\n return !!time && Date.parse(time) <= before\n}\n\nconst checkList = (value: string, list?: string[] | string) => {\n if (typeof list === 'string') {\n list = [list]\n }\n // invalid list is equivalent to 'any'\n if (!Array.isArray(list)) return true\n if (list.length === 1 && list[0] === 'any') {\n return true\n }\n // match none of the negated values, and at least one of the\n // non-negated values, if any are present.\n let negated = 0\n let match = false\n for (const entry of list) {\n const negate = entry.startsWith('!')\n const test = negate ? entry.slice(1) : entry\n if (negate) {\n negated++\n if (value === test) {\n return false\n }\n } else {\n match = match || value === test\n }\n }\n return match || negated === list.length\n}\n\n/* c8 ignore start - Linux-only helper */\nconst isMusl = (file: string) =>\n file.includes('libc.musl-') || file.includes('ld-musl-')\n/* c8 ignore stop */\n\n/**\n * Path to the ldd binary used for filesystem-based libc detection.\n */\nexport const LDD_PATH = '/usr/bin/ldd'\n\n/**\n * Detect libc family by reading the /usr/bin/ldd file.\n * Returns 'glibc', 'musl', null (detection ran but unknown)\n * or undefined (file not readable).\n */\nexport const getFamilyFromFilesystem = ():\n | string\n | null\n | undefined => {\n /* c8 ignore start - Linux-only detection */\n try {\n const content = readFileSync(LDD_PATH, 'utf-8')\n if (content.includes('musl')) {\n return 'musl'\n }\n if (content.includes('GNU C Library')) {\n return 'glibc'\n }\n // File exists but content unrecognized\n return null\n } catch {\n // File not readable, return undefined to signal fallback needed\n return undefined\n }\n /* c8 ignore stop */\n}\n\n/**\n * Detect libc family by using process.report.getReport().\n * Returns 'glibc', 'musl', or null if detection fails.\n */\nexport const getFamilyFromReport = (): string | null => {\n /* c8 ignore start - Linux-only detection */\n try {\n const processReport = process.report as {\n excludeNetwork?: boolean\n getReport: () => unknown\n }\n const originalExclude = processReport.excludeNetwork === true\n processReport.excludeNetwork = true\n const report = processReport.getReport() as\n | {\n header?: { glibcRuntimeVersion?: string }\n sharedObjects?: string[]\n }\n | undefined\n processReport.excludeNetwork = originalExclude\n if (report?.header?.glibcRuntimeVersion) {\n return 'glibc'\n }\n if (\n Array.isArray(report?.sharedObjects) &&\n report.sharedObjects.some(isMusl)\n ) {\n return 'musl'\n }\n } catch {\n // detection failed\n }\n return null\n /* c8 ignore stop */\n}\n\n/**\n * Cached libc family detection result.\n * null means detection ran but couldn't determine, undefined means not cached yet.\n */\nlet cachedLibcFamily: string | null | undefined = undefined\n\n/* c8 ignore start - test helper */\n/** Reset the cached libc detection result. For testing only. */\nexport const resetLibcCache = (): void => {\n cachedLibcFamily = undefined\n}\n/* c8 ignore stop */\n\n/**\n * Detect the libc family (glibc or musl) on Linux systems.\n * First tries filesystem-based detection (/usr/bin/ldd),\n * then falls back to process.report.\n * Returns undefined on non-Linux platforms or if detection fails.\n */\nexport const detectLibc = (): string | undefined => {\n /* c8 ignore start - Linux-only detection */\n // Return cached result if available (null means detection ran but failed)\n if (cachedLibcFamily !== undefined) {\n return cachedLibcFamily ?? undefined\n }\n\n // libc checks only work on linux\n if (process.platform !== 'linux') {\n cachedLibcFamily = null\n return undefined\n }\n\n // Try filesystem detection first\n let family = getFamilyFromFilesystem()\n\n // If filesystem detection didn't work, fall back to process.report\n if (!family) {\n family = getFamilyFromReport()\n }\n\n cachedLibcFamily = family\n return family ?? undefined\n /* c8 ignore stop */\n}\n\n/**\n * Call with a manifest and the node version and process platform/arch/libc\n * to check whether a version is suitable for the current platform.\n */\nexport const platformCheck = (\n mani: Manifestish,\n nodeVersion: Version | string,\n wantOs?: string,\n wantArch?: string,\n wantLibc?: string,\n): boolean => {\n const { engines, os, cpu, libc } = mani\n if (engines) {\n const { node } = engines\n if (node && !satisfies(nodeVersion, node, true)) {\n return false\n }\n }\n if (wantOs && !checkList(wantOs, os)) return false\n if (wantArch && !checkList(wantArch, cpu)) return false\n // libc checks only apply when the package specifies libc requirements\n if (libc) {\n /* c8 ignore start - system specific */\n // if wantLibc is not provided, detect it\n const libcFamily = wantLibc ?? detectLibc()\n // if libc can't be determined, fail the check (can't install libc-specific packages)\n if (!libcFamily) return false\n if (!checkList(libcFamily, libc)) return false\n /* c8 ignore stop */\n }\n return true\n}\n\nconst versionOk = (\n packument: Packumentish,\n version: string,\n nodeVersion: Version,\n os: string,\n arch: string,\n libc: string | undefined,\n before?: number,\n) => {\n const mani = packument.versions[version]\n /* c8 ignore next */\n if (!mani) return false\n const { time } = packument\n return (\n isBefore(version, before, time) &&\n platformCheck(mani, nodeVersion, os, arch, libc)\n )\n}\n\n/**\n * Choose the most appropriate manifest from a packument.\n *\n * If `before` is set in the options, then the packument MUST\n * be a full non-minified Packument object. Otherwise, a minified packument\n * is fine.\n */\nexport function pickManifest<T extends Packumentish>(\n packument: T,\n wanted: Range | Spec | string,\n opts: PickManifestOptions = {},\n): PickManifestish<T> | undefined {\n const {\n tag = 'latest',\n before,\n 'node-version': nodeVersion,\n os = process.platform,\n arch = process.arch,\n libc,\n } = opts\n const nv =\n !nodeVersion ? parsedNodeVersion : Version.parse(nodeVersion)\n // detect libc if not provided\n const libcFamily = libc ?? detectLibc()\n\n // cast since 'time' might not be present on minified packuments\n const {\n name,\n time: verTimes,\n versions,\n 'dist-tags': distTags,\n } = packument\n\n const time = before && verTimes ? +new Date(before) : Infinity\n let range: Range | undefined = undefined\n let spec: Spec | undefined = undefined\n if (typeof wanted === 'object') {\n if (isSpec(wanted)) {\n const f = wanted.final\n range = f.range\n spec = f\n } else if (isRange(wanted)) {\n range = wanted\n }\n } else {\n spec = Spec.parse(`${name}@${wanted}`).final\n range = spec.range\n }\n\n if (!range) {\n if (!spec?.distTag) {\n throw error(\n 'Only dist-tag or semver range specs are supported',\n { spec },\n )\n }\n // if there is an explicit dist tag, we must get that version.\n const ver = distTags[spec.distTag]\n if (!ver) return undefined\n // if the version in the dist-tags is before the before date, then\n // we use that. Otherwise, we get the highest precedence version\n // prior to the dist-tag.\n const mani = versions[ver]\n if (\n mani &&\n versionOk(packument, ver, nv, os, arch, libcFamily, time)\n ) {\n return mani as PickManifestish<T>\n } else {\n range = new Range(`<=${ver}`)\n }\n }\n\n if (range.isAny) range = new Range('*', true)\n\n // if the range is *, then we prefer the 'latest' if available\n // but skip this if it should be avoided, in that case we have\n // to try a little harder.\n const defaultVer = distTags[tag]\n const defTagVersion =\n defaultVer ? Version.parse(defaultVer) : undefined\n if (\n defaultVer &&\n (range.isAny || defTagVersion?.satisfies(range)) &&\n versionOk(packument, defaultVer, nv, os, arch, libcFamily, time)\n ) {\n return versions[defaultVer] as PickManifestish<T>\n }\n\n // ok, actually have to scan the list\n const entries = Object.entries(versions) as [\n string,\n PickManifestish<T>,\n ][]\n\n if (!entries.length) {\n return undefined\n }\n\n let found: ManiCheck<T> | undefined = undefined\n let foundIsDefTag = false\n\n for (const [ver, mani] of entries) {\n if (time && verTimes && !isBefore(ver, time, verTimes)) {\n continue\n }\n const version = parse(ver)\n if (!version?.satisfies(range)) {\n continue\n }\n const mc = {\n version,\n deprecated: !!mani.deprecated,\n platform: platformCheck(mani, nv, os, arch, libcFamily),\n prerelease: !!version.prerelease?.length,\n mani,\n }\n if (!found) {\n found = mc\n if (defTagVersion?.equals(found.version)) {\n foundIsDefTag = true\n }\n continue\n }\n\n const mok = !mc.deprecated && mc.platform\n const fok = !found.deprecated && found.platform\n\n if (mok !== fok) {\n if (mok) {\n found = mc\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (mc.platform !== found.platform) {\n if (mc.platform) {\n found = mc\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (mc.deprecated !== found.deprecated) {\n if (!mc.deprecated) {\n found = mc\n /* c8 ignore next */\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (found.prerelease !== mc.prerelease) {\n if (!mc.prerelease) {\n found = mc\n /* c8 ignore next */\n foundIsDefTag = !!defTagVersion?.equals(mc.version)\n }\n } else if (defTagVersion?.equals(mc.version)) {\n found = mc\n foundIsDefTag = true\n } else if (\n mc.version.greaterThan(found.version) &&\n !foundIsDefTag\n ) {\n found = mc\n }\n }\n return found?.mani\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/pick-manifest",
3
3
  "description": "Choose a manifest from a packument",
4
- "version": "1.0.0-rc.13",
4
+ "version": "1.0.0-rc.15",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -9,10 +9,10 @@
9
9
  },
10
10
  "author": "vlt technology inc. <support@vlt.sh> (http://vlt.sh)",
11
11
  "dependencies": {
12
- "@vltpkg/error-cause": "1.0.0-rc.13",
13
- "@vltpkg/semver": "1.0.0-rc.13",
14
- "@vltpkg/types": "1.0.0-rc.13",
15
- "@vltpkg/spec": "1.0.0-rc.13"
12
+ "@vltpkg/error-cause": "1.0.0-rc.15",
13
+ "@vltpkg/semver": "1.0.0-rc.15",
14
+ "@vltpkg/spec": "1.0.0-rc.15",
15
+ "@vltpkg/types": "1.0.0-rc.15"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@eslint/js": "^9.39.1",