@endo/compartment-mapper 1.2.1 → 1.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.
Files changed (67) hide show
  1. package/archive-lite.d.ts.map +1 -0
  2. package/archive-parsers.d.ts.map +1 -0
  3. package/archive.d.ts.map +1 -0
  4. package/bundle.d.ts.map +1 -0
  5. package/capture-lite.d.ts.map +1 -0
  6. package/import-archive-lite.d.ts.map +1 -0
  7. package/import-archive-parsers.d.ts.map +1 -0
  8. package/import-archive.d.ts.map +1 -0
  9. package/import-lite.d.ts.map +1 -0
  10. package/import-parsers.d.ts.map +1 -0
  11. package/import.d.ts.map +1 -0
  12. package/index.d.ts.map +1 -0
  13. package/node-modules.d.ts.map +1 -0
  14. package/node-powers.d.ts +1 -1
  15. package/node-powers.d.ts.map +1 -0
  16. package/node-powers.js +5 -1
  17. package/package.json +15 -11
  18. package/src/compartment-map.d.ts +1 -1
  19. package/src/compartment-map.d.ts.map +1 -1
  20. package/src/compartment-map.js +1 -1
  21. package/src/import-hook.d.ts +14 -1
  22. package/src/import-hook.d.ts.map +1 -1
  23. package/src/import-hook.js +493 -144
  24. package/src/import-lite.d.ts +20 -3
  25. package/src/import-lite.d.ts.map +1 -1
  26. package/src/import-lite.js +137 -15
  27. package/src/import.d.ts +45 -5
  28. package/src/import.d.ts.map +1 -1
  29. package/src/import.js +52 -6
  30. package/src/link.d.ts +2 -11
  31. package/src/link.d.ts.map +1 -1
  32. package/src/link.js +76 -154
  33. package/src/map-parser.d.ts +4 -0
  34. package/src/map-parser.d.ts.map +1 -0
  35. package/src/map-parser.js +339 -0
  36. package/src/node-modules.d.ts +2 -5
  37. package/src/node-modules.d.ts.map +1 -1
  38. package/src/node-modules.js +12 -5
  39. package/src/node-powers.d.ts +29 -23
  40. package/src/node-powers.d.ts.map +1 -1
  41. package/src/node-powers.js +102 -25
  42. package/src/parse-archive-cjs.js +2 -1
  43. package/src/parse-archive-mjs.js +2 -1
  44. package/src/parse-bytes.d.ts.map +1 -1
  45. package/src/parse-bytes.js +2 -6
  46. package/src/parse-cjs-shared-export-wrapper.d.ts.map +1 -1
  47. package/src/parse-cjs-shared-export-wrapper.js +23 -6
  48. package/src/parse-cjs.js +3 -2
  49. package/src/parse-json.d.ts +5 -3
  50. package/src/parse-json.d.ts.map +1 -1
  51. package/src/parse-json.js +9 -9
  52. package/src/parse-mjs.js +2 -1
  53. package/src/parse-pre-cjs.js +3 -2
  54. package/src/parse-pre-mjs.js +2 -1
  55. package/src/parse-text.d.ts.map +1 -1
  56. package/src/parse-text.js +2 -6
  57. package/src/policy.d.ts +21 -14
  58. package/src/policy.d.ts.map +1 -1
  59. package/src/policy.js +56 -37
  60. package/src/powers.d.ts +8 -1
  61. package/src/powers.d.ts.map +1 -1
  62. package/src/powers.js +60 -10
  63. package/src/search.d.ts.map +1 -1
  64. package/src/search.js +1 -2
  65. package/src/types.d.ts +343 -21
  66. package/src/types.d.ts.map +1 -1
  67. package/src/types.js +369 -22
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-lite.d.ts","sourceRoot":"","sources":["archive-lite.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-parsers.d.ts","sourceRoot":"","sources":["archive-parsers.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["archive.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["bundle.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-lite.d.ts","sourceRoot":"","sources":["capture-lite.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-archive-lite.d.ts","sourceRoot":"","sources":["import-archive-lite.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-archive-parsers.d.ts","sourceRoot":"","sources":["import-archive-parsers.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-archive.d.ts","sourceRoot":"","sources":["import-archive.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-lite.d.ts","sourceRoot":"","sources":["import-lite.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-parsers.d.ts","sourceRoot":"","sources":["import-parsers.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["import.js"],"names":[],"mappings":""}
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-modules.d.ts","sourceRoot":"","sources":["node-modules.js"],"names":[],"mappings":""}
package/node-powers.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { makeReadPowers, makeWritePowers, makeNodeReadPowers, makeNodeWritePowers } from "./src/node-powers.js";
1
+ export { makeReadPowers, makeWritePowers, makeReadNowPowers, makeNodeReadPowers, makeNodeWritePowers } from "./src/node-powers.js";
2
2
  //# sourceMappingURL=node-powers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-powers.d.ts","sourceRoot":"","sources":["node-powers.js"],"names":[],"mappings":""}
