@packall/core 0.5.0 → 0.5.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.
@@ -114,6 +114,17 @@ var RegistryUnreachableError = class extends BundlerErrorBase {
114
114
  }
115
115
  };
116
116
  const NETWORK_HINT = "Check your network connection, VPN, and the proxy settings in your .npmrc.";
117
+ /** No response was exposed, so neither an HTTP status nor a network failure can be claimed. */
118
+ var RegistryResponseUnavailableError = class extends BundlerErrorBase {
119
+ _tag = "RegistryResponseUnavailableError";
120
+ registry;
121
+ packageName;
122
+ constructor(registry, packageName, options) {
123
+ super(`No readable response from ${registry} while fetching "${packageName}".\n The requested package or file may not exist, the registry may block this environment, or the network may be unavailable.\n Check the package name and registry access, or run the command locally for a more specific error.`, options);
124
+ this.registry = registry;
125
+ this.packageName = packageName;
126
+ }
127
+ };
117
128
  /** The registry answered, but has never heard of this package. */
118
129
  var PackageNotFoundError = class extends BundlerErrorBase {
119
130
  _tag = "PackageNotFoundError";
@@ -280,5 +291,5 @@ const createArchive = (options) => Effect.gen(function* () {
280
291
  });
281
292
 
282
293
  //#endregion
283
- export { OutputError as _, layerCallback as a, RegistryUnreachableError as b, ArchiveError as c, InvalidInputFileError as d, InvalidSpecError as f, NoMatchingVersionsError as g, LockfileOutOfDateError as h, emit as i, AuthenticationError as l, LockfileIncompleteError as m, createArchive as n, layerSilent as o, LockfileError as p, Progress as r, makeCollector as s, Archiver as t, IntegrityError as u, PackageNotFoundError as v, VersionNotFoundError as x, RegistryResponseError as y };
284
- //# sourceMappingURL=archive-DmF9XNl7.js.map
294
+ export { VersionNotFoundError as S, OutputError as _, layerCallback as a, RegistryResponseUnavailableError as b, ArchiveError as c, InvalidInputFileError as d, InvalidSpecError as f, NoMatchingVersionsError as g, LockfileOutOfDateError as h, emit as i, AuthenticationError as l, LockfileIncompleteError as m, createArchive as n, layerSilent as o, LockfileError as p, Progress as r, makeCollector as s, Archiver as t, IntegrityError as u, PackageNotFoundError as v, RegistryUnreachableError as x, RegistryResponseError as y };
295
+ //# sourceMappingURL=archive-D1AFjtiX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-D1AFjtiX.js","names":["layerSilent: Layer.Layer<Progress>","Progress.emit"],"sources":["../src/errors.ts","../src/progress.ts","../src/archive.ts"],"sourcesContent":["/**\n * Failure types for the bundler.\n *\n * These are deliberately plain classes carrying a literal `_tag` rather than\n * `Data.TaggedError`. They work with `Effect.catchTag` / `Effect.catchTags`\n * exactly the same way, and they keep the public error surface independent of\n * any single Effect release — useful while Effect v4 is still in beta.\n *\n * Every error carries enough context to be actionable without a stack trace,\n * because the primary consumer is somebody staring at a terminal on a\n * locked-down network trying to work out why a download did not happen.\n */\n\n/** Discriminant union of every failure the bundler can produce. */\nexport type BundlerError =\n\t| InvalidSpecError\n\t| InvalidInputFileError\n\t| LockfileError\n\t| LockfileIncompleteError\n\t| LockfileOutOfDateError\n\t| RegistryUnreachableError\n\t| RegistryResponseUnavailableError\n\t| PackageNotFoundError\n\t| VersionNotFoundError\n\t| NoMatchingVersionsError\n\t| RegistryResponseError\n\t| AuthenticationError\n\t| IntegrityError\n\t| ArchiveError\n\t| OutputError;\n\nabstract class BundlerErrorBase extends Error {\n\tabstract readonly _tag: string;\n\tconstructor(message: string, options?: ErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.name = new.target.name;\n\t}\n}\n\n/** A package spec on the command line or in an input file could not be parsed. */\nexport class InvalidSpecError extends BundlerErrorBase {\n\treadonly _tag = \"InvalidSpecError\" as const;\n\treadonly spec: string;\n\treadonly reason: string;\n\tconstructor(spec: string, reason: string) {\n\t\tsuper(`Invalid package spec ${JSON.stringify(spec)}: ${reason}`);\n\t\tthis.spec = spec;\n\t\tthis.reason = reason;\n\t}\n}\n\n/** `--file` pointed at something that is neither a usable package.json nor a spec list. */\nexport class InvalidInputFileError extends BundlerErrorBase {\n\treadonly _tag = \"InvalidInputFileError\" as const;\n\treadonly path: string;\n\treadonly reason: string;\n\tconstructor(path: string, reason: string, options?: { cause?: unknown }) {\n\t\tsuper(`Cannot read specs from ${path}: ${reason}`, options);\n\t\tthis.path = path;\n\t\tthis.reason = reason;\n\t}\n}\n\n/** A lockfile could not be read, or is in a format we do not support. */\nexport class LockfileError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileError\" as const;\n\treadonly path: string;\n\treadonly reason: string;\n\tconstructor(path: string, reason: string, options?: { cause?: unknown }) {\n\t\t// Opens with \"Lockfile\" so the renderer's tag prefix does not stutter, and\n\t\t// because not every reason is a read failure — \"does not cover this\n\t\t// package\" is about a file that read perfectly well.\n\t\tsuper(`Lockfile ${path}: ${reason}`, options);\n\t\tthis.path = path;\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * The lockfile parsed, but does not pin everything the bundle needs.\n *\n * Falling back to a range here would defeat the entire point of reading a\n * lockfile — you would get a bundle that is *mostly* what CI installed, with no\n * indication of which parts were guessed. So this is fatal, and it names every\n * gap at once so one `npm install` fixes all of them.\n */\nexport class LockfileIncompleteError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileIncompleteError\" as const;\n\treadonly path: string;\n\treadonly missing: ReadonlyArray<string>;\n\tconstructor(path: string, missing: ReadonlyArray<string>, detail: string, remedy: string) {\n\t\tconst shown = missing\n\t\t\t.slice(0, 10)\n\t\t\t.map((entry) => ` ${entry}`)\n\t\t\t.join(\"\\n\");\n\t\tconst rest = missing.length > 10 ? `\\n … and ${missing.length - 10} more` : \"\";\n\t\tsuper(\n\t\t\t`${path} is incomplete — ${detail}:\\n${shown}${rest}\\n` +\n\t\t\t\t` ${remedy}\\n` +\n\t\t\t\t` Or pass --lockfile off to resolve version ranges fresh instead.`,\n\t\t);\n\t\tthis.path = path;\n\t\tthis.missing = missing;\n\t}\n}\n\n/**\n * The lockfile pins versions the registry no longer serves.\n *\n * Unpublished, or never mirrored into a private registry. Either way the\n * bundle cannot be built as specified, and quietly substituting a nearby\n * version would produce exactly the mismatch this feature exists to prevent.\n */\nexport class LockfileOutOfDateError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileOutOfDateError\" as const;\n\treadonly path: string;\n\treadonly registry: string;\n\treadonly missing: ReadonlyArray<{ readonly name: string; readonly version: string }>;\n\tconstructor(\n\t\tpath: string,\n\t\tregistry: string,\n\t\tmissing: ReadonlyArray<{\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly detail: string;\n\t\t}>,\n\t) {\n\t\tconst shown = missing\n\t\t\t.slice(0, 10)\n\t\t\t.map((entry) => ` ${entry.name}@${entry.version} — ${entry.detail}`)\n\t\t\t.join(\"\\n\");\n\t\tconst rest = missing.length > 10 ? `\\n … and ${missing.length - 10} more` : \"\";\n\t\tsuper(\n\t\t\t`${path} pins ${missing.length} version${missing.length === 1 ? \"\" : \"s\"} ` +\n\t\t\t\t`that ${registry} does not serve:\\n${shown}${rest}\\n` +\n\t\t\t\t` Refresh the lockfile against this registry, or pass --lockfile off to\\n` +\n\t\t\t\t` resolve version ranges fresh instead.`,\n\t\t);\n\t\tthis.path = path;\n\t\tthis.registry = registry;\n\t\tthis.missing = missing.map(({ name, version }) => ({ name, version }));\n\t}\n}\n\n/**\n * The registry could not be reached at all — DNS failure, refused connection,\n * a certificate the machine does not trust, proxy blackhole, or a preflight\n * that timed out.\n *\n * This is the error that fixes \"hangs forever with no network\": we surface it\n * quickly and say which host we could not reach.\n */\nexport class RegistryUnreachableError extends BundlerErrorBase {\n\treadonly _tag = \"RegistryUnreachableError\" as const;\n\treadonly registry: string;\n\treadonly timeoutMs: number | undefined;\n\t/**\n\t * `hint` replaces the closing line of advice.\n\t *\n\t * The default suits the common case and is wrong for at least one: a\n\t * rejected certificate is not a network problem, and telling somebody to\n\t * check their VPN sends them to look at the one thing that is working. The\n\t * backend knows which failure it saw, so it is the backend that gets to say.\n\t */\n\tconstructor(\n\t\tregistry: string,\n\t\tdetail: string,\n\t\toptions?: { cause?: unknown; timeoutMs?: number; hint?: string | undefined },\n\t) {\n\t\tsuper(\n\t\t\t`Cannot reach registry ${registry}: ${detail}.\\n ${options?.hint ?? NETWORK_HINT}`,\n\t\t\toptions,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.timeoutMs = options?.timeoutMs;\n\t}\n}\n\nconst NETWORK_HINT = \"Check your network connection, VPN, and the proxy settings in your .npmrc.\";\n\n/** No response was exposed, so neither an HTTP status nor a network failure can be claimed. */\nexport class RegistryResponseUnavailableError extends BundlerErrorBase {\n\treadonly _tag = \"RegistryResponseUnavailableError\" as const;\n\treadonly registry: string;\n\treadonly packageName: string;\n\tconstructor(registry: string, packageName: string, options?: { cause?: unknown }) {\n\t\tsuper(\n\t\t\t`No readable response from ${registry} while fetching \"${packageName}\".\\n` +\n\t\t\t\t` The requested package or file may not exist, the registry may block this environment, or the network may be unavailable.\\n` +\n\t\t\t\t` Check the package name and registry access, or run the command locally for a more specific error.`,\n\t\t\toptions,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.packageName = packageName;\n\t}\n}\n\n/** The registry answered, but has never heard of this package. */\nexport class PackageNotFoundError extends BundlerErrorBase {\n\treadonly _tag = \"PackageNotFoundError\" as const;\n\treadonly packageName: string;\n\treadonly registry: string;\n\tconstructor(packageName: string, registry: string) {\n\t\tsuper(`Package \"${packageName}\" was not found on ${registry}`);\n\t\tthis.packageName = packageName;\n\t\tthis.registry = registry;\n\t}\n}\n\n/** The package exists but the exact version requested does not. */\nexport class VersionNotFoundError extends BundlerErrorBase {\n\treadonly _tag = \"VersionNotFoundError\" as const;\n\treadonly packageName: string;\n\treadonly version: string;\n\treadonly available: ReadonlyArray<string>;\n\tconstructor(packageName: string, version: string, available: ReadonlyArray<string>) {\n\t\tconst tail = available.slice(-5).join(\", \");\n\t\tsuper(\n\t\t\t`${packageName}@${version} does not exist.` +\n\t\t\t\t(tail.length > 0 ? ` Most recent published versions: ${tail}` : \"\"),\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.version = version;\n\t\tthis.available = available;\n\t}\n}\n\n/** A range (or dist-tag) matched nothing that is actually published. */\nexport class NoMatchingVersionsError extends BundlerErrorBase {\n\treadonly _tag = \"NoMatchingVersionsError\" as const;\n\treadonly packageName: string;\n\treadonly selector: string;\n\treadonly available: ReadonlyArray<string>;\n\tconstructor(packageName: string, selector: string, available: ReadonlyArray<string>) {\n\t\tconst tail = available.slice(-5).join(\", \");\n\t\tsuper(\n\t\t\t`No published version of ${packageName} satisfies \"${selector}\".` +\n\t\t\t\t(tail.length > 0 ? ` Most recent published versions: ${tail}` : \"\"),\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.selector = selector;\n\t\tthis.available = available;\n\t}\n}\n\n/** The registry responded, but with something we cannot use. */\nexport class RegistryResponseError extends BundlerErrorBase {\n\treadonly _tag = \"RegistryResponseError\" as const;\n\treadonly url: string;\n\treadonly status: number | undefined;\n\tconstructor(url: string, detail: string, options?: { cause?: unknown; status?: number }) {\n\t\tsuper(`Unexpected response from ${url}: ${detail}`, options);\n\t\tthis.url = url;\n\t\tthis.status = options?.status;\n\t}\n}\n\n/** 401/403 — almost always a missing or stale token in `.npmrc`. */\nexport class AuthenticationError extends BundlerErrorBase {\n\treadonly _tag = \"AuthenticationError\" as const;\n\treadonly registry: string;\n\treadonly status: number;\n\tconstructor(registry: string, status: number, packageName?: string) {\n\t\tsuper(\n\t\t\t`Registry ${registry} rejected the request with HTTP ${status}` +\n\t\t\t\t(packageName ? ` while fetching \"${packageName}\"` : \"\") +\n\t\t\t\t`.\\n Add credentials to your .npmrc, e.g.\\n` +\n\t\t\t\t` //${safeHost(registry)}/:_authToken=\\${NPM_TOKEN}`,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.status = status;\n\t}\n}\n\n/**\n * A downloaded tarball did not match the checksum the registry advertised.\n *\n * Never soft-fail this: a bundle is a supply-chain artifact and a corrupt or\n * substituted tarball is exactly what integrity checking exists to catch.\n */\nexport class IntegrityError extends BundlerErrorBase {\n\treadonly _tag = \"IntegrityError\" as const;\n\treadonly packageName: string;\n\treadonly version: string;\n\treadonly expected: string;\n\treadonly actual: string;\n\tconstructor(packageName: string, version: string, expected: string, actual: string) {\n\t\tsuper(\n\t\t\t`Integrity check failed for ${packageName}@${version}.\\n` +\n\t\t\t\t` expected: ${expected}\\n` +\n\t\t\t\t` actual: ${actual}\\n` +\n\t\t\t\t` The download was discarded. This is either corruption in transit or a tampered artifact.`,\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.version = version;\n\t\tthis.expected = expected;\n\t\tthis.actual = actual;\n\t}\n}\n\n/** Something went wrong writing the `.tgz`. */\nexport class ArchiveError extends BundlerErrorBase {\n\treadonly _tag = \"ArchiveError\" as const;\n\treadonly path: string;\n\tconstructor(path: string, detail: string, options?: { cause?: unknown }) {\n\t\tsuper(`Failed to create archive ${path}: ${detail}`, options);\n\t\tthis.path = path;\n\t}\n}\n\n/** Something went wrong preparing or writing to the output directory. */\nexport class OutputError extends BundlerErrorBase {\n\treadonly _tag = \"OutputError\" as const;\n\treadonly path: string;\n\tconstructor(path: string, detail: string, options?: { cause?: unknown }) {\n\t\tsuper(`Output error at ${path}: ${detail}`, options);\n\t\tthis.path = path;\n\t}\n}\n\nconst safeHost = (registry: string): string => {\n\ttry {\n\t\tconst url = new URL(registry);\n\t\treturn url.host + url.pathname.replace(/\\/+$/, \"\");\n\t} catch {\n\t\treturn registry;\n\t}\n};\n","/**\n * Progress reporting.\n *\n * The engine emits structured events; it never writes to a terminal. That\n * separation is what lets the CLI draw a live TTY view, CI print plain lines,\n * and the test suite assert on an array of events without any of them\n * interfering with each other.\n */\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Ref from \"effect/Ref\";\n\nimport type { Phase } from \"./enums/phase.js\";\n\n/** A structured progress event. */\nexport type ProgressEvent =\n\t/** A phase began. `total` is set only when it is known up front. */\n\t| { readonly _tag: \"PhaseStarted\"; readonly phase: Phase; readonly total?: number | undefined }\n\t/** A phase finished. */\n\t| { readonly _tag: \"PhaseCompleted\"; readonly phase: Phase }\n\t/** The resolver discovered a package that has to be included. */\n\t| {\n\t\t\treadonly _tag: \"PackageResolved\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\t/** Running count of resolved packages, for a live counter. */\n\t\t\treadonly resolvedCount: number;\n\t\t\t/** Packages still queued for resolution. */\n\t\t\treadonly pendingCount: number;\n\t }\n\t/** A tarball download started. */\n\t| { readonly _tag: \"DownloadStarted\"; readonly name: string; readonly version: string }\n\t/** A tarball download finished. */\n\t| {\n\t\t\treadonly _tag: \"DownloadCompleted\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly bytes: number;\n\t\t\treadonly completedCount: number;\n\t\t\treadonly totalCount: number;\n\t }\n\t/** A download failed and will be retried. */\n\t| {\n\t\t\treadonly _tag: \"DownloadRetrying\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly attempt: number;\n\t\t\treadonly reason: string;\n\t }\n\t/** An archive is being written. */\n\t| { readonly _tag: \"ArchiveStarted\"; readonly path: string; readonly entryCount: number }\n\t/** An archive finished. */\n\t| { readonly _tag: \"ArchiveCompleted\"; readonly path: string; readonly bytes: number }\n\t/** Something noteworthy but non-fatal, e.g. a deprecated package. */\n\t| { readonly _tag: \"Warning\"; readonly message: string };\n\nexport declare namespace Progress {\n\t/** The reporting sink. */\n\texport type Service = {\n\t\treadonly emit: (event: ProgressEvent) => Effect.Effect<void>;\n\t};\n}\n\n/** Service tag for progress reporting. */\nexport class Progress extends Context.Service<Progress, Progress.Service>()(\n\t\"@packall/core/Progress\",\n) {}\n\n/** Emits an event to whichever reporter is installed. */\nexport const emit = (event: ProgressEvent): Effect.Effect<void, never, Progress> =>\n\tEffect.gen(function* () {\n\t\tconst progress = yield* Progress;\n\t\tyield* progress.emit(event);\n\t});\n\n/**\n * Discards every event.\n *\n * The default for library consumers and for tests that do not care about\n * progress — silence should never require ceremony.\n */\nexport const layerSilent: Layer.Layer<Progress> = Layer.succeed(Progress)({\n\temit: () => Effect.void,\n});\n\n/** Sends every event to a callback. Used by the CLI renderer. */\nexport const layerCallback = (onEvent: (event: ProgressEvent) => void): Layer.Layer<Progress> =>\n\tLayer.succeed(Progress)({\n\t\temit: (event) => Effect.sync(() => onEvent(event)),\n\t});\n\n/**\n * Accumulates every event into a `Ref`, for assertions.\n *\n * Returned as `{ layer, events }` so a test can provide the layer and then read\n * the transcript afterwards.\n */\nexport const makeCollector = Effect.gen(function* () {\n\tconst ref = yield* Ref.make<ReadonlyArray<ProgressEvent>>([]);\n\tconst layer = Layer.succeed(Progress)({\n\t\temit: (event: ProgressEvent) => Ref.update(ref, (events) => [...events, event]),\n\t});\n\treturn { layer, events: Ref.get(ref) } as const;\n});\n","/**\n * Turning a staged directory tree into a gzipped tarball.\n *\n * A service rather than a function, because packing is the one step that has\n * to be implemented differently per platform. Everywhere else the engine\n * reaches the disk through `effect/FileSystem`, which is what lets an in-memory\n * filesystem carry the whole pipeline — but a tar writer is not filesystem\n * access, it is a format, and `node-tar` reads the paths it is given with\n * Node's own `fs` rather than through the injected service. Left as a direct\n * call, packing would quietly bypass the abstraction the rest of the engine\n * depends on, which stays invisible until something other than Node provides\n * the filesystem.\n *\n * The implementations live outside this module — `@packall/core/node` for\n * Node, a Web Streams writer in the browser — so nothing platform-specific is\n * reachable from the engine's own graph.\n */\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport type * as FileSystem from \"effect/FileSystem\";\nimport type { PlatformError } from \"effect/PlatformError\";\n\nimport type { ArchiveError } from \"./errors.js\";\nimport * as Progress from \"./progress.js\";\n\n/** A finished archive. */\nexport type ArchiveResult = {\n\treadonly path: string;\n\treadonly bytes: number;\n};\n\n/** What to pack, and where to put it. */\nexport type CreateArchiveOptions = {\n\treadonly cwd: string;\n\t/** Entry paths, relative to `cwd`. */\n\treadonly entries: ReadonlyArray<string>;\n\treadonly outPath: string;\n\treadonly gzipLevel?: number | undefined;\n};\n\nexport declare namespace Archiver {\n\t/** The packing backend. */\n\texport type Service = {\n\t\t/**\n\t\t * Packs `entries` (paths relative to `cwd`) into a gzipped tar at\n\t\t * `outPath`.\n\t\t *\n\t\t * Implementations must produce byte-identical output for identical inputs —\n\t\t * normalised uid/gid/mtime, entries in a stable order — because a security\n\t\t * team diffing two bundles, or re-deriving one from its manifest, is a\n\t\t * thing that actually happens.\n\t\t */\n\t\treadonly create: (\n\t\t\toptions: CreateArchiveOptions,\n\t\t) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, FileSystem.FileSystem>;\n\t};\n}\n\n/** Service tag for archive creation. */\nexport class Archiver extends Context.Service<Archiver, Archiver.Service>()(\n\t\"@packall/core/Archiver\",\n) {}\n\n/**\n * Packs an archive with whichever backend is installed.\n *\n * The progress events are emitted here rather than inside the backends, so\n * every implementation reports identically and a new one cannot forget to.\n */\nexport const createArchive = (\n\toptions: CreateArchiveOptions,\n): Effect.Effect<\n\tArchiveResult,\n\tArchiveError | PlatformError,\n\tArchiver | FileSystem.FileSystem | Progress.Progress\n> =>\n\tEffect.gen(function* () {\n\t\tconst archiver = yield* Archiver;\n\n\t\tyield* Progress.emit({\n\t\t\t_tag: \"ArchiveStarted\",\n\t\t\tpath: options.outPath,\n\t\t\tentryCount: options.entries.length,\n\t\t});\n\n\t\tconst result = yield* archiver.create(options);\n\n\t\tyield* Progress.emit({\n\t\t\t_tag: \"ArchiveCompleted\",\n\t\t\tpath: result.path,\n\t\t\tbytes: result.bytes,\n\t\t});\n\n\t\treturn result;\n\t});\n"],"mappings":";;;;;;AA+BA,IAAe,mBAAf,cAAwC,MAAM;CAE7C,YAAY,SAAiB,SAAwB;AACpD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO,IAAI,OAAO;;;;AAKzB,IAAa,mBAAb,cAAsC,iBAAiB;CACtD,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,YAAY,MAAc,QAAgB;AACzC,QAAM,wBAAwB,KAAK,UAA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+11,7 @@
11
11
  * locked-down network trying to work out why a download did not happen.
12
12
  */
13
13
  /** Discriminant union of every failure the bundler can produce. */
14
- export type BundlerError = InvalidSpecError | InvalidInputFileError | LockfileError | LockfileIncompleteError | LockfileOutOfDateError | RegistryUnreachableError | PackageNotFoundError | VersionNotFoundError | NoMatchingVersionsError | RegistryResponseError | AuthenticationError | IntegrityError | ArchiveError | OutputError;
14
+ export type BundlerError = InvalidSpecError | InvalidInputFileError | LockfileError | LockfileIncompleteError | LockfileOutOfDateError | RegistryUnreachableError | RegistryResponseUnavailableError | PackageNotFoundError | VersionNotFoundError | NoMatchingVersionsError | RegistryResponseError | AuthenticationError | IntegrityError | ArchiveError | OutputError;
15
15
  declare abstract class BundlerErrorBase extends Error {
16
16
  abstract readonly _tag: string;
17
17
  constructor(message: string, options?: ErrorOptions);
@@ -102,6 +102,15 @@ export declare class RegistryUnreachableError extends BundlerErrorBase {
102
102
  hint?: string | undefined;
103
103
  });
104
104
  }
