@packall/core 0.1.0 → 0.2.0

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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/archive-6sqTn1C4.js +274 -0
  4. package/dist/archive-6sqTn1C4.js.map +1 -0
  5. package/dist/archive.d.ts +47 -15
  6. package/dist/archive.d.ts.map +1 -1
  7. package/dist/bundle.d.ts +6 -3
  8. package/dist/bundle.d.ts.map +1 -1
  9. package/dist/dependency-range.d.ts.map +1 -1
  10. package/dist/download.d.ts +2 -1
  11. package/dist/download.d.ts.map +1 -1
  12. package/dist/enums/artifact-kind.d.ts.map +1 -1
  13. package/dist/enums/edge-kind.d.ts.map +1 -1
  14. package/dist/enums/input-file-kind.d.ts.map +1 -1
  15. package/dist/enums/layout.d.ts.map +1 -1
  16. package/dist/enums/lockfile-format.d.ts.map +1 -1
  17. package/dist/enums/phase.d.ts.map +1 -1
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/index.d.ts +12 -10
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +169 -344
  22. package/dist/index.js.map +1 -1
  23. package/dist/input-file.d.ts.map +1 -1
  24. package/dist/integrity.d.ts +37 -5
  25. package/dist/integrity.d.ts.map +1 -1
  26. package/dist/layout.d.ts +41 -7
  27. package/dist/layout.d.ts.map +1 -1
  28. package/dist/locked-resolve.d.ts.map +1 -1
  29. package/dist/lockfile/bun.d.ts.map +1 -1
  30. package/dist/lockfile/detect.d.ts.map +1 -1
  31. package/dist/lockfile/json.d.ts.map +1 -1
  32. package/dist/lockfile/names.d.ts.map +1 -1
  33. package/dist/lockfile/npm.d.ts.map +1 -1
  34. package/dist/lockfile/parse.d.ts.map +1 -1
  35. package/dist/lockfile/pnpm.d.ts.map +1 -1
  36. package/dist/lockfile/tree-builder.d.ts.map +1 -1
  37. package/dist/lockfile/types.d.ts.map +1 -1
  38. package/dist/manifest.d.ts.map +1 -1
  39. package/dist/node/archiver.d.ts +5 -0
  40. package/dist/node/archiver.d.ts.map +1 -0
  41. package/dist/node/index.d.ts +13 -0
  42. package/dist/node/index.d.ts.map +1 -0
  43. package/dist/node/index.js +55 -0
  44. package/dist/node/index.js.map +1 -0
  45. package/dist/options.d.ts +3 -3
  46. package/dist/options.d.ts.map +1 -1
  47. package/dist/platform.d.ts +5 -10
  48. package/dist/platform.d.ts.map +1 -1
  49. package/dist/progress.d.ts.map +1 -1
  50. package/dist/registry.d.ts.map +1 -1
  51. package/dist/resolve.d.ts.map +1 -1
  52. package/dist/schemas/lenient.d.ts.map +1 -1
  53. package/dist/schemas/package-json.d.ts.map +1 -1
  54. package/dist/spec.d.ts.map +1 -1
  55. package/dist/types/value-of.d.ts.map +1 -1
  56. package/dist/utils/is-record.d.ts.map +1 -1
  57. package/package.json +11 -10
  58. package/src/archive.ts +95 -92
  59. package/src/bundle.ts +736 -616
  60. package/src/dependency-range.ts +121 -115
  61. package/src/download.ts +155 -133
  62. package/src/enums/artifact-kind.ts +5 -5
  63. package/src/enums/edge-kind.ts +13 -13
  64. package/src/enums/input-file-kind.ts +9 -9
  65. package/src/enums/layout.ts +20 -20
  66. package/src/enums/lockfile-format.ts +6 -6
  67. package/src/enums/phase.ts +8 -8
  68. package/src/errors.ts +200 -198
  69. package/src/index.ts +126 -113
  70. package/src/input-file.ts +246 -234
  71. package/src/integrity.ts +165 -121
  72. package/src/layout.ts +63 -29
  73. package/src/locked-resolve.ts +471 -461
  74. package/src/lockfile/bun.ts +214 -207
  75. package/src/lockfile/detect.ts +80 -80
  76. package/src/lockfile/json.ts +91 -92
  77. package/src/lockfile/names.ts +9 -9
  78. package/src/lockfile/npm.ts +328 -308
  79. package/src/lockfile/parse.ts +32 -32
  80. package/src/lockfile/pnpm.ts +230 -225
  81. package/src/lockfile/tree-builder.ts +116 -116
  82. package/src/lockfile/types.ts +52 -52
  83. package/src/manifest.ts +129 -133
  84. package/src/node/archiver.ts +85 -0
  85. package/src/node/index.ts +13 -0
  86. package/src/options.ts +84 -84
  87. package/src/platform.ts +97 -101
  88. package/src/progress.ts +105 -106
  89. package/src/registry.ts +116 -115
  90. package/src/resolve.ts +560 -537
  91. package/src/schemas/lenient.ts +67 -60
  92. package/src/schemas/package-json.ts +11 -10
  93. package/src/spec.ts +123 -119
  94. package/src/types/value-of.ts +1 -1
  95. package/src/utils/is-record.ts +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 YL
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @packall/core
2
+
3
+ The registry-agnostic engine behind packall. It resolves package specs, walks their
4
+ dependency closures, verifies downloads, and writes registry-shaped bundle artifacts.
5
+ The engine does not know how a registry speaks HTTP: that boundary is the `Registry`
6
+ service.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install @packall/core effect
12
+ ```
13
+
14
+ `effect` is a peer dependency. The default entry point is browser-safe. Node-specific
15
+ archive support is available explicitly from `@packall/core/node`.
16
+
17
+ ## Registry service
18
+
19
+ Implement or provide `Registry` when embedding the engine. A registry backend supplies
20
+ three operations:
21
+
22
+ - `preflight` checks that the registry is reachable.
23
+ - `packument(name)` reads package metadata and published versions.
24
+ - `download(manifest)` returns the tarball bytes for a resolved package.
25
+
26
+ The engine then handles resolution, lockfile pinning, platform filtering, integrity
27
+ verification, progress reporting, manifests, layouts, and archive planning.
28
+
29
+ ## Bundle from code
30
+
31
+ ```ts
32
+ import * as Effect from "effect/Effect";
33
+ import { bundle, defaultBundleOptions, parseSpec, Registry } from "@packall/core";
34
+
35
+ const program = Effect.gen(function* () {
36
+ // The surrounding Effect runtime provides Registry, Progress, filesystem,
37
+ // crypto, and the Node archive layer.
38
+ yield* Registry;
39
+ return yield* bundle([parseSpec("react@18.2.0")], {
40
+ ...defaultBundleOptions,
41
+ outDir: "./bundles",
42
+ toolVersion: "example",
43
+ });
44
+ });
45
+ ```
46
+
47
+ In practice, compose the program with an Effect layer that provides `Registry`,
48
+ `Progress`, and the archive backend. The public API also exposes `plan`, `resolve`,
49
+ `resolveLocked`, `bundleLocked`, input-file parsing, lockfile parsing, and manifest
50
+ helpers for applications that need more control than `bundle` provides.
51
+
52
+ See the [packall documentation](https://packall.localhost/docs) and the
53
+ [`@packall/core` API reference](https://packall.localhost/docs/api/core) for the full
54
+ typed surface.
55
+
56
+ ## License
57
+
58
+ MIT
@@ -0,0 +1,274 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Context from "effect/Context";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Ref from "effect/Ref";
5
+
6
+ //#region src/errors.ts
7
+ var BundlerErrorBase = class extends Error {
8
+ constructor(message, options) {
9
+ super(message, options);
10
+ this.name = new.target.name;
11
+ }
12
+ };
13
+ /** A package spec on the command line or in an input file could not be parsed. */
14
+ var InvalidSpecError = class extends BundlerErrorBase {
15
+ _tag = "InvalidSpecError";
16
+ spec;
17
+ reason;
18
+ constructor(spec, reason) {
19
+ super(`Invalid package spec ${JSON.stringify(spec)}: ${reason}`);
20
+ this.spec = spec;
21
+ this.reason = reason;
22
+ }
23
+ };
24
+ /** `--file` pointed at something that is neither a usable package.json nor a spec list. */
25
+ var InvalidInputFileError = class extends BundlerErrorBase {
26
+ _tag = "InvalidInputFileError";
27
+ path;
28
+ reason;
29
+ constructor(path, reason, options) {
30
+ super(`Cannot read specs from ${path}: ${reason}`, options);
31
+ this.path = path;
32
+ this.reason = reason;
33
+ }
34
+ };
35
+ /** A lockfile could not be read, or is in a format we do not support. */
36
+ var LockfileError = class extends BundlerErrorBase {
37
+ _tag = "LockfileError";
38
+ path;
39
+ reason;
40
+ constructor(path, reason, options) {
41
+ super(`Lockfile ${path}: ${reason}`, options);
42
+ this.path = path;
43
+ this.reason = reason;
44
+ }
45
+ };
46
+ /**
47
+ * The lockfile parsed, but does not pin everything the bundle needs.
48
+ *
49
+ * Falling back to a range here would defeat the entire point of reading a
50
+ * lockfile — you would get a bundle that is *mostly* what CI installed, with no
51
+ * indication of which parts were guessed. So this is fatal, and it names every
52
+ * gap at once so one `npm install` fixes all of them.
53
+ */
54
+ var LockfileIncompleteError = class extends BundlerErrorBase {
55
+ _tag = "LockfileIncompleteError";
56
+ path;
57
+ missing;
58
+ constructor(path, missing, detail, remedy) {
59
+ const shown = missing.slice(0, 10).map((entry) => ` ${entry}`).join("\n");
60
+ const rest = missing.length > 10 ? `\n … and ${missing.length - 10} more` : "";
61
+ super(`${path} is incomplete — ${detail}:\n${shown}${rest}\n ${remedy}\n Or pass --lockfile off to resolve version ranges fresh instead.`);
62
+ this.path = path;
63
+ this.missing = missing;
64
+ }
65
+ };
66
+ /**
67
+ * The lockfile pins versions the registry no longer serves.
68
+ *
69
+ * Unpublished, or never mirrored into a private registry. Either way the
70
+ * bundle cannot be built as specified, and quietly substituting a nearby
71
+ * version would produce exactly the mismatch this feature exists to prevent.
72
+ */
73
+ var LockfileOutOfDateError = class extends BundlerErrorBase {
74
+ _tag = "LockfileOutOfDateError";
75
+ path;
76
+ registry;
77
+ missing;
78
+ constructor(path, registry, missing) {
79
+ const shown = missing.slice(0, 10).map((entry) => ` ${entry.name}@${entry.version} — ${entry.detail}`).join("\n");
80
+ const rest = missing.length > 10 ? `\n … and ${missing.length - 10} more` : "";
81
+ super(`${path} pins ${missing.length} version${missing.length === 1 ? "" : "s"} that ${registry} does not serve:\n${shown}${rest}\n Refresh the lockfile against this registry, or pass --lockfile off to\n resolve version ranges fresh instead.`);
82
+ this.path = path;
83
+ this.registry = registry;
84
+ this.missing = missing.map(({ name, version }) => ({
85
+ name,
86
+ version
87
+ }));
88
+ }
89
+ };
90
+ /**
91
+ * The registry could not be reached at all — DNS failure, refused connection,
92
+ * proxy blackhole, or a preflight that timed out.
93
+ *
94
+ * This is the error that fixes "hangs forever with no network": we surface it
95
+ * quickly and say which host we could not reach.
96
+ */
97
+ var RegistryUnreachableError = class extends BundlerErrorBase {
98
+ _tag = "RegistryUnreachableError";
99
+ registry;
100
+ timeoutMs;
101
+ constructor(registry, detail, options) {
102
+ super(`Cannot reach registry ${registry}: ${detail}.\n Check your network connection, VPN, and the proxy settings in your .npmrc.`, options);
103
+ this.registry = registry;
104
+ this.timeoutMs = options?.timeoutMs;
105
+ }
106
+ };
107
+ /** The registry answered, but has never heard of this package. */
108
+ var PackageNotFoundError = class extends BundlerErrorBase {
109
+ _tag = "PackageNotFoundError";
110
+ packageName;
111
+ registry;
112
+ constructor(packageName, registry) {
113
+ super(`Package "${packageName}" was not found on ${registry}`);
114
+ this.packageName = packageName;
115
+ this.registry = registry;
116
+ }
117
+ };
118
+ /** The package exists but the exact version requested does not. */
119
+ var VersionNotFoundError = class extends BundlerErrorBase {
120
+ _tag = "VersionNotFoundError";
121
+ packageName;
122
+ version;
123
+ available;
124
+ constructor(packageName, version, available) {
125
+ const tail = available.slice(-5).join(", ");
126
+ super(`${packageName}@${version} does not exist.` + (tail.length > 0 ? ` Most recent published versions: ${tail}` : ""));
127
+ this.packageName = packageName;
128
+ this.version = version;
129
+ this.available = available;
130
+ }
131
+ };
132
+ /** A range (or dist-tag) matched nothing that is actually published. */
133
+ var NoMatchingVersionsError = class extends BundlerErrorBase {
134
+ _tag = "NoMatchingVersionsError";
135
+ packageName;
136
+ selector;
137
+ available;
138
+ constructor(packageName, selector, available) {
139
+ const tail = available.slice(-5).join(", ");
140
+ super(`No published version of ${packageName} satisfies "${selector}".` + (tail.length > 0 ? ` Most recent published versions: ${tail}` : ""));
141
+ this.packageName = packageName;
142
+ this.selector = selector;
143
+ this.available = available;
144
+ }
145
+ };
146
+ /** The registry responded, but with something we cannot use. */
147
+ var RegistryResponseError = class extends BundlerErrorBase {
148
+ _tag = "RegistryResponseError";
149
+ url;
150
+ status;
151
+ constructor(url, detail, options) {
152
+ super(`Unexpected response from ${url}: ${detail}`, options);
153
+ this.url = url;
154
+ this.status = options?.status;
155
+ }
156
+ };
157
+ /** 401/403 — almost always a missing or stale token in `.npmrc`. */
158
+ var AuthenticationError = class extends BundlerErrorBase {
159
+ _tag = "AuthenticationError";
160
+ registry;
161
+ status;
162
+ constructor(registry, status, packageName) {
163
+ super(`Registry ${registry} rejected the request with HTTP ${status}` + (packageName ? ` while fetching "${packageName}"` : "") + `.\n Add credentials to your .npmrc, e.g.\n //${safeHost(registry)}/:_authToken=\${NPM_TOKEN}`);
164
+ this.registry = registry;
165
+ this.status = status;
166
+ }
167
+ };
168
+ /**
169
+ * A downloaded tarball did not match the checksum the registry advertised.
170
+ *
171
+ * Never soft-fail this: a bundle is a supply-chain artifact and a corrupt or
172
+ * substituted tarball is exactly what integrity checking exists to catch.
173
+ */
174
+ var IntegrityError = class extends BundlerErrorBase {
175
+ _tag = "IntegrityError";
176
+ packageName;
177
+ version;
178
+ expected;
179
+ actual;
180
+ constructor(packageName, version, expected, actual) {
181
+ super(`Integrity check failed for ${packageName}@${version}.\n expected: ${expected}\n actual: ${actual}\n The download was discarded. This is either corruption in transit or a tampered artifact.`);
182
+ this.packageName = packageName;
183
+ this.version = version;
184
+ this.expected = expected;
185
+ this.actual = actual;
186
+ }
187
+ };
188
+ /** Something went wrong writing the `.tgz`. */
189
+ var ArchiveError = class extends BundlerErrorBase {
190
+ _tag = "ArchiveError";
191
+ path;
192
+ constructor(path, detail, options) {
193
+ super(`Failed to create archive ${path}: ${detail}`, options);
194
+ this.path = path;
195
+ }
196
+ };
197
+ /** Something went wrong preparing or writing to the output directory. */
198
+ var OutputError = class extends BundlerErrorBase {
199
+ _tag = "OutputError";
200
+ path;
201
+ constructor(path, detail, options) {
202
+ super(`Output error at ${path}: ${detail}`, options);
203
+ this.path = path;
204
+ }
205
+ };
206
+ const safeHost = (registry) => {
207
+ try {
208
+ const url = new URL(registry);
209
+ return url.host + url.pathname.replace(/\/+$/, "");
210
+ } catch {
211
+ return registry;
212
+ }
213
+ };
214
+
215
+ //#endregion
216
+ //#region src/progress.ts
217
+ /** Service tag for progress reporting. */
218
+ var Progress = class extends Context.Service()("@packall/core/Progress") {};
219
+ /** Emits an event to whichever reporter is installed. */
220
+ const emit = (event) => Effect.gen(function* () {
221
+ yield* (yield* Progress).emit(event);
222
+ });
223
+ /**
224
+ * Discards every event.
225
+ *
226
+ * The default for library consumers and for tests that do not care about
227
+ * progress — silence should never require ceremony.
228
+ */
229
+ const layerSilent = Layer.succeed(Progress)({ emit: () => Effect.void });
230
+ /** Sends every event to a callback. Used by the CLI renderer. */
231
+ const layerCallback = (onEvent) => Layer.succeed(Progress)({ emit: (event) => Effect.sync(() => onEvent(event)) });
232
+ /**
233
+ * Accumulates every event into a `Ref`, for assertions.
234
+ *
235
+ * Returned as `{ layer, events }` so a test can provide the layer and then read
236
+ * the transcript afterwards.
237
+ */
238
+ const makeCollector = Effect.gen(function* () {
239
+ const ref = yield* Ref.make([]);
240
+ return {
241
+ layer: Layer.succeed(Progress)({ emit: (event) => Ref.update(ref, (events) => [...events, event]) }),
242
+ events: Ref.get(ref)
243
+ };
244
+ });
245
+
246
+ //#endregion
247
+ //#region src/archive.ts
248
+ /** Service tag for archive creation. */
249
+ var Archiver = class extends Context.Service()("@packall/core/Archiver") {};
250
+ /**
251
+ * Packs an archive with whichever backend is installed.
252
+ *
253
+ * The progress events are emitted here rather than inside the backends, so
254
+ * every implementation reports identically and a new one cannot forget to.
255
+ */
256
+ const createArchive = (options) => Effect.gen(function* () {
257
+ const archiver = yield* Archiver;
258
+ yield* emit({
259
+ _tag: "ArchiveStarted",
260
+ path: options.outPath,
261
+ entryCount: options.entries.length
262
+ });
263
+ const result = yield* archiver.create(options);
264
+ yield* emit({
265
+ _tag: "ArchiveCompleted",
266
+ path: result.path,
267
+ bytes: result.bytes
268
+ });
269
+ return result;
270
+ });
271
+
272
+ //#endregion
273
+ 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 };
274
+ //# sourceMappingURL=archive-6sqTn1C4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-6sqTn1C4.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 * proxy blackhole, or a preflight 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\tconstructor(\n\t\tregistry: string,\n\t\tdetail: string,\n\t\toptions?: { cause?: unknown; timeoutMs?: number },\n\t) {\n\t\tsuper(\n\t\t\t`Cannot reach registry ${registry}: ${detail}.\\n` +\n\t\t\t\t` Check your network connection, VPN, and the proxy settings in your .npmrc.`,\n\t\t\toptions,\n\t\t);\n\t\tthis.registry = registry;\n\t\tthis.timeoutMs = options?.timeoutMs;\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":";;;;;;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,Y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AO;;;;;;;ACxOT,IAAa,WAAb,cAA8B,QAAQ,SAAqC,CAC1E,yBACA,CAAC;;AAGF,MAAa,QAAQ,UACpB,OAAO,IAAI,aAAa;AAEvB,SADiB,OAAO,UACR,KAAK,MAAM;EAC1B;;;;;;;AAQH,MAAaA,cAAqC,MAAM,QAAQ,SAAS,CAAC,EACzE,YAAY,OAAO,MACnB,CAAC;;AAGF,MAAa,iBAAiB,YAC7B,MAAM,QAAQ,SAAS,CAAC,EACvB,OAAO,UAAU,OAAO,WAAW,QAAQ,MAAM,CAAC,EAClD,CAAC;;;;;;;AAQH,MAAa,gBAAgB,OAAO,IAAI,aAAa;CACpD,MAAM,MAAM,OAAO,IAAI,KAAmC,EAAE,CAAC;AAI7D,QAAO;EAAE,OAHK,MAAM,QAAQ,SAAS,CAAC,EACrC,OAAO,UAAyB,IAAI,OAAO,MAAM,WAAW,CAAC,GAAG,QAAQ,MAAM,CAAC,EAC/E,CAAC;EACc,QAAQ,IAAI,IAAI,IAAI;EAAE;EACrC;;;;;AC7CF,IAAa,WAAb,cAA8B,QAAQ,SAAqC,CAC1E,yBACA,CAAC;;;;;;;AAQF,MAAa,iBACZ,YAMA,OAAO,IAAI,aAAa;CACvB,MAAM,WAAW,OAAO;AAExB,QAAOC,KAAc;EACpB,MAAM;EACN,MAAM,QAAQ;EACd,YAAY,QAAQ,QAAQ;EAC5B,CAAC;CAEF,MAAM,SAAS,OAAO,SAAS,OAAO,QAAQ;AAE9C,QAAOA,KAAc;EACpB,MAAM;EACN,MAAM,OAAO;EACb,OAAO,OAAO;EACd,CAAC;AAEF,QAAO;EACN"}
package/dist/archive.d.ts CHANGED
@@ -1,32 +1,64 @@
1
1
  /**
2
2
  * Turning a staged directory tree into a gzipped tarball.
3
3
  *
4
- * Uses `node-tar`, the same library npm itself packs with. Writing a USTAR
5
- * encoder by hand would be a fun afternoon and a bad idea: scoped package
6
- * paths routinely exceed the 100-byte name field, so correctness depends on
7
- * prefix-splitting and PAX headers that `tar` already gets right.
4
+ * A service rather than a function, because packing is the one step that has
5
+ * to be implemented differently per platform. Everywhere else the engine
6
+ * reaches the disk through `effect/FileSystem`, which is what lets an in-memory
7
+ * filesystem carry the whole pipeline — but a tar writer is not filesystem
8
+ * access, it is a format, and `node-tar` reads the paths it is given with
9
+ * Node's own `fs` rather than through the injected service. Left as a direct
10
+ * call, packing would quietly bypass the abstraction the rest of the engine
11
+ * depends on, which stays invisible until something other than Node provides
12
+ * the filesystem.
13
+ *
14
+ * The implementations live outside this module — `@packall/core/node` for
15
+ * Node, a Web Streams writer in the browser — so nothing platform-specific is
16
+ * reachable from the engine's own graph.
8
17
  */
