@packall/core 0.1.0 → 0.3.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.
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/archive-DmF9XNl7.js +284 -0
- package/dist/archive-DmF9XNl7.js.map +1 -0
- package/dist/archive.d.ts +47 -15
- package/dist/archive.d.ts.map +1 -1
- package/dist/bundle.d.ts +6 -3
- package/dist/bundle.d.ts.map +1 -1
- package/dist/dependency-range.d.ts.map +1 -1
- package/dist/download.d.ts +2 -1
- package/dist/download.d.ts.map +1 -1
- package/dist/enums/artifact-kind.d.ts.map +1 -1
- package/dist/enums/edge-kind.d.ts.map +1 -1
- package/dist/enums/input-file-kind.d.ts.map +1 -1
- package/dist/enums/layout.d.ts.map +1 -1
- package/dist/enums/lockfile-format.d.ts.map +1 -1
- package/dist/enums/phase.d.ts.map +1 -1
- package/dist/errors.d.ts +11 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +169 -344
- package/dist/index.js.map +1 -1
- package/dist/input-file.d.ts.map +1 -1
- package/dist/integrity.d.ts +37 -5
- package/dist/integrity.d.ts.map +1 -1
- package/dist/layout.d.ts +41 -7
- package/dist/layout.d.ts.map +1 -1
- package/dist/locked-resolve.d.ts.map +1 -1
- package/dist/lockfile/bun.d.ts.map +1 -1
- package/dist/lockfile/detect.d.ts.map +1 -1
- package/dist/lockfile/json.d.ts.map +1 -1
- package/dist/lockfile/names.d.ts.map +1 -1
- package/dist/lockfile/npm.d.ts.map +1 -1
- package/dist/lockfile/parse.d.ts.map +1 -1
- package/dist/lockfile/pnpm.d.ts.map +1 -1
- package/dist/lockfile/tree-builder.d.ts.map +1 -1
- package/dist/lockfile/types.d.ts.map +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/node/archiver.d.ts +5 -0
- package/dist/node/archiver.d.ts.map +1 -0
- package/dist/node/index.d.ts +13 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +55 -0
- package/dist/node/index.js.map +1 -0
- package/dist/options.d.ts +3 -3
- package/dist/options.d.ts.map +1 -1
- package/dist/platform.d.ts +5 -10
- package/dist/platform.d.ts.map +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/schemas/lenient.d.ts.map +1 -1
- package/dist/schemas/package-json.d.ts.map +1 -1
- package/dist/spec.d.ts.map +1 -1
- package/dist/types/value-of.d.ts.map +1 -1
- package/dist/utils/is-record.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/archive.ts +95 -92
- package/src/bundle.ts +736 -616
- package/src/dependency-range.ts +121 -115
- package/src/download.ts +155 -133
- package/src/enums/artifact-kind.ts +5 -5
- package/src/enums/edge-kind.ts +13 -13
- package/src/enums/input-file-kind.ts +9 -9
- package/src/enums/layout.ts +20 -20
- package/src/enums/lockfile-format.ts +6 -6
- package/src/enums/phase.ts +8 -8
- package/src/errors.ts +211 -199
- package/src/index.ts +126 -113
- package/src/input-file.ts +246 -234
- package/src/integrity.ts +165 -121
- package/src/layout.ts +63 -29
- package/src/locked-resolve.ts +471 -461
- package/src/lockfile/bun.ts +214 -207
- package/src/lockfile/detect.ts +80 -80
- package/src/lockfile/json.ts +91 -92
- package/src/lockfile/names.ts +9 -9
- package/src/lockfile/npm.ts +328 -308
- package/src/lockfile/parse.ts +32 -32
- package/src/lockfile/pnpm.ts +230 -225
- package/src/lockfile/tree-builder.ts +116 -116
- package/src/lockfile/types.ts +52 -52
- package/src/manifest.ts +129 -133
- package/src/node/archiver.ts +85 -0
- package/src/node/index.ts +13 -0
- package/src/options.ts +84 -84
- package/src/platform.ts +97 -101
- package/src/progress.ts +105 -106
- package/src/registry.ts +116 -115
- package/src/resolve.ts +560 -537
- package/src/schemas/lenient.ts +67 -60
- package/src/schemas/package-json.ts +11 -10
- package/src/spec.ts +123 -119
- package/src/types/value-of.ts +1 -1
- package/src/utils/is-record.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -9,134 +9,147 @@
|
|
|
9
9
|
* implementation detail, including modules that happen to be reachable.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
export type * from "./errors.js"
|
|
12
|
+
export type * from "./errors.js";
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} from "./errors.js"
|
|
29
|
-
|
|
30
|
-
export { ArtifactKind } from "./enums/artifact-kind.js"
|
|
31
|
-
export { DirectOnlyKind, EdgeKind, LockedRootKind } from "./enums/edge-kind.js"
|
|
32
|
-
export { InputFileKind } from "./enums/input-file-kind.js"
|
|
33
|
-
export { Layout, Layouts } from "./enums/layout.js"
|
|
34
|
-
export { LockfileFormat } from "./enums/lockfile-format.js"
|
|
35
|
-
export { Phase } from "./enums/phase.js"
|
|
36
|
-
|
|
37
|
-
export type { ValueOf } from "./types/value-of.js"
|
|
38
|
-
export { isRecord } from "./utils/is-record.js"
|
|
14
|
+
ArchiveError,
|
|
15
|
+
AuthenticationError,
|
|
16
|
+
IntegrityError,
|
|
17
|
+
InvalidInputFileError,
|
|
18
|
+
InvalidSpecError,
|
|
19
|
+
LockfileError,
|
|
20
|
+
LockfileIncompleteError,
|
|
21
|
+
LockfileOutOfDateError,
|
|
22
|
+
NoMatchingVersionsError,
|
|
23
|
+
OutputError,
|
|
24
|
+
PackageNotFoundError,
|
|
25
|
+
RegistryResponseError,
|
|
26
|
+
RegistryUnreachableError,
|
|
27
|
+
VersionNotFoundError,
|
|
28
|
+
} from "./errors.js";
|
|
29
|
+
|
|
30
|
+
export { ArtifactKind } from "./enums/artifact-kind.js";
|
|
31
|
+
export { DirectOnlyKind, EdgeKind, LockedRootKind } from "./enums/edge-kind.js";
|
|
32
|
+
export { InputFileKind } from "./enums/input-file-kind.js";
|
|
33
|
+
export { Layout, Layouts } from "./enums/layout.js";
|
|
34
|
+
export { LockfileFormat } from "./enums/lockfile-format.js";
|
|
35
|
+
export { Phase } from "./enums/phase.js";
|
|
36
|
+
|
|
37
|
+
export type { ValueOf } from "./types/value-of.js";
|
|
38
|
+
export { isRecord } from "./utils/is-record.js";
|
|
39
39
|
|
|
40
40
|
// The tolerant decoders every boundary that reads untrusted JSON is built from
|
|
41
41
|
// — registry responses here, package.json and lockfiles inside the engine.
|
|
42
42
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} from "./schemas/lenient.js"
|
|
51
|
-
|
|
52
|
-
export type { PackageSpec, Selector } from "./spec.js"
|
|
53
|
-
export { dedupeSpecs, formatSelector, formatSpec, parseSpec, parseSpecs } from "./spec.js"
|
|
54
|
-
|
|
55
|
-
export type { DependencyTarget } from "./dependency-range.js"
|
|
56
|
-
export { parseDependencyTarget } from "./dependency-range.js"
|
|
57
|
-
|
|
58
|
-
export type { PlatformConstraints, PlatformFilter, PlatformTarget } from "./platform.js"
|
|
43
|
+
OptionalFlagRecordOrAbsentSchema,
|
|
44
|
+
OptionalFlagRecordSchema,
|
|
45
|
+
OptionalStringArraySchema,
|
|
46
|
+
OptionalStringRecordSchema,
|
|
47
|
+
StringArraySchema,
|
|
48
|
+
StringRecordSchema,
|
|
49
|
+
tolerant,
|
|
50
|
+
} from "./schemas/lenient.js";
|
|
51
|
+
|
|
52
|
+
export type { PackageSpec, Selector } from "./spec.js";
|
|
53
|
+
export { dedupeSpecs, formatSelector, formatSpec, parseSpec, parseSpecs } from "./spec.js";
|
|
54
|
+
|
|
55
|
+
export type { DependencyTarget } from "./dependency-range.js";
|
|
56
|
+
export { parseDependencyTarget } from "./dependency-range.js";
|
|
57
|
+
|
|
58
|
+
export type { PlatformConstraints, PlatformFilter, PlatformTarget } from "./platform.js";
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} from "./platform.js"
|
|
67
|
-
|
|
68
|
-
export type { BundleOptions, DependencyScope, ResolveOptions } from "./options.js"
|
|
69
|
-
export { defaultBundleOptions, defaultResolveOptions, defaultScope } from "./options.js"
|
|
70
|
-
|
|
71
|
-
export type { Packument, PackageDist, PackageManifest } from "./registry.js"
|
|
60
|
+
allPlatforms,
|
|
61
|
+
currentPlatform,
|
|
62
|
+
formatPlatformFilter,
|
|
63
|
+
isIncluded,
|
|
64
|
+
parsePlatformTarget,
|
|
65
|
+
platformTargets,
|
|
66
|
+
} from "./platform.js";
|
|
67
|
+
|
|
68
|
+
export type { BundleOptions, DependencyScope, ResolveOptions } from "./options.js";
|
|
69
|
+
export { defaultBundleOptions, defaultResolveOptions, defaultScope } from "./options.js";
|
|
70
|
+
|
|
71
|
+
export type { Packument, PackageDist, PackageManifest } from "./registry.js";
|
|
72
72
|
// `Registry.Service` and `Progress.Service` travel with their class through
|
|
73
73
|
// declaration merging, so the one name carries the tag and its shape.
|
|
74
|
-
export { Registry } from "./registry.js"
|
|
74
|
+
export { Registry } from "./registry.js";
|
|
75
75
|
|
|
76
|
-
export type { ProgressEvent } from "./progress.js"
|
|
76
|
+
export type { ProgressEvent } from "./progress.js";
|
|
77
77
|
// Aliased: `emit` and `layerSilent` say what they do inside `progress.ts`, and
|
|
78
78
|
// nothing at all on a package's public surface.
|
|
79
79
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} from "./progress.js"
|
|
86
|
-
|
|
87
|
-
export type { IntegrityHash, VerificationResult } from "./integrity.js"
|
|
88
|
-
export { digestOf, hexDigestOf, parseIntegrity, verify as verifyIntegrity } from "./integrity.js"
|
|
80
|
+
emit as emitProgress,
|
|
81
|
+
layerCallback as layerCallbackProgress,
|
|
82
|
+
layerSilent as layerSilentProgress,
|
|
83
|
+
makeCollector as makeProgressCollector,
|
|
84
|
+
Progress,
|
|
85
|
+
} from "./progress.js";
|
|
86
|
+
|
|
87
|
+
export type { IntegrityAlgorithm, IntegrityHash, VerificationResult } from "./integrity.js";
|
|
88
|
+
export { digestOf, hexDigestOf, parseIntegrity, verify as verifyIntegrity } from "./integrity.js";
|
|
89
|
+
|
|
90
|
+
// The packing backend. The Node implementation is deliberately *not* re-exported
|
|
91
|
+
// here — it lives behind `@packall/core/node`, because it pulls in `node-tar` and
|
|
92
|
+
// reaching it has to be an explicit act so importing the engine stays safe in a
|
|
93
|
+
// browser.
|
|
94
|
+
export type { ArchiveResult, CreateArchiveOptions } from "./archive.js";
|
|
95
|
+
export { Archiver, createArchive } from "./archive.js";
|
|
89
96
|
|
|
90
97
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
} from "./layout.js"
|
|
100
|
-
|
|
101
|
-
export type { BundleManifest, ManifestEntry } from "./manifest.js"
|
|
102
|
-
export { buildManifest, MANIFEST_VERSION, serializeManifest } from "./manifest.js"
|
|
98
|
+
importGuide,
|
|
99
|
+
MANIFEST_FILE,
|
|
100
|
+
packagePath,
|
|
101
|
+
perSpecArchiveName,
|
|
102
|
+
README_FILE,
|
|
103
|
+
singleArchiveName,
|
|
104
|
+
splitName,
|
|
105
|
+
tarballFileName,
|
|
106
|
+
} from "./layout.js";
|
|
107
|
+
|
|
108
|
+
export type { BundleManifest, ManifestEntry } from "./manifest.js";
|
|
109
|
+
export { buildManifest, MANIFEST_VERSION, serializeManifest } from "./manifest.js";
|
|
103
110
|
|
|
104
111
|
export type {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
} from "./resolve.js"
|
|
112
|
-
export { indexPackages, packageKey, resolve, selectVersions } from "./resolve.js"
|
|
113
|
-
|
|
114
|
-
export type { LockedResolveOptions } from "./locked-resolve.js"
|
|
115
|
-
export { resolveLocked } from "./locked-resolve.js"
|
|
116
|
-
|
|
117
|
-
export type { LockfileDetection } from "./lockfile/detect.js"
|
|
118
|
-
export { detectLockfile } from "./lockfile/detect.js"
|
|
112
|
+
PackageKey,
|
|
113
|
+
Reason,
|
|
114
|
+
Resolution,
|
|
115
|
+
ResolutionWarning,
|
|
116
|
+
ResolvedPackage,
|
|
117
|
+
RootResolution,
|
|
118
|
+
} from "./resolve.js";
|
|
119
|
+
export { indexPackages, packageKey, resolve, selectVersions } from "./resolve.js";
|
|
120
|
+
|
|
121
|
+
export type { LockedResolveOptions } from "./locked-resolve.js";
|
|
122
|
+
export { resolveLocked } from "./locked-resolve.js";
|
|
123
|
+
|
|
124
|
+
export type { LockfileDetection } from "./lockfile/detect.js";
|
|
125
|
+
export { detectLockfile } from "./lockfile/detect.js";
|
|
126
|
+
export type {
|
|
127
|
+
LockedEdge,
|
|
128
|
+
LockedPackage,
|
|
129
|
+
LockedRoot,
|
|
130
|
+
LockedTree,
|
|
131
|
+
LockfileParseOptions,
|
|
132
|
+
} from "./lockfile/types.js";
|
|
133
|
+
export { formatByLockfileName, lockfileNamesFor } from "./lockfile/names.js";
|
|
134
|
+
export { parseLockfile } from "./lockfile/parse.js";
|
|
135
|
+
|
|
136
|
+
export type { InputFileOptions, InputFileResult } from "./input-file.js";
|
|
137
|
+
export { defaultInputFileOptions, parseInputFile, readInputFile } from "./input-file.js";
|
|
138
|
+
|
|
119
139
|
export type {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} from "./
|
|
126
|
-
export { formatByLockfileName, lockfileNamesFor } from "./lockfile/names.js"
|
|
127
|
-
export { parseLockfile } from "./lockfile/parse.js"
|
|
128
|
-
|
|
129
|
-
export type { InputFileOptions, InputFileResult } from "./input-file.js"
|
|
130
|
-
export { defaultInputFileOptions, parseInputFile, readInputFile } from "./input-file.js"
|
|
131
|
-
|
|
132
|
-
export type { BundleArtifact, BundleContext, BundleResult, PlannedOutput, PlanSummary } from "./bundle.js"
|
|
140
|
+
BundleArtifact,
|
|
141
|
+
BundleContext,
|
|
142
|
+
BundleResult,
|
|
143
|
+
PlannedOutput,
|
|
144
|
+
PlanSummary,
|
|
145
|
+
} from "./bundle.js";
|
|
133
146
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
} from "./bundle.js"
|
|
147
|
+
bundle,
|
|
148
|
+
bundleLocked,
|
|
149
|
+
bundleResolved,
|
|
150
|
+
plan,
|
|
151
|
+
planLocked,
|
|
152
|
+
plannedOutputs,
|
|
153
|
+
summarize,
|
|
154
|
+
withLayout,
|
|
155
|
+
} from "./bundle.js";
|