package/node-powers.js CHANGED
@@ -1,3 +1,7 @@
1
- export { makeReadPowers, makeWritePowers } from './src/node-powers.js';
1
+ export {
2
+ makeReadPowers,
3
+ makeWritePowers,
4
+ makeReadNowPowers,
5
+ } from './src/node-powers.js';
2
6
  // Deprecated:
3
7
  export { makeNodeReadPowers, makeNodeWritePowers } from './src/node-powers.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@endo/compartment-mapper",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "The compartment mapper assembles Node applications in a sandbox",
5
5
  "keywords": [
6
6
  "node",
@@ -45,7 +45,7 @@
45
45
  "scripts": {
46
46
  "build": "exit 0",
47
47
  "prepack": "tsc --build tsconfig.build.json",
48
- "postpack": "git clean -f '*.d.ts*'",
48
+ "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'",
49
49
  "cover": "c8 ava",
50
50
  "lint": "yarn lint:types && yarn lint:eslint",
51
51
  "lint-fix": "eslint --fix .",
@@ -55,10 +55,11 @@
55
55
  "test": "ava"
56
56
  },
57
57
  "dependencies": {
58
- "@endo/cjs-module-analyzer": "^1.0.6",
59
- "@endo/module-source": "^1.0.1",
60
- "@endo/zip": "^1.0.6",
61
- "ses": "^1.7.0"
58
+ "@endo/cjs-module-analyzer": "^1.0.8",
59
+ "@endo/module-source": "^1.1.0",
60
+ "@endo/trampoline": "^1.0.2",
61
+ "@endo/zip": "^1.0.8",
62
+ "ses": "^1.9.0"
62
63
  },
63
64
  "devDependencies": {
64
65
  "ava": "^6.1.3",
@@ -70,14 +71,18 @@
70
71
  "eslint-plugin-eslint-comments": "^3.2.0",
71
72
  "eslint-plugin-import": "^2.29.1",
72
73
  "prettier": "^3.2.5",
73
- "typescript": "5.5.2"
74
+ "typescript": "~5.6.2"
74
75
  },
75
76
  "files": [
77
+ "./*.d.ts",
78
+ "./*.js",
79
+ "./*.map",
76
80
  "LICENSE*",
77
81
  "SECURITY*",
82
+ "dist",
83
+ "lib",
78
84
  "src",
79
- "*.js",
80
- "*.ts"
85
+ "tools"
81
86
  ],
82
87
  "publishConfig": {
83
88
  "access": "public"
@@ -101,7 +106,6 @@
101
106
  },
102
107
  "ava": {
103
108
  "files": [
104
- "test/**/test-*.*",
105
109
  "test/**/*.test.*"
106
110
  ],
107
111
  "timeout": "2m"
@@ -109,5 +113,5 @@
109
113
  "typeCoverage": {
110
114
  "atLeast": 86.14
111
115
  },
112
- "gitHead": "444c81ad3ecc1b0a449023a9c65e9be2fa17db21"
116
+ "gitHead": "bbf20fae6726f7d26456714b8852572787d34e05"
113
117
  }
@@ -1,5 +1,5 @@
1
1
  /** @type {(a: string, b: string) => number} */
2
2
  export const stringCompare: (a: string, b: string) => number;
3
3
  export function pathCompare(a: Array<string> | undefined, b: Array<string> | undefined): number;
4
- export function assertCompartmentMap(allegedCompartmentMap: unknown, url?: string | undefined): asserts compartmentMap is import("./types.js").CompartmentMapDescriptor;
4
+ export function assertCompartmentMap(allegedCompartmentMap: unknown, url?: string | undefined): asserts allegedCompartmentMap is import("./types.js").CompartmentMapDescriptor;
5
5
  //# sourceMappingURL=compartment-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compartment-map.d.ts","sourceRoot":"","sources":["compartment-map.js"],"names":[],"mappings":"AAaA,+CAA+C;AAE/C,4BAFW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAE2B;AAc/D,+BAHI,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,KACzB,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,UAqCnC;AAuZM,4DALI,OAAO,qGAiCjB"}
1
+ {"version":3,"file":"compartment-map.d.ts","sourceRoot":"","sources":["compartment-map.js"],"names":[],"mappings":"AAaA,+CAA+C;AAE/C,4BAFW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAE2B;AAc/D,+BAHI,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,KACzB,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,UAqCnC;AAuZM,4DALI,OAAO,6BAEL,QAAQ,qBAAqB,IAAI,OAAO,YAAY,EAAE,wBAAwB,CA+B1F"}
@@ -466,7 +466,7 @@ const assertEntry = (allegedEntry, url) => {
466
466
  /**
467
467
  * @param {unknown} allegedCompartmentMap
468
468
  * @param {string} [url]
469
- * @returns {asserts compartmentMap is import('./types.js').CompartmentMapDescriptor}
469
+ * @returns {asserts allegedCompartmentMap is import('./types.js').CompartmentMapDescriptor}
470
470
  */
471
471
 
472
472
  export const assertCompartmentMap = (
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Synchronous import for dynamic requires.
3
+ *
4
+ * @param {ReadNowPowers} readPowers
5
+ * @param {string} baseLocation
6
+ * @param {MakeImportNowHookMakerOptions} options
7
+ * @returns {ImportNowHookMaker}
8
+ */
9
+ export function makeImportNowHookMaker(readPowers: ReadNowPowers, baseLocation: string, { sources, compartmentDescriptors, computeSha512, searchSuffixes, sourceMapHook, exitModuleImportNowHook, }: MakeImportNowHookMakerOptions): ImportNowHookMaker;
1
10
  export function exitModuleImportHookMaker({ modules, exitModuleImportHook, }: {
2
11
  modules?: Record<string, any> | undefined;
3
12
  exitModuleImportHook?: ExitModuleImportHook | undefined;
@@ -11,13 +20,17 @@ export function makeImportHookMaker(readPowers: ReadFn | ReadPowers, baseLocatio
11
20
  entryCompartmentName: string;
12
21
  entryModuleSpecifier: string;
13
22
  exitModuleImportHook?: ExitModuleImportHook | undefined;
14
- sourceMapHook?: import("./types.js").SourceMapHook | undefined;
23
+ sourceMapHook?: SourceMapHook | undefined;
15
24
  }): ImportHookMaker;
25
+ import type { ReadNowPowers } from './types.js';
26
+ import type { MakeImportNowHookMakerOptions } from './types.js';
27
+ import type { ImportNowHookMaker } from './types.js';
16
28
  import type { ExitModuleImportHook } from './types.js';
17
29
  import type { ReadFn } from './types.js';
18
30
  import type { ReadPowers } from './types.js';
19
31
  import type { Sources } from './types.js';
20
32
  import type { CompartmentDescriptor } from './types.js';
21
33
  import type { HashFn } from './types.js';
34
+ import type { SourceMapHook } from './types.js';
22
35
  import type { ImportHookMaker } from './types.js';
23
36
  //# sourceMappingURL=import-hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-hook.d.ts","sourceRoot":"","sources":["import-hook.js"],"names":[],"mappings":"AA4EO,8EAJJ;IAAqC,OAAO,GAApC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAC;IACU,oBAAoB,GAAlD,oBAAoB,YAAC;CAC7B,GAAU,oBAAoB,GAAC,SAAS,CA0B1C;AAuBM,gDApBI,MAAM,GAAC,UAAU,gBACjB,MAAM,qKAEd;IAA0B,OAAO;IACuB,sBAAsB;IACpD,WAAW;IACZ,aAAa;IACN,cAAc;IAOtB,oBAAoB,EAApC,MAAM;IACU,oBAAoB,EAApC,MAAM;IACyB,oBAAoB;IACN,aAAa;CAClE,GAAU,eAAe,CAuR3B;0CA7XuC,YAAY;4BAN1B,YAAY;gCACR,YAAY;6BAEf,YAAY;2CACE,YAAY;4BAF3B,YAAY;qCAGH,YAAY"}
1
+ {"version":3,"file":"import-hook.d.ts","sourceRoot":"","sources":["import-hook.js"],"names":[],"mappings":"AAilBA;;;;;;;GAOG;AACH,mDALW,aAAa,gBACb,MAAM,+GACN,6BAA6B,GAC3B,kBAAkB,CAsJ9B;AAnjBM,8EAJJ;IAAqC,OAAO,GAApC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAC;IACU,oBAAoB;CAC1D,GAAU,oBAAoB,GAAC,SAAS,CA0B1C;AA0MM,gDApBI,MAAM,GAAC,UAAU,gBACjB,MAAM,qKAEd;IAA0B,OAAO;IACuB,sBAAsB;IACpD,WAAW;IACZ,aAAa;IACN,cAAc;IAOtB,oBAAoB,EAApC,MAAM;IACU,oBAAoB,EAApC,MAAM;IACyB,oBAAoB;IAC3B,aAAa;CAC7C,GAAU,eAAe,CAqL3B;mCA7iBS,YAAY;mDAAZ,YAAY;wCAAZ,YAAY;0CAAZ,YAAY;4BAAZ,YAAY;gCAAZ,YAAY;6BAAZ,YAAY;2CAAZ,YAAY;4BAAZ,YAAY;mCAAZ,YAAY;qCAAZ,YAAY"}