@endo/compartment-mapper 1.3.1 → 1.5.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 (154) hide show
  1. package/README.md +64 -27
  2. package/archive-lite.d.ts +1 -0
  3. package/archive-lite.js +3 -0
  4. package/archive-parsers.d.ts +1 -0
  5. package/archive-parsers.js +3 -0
  6. package/archive.d.ts +1 -0
  7. package/archive.js +3 -0
  8. package/bundle.d.ts +1 -0
  9. package/bundle.js +3 -0
  10. package/capture-lite.d.ts +1 -0
  11. package/capture-lite.js +3 -0
  12. package/import-archive-all-parsers.d.ts +2 -0
  13. package/import-archive-all-parsers.d.ts.map +1 -0
  14. package/import-archive-all-parsers.js +1 -0
  15. package/import-archive-lite.d.ts +1 -0
  16. package/import-archive-lite.js +3 -0
  17. package/import-archive-parsers.d.ts +1 -0
  18. package/import-archive-parsers.js +3 -0
  19. package/import-archive.d.ts +1 -0
  20. package/import-archive.js +3 -0
  21. package/import-lite.d.ts +1 -0
  22. package/import-lite.js +3 -0
  23. package/import-parsers.d.ts +1 -0
  24. package/import-parsers.js +3 -0
  25. package/import.d.ts +1 -0
  26. package/import.js +3 -0
  27. package/index.d.ts +1 -0
  28. package/index.js +3 -1
  29. package/node-modules.d.ts +1 -0
  30. package/node-modules.js +3 -0
  31. package/node-powers.d.ts +1 -0
  32. package/node-powers.js +3 -0
  33. package/package.json +16 -15
  34. package/src/archive-lite.d.ts +8 -10
  35. package/src/archive-lite.d.ts.map +1 -1
  36. package/src/archive-lite.js +35 -209
  37. package/src/archive.d.ts.map +1 -1
  38. package/src/archive.js +140 -28
  39. package/src/bundle.d.ts.map +1 -1
  40. package/src/bundle.js +62 -16
  41. package/src/capture-lite.d.ts +2 -2
  42. package/src/capture-lite.d.ts.map +1 -1
  43. package/src/capture-lite.js +27 -201
  44. package/src/compartment-map.d.ts +2 -1
  45. package/src/compartment-map.d.ts.map +1 -1
  46. package/src/compartment-map.js +11 -3
  47. package/src/digest.d.ts +5 -0
  48. package/src/digest.d.ts.map +1 -0
  49. package/src/digest.js +235 -0
  50. package/src/extension.d.ts.map +1 -1
  51. package/src/extension.js +1 -3
  52. package/src/import-archive-all-parsers.d.ts +11 -0
  53. package/src/import-archive-all-parsers.d.ts.map +1 -0
  54. package/src/import-archive-all-parsers.js +29 -0
  55. package/src/import-archive-lite.d.ts +3 -19
  56. package/src/import-archive-lite.d.ts.map +1 -1
  57. package/src/import-archive-lite.js +47 -57
  58. package/src/import-archive-parsers.d.ts.map +1 -1
  59. package/src/import-archive-parsers.js +1 -0
  60. package/src/import-archive.d.ts +2 -2
  61. package/src/import-archive.d.ts.map +1 -1
  62. package/src/import-archive.js +15 -12
  63. package/src/import-hook.d.ts +2 -1
  64. package/src/import-hook.d.ts.map +1 -1
  65. package/src/import-hook.js +87 -76
  66. package/src/import-lite.d.ts.map +1 -1
  67. package/src/import-lite.js +26 -23
  68. package/src/import.d.ts.map +1 -1
  69. package/src/import.js +49 -23
  70. package/src/infer-exports.d.ts.map +1 -1
  71. package/src/infer-exports.js +2 -3
  72. package/src/json.d.ts.map +1 -1
  73. package/src/json.js +1 -2
  74. package/src/link.d.ts.map +1 -1
  75. package/src/link.js +14 -29
  76. package/src/map-parser.d.ts.map +1 -1
  77. package/src/map-parser.js +25 -17
  78. package/src/node-module-specifier.d.ts.map +1 -1
  79. package/src/node-module-specifier.js +2 -3
  80. package/src/node-modules.d.ts +10 -8
  81. package/src/node-modules.d.ts.map +1 -1
  82. package/src/node-modules.js +212 -97
  83. package/src/node-powers.d.ts +8 -8
  84. package/src/node-powers.d.ts.map +1 -1
  85. package/src/node-powers.js +29 -24
  86. package/src/parse-archive-cjs.d.ts +3 -2
  87. package/src/parse-archive-cjs.d.ts.map +1 -1
  88. package/src/parse-archive-cjs.js +5 -4
  89. package/src/parse-archive-mjs.d.ts +3 -2
  90. package/src/parse-archive-mjs.d.ts.map +1 -1
  91. package/src/parse-archive-mjs.js +7 -5
  92. package/src/parse-bytes.d.ts +3 -2
  93. package/src/parse-bytes.d.ts.map +1 -1
  94. package/src/parse-bytes.js +7 -5
  95. package/src/parse-cjs-shared-export-wrapper.d.ts.map +1 -1
  96. package/src/parse-cjs-shared-export-wrapper.js +7 -6
  97. package/src/parse-cjs.d.ts +3 -2
  98. package/src/parse-cjs.d.ts.map +1 -1
  99. package/src/parse-cjs.js +14 -5
  100. package/src/parse-json.d.ts.map +1 -1
  101. package/src/parse-json.js +6 -6
  102. package/src/parse-mjs.d.ts +3 -2
  103. package/src/parse-mjs.d.ts.map +1 -1
  104. package/src/parse-mjs.js +3 -3
  105. package/src/parse-pre-cjs.d.ts +3 -2
  106. package/src/parse-pre-cjs.d.ts.map +1 -1
  107. package/src/parse-pre-cjs.js +14 -4
  108. package/src/parse-pre-mjs.d.ts +3 -2
  109. package/src/parse-pre-mjs.d.ts.map +1 -1
  110. package/src/parse-pre-mjs.js +4 -3
  111. package/src/parse-text.d.ts +3 -2
  112. package/src/parse-text.d.ts.map +1 -1
  113. package/src/parse-text.js +6 -5
  114. package/src/policy-format.d.ts +1 -1
  115. package/src/policy-format.d.ts.map +1 -1
  116. package/src/policy-format.js +5 -7
  117. package/src/policy.d.ts.map +1 -1
  118. package/src/policy.js +15 -10
  119. package/src/powers.d.ts.map +1 -1
  120. package/src/powers.js +15 -12
  121. package/src/search.d.ts.map +1 -1
  122. package/src/search.js +10 -7
  123. package/src/types/compartment-map-schema.d.ts +98 -0
  124. package/src/types/compartment-map-schema.d.ts.map +1 -0
  125. package/src/types/compartment-map-schema.ts +116 -0
  126. package/src/types/external.d.ts +299 -0
  127. package/src/types/external.d.ts.map +1 -0
  128. package/src/types/external.ts +428 -0
  129. package/src/types/internal.d.ts +162 -0
  130. package/src/types/internal.d.ts.map +1 -0
  131. package/src/types/internal.ts +217 -0
  132. package/src/types/node-powers.d.ts +46 -0
  133. package/src/types/node-powers.d.ts.map +1 -0
  134. package/src/types/node-powers.ts +52 -0
  135. package/src/types/policy-schema.d.ts +81 -0
  136. package/src/types/policy-schema.d.ts.map +1 -0
  137. package/src/types/policy-schema.ts +131 -0
  138. package/src/types/policy.d.ts +20 -0
  139. package/src/types/policy.d.ts.map +1 -0
  140. package/src/types/policy.ts +42 -0
  141. package/src/types/powers.d.ts +83 -0
  142. package/src/types/powers.d.ts.map +1 -0
  143. package/src/types/powers.ts +120 -0
  144. package/src/types/typescript.d.ts +28 -0
  145. package/src/types/typescript.d.ts.map +1 -0
  146. package/src/types/typescript.ts +41 -0
  147. package/src/types-external.d.ts +14 -0
  148. package/src/types-external.js +2 -0
  149. package/src/types.d.ts +9 -787
  150. package/src/url.d.ts.map +1 -1
  151. package/src/url.js +2 -3
  152. package/src/types.d.ts.map +0 -1
  153. package/src/types.js +0 -995
  154. package/types.d.ts +0 -19
