@packall/core 0.0.1 → 0.1.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 (126) hide show
  1. package/dist/{Archive.d.ts → archive.d.ts} +5 -5
  2. package/dist/archive.d.ts.map +1 -0
  3. package/dist/{Bundle.d.ts → bundle.d.ts} +51 -36
  4. package/dist/bundle.d.ts.map +1 -0
  5. package/dist/{DependencyRange.d.ts → dependency-range.d.ts} +2 -2
  6. package/dist/dependency-range.d.ts.map +1 -0
  7. package/dist/{Download.d.ts → download.d.ts} +7 -7
  8. package/dist/download.d.ts.map +1 -0
  9. package/dist/enums/artifact-kind.d.ts +8 -0
  10. package/dist/enums/artifact-kind.d.ts.map +1 -0
  11. package/dist/enums/edge-kind.d.ts +29 -0
  12. package/dist/enums/edge-kind.d.ts.map +1 -0
  13. package/dist/enums/input-file-kind.d.ts +12 -0
  14. package/dist/enums/input-file-kind.d.ts.map +1 -0
  15. package/dist/enums/layout.d.ts +23 -0
  16. package/dist/enums/layout.d.ts.map +1 -0
  17. package/dist/enums/lockfile-format.d.ts +9 -0
  18. package/dist/enums/lockfile-format.d.ts.map +1 -0
  19. package/dist/enums/phase.d.ts +11 -0
  20. package/dist/enums/phase.d.ts.map +1 -0
  21. package/dist/{Errors.d.ts → errors.d.ts} +49 -7
  22. package/dist/errors.d.ts.map +1 -0
  23. package/dist/index.d.ts +44 -28
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2416 -1180
  26. package/dist/index.js.map +1 -1
  27. package/dist/input-file.d.ts +77 -0
  28. package/dist/input-file.d.ts.map +1 -0
  29. package/dist/{Integrity.d.ts → integrity.d.ts} +3 -3
  30. package/dist/integrity.d.ts.map +1 -0
  31. package/dist/{Layout.d.ts → layout.d.ts} +1 -1
  32. package/dist/{Layout.d.ts.map → layout.d.ts.map} +1 -1
  33. package/dist/locked-resolve.d.ts +47 -0
  34. package/dist/locked-resolve.d.ts.map +1 -0
  35. package/dist/lockfile/bun.d.ts +3 -0
  36. package/dist/lockfile/bun.d.ts.map +1 -0
  37. package/dist/lockfile/detect.d.ts +31 -0
  38. package/dist/lockfile/detect.d.ts.map +1 -0
  39. package/dist/lockfile/json.d.ts +23 -0
  40. package/dist/lockfile/json.d.ts.map +1 -0
  41. package/dist/lockfile/names.d.ts +16 -0
  42. package/dist/lockfile/names.d.ts.map +1 -0
  43. package/dist/lockfile/npm.d.ts +3 -0
  44. package/dist/lockfile/npm.d.ts.map +1 -0
  45. package/dist/lockfile/parse.d.ts +23 -0
  46. package/dist/lockfile/parse.d.ts.map +1 -0
  47. package/dist/lockfile/pnpm.d.ts +20 -0
  48. package/dist/lockfile/pnpm.d.ts.map +1 -0
  49. package/dist/lockfile/tree-builder.d.ts +70 -0
  50. package/dist/lockfile/tree-builder.d.ts.map +1 -0
  51. package/dist/lockfile/types.d.ts +70 -0
  52. package/dist/lockfile/types.d.ts.map +1 -0
  53. package/dist/{Manifest.d.ts → manifest.d.ts} +7 -15
  54. package/dist/manifest.d.ts.map +1 -0
  55. package/dist/{Options.d.ts → options.d.ts} +9 -27
  56. package/dist/options.d.ts.map +1 -0
  57. package/dist/{Platform.d.ts → platform.d.ts} +9 -9
  58. package/dist/platform.d.ts.map +1 -0
  59. package/dist/{Progress.d.ts → progress.d.ts} +10 -9
  60. package/dist/progress.d.ts.map +1 -0
  61. package/dist/{Registry.d.ts → registry.d.ts} +42 -44
  62. package/dist/registry.d.ts.map +1 -0
  63. package/dist/{Resolve.d.ts → resolve.d.ts} +25 -26
  64. package/dist/resolve.d.ts.map +1 -0
  65. package/dist/schemas/lenient.d.ts +38 -0
  66. package/dist/schemas/lenient.d.ts.map +1 -0
  67. package/dist/schemas/package-json.d.ts +44 -0
  68. package/dist/schemas/package-json.d.ts.map +1 -0
  69. package/dist/{Spec.d.ts → spec.d.ts} +4 -4
  70. package/dist/spec.d.ts.map +1 -0
  71. package/dist/types/value-of.d.ts +9 -0
  72. package/dist/types/value-of.d.ts.map +1 -0
  73. package/dist/utils/is-record.d.ts +8 -0
  74. package/dist/utils/is-record.d.ts.map +1 -0
  75. package/package.json +3 -2
  76. package/src/{Archive.ts → archive.ts} +92 -92
  77. package/src/{Bundle.ts → bundle.ts} +616 -570
  78. package/src/{DependencyRange.ts → dependency-range.ts} +115 -115
  79. package/src/{Download.ts → download.ts} +133 -132
  80. package/src/enums/artifact-kind.ts +9 -0
  81. package/src/enums/edge-kind.ts +32 -0
  82. package/src/enums/input-file-kind.ts +13 -0
  83. package/src/enums/layout.ts +25 -0
  84. package/src/enums/lockfile-format.ts +10 -0
  85. package/src/enums/phase.ts +12 -0
  86. package/src/{Errors.ts → errors.ts} +87 -5
  87. package/src/index.ts +133 -35
  88. package/src/{InputFile.ts → input-file.ts} +127 -44
  89. package/src/{Integrity.ts → integrity.ts} +121 -122
  90. package/src/locked-resolve.ts +461 -0
  91. package/src/lockfile/bun.ts +207 -0
  92. package/src/lockfile/detect.ts +80 -0
  93. package/src/lockfile/json.ts +132 -0
  94. package/src/lockfile/names.ts +20 -0
  95. package/src/lockfile/npm.ts +308 -0
  96. package/src/lockfile/parse.ts +56 -0
  97. package/src/lockfile/pnpm.ts +225 -0
  98. package/src/lockfile/tree-builder.ts +166 -0
  99. package/src/lockfile/types.ts +74 -0
  100. package/src/{Manifest.ts → manifest.ts} +133 -133
  101. package/src/{Options.ts → options.ts} +7 -27
  102. package/src/{Platform.ts → platform.ts} +23 -23
  103. package/src/{Progress.ts → progress.ts} +106 -106
  104. package/src/{Registry.ts → registry.ts} +115 -121
  105. package/src/{Resolve.ts → resolve.ts} +537 -528
  106. package/src/schemas/lenient.ts +123 -0
  107. package/src/schemas/package-json.ts +27 -0
  108. package/src/{Spec.ts → spec.ts} +11 -19
  109. package/src/types/value-of.ts +8 -0
  110. package/src/utils/is-record.ts +8 -0
  111. package/dist/Archive.d.ts.map +0 -1
  112. package/dist/Bundle.d.ts.map +0 -1
  113. package/dist/DependencyRange.d.ts.map +0 -1
  114. package/dist/Download.d.ts.map +0 -1
  115. package/dist/Errors.d.ts.map +0 -1
  116. package/dist/InputFile.d.ts +0 -46
  117. package/dist/InputFile.d.ts.map +0 -1
  118. package/dist/Integrity.d.ts.map +0 -1
  119. package/dist/Manifest.d.ts.map +0 -1
  120. package/dist/Options.d.ts.map +0 -1
  121. package/dist/Platform.d.ts.map +0 -1
  122. package/dist/Progress.d.ts.map +0 -1
  123. package/dist/Registry.d.ts.map +0 -1
  124. package/dist/Resolve.d.ts.map +0 -1
  125. package/dist/Spec.d.ts.map +0 -1
  126. /package/src/{Layout.ts → layout.ts} +0 -0
