@gjsify/cli 0.36.0 → 0.38.0

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.
Files changed (122) hide show
  1. package/dist/cli.gjs.mjs +169 -169
  2. package/lib/actions/build.d.ts +7 -0
  3. package/lib/actions/build.js +18 -3
  4. package/lib/bundler-pick.js +61 -87
  5. package/lib/cli-fail.d.ts +4 -7
  6. package/lib/cli-fail.js +29 -55
  7. package/lib/commands/affected.js +161 -286
  8. package/lib/commands/install.d.ts +63 -66
  9. package/lib/commands/install.js +372 -536
  10. package/lib/config.d.ts +14 -0
  11. package/lib/config.js +18 -1
  12. package/lib/templates/install.mjs.tmpl +164 -75
  13. package/lib/types/cli-build-options.d.ts +33 -67
  14. package/lib/types/command.d.ts +9 -12
  15. package/lib/types/config-data.d.ts +137 -221
  16. package/lib/utils/auth-npmrc.d.ts +5 -10
  17. package/lib/utils/auth-npmrc.js +11 -21
  18. package/lib/utils/bin-shim.d.ts +40 -25
  19. package/lib/utils/bin-shim.js +51 -26
  20. package/lib/utils/clear-targets.d.ts +8 -11
  21. package/lib/utils/clear-targets.js +22 -29
  22. package/lib/utils/copy-targets.d.ts +13 -19
  23. package/lib/utils/copy-targets.js +31 -44
  24. package/lib/utils/dep-aggregation.d.ts +7 -15
  25. package/lib/utils/dep-aggregation.js +9 -22
  26. package/lib/utils/detect-native-packages.d.ts +89 -122
  27. package/lib/utils/detect-native-packages.js +119 -169
  28. package/lib/utils/dir-link.d.ts +29 -48
  29. package/lib/utils/dir-link.js +33 -56
  30. package/lib/utils/discover-showcases.d.ts +6 -7
  31. package/lib/utils/discover-showcases.js +11 -15
  32. package/lib/utils/dlx-cache.d.ts +29 -38
  33. package/lib/utils/dlx-cache.js +53 -63
  34. package/lib/utils/force-exit.d.ts +0 -3
  35. package/lib/utils/force-exit.js +13 -24
  36. package/lib/utils/gi-search-path.d.ts +16 -24
  37. package/lib/utils/gi-search-path.js +54 -82
  38. package/lib/utils/gjs-bundle-guard.d.ts +5 -13
  39. package/lib/utils/gjs-bundle-guard.js +35 -57
  40. package/lib/utils/gjs-source-escape.d.ts +2 -2
  41. package/lib/utils/gjs-source-escape.js +21 -39
  42. package/lib/utils/gjsify-shim.d.ts +17 -20
  43. package/lib/utils/gjsify-shim.js +80 -120
  44. package/lib/utils/html-entry.d.ts +8 -12
  45. package/lib/utils/html-entry.js +19 -28
  46. package/lib/utils/install-backend-native.d.ts +123 -161
  47. package/lib/utils/install-backend-native.js +536 -737
  48. package/lib/utils/install-backend.d.ts +42 -57
  49. package/lib/utils/install-backend.js +16 -21
  50. package/lib/utils/install-cache-fs.d.ts +10 -15
  51. package/lib/utils/install-cache-fs.js +18 -26
  52. package/lib/utils/install-lock.d.ts +5 -6
  53. package/lib/utils/install-lock.js +46 -65
  54. package/lib/utils/install-packument-cache.d.ts +27 -33
  55. package/lib/utils/install-packument-cache.js +44 -57
  56. package/lib/utils/install-progress.d.ts +2 -9
  57. package/lib/utils/install-progress.js +14 -39
  58. package/lib/utils/install-tarball-cache.d.ts +14 -20
  59. package/lib/utils/install-tarball-cache.js +41 -59
  60. package/lib/utils/library-output.d.ts +9 -22
  61. package/lib/utils/library-output.js +19 -37
  62. package/lib/utils/load-npmrc.d.ts +5 -6
  63. package/lib/utils/load-npmrc.js +18 -27
  64. package/lib/utils/node-bundle-guard.d.ts +4 -8
  65. package/lib/utils/node-bundle-guard.js +21 -35
  66. package/lib/utils/node-script.js +40 -53
  67. package/lib/utils/node-version.d.ts +5 -14
  68. package/lib/utils/node-version.js +15 -24
  69. package/lib/utils/normalize-bundler-options.d.ts +7 -11
  70. package/lib/utils/normalize-bundler-options.js +24 -42
  71. package/lib/utils/npm-oidc.d.ts +23 -37
  72. package/lib/utils/npm-oidc.js +28 -53
  73. package/lib/utils/npm-otp-cache.d.ts +4 -4
  74. package/lib/utils/npm-otp-cache.js +20 -25
  75. package/lib/utils/npm-otp.d.ts +20 -30
  76. package/lib/utils/npm-otp.js +32 -51
  77. package/lib/utils/onboard-probe.d.ts +7 -13
  78. package/lib/utils/onboard-probe.js +16 -27
  79. package/lib/utils/parse-spec.d.ts +3 -3
  80. package/lib/utils/parse-spec.js +4 -5
  81. package/lib/utils/pkg-json-edit.d.ts +7 -12
  82. package/lib/utils/pkg-json-edit.js +13 -26
  83. package/lib/utils/pkg-json.d.ts +11 -18
  84. package/lib/utils/pkg-json.js +19 -28
  85. package/lib/utils/prefixed-output.d.ts +3 -4
  86. package/lib/utils/prefixed-output.js +13 -19
  87. package/lib/utils/prompt.d.ts +3 -4
  88. package/lib/utils/prompt.js +14 -18
  89. package/lib/utils/publish-diagnose.d.ts +11 -16
  90. package/lib/utils/publish-diagnose.js +15 -28
  91. package/lib/utils/publish-headers.d.ts +7 -11
  92. package/lib/utils/publish-headers.js +36 -65
  93. package/lib/utils/publishable-packages.d.ts +4 -6
  94. package/lib/utils/publishable-packages.js +14 -18
  95. package/lib/utils/resolve-gjs-entry.d.ts +5 -8
  96. package/lib/utils/resolve-gjs-entry.js +10 -27
  97. package/lib/utils/resolve-npm-package.d.ts +6 -11
  98. package/lib/utils/resolve-npm-package.js +29 -63
  99. package/lib/utils/resolve-plugin-by-name.d.ts +11 -19
  100. package/lib/utils/resolve-plugin-by-name.js +9 -14
  101. package/lib/utils/run-gjs.d.ts +16 -21
  102. package/lib/utils/run-gjs.js +31 -56
  103. package/lib/utils/run-lifecycle-script.d.ts +5 -9
  104. package/lib/utils/run-lifecycle-script.js +23 -42
  105. package/lib/utils/run-node.d.ts +21 -33
  106. package/lib/utils/run-node.js +43 -64
  107. package/lib/utils/runtimes.d.ts +25 -35
  108. package/lib/utils/runtimes.js +34 -46
  109. package/lib/utils/spawn.d.ts +32 -48
  110. package/lib/utils/spawn.js +51 -84
  111. package/lib/utils/stdin.d.ts +2 -2
  112. package/lib/utils/stdin.js +10 -25
  113. package/lib/utils/suggest.d.ts +6 -7
  114. package/lib/utils/suggest.js +8 -10
  115. package/lib/utils/system-gi.d.ts +36 -27
  116. package/lib/utils/system-gi.js +85 -114
  117. package/lib/utils/trust-registry.d.ts +4 -8
  118. package/lib/utils/trust-registry.js +7 -15
  119. package/lib/utils/win32-command.d.ts +8 -14
  120. package/lib/utils/win32-command.js +29 -43
  121. package/lib/utils/workspace-root.js +7 -12
  122. package/package.json +18 -18