package/README.md CHANGED
@@ -204,6 +204,8 @@ does not exist, to the `index.js` file in the directory with the same name.
204
204
  > `fetch` global, in conjunction with usable values for `import.meta.url` in
205
205
  > ECMAScript modules or `__dirname` and `__filename` in CommonJS modules.
206
206
 
207
+ ## Language Extensions
208
+
207
209
  Officially beginning with Node.js 14, Node.js treats `.mjs` files as ECMAScript
208
210
  modules and `.cjs` files as CommonJS modules.
209
211
  The `.js` extension indicates a CommonJS module by default, to maintain
@@ -211,30 +213,6 @@ backward compatibility.
211
213
  However, packages that have a `type` property that explicitly says `module`
212
214
  will treat a `.js` file as an ECMAScript module.
213
215
 
214
- This unforunately conflicts with packages written to work with the ECMAScript
215
- module system emulator in the `esm` package on npm, which allows every file
216
- with the `js` extension to be an ECMAScript module that presents itself to
217
- Node.js as a CommonJS module.
218
- To overcome such obstacles, the compartment mapper will accept a non-standard
219
- `parsers` property in `package.json` that maps file extensions, specifically
220
- `js` to the corresponding language name, one of `mjs` for ECMAScript modules,
221
- `cjs` for CommonJS modules, and `json` for JSON modules.
222
- All other language names are reserved and the defaults for files with the
223
- extensions `cjs`, `mjs`, `json`, `text`, and `bytes` default to the language of
224
- the same name unless overridden.
225
- JSON modules export a default object resulting from the conventional JSON.parse
226
- of the module's UTF-8 encoded bytes.
227
- Text modules export a default string from the module's UTF-8 encoded bytes.
228
- Bytes modules export a default ArrayBuffer capturing the module's bytes.
229
- If compartment mapper sees `parsers`, it ignores `type`, so these can
230
- contradict where using the `esm` emulator requires.
231
-
232
- ```json
233
- {
234
- "parsers": {"js": "mjs"}
235
- }
236
- ```
237
-
238
216
  Many Node.js applications using CommonJS modules expect to be able to `require`
