import { a as Npmrc, i as LoadedNpmrc, n as announcePlatform, r as Transport, t as Tty } from "./tty-DNwBIkPj.js"; import { Argument, Command, Flag } from "effect/unstable/cli"; import { BundleContext, BundleResult, Layout, LockedTree, LockfileFormat, PackageSpec, PlatformFilter, ProgressEvent, Resolution, ValueOf } from "@packall/core"; import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; //#region src/command.d.ts /** The root command. */ export declare const bundleCommand: Command.Command<"packall", { readonly file: import("effect/Option").Option; readonly prod: boolean; readonly lockfile: string; readonly out: string; readonly layout: import("effect/Option").Option<"dir" | "flat" | "per-spec" | "single">; readonly layoutThreshold: import("effect/Option").Option; readonly archiveName: import("effect/Option").Option; readonly allVersions: boolean; readonly maxVersions: import("effect/Option").Option; readonly includePrerelease: boolean; readonly optional: boolean; readonly peer: boolean; readonly platform: readonly string[]; readonly registry: import("effect/Option").Option; readonly npmrc: import("effect/Option").Option; readonly rewriteTarballHost: boolean; readonly timeout: number; readonly retries: number; readonly concurrency: number; readonly dryRun: boolean; readonly verify: boolean; readonly force: import("effect/Option").Option; readonly forceSpec: readonly string[]; readonly printAbsolutePath: boolean; readonly json: boolean; readonly quiet: boolean; readonly interactive: boolean; readonly yes: boolean; readonly specs: readonly unknown[]; }, {}, never, import("@packall/core").Archiver | import("effect/Crypto").Crypto | Npmrc | Transport | Tty | Command.Environment>; /** The runnable CLI. */ export declare const cli: import("effect/Effect").Effect; //#endregion //#region src/config.d.ts /** * The shape the handler receives. * * Written out rather than inferred so that the helpers below have a stable, * readable contract instead of a conditional type nobody can hover. */ type Config = { readonly specs: ReadonlyArray; readonly file: Option.Option; readonly prod: boolean; readonly lockfile: string; readonly out: string; readonly layout: Option.Option; /** Absent means "ask at the default"; present means "switch at this, silently". */ readonly layoutThreshold: Option.Option; readonly archiveName: Option.Option; readonly allVersions: boolean; readonly maxVersions: Option.Option; readonly includePrerelease: boolean; readonly optional: boolean; readonly peer: boolean; readonly platform: ReadonlyArray; readonly registry: Option.Option; readonly npmrc: Option.Option; readonly rewriteTarballHost: boolean; readonly timeout: number; readonly retries: number; readonly concurrency: number; readonly dryRun: boolean; readonly verify: boolean; readonly force: Option.Option; readonly forceSpec: ReadonlyArray; readonly printAbsolutePath: boolean; readonly json: boolean; readonly quiet: boolean; readonly interactive: boolean; readonly yes: boolean; }; //#endregion //#region src/constants.d.ts /** Kept in step with package.json; recorded in every bundle manifest. */ export declare const VERSION: string; //#endregion //#region src/descriptors.d.ts /** * Above this many archives, per-spec means importing a lot of separate * tarballs, which is worth a second thought before writing them. */ export declare const DEFAULT_LAYOUT_PROMPT_THRESHOLD = 20; /** Sections of the surface, in the order `--help` presents them. */ export declare const FlagGroup: { readonly Input: "input"; readonly Output: "output"; readonly Selection: "selection"; readonly Registry: "registry"; readonly Other: "other"; }; export type FlagGroup = ValueOf; /** * What a flag accepts, and what it is when absent. * * A `default` of `undefined` means the flag is genuinely optional — absent is * distinguishable from any value it could carry. That distinction is not * decoration: `--force` relies on it to tell "replace everything" from "refuse" * from "ask me per file". */ type FlagType = { readonly _tag: "Boolean"; readonly default: boolean | undefined; } | { readonly _tag: "Integer"; readonly default: number | undefined; } | { readonly _tag: "Text"; readonly default: string | undefined; } | /** Repeatable, and absent means an empty list rather than nothing. */ { readonly _tag: "TextList"; } | { readonly _tag: "Choice"; readonly choices: ReadonlyArray; } | { readonly _tag: "File"; readonly mustExist: boolean; } | { readonly _tag: "Directory"; readonly default: string; }; /** When a flag only means something in the presence of another. */ type FlagDependency = { readonly flag: string; /** Required value of the controlling flag; presence alone when absent. */ readonly value?: string | boolean | undefined; }; type FlagDescriptor = { readonly name: string; readonly alias?: string | undefined; /** Placeholder shown in help, e.g. `PATH` in `--file PATH`. */ readonly metavar?: string | undefined; readonly description: string; readonly group: FlagGroup; readonly type: FlagType; readonly dependsOn?: FlagDependency | undefined; }; export declare const specsDescriptor: { readonly name: "spec"; readonly metavar: "SPEC"; readonly description: "Packages to bundle: lodash, react@18.2.0, @babel/core@^7, typescript@next"; }; export declare const descriptors: { readonly file: { readonly name: "file"; readonly alias: "f"; readonly metavar: "PATH"; readonly description: "Read specs from a file: a package.json (bundles its dependencies), a lockfile (bundles the versions it pins), or one spec per line with # and // comments. Detected by content, not extension"; readonly group: "input"; readonly type: { readonly _tag: "File"; readonly mustExist: true; }; }; readonly prod: { readonly name: "prod"; readonly description: "With --file , skip devDependencies"; readonly group: "input"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; readonly dependsOn: { readonly flag: "file"; }; }; readonly lockfile: { readonly name: "lockfile"; readonly metavar: "MODE"; readonly description: "With --file : detect finds a sibling lockfile (default) · off never does · npm, pnpm or bun requires that one · or pass a path"; readonly group: "input"; readonly type: { readonly _tag: "Text"; readonly default: "detect"; }; }; readonly out: { readonly name: "out"; readonly alias: "o"; readonly metavar: "DIR"; readonly description: "Directory to write bundles into (default: the current directory)"; readonly group: "output"; readonly type: { readonly _tag: "Directory"; readonly default: "."; }; }; readonly layout: { readonly name: "layout"; readonly description: string; readonly group: "output"; readonly type: { readonly _tag: "Choice"; readonly choices: readonly import("@packall/core").Layout[]; }; }; readonly layoutThreshold: { readonly name: "layout-threshold"; readonly metavar: "N"; readonly description: string; readonly group: "output"; readonly type: { readonly _tag: "Integer"; readonly default: undefined; }; }; readonly archiveName: { readonly name: "archive-name"; readonly metavar: "NAME"; readonly description: "Base name for the archive in --layout single"; readonly group: "output"; readonly type: { readonly _tag: "Text"; readonly default: undefined; }; readonly dependsOn: { readonly flag: "layout"; readonly value: "single"; }; }; readonly allVersions: { readonly name: "all-versions"; readonly description: "Bundle every published version matching a range, not just the best match"; readonly group: "selection"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly maxVersions: { readonly name: "max-versions"; readonly metavar: "N"; readonly description: "With --all-versions, keep at most the N newest matching versions"; readonly group: "selection"; readonly type: { readonly _tag: "Integer"; readonly default: undefined; }; readonly dependsOn: { readonly flag: "all-versions"; readonly value: true; }; }; readonly includePrerelease: { readonly name: "include-prerelease"; readonly description: "Let prereleases satisfy ranges"; readonly group: "selection"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly optional: { readonly name: "optional"; readonly description: "Follow optionalDependencies. On by default — this is where per-platform native binaries live"; readonly group: "selection"; readonly type: { readonly _tag: "Boolean"; readonly default: true; }; }; readonly peer: { readonly name: "peer"; readonly description: "Follow non-optional peerDependencies"; readonly group: "selection"; readonly type: { readonly _tag: "Boolean"; readonly default: true; }; }; readonly platform: { readonly name: "platform"; readonly metavar: "LIST"; readonly description: "Restrict optional deps to these platforms. An OS alone takes every arch: win32,linux · linux-x64 · linux-x64-musl (default: all)"; readonly group: "selection"; readonly type: { readonly _tag: "TextList"; }; }; readonly registry: { readonly name: "registry"; readonly alias: "r"; readonly metavar: "URL"; readonly description: "Registry to fetch from. Outranks every other source, including npm_config_registry (default: your .npmrc)"; readonly group: "registry"; readonly type: { readonly _tag: "Text"; readonly default: undefined; }; }; readonly npmrc: { readonly name: "npmrc"; readonly metavar: "PATH"; readonly description: "Explicit .npmrc to read registries and credentials from. npm_config_registry in the environment still outranks its registry= line"; readonly group: "registry"; readonly type: { readonly _tag: "File"; readonly mustExist: true; }; }; readonly rewriteTarballHost: { readonly name: "rewrite-tarball-host"; readonly description: "Fetch tarballs from --registry rather than the URL the registry returned"; readonly group: "registry"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly timeout: { readonly name: "timeout"; readonly metavar: "MS"; readonly description: "Ceiling on every network wait: connecting, the preflight check, and each request. Prevents an unreachable registry hanging the run"; readonly group: "registry"; readonly type: { readonly _tag: "Integer"; readonly default: 10000; }; }; readonly retries: { readonly name: "retries"; readonly metavar: "N"; readonly description: "Retries for transient failures (5xx, 429, dropped connections)"; readonly group: "registry"; readonly type: { readonly _tag: "Integer"; readonly default: 3; }; }; readonly concurrency: { readonly name: "concurrency"; readonly alias: "c"; readonly metavar: "N"; readonly description: "Simultaneous registry requests"; readonly group: "registry"; readonly type: { readonly _tag: "Integer"; readonly default: 10; }; }; readonly dryRun: { readonly name: "dry-run"; readonly description: "Resolve and report what would be bundled, downloading nothing"; readonly group: "other"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly verify: { readonly name: "verify"; readonly description: "Check every tarball against the registry's checksum"; readonly group: "other"; readonly type: { readonly _tag: "Boolean"; readonly default: true; }; }; readonly force: { readonly name: "force"; readonly description: "Replace any existing output file. --no-force refuses instead. Omit to be asked per file"; readonly group: "output"; readonly type: { readonly _tag: "Boolean"; readonly default: undefined; }; }; readonly forceSpec: { readonly name: "force-spec"; readonly metavar: "SPEC"; readonly description: "Always replace these specs, whatever --force says about the rest, e.g. --force-spec tsdown esbuild@0.21.5"; readonly group: "output"; readonly type: { readonly _tag: "TextList"; }; }; readonly printAbsolutePath: { readonly name: "print-absolute-path"; readonly description: "Report full paths instead of ones relative to the current directory"; readonly group: "output"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly json: { readonly name: "json"; readonly description: "Emit a machine-readable summary on stdout"; readonly group: "output"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly quiet: { readonly name: "quiet"; readonly alias: "q"; readonly description: "Only report warnings and errors"; readonly group: "other"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly interactive: { readonly name: "interactive"; readonly alias: "i"; readonly description: "Choose from what the resolution actually found — platforms, layout — instead of guessing flags up front"; readonly group: "other"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; readonly yes: { readonly name: "yes"; readonly alias: "y"; readonly description: "Never prompt; take the default for any question"; readonly group: "other"; readonly type: { readonly _tag: "Boolean"; readonly default: false; }; }; }; /** Every flag, in declaration order. */ export declare const flagDescriptors: ReadonlyArray; //#endregion //#region src/flags.d.ts export declare const specsArgument: Argument.Argument; export declare const flags: { file: Flag.Flag>; prod: Flag.Flag; lockfile: Flag.Flag; out: Flag.Flag; layout: Flag.Flag>; layoutThreshold: Flag.Flag>; archiveName: Flag.Flag>; allVersions: Flag.Flag; maxVersions: Flag.Flag>; includePrerelease: Flag.Flag; optional: Flag.Flag; peer: Flag.Flag; platform: Flag.Flag; registry: Flag.Flag>; npmrc: Flag.Flag>; rewriteTarballHost: Flag.Flag; timeout: Flag.Flag; retries: Flag.Flag; concurrency: Flag.Flag; dryRun: Flag.Flag; verify: Flag.Flag; force: Flag.Flag>; forceSpec: Flag.Flag; printAbsolutePath: Flag.Flag; json: Flag.Flag; quiet: Flag.Flag; interactive: Flag.Flag; yes: Flag.Flag; }; //#endregion //#region src/enums/force-mode.d.ts /** What to do about an output file that already exists. */ export declare const ForceMode: { /** Ask, once per colliding file. The default. */ readonly Prompt: "prompt"; /** Replace everything. */ readonly All: "all"; /** Refuse, and exit non-zero. */ readonly None: "none"; }; export type ForceMode = ValueOf; //#endregion //#region src/enums/overwrite-answer.d.ts /** How one "this file already exists" question was answered. */ export declare const OverwriteAnswer: { readonly Overwrite: "overwrite"; readonly Keep: "keep"; /** Replace this one and stop asking for the rest of the run. */ readonly Always: "always"; }; export type OverwriteAnswer = ValueOf; //#endregion //#region src/input/lockfile.d.ts /** What `--lockfile` was asked for. */ type LockfilePolicy = { readonly _tag: "Off"; } | { readonly _tag: "Detect"; } | { readonly _tag: "Manager"; readonly format: LockfileFormat; } | { readonly _tag: "Path"; readonly path: string; }; /** A lockfile found for a package.json. */ type LockfileCandidate = { readonly path: string; readonly format: LockfileFormat; /** * Where the package.json sits relative to the lockfile, POSIX-style. * * `"."` when they are siblings. Anything else means the lockfile was found by * walking up and covers more than the project that went looking for it. */ readonly importer: string; }; /** A settled pin: the graph, where it came from, and the roots it names. */ type PinnedLockfile = { readonly lockfile: LockedTree; readonly path: string; readonly specs: ReadonlyArray; }; /** * Reads `--lockfile`. * * Overloaded the same way `--force` is, and for the same reason: the values are * a small closed set of policies plus one open-ended case, and splitting them * across two flags would make the common form longer without making anything * clearer. Anything unrecognised is a path, so a lockfile called * `ci/locked.json` needs no extra ceremony. */ export declare const parseLockfilePolicy: (value: string) => LockfilePolicy; /** * Where the package.json sits relative to the lockfile's directory. * * Separators are normalised because the lockfile formats all spell their * workspace keys POSIX-style regardless of the platform that wrote them. */ export declare const importerPath: (lockfileDir: string, packageJsonDir: string, path: Path.Path) => string; /** * The paths a policy would consider for a package.json, nearest first. * * The walk up the directory tree is what makes this useful in a monorepo, where * `packages/core/package.json` has no lockfile of its own and the one that pins * it sits at the repository root. Each level records how to get back down, so * the parse can scope to that member rather than bundling every sibling's * dependencies too. * * Pure, and exported so the ordering is testable without a filesystem. */ export declare const lockfileCandidates: (policy: LockfilePolicy, directory: string, path: Path.Path) => ReadonlyArray; //#endregion //#region src/input/platforms.d.ts /** * Parses `--platform win32,linux`, `--platform "win32 linux"`, and * `--platform win32 --platform linux` — all to the same thing. * * Whitespace counts as a separator because PowerShell turns an unquoted * `win32,linux` into the single argument `"win32 linux"`: a comma builds an * array literal there, and arrays are space-joined on their way to a native * command. Accepting that costs nothing — no platform token contains a space — * and it means the obvious command works in the shell most of these users are * sitting in, rather than failing with a confusing quoting error. */ export declare const parsePlatforms: (inputs: ReadonlyArray) => Effect.Effect; //#endregion //#region src/input/specs.d.ts /** What the run will bundle, once `--file` and `--lockfile` have been settled. */ type ResolvedInput = { readonly specs: ReadonlyArray; /** Set when the run is pinned; `specs` is then only for display. */ readonly lockfile?: LockedTree | undefined; /** Echoed path of the lockfile in force, for the reproducible command. */ readonly lockfilePath?: string | undefined; /** Names the accompanying package.json declares, cross-checked against it. */ readonly declared?: ReadonlyArray | undefined; /** * Whether detection had something to decide. * * Only true for a `--file package.json`: that is the one input where a * lockfile could have applied and did not, which is the only case worth * pinning down with `--lockfile off` in the echoed command. */ readonly detectionRan?: boolean | undefined; }; /** Merges positional specs with anything from `--file`, and settles pinning. */ export declare const collectInput: (config: Config, interactive: boolean) => Effect.Effect; /** * Explains why positional specs and a lockfile cannot be one run. * * Both ways out are given as commands rather than described, because the useful * thing at this point is the line to run next — the same reason `--dry-run` * prints the command that reproduces it. * * Which way out comes first depends on how the lockfile got here. `--lockfile * off` governs *detection*, so it un-pins a file that was found and does * nothing at all to one that was named with `--file`; offering it there would * send you round the same error a second time. */ export declare const specsWithLockfileError: (config: Pick, lockfilePath: string | undefined, filePath: string | undefined, tty: Tty.Service) => Error; //#endregion //#region src/prompts/layout.d.ts /** What to do about the layout, once the resolution is known. */ type LayoutDecision = /** Leave it as it is. */ { readonly _tag: "Keep"; } | /** Ask, because nobody has said what they want. */ { readonly _tag: "Ask"; } | /** Switch without asking: a threshold was given, so the question is answered. */ { readonly _tag: "Switch"; readonly layout: Layout; }; type LayoutInput = { readonly explicitLayout: boolean; readonly yes: boolean; readonly json: boolean; readonly dryRun: boolean; readonly interactive: boolean; /** * `--layout-threshold`, when it was given. * * Absent and present mean different things, which is why this is an `Option` * rather than a number with a default. Absent leaves the old behaviour — * ask, at `DEFAULT_LAYOUT_PROMPT_THRESHOLD`. Present is somebody stating the * answer in advance, so it switches instead of asking, and works where no * prompt could: under `--yes`, `--json`, or a pipe. */ readonly threshold: Option.Option; readonly perSpecArchives: number; readonly perSpecEntries: number; readonly uniquePackages: number; }; export declare const decideLayout: (input: LayoutInput) => LayoutDecision; export declare const chooseLayout: (resolution: Resolution, config: Config, current: Layout, interactive: boolean) => Effect.Effect; //#endregion //#region src/prompts/overwrite.d.ts /** How `--force` was answered. */ type ForcePolicy = { /** What to do about collisions not named in `specs`. */ readonly global: ForceMode; /** Specs always replaced, whatever `global` says. */ readonly specs: ReadonlyArray; }; /** What a run should do about output files that already exist. */ type OverwritePlan = { /** True once the answer is "always", or `--force true`. */ readonly force: boolean; /** Outputs the user chose to leave alone; these are never produced. */ readonly skipExisting: ReadonlySet; /** Outputs cleared for replacement without forcing the whole run. */ readonly overwrite: ReadonlySet; }; /** * Reads `--force`, which is deliberately overloaded. * * `true` / `false` / `prompt` are the whole-run policies. Anything else is read * as a spec: `--force tsdown esbuild@0.21.5` replaces exactly those two and * still asks about the rest, which is what you want in a directory holding a * dozen bundles when only one is stale. * * Separators are commas or whitespace, for the same PowerShell reason as * `--platform`. */ export declare const parseForce: (force: Option.Option, spec: ReadonlyArray) => ForcePolicy; export declare const resolveOverwrites: (resolution: Resolution, options: BundleContext, config: Config, interactive: boolean) => Effect.Effect; //#endregion //#region src/prompts/platforms.d.ts /** * The `os-arch` pairs the resolved packages declare. * * Negations and wildcards are skipped — a package saying "not win32" tells you * nothing about which platforms exist to choose between. */ export declare const availablePlatforms: (resolution: Resolution) => ReadonlyArray; /** * Offers the platforms this resolution contains, and narrows to the chosen set. * * Only when `--interactive` is on, `--platform` was not already given, and * optional dependencies are being followed — there is nothing to ask about * otherwise. Answering with everything selected is the same as not narrowing. */ export declare const choosePlatforms: (resolution: Resolution, config: Config, current: PlatformFilter, interactive: boolean) => Effect.Effect; //#endregion //#region src/renderer.d.ts export declare namespace ProgressRenderer { /** * Drives the animation between events, returning a function that stops it. * * The line is redrawn on a timer as well as on events because the waits worth * reassuring somebody about are exactly the ones that emit no events: the * preflight check against a dead registry produces nothing at all for ten * seconds, and a still line is indistinguishable from a hung process. * * Injected rather than called directly so a test can step the spinner by * hand; the default is a `setInterval` that is `unref`'d, since an animation * must never be the reason a finished process is still running. */ type Ticker = (tick: () => void, intervalMs: number) => () => void; type Options = { /** Draw in place. Set from `stderr.isTTY`. */ readonly interactive: boolean; /** Suppress everything except warnings. */ readonly quiet: boolean; readonly write: (text: string) => void; readonly now?: (() => number) | undefined; readonly columns?: number | undefined; /** Minimum gap between redraws, to avoid spending the run repainting. */ readonly frameIntervalMs?: number | undefined; /** How often the spinner advances while a phase is waiting. */ readonly tickIntervalMs?: number | undefined; /** * The preflight ceiling, so the waiting line can name what it is counting * towards. `0` shows the elapsed time alone. */ readonly preflightTimeoutMs?: number | undefined; readonly ticker?: Ticker | undefined; }; } /** Consumes progress events and renders them. */ export declare class ProgressRenderer { private readonly options; private phase; private phaseStartedAt; /** * `-Infinity`, not `0`, so the *first* frame is never throttled away. * * With `0` the first draw is suppressed whenever the clock reads below the * frame interval — which is always true at the start of a phase under an * injected clock, and would leave the user staring at nothing for the first * frame interval of a real run. */ private lastFrameAt; private lineIsDirty; /** Frames drawn by the timer; the spinner reads its glyph from this. */ private ticks; /** Set while the animation is running. */ private stopTicking; private state; /** Warnings are held back and printed once at the end, not interleaved. */ private readonly warnings; constructor(options: ProgressRenderer.Options); /** Everything collected but not yet shown. */ get collectedWarnings(): ReadonlyArray; handle(event: ProgressEvent): void; /** * Stops the animation and clears any in-place line. * * Called on the way out of a run whether it succeeded or failed — a dirty * line would otherwise eat the first line of the error, and a live timer * would keep repainting over it. */ finish(): void; /** * Advances the animation one frame. * * Public so a test can step it without a real timer; nothing else should * call it. */ tick(): void; /** * Starts repainting on a timer for phases that can go quiet. * * `done` is excluded because there is nothing left to wait for by then. */ private startTicker; private stopTicker; private announcePhase; private summarizePhase; /** * Draws the live line. * * Throttled, except when `force` is set — the final frame of a phase should * always land, so the last thing on screen is not a stale count. */ private draw; /** The current live line. Exposed for testing. */ frame(): string; private endLine; private log; } //#endregion //#region src/summary.d.ts type TextInput = { readonly result: BundleResult; readonly options: BundleContext; /** The host, for rendering paths the way they were typed. */ readonly tty: Tty.Service; readonly elapsedMs: number; readonly warnings: ReadonlyArray; readonly quiet: boolean; /** Print resolved absolute paths instead of ones relative to the cwd. */ readonly absolutePaths?: boolean | undefined; /** When present, the run prints the command that reproduces it. */ readonly echo?: CommandEcho | undefined; /** Set when a lockfile pinned this run, and reported because it changes the answer. */ readonly pinnedBy?: PinnedBy | undefined; }; /** The lockfile a run was pinned to. */ type PinnedBy = { readonly path: string; readonly format: string; readonly lockfileVersion: string; /** The workspace member the roots came from, when the lockfile covers several. */ readonly importer?: string | undefined; }; /** Everything needed to reconstruct the command that produced this run. */ type CommandEcho = { readonly specs: ReadonlyArray; /** Set when the run came from `--file`; echoed instead of the spec list. */ readonly file?: string | undefined; readonly prod?: boolean | undefined; /** Path of the lockfile that pinned the run, when one did. */ readonly lockfile?: string | undefined; /** True when detection ran against a package.json and pinned nothing. */ readonly skipLockfile?: boolean | undefined; readonly layout: Layout; readonly outDir: string; /** As `formatPlatformFilter` renders it — `"all"` when unrestricted. */ readonly platforms: string; readonly optional: boolean; readonly peer: boolean; readonly allVersions: boolean; readonly maxVersions?: number | undefined; readonly includePrerelease: boolean; readonly verify: boolean; /** Overwrite stance actually in force. */ readonly force?: ForceMode | undefined; readonly forceSpecs?: ReadonlyArray | undefined; readonly registry?: string | undefined; readonly archiveName?: string | undefined; }; /** * Renders an absolute path the way you would have typed it. * * `Flag.directory` and `Flag.file` resolve their values before the handler sees * them, which is right for doing the work and wrong for showing it back: an * echoed command reading `--out ./temp` is what you meant, and it stays correct * when pasted somewhere else in the same tree. * * Paths outside the working directory keep their absolute form — a `../../..` * chain is longer than what it replaces and silently depends on where you run * it. Separators are normalised to `/`, which every shell on Windows accepts. * * The host arrives as a value rather than being read from `process`, so this is * testable without chdir'ing the test process — and so the identical function * renders virtual paths in a browser, where there is no `process` to read. */ export declare const relativeToCwd: (target: string, tty: Tty.Service) => string; /** * Shell-quotes an argument. * * Specs beginning with `@` are quoted unconditionally: PowerShell reads a * leading `@` as the array/splat operator, so `npmb @babel/core` is a parse * error there. A quoted spec is correct in every shell involved, and a * copy-pasteable command that only works in bash is not much use to somebody * on Windows — which, for this tool, is most people. */ export declare const quoteArgument: (argument: string) => string; /** * The command that reproduces this run non-interactively. * * Printed after anything was decided by a prompt, and on every `--dry-run`. * Exploring is how you find the right flags; this is what lets you keep them — * paste it into a script, a ticket, or a CI job and get the identical bundle * without answering a single question. * * Only non-default values are emitted, so the line stays short enough to read. */ export declare const equivalentCommand: (echo: CommandEcho, tty: Tty.Service) => string; /** The human-readable summary. */ export declare const toText: (input: TextInput) => string; /** The machine-readable summary. */ export declare const toJson: (result: BundleResult, options: BundleContext, elapsedMs: number) => string; /** * Renders a failure. * * Our own errors already carry a full, actionable message — including the * suggested `.npmrc` line for an auth failure and the host name for an * unreachable registry — so the job here is mostly to not get in the way. */ export declare const formatError: (error: unknown) => string; //#endregion //#region src/format.d.ts /** `1536` -> `"1.5 KB"`. Decimal units, because that is what registries report. */ export declare const bytes: (value: number) => string; /** * `93000` -> `"1m 33s"`. * * `Duration.format` does the decomposition — there is no reason to * reimplement "how many minutes are in 93 seconds" — but it renders *every* * non-zero part it finds, so 3,700,000 ms comes out as `1h 1m 40s`. Two units * is as much as a progress line can spend on a number nobody is reading * precisely, and the seconds place on an hour-long run is noise that changes * every frame. So the value is quantised first and formatted after. * * Sub-second values keep their own branch: `Duration.format` renders zero as * `"0"`, and `Done in 0` reads like a bug. */ export declare const duration: (ms: number) => string; /** * `4200` -> `"4s"`. * * Whole seconds, unlike `duration`, because this is for a counter that is * redrawn ten times a second: rounding to the nearest millisecond would make * every frame differ, and a number that never stops changing is harder to read * than one that ticks once a second. */ export declare const seconds: (ms: number) => string; /** `pluralize(1, "package")` -> `"1 package"`. */ export declare const pluralize: (count: number, singular: string, plural?: string) => string; /** * A fixed-width progress bar. * * Uses block-drawing characters, which every terminal that reports itself as a * TTY has handled for a decade. */ export declare const bar: (fraction: number, width?: number) => string; /** * Truncates to `width`, keeping the end of the string. * * Package names are most distinctive at the tail (`@babel/plugin-transform-…` * tells you nothing; `…-modules-commonjs` tells you everything), so the head is * what gets dropped. */ export declare const truncateStart: (value: string, width: number) => string; /** Pads or truncates to exactly `width`, for stable single-line redraws. */ export declare const fit: (value: string, width: number) => string; /** Estimates remaining time from a completion rate. */ export declare const eta: (completed: number, total: number, elapsedMs: number) => string | undefined; //#endregion export { type CommandEcho, type Config, type FlagDependency, type FlagDescriptor, type FlagType, type ForcePolicy, type LayoutDecision, type LayoutInput, type LoadedNpmrc, type LockfileCandidate, type LockfilePolicy, Npmrc, type OverwritePlan, type PinnedBy, type PinnedLockfile, type ResolvedInput, type TextInput, Transport, Tty, announcePlatform }; //# sourceMappingURL=index.d.ts.map