18
+ import * as Context from "effect/Context";
9
19
  import * as Effect from "effect/Effect";
10
- import * as FileSystem from "effect/FileSystem";
20
+ import type * as FileSystem from "effect/FileSystem";
11
21
  import type { PlatformError } from "effect/PlatformError";
12
- import { ArchiveError } from "./errors.js";
22
+ import type { ArchiveError } from "./errors.js";
13
23
  import * as Progress from "./progress.js";
14
24
  /** A finished archive. */
15
25
  export type ArchiveResult = {
16
26
  readonly path: string;
17
27
  readonly bytes: number;
18
28
  };
19
- /**
20
- * Packs `entries` (paths relative to `cwd`) into a gzipped tar at `outPath`.
21
- *
22
- * `portable` normalises uid/gid/mtime so the same inputs produce byte-identical
23
- * output — which matters when a security team wants to diff two bundles or
24
- * re-derive one from a manifest.
25
- */
26
- export declare const createArchive: (options: {
29
+ /** What to pack, and where to put it. */
30
+ export type CreateArchiveOptions = {
27
31
  readonly cwd: string;
32
+ /** Entry paths, relative to `cwd`. */
28
33
  readonly entries: ReadonlyArray<string>;
29
34
  readonly outPath: string;
30
35
  readonly gzipLevel?: number | undefined;
31
- }) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, FileSystem.FileSystem | Progress.Progress>;
36
+ };
37
+ export declare namespace Archiver {
38
+ /** The packing backend. */
39
+ type Service = {
40
+ /**
41
+ * Packs `entries` (paths relative to `cwd`) into a gzipped tar at
42
+ * `outPath`.
43
+ *
44
+ * Implementations must produce byte-identical output for identical inputs —
45
+ * normalised uid/gid/mtime, entries in a stable order — because a security
46
+ * team diffing two bundles, or re-deriving one from its manifest, is a
47
+ * thing that actually happens.
48
+ */
49
+ readonly create: (options: CreateArchiveOptions) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, FileSystem.FileSystem>;
50
+ };
51
+ }
52
+ declare const Archiver_base: Context.ServiceClass<Archiver, "@packall/core/Archiver", Archiver.Service>;
53
+ /** Service tag for archive creation. */
54
+ export declare class Archiver extends Archiver_base {
55
+ }
56
+ /**
57
+ * Packs an archive with whichever backend is installed.
58
+ *
59
+ * The progress events are emitted here rather than inside the backends, so
60
+ * every implementation reports identically and a new one cannot forget to.
61
+ */
62
+ export declare const createArchive: (options: CreateArchiveOptions) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, Archiver | FileSystem.FileSystem | Progress.Progress>;
63
+ export {};
32
64
  //# sourceMappingURL=archive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../src/archive.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC,0BAA0B;AAC1B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,YAAa;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACvC,QAA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,CAAC,aAAa,EAAE,YAAY,GAAG,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;KACvF,CAAC;CACF;;AAED,wCAAwC;AACxC,qBAAa,QAAS,SAAQ,aAE7B;CAAG;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAChB,oBAAoB,KAC3B,MAAM,CAAC,MAAM,CACf,aAAa,EACb,YAAY,GAAG,aAAa,EAC5B,QAAQ,GAAG,UAAU,CAAC,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAoBlD,CAAC"}