@@ -9,13 +9,13 @@
9
9
  import * as Effect from "effect/Effect";
10
10
  import * as FileSystem from "effect/FileSystem";
11
11
  import type { PlatformError } from "effect/PlatformError";
12
- import { ArchiveError } from "./Errors.js";
13
- import * as Progress from "./Progress.js";
12
+ import { ArchiveError } from "./errors.js";
13
+ import * as Progress from "./progress.js";
14
14
  /** A finished archive. */
15
- export interface ArchiveResult {
15
+ export type ArchiveResult = {
16
16
  readonly path: string;
17
17
  readonly bytes: number;
18
- }
18
+ };
19
19
  /**
20
20
  * Packs `entries` (paths relative to `cwd`) into a gzipped tar at `outPath`.
21
21
  *
@@ -29,4 +29,4 @@ export declare const createArchive: (options: {
29
29
  readonly outPath: string;
30
30
  readonly gzipLevel?: number | undefined;
31
31
  }) => Effect.Effect<ArchiveResult, ArchiveError | PlatformError, FileSystem.FileSystem | Progress.Progress>;
32
- //# sourceMappingURL=Archive.d.ts.map
32
+ //# sourceMappingURL=archive.d.ts.map
@@ -0,0 +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,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC,KAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,YAAY,GAAG,aAAa,EAAE,UAAU,CAAC,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAoCpG,CAAA"}
@@ -19,24 +19,28 @@ import * as Effect from "effect/Effect";
19
19
  import * as FileSystem from "effect/FileSystem";
20
20
  import * as Path from "effect/Path";
21
21
  import type { PlatformError } from "effect/PlatformError";
22
- import type { BundlerError } from "./Errors.js";
23
- import type { BundleOptions, Layout } from "./Options.js";
24
- import * as Progress from "./Progress.js";
25
- import { Registry } from "./Registry.js";
26
- import type { Resolution } from "./Resolve.js";
27
- import type { PackageSpec } from "./Spec.js";
22
+ import { ArtifactKind } from "./enums/artifact-kind.js";
23
+ import { Layout } from "./enums/layout.js";
24
+ import type { BundlerError } from "./errors.js";
25
+ import type { LockedResolveOptions } from "./locked-resolve.js";
26
+ import type { LockedTree } from "./lockfile/types.js";
27
+ import type { BundleOptions } from "./options.js";
28
+ import * as Progress from "./progress.js";
29
+ import { Registry } from "./registry.js";
30
+ import type { Resolution } from "./resolve.js";
31
+ import type { PackageSpec } from "./spec.js";
28
32
  /** One thing written to the output directory. */