239
217
  a JSON file like `package.json`.
240
218
  The compartment mapper supports loading JSON modules from any type of module.
@@ -252,9 +230,54 @@ As of Node.js 14, Node does not support loading ECMAScript modules from
252
230
  CommonJS modules, so using this feature may limit compatibility with the
253
231
  Node.js platform.
254
232
 
255
- > TODO A future version may introduce language plugins, so a package may state
256
- > that files with a particular extension are either parsed or linked with
257
- > another module.
233
+ The compartment mapper supports language plugins.
234
+ The languages supported by default are:
235
+
236
+ - `mjs` for ECMAScript modules,
237
+ - `cjs` for CommonJS modules,
238
+ - `json` for JSON modules,
239
+ - `text` for UTF-8 encoded text files,
240
+ - `bytes` for any file, exporting a `Uint8Array` as `default`,
241
+ - `pre-mjs-json` for pre-compiled ECMAScript modules captured as JSON in
242
+ archives, and
243
+ - `pre-cjs-json` for pre-compiled CommonJS modules captured as JSON in
244
+ archives.
245
+
246
+ The compartment mapper accepts extensions to this set of languages with
247
+ the `parserForLanguage` option supported by many functions.
248
+ See `src/types/external.ts` for the type and expected behavior for
249
+ parsers.
250
+
251
+ These language identifiers are keys for the `moduleTransforms` and
252
+ `syncModuleTransforms` options, which may map each language to a transform
253
+ function.
254
+ The language identifiers are also the values for a `languageForExtension`,
255
+ `moduleLanguageForExtension`, and `commonjsLanguageForExtension` options to
256
+ configure additional extension-to-language mappings for a module and its
257
+ transitive dependencies.
258
+
259
+ For any package that has `type` set to `"module"` in its `package.json`,
260
+ `moduleLangaugeForExtension` will precede `languageForExtension`.
261
+ Packages with `type` set to `"commonjs"` or simply not set,
262
+ `commonjsLanguageForExtension` will precede `languageForExtension`.
263
+ This provides an hook for mapping TypeScript's `.ts` to either `.cts` or
264
+ `.mts`.
265
+
266
+ The analogous `workspaceLanguageForExtension`,
267
+ `workspaceCommonjsLanguageForExtension`, and
268
+ `workspaceModuleLanguageForExtension` options apply more specifically for
269
+ packages that are not under a `node_modules` directory, indicating that they
270
+ are in the set of linked workspaces and have not been built or published to
271
+ npm.
272
+
273
+ In the scope any given package, the `parsers` property in `package.json` may
274
+ override the extension-to-language mapping.
275
+
276
+ ```json
277
+ {
278
+ "parsers": { "png": "bytes" }
279
+ }
280
+ ```
258
281
 