package/dist/bundle.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * End-to-end orchestration: specs in, tarballs out.
3
3
  *
4
- * Two properties this module is responsible for, both of them fixes for how
5
- * the original tool behaved:
4
+ * Two properties this module is responsible for see `notes/requirements.md`
5
+ * § FR-5 and § NFR-9 for why they are requirements, and the mechanisms below
6
+ * for why the code reads as it does:
6
7
  *
7
8
  * 1. **Nothing is written outside the output directory.** Every intermediate
8
9
  * file lives in a scoped temp directory obtained from
@@ -15,10 +16,12 @@
15
16
  * shared download tree, so `per-spec` costs extra disk in the *output*, not
16
17
  * extra network.
17
18
  */
19
+ import type * as Crypto from "effect/Crypto";
18
20
  import * as Effect from "effect/Effect";
19
21
  import * as FileSystem from "effect/FileSystem";
20
22
  import * as Path from "effect/Path";
21
23
  import type { PlatformError } from "effect/PlatformError";
24
+ import type { Archiver } from "./archive.js";
22
25
  import { ArtifactKind } from "./enums/artifact-kind.js";
23
26
  import { Layout } from "./enums/layout.js";
24
27
  import type { BundlerError } from "./errors.js";
@@ -85,7 +88,7 @@ export type PlannedOutput = {
85
88
  readonly name?: string | undefined;
86
89
  readonly version?: string | undefined;
87
90
  };