29
- export interface BundleArtifact {
30
- readonly kind: "archive" | "directory";
33
+ export type BundleArtifact = {
34
+ readonly kind: ArtifactKind;
31
35
  readonly path: string;
32
36
  readonly bytes: number;
33
37
  readonly packageCount: number;
34
38
  /** Which spec this artifact covers. Absent for `single` and `dir`. */
35
39
  readonly spec?: string | undefined;
36
40
  readonly version?: string | undefined;
37
- }
41
+ };
38
42
  /** The outcome of a bundle run. */
39
- export interface BundleResult {
43
+ export type BundleResult = {
40
44
  readonly resolution: Resolution;
41
45
  readonly artifacts: ReadonlyArray<BundleArtifact>;
42
46
  /** Total bytes downloaded from the registry. */
@@ -44,17 +48,17 @@ export interface BundleResult {
44
48
  /** Packages the registry advertised no usable checksum for. */
45
49
  readonly unverified: ReadonlyArray<string>;
46
50
  readonly dryRun: boolean;
47
- }
51
+ };
48
52
  /** Everything `bundle` needs beyond the user-facing options. */
49
- export interface BundleContext extends BundleOptions {
53
+ export type BundleContext = BundleOptions & {
50
54
  /** Recorded in the manifest so a bundle can be traced to the tool that built it. */
51
55
  readonly toolVersion: string;
52
- }
56
+ };
53
57
  /**
54
58
  * A summary of what a resolution would produce, for deciding whether the
55
59
  * chosen layout is still the right one.
56
60
  */
57
- export interface PlanSummary {
61
+ export type PlanSummary = {
58
62
  /** Distinct packages in the deduplicated union. */
59
63
  readonly uniquePackages: number;
60
64
  /** How many archives `per-spec` layout would emit. */
@@ -65,12 +69,27 @@ export interface PlanSummary {
65
69
  * `uniquePackages` is exactly what `single` layout would save.
66
70
  */
67
71
  readonly perSpecEntries: number;
68
- }
72
+ };
73
+ /**
74
+ * The files a run will write, known before anything is downloaded.
75
+ *
76
+ * `dir` layout is the odd one: it merges a package tree into `outDir`, and
77
+ * package paths are `name/-/name-version.tgz` — the same package at the same
78
+ * version is the same bytes, so an overlap there is idempotent rather than
79
+ * destructive. Only the two summary files are genuinely replaced, and those are
80
+ * the ones worth guarding.
81
+ */
82
+ export type PlannedOutput = {
83
+ readonly file: string;
84
+ /** The root this file belongs to, when one file corresponds to one spec. */
85
+ readonly name?: string | undefined;
86
+ readonly version?: string | undefined;
87
+ };
88
+ type BundleEnv = Registry | Progress.Progress | FileSystem.FileSystem | Path.Path;
69
89
  /** Computes the plan summary for a resolution. */
70
90
  export declare const summarize: (resolution: Resolution) => PlanSummary;
71
91
  /** Replaces the layout on a set of options. */
72
92
  export declare const withLayout: <T extends BundleOptions>(options: T, layout: Layout) => T;
73
- type BundleEnv = Registry | Progress.Progress | FileSystem.FileSystem | Path.Path;
74
93
  /**
75
94
  * Checks the registry is reachable, then resolves every spec.
76
95
  *
@@ -80,6 +99,16 @@ type BundleEnv = Registry | Progress.Progress | FileSystem.FileSystem | Path.Pat
80
99
  * expected.
81
100
  */
82
101
  export declare const plan: (specs: ReadonlyArray<PackageSpec>, options: BundleOptions) => Effect.Effect<Resolution, BundlerError, Registry | Progress.Progress>;
102
+ /**
103
+ * The lockfile counterpart of `plan`.
104
+ *
105
+ * Same preflight, same `Resolution` out; the difference is entirely in how the
106
+ * package set is arrived at. Kept as a separate entry point rather than an
107
+ * option on `plan` because the two take genuinely different inputs — a set of
108
+ * specs to satisfy versus a graph to reproduce — and blurring that is how a
109
+ * "pinned" run quietly starts resolving ranges again.
110
+ */
111
+ export declare const planLocked: (lockfile: LockedTree, options: BundleOptions & LockedResolveOptions) => Effect.Effect<Resolution, BundlerError, Registry | Progress.Progress>;
83
112
  /**
84
113
  * Resolves, downloads and packages a set of specs.
85
114
  *
@@ -88,6 +117,8 @@ export declare const plan: (specs: ReadonlyArray<PackageSpec>, options: BundleOp
88
117
  * download over a slow VPN.
89
118
  */
90
119
  export declare const bundle: (specs: ReadonlyArray<PackageSpec>, options: BundleContext) => Effect.Effect<BundleResult, BundlerError | PlatformError, BundleEnv>;
120
+ /** `bundle`, pinned to a lockfile. */
121
+ export declare const bundleLocked: (lockfile: LockedTree, options: BundleContext & LockedResolveOptions) => Effect.Effect<BundleResult, BundlerError | PlatformError, BundleEnv>;
91
122
  /**
92
123
  * Downloads and packages an already-computed resolution.
93
124
  *
@@ -97,27 +128,11 @@ export declare const bundle: (specs: ReadonlyArray<PackageSpec>, options: Bundle
97
128
  */
98
129
  export declare const bundleResolved: (resolution: Resolution, options: BundleContext) => Effect.Effect<BundleResult, BundlerError | PlatformError, BundleEnv>;
99
130
  /**
100
- * Creates the output directory, refusing to clobber an existing non-empty one
101
- * unless `--force` was passed.
131
+ * The files a run will write.
102
132
  *
103
- * Silently overwriting somebody's previous bundle is the kind of thing a tool
104
- * only gets forgiven for once.
133
+ * Computed before anything is downloaded, so a collision is reported in the
134
+ * first second rather than after a twenty-minute transfer.
105
135
  */
106
- /**
107
- * The files a run will write, known before anything is downloaded.
108
- *
109
- * `dir` layout is the odd one: it merges a package tree into `outDir`, and
110
- * package paths are `name/-/name-version.tgz` — the same package at the same
111
- * version is the same bytes, so an overlap there is idempotent rather than
112
- * destructive. Only the two summary files are genuinely replaced, and those are
113
- * the ones worth guarding.
114
- */
115
- export interface PlannedOutput {
116
- readonly file: string;
117
- /** The root this file belongs to, when one file corresponds to one spec. */
118
- readonly name?: string | undefined;
119
- readonly version?: string | undefined;
120
- }
121
136
  export declare const plannedOutputs: (resolution: Resolution, options: BundleContext) => ReadonlyArray<PlannedOutput>;
122
137
  export {};
123
- //# sourceMappingURL=Bundle.d.ts.map
138
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +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,EA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AM,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,EAAE,SAAS,CAIlE,CAAA;AAEJ,sCAAsC;AACtC,eAAO,MAAM,YAAY,aACb,UAAU,WACX,aAAa,GAAG,oBAAoB,KAC5C,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,EAAE,SAAS,CAIlE,CAAA;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,eACb,UAAU,WACb,aAAa,KACrB,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,EAAE,SAAS,CAYlE,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,eACb,UAAU,WACb,aAAa,KACrB,aAAa,CAAC,aAAa,CAY7B,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { Selector } from "./Spec.js";
1
+ import type { Selector } from "./spec.js";
2
2
  /** What a dependency edge points at. */
3
3
  export type DependencyTarget =
4
4
  /** A normal registry dependency. `name` may differ from the key under an alias. */
@@ -23,4 +23,4 @@ export type DependencyTarget =
23
23
  * treats them interchangeably and so do we.
24
24
  */
25
25
  export declare const parseDependencyTarget: (name: string, raw: string) => DependencyTarget;
26
- //# sourceMappingURL=DependencyRange.d.ts.map
26
+ //# sourceMappingURL=dependency-range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-range.d.ts","sourceRoot":"","sources":["../src/dependency-range.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEzC,wCAAwC;AACxC,MAAM,MAAM,gBAAgB;AAC1B,mFAAmF;AACjF;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC;AACH,iDAAiD;GAC/C;IAAE,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"}
@@ -9,18 +9,18 @@ import * as Effect from "effect/Effect";
9
9
  import * as FileSystem from "effect/FileSystem";
10
10
  import * as Path from "effect/Path";
11
11
  import type { PlatformError } from "effect/PlatformError";
12
- import type { BundlerError } from "./Errors.js";
13
- import * as Progress from "./Progress.js";
14
- import { Registry } from "./Registry.js";
15
- import type { ResolvedPackage } from "./Resolve.js";
12
+ import type { BundlerError } from "./errors.js";
13
+ import * as Progress from "./progress.js";
14
+ import { Registry } from "./registry.js";
15
+ import type { ResolvedPackage } from "./resolve.js";
16
16
  /** What a completed download run produced. */
17
- export interface DownloadReport {
17
+ export type DownloadReport = {
18
18
  /** `name@version` -> bytes written. */
19
19
  readonly sizes: ReadonlyMap<string, number>;
20
20
  /** Packages the registry advertised no usable checksum for. */
21
21
  readonly unverified: ReadonlyArray<string>;
22
22
  readonly totalBytes: number;
23
- }
23
+ };
24
24
  /**
25
25
  * Downloads every package into `destDir`, laid out the way a registry serves
26
26
  * them.
@@ -32,4 +32,4 @@ export declare const downloadAll: (packages: ReadonlyArray<ResolvedPackage>, des
32
32
  readonly concurrency: number;
33
33
  readonly verifyIntegrity: boolean;
34
34
  }) => Effect.Effect<DownloadReport, BundlerError | PlatformError, Registry | Progress.Progress | FileSystem.FileSystem | Path.Path>;
35
- //# sourceMappingURL=Download.d.ts.map
35
+ //# sourceMappingURL=download.d.ts.map
@@ -0,0 +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,CACd,cAAc,EACd,YAAY,GAAG,aAAa,EAC5B,QAAQ,GAAG,QAAQ,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAyF9D,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /** What a bundle run wrote to the output directory. */
3
+ export declare const ArtifactKind: {
4
+ readonly Archive: "archive";
5
+ readonly Directory: "directory";
6
+ };
7
+ export type ArtifactKind = ValueOf<typeof ArtifactKind>;
8
+ //# sourceMappingURL=artifact-kind.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,29 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /**
3
+ * Why one package depends on another.
4
+ *
5
+ * `EdgeKind` and `LockedRootKind` are one concept in two parts, which is why
6
+ * they share a file: `Dev` exists only at the top level, because lockfiles
7
+ * record dev dependencies for the project alone — a transitive devDependency is
8
+ * never installed, so it is never locked.
9
+ */
10
+ export declare const EdgeKind: {
11
+ readonly Prod: "prod";
12
+ readonly Optional: "optional";
13
+ readonly Peer: "peer";
14
+ };
15
+ export type EdgeKind = ValueOf<typeof EdgeKind>;
16
+ /** The kind that only a direct dependency of the locked project can have. */
17
+ export declare const DirectOnlyKind: {
18
+ readonly Dev: "dev";
19
+ };
20
+ export type DirectOnlyKind = ValueOf<typeof DirectOnlyKind>;
21
+ /** Why a direct dependency of the locked project is a root. */
22
+ export declare const LockedRootKind: {
23
+ readonly Prod: "prod";
24
+ readonly Optional: "optional";
25
+ readonly Peer: "peer";
26
+ readonly Dev: "dev";
27
+ };
28
+ export type LockedRootKind = ValueOf<typeof LockedRootKind>;
29
+ //# sourceMappingURL=edge-kind.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,12 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /** Which of the three shapes a `--file` input turned out to be. */
3
+ export declare const InputFileKind: {
4
+ /** Bundle everything a package.json depends on. */
5
+ readonly PackageJson: "package.json";
6
+ /** Bundle the exact versions a lockfile pins. */
7
+ readonly Lockfile: "lockfile";
8
+ /** A newline-delimited list of specs. */
9
+ readonly List: "list";
10
+ };
11
+ export type InputFileKind = ValueOf<typeof InputFileKind>;
12
+ //# sourceMappingURL=input-file-kind.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,23 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /** How the resulting tarball(s) are shaped. */
3
+ export declare const Layout: {
4
+ /**
5
+ * One tarball per requested spec, each carrying its own complete dependency
6
+ * closure. Shared dependencies repeat across tarballs, so the total is
7
+ * larger — but each one imports, rolls back and hands off independently.
8
+ */
9
+ readonly PerSpec: "per-spec";
10
+ /**
11
+ * One tarball for everything, with the union of all closures deduplicated.
12
+ * Smallest output and a single import step; all-or-nothing to roll back.
13
+ */
14
+ readonly Single: "single";
15
+ /**
16
+ * No archive at all — just the npm-layout directory tree, ready for
17
+ * `jf rt upload` or rsync.
18
+ */
19
+ readonly Dir: "dir";
20
+ };
21
+ export type Layout = ValueOf<typeof Layout>;
22
+ export declare const Layouts: ReadonlyArray<Layout>;
23
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,9 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /** Which package manager wrote a lockfile. */
3
+ export declare const LockfileFormat: {
4
+ readonly Npm: "npm";
5
+ readonly Pnpm: "pnpm";
6
+ readonly Bun: "bun";
7
+ };
8
+ export type LockfileFormat = ValueOf<typeof LockfileFormat>;
9
+ //# sourceMappingURL=lockfile-format.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,11 @@
1
+ import type { ValueOf } from "../types/value-of.js";
2
+ /** The phases a bundle run moves through, in order. */
3
+ export declare const Phase: {
4
+ readonly Preflight: "preflight";
5
+ readonly Resolve: "resolve";
6
+ readonly Download: "download";
7
+ readonly Archive: "archive";
8
+ readonly Done: "done";
9
+ };
10
+ export type Phase = ValueOf<typeof Phase>;
11
+ //# sourceMappingURL=phase.d.ts.map
@@ -0,0 +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"}
@@ -11,12 +11,10 @@
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 | RegistryUnreachableError | PackageNotFoundError | VersionNotFoundError | NoMatchingVersionsError | RegistryResponseError | AuthenticationError | IntegrityError | ArchiveError | OutputError;
14
+ export type BundlerError = InvalidSpecError | InvalidInputFileError | LockfileError | LockfileIncompleteError | LockfileOutOfDateError | RegistryUnreachableError | PackageNotFoundError | VersionNotFoundError | NoMatchingVersionsError | RegistryResponseError | AuthenticationError | IntegrityError | ArchiveError | OutputError;
15
15
  declare abstract class BundlerErrorBase extends Error {
16
16
  abstract readonly _tag: string;
17
- constructor(message: string, options?: {
18
- cause?: unknown;
19
- });
17
+ constructor(message: string, options?: ErrorOptions);
20
18
  }
21
19
  /** A package spec on the command line or in an input file could not be parsed. */
22
20
  export declare class InvalidSpecError extends BundlerErrorBase {
@@ -34,6 +32,50 @@ export declare class InvalidInputFileError extends BundlerErrorBase {
34
32
  cause?: unknown;
35
33
  });
36
34
  }
35
+ /** A lockfile could not be read, or is in a format we do not support. */
36
+ export declare class LockfileError extends BundlerErrorBase {
37
+ readonly _tag: "LockfileError";
38
+ readonly path: string;
39
+ readonly reason: string;
40
+ constructor(path: string, reason: string, options?: {
41
+ cause?: unknown;
42
+ });
43
+ }
44
+ /**
45
+ * The lockfile parsed, but does not pin everything the bundle needs.
46
+ *
47
+ * Falling back to a range here would defeat the entire point of reading a
48
+ * lockfile — you would get a bundle that is *mostly* what CI installed, with no
49
+ * indication of which parts were guessed. So this is fatal, and it names every
50
+ * gap at once so one `npm install` fixes all of them.
51
+ */
52
+ export declare class LockfileIncompleteError extends BundlerErrorBase {
53
+ readonly _tag: "LockfileIncompleteError";
54
+ readonly path: string;
55
+ readonly missing: ReadonlyArray<string>;
56
+ constructor(path: string, missing: ReadonlyArray<string>, detail: string, remedy: string);
57
+ }
58
+ /**
59
+ * The lockfile pins versions the registry no longer serves.
60
+ *
61
+ * Unpublished, or never mirrored into a private registry. Either way the
62
+ * bundle cannot be built as specified, and quietly substituting a nearby
63
+ * version would produce exactly the mismatch this feature exists to prevent.
64
+ */
65
+ export declare class LockfileOutOfDateError extends BundlerErrorBase {
66
+ readonly _tag: "LockfileOutOfDateError";
67
+ readonly path: string;
68
+ readonly registry: string;
69
+ readonly missing: ReadonlyArray<{
70
+ readonly name: string;
71
+ readonly version: string;
72
+ }>;
73
+ constructor(path: string, registry: string, missing: ReadonlyArray<{
74
+ readonly name: string;
75
+ readonly version: string;
76
+ readonly detail: string;
77
+ }>);
78
+ }
37
79
  /**
38
80
  * The registry could not be reached at all — DNS failure, refused connection,
39
81
  * proxy blackhole, or a preflight that timed out.
@@ -44,10 +86,10 @@ export declare class InvalidInputFileError extends BundlerErrorBase {
44
86
  export declare class RegistryUnreachableError extends BundlerErrorBase {
45
87
  readonly _tag: "RegistryUnreachableError";
46
88
  readonly registry: string;
47
- readonly timeoutMillis: number | undefined;
89
+ readonly timeoutMs: number | undefined;
48
90
  constructor(registry: string, detail: string, options?: {
49
91
  cause?: unknown;
50
- timeoutMillis?: number;
92
+ timeoutMs?: number;
51
93
  });
52
94
  }
53
95
  /** The registry answered, but has never heard of this package. */
@@ -121,4 +163,4 @@ export declare class OutputError extends BundlerErrorBase {
121
163
  });
