From 756c062c7e8d4fca1e75f265c975c13ba8a4922d Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 3 Jun 2024 14:33:32 -0700 Subject: [PATCH] refactor(compartment-mapper): Decouple node_modules mapping strategy --- packages/compartment-mapper/archive-lite.js | 10 +- packages/compartment-mapper/import-lite.js | 2 +- packages/compartment-mapper/node-modules.js | 1 + packages/compartment-mapper/package.json | 1 + .../compartment-mapper/src/archive-lite.js | 85 +++++++---------- packages/compartment-mapper/src/archive.js | 87 ++++++++++++++---- .../compartment-mapper/src/import-lite.js | 69 +++++--------- packages/compartment-mapper/src/import.js | 34 ++++--- .../compartment-mapper/src/node-modules.js | 38 +++++++- .../test/snapshots/error-handling.test.js.md | 28 +++--- .../snapshots/error-handling.test.js.snap | Bin 784 -> 787 bytes 11 files changed, 203 insertions(+), 152 deletions(-) create mode 100644 packages/compartment-mapper/node-modules.js diff --git a/packages/compartment-mapper/archive-lite.js b/packages/compartment-mapper/archive-lite.js index 1b20c84f67..06ce1b188b 100644 --- a/packages/compartment-mapper/archive-lite.js +++ b/packages/compartment-mapper/archive-lite.js @@ -1,7 +1,7 @@ export { - makeArchive, - makeAndHashArchive, - writeArchive, - mapLocation, - hashLocation, + makeArchiveFromMap, + makeAndHashArchiveFromMap, + writeArchiveFromMap, + mapFromMap, + hashFromMap, } from './src/archive-lite.js'; diff --git a/packages/compartment-mapper/import-lite.js b/packages/compartment-mapper/import-lite.js index 48d1dea9d0..bc7493028f 100644 --- a/packages/compartment-mapper/import-lite.js +++ b/packages/compartment-mapper/import-lite.js @@ -1 +1 @@ -export { loadLocation, importLocation } from './src/import-lite.js'; +export { loadFromMap, importFromMap } from './src/import-lite.js'; diff --git a/packages/compartment-mapper/node-modules.js b/packages/compartment-mapper/node-modules.js new file mode 100644 index 0000000000..e6d1b20115 --- /dev/null +++ b/packages/compartment-mapper/node-modules.js @@ -0,0 +1 @@ +export { mapNodeModules } from './src/node-modules.js'; diff --git a/packages/compartment-mapper/package.json b/packages/compartment-mapper/package.json index 63da566cdc..d4d7c74d88 100644 --- a/packages/compartment-mapper/package.json +++ b/packages/compartment-mapper/package.json @@ -38,6 +38,7 @@ "./import-archive-parsers.js": "./import-archive-parsers.js", "./bundle.js": "./bundle.js", "./node-powers.js": "./node-powers.js", + "./node-modules.js": "./node-modules.js", "./package.json": "./package.json" }, "scripts": { diff --git a/packages/compartment-mapper/src/archive-lite.js b/packages/compartment-mapper/src/archive-lite.js index ebba03df9e..8f66a46a2e 100644 --- a/packages/compartment-mapper/src/archive-lite.js +++ b/packages/compartment-mapper/src/archive-lite.js @@ -15,14 +15,11 @@ import { writeZip } from '@endo/zip'; import { resolve } from './node-module-specifier.js'; -import { compartmentMapForNodeModules } from './node-modules.js'; -import { search } from './search.js'; import { link } from './link.js'; import { exitModuleImportHookMaker, makeImportHookMaker, } from './import-hook.js'; -import { parseLocatedJson } from './json.js'; import { unpackReadPowers } from './powers.js'; import { assertCompartmentMap, @@ -272,19 +269,16 @@ export const makeArchiveCompartmentMap = (compartmentMap, sources) => { /** * @param {ReadFn | ReadPowers} powers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] * @returns {Promise<{sources: Sources, compartmentMapBytes: Uint8Array, sha512?: string}>} */ -const digestLocation = async (powers, moduleLocation, options = {}) => { +const digestFromMap = async (powers, compartmentMap, options = {}) => { const { moduleTransforms, modules: exitModules = {}, - dev = false, - tags = new Set(), captureSourceLocation = undefined, searchSuffixes = undefined, - commonDependencies = undefined, importHook: exitModuleImportHook = undefined, policy = undefined, sourceMapHook = undefined, @@ -300,29 +294,6 @@ const digestLocation = async (powers, moduleLocation, options = {}) => { ); const { read, computeSha512 } = unpackReadPowers(powers); - const { - packageLocation, - packageDescriptorText, - packageDescriptorLocation, - moduleSpecifier, - } = await search(read, moduleLocation); - - tags.add('endo'); - tags.add('import'); - tags.add('default'); - - const packageDescriptor = parseLocatedJson( - packageDescriptorText, - packageDescriptorLocation, - ); - const compartmentMap = await compartmentMapForNodeModules( - powers, - packageLocation, - tags, - packageDescriptor, - moduleSpecifier, - { dev, commonDependencies, policy }, - ); const { compartments, @@ -337,7 +308,7 @@ const digestLocation = async (powers, moduleLocation, options = {}) => { exitModuleImportHook, }); - const makeImportHook = makeImportHookMaker(read, packageLocation, { + const makeImportHook = makeImportHookMaker(read, entryCompartmentName, { sources, compartmentDescriptors: compartments, archiveOnly: true, @@ -399,14 +370,18 @@ const digestLocation = async (powers, moduleLocation, options = {}) => { /** * @param {ReadFn | ReadPowers} powers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] * @returns {Promise<{bytes: Uint8Array, sha512?: string}>} */ -export const makeAndHashArchive = async (powers, moduleLocation, options) => { - const { compartmentMapBytes, sources, sha512 } = await digestLocation( +export const makeAndHashArchiveFromMap = async ( + powers, + compartmentMap, + options, +) => { + const { compartmentMapBytes, sources, sha512 } = await digestFromMap( powers, - moduleLocation, + compartmentMap, options, ); @@ -420,25 +395,29 @@ export const makeAndHashArchive = async (powers, moduleLocation, options) => { /** * @param {ReadFn | ReadPowers} powers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const makeArchive = async (powers, moduleLocation, options) => { - const { bytes } = await makeAndHashArchive(powers, moduleLocation, options); +export const makeArchiveFromMap = async (powers, compartmentMap, options) => { + const { bytes } = await makeAndHashArchiveFromMap( + powers, + compartmentMap, + options, + ); return bytes; }; /** * @param {ReadFn | ReadPowers} powers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const mapLocation = async (powers, moduleLocation, options) => { - const { compartmentMapBytes } = await digestLocation( +export const mapFromMap = async (powers, compartmentMap, options) => { + const { compartmentMapBytes } = await digestFromMap( powers, - moduleLocation, + compartmentMap, options, ); return compartmentMapBytes; @@ -446,14 +425,14 @@ export const mapLocation = async (powers, moduleLocation, options) => { /** * @param {HashPowers} powers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const hashLocation = async (powers, moduleLocation, options) => { - const { compartmentMapBytes } = await digestLocation( +export const hashFromMap = async (powers, compartmentMap, options) => { + const { compartmentMapBytes } = await digestFromMap( powers, - moduleLocation, + compartmentMap, options, ); const { computeSha512 } = powers; @@ -464,16 +443,20 @@ export const hashLocation = async (powers, moduleLocation, options) => { * @param {WriteFn} write * @param {ReadFn | ReadPowers} readPowers * @param {string} archiveLocation - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ArchiveOptions} [options] */ -export const writeArchive = async ( +export const writeArchiveFromMap = async ( write, readPowers, archiveLocation, - moduleLocation, + compartmentMap, options, ) => { - const archiveBytes = await makeArchive(readPowers, moduleLocation, options); + const archiveBytes = await makeArchiveFromMap( + readPowers, + compartmentMap, + options, + ); await write(archiveLocation, archiveBytes); }; diff --git a/packages/compartment-mapper/src/archive.js b/packages/compartment-mapper/src/archive.js index 7ae3a0f899..b75a14c785 100644 --- a/packages/compartment-mapper/src/archive.js +++ b/packages/compartment-mapper/src/archive.js @@ -1,16 +1,15 @@ // @ts-check import { defaultParserForLanguage } from './archive-parsers.js'; +import { mapNodeModules } from './node-modules.js'; import { - makeAndHashArchive as makeAndHashArchiveLite, - makeArchive as makeArchiveLite, - mapLocation as mapLocationLite, - hashLocation as hashLocationLite, - writeArchive as writeArchiveLite, + makeAndHashArchiveFromMap, + makeArchiveFromMap, + mapFromMap, + hashFromMap, + writeArchiveFromMap, } from './archive-lite.js'; -export { makeArchiveCompartmentMap } from './archive-lite.js'; - const { assign, create, freeze } = Object; /** @import {ArchiveOptions} from './types.js' */ @@ -34,12 +33,18 @@ const assignParserForLanguage = (options = {}) => { * @param {ArchiveOptions} [options] * @returns {Promise<{bytes: Uint8Array, sha512?: string}>} */ -export const makeAndHashArchive = async (powers, moduleLocation, options) => - makeAndHashArchiveLite( +export const makeAndHashArchive = async ( + powers, + moduleLocation, + options = {}, +) => { + const compartmentMap = await mapNodeModules(powers, moduleLocation, options); + return makeAndHashArchiveFromMap( powers, - moduleLocation, + compartmentMap, assignParserForLanguage(options), ); +}; /** * @param {ReadFn | ReadPowers} powers @@ -47,8 +52,22 @@ export const makeAndHashArchive = async (powers, moduleLocation, options) => * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const makeArchive = async (powers, moduleLocation, options) => - makeArchiveLite(powers, moduleLocation, assignParserForLanguage(options)); +export const makeArchive = async (powers, moduleLocation, options = {}) => { + const { dev, tags, commonDependencies, policy } = options; + + const compartmentMap = await mapNodeModules(powers, moduleLocation, { + dev, + tags, + commonDependencies, + policy, + }); + + return makeArchiveFromMap( + powers, + compartmentMap, + assignParserForLanguage(options), + ); +}; /** * @param {ReadFn | ReadPowers} powers @@ -56,8 +75,18 @@ export const makeArchive = async (powers, moduleLocation, options) => * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const mapLocation = async (powers, moduleLocation, options) => - mapLocationLite(powers, moduleLocation, assignParserForLanguage(options)); +export const mapLocation = async (powers, moduleLocation, options = {}) => { + const { dev, tags, commonDependencies, policy } = options; + + const compartmentMap = await mapNodeModules(powers, moduleLocation, { + dev, + tags, + commonDependencies, + policy, + }); + + return mapFromMap(powers, compartmentMap, assignParserForLanguage(options)); +}; /** * @param {HashPowers} powers @@ -65,8 +94,18 @@ export const mapLocation = async (powers, moduleLocation, options) => * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const hashLocation = async (powers, moduleLocation, options) => - hashLocationLite(powers, moduleLocation, assignParserForLanguage(options)); +export const hashLocation = async (powers, moduleLocation, options = {}) => { + const { dev, tags, commonDependencies, policy } = options; + + const compartmentMap = await mapNodeModules(powers, moduleLocation, { + dev, + tags, + commonDependencies, + policy, + }); + + return hashFromMap(powers, compartmentMap, assignParserForLanguage(options)); +}; /** * @param {WriteFn} write @@ -80,12 +119,20 @@ export const writeArchive = async ( readPowers, archiveLocation, moduleLocation, - options, -) => - writeArchiveLite( + options = {}, +) => { + const { dev, tags, commonDependencies, policy } = options; + const compartmentMap = await mapNodeModules(readPowers, moduleLocation, { + dev, + tags, + commonDependencies, + policy, + }); + return writeArchiveFromMap( write, readPowers, archiveLocation, - moduleLocation, + compartmentMap, assignParserForLanguage(options), ); +}; diff --git a/packages/compartment-mapper/src/import-lite.js b/packages/compartment-mapper/src/import-lite.js index 653a950734..cf556a0ea8 100644 --- a/packages/compartment-mapper/src/import-lite.js +++ b/packages/compartment-mapper/src/import-lite.js @@ -1,6 +1,7 @@ // @ts-check /* eslint no-shadow: "off" */ +/** @import {CompartmentMapDescriptor} from './types.js' */ /** @import {Application} from './types.js' */ /** @import {ImportLocationOptions} from './types.js' */ /** @import {LoadLocationOptions} from './types.js' */ @@ -9,36 +10,24 @@ /** @import {ReadPowers} from './types.js' */ /** @import {SomeObject} from './types.js' */ -import { compartmentMapForNodeModules } from './node-modules.js'; -import { search } from './search.js'; import { link } from './link.js'; import { exitModuleImportHookMaker, makeImportHookMaker, } from './import-hook.js'; -import { parseLocatedJson } from './json.js'; -import { unpackReadPowers } from './powers.js'; const { assign, create, freeze } = Object; /** * @param {ReadFn | ReadPowers} readPowers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {LoadLocationOptions} [options] * @returns {Promise} */ -export const loadLocation = async ( - readPowers, - moduleLocation, - options = {}, -) => { +export const loadFromMap = async (readPowers, compartmentMap, options = {}) => { const { moduleTransforms = {}, - dev = false, - tags = new Set(), searchSuffixes = undefined, - commonDependencies = undefined, - policy, parserForLanguage: parserForLanguageOption = {}, languageForExtension: languageForExtensionOption = {}, } = options; @@ -50,27 +39,9 @@ export const loadLocation = async ( assign(create(null), languageForExtensionOption), ); - const { read } = unpackReadPowers(readPowers); - const { - packageLocation, - packageDescriptorText, - packageDescriptorLocation, - moduleSpecifier, - } = await search(read, moduleLocation); - - const packageDescriptor = parseLocatedJson( - packageDescriptorText, - packageDescriptorLocation, - ); - const compartmentMap = await compartmentMapForNodeModules( - readPowers, - packageLocation, - tags, - packageDescriptor, - moduleSpecifier, - { dev, commonDependencies, policy }, - ); + entry: { compartment: entryCompartmentName, module: entryModuleSpecifier }, + } = compartmentMap; /** @type {ExecuteFn} */ const execute = async (options = {}) => { @@ -86,14 +57,18 @@ export const loadLocation = async ( modules, exitModuleImportHook, }); - const makeImportHook = makeImportHookMaker(readPowers, packageLocation, { - compartmentDescriptors: compartmentMap.compartments, - searchSuffixes, - archiveOnly: false, - entryCompartmentName: packageLocation, - entryModuleSpecifier: moduleSpecifier, - exitModuleImportHook: compartmentExitModuleImportHook, - }); + const makeImportHook = makeImportHookMaker( + readPowers, + entryCompartmentName, + { + compartmentDescriptors: compartmentMap.compartments, + searchSuffixes, + archiveOnly: false, + entryCompartmentName, + entryModuleSpecifier, + exitModuleImportHook: compartmentExitModuleImportHook, + }, + ); const { compartment, pendingJobsPromise } = link(compartmentMap, { makeImportHook, parserForLanguage, @@ -107,7 +82,7 @@ export const loadLocation = async ( await pendingJobsPromise; - return compartment.import(moduleSpecifier); + return compartment.import(entryModuleSpecifier); }; return { import: execute }; @@ -115,16 +90,16 @@ export const loadLocation = async ( /** * @param {ReadFn | ReadPowers} readPowers - * @param {string} moduleLocation + * @param {CompartmentMapDescriptor} compartmentMap * @param {ImportLocationOptions} [options] * @returns {Promise} the object of the imported modules exported * names. */ -export const importLocation = async ( +export const importFromMap = async ( readPowers, - moduleLocation, + compartmentMap, options = {}, ) => { - const application = await loadLocation(readPowers, moduleLocation, options); + const application = await loadFromMap(readPowers, compartmentMap, options); return application.import(options); }; diff --git a/packages/compartment-mapper/src/import.js b/packages/compartment-mapper/src/import.js index 98a3c92043..7151d08de4 100644 --- a/packages/compartment-mapper/src/import.js +++ b/packages/compartment-mapper/src/import.js @@ -1,10 +1,8 @@ // @ts-check import { defaultParserForLanguage } from './import-parsers.js'; -import { - loadLocation as loadLocationLite, - importLocation as importLocationLite, -} from './import-lite.js'; +import { mapNodeModules } from './node-modules.js'; +import { loadFromMap } from './import-lite.js'; const { assign, create, freeze } = Object; @@ -29,12 +27,24 @@ const assignParserForLanguage = (options = {}) => { * @param {ArchiveOptions} [options] * @returns {Promise} */ -export const loadLocation = async (readPowers, moduleLocation, options) => - loadLocationLite( +export const loadLocation = async ( + readPowers, + moduleLocation, + options = {}, +) => { + const { dev, tags, commonDependencies, policy } = options; + const compartmentMap = await mapNodeModules(readPowers, moduleLocation, { + dev, + tags, + commonDependencies, + policy, + }); + return loadFromMap( readPowers, - moduleLocation, + compartmentMap, assignParserForLanguage(options), ); +}; /** * @param {ReadFn | ReadPowers} readPowers @@ -43,9 +53,7 @@ export const loadLocation = async (readPowers, moduleLocation, options) => * @returns {Promise} the object of the imported modules exported * names. */ -export const importLocation = async (readPowers, moduleLocation, options) => - importLocationLite( - readPowers, - moduleLocation, - assignParserForLanguage(options), - ); +export const importLocation = async (readPowers, moduleLocation, options) => { + const application = await loadLocation(readPowers, moduleLocation, options); + return application.import(options); +}; diff --git a/packages/compartment-mapper/src/node-modules.js b/packages/compartment-mapper/src/node-modules.js index aaee187034..d912119d65 100644 --- a/packages/compartment-mapper/src/node-modules.js +++ b/packages/compartment-mapper/src/node-modules.js @@ -55,7 +55,7 @@ import { getPolicyForPackage, } from './policy.js'; import { unpackReadPowers } from './powers.js'; -import { searchDescriptor } from './search.js'; +import { search, searchDescriptor } from './search.js'; const { assign, create, keys, values } = Object; @@ -784,3 +784,39 @@ export const compartmentMapForNodeModules = async ( return compartmentMap; }; + +/** + * @param {ReadFn | ReadPowers} readPowers + * @param {string} moduleLocation + * @param {object} [options] + */ +export const mapNodeModules = async ( + readPowers, + moduleLocation, + options = {}, +) => { + const { tags = new Set(), dev = false, commonDependencies, policy } = options; + + const { read } = unpackReadPowers(readPowers); + + const { + packageLocation, + packageDescriptorText, + packageDescriptorLocation, + moduleSpecifier, + } = await search(read, moduleLocation); + + const packageDescriptor = parseLocatedJson( + packageDescriptorText, + packageDescriptorLocation, + ); + + return compartmentMapForNodeModules( + readPowers, + packageLocation, + tags, + packageDescriptor, + moduleSpecifier, + { dev, commonDependencies, policy }, + ); +}; diff --git a/packages/compartment-mapper/test/snapshots/error-handling.test.js.md b/packages/compartment-mapper/test/snapshots/error-handling.test.js.md index bc36aa2aca..500b959374 100644 --- a/packages/compartment-mapper/test/snapshots/error-handling.test.js.md +++ b/packages/compartment-mapper/test/snapshots/error-handling.test.js.md @@ -31,9 +31,9 @@ Generated by [AVA](https://avajs.dev). `TypeError: Failed to load module "./main.js" in package "file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/" (1 underlying failures: Cannot find external module "missing" in package file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/␊ at throwAggregateError (file://.../ses/src/module-load.js:…)␊ at load (file://.../ses/src/module-load.js:…)␊ - at async digestLocation (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeAndHashArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async digestFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeAndHashArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ at async file://.../compartment-mapper/test/scaffold.js:…␊ at async file://.../compartment-mapper/test/scaffold.js:…` @@ -44,9 +44,9 @@ Generated by [AVA](https://avajs.dev). `TypeError: Failed to load module "./main.js" in package "file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/" (1 underlying failures: Cannot find external module "missing" in package file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/␊ at throwAggregateError (file://.../ses/src/module-load.js:…)␊ at load (file://.../ses/src/module-load.js:…)␊ - at async digestLocation (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeAndHashArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async digestFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeAndHashArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ at async file://.../compartment-mapper/test/scaffold.js:…␊ at async file://.../compartment-mapper/test/scaffold.js:…` @@ -57,10 +57,10 @@ Generated by [AVA](https://avajs.dev). `TypeError: Failed to load module "./main.js" in package "file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/" (1 underlying failures: Cannot find external module "missing" in package file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/␊ at throwAggregateError (file://.../ses/src/module-load.js:…)␊ at load (file://.../ses/src/module-load.js:…)␊ - at async digestLocation (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeAndHashArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async writeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async digestFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeAndHashArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async writeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ at async file://.../compartment-mapper/test/scaffold.js:…␊ at async file://.../compartment-mapper/test/scaffold.js:…` @@ -71,10 +71,10 @@ Generated by [AVA](https://avajs.dev). `TypeError: Failed to load module "./main.js" in package "file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/" (1 underlying failures: Cannot find external module "missing" in package file://.../compartment-mapper/test/fixtures-error-handling/node_modules/esm/␊ at throwAggregateError (file://.../ses/src/module-load.js:…)␊ at load (file://.../ses/src/module-load.js:…)␊ - at async digestLocation (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeAndHashArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async makeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ - at async writeArchive (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async digestFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeAndHashArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async makeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ + at async writeArchiveFromMap (file://.../compartment-mapper/src/archive-lite.js:…)␊ at async file://.../compartment-mapper/test/scaffold.js:…␊ at async file://.../compartment-mapper/test/scaffold.js:…` diff --git a/packages/compartment-mapper/test/snapshots/error-handling.test.js.snap b/packages/compartment-mapper/test/snapshots/error-handling.test.js.snap index e940823a3ff20cf37c9823764fcca09308949948..376992fd849cca90cf901c0843fdf788e7d8b19d 100644 GIT binary patch literal 787 zcmV+u1MK`kRzV5SFhROOz_Nq6ytm%tCrC4SnT{AX~ zTDbCB;U9|#00000000B+n9Xj}Koo`BMhJ-=utvIM)k?7~wo!#tRjrD|&!!tz=yrS^ zPcoh{Gvoa1V8M=;C<`8pCqcHGVz+7Rw517Xvapn7=FH5w=d+W09-RrrM&|nuvfK)q z_98yDnI_|r)=GOZ%204QfB?uO5P(n^zEun@SCSivsfm>}U(dr3Eq>hTcD5dG<*)5W zTTgeM@0`w3I?9#$aEx3~2v!vukf<;d1YJK!kV}7Py1*r*$VNCI=tf*nKL~u^512|) z)HWe$y#&*gbYRKY;D)URQib%Xls5sHBTFmmZM94)xu@8qRrLqul83Ii$ zX^G-;X9+ik%Ry~l_qnYn003yg##&7d1_Mn4w540HTUp4E35;ezIoHeG^M|JY>&wr* zxkTaUigVD+Bx`dZ!!U}Jm{yb`aQ`C5pDs5fZT-fd&wtiFC5**QiW-%WV1dyUO z^S9T7*Xh-Q_oCy1x8cDH`GAZ))+%|2X-#6m`Eo@pYwrneX|ZGx7#W_Ri7$e3|MGu9 zcYO$++#W%ga2o?cswv`A2c!ei0r>#W#EIs%LS$aeo1cl_Y6y-Uf)2rd1;J|0{}Zdwl)tID8a7k@pYSE-Boo;GUIj>uLz2x_3>GeuInylt~)Y&B8Kb#GTS)ZoFGD|CX zzwD;8NbQR2TpEj#U7K22^i8qQdo@|8QyF+wek5b85qB8UP&xd)uj>af5yvaozkw+IJ<_qlgs%o`0S1)sU zs8kmR+pq$+8r`DV)5LOPv&WI`$aZ9}i|ody^h#YL$FgJDvAiypmvo61vfR`qax^=d R9nB9-^KXZ0n6kws008I=e^meg literal 784 zcmV+r1MmDnRzVm10Re}f|9JG*}5j(1}&0%h}718Y(IW}cKcq$r&9Bg{r-cTaFQnb zv6#5RkPXNfZGse4B!x+x3k+J3b4 zZ0E(!$uy_8rP2W2p^y}T)0GBfIw~YVKV%sS6%K75gn}IT2or*SEF=vW3&W6co#kj; zM#=>l<~bSW$U1h*RGHEdeW~RwBb%{4?7oIVMP%f(TuY2XmK_Ihgi2`#u}~4v#F0@b zuV$7BYlTW0^Lof>Jplkf2QD>we3&GL5_Gj&usb)9CCjYgtnM3>?uA1;`1SSY-b|u$ zbj3bsr;2x3kmVT1TFwOS+kY0duq|pL%e8SnY(8xF58I$EY#EN|(C}286EMip*xB2g z!Rx(j1n+6j2XDiJ7m0-I)lt&WSg^oS66?(mq;RxYvr3GLj?t#G;5?k}Lkg~sy5qZ3 z2V>zwiz4 zWKXgud9z4fQe)#o+gfAWe$^oN`SvBXYa@gY?G+*QsdKFLsLL+Zt%FqS(c(?2o+k#g zTuY&-D>xlWOtsT(B_{86XRnw1&aAy&slrk;e2;sZgExl4T$g}KO_AIZ953K OrujE{0?P)2B>({5aD7Pt