@endo/compartment-mapper 1.1.0 → 1.1.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endo/compartment-mapper",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "The compartment mapper assembles Node applications in a sandbox",
5
5
  "keywords": [
6
6
  "node",
@@ -13,7 +13,8 @@
13
13
  "homepage": "https://github.com/endojs/endo/tree/master/packages/compartment-mapper#readme",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/endojs/endo.git"
16
+ "url": "git+https://github.com/endojs/endo.git",
17
+ "directory": "packages/compartment-mapper"
17
18
  },
18
19
  "bugs": {
19
20
  "url": "https://github.com/endojs/endo/issues"
@@ -46,10 +47,10 @@
46
47
  "test": "ava"
47
48
  },
48
49
  "dependencies": {
49
- "@endo/cjs-module-analyzer": "^1.0.1",
50
- "@endo/static-module-record": "^1.0.2",
51
- "@endo/zip": "^1.0.1",
52
- "ses": "^1.1.0"
50
+ "@endo/cjs-module-analyzer": "^1.0.2",
51
+ "@endo/static-module-record": "^1.0.4",
52
+ "@endo/zip": "^1.0.2",
53
+ "ses": "^1.3.0"
53
54
  },
54
55
  "devDependencies": {
55
56
  "ava": "^5.3.0",
@@ -99,5 +100,5 @@
99
100
  "typeCoverage": {
100
101
  "atLeast": 86.14
101
102
  },
102
- "gitHead": "373f9eebab66c94ed42350473c90fb25e6054f0a"
103
+ "gitHead": "297fed572fedec0e1ae3ce34cf409f9d45233d43"
103
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"import-archive.d.ts","sourceRoot":"","sources":["import-archive.js"],"names":[],"mappings":"AAyPO,2CAZI,UAAU;;;;;;;;gBAUR,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAmJrD;AAQM,wCALI,OAAO,YAAY,EAAE,MAAM,GAAG,OAAO,YAAY,EAAE,UAAU,mBAC7D,MAAM,kEAEJ,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAsBrD;AAQM,0CALI,OAAO,YAAY,EAAE,MAAM,GAAG,OAAO,YAAY,EAAE,UAAU,mBAC7D,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,GAAG,OAAO,YAAY,EAAE,kBAAkB,GAC3E,QAAQ,MAAM,CAAC,CAK3B;qCAvMa,kBAAkB"}
1
+ {"version":3,"file":"import-archive.d.ts","sourceRoot":"","sources":["import-archive.js"],"names":[],"mappings":"AA8PO,2CAZI,UAAU;;;;;;;;gBAUR,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAmJrD;AAQM,wCALI,OAAO,YAAY,EAAE,MAAM,GAAG,OAAO,YAAY,EAAE,UAAU,mBAC7D,MAAM,kEAEJ,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,CAsBrD;AAQM,0CALI,OAAO,YAAY,EAAE,MAAM,GAAG,OAAO,YAAY,EAAE,UAAU,mBAC7D,MAAM,WACN,OAAO,YAAY,EAAE,cAAc,GAAG,OAAO,YAAY,EAAE,kBAAkB,GAC3E,QAAQ,MAAM,CAAC,CAK3B;qCAvMa,kBAAkB"}
@@ -208,9 +208,13 @@ const makeArchiveImportHookMaker = (
208
208
  return makeImportHook;
209
209
  };
210
210
 
211
- const makeFeauxModuleExportsNamespace = Compartment => {
212
- // @ts-ignore Unclear at time of writing why Compartment type is not
213
- // constructible.
211
+ /**
212
+ * Creates a fake module namespace object that passes a brand check.
213
+ *
214
+ * @param {typeof Compartment} Compartment
215
+ * @returns {import('ses').ModuleExportsNamespace}
216
+ */
217
+ const makeFauxModuleExportsNamespace = Compartment => {
214
218
  const compartment = new Compartment(
215
219
  {},
216
220
  {},
@@ -218,10 +222,11 @@ const makeFeauxModuleExportsNamespace = Compartment => {
218
222
  resolveHook() {
219
223
  return '.';
220
224
  },
221
- importHook() {
225
+ async importHook() {
222
226
  return {
223
227
  imports: [],
224
228
  execute() {},
229
+ exports: [],
225
230
  };
226
231
  },
227
232
  },
@@ -336,7 +341,7 @@ export const parseArchive = async (
336
341
  parserForLanguage,
337
342
  modules: Object.fromEntries(
338
343
  Object.keys(modules || {}).map(specifier => {
339
- return [specifier, makeFeauxModuleExportsNamespace(Compartment)];
344
+ return [specifier, makeFauxModuleExportsNamespace(Compartment)];
340
345
  }),
341
346
  ),
342
347
  Compartment,