88
- type BundleEnv = Registry | Progress.Progress | FileSystem.FileSystem | Path.Path;
91
+ type BundleEnv = Registry | Progress.Progress | FileSystem.FileSystem | Path.Path | Crypto.Crypto | Archiver;
89
92
  /** Computes the plan summary for a resolution. */
90
93
  export declare const summarize: (resolution: Resolution) => PlanSummary;
91
94
  /** Replaces the layout on a set of options. */
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAU/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAc,UAAU,EAAmB,MAAM,cAAc,CAAA;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAG5C,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,S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,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAiB1G;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,OAAO,MAAM,KAAG,gBAuCjE,CAAA"}
1
+ {"version":3,"file":"dependency-range.d.ts","sourceRoot":"","sources":["../src/dependency-range.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,wCAAwC;AACxC,MAAM,MAAM,gBAAgB;AAC3B,mFAAmF;AACjF;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AACH,iDAAiD;GAC/C;IACA,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACvB,CAAC;AAiBL;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,OAAO,MAAM,KAAG,gBAuCjE,CAAC"}
@@ -5,6 +5,7 @@
5
5
  * written, and the destination is always the scoped temp directory — nothing
6
6
  * lands next to the user's own files.
7
7
  */
8
+ import type * as Crypto from "effect/Crypto";
8
9
  import * as Effect from "effect/Effect";
9
10
  import * as FileSystem from "effect/FileSystem";
10
11
  import * as Path from "effect/Path";
@@ -31,5 +32,5 @@ export type DownloadReport = {
31
32
  export declare const downloadAll: (packages: ReadonlyArray<ResolvedPackage>, destDir: string, options: {
32
33
  readonly concurrency: number;
33
34
  readonly verifyIntegrity: boolean;
34
- }) => Effect.Effect<DownloadReport, BundlerError | PlatformError, Registry | Progress.Progress | FileSystem.FileSystem | Path.Path>;
35
+ }) => Effect.Effect<DownloadReport, BundlerError | PlatformError, Registry | Progress.Progress | FileSystem.FileSystem | Path.Path | Crypto.Crypto>;
35
36
  //# sourceMappingURL=download.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG;IAC3B,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aACZ,aAAa,CAAC,eAAe,CAAC,WAC/B,MAAM,WACN;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CAAE,KAC3E,MAAM,CAAC,MAAM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UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CA6G9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-kind.d.ts","sourceRoot":"","sources":["../../src/enums/artifact-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,uDAAuD;AACvD,eAAO,MAAM,YAAY;aACvB,OAAO,EAAE,SAAS;aAClB,SAAS,EAAE,WAAW;CACd,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAA"}