@@ -1,16 +1,8 @@
1
- // Workspace-aware dependency aggregation for `gjsify upgrade`.
2
- //
3
- // Given a flat list of per-workspace dependency declarations, group them by
4
- // package name and surface inconsistencies (the same package declared at
5
- // different version ranges across workspaces). Used by:
6
- //
7
- // - `gjsify upgrade` interactive table — shows fan-out (count of workspaces
8
- // declaring the dep) and flags inconsistent declarations with `⚠`.
9
- // - `gjsify upgrade --align` — offline mode that detects inconsistencies
10
- // and proposes a single range (the highest semver-satisfying one) without
11
- // hitting the registry.
12
- // - `gjsify upgrade --check` — CI gate that exits non-zero when any
13
- // inconsistency exists.
1
+ // Workspace-aware dependency aggregation for `gjsify upgrade`: group per-workspace
2
+ // declarations by package name and surface inconsistencies — the same package
3
+ // declared at different ranges across workspaces. Drives the interactive table's
4
+ // fan-out column, `--align` (propose one range offline, no registry hit) and
5
+ // `--check` (CI gate, non-zero on any inconsistency).
14
6
  import { compare, parse } from '@gjsify/semver';
15
7
  /** Local `gt` shim: `@gjsify/semver` exports `compare` returning -1|0|1. */
