import * as Context from "effect/Context"; import type * as Effect from "effect/Effect"; import type * as FileSystem from "effect/FileSystem"; import type * as Path from "effect/Path"; import type { NpmrcConfig, TlsSettings } from "@packall/registry-npm"; /** A resolved `.npmrc`, and where its values came from. */ export type LoadedNpmrc = { readonly config: NpmrcConfig; /** Sources that were read, in precedence order, for reporting. */ readonly sources: ReadonlyArray; /** * TLS trust, with `cafile` already read. * * Resolved by the host rather than by the transport because it is *file* * work, and which files exist is precisely what separates a workstation from * a tab. What the transport receives is plain data it can hand to a socket. */ readonly tls: TlsSettings; /** * Configuration that was understood but could not be honoured. * * Reported rather than thrown: a `cafile` that will not open should not end a * run the system store might complete, but it must not pass in silence * either — the certificate error it leads to names nothing that would help. */ readonly warnings: ReadonlyArray; }; export declare namespace Npmrc { export type Service = { /** * Resolves the configuration in force. * * `explicitPath` is `--npmrc`, which outranks everything a host would find * on its own. */ readonly load: ( explicitPath: string | undefined, ) => Effect.Effect; }; } /** Service tag for `.npmrc` resolution. */ export class Npmrc extends Context.Service()("@packall/cli/Npmrc") {}