1
+ {"version":3,"file":"artifact-kind.d.ts","sourceRoot":"","sources":["../../src/enums/artifact-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,uDAAuD;AACvD,eAAO,MAAM,YAAY;aACxB,OAAO,EAAE,SAAS;aAClB,SAAS,EAAE,WAAW;CACb,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"edge-kind.d.ts","sourceRoot":"","sources":["../../src/enums/edge-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;aACnB,IAAI,EAAE,MAAM;aACZ,QAAQ,EAAE,UAAU;aACpB,IAAI,EAAE,MAAM;CACJ,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE/C,6EAA6E;AAC7E,eAAO,MAAM,cAAc;aACzB,GAAG,EAAE,KAAK;CACF,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,+DAA+D;AAC/D,eAAO,MAAM,cAAc;mBAfnB,MAAM;uBACF,UAAU;mBACd,MAAM;kBAOP,KAAK;CASF,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"edge-kind.d.ts","sourceRoot":"","sources":["../../src/enums/edge-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;aACpB,IAAI,EAAE,MAAM;aACZ,QAAQ,EAAE,UAAU;aACpB,IAAI,EAAE,MAAM;CACH,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,6EAA6E;AAC7E,eAAO,MAAM,cAAc;aAC1B,GAAG,EAAE,KAAK;CACD,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,+DAA+D;AAC/D,eAAO,MAAM,cAAc;mBAfpB,MAAM;uBACF,UAAU;mBACd,MAAM;kBAOP,KAAK;CASD,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input-file-kind.d.ts","sourceRoot":"","sources":["../../src/enums/input-file-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,mEAAmE;AACnE,eAAO,MAAM,aAAa;IACxB,mDAAmD;aACnD,WAAW,EAAE,cAAc;IAC3B,iDAAiD;aACjD,QAAQ,EAAE,UAAU;IACpB,yCAAyC;aACzC,IAAI,EAAE,MAAM;CACJ,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAA"}
1
+ {"version":3,"file":"input-file-kind.d.ts","sourceRoot":"","sources":["../../src/enums/input-file-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,mEAAmE;AACnE,eAAO,MAAM,aAAa;IACzB,mDAAmD;aACnD,WAAW,EAAE,cAAc;IAC3B,iDAAiD;aACjD,QAAQ,EAAE,UAAU;IACpB,yCAAyC;aACzC,IAAI,EAAE,MAAM;CACH,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/enums/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,+CAA+C;AAC/C,eAAO,MAAM,MAAM;IACjB;;;;OAIG;aACH,OAAO,EAAE,UAAU;IACnB;;;OAGG;aACH,MAAM,EAAE,QAAQ;IAChB;;;OAGG;aACH,GAAG,EAAE,KAAK;CACF,CAAA;AAEV,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,MAAM,CAAC,CAAA;AAE3C,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,MAAM,CAAyB,CAAA"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/enums/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,+CAA+C;AAC/C,eAAO,MAAM,MAAM;IAClB;;;;OAIG;aACH,OAAO,EAAE,UAAU;IACnB;;;OAGG;aACH,MAAM,EAAE,QAAQ;IAChB;;;OAGG;aACH,GAAG,EAAE,KAAK;CACD,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC;AAE5C,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,MAAM,CAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile-format.d.ts","sourceRoot":"","sources":["../../src/enums/lockfile-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,8CAA8C;AAC9C,eAAO,MAAM,cAAc;aACzB,GAAG,EAAE,KAAK;aACV,IAAI,EAAE,MAAM;aACZ,GAAG,EAAE,KAAK;CACF,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAA"}
1
+ {"version":3,"file":"lockfile-format.d.ts","sourceRoot":"","sources":["../../src/enums/lockfile-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,8CAA8C;AAC9C,eAAO,MAAM,cAAc;aAC1B,GAAG,EAAE,KAAK;aACV,IAAI,EAAE,MAAM;aACZ,GAAG,EAAE,KAAK;CACD,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"phase.d.ts","sourceRoot":"","sources":["../../src/enums/phase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,uDAAuD;AACvD,eAAO,MAAM,KAAK;aAChB,SAAS,EAAE,WAAW;aACtB,OAAO,EAAE,SAAS;aAClB,QAAQ,EAAE,UAAU;aACpB,OAAO,EAAE,SAAS;aAClB,IAAI,EAAE,MAAM;CACJ,CAAA;AAEV,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC,CAAA"}
1
+ {"version":3,"file":"phase.d.ts","sourceRoot":"","sources":["../../src/enums/phase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,uDAAuD;AACvD,eAAO,MAAM,KAAK;aACjB,SAAS,EAAE,WAAW;aACtB,OAAO,EAAE,SAAS;aAClB,QAAQ,EAAE,UAAU;aACpB,OAAO,EAAE,SAAS;aAClB,IAAI,EAAE,MAAM;CACH,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC,CAAC"}