@crombolo/transfer 0.14.1 → 0.14.4
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/package.json +3 -3
- package/src/load.ts +1 -1
- package/src/model.ts +7 -2
- package/src/write.ts +6 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/transfer",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "Content transfer for crombolo: bundles of content moved between environments.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crombolo",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@crombolo/core": "0.14.
|
|
32
|
-
"@crombolo/data": "0.14.
|
|
31
|
+
"@crombolo/core": "0.14.4",
|
|
32
|
+
"@crombolo/data": "0.14.4"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/load.ts
CHANGED
|
@@ -315,7 +315,7 @@ function parseManifest(text: string, problems: BundleProblem[]): BundleManifest
|
|
|
315
315
|
...(parseSealParameters(raw.seal) ? { seal: parseSealParameters(raw.seal) } : {}),
|
|
316
316
|
...(raw.content === 'sealed' || raw.content === 'omitted' ? { content: raw.content } : {}),
|
|
317
317
|
...(raw.scope === 'site' ? { scope: 'site' as const } : {}),
|
|
318
|
-
...(raw.media === 'omitted' ? { media:
|
|
318
|
+
...(raw.media === 'omitted' || raw.media === 'referenced' ? { media: raw.media } : {}),
|
|
319
319
|
...(isRecord(raw.requires) ? { requires: parseRequires(raw.requires) } : {}),
|
|
320
320
|
}
|
|
321
321
|
}
|
package/src/model.ts
CHANGED
|
@@ -236,8 +236,13 @@ export interface BundleManifest {
|
|
|
236
236
|
* selection, overlaid as always.
|
|
237
237
|
*/
|
|
238
238
|
scope?: 'site'
|
|
239
|
-
/**
|
|
240
|
-
|
|
239
|
+
/**
|
|
240
|
+
* `omitted`: a whole-site file written without its media files (`--no-media`).
|
|
241
|
+
* `referenced`: without them because they move one at a time between the
|
|
242
|
+
* stores of a remote and the CLI (story 107): every blob is named, none is in
|
|
243
|
+
* the file, and the file is no use away from its remote.
|
|
244
|
+
*/
|
|
245
|
+
media?: 'omitted' | 'referenced'
|
|
241
246
|
/**
|
|
242
247
|
* The server bundles the site wires, by package name, at the versions that
|
|
243
248
|
* wrote it. An import refuses when the destination lacks one or has an older
|
package/src/write.ts
CHANGED
|
@@ -315,21 +315,17 @@ export function writeBundle(
|
|
|
315
315
|
/**
|
|
316
316
|
* A bundle whose media files the caller streams (story 104): the manifest and
|
|
317
317
|
* every other file, from each carried file's size alone. The caller writes
|
|
318
|
-
* `blobs` at `blobPath
|
|
319
|
-
*
|
|
320
|
-
*
|
|
318
|
+
* `blobs` at `blobPath` — sealed with `sealBytes` under the seal when `sealing`
|
|
319
|
+
* — computes `bundleIntegrity` over those and `files` in path order, and writes
|
|
320
|
+
* the manifest with it.
|
|
321
321
|
*/
|
|
322
322
|
export function planStreamedBundle(
|
|
323
323
|
set: ContentSet,
|
|
324
324
|
blobSizes: ReadonlyMap<string, number>,
|
|
325
325
|
sections: readonly BundleFile[] = [],
|
|
326
|
-
options:
|
|
327
|
-
): { manifest: BundleManifest; files: BundleFile[]; blobs: string[] } {
|
|
328
|
-
|
|
329
|
-
...options,
|
|
330
|
-
content: options.content ?? 'open',
|
|
331
|
-
})
|
|
332
|
-
return { manifest: planned.manifest, files: planned.files, blobs: planned.blobs }
|
|
326
|
+
options: WriteOptions = {},
|
|
327
|
+
): { manifest: BundleManifest; files: BundleFile[]; blobs: string[]; sealing: boolean } {
|
|
328
|
+
return planBundle(set, blobSizes, sections, { ...options, content: options.content ?? 'open' })
|
|
333
329
|
}
|
|
334
330
|
|
|
335
331
|
function planBundle(
|