122
164
  }
123
165
  export {};
124
- //# sourceMappingURL=Errors.d.ts.map
166
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,mEAAmE;AACnE,MAAM,MAAM,YAAY,GACpB,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,WAAW,CAAA;AAEf,uBAAe,gBAAiB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAC9B,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAGlD;CACF;AAED,kFAAkF;AAClF,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,QAAQ,CAAC,IAAI,EAAG,kBAAkB,CAAS;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ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,CAAS;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,YAAY,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAWjF;CACF;AAED,+CAA+C;AAC/C,qBAAa,YAAa,SAAQ,gBAAgB;IAChD,QAAQ,CAAC,IAAI,EAAG,cAAc,CAAS;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGtE;CACF;AAED,yEAAyE;AACzE,qBAAa,WAAY,SAAQ,gBAAgB;IAC/C,QAAQ,CAAC,IAAI,EAAG,aAAa,CAAS;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGtE;CACF"}
package/dist/index.d.ts CHANGED
@@ -4,33 +4,49 @@
4
4
  * Nothing in here knows about npm specifically. Point it at any implementation
5
5
  * of the `Registry` service and it will resolve, download, verify and package
6
6
  * a dependency closure.
7
+ *
8
+ * This is the package's whole public API. Everything not named here is an
9
+ * implementation detail, including modules that happen to be reachable.
7
10
  */