105
+ /** No response was exposed, so neither an HTTP status nor a network failure can be claimed. */
106
+ export declare class RegistryResponseUnavailableError extends BundlerErrorBase {
107
+ readonly _tag: "RegistryResponseUnavailableError";
108
+ readonly registry: string;
109
+ readonly packageName: string;
110
+ constructor(registry: string, packageName: string, options?: {
111
+ cause?: unknown;
112
+ });
113
+ }
105
114
  /** The registry answered, but has never heard of this package. */
106
115
  export declare class PackageNotFoundError extends BundlerErrorBase {
107
116
  readonly _tag: "PackageNotFoundError";
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mEAAmE;AACnE,MAAM,MAAM,YAAY,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,aAAa,GACb,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,oBAAoB,GACpB,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ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AAC,MAAM,EAAE,MAAM,CAAC;IACxB,YAAY,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAWjF;CACD;AAED,+CAA+C;AAC/C,qBAAa,YAAa,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,EAAG,cAAc,CAAU;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGtE;CACD;AAED,yEAAyE;AACzE,qBAAa,WAAY,SAAQ,gBAAgB;IAChD,QAAQ,CAAC,IAAI,EAAG,aAAa,CAAU;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGtE;CACD"}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * implementation detail, including modules that happen to be reachable.
10
10
  */
11
11
  export type * from "./errors.js";
12
- export { ArchiveError, AuthenticationError, IntegrityError, InvalidInputFileError, InvalidSpecError, LockfileError, LockfileIncompleteError, LockfileOutOfDateError, NoMatchingVersionsError, OutputError, PackageNotFoundError, RegistryResponseError, RegistryUnreachableError, VersionNotFoundError, } from "./errors.js";
12
+ export { ArchiveError, AuthenticationError, IntegrityError, InvalidInputFileError, InvalidSpecError, LockfileError, LockfileIncompleteError, LockfileOutOfDateError, NoMatchingVersionsError, OutputError, PackageNotFoundError, RegistryResponseError, RegistryResponseUnavailableError, RegistryUnreachableError, VersionNotFoundError, } from "./errors.js";
13
13
  export { ArtifactKind } from "./enums/artifact-kind.js";
14
14
  export { DirectOnlyKind, EdgeKind, LockedRootKind } from "./enums/edge-kind.js";
15
15
  export { InputFileKind } from "./enums/input-file-kind.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,mBAAmB,aAAa,CAAC;AACjC,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,OAAO,EACN,gCAAgC,EAChC,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,GACR,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE3F,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB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YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACX,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzF,YAAY,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,MAAM,EACN,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,UAAU,EACV,cAAc,EACd,SAAS,EACT,UAAU,GACV,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as OutputError, a as layerCallback, b as RegistryUnreachableError, c as ArchiveError, d as InvalidInputFileError, f as InvalidSpecError, g as NoMatchingVersionsError, h as LockfileOutOfDateError, i as emit, l as AuthenticationError, m as LockfileIncompleteError, n as createArchive, o as layerSilent, p as LockfileError, r as Progress, s as makeCollector, t as Archiver, u as IntegrityError, v as PackageNotFoundError, x as VersionNotFoundError, y as RegistryResponseError } from "./archive-DmF9XNl7.js";
1
+ import { S as VersionNotFoundError, _ as OutputError, a as layerCallback, b as RegistryResponseUnavailableError, c as ArchiveError, d as InvalidInputFileError, f as InvalidSpecError, g as NoMatchingVersionsError, h as LockfileOutOfDateError, i as emit, l as AuthenticationError, m as LockfileIncompleteError, n as createArchive, o as layerSilent, p as LockfileError, r as Progress, s as makeCollector, t as Archiver, u as IntegrityError, v as PackageNotFoundError, x as RegistryUnreachableError, y as RegistryResponseError } from "./archive-D1AFjtiX.js";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Option from "effect/Option";
4
4
  import * as Schema from "effect/Schema";
@@ -2925,5 +2925,5 @@ const prepareOutputDir = (resolution, options) => Effect.gen(function* () {
2925
2925
  });
2926
2926
 
2927
2927
  //#endregion
2928
- export { ArchiveError, Archiver, ArtifactKind, AuthenticationError, DirectOnlyKind, EdgeKind, InputFileKind, IntegrityError, InvalidInputFileError, InvalidSpecError, Layout, Layouts, LockedRootKind, LockfileError, LockfileFormat, LockfileIncompleteError, LockfileOutOfDateError, MANIFEST_FILE, MANIFEST_VERSION, NoMatchingVersionsError, OptionalFlagRecordOrAbsentSchema, OptionalFlagRecordSchema, OptionalStringArraySchema, OptionalStringRecordSchema, OutputError, PackageNotFoundError, Phase, Progress, README_FILE, Registry, RegistryResponseError, RegistryUnreachableError, StringArraySchema, StringRecordSchema, VersionNotFoundError, allPlatforms, buildManifest, bundle, bundleLocked, bundleResolved, createArchive, dedupeSpecs, defaultBundleOptions, defaultInputFileOptions, defaultResolveOptions, defaultScope, detectLockfile, digestOf, emit as emitProgress, formatByLockfileName, formatPlatformFilter, formatSelector, formatSpec, hexDigestOf, importGuide, indexPackages, isIncluded, isRecord, layerCallback as layerCallbackProgress, layerSilent as layerSilentProgress, lockfileNamesFor, makeCollector as makeProgressCollector, packageKey, packagePath, parseDependencyTarget, parseInputFile, parseIntegrity, parseLockfile, parsePlatformTarget, parseSpec, parseSpecs, perSpecArchiveName, plan, planLocked, plannedOutputs, platformTargets, readInputFile, resolve, resolveLocked, selectVersions, serializeManifest, singleArchiveName, splitName, summarize, tarballFileName, tolerant, verify as verifyIntegrity, withLayout };
2928
+ export { ArchiveError, Archiver, ArtifactKind, AuthenticationError, DirectOnlyKind, EdgeKind, InputFileKind, IntegrityError, InvalidInputFileError, InvalidSpecError, Layout, Layouts, LockedRootKind, LockfileError, LockfileFormat, LockfileIncompleteError, LockfileOutOfDateError, MANIFEST_FILE, MANIFEST_VERSION, NoMatchingVersionsError, OptionalFlagRecordOrAbsentSchema, OptionalFlagRecordSchema, OptionalStringArraySchema, OptionalStringRecordSchema, OutputError, PackageNotFoundError, Phase, Progress, README_FILE, Registry, RegistryResponseError, RegistryResponseUnavailableError, RegistryUnreachableError, StringArraySchema, StringRecordSchema, VersionNotFoundError, allPlatforms, buildManifest, bundle, bundleLocked, bundleResolved, createArchive, dedupeSpecs, defaultBundleOptions, defaultInputFileOptions, defaultResolveOptions, defaultScope, detectLockfile, digestOf, emit as emitProgress, formatByLockfileName, formatPlatformFilter, formatSelector, formatSpec, hexDigestOf, importGuide, indexPackages, isIncluded, isRecord, layerCallback as layerCallbackProgress, layerSilent as layerSilentProgress, lockfileNamesFor, makeCollector as makeProgressCollector, packageKey, packagePath, parseDependencyTarget, parseInputFile, parseIntegrity, parseLockfile, parsePlatformTarget, parseSpec, parseSpecs, perSpecArchiveName, plan, planLocked, plannedOutputs, platformTargets, readInputFile, resolve, resolveLocked, selectVersions, serializeManifest, singleArchiveName, splitName, summarize, tarballFileName, tolerant, verify as verifyIntegrity, withLayout };
2929
2929
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { c as ArchiveError, t as Archiver } from "../archive-DmF9XNl7.js";
1
+ import { c as ArchiveError, t as Archiver } from "../archive-D1AFjtiX.js";
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Layer from "effect/Layer";
4
4
  import * as FileSystem from "effect/FileSystem";
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@packall/core",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Registry-agnostic engine for bundling npm packages and their full dependency closure for offline import.",
5
5
  "homepage": "https://packall.vercel.app",
6
6
  "bugs": {
7
- "url": "https://gitlab.com/yeleveley/packall/-/issues"
7
+ "url": "https://gitlab.com/yelev/packall/-/issues"
8
8
  },
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://gitlab.com/yeleveley/packall.git",
12
+ "url": "git+https://gitlab.com/yelev/packall.git",
13
13
  "directory": "packages/core"
14
14
  },
