@pnpm/napi 12.0.0-beta.1 → 12.0.0-beta.2
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 +6 -0
- package/index.d.ts +80 -0
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @pnpm/napi
|
|
2
2
|
|
|
3
|
+
## 12.0.0-beta.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
3
9
|
## 12.0.0-beta.1
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/index.d.ts
CHANGED
|
@@ -329,5 +329,85 @@ export interface ParsedBareSpecifier {
|
|
|
329
329
|
/** Parses/validates a dependency specifier. Returns null for unparsable input. */
|
|
330
330
|
export function parseBareSpecifier(spec: string, alias?: string): ParsedBareSpecifier | null
|
|
331
331
|
|
|
332
|
+
export interface ReadConfigOptions {
|
|
333
|
+
/**
|
|
334
|
+
* Directory whose config cascade to resolve — its `.npmrc`, the enclosing
|
|
335
|
+
* workspace's `pnpm-workspace.yaml` and `.npmrc`, the user and global
|
|
336
|
+
* config files, and `npm_config_*` environment variables.
|
|
337
|
+
*/
|
|
338
|
+
dir: string
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/** One configured registry: the `default` entry plus one per `@scope`. */
|
|
342
|
+
export interface ResolvedRegistry {
|
|
343
|
+
/** `"default"` or the package scope (`"@teambit"`). */
|
|
344
|
+
name: string
|
|
345
|
+
url: string
|
|
346
|
+
/**
|
|
347
|
+
* Ready-to-send `Authorization` header for this registry, when the config
|
|
348
|
+
* carries a static credential for it. `tokenHelper` credentials are not
|
|
349
|
+
* executed here and yield no header.
|
|
350
|
+
*/
|
|
351
|
+
authHeader?: string
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface ResolvedConfig {
|
|
355
|
+
registries: ResolvedRegistry[]
|
|
356
|
+
/**
|
|
357
|
+
* Static `Authorization` headers keyed by nerf-darted registry URI
|
|
358
|
+
* (`//host[:port]/path/`) — the shape `install`'s `authHeaderByUri`
|
|
359
|
+
* accepts.
|
|
360
|
+
*/
|
|
361
|
+
authHeaderByUri: Record<string, string>
|
|
362
|
+
httpProxy?: string
|
|
363
|
+
httpsProxy?: string
|
|
364
|
+
/** `true` (bypass every proxy) or a comma-separated host list. */
|
|
365
|
+
noProxy?: boolean | string
|
|
366
|
+
/** PEM-encoded CA certificates (`ca` / `cafile` already merged). */
|
|
367
|
+
ca?: string[]
|
|
368
|
+
cert?: string
|
|
369
|
+
key?: string
|
|
370
|
+
strictSsl?: boolean
|
|
371
|
+
storeDir: string
|
|
372
|
+
cacheDir: string
|
|
373
|
+
virtualStoreDirMaxLength: number
|
|
374
|
+
networkConcurrency: number
|
|
375
|
+
maxSockets?: number
|
|
376
|
+
fetchRetries: number
|
|
377
|
+
fetchRetryFactor: number
|
|
378
|
+
fetchRetryMintimeout: number
|
|
379
|
+
fetchRetryMaxtimeout: number
|
|
380
|
+
fetchTimeout: number
|
|
381
|
+
/**
|
|
382
|
+
* The explicitly configured user agent, when the cascade set one. The
|
|
383
|
+
* engine's own computed default is omitted — an embedder that passes
|
|
384
|
+
* nothing back to `install` gets that same default.
|
|
385
|
+
*/
|
|
386
|
+
userAgent?: string
|
|
387
|
+
engineStrict: boolean
|
|
388
|
+
nodeVersion?: string
|
|
389
|
+
/** `"auto"` / `"hardlink"` / `"copy"` / `"clone"` / `"clone-or-copy"`. */
|
|
390
|
+
packageImportMethod: string
|
|
391
|
+
hoistPattern?: string[]
|
|
392
|
+
publicHoistPattern?: string[]
|
|
393
|
+
/**
|
|
394
|
+
* The legacy `shamefullyHoist` flag; `publicHoistPattern` already
|
|
395
|
+
* reflects it, exposed for embedders that branch on the flag itself.
|
|
396
|
+
*/
|
|
397
|
+
shamefullyHoist: boolean
|
|
398
|
+
/**
|
|
399
|
+
* The engine's pnpm home directory (`PNPM_HOME` or the platform default) —
|
|
400
|
+
* not a per-project setting. Absent when no home directory is resolvable.
|
|
401
|
+
*/
|
|
402
|
+
pnpmHomeDir?: string
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Resolve the configuration the engine's own installs use — registries,
|
|
407
|
+
* credentials, proxy, TLS, and network settings from the `.npmrc` cascade —
|
|
408
|
+
* so the embedder needs no JavaScript config reader.
|
|
409
|
+
*/
|
|
410
|
+
export function readConfig(options: ReadConfigOptions): ResolvedConfig
|
|
411
|
+
|
|
332
412
|
/** Version of the underlying Rust engine (pacquet). */
|
|
333
413
|
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.2",
|
|
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.2",
|
|
31
|
+
"@pnpm/napi.win32-arm64": "12.0.0-beta.2",
|
|
32
|
+
"@pnpm/napi.darwin-x64": "12.0.0-beta.2",
|
|
33
|
+
"@pnpm/napi.darwin-arm64": "12.0.0-beta.2",
|
|
34
|
+
"@pnpm/napi.linux-x64": "12.0.0-beta.2",
|
|
35
|
+
"@pnpm/napi.linux-arm64": "12.0.0-beta.2",
|
|
36
|
+
"@pnpm/napi.linux-x64-musl": "12.0.0-beta.2",
|
|
37
|
+
"@pnpm/napi.linux-arm64-musl": "12.0.0-beta.2"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"generate-packages": "node scripts/generate-packages.mjs"
|