8
- export * as Archive from "./Archive.js";
9
- export * as Bundle from "./Bundle.js";
10
- export * as DependencyRange from "./DependencyRange.js";
11
- export * as Download from "./Download.js";
12
- export * as Integrity from "./Integrity.js";
13
- export * as InputFile from "./InputFile.js";
14
- export * as Layout from "./Layout.js";
15
- export * as Manifest from "./Manifest.js";
16
- export * as Options from "./Options.js";
17
- export * as Platform from "./Platform.js";
18
- export * as Progress from "./Progress.js";
19
- export * as Resolve from "./Resolve.js";
20
- export * as Spec from "./Spec.js";
21
- export { bundle, bundleResolved, plan, plannedOutputs, summarize, withLayout } from "./Bundle.js";
22
- export type { BundleArtifact, BundleContext, BundleResult, PlanSummary } from "./Bundle.js";
23
- export { Registry } from "./Registry.js";
24
- export type { Packument, PackageDist, PackageManifest, RegistryService } from "./Registry.js";
25
- export { Progress as ProgressTag } from "./Progress.js";
26
- export type { ProgressEvent } from "./Progress.js";
27
- export { resolve } from "./Resolve.js";
28
- export type { Resolution, ResolvedPackage, RootResolution } from "./Resolve.js";
29
- export { parseSpec, parseSpecs } from "./Spec.js";
30
- export type { PackageSpec, Selector } from "./Spec.js";
31
- export type { BundleOptions, DependencyScope, Layout as LayoutKind, ResolveOptions } from "./Options.js";
32
- export { defaultBundleOptions, defaultResolveOptions, defaultScope, layouts } from "./Options.js";
33
- export type { PlatformFilter, PlatformTarget } from "./Platform.js";
34
- export { allPlatforms, currentPlatform, parsePlatformTarget, platformTargets } from "./Platform.js";
35
- export * from "./Errors.js";
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";
13
+ export { ArtifactKind } from "./enums/artifact-kind.js";
14
+ export { DirectOnlyKind, EdgeKind, LockedRootKind } from "./enums/edge-kind.js";
15
+ export { InputFileKind } from "./enums/input-file-kind.js";
16
+ export { Layout, Layouts } from "./enums/layout.js";
17
+ export { LockfileFormat } from "./enums/lockfile-format.js";
18
+ export { Phase } from "./enums/phase.js";
19
+ export type { ValueOf } from "./types/value-of.js";
20
+ export { isRecord } from "./utils/is-record.js";
21
+ export { OptionalFlagRecordOrAbsentSchema, OptionalFlagRecordSchema, OptionalStringArraySchema, OptionalStringRecordSchema, StringArraySchema, StringRecordSchema, tolerant } from "./schemas/lenient.js";
22
+ export type { PackageSpec, Selector } from "./spec.js";
23
+ export { dedupeSpecs, formatSelector, formatSpec, parseSpec, parseSpecs } from "./spec.js";
24
+ export type { DependencyTarget } from "./dependency-range.js";
25
+ export { parseDependencyTarget } from "./dependency-range.js";
26
+ export type { PlatformConstraints, PlatformFilter, PlatformTarget } from "./platform.js";
27
+ export { allPlatforms, currentPlatform, formatPlatformFilter, isIncluded, parsePlatformTarget, platformTargets } from "./platform.js";
28
+ export type { BundleOptions, DependencyScope, ResolveOptions } from "./options.js";
29
+ export { defaultBundleOptions, defaultResolveOptions, defaultScope } from "./options.js";
30
+ export type { Packument, PackageDist, PackageManifest } from "./registry.js";
31
+ export { Registry } from "./registry.js";
32
+ export type { ProgressEvent } from "./progress.js";
33
+ export { emit as emitProgress, layerCallback as layerCallbackProgress, layerSilent as layerSilentProgress, makeCollector as makeProgressCollector, Progress } from "./progress.js";
34
+ export type { IntegrityHash, VerificationResult } from "./integrity.js";
35
+ export { digestOf, hexDigestOf, parseIntegrity, verify as verifyIntegrity } from "./integrity.js";
36
+ export { importGuide, MANIFEST_FILE, packagePath, perSpecArchiveName, README_FILE, singleArchiveName, splitName, tarballFileName } from "./layout.js";
37
+ export type { BundleManifest, ManifestEntry } from "./manifest.js";
38
+ export { buildManifest, MANIFEST_VERSION, serializeManifest } from "./manifest.js";
39
+ export type { PackageKey, Reason, Resolution, ResolutionWarning, ResolvedPackage, RootResolution } from "./resolve.js";
40
+ export { indexPackages, packageKey, resolve, selectVersions } from "./resolve.js";
41
+ export type { LockedResolveOptions } from "./locked-resolve.js";
42
+ export { resolveLocked } from "./locked-resolve.js";
43
+ export type { LockfileDetection } from "./lockfile/detect.js";
44
+ export { detectLockfile } from "./lockfile/detect.js";
45
+ export type { LockedEdge, LockedPackage, LockedRoot, LockedTree, LockfileParseOptions } from "./lockfile/types.js";
46
+ export { formatByLockfileName, lockfileNamesFor } from "./lockfile/names.js";
47
+ export { parseLockfile } from "./lockfile/parse.js";
48
+ export type { InputFileOptions, InputFileResult } from "./input-file.js";
49
+ export { defaultInputFileOptions, parseInputFile, readInputFile } from "./input-file.js";
50
+ export type { BundleArtifact, BundleContext, BundleResult, PlannedOutput, PlanSummary } from "./bundle.js";
51
+ export { bundle, bundleLocked, bundleResolved, plan, planLocked, plannedOutputs, summarize, withLayout } from "./bundle.js";
36
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACjG,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,YAAY,EAAE,SAA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