259
282
  > TODO
260
283
  >
@@ -305,6 +328,20 @@ These will be appended to each module from the archive, for debugging purposes.
305
328
  The `@endo/bundle-source` and `@endo/import-bundle` tools integrate source maps
306
329
  for an end-to-end debugging experience.
307
330
 
331
+ # XS (experimental)
332
+
333
+ The Compartment Mapper can use native XS `Compartment` and `ModuleSource` under
334
+ certain conditions:
335
+
336
+ 1. The application must be an XS script that was compiled with the `xs`
337
+ package condition.
338
+ This causes `ses`, `@endo/module-source`, and `@endo/import-bundle` to
339
+ provide slightly different implementations that can fall through to native
340
+ behavior.
341
+ 2. The application must opt-in with the `__native__: true` option on any
342
+ of the compartment mapper methods that import modules like `importLocation`
343
+ and `importArchive`.
344
+
308
345
  # Design
309
346
 
310
347
  Each of the workflows the compartment mapper executes a portion of one sequence
package/archive-lite.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { makeArchiveFromMap, makeAndHashArchiveFromMap, writeArchiveFromMap, mapFromMap, hashFromMap } from "./src/archive-lite.js";
2
3
  //# sourceMappingURL=archive-lite.d.ts.map
package/archive-lite.js CHANGED
@@ -1,3 +1,6 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export {
2
5
  makeArchiveFromMap,
3
6
  makeAndHashArchiveFromMap,
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { defaultParserForLanguage } from "./src/archive-parsers.js";
2
3
  //# sourceMappingURL=archive-parsers.d.ts.map
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { defaultParserForLanguage } from './src/archive-parsers.js';
package/archive.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { makeArchive, makeAndHashArchive, writeArchive, mapLocation, hashLocation } from "./src/archive.js";
2
3
  //# sourceMappingURL=archive.d.ts.map
package/archive.js CHANGED
@@ -1,3 +1,6 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export {
2
5
  makeArchive,
3
6
  makeAndHashArchive,
package/bundle.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { makeBundle, writeBundle } from "./src/bundle.js";
2
3
  //# sourceMappingURL=bundle.d.ts.map
package/bundle.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { makeBundle, writeBundle } from './src/bundle.js';
package/capture-lite.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { captureFromMap } from "./src/capture-lite.js";
2
3
  //# sourceMappingURL=capture-lite.d.ts.map
package/capture-lite.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { captureFromMap } from './src/capture-lite.js';
@@ -0,0 +1,2 @@
1
+ export { defaultParserForLanguage } from "./src/import-archive-all-parsers.js";
2
+ //# sourceMappingURL=import-archive-all-parsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-archive-all-parsers.d.ts","sourceRoot":"","sources":["import-archive-all-parsers.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { defaultParserForLanguage } from './src/import-archive-all-parsers.js';
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { parseArchive, loadArchive, importArchive } from "./src/import-archive-lite.js";
2
3
  //# sourceMappingURL=import-archive-lite.d.ts.map
@@ -1,3 +1,6 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export {
2
5
  parseArchive,
3
6
  loadArchive,
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { defaultParserForLanguage } from "./src/import-archive-parsers.js";
2
3
  //# sourceMappingURL=import-archive-parsers.d.ts.map
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { defaultParserForLanguage } from './src/import-archive-parsers.js';
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { parseArchive, loadArchive, importArchive } from "./src/import-archive.js";
2
3
  //# sourceMappingURL=import-archive.d.ts.map
package/import-archive.js CHANGED
@@ -1,3 +1,6 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export {
2
5
  parseArchive,
3
6
  loadArchive,
package/import-lite.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { loadFromMap, importFromMap } from "./src/import-lite.js";
2
3
  //# sourceMappingURL=import-lite.d.ts.map
package/import-lite.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { loadFromMap, importFromMap } from './src/import-lite.js';
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { defaultParserForLanguage } from "./src/import-parsers.js";
2
3
  //# sourceMappingURL=import-parsers.d.ts.map
package/import-parsers.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { defaultParserForLanguage } from './src/import-parsers.js';
package/import.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { loadLocation, importLocation } from "./src/import.js";
2
3
  //# sourceMappingURL=import.d.ts.map
package/import.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { loadLocation, importLocation } from './src/import.js';
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./src/types-external.js";
1
2
  export { search } from "./src/search.js";
2
3
  export { compartmentMapForNodeModules } from "./src/node-modules.js";
3
4
  export { loadLocation, importLocation } from "./src/import.js";
package/index.js CHANGED
@@ -1,4 +1,6 @@
1
- // @ts-check
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
2
4
  export { loadLocation, importLocation } from './src/import.js';
3
5
  export {
4
6
  makeArchive,
package/node-modules.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { mapNodeModules } from "./src/node-modules.js";
2
3
  //# sourceMappingURL=node-modules.d.ts.map
package/node-modules.js CHANGED
@@ -1 +1,4 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export { mapNodeModules } from './src/node-modules.js';
package/node-powers.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "./src/types-external.js";
1
2
  export { makeReadPowers, makeWritePowers, makeReadNowPowers, makeNodeReadPowers, makeNodeWritePowers } from "./src/node-powers.js";
2
3
  //# sourceMappingURL=node-powers.d.ts.map
package/node-powers.js CHANGED
@@ -1,3 +1,6 @@
1
+ // eslint-disable-next-line import/export -- just types
2
+ export * from './src/types-external.js';
3
+
1
4
  export {
2
5
  makeReadPowers,
3
6
  makeWritePowers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endo/compartment-mapper",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "The compartment mapper assembles Node applications in a sandbox",
5
5
  "keywords": [
6
6
  "node",
@@ -21,12 +21,8 @@
21
21
  },
22
22
  "type": "module",
23
23
  "main": "./index.js",
24
- "types": "./types.d.ts",
25
24
  "exports": {
26
- ".": {
27
- "types": "./types.d.ts",
28
- "default": "./index.js"
29
- },
25
+ ".": "./index.js",
30
26
  "./import.js": "./import.js",
31
27
  "./import-lite.js": "./import-lite.js",
32
28
  "./import-parsers.js": "./import-parsers.js",
@@ -36,7 +32,12 @@
36
32
  "./capture-lite.js": "./capture-lite.js",
37
33
  "./import-archive.js": "./import-archive.js",
38
34
  "./import-archive-lite.js": "./import-archive-lite.js",
39
- "./import-archive-parsers.js": "./import-archive-parsers.js",
35
+ "./import-archive-parsers.js": {
36
+ "xs": "./import-archive-all-parsers.js",
37
+ "node": "./import-archive-all-parsers.js",
38
+ "default": "./import-archive-parsers.js"
39
+ },
40
+ "./import-archive-all-parsers.js": "./import-archive-all-parsers.js",
40
41
  "./bundle.js": "./bundle.js",
41
42
  "./node-powers.js": "./node-powers.js",
42
43
  "./node-modules.js": "./node-modules.js",
@@ -55,11 +56,11 @@
55
56
  "test": "ava"
56
57
  },
57
58
  "dependencies": {
58
- "@endo/cjs-module-analyzer": "^1.0.8",
59
- "@endo/module-source": "^1.1.1",
60
- "@endo/trampoline": "^1.0.2",
61
- "@endo/zip": "^1.0.8",
62
- "ses": "^1.9.1"
59
+ "@endo/cjs-module-analyzer": "^1.0.9",
60
+ "@endo/module-source": "^1.2.0",
61
+ "@endo/trampoline": "^1.0.3",
62
+ "@endo/zip": "^1.0.9",
63
+ "ses": "^1.11.0"
63
64
  },
64
65
  "devDependencies": {
65
66
  "ava": "^6.1.3",
@@ -70,8 +71,8 @@
70
71
  "eslint-config-prettier": "^9.1.0",
71
72
  "eslint-plugin-eslint-comments": "^3.2.0",
72
73
  "eslint-plugin-import": "^2.29.1",
73
- "prettier": "^3.2.5",
74
- "typescript": "~5.6.2"
74
+ "prettier": "^3.3.3",
75
+ "typescript": "~5.6.3"
75
76
  },
76
77
  "files": [
77
78
  "./*.d.ts",
@@ -113,5 +114,5 @@
113
114
  "typeCoverage": {
114
115
  "atLeast": 86.14
115
116
  },
116
- "gitHead": "c242c28a68d1af29475150e44b5f3e9d0feda8cd"
117
+ "gitHead": "e0683e0bfdbfc84351af332c9e78813d7b67ef89"
117
118
  }
@@ -1,20 +1,18 @@
1
- export function makeArchiveCompartmentMap(compartmentMap: CompartmentMapDescriptor, sources: Sources): {
2
- archiveCompartmentMap: CompartmentMapDescriptor;
3
- archiveSources: Sources;
4
- };
5
- export function makeAndHashArchiveFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveOptions | undefined): Promise<{
1
+ export function makeArchiveCompartmentMap(compartmentMap: CompartmentMapDescriptor, sources: Sources): ArchiveResult;
2
+ export function makeAndHashArchiveFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveLiteOptions | undefined): Promise<{
6
3
  bytes: Uint8Array;
7
4
  sha512?: string;
8
5
  }>;
9
- export function makeArchiveFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveOptions | undefined): Promise<Uint8Array>;
10
- export function mapFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveOptions | undefined): Promise<Uint8Array>;
11
- export function hashFromMap(powers: HashPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveOptions | undefined): Promise<string>;
12
- export function writeArchiveFromMap(write: WriteFn, readPowers: ReadFn | ReadPowers, archiveLocation: string, compartmentMap: CompartmentMapDescriptor, options?: ArchiveOptions | undefined): Promise<void>;
6
+ export function makeArchiveFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveLiteOptions | undefined): Promise<Uint8Array>;
7
+ export function mapFromMap(powers: ReadFn | ReadPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveLiteOptions | undefined): Promise<Uint8Array>;
8
+ export function hashFromMap(powers: HashPowers, compartmentMap: CompartmentMapDescriptor, options?: ArchiveLiteOptions | undefined): Promise<string>;
9
+ export function writeArchiveFromMap(write: WriteFn, readPowers: ReadFn | ReadPowers, archiveLocation: string, compartmentMap: CompartmentMapDescriptor, options?: ArchiveLiteOptions | undefined): Promise<void>;
13
10
  import type { CompartmentMapDescriptor } from './types.js';
14
11
  import type { Sources } from './types.js';
12
+ import type { ArchiveResult } from './types.js';
15
13
  import type { ReadFn } from './types.js';
16
14
  import type { ReadPowers } from './types.js';
17
- import type { ArchiveOptions } from './types.js';
15
+ import type { ArchiveLiteOptions } from './types.js';
18
16
  import type { HashPowers } from './types.js';
19
17
  import type { WriteFn } from './types.js';
20
18
  //# sourceMappingURL=archive-lite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"archive-lite.d.ts","sourceRoot":"","sources":["archive-lite.js"],"names":[],"mappings":"AA2QO,0DAJI,wBAAwB,WACxB,OAAO,GACL;IAAC,qBAAqB,EAAE,wBAAwB,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAC,CAmCtF;AA6GM,kDALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,yCAEtB,OAAO,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAmBzD;AAQM,2CALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,yCAEtB,OAAO,CAAC,UAAU,CAAC,CAS/B;AAQM,mCALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,yCAEtB,OAAO,CAAC,UAAU,CAAC,CAS/B;AAQM,oCALI,UAAU,kBACV,wBAAwB,yCAEtB,OAAO,CAAC,MAAM,CAAC,CAU3B;AASM,2CANI,OAAO,cACP,MAAM,GAAG,UAAU,mBACnB,MAAM,kBACN,wBAAwB,uDAgBlC;8CA1c2C,YAAY;6BAM7B,YAAY;4BAJb,YAAY;gCAER,YAAY;oCAPR,YAAY;gCAQhB,YAAY;6BAEf,YAAY"}
1
+ {"version":3,"file":"archive-lite.d.ts","sourceRoot":"","sources":["archive-lite.js"],"names":[],"mappings":"AAmHO,0DAJI,wBAAwB,WACxB,OAAO,GACL,aAAa,CAiBzB;AAyGM,kDALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,6CAEtB,OAAO,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAmBzD;AAQM,2CALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,6CAEtB,OAAO,CAAC,UAAU,CAAC,CAS/B;AAQM,mCALI,MAAM,GAAG,UAAU,kBACnB,wBAAwB,6CAEtB,OAAO,CAAC,UAAU,CAAC,CAS/B;AAQM,oCALI,UAAU,kBACV,wBAAwB,6CAEtB,OAAO,CAAC,MAAM,CAAC,CAU3B;AASM,2CANI,OAAO,cACP,MAAM,GAAG,UAAU,mBACnB,MAAM,kBACN,wBAAwB,2DAgBlC;8CApRS,YAAY;6BAAZ,YAAY;mCAAZ,YAAY;4BAAZ,YAAY;gCAAZ,YAAY;wCAAZ,YAAY;gCAAZ,YAAY;6BAAZ,YAAY"}