@pnpm/napi 12.0.0-beta.1 → 12.0.0-beta.3
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/CHANGELOG.md +14 -0
- package/index.d.ts +103 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pnpm/napi
|
|
2
2
|
|
|
3
|
+
## 12.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `readConfig` now returns `explicitSettings` — the camelCase names of settings the config cascade set explicitly — so hosts that layer the resolved config over their own defaults can forward only the values the user actually configured.
|
|
8
|
+
|
|
9
|
+
- Added a `returnListOfDepsRequiringBuild` install option. When it is set, `InstallResult.depsRequiringBuild` lists the dep path of every package whose files carry install scripts, whether or not the scripts were allowed to run, matching the TypeScript CLI's option of the same name. An install that computes no list, such as one served from the lockfile, leaves the field undefined.
|
|
10
|
+
|
|
11
|
+
## 12.0.0-beta.2
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Added `readConfig(options)`: resolves the configuration the engine's own installs use — registries with their resolved `Authorization` headers, `authHeaderByUri`, proxy, TLS, network limits, store/cache directories, and install behavior settings from the `.npmrc` / `pnpm-workspace.yaml` cascade — so hosts that embed the engine no longer need a JavaScript config reader.
|
|
16
|
+
|
|
3
17
|
## 12.0.0-beta.1
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/index.d.ts
CHANGED
|
@@ -197,6 +197,15 @@ export interface InstallOptions extends SharedEngineOptions {
|
|
|
197
197
|
* `InstallResult.depsRequiringBuild` instead.
|
|
198
198
|
*/
|
|
199
199
|
strictDepBuilds?: boolean
|
|
200
|
+
/**
|
|
201
|
+
* Report in `InstallResult.depsRequiringBuild` the dep path of every
|
|
202
|
+
* package whose files carry install scripts, regardless of the
|
|
203
|
+
* allow-build policy. The list is computed only when a fresh resolve
|
|
204
|
+
* materializes `node_modules`; an install served from the
|
|
205
|
+
* frozen-lockfile path (or `lockfileOnly`) leaves the field undefined
|
|
206
|
+
* so the embedder keeps its previously recorded list.
|
|
207
|
+
*/
|
|
208
|
+
returnListOfDepsRequiringBuild?: boolean
|
|
200
209
|
/** Customizations for how peer-dependency mismatches are treated. */
|
|
201
210
|
peerDependencyRules?: PeerDependencyRules
|
|
202
211
|
}
|
|
@@ -214,7 +223,13 @@ export interface InstallResult {
|
|
|
214
223
|
removed: number
|
|
215
224
|
linkedToRoot: number
|
|
216
225
|
}
|
|
217
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* With `returnListOfDepsRequiringBuild`: the dep path of every package
|
|
228
|
+
* whose files carry install scripts, whether or not the scripts were
|
|
229
|
+
* allowed to run; undefined when the install did not compute the list
|
|
230
|
+
* (see the option). Without it: the dep paths whose build scripts were
|
|
231
|
+
* skipped and require approval to run.
|
|
232
|
+
*/
|
|
218
233
|
depsRequiringBuild?: string[]
|
|
219
234
|
/** The resolved content-addressable store directory used by this install. */
|
|
220
235
|
storeDir: string
|
|
@@ -329,5 +344,92 @@ export interface ParsedBareSpecifier {
|
|
|
329
344
|
/** Parses/validates a dependency specifier. Returns null for unparsable input. */
|
|
330
345
|
export function parseBareSpecifier(spec: string, alias?: string): ParsedBareSpecifier | null
|
|
331
346
|
|
|
347
|
+
export interface ReadConfigOptions {
|
|
348
|
+
/**
|
|
349
|
+
* Directory whose config cascade to resolve — its `.npmrc`, the enclosing
|
|
350
|
+
* workspace's `pnpm-workspace.yaml` and `.npmrc`, the user and global
|
|
351
|
+
* config files, and `npm_config_*` environment variables.
|
|
352
|
+
*/
|
|
353
|
+
dir: string
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** One configured registry: the `default` entry plus one per `@scope`. */
|
|
357
|
+
export interface ResolvedRegistry {
|
|
358
|
+
/** `"default"` or the package scope (`"@teambit"`). */
|
|
359
|
+
name: string
|
|
360
|
+
url: string
|
|
361
|
+
/**
|
|
362
|
+
* Ready-to-send `Authorization` header for this registry, when the config
|
|
363
|
+
* carries a static credential for it. `tokenHelper` credentials are not
|
|
364
|
+
* executed here and yield no header.
|
|
365
|
+
*/
|
|
366
|
+
authHeader?: string
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export interface ResolvedConfig {
|
|
370
|
+
registries: ResolvedRegistry[]
|
|
371
|
+
/**
|
|
372
|
+
* Static `Authorization` headers keyed by nerf-darted registry URI
|
|
373
|
+
* (`//host[:port]/path/`) — the shape `install`'s `authHeaderByUri`
|
|
374
|
+
* accepts.
|
|
375
|
+
*/
|
|
376
|
+
authHeaderByUri: Record<string, string>
|
|
377
|
+
httpProxy?: string
|
|
378
|
+
httpsProxy?: string
|
|
379
|
+
/** `true` (bypass every proxy) or a comma-separated host list. */
|
|
380
|
+
noProxy?: boolean | string
|
|
381
|
+
/** PEM-encoded CA certificates (`ca` / `cafile` already merged). */
|
|
382
|
+
ca?: string[]
|
|
383
|
+
cert?: string
|
|
384
|
+
key?: string
|
|
385
|
+
strictSsl?: boolean
|
|
386
|
+
storeDir: string
|
|
387
|
+
cacheDir: string
|
|
388
|
+
virtualStoreDirMaxLength: number
|
|
389
|
+
networkConcurrency: number
|
|
390
|
+
maxSockets?: number
|
|
391
|
+
fetchRetries: number
|
|
392
|
+
fetchRetryFactor: number
|
|
393
|
+
fetchRetryMintimeout: number
|
|
394
|
+
fetchRetryMaxtimeout: number
|
|
395
|
+
fetchTimeout: number
|
|
396
|
+
/**
|
|
397
|
+
* The explicitly configured user agent, when the cascade set one. The
|
|
398
|
+
* engine's own computed default is omitted — an embedder that passes
|
|
399
|
+
* nothing back to `install` gets that same default.
|
|
400
|
+
*/
|
|
401
|
+
userAgent?: string
|
|
402
|
+
engineStrict: boolean
|
|
403
|
+
nodeVersion?: string
|
|
404
|
+
/** `"auto"` / `"hardlink"` / `"copy"` / `"clone"` / `"clone-or-copy"`. */
|
|
405
|
+
packageImportMethod: string
|
|
406
|
+
hoistPattern?: string[]
|
|
407
|
+
publicHoistPattern?: string[]
|
|
408
|
+
/**
|
|
409
|
+
* The legacy `shamefullyHoist` flag; `publicHoistPattern` already
|
|
410
|
+
* reflects it, exposed for embedders that branch on the flag itself.
|
|
411
|
+
*/
|
|
412
|
+
shamefullyHoist: boolean
|
|
413
|
+
/**
|
|
414
|
+
* The engine's pnpm home directory (`PNPM_HOME` or the platform default) —
|
|
415
|
+
* not a per-project setting. Absent when no home directory is resolvable.
|
|
416
|
+
*/
|
|
417
|
+
pnpmHomeDir?: string
|
|
418
|
+
/**
|
|
419
|
+
* The camelCase names of settings the cascade set explicitly
|
|
420
|
+
* (`pnpm-workspace.yaml`, the global config, `pnpm_config_*` env vars).
|
|
421
|
+
* Every other projected value is an engine default; an embedder that
|
|
422
|
+
* layers this config over its own must forward only the explicit ones.
|
|
423
|
+
*/
|
|
424
|
+
explicitSettings: string[]
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Resolve the configuration the engine's own installs use — registries,
|
|
429
|
+
* credentials, proxy, TLS, and network settings from the `.npmrc` cascade —
|
|
430
|
+
* so the embedder needs no JavaScript config reader.
|
|
431
|
+
*/
|
|
432
|
+
export function readConfig(options: ReadConfigOptions): ResolvedConfig
|
|
433
|
+
|
|
332
434
|
/** Version of the underlying Rust engine (pacquet). */
|
|
333
435
|
export function engineVersion(): string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/napi",
|
|
3
|
-
"version": "12.0.0-beta.
|
|
3
|
+
"version": "12.0.0-beta.3",
|
|
4
4
|
"description": "Node.js addon bindings for the pnpm v12 Rust engine (pacquet)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"README.md"
|
|
28
28
|
],
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"@pnpm/napi.win32-x64": "12.0.0-beta.
|
|
31
|
-
"@pnpm/napi.win32-arm64": "12.0.0-beta.
|
|
32
|
-
"@pnpm/napi.darwin-x64": "12.0.0-beta.
|
|
33
|
-
"@pnpm/napi.darwin-arm64": "12.0.0-beta.
|
|
34
|
-
"@pnpm/napi.linux-x64": "12.0.0-beta.
|
|
35
|
-
"@pnpm/napi.linux-arm64": "12.0.0-beta.
|
|
36
|
-
"@pnpm/napi.linux-x64-musl": "12.0.0-beta.
|
|
37
|
-
"@pnpm/napi.linux-arm64-musl": "12.0.0-beta.
|
|
30
|
+
"@pnpm/napi.win32-x64": "12.0.0-beta.3",
|
|
31
|
+
"@pnpm/napi.win32-arm64": "12.0.0-beta.3",
|
|
32
|
+
"@pnpm/napi.darwin-x64": "12.0.0-beta.3",
|
|
33
|
+
"@pnpm/napi.darwin-arm64": "12.0.0-beta.3",
|
|
34
|
+
"@pnpm/napi.linux-x64": "12.0.0-beta.3",
|
|
35
|
+
"@pnpm/napi.linux-arm64": "12.0.0-beta.3",
|
|
36
|
+
"@pnpm/napi.linux-x64-musl": "12.0.0-beta.3",
|
|
37
|
+
"@pnpm/napi.linux-arm64-musl": "12.0.0-beta.3"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"generate-packages": "node scripts/generate-packages.mjs"
|