16
8
  function semverGt(a, b) {
@@ -22,9 +14,8 @@ function semverGt(a, b) {
22
14
  }
23
15
  }
24
16
  /**
25
- * Group a flat list of `DepDeclaration`s by dep name. Each group has the full
26
- * occurrence list plus pre-computed aggregates (consensus range, highest
27
- * declared version) so callers don't have to re-scan.
17
+ * Group a flat list of `DepDeclaration`s by dep name, pre-computing the aggregates
18
+ * so no caller has to re-scan the occurrences.
28
19
  */
29
20
  export function groupByDependency(decls) {
30
21
  const map = new Map();
@@ -48,8 +39,7 @@ export function groupByDependency(decls) {
48
39
  }
49
40
  }
50
41
  }
51
- // Second pass: dominantRange = the range with the most occurrences;
52
- // ties resolve by highest semver, then by lexicographic order.
42
+ // dominantRange = most occurrences; ties break on highest semver, then lexically.
53
43
  for (const g of map.values()) {
54
44
  const counts = new Map();
55
45
  for (const occ of g.occurrences) {
@@ -77,10 +67,7 @@ export function groupByDependency(decls) {
77
67
  export function isInconsistent(group) {
78
68
  return group.declaredRanges.size > 1;
79
69
  }
80
- /**
81
- * Filter to just the inconsistent groups (>1 distinct range across workspaces).
82
- * Convenience wrapper for `--align` and `--check` modes.
83
- */
70
+ /** The inconsistent groups only — what `--align` and `--check` operate on. */
84
71
  export function findInconsistencies(groups) {
85
72
  return groups.filter(isInconsistent);
86
73
  }
@@ -6,38 +6,32 @@ export interface NativePackage {
6
6
  prebuildsDir: string;
7
7
  }
8
8
  /**
9
- * Which C library an artifact is built against. npm's own `libc` manifest field
10
- * uses exactly these two tokens, and it is LINUX-ONLY there — every other OS has
11
- * one C library, so the axis does not exist off Linux and is `null` there rather
12
- * than defaulted to something.
9
+ * Which C library an artifact is built against. npm's own `libc` manifest field uses
10
+ * exactly these two tokens and is LINUX-ONLY — every other OS has one C library, so
11
+ * the axis is `null` off Linux rather than defaulted to something.
13
12
  */
14
13
  export type HostLibc = 'glibc' | 'musl';
15
14
  /** The host target a resolution is performed for. Defaults to the running process. */
16
15
  export interface HostTarget {
17
- /** `process.platform` value — `linux` | `darwin` | `win32` | … */
18
16
  platform?: string;
19
- /** `process.arch` value — `x64` | `arm64` | `ppc64` | `s390x` | `riscv64` | … */
20
17
  arch?: string;
21
18
  /**
22
- * Host C library, or `undefined`/`null` when the axis does not apply (any
23
- * non-Linux OS) or could not be determined. Both non-values mean the same
24
- * thing to the resolver: behave exactly as before the libc axis existed —
25
- * never offer a `-musl` directory. That is deliberately the conservative
26
- * direction: an unsuffixed directory is the DEFAULT build, so a host we
27
- * cannot classify still resolves what it always did.
19
+ * Host C library, or `undefined`/`null` when the axis does not apply (non-Linux)
20
+ * or could not be determined. Both non-values mean the same thing: never offer a
21
+ * `-musl` directory, exactly as before the axis existed. Conservative on purpose —
22
+ * an unsuffixed directory is the DEFAULT build, so an unclassifiable host still
23
+ * resolves what it always did.
28
24
  */
29
25
  libc?: HostLibc | null;
30
26
  }
31
27
  /**
32
- * Environment a GJS process needs so `gi://Gjsify…` imports resolve against
33
- * the detected prebuilds. `GI_TYPELIB_PATH` is universal (girepository reads
34
- * it on every OS); the *library* search path is whatever the host's dynamic
35
- * loader actually consults, which is a different variable per OS — see
28
+ * Environment a GJS process needs so `gi://Gjsify…` imports resolve against the
29
+ * detected prebuilds. `GI_TYPELIB_PATH` is universal (girepository reads it on every
30
+ * OS); the *library* search path is a different variable per OS — see
36
31
  * {@link buildNativeEnv}.
37
32
  *
38
- * The index signature exists for the Windows case, where the key is the host's
39
- * own `PATH` spelling (`Path` on a stock Windows env block) rather than a
40
- * fixed literal.
33
+ * The index signature exists for Windows, where the key is the host's own `PATH`
34
+ * spelling (`Path` on a stock env block) rather than a fixed literal.
41
35
  */
42
36
  export interface NativeEnv {
43
37
  GI_TYPELIB_PATH: string;
@@ -55,35 +49,27 @@ export interface NativeEnv {
55
49
  [key: string]: string | undefined;
56
50
  }
57
51
  /**
58
- * Split a prebuild target into its three axes.
59
- *
60
- * TOKEN GRAMMAR: `<os>-<arch>[-musl]`.
61
- *
62
- * An UNSUFFIXED token means "the default build". Note what it does NOT mean: it
63
- * is not a synonym for glibc. For an artifact that links `libc.so.6` the default
64
- * build IS glibc; for one that links only GLib/GObject/GIO (plus GnuTLS resp.
65
- * GStreamer) it is libc-AGNOSTIC and loads against whatever libc the host's GLib
66
- * was built for. The directory name cannot express that difference and does not
67
- * need to: the package's own `libc` field answers it at install time, and the
68
- * `prebuild-libc` conformance rule verifies that field against the binaries
69
- * (`readElfNeeded` — the DT_NEEDED list is where the answer actually lives).
70
- *
71
- * DELIBERATELY NOT CHOSEN: renaming every existing `linux-<arch>` directory to
72
- * `linux-<arch>-gnu`, which is what a symmetric grammar would demand. It would
73
- * rename ~60 COMMITTED directories, and — per `status/open-todos.md`'s
74
- * "Nine fixtures re-implement the prebuild-target name instead of importing it"
75
- * — nine e2e fixtures COMPOSE the token themselves instead of importing it, so
76
- * the rename would have to be swept by hand in two shapes (the literal path and
77
- * the computed one), which is exactly how the last vocabulary change missed
78
- * `tests/e2e/self-host/run.mjs`. The asymmetric grammar buys the same
79
- * expressiveness for zero renames, and the cost — that "unsuffixed" is not
80
- * self-describing — is paid by a field that is machine-checked anyway.
81
- *
82
- * A `-musl` suffix is only meaningful when the OS half is `linux`: musl targets
83
- * no other kernel, and npm's own `libc` field is documented as Linux-only. A
84
- * `darwin-arm64-musl` token is therefore not a target with an odd name, it is a
85
- * malformed one, and this returns `libc: null` for it so callers report the
86
- * token rather than half-honouring it.
52
+ * Split a prebuild target into its three axes. TOKEN GRAMMAR: `<os>-<arch>[-musl]`.
53
+ *
54
+ * An UNSUFFIXED token means "the default build", NOT a synonym for glibc. For an
55
+ * artifact linking `libc.so.6` the default build IS glibc; for one linking only
56
+ * GLib/GObject/GIO it is libc-AGNOSTIC and loads against whatever libc the host's GLib
57
+ * was built for. The directory name cannot express that and does not need to — the
58
+ * package's own `libc` field answers it at install time, verified against the binaries'
59
+ * DT_NEEDED list by the `prebuild-libc` conformance rule.
60
+ *
61
+ * DELIBERATELY NOT CHOSEN: the symmetric grammar, renaming every `linux-<arch>` to
62
+ * `linux-<arch>-gnu`. That is ~60 committed directories plus nine e2e fixtures that
63
+ * COMPOSE the token instead of importing it (open-todos: "Nine fixtures re-implement
64
+ * the prebuild-target name instead of importing it"), so the sweep would have to be
65
+ * done by hand in two shapes — the literal path and the computed one — which is
66
+ * exactly how the last vocabulary change missed `tests/e2e/self-host/run.mjs`. The
67
+ * asymmetric grammar is equally expressive for zero renames.
68
+ *
69
+ * A `-musl` suffix is only meaningful when the OS half is `linux`: musl targets no
70
+ * other kernel and npm's `libc` field is documented Linux-only. `darwin-arm64-musl` is
71
+ * therefore malformed rather than oddly named, and this returns `libc: null` for it so
72
+ * callers report the token instead of half-honouring it.
87
73
  */
88
74
  export declare function parsePlatformToken(token: string): {
89
75
  os: string;
@@ -91,83 +77,64 @@ export declare function parsePlatformToken(token: string): {
91
77
  libc: HostLibc | null;
92
78
  };
93
79
  /**
94
- * Canonical `<os>-<arch>[-musl]` form — the node spelling — so `linux-x86_64`
95
- * and `linux-x64` compare equal. Only the *arch* half is normalised: the OS half
96
- * is always a `process.platform` token (`linux`/`darwin`/`win32`), which has no
97
- * competing spelling, and the libc half has exactly one spelling by
98
- * construction.
99
- *
100
- * A `-musl` suffix on a non-Linux token is preserved verbatim rather than
101
- * dropped. Silently canonicalising `darwin-arm64-musl` to `darwin-arm64` would
102
- * make a malformed declaration compare EQUAL to a valid one, so the audit that
103
- * rejects it would never see it — the same class of bug as folding the legacy
104
- * uname spelling on a WRITE path.
80
+ * Canonical `<os>-<arch>[-musl]` (node spelling) so `linux-x86_64` and `linux-x64`
81
+ * compare equal. Only the *arch* half is normalised — the OS half is always a
82
+ * `process.platform` token with no competing spelling, and the libc half has exactly
83
+ * one spelling by construction.
84
+ *
85
+ * A `-musl` suffix on a non-Linux token is preserved rather than dropped: silently
86
+ * canonicalising `darwin-arm64-musl` to `darwin-arm64` would make a malformed
87
+ * declaration compare EQUAL to a valid one, so the audit that rejects it would never
88
+ * see it.
105
89
  */
106
90
  export declare function canonicalPlatformToken(token: string): string;
107
91
  /**
108
- * The target tokens that describe THIS host, most-specific first — the WRITE-side
109
- * vocabulary.
110
- *
111
- * This is the single definition of the musl preference order, and three callers
112
- * share it so it cannot drift: the directory probe ({@link prebuildDirCandidates}),
113
- * the per-platform sibling package probe ({@link platformPackageName}), and
114
- * `scripts/stage-prebuild.mjs`, which must stage a musl build into
115
- * `linux-x64-musl/` and never into `linux-x64/`.
116
- *
117
- * On a musl host the suffixed token comes FIRST and the unsuffixed one stays as a
118
- * fallback: an unsuffixed directory is the default build, which for the
119
- * libc-agnostic bridges (they record no `libc.so.6` at all) genuinely does load
120
- * on musl. On glibc the `-musl` token is not offered at all — a musl artifact
121
- * cannot load against glibc, so probing for it could only ever produce a
122
- * false positive.
123
- *
124
- * @param platform `process.platform` value.
125
- * @param arch `process.arch` value.
126
- * @param libc host C library; `undefined`/`null` behaves as glibc (see
127
- * {@link HostTarget.libc} for why that is the safe default).
92
+ * The target tokens describing THIS host, most-specific first — the WRITE-side
93
+ * vocabulary, and the SINGLE definition of the musl preference order. Three callers
94
+ * share it so it cannot drift: the directory probe ({@link prebuildDirCandidates}), the
95
+ * companion-package probe ({@link platformPackageName}), and `scripts/stage-prebuild.mjs`,
96
+ * which must stage a musl build into `linux-x64-musl/` and never into `linux-x64/`.
97
+ *
98
+ * On a musl host the suffixed token comes FIRST with the unsuffixed one as fallback,
99
+ * because an unsuffixed directory is the default build and the libc-agnostic bridges
100
+ * (no `libc.so.6` recorded at all) genuinely do load on musl. On glibc the `-musl`
101
+ * token is not offered at all — a musl artifact cannot load against glibc, so probing
102
+ * for it could only produce a false positive.
103
+ *
104
+ * @param libc `undefined`/`null` behaves as glibc — see {@link HostTarget.libc}.
128
105
  */
129
106
  export declare function hostPlatformTokens(platform: string, arch: string, libc?: HostLibc | null): string[];
130
107
  /**
131
108
  * The prebuild directory names to probe for a host, most-specific first.
132
109
  *
133
- * The canonical name is `${process.platform}-${process.arch}` — `linux-x64`,
134
- * `linux-arm64`, `darwin-arm64`, `win32-x64`. Every package in the release
135
- * train declares it (`gjsify.platforms`), `scripts/stage-prebuild.mjs` is the
136
- * only thing that creates it, and `scripts/audit-runtimes.mjs --check` rejects
137
- * any other spelling, so the three can no longer drift.
138
- *
139
- * Two probes remain BEHIND that canonical name, and both are backward
140
- * compatibility with tarballs already on npm — not a second convention:
141
- *
142
- * 1. **The package's own declared spelling.** A tarball published before the
143
- * rename declares (and ships) `linux-x86_64`; probing its declaration
144
- * first loads it without the CLI having to guess. This is also what makes
145
- * the rename work in the OTHER direction — an older CLI resolving a newer
146
- * package — because `canonicalPlatformToken` folds both spellings onto
147
- * one form at both ends.
148
- * 2. **The legacy uname spelling.** Only reachable for a package that ships
149
- * a prebuild dir and declares NO `gjsify.platforms` at all — i.e. a
150
- * tarball predating the OS-axis audit, or a third-party package using
151
- * `gjsify.prebuilds` without the declaration. Inside this repo the audit
152
- * makes that state impossible.
153
- *
154
- * Both are pure array entries matched against an already-read directory
155
- * listing — no extra I/O — so tolerance on the READ side costs nothing, while
156
- * the single spelling is enforced everywhere a name is WRITTEN.
157
- *
158
- * The LIBC AXIS rides in front of all of that: on a musl host the
159
- * `<os>-<arch>-musl` token is preferred over `<os>-<arch>`, and on glibc the
160
- * suffixed token is NEVER offered (a musl artifact cannot load against glibc, so
161
- * a probe for it can only produce a false positive). The `libc` value is a
162
- * PARAMETER rather than a `process` read for the same reason `platform` and
163
- * `arch` are: it is the only way the musl branch gets exercised at all, since CI
164
- * and every developer machine here run glibc.
165
- *
166
- * @param platform `process.platform` value.
167
- * @param arch `process.arch` value.
110
+ * The canonical name is `${process.platform}-${process.arch}`. Every package in the
111
+ * release train declares it (`gjsify.platforms`), `scripts/stage-prebuild.mjs` is the
112
+ * only thing that creates it, and `scripts/audit-runtimes.mjs --check` rejects any
113
+ * other spelling, so the three cannot drift.
114
+ *
115
+ * Two probes sit BEHIND it, both backward compatibility with tarballs already on npm
116
+ * rather than a second convention:
117
+ *
118
+ * 1. **The package's own declared spelling.** A pre-rename tarball declares and
119
+ * ships `linux-x86_64`, so probing its declaration first loads it without
120
+ * guessing. This is also what makes the rename work in the OTHER direction (an
121
+ * older CLI, a newer package), since `canonicalPlatformToken` folds both
122
+ * spellings onto one form at both ends.
123
+ * 2. **The legacy uname spelling.** Only reachable for a package that ships a
124
+ * prebuild dir and declares NO `gjsify.platforms` — a tarball predating the
125
+ * OS-axis audit, or a third-party package. The audit makes that state impossible
126
+ * inside this repo.
127
+ *
128
+ * Both are array entries matched against an already-read directory listing, so
129
+ * tolerance on the READ side costs no I/O while the single spelling stays enforced
130
+ * everywhere a name is WRITTEN.
131
+ *
132
+ * The LIBC AXIS rides in front of all of it (see {@link hostPlatformTokens}). `libc` is
133
+ * a PARAMETER rather than a `process` read for the same reason `platform` and `arch`
134
+ * are: it is the only way the musl branch is exercised at all, since CI and every
135
+ * developer machine here run glibc.
136
+ *
168
137
  * @param declaredPlatforms `package.json#gjsify.platforms`, when present.
169
- * @param libc host C library; `undefined`/`null` = behave as before the axis
170
- * existed.
171
138
  */
172
139
  export declare function prebuildDirCandidates(platform: string, arch: string, declaredPlatforms?: readonly string[] | undefined, libc?: HostLibc | null): string[];
173
140
  /**
@@ -318,12 +285,12 @@ export declare function libraryPathVar(platform: string): {
318
285
  * exactly the "nothing else found it" case. Consequence, and it is the
319
286
  * intended precedence: gjsify's own prebuilds keep priority through the
320
287
  * override variable, the system stack fills in behind it.
321
- * 2. **Our dirs go FIRST, an inherited fallback is kept BEHIND them, and
322
- * `/usr/lib` is appended when there is none.** Setting the variable
323
- * REPLACES dyld's own default fallback list, so writing only our dirs would
324
- * silently remove `/usr/lib` from the search — a host that exported the
325
- * variable itself already carries whatever tail it wants. Same composition
326
- * as node-gi's re-exec.
288
+ * 2. **Our dirs go FIRST, an inherited fallback behind them, and dyld's own
289
+ * default list behind that** — `composeDyldFallback()`, the same
290
+ * composition node-gi's re-exec uses. Setting the variable REPLACES that
291
+ * default list rather than extending it, so any composition that does not
292
+ * carry it hands the child a SMALLER search path than it would have had
293
+ * with the variable unset.
327
294
  *
328
295
  * Emitted even when `packages` is empty: the gap is in the host's loader, not in
329
296
  * a gjsify prebuild, so a plain `gjsify run script.gjs.js` that touches GTK needs