15
15
  "files": [
package/src/errors.ts CHANGED
@@ -19,6 +19,7 @@ export type BundlerError =
19
19
  | LockfileIncompleteError
20
20
  | LockfileOutOfDateError
21
21
  | RegistryUnreachableError
22
+ | RegistryResponseUnavailableError
22
23
  | PackageNotFoundError
23
24
  | VersionNotFoundError
24
25
  | NoMatchingVersionsError
@@ -177,6 +178,23 @@ export class RegistryUnreachableError extends BundlerErrorBase {
177
178
 
178
179
  const NETWORK_HINT = "Check your network connection, VPN, and the proxy settings in your .npmrc.";
179
180
 
181
+ /** No response was exposed, so neither an HTTP status nor a network failure can be claimed. */
182
+ export class RegistryResponseUnavailableError extends BundlerErrorBase {
183
+ readonly _tag = "RegistryResponseUnavailableError" as const;
184
+ readonly registry: string;
185
+ readonly packageName: string;
186
+ constructor(registry: string, packageName: string, options?: { cause?: unknown }) {
187
+ super(
188
+ `No readable response from ${registry} while fetching "${packageName}".\n` +
189
+ ` The requested package or file may not exist, the registry may block this environment, or the network may be unavailable.\n` +
190
+ ` Check the package name and registry access, or run the command locally for a more specific error.`,
191
+ options,
192
+ );
193
+ this.registry = registry;
194
+ this.packageName = packageName;
195
+ }
196
+ }
197
+
180
198
  /** The registry answered, but has never heard of this package. */
181
199
  export class PackageNotFoundError extends BundlerErrorBase {
182
200
  readonly _tag = "PackageNotFoundError" as const;
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ export {
23
23
  OutputError,
24
24
  PackageNotFoundError,
25
25
  RegistryResponseError,
26
+ RegistryResponseUnavailableError,
26
27
  RegistryUnreachableError,
27
28
  VersionNotFoundError,
28
29
  } from "./errors.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"archive-DmF9XNl7.js","names":["layerSilent: Layer.Layer<Progress>","Progress.emit"],"sources":["../src/errors.ts","../src/progress.ts","../src/archive.ts"],"sourcesContent":["/**\n * Failure types for the bundler.\n *\n * These are deliberately plain classes carrying a literal `_tag` rather than\n * `Data.TaggedError`. They work with `Effect.catchTag` / `Effect.catchTags`\n * exactly the same way, and they keep the public error surface independent of\n * any single Effect release — useful while Effect v4 is still in beta.\n *\n * Every error carries enough context to be actionable without a stack trace,\n * because the primary consumer is somebody staring at a terminal on a\n * locked-down network trying to work out why a download did not happen.\n */\n\n/** Discriminant union of every failure the bundler can produce. */\nexport type BundlerError =\n\t| InvalidSpecError\n\t| InvalidInputFileError\n\t| LockfileError\n\t| LockfileIncompleteError\n\t| LockfileOutOfDateError\n\t| RegistryUnreachableError\n\t| PackageNotFoundError\n\t| VersionNotFoundError\n\t| NoMatchingVersionsError\n\t| RegistryResponseError\n\t| AuthenticationError\n\t| IntegrityError\n\t| ArchiveError\n\t| OutputError;\n\nabstract class BundlerErrorBase extends Error {\n\tabstract readonly _tag: string;\n\tconstructor(message: string, options?: ErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.name = new.target.name;\n\t}\n}\n\n/** A package spec on the command line or in an input file could not be parsed. */\nexport class InvalidSpecError extends BundlerErrorBase {\n\treadonly _tag = \"InvalidSpecError\" as const;\n\treadonly spec: string;\n\treadonly reason: string;\n\tconstructor(spec: string, reason: string) {\n\t\tsuper(`Invalid package spec ${JSON.stringify(spec)}: ${reason}`);\n\t\tthis.spec = spec;\n\t\tthis.reason = reason;\n\t}\n}\n\n/** `--file` pointed at something that is neither a usable package.json nor a spec list. */\nexport class InvalidInputFileError extends BundlerErrorBase {\n\treadonly _tag = \"InvalidInputFileError\" as const;\n\treadonly path: string;\n\treadonly reason: string;\n\tconstructor(path: string, reason: string, options?: { cause?: unknown }) {\n\t\tsuper(`Cannot read specs from ${path}: ${reason}`, options);\n\t\tthis.path = path;\n\t\tthis.reason = reason;\n\t}\n}\n\n/** A lockfile could not be read, or is in a format we do not support. */\nexport class LockfileError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileError\" as const;\n\treadonly path: string;\n\treadonly reason: string;\n\tconstructor(path: string, reason: string, options?: { cause?: unknown }) {\n\t\t// Opens with \"Lockfile\" so the renderer's tag prefix does not stutter, and\n\t\t// because not every reason is a read failure — \"does not cover this\n\t\t// package\" is about a file that read perfectly well.\n\t\tsuper(`Lockfile ${path}: ${reason}`, options);\n\t\tthis.path = path;\n\t\tthis.reason = reason;\n\t}\n}\n\n/**\n * The lockfile parsed, but does not pin everything the bundle needs.\n *\n * Falling back to a range here would defeat the entire point of reading a\n * lockfile — you would get a bundle that is *mostly* what CI installed, with no\n * indication of which parts were guessed. So this is fatal, and it names every\n * gap at once so one `npm install` fixes all of them.\n */\nexport class LockfileIncompleteError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileIncompleteError\" as const;\n\treadonly path: string;\n\treadonly missing: ReadonlyArray<string>;\n\tconstructor(path: string, missing: ReadonlyArray<string>, detail: string, remedy: string) {\n\t\tconst shown = missing\n\t\t\t.slice(0, 10)\n\t\t\t.map((entry) => ` ${entry}`)\n\t\t\t.join(\"\\n\");\n\t\tconst rest = missing.length > 10 ? `\\n … and ${missing.length - 10} more` : \"\";\n\t\tsuper(\n\t\t\t`${path} is incomplete — ${detail}:\\n${shown}${rest}\\n` +\n\t\t\t\t` ${remedy}\\n` +\n\t\t\t\t` Or pass --lockfile off to resolve version ranges fresh instead.`,\n\t\t);\n\t\tthis.path = path;\n\t\tthis.missing = missing;\n\t}\n}\n\n/**\n * The lockfile pins versions the registry no longer serves.\n *\n * Unpublished, or never mirrored into a private registry. Either way the\n * bundle cannot be built as specified, and quietly substituting a nearby\n * version would produce exactly the mismatch this feature exists to prevent.\n */\nexport class LockfileOutOfDateError extends BundlerErrorBase {\n\treadonly _tag = \"LockfileOutOfDateError\" as const;\n\treadonly path: string;\n\treadonly registry: string;\n\treadonly missing: ReadonlyArray<{ readonly name: string; readonly version: string }>;\n\tconstructor(\n\t\tpath: string,\n\t\tregistry: string,\n\t\tmissing: ReadonlyArray<{\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly detail: string;\n\t\t}>,\n\t) {\n\t\tconst shown = missing\n\t\t\t.slice(0, 10)\n\t\t\t.map((entry) => ` ${entry.name}@${entry.version} — ${entry.detail}`)\n\t\t\t.join(\"\\n\");\n\t\tconst rest = missing.length > 10 ? `\\n … and ${missing.length - 10} more` : \"\";\n\t\tsuper(\n\t\t\t`${path} pins ${missing.length} version${missing.length === 1 ? \"\" : \"s\"} ` +\n\t\t\t\t`that ${registry} does not serve:\\n${shown}${rest}\\n` +\n\t\t\t\t` Refresh the lockfile against this registry, or pass --lockfile off to\\n` +\n\t\t\t\t` resolve version ranges fresh instead.`,\n\t\t);\n\t\tthis.path = path;\n\t\tthis.registry = registry;\n\t\tthis.missing = missing.map(({ name, version }) => ({ name, version }));\n\t}\n}\n\n/**\n * The registry could not be reached at all — DNS failure, refused connection,\n * a certificate the machine does not trust, proxy blackhole, or a preflight\n * that timed out.\n *\n * This is the error that fixes \"hangs forever with no network\": we surface it\n * quickly and say which host we could not reach.\n */\nexport class RegistryUnreachableError extends BundlerErrorBase {\n\treadonly _tag = \"RegistryUnreachableError\" as const;\n\treadonly registry: string;\n\treadonly timeoutMs: number | undefined;\n\t/**\n\t * `hint` replaces the closing line of advice.\n\t *\n\t * The default suits the common case and is wrong for at least one: a\n\t * rejected certificate is not a network problem, and telling somebody to\n\t * check their VPN sends them to look at the one thing that is working. The\n\t * backend knows which failure it saw, so it is the backend that gets to say.\n\t */\n\tconstructor(\n\t\tregistry: string,\n\t\tdetail: string,\n\t\toptions?: { cause?: unknown; timeoutMs?: number; hint?: string | undefined },\n\t) {\n\t\tsuper(\n\t\t\t`Cannot reach registry ${registry}: ${detail}.\\n ${options?.hint ?? NETWORK_HINT}`,\n\t\t\toptions,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.timeoutMs = options?.timeoutMs;\n\t}\n}\n\nconst NETWORK_HINT = \"Check your network connection, VPN, and the proxy settings in your .npmrc.\";\n\n/** The registry answered, but has never heard of this package. */\nexport class PackageNotFoundError extends BundlerErrorBase {\n\treadonly _tag = \"PackageNotFoundError\" as const;\n\treadonly packageName: string;\n\treadonly registry: string;\n\tconstructor(packageName: string, registry: string) {\n\t\tsuper(`Package \"${packageName}\" was not found on ${registry}`);\n\t\tthis.packageName = packageName;\n\t\tthis.registry = registry;\n\t}\n}\n\n/** The package exists but the exact version requested does not. */\nexport class VersionNotFoundError extends BundlerErrorBase {\n\treadonly _tag = \"VersionNotFoundError\" as const;\n\treadonly packageName: string;\n\treadonly version: string;\n\treadonly available: ReadonlyArray<string>;\n\tconstructor(packageName: string, version: string, available: ReadonlyArray<string>) {\n\t\tconst tail = available.slice(-5).join(\", \");\n\t\tsuper(\n\t\t\t`${packageName}@${version} does not exist.` +\n\t\t\t\t(tail.length > 0 ? ` Most recent published versions: ${tail}` : \"\"),\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.version = version;\n\t\tthis.available = available;\n\t}\n}\n\n/** A range (or dist-tag) matched nothing that is actually published. */\nexport class NoMatchingVersionsError extends BundlerErrorBase {\n\treadonly _tag = \"NoMatchingVersionsError\" as const;\n\treadonly packageName: string;\n\treadonly selector: string;\n\treadonly available: ReadonlyArray<string>;\n\tconstructor(packageName: string, selector: string, available: ReadonlyArray<string>) {\n\t\tconst tail = available.slice(-5).join(\", \");\n\t\tsuper(\n\t\t\t`No published version of ${packageName} satisfies \"${selector}\".` +\n\t\t\t\t(tail.length > 0 ? ` Most recent published versions: ${tail}` : \"\"),\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.selector = selector;\n\t\tthis.available = available;\n\t}\n}\n\n/** The registry responded, but with something we cannot use. */\nexport class RegistryResponseError extends BundlerErrorBase {\n\treadonly _tag = \"RegistryResponseError\" as const;\n\treadonly url: string;\n\treadonly status: number | undefined;\n\tconstructor(url: string, detail: string, options?: { cause?: unknown; status?: number }) {\n\t\tsuper(`Unexpected response from ${url}: ${detail}`, options);\n\t\tthis.url = url;\n\t\tthis.status = options?.status;\n\t}\n}\n\n/** 401/403 — almost always a missing or stale token in `.npmrc`. */\nexport class AuthenticationError extends BundlerErrorBase {\n\treadonly _tag = \"AuthenticationError\" as const;\n\treadonly registry: string;\n\treadonly status: number;\n\tconstructor(registry: string, status: number, packageName?: string) {\n\t\tsuper(\n\t\t\t`Registry ${registry} rejected the request with HTTP ${status}` +\n\t\t\t\t(packageName ? ` while fetching \"${packageName}\"` : \"\") +\n\t\t\t\t`.\\n Add credentials to your .npmrc, e.g.\\n` +\n\t\t\t\t` //${safeHost(registry)}/:_authToken=\\${NPM_TOKEN}`,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.status = status;\n\t}\n}\n\n/**\n * A downloaded tarball did not match the checksum the registry advertised.\n *\n * Never soft-fail this: a bundle is a supply-chain artifact and a corrupt or\n * substituted tarball is exactly what integrity checking exists to catch.\n */\nexport class IntegrityError extends BundlerErrorBase {\n\treadonly _tag = \"IntegrityError\" as const;\n\treadonly packageName: string;\n\treadonly version: string;\n\treadonly expected: string;\n\treadonly actual: string;\n\tconstructor(packageName: string, version: string, expected: string, actual: string) {\n\t\tsuper(\n\t\t\t`Integrity check failed for ${packageName}@${version}.\\n` +\n\t\t\t\t` expected: ${expected}\\n` +\n\t\t\t\t` actual: ${actual}\\n` +\n\t\t\t\t` The download was discarded. This is either corruption in transit or a tampered artifact.`,\n\t\t);\n\t\tthis.packageName = packageName;\n\t\tthis.version = version;\n\t\tthis.expected = expected;\n\t\tthis.actual = actual;\n\t}\n}\n\n/** Something went wrong writing the `.tgz`. */\nexport class ArchiveError extends BundlerErrorBase {\n\treadonly _tag = \"ArchiveError\" as const;\n\treadonly path: string;\n\tconstructor(path: string, detail: string, options?: { cause?: unknown }) {\n\t\tsuper(`Failed to create archive ${path}: ${detail}`, options);\n\t\tthis.path = path;\n\t}\n}\n\n/** Something went wrong preparing or writing to the output directory. */\nexport class OutputError extends BundlerErrorBase {\n\treadonly _tag = \"OutputError\" as const;\n\treadonly path: string;\n\tconstructor(path: string, detail: string, options?: { cause?: unknown }) {\n\t\tsuper(`Output error at ${path}: ${detail}`, options);\n\t\tthis.path = path;\n\t}\n}\n\nconst safeHost = (registry: string): string => {\n\ttry {\n\t\tconst url = new URL(registry);\n\t\treturn url.host + url.pathname.replace(/\\/+$/, \"\");\n\t} catch {\n\t\treturn registry;\n\t}\n};\n","/**\n * Progress reporting.\n *\n * The engine emits structured events; it never writes to a terminal. That\n * separation is what lets the CLI draw a live TTY view, CI print plain lines,\n * and the test suite assert on an array of events without any of them\n * interfering with each other.\n */\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Ref from \"effect/Ref\";\n\nimport type { Phase } from \"./enums/phase.js\";\n\n/** A structured progress event. */\nexport type ProgressEvent =\n\t/** A phase began. `total` is set only when it is known up front. */\n\t| { readonly _tag: \"PhaseStarted\"; readonly phase: Phase; readonly total?: number | undefined }\n\t/** A phase finished. */\n\t| { readonly _tag: \"PhaseCompleted\"; readonly phase: Phase }\n\t/** The resolver discovered a package that has to be included. */\n\t| {\n\t\t\treadonly _tag: \"PackageResolved\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\t/** Running count of resolved packages, for a live counter. */\n\t\t\treadonly resolvedCount: number;\n\t\t\t/** Packages still queued for resolution. */\n\t\t\treadonly pendingCount: number;\n\t }\n\t/** A tarball download started. */\n\t| { readonly _tag: \"DownloadStarted\"; readonly name: string; readonly version: string }\n\t/** A tarball download finished. */\n\t| {\n\t\t\treadonly _tag: \"DownloadCompleted\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly bytes: number;\n\t\t\treadonly completedCount: number;\n\t\t\treadonly totalCount: number;\n\t }\n\t/** A download failed and will be retried. */\n\t| {\n\t\t\treadonly _tag: \"DownloadRetrying\";\n\t\t\treadonly name: string;\n\t\t\treadonly version: string;\n\t\t\treadonly attempt: number;\n\t\t\treadonly reason: string;\n\t }\n\t/** An archive is being written. */\n\t| { readonly _tag: \"ArchiveStarted\"; readonly path: string; readonly entryCount: number }\n\t/** An archive finished. */\n\t| { readonly _tag: \"ArchiveCompleted\"; readonly path: string; readonly bytes: number }\n\t/** Something noteworthy but non-fatal, e.g. a deprecated package. */\n\t| { readonly _tag: \"Warning\"; readonly message: string };\n\nexport declare namespace Progress {\n\t/** The reporting sink. */\n\texport type Service = {\n\t\treadonly emit: (event: ProgressEvent) => Effect.Effect<void>;\n\t};\n}\n\n/** Service tag for progress reporting. */\nexport class Progress extends Context.Service<Progress, Progress.Service>()(\n\t\"@packall/core/Progress\",\n) {}\n\n/** Emits an event to whichever reporter is installed. */\nexport const emit = (event: ProgressEvent): Effect.Effect<void, never, Progress> =>\n\tEffect.gen(function* () {\n\t\tconst progress = yield* Progress;\n\t\tyield* progress.emit(event);\n\t});\n\n/**\n * Discards every event.\n *\n * The default for library consumers and for tests that do not care about\n * progress — silence should never require ceremony.\n */\nexport const layerSilent: Layer.Layer<Progress> = Layer.succeed(Progress)({\n\temit: () => Effect.void,\n});\n\n/** Sends every event to a callback. Used by the CLI renderer. */\nexport const layerCallback = (onEvent: (event: ProgressEvent) => void): Layer.Layer<Progress> =>\n\tLayer.succeed(Progress)({\n\t\temit: (event) => Effect.sync(() => onEvent(event)),\n\t});\n\n/**\n * Accumulates every event into a `Ref`, for assertions.\n *\n * Returned as `{ layer, events }` so a test can provide the layer and then read\n * the transcript afterwards.\n */\nexport const makeCollector = Effect.gen(function* () {\n\tconst ref = yield* Ref.make<ReadonlyArray<ProgressEvent>>([]);\n\tconst layer = Layer.succeed(Progress)({\n\t\temit: (event: ProgressEvent) => Ref.update(ref, (events) => [...events, event]),\n\t});\n\treturn { layer, events: Ref.get(ref) } as const;\n});\n","/**\n * Turning a staged directory tree into a gzipped tarball.\n *\n * A service rather than a function, because packing is the one step that has\n * to be implemented differently per platform. Everywhere else the engine\n * reaches the disk through `effect/FileSystem`, which is what lets an in-memory\n * filesystem carry the whole pipeline — but a tar writer is not filesystem\n * access, it is a format, and `node-tar` reads the paths it is given with\n * Node's own `fs` rather than through the injected service. Left as a direct\n * call, packing would quietly bypass the abstraction the rest of the engine\n * depends on, which stays invisible until something other than Node provides\n * the filesystem.\n *\n * The implementations live outside this module — `@packall/core/node` for\n * Node, a Web Streams writer in the browser — so nothing platform-specific is\n * reachable from the engine's own graph.\n */\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport type * as FileSystem from \"effect/FileSystem\";\nimport type { PlatformError } from \"effect/PlatformError\";\n\nimport type { ArchiveError } from \"./errors.js\";\nimport * as Progress from \"./progress.js\";\n\n/** A finished archive. */\nexport type ArchiveResult = {\n\treadonly path: string;\n\treadonly bytes: number;\n};\n\n/** What to pack, and where to put it. */\nexport type CreateArchiveOptions = {\n\treadonly cwd: string;\n\t/** Entry paths, relative to `cwd`. */\n\treadonly entries: ReadonlyArray<string>;\n\treadonly outPath: string;\n\treadonly gzipLevel?: number | undefined;\n};\n\nexport declare namespace Archiver {\n\t/** The packing backend. */\n\texport type Service = {\n\t\t/**\n\t\t * Packs `entries` (paths relative to `cwd`) into a gzipped tar at\n\t\t * `outPath`.\n\t\t *\n\t\t * Implementations must produce byte-identical output for identical inputs —\n\t\t * normalised uid/gid/mtime, entries in a stable order — because a security\n\t\t * team diffing two bundles, or re-deriving one from its manifest, is a\n\t\t * thing that actually happens.\n\t\t */\n\t\treadonly create: (\n\t\t\toptions: CreateArchiveOptions,\n\t\t) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, FileSystem.FileSystem>;\n\t};\n}\n\n/** Service tag for archive creation. */\nexport class Archiver extends Context.Service<Archiver, Archiver.Service>()(\n\t\"@packall/core/Archiver\",\n) {}\n\n/**\n * Packs an archive with whichever backend is installed.\n *\n * The progress events are emitted here rather than inside the backends, so\n * every implementation reports identically and a new one cannot forget to.\n */\nexport const createArchive = (\n\toptions: CreateArchiveOptions,\n): Effect.Effect<\n\tArchiveResult,\n\tArchiveError | PlatformError,\n\tArchiver | FileSystem.FileSystem | Progress.Progress\n> =>\n\tEffect.gen(function* () {\n\t\tconst archiver = yield* Archiver;\n\n\t\tyield* Progress.emit({\n\t\t\t_tag: \"ArchiveStarted\",\n\t\t\tpath: options.outPath,\n\t\t\tentryCount: options.entries.length,\n\t\t});\n\n\t\tconst result = yield* archiver.create(options);\n\n\t\tyield* Progress.emit({\n\t\t\t_tag: \"ArchiveCompleted\",\n\t\t\tpath: result.path,\n\t\t\tbytes: result.bytes,\n\t\t});\n\n\t\treturn result;\n\t});\n"],"mappings":";;;;;;AA8BA,IAAe,mBAAf,cAAwC,MAAM;CAE7C,YAAY,SAAiB,SAAwB;AACpD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO,IAAI,OAAO;;;;AAKzB,IAAa,mBAAb,cAAsC,iBAAiB;CACtD,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,YAAY,MAAc,QAAgB;AACzC,QAAM,wBAAwB,KAAK,UAAU,KAAK,CAAC,IAAI,SAAS;AAChE,OAAK,OAAO;AACZ,OAAK,SAAS;;;;AAKhB,IAAa,wBAAb,cAA2C,iBAAiB;CAC3D,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,YAAY,MAAc,QAAgB,SAA+B;AACxE,QAAM,0BAA0B,KAAK,IAAI,UAAU,QAAQ;AAC3D,OAAK,OAAO;AACZ,OAAK,SAAS;;;;AAKhB,IAAa,gBAAb,cAAmC,iBAAiB;CACnD,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,YAAY,MAAc,QAAgB,SAA+B;AAIxE,QAAM,YAAY,KAAK,IAAI,UAAU,QAAQ;AAC7C,OAAK,OAAO;AACZ,OAAK,SAAS;;;;;;;;;;;AAYhB,IAAa,0BAAb,cAA6C,iBAAiB;CAC7D,AAAS,OAAO;CAChB,AAAS;CACT,AAAS;CACT,YAAY,MAAc,SAAgC,QAAgB,QAAgB;EACzF,MAAM,QAAQ,QACZ,MAAM,GAAG,GAAG,CACZ,KAAK,UAAU,OAAO,QAA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