@endo/compartment-mapper 1.6.0 → 1.6.1
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/LICENSE +1 -1
- package/SECURITY.md +2 -2
- package/package.json +11 -11
- package/src/archive-lite.d.ts +5 -5
- package/src/archive-lite.d.ts.map +1 -1
- package/src/archive.d.ts +5 -5
- package/src/archive.d.ts.map +1 -1
- package/src/archive.js +3 -1
- package/src/bundle-cjs.d.ts +12 -2
- package/src/bundle-cjs.d.ts.map +1 -1
- package/src/bundle-lite.d.ts +2 -2
- package/src/bundle-lite.d.ts.map +1 -1
- package/src/bundle-lite.js +0 -1
- package/src/bundle-mjs.d.ts +12 -2
- package/src/bundle-mjs.d.ts.map +1 -1
- package/src/bundle.d.ts +5 -5
- package/src/bundle.d.ts.map +1 -1
- package/src/bundle.js +1 -1
- package/src/capture-lite.d.ts +1 -1
- package/src/capture-lite.d.ts.map +1 -1
- package/src/capture-lite.js +3 -1
- package/src/compartment-map.d.ts +1 -1
- package/src/compartment-map.d.ts.map +1 -1
- package/src/import-archive-lite.d.ts +2 -2
- package/src/import-archive-lite.d.ts.map +1 -1
- package/src/import-archive-lite.js +3 -1
- package/src/import-archive.d.ts +3 -3
- package/src/import-archive.d.ts.map +1 -1
- package/src/import-archive.js +3 -1
- package/src/import-hook.d.ts.map +1 -1
- package/src/import-hook.js +204 -99
- package/src/import-lite.d.ts +1 -1
- package/src/import-lite.d.ts.map +1 -1
- package/src/import-lite.js +3 -1
- package/src/import.d.ts.map +1 -1
- package/src/import.js +3 -1
- package/src/infer-exports.d.ts +5 -7
- package/src/infer-exports.d.ts.map +1 -1
- package/src/infer-exports.js +23 -8
- package/src/link.d.ts.map +1 -1
- package/src/link.js +4 -1
- package/src/map-parser.d.ts.map +1 -1
- package/src/map-parser.js +51 -5
- package/src/node-module-specifier.d.ts.map +1 -1
- package/src/node-module-specifier.js +3 -1
- package/src/node-modules.d.ts +2 -2
- package/src/node-modules.d.ts.map +1 -1
- package/src/node-modules.js +150 -31
- package/src/node-powers.d.ts +1 -1
- package/src/node-powers.d.ts.map +1 -1
- package/src/node-powers.js +3 -1
- package/src/parse-archive-cjs.d.ts +5 -1
- package/src/parse-archive-cjs.d.ts.map +1 -1
- package/src/parse-archive-cjs.js +3 -1
- package/src/parse-archive-mjs.d.ts +5 -1
- package/src/parse-archive-mjs.d.ts.map +1 -1
- package/src/parse-archive-mjs.js +3 -1
- package/src/parse-bytes.d.ts +5 -1
- package/src/parse-bytes.d.ts.map +1 -1
- package/src/parse-bytes.js +3 -1
- package/src/parse-cjs-shared-export-wrapper.d.ts.map +1 -1
- package/src/parse-cjs-shared-export-wrapper.js +3 -1
- package/src/parse-cjs.d.ts +5 -1
- package/src/parse-cjs.d.ts.map +1 -1
- package/src/parse-cjs.js +3 -1
- package/src/parse-json.d.ts +5 -2
- package/src/parse-json.d.ts.map +1 -1
- package/src/parse-mjs.d.ts +5 -1
- package/src/parse-mjs.d.ts.map +1 -1
- package/src/parse-pre-cjs.d.ts +5 -1
- package/src/parse-pre-cjs.d.ts.map +1 -1
- package/src/parse-pre-cjs.js +3 -1
- package/src/parse-pre-mjs.d.ts +5 -1
- package/src/parse-pre-mjs.d.ts.map +1 -1
- package/src/parse-pre-mjs.js +3 -1
- package/src/parse-text.d.ts +5 -1
- package/src/parse-text.d.ts.map +1 -1
- package/src/parse-text.js +3 -1
- package/src/policy-format.d.ts +2 -1
- package/src/policy-format.d.ts.map +1 -1
- package/src/policy-format.js +5 -2
- package/src/policy.d.ts +2 -2
- package/src/policy.d.ts.map +1 -1
- package/src/policy.js +10 -8
- package/src/powers.d.ts +1 -1
- package/src/powers.d.ts.map +1 -1
- package/src/powers.js +3 -1
- package/src/search.d.ts +2 -1
- package/src/search.d.ts.map +1 -1
- package/src/search.js +3 -1
- package/src/types/compartment-map-schema.d.ts +3 -1
- package/src/types/compartment-map-schema.d.ts.map +1 -1
- package/src/types/compartment-map-schema.ts +3 -1
- package/src/types/external.d.ts +15 -9
- package/src/types/external.d.ts.map +1 -1
- package/src/types/external.ts +15 -9
- package/src/types/internal.d.ts +33 -18
- package/src/types/internal.d.ts.map +1 -1
- package/src/types/internal.ts +40 -20
- package/src/types/node-powers.d.ts +3 -1
- package/src/types/node-powers.d.ts.map +1 -1
- package/src/types/node-powers.ts +3 -1
- package/src/types/policy-schema.d.ts +3 -1
- package/src/types/policy-schema.d.ts.map +1 -1
- package/src/types/policy-schema.ts +3 -1
- package/src/types/policy.d.ts +3 -1
- package/src/types/policy.d.ts.map +1 -1
- package/src/types/policy.ts +3 -1
- package/src/types/powers.d.ts +3 -1
- package/src/types/powers.d.ts.map +1 -1
- package/src/types/powers.ts +3 -1
- package/src/types/typescript.d.ts +3 -1
- package/src/types/typescript.d.ts.map +1 -1
- package/src/types/typescript.ts +3 -1
- package/src/url.d.ts.map +1 -1
- package/src/url.js +3 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides functions for interacting with Node.js module specifiers in
|
|
3
3
|
* their canonical form.
|
|
4
4
|
* This is a kind of path math that is platform-agnostic.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
// q, as in quote, for error messages.
|
package/src/node-modules.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function basename(location: string): string;
|
|
2
|
-
export function compartmentMapForNodeModules(readPowers: ReadFn | ReadPowers | MaybeReadPowers, packageLocation: string, conditionsOption: Set<string>, packageDescriptor: PackageDescriptor, moduleSpecifier: string, options?: CompartmentMapForNodeModulesOptions
|
|
3
|
-
export function mapNodeModules(readPowers: ReadFn | ReadPowers | MaybeReadPowers, moduleLocation: string, { tags, conditions, log, ...otherOptions }?: MapNodeModulesOptions
|
|
2
|
+
export function compartmentMapForNodeModules(readPowers: ReadFn | ReadPowers | MaybeReadPowers, packageLocation: string, conditionsOption: Set<string>, packageDescriptor: PackageDescriptor, moduleSpecifier: string, options?: CompartmentMapForNodeModulesOptions): Promise<CompartmentMapDescriptor>;
|
|
3
|
+
export function mapNodeModules(readPowers: ReadFn | ReadPowers | MaybeReadPowers, moduleLocation: string, { tags, conditions, log, ...otherOptions }?: MapNodeModulesOptions): Promise<CompartmentMapDescriptor>;
|
|
4
4
|
import type { ReadFn } from './types.js';
|
|
5
5
|
import type { ReadPowers } from './types.js';
|
|
6
6
|
import type { MaybeReadPowers } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-modules.d.ts","sourceRoot":"","sources":["node-modules.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-modules.d.ts","sourceRoot":"","sources":["node-modules.js"],"names":[],"mappings":"AAmFO,mCAHI,MAAM,GACJ,MAAM,CAYlB;AA43BM,yDATI,MAAM,GAAG,UAAU,GAAG,eAAe,mBACrC,MAAM,oBACN,GAAG,CAAC,MAAM,CAAC,qBACX,iBAAiB,mBACjB,MAAM,YACN,mCAAmC,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAkE7C;AAaM,2CALI,MAAM,GAAG,UAAU,GAAG,eAAe,kBACrC,MAAM,+CACN,qBAAqB,GACnB,OAAO,CAAC,wBAAwB,CAAC,CA0B7C;4BA9hCS,YAAY;gCAAZ,YAAY;qCAAZ,YAAY;uCAAZ,YAAY;yDAAZ,YAAY;8CAAZ,YAAY;2CAAZ,YAAY"}
|
package/src/node-modules.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides functions for constructing a compartment map that has a
|
|
3
3
|
* compartment descriptor corresponding to every reachable package from an
|
|
4
4
|
* entry module and how to create links between them.
|
|
5
5
|
* The resulting compartment map does not describe individual modules but does
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* wildcard expansion.
|
|
8
8
|
* See {@link link} to expand a compartment map to capture module descriptors
|
|
9
9
|
* for transitive dependencies.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
/* eslint no-shadow: 0 */
|
|
@@ -53,7 +55,7 @@ import {
|
|
|
53
55
|
import { unpackReadPowers } from './powers.js';
|
|
54
56
|
import { search, searchDescriptor } from './search.js';
|
|
55
57
|
|
|
56
|
-
const { assign, create, keys, values } = Object;
|
|
58
|
+
const { assign, create, keys, values, entries } = Object;
|
|
57
59
|
|
|
58
60
|
const decoder = new TextDecoder();
|
|
59
61
|
|
|
@@ -123,6 +125,90 @@ const readDescriptorWithMemo = async (memo, maybeRead, packageLocation) => {
|
|
|
123
125
|
return promise;
|
|
124
126
|
};
|
|
125
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Compares `logicalPath` to the current best logical path in `preferredPackageLogicalPathMap` for `packageLocation`.
|
|
130
|
+
*
|
|
131
|
+
* If no current best path exists, it returns `logicalPath`.
|
|
132
|
+
*
|
|
133
|
+
* @template {string[]} T
|
|
134
|
+
* @template {string[]} U
|
|
135
|
+
* @param {T} logicalPath
|
|
136
|
+
* @param {string} packageLocation
|
|
137
|
+
* @param {Map<string, U>} preferredPackageLogicalPathMap
|
|
138
|
+
* @returns {T|U}
|
|
139
|
+
*/
|
|
140
|
+
const currentBestLogicalPath = (
|
|
141
|
+
logicalPath,
|
|
142
|
+
packageLocation,
|
|
143
|
+
preferredPackageLogicalPathMap,
|
|
144
|
+
) => {
|
|
145
|
+
const theCurrentBest = preferredPackageLogicalPathMap.get(packageLocation);
|
|
146
|
+
if (theCurrentBest === undefined) {
|
|
147
|
+
return logicalPath;
|
|
148
|
+
}
|
|
149
|
+
return pathCompare(logicalPath, theCurrentBest) < 0
|
|
150
|
+
? logicalPath
|
|
151
|
+
: theCurrentBest;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Updates the shortest paths in a subgraph of `graph` starting with `packageLocation`.
|
|
156
|
+
*
|
|
157
|
+
* This should be called upon the second (and each subsequent) visit to a graph node.
|
|
158
|
+
*
|
|
159
|
+
* @param {Graph} graph Graph
|
|
160
|
+
* @param {string} packageLocation Location of the package to start with
|
|
161
|
+
* @param {string[]} logicalPath Current path parts of the same package
|
|
162
|
+
* @param {Map<string, string[]>} [preferredPackageLogicalPathMap] Mapping of shortest known paths for each package location
|
|
163
|
+
* @returns {void}
|
|
164
|
+
*/
|
|
165
|
+
const updateShortestPaths = (
|
|
166
|
+
graph,
|
|
167
|
+
packageLocation,
|
|
168
|
+
logicalPath,
|
|
169
|
+
preferredPackageLogicalPathMap = new Map(),
|
|
170
|
+
) => {
|
|
171
|
+
const node = graph[packageLocation];
|
|
172
|
+
if (!node) {
|
|
173
|
+
throw new ReferenceError(
|
|
174
|
+
`Cannot find package at ${packageLocation} in graph`,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const bestLogicalPath = currentBestLogicalPath(
|
|
179
|
+
logicalPath,
|
|
180
|
+
packageLocation,
|
|
181
|
+
preferredPackageLogicalPathMap,
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
if (bestLogicalPath === logicalPath) {
|
|
185
|
+
preferredPackageLogicalPathMap.set(packageLocation, bestLogicalPath);
|
|
186
|
+
|
|
187
|
+
for (const name of keys(node.dependencyLocations).sort()) {
|
|
188
|
+
const packageLocation = node.dependencyLocations[name];
|
|
189
|
+
if (!packageLocation) {
|
|
190
|
+
// "should never happen"
|
|
191
|
+
throw new ReferenceError(
|
|
192
|
+
`Expected graph node ${q(node.name)} to contain a dependency location for ${q(name)}`,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
updateShortestPaths(
|
|
196
|
+
graph,
|
|
197
|
+
packageLocation,
|
|
198
|
+
[...logicalPath, name],
|
|
199
|
+
preferredPackageLogicalPathMap,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// a path length of 0 means the node represents the eventual entry compartment.
|
|
205
|
+
// we do not want to mess with that path.
|
|
206
|
+
if (node.path.length && node.path !== bestLogicalPath) {
|
|
207
|
+
node.path = bestLogicalPath;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return undefined;
|
|
211
|
+
};
|
|
126
212
|
/**
|
|
127
213
|
* `findPackage` behaves as Node.js to find third-party modules by searching
|
|
128
214
|
* parent to ancestor directories for a `node_modules` directory that contains
|
|
@@ -291,6 +377,13 @@ const graphPackage = async (
|
|
|
291
377
|
} = {},
|
|
292
378
|
) => {
|
|
293
379
|
if (graph[packageLocation] !== undefined) {
|
|
380
|
+
updateShortestPaths(
|
|
381
|
+
graph,
|
|
382
|
+
packageLocation,
|
|
383
|
+
logicalPath,
|
|
384
|
+
preferredPackageLogicalPathMap,
|
|
385
|
+
);
|
|
386
|
+
|
|
294
387
|
// Returning the promise here would create a causal cycle and stall recursion.
|
|
295
388
|
return undefined;
|
|
296
389
|
}
|
|
@@ -310,7 +403,20 @@ const graphPackage = async (
|
|
|
310
403
|
const dependencyLocations = {};
|
|
311
404
|
/** @type {ReturnType<typeof gatherDependency>[]} */
|
|
312
405
|
const children = [];
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* A set containing dependency names which are considered "optional"
|
|
409
|
+
*/
|
|
313
410
|
const optionals = new Set();
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Contains the names of _all_ dependencies
|
|
414
|
+
*
|
|
415
|
+
* @type {Set<string>}
|
|
416
|
+
*/
|
|
417
|
+
const allDependencies = new Set();
|
|
418
|
+
|
|
419
|
+
// these are fields from package.json containing dependencies
|
|
314
420
|
const {
|
|
315
421
|
dependencies = {},
|
|
316
422
|
peerDependencies = {},
|
|
@@ -319,32 +425,40 @@ const graphPackage = async (
|
|
|
319
425
|
optionalDependencies = {},
|
|
320
426
|
devDependencies = {},
|
|
321
427
|
} = packageDescriptor;
|
|
322
|
-
|
|
323
|
-
for (const [name, descriptor] of
|
|
324
|
-
commonDependencyDescriptors,
|
|
325
|
-
)) {
|
|
428
|
+
|
|
429
|
+
for (const [name, descriptor] of entries(commonDependencyDescriptors)) {
|
|
326
430
|
if (Object(descriptor) === descriptor) {
|
|
327
|
-
|
|
328
|
-
allDependencies[name] = spec;
|
|
431
|
+
allDependencies.add(name);
|
|
329
432
|
}
|
|
330
433
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
for (const
|
|
434
|
+
|
|
435
|
+
// only consider devDependencies if dev flag is true
|
|
436
|
+
for (const name of keys({
|
|
437
|
+
...dependencies,
|
|
438
|
+
...peerDependencies,
|
|
439
|
+
...bundleDependencies,
|
|
440
|
+
...optionalDependencies,
|
|
441
|
+
...(dev ? devDependencies : {}),
|
|
442
|
+
})) {
|
|
443
|
+
allDependencies.add(name);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// for historical reasons, some packages omit peerDependencies and only
|
|
447
|
+
// use the peerDependenciesMeta field (because there was no way to define
|
|
448
|
+
// an "optional" peerDependency prior to npm v7). this is plainly wrong,
|
|
449
|
+
// but not exactly rare, either
|
|
450
|
+
for (const [name, meta] of entries(peerDependenciesMeta)) {
|
|
334
451
|
if (Object(meta) === meta && meta.optional) {
|
|
335
452
|
optionals.add(name);
|
|
453
|
+
allDependencies.add(name);
|
|
336
454
|
}
|
|
337
455
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
for (const name of Object.keys(optionalDependencies)) {
|
|
456
|
+
|
|
457
|
+
for (const name of keys(optionalDependencies)) {
|
|
341
458
|
optionals.add(name);
|
|
342
459
|
}
|
|
343
|
-
if (dev) {
|
|
344
|
-
assign(allDependencies, devDependencies);
|
|
345
|
-
}
|
|
346
460
|
|
|
347
|
-
for (const name of
|
|
461
|
+
for (const name of [...allDependencies].sort()) {
|
|
348
462
|
const optional = optionals.has(name);
|
|
349
463
|
const childLogicalPath = [...logicalPath, name];
|
|
350
464
|
children.push(
|
|
@@ -407,7 +521,7 @@ const graphPackage = async (
|
|
|
407
521
|
|
|
408
522
|
const sourceDirname = basename(packageLocation);
|
|
409
523
|
|
|
410
|
-
|
|
524
|
+
assign(result, {
|
|
411
525
|
name,
|
|
412
526
|
path: logicalPath,
|
|
413
527
|
label: `${name}${version ? `-v${version}` : ''}`,
|
|
@@ -432,7 +546,7 @@ const graphPackage = async (
|
|
|
432
546
|
await Promise.all(children);
|
|
433
547
|
|
|
434
548
|
// handle commonDependencyDescriptors package aliases
|
|
435
|
-
for (const [name, { alias }] of
|
|
549
|
+
for (const [name, { alias }] of entries(commonDependencyDescriptors)) {
|
|
436
550
|
// update the dependencyLocations to point to the common dependency
|
|
437
551
|
const targetLocation = dependencyLocations[name];
|
|
438
552
|
if (targetLocation === undefined) {
|
|
@@ -510,15 +624,20 @@ const gatherDependency = async (
|
|
|
510
624
|
throw Error(`Cannot find dependency ${name} for ${packageLocation}`);
|
|
511
625
|
}
|
|
512
626
|
dependencyLocations[name] = dependency.packageLocation;
|
|
513
|
-
|
|
627
|
+
|
|
628
|
+
const bestLogicalPath = currentBestLogicalPath(
|
|
629
|
+
childLogicalPath,
|
|
514
630
|
dependency.packageLocation,
|
|
631
|
+
preferredPackageLogicalPathMap,
|
|
515
632
|
);
|
|
516
|
-
|
|
633
|
+
|
|
634
|
+
if (bestLogicalPath === childLogicalPath) {
|
|
517
635
|
preferredPackageLogicalPathMap.set(
|
|
518
636
|
dependency.packageLocation,
|
|
519
|
-
|
|
637
|
+
bestLogicalPath,
|
|
520
638
|
);
|
|
521
639
|
}
|
|
640
|
+
|
|
522
641
|
await graphPackage(
|
|
523
642
|
name,
|
|
524
643
|
readDescriptor,
|
|
@@ -598,7 +717,7 @@ const graphPackages = async (
|
|
|
598
717
|
/** @type {CommonDependencyDescriptors} */
|
|
599
718
|
const commonDependencyDescriptors = {};
|
|
600
719
|
const packageDescriptorDependencies = packageDescriptor.dependencies || {};
|
|
601
|
-
for (const [alias, dependencyName] of
|
|
720
|
+
for (const [alias, dependencyName] of entries(commonDependencies)) {
|
|
602
721
|
const spec = packageDescriptorDependencies[dependencyName];
|
|
603
722
|
if (spec === undefined) {
|
|
604
723
|
throw Error(
|
|
@@ -653,7 +772,7 @@ const translateGraph = (
|
|
|
653
772
|
policy,
|
|
654
773
|
) => {
|
|
655
774
|
/** @type {CompartmentMapDescriptor['compartments']} */
|
|
656
|
-
const compartments =
|
|
775
|
+
const compartments = create(null);
|
|
657
776
|
|
|
658
777
|
// For each package, build a map of all the external modules the package can
|
|
659
778
|
// import from other packages.
|
|
@@ -676,9 +795,9 @@ const translateGraph = (
|
|
|
676
795
|
types,
|
|
677
796
|
} = graph[dependeeLocation];
|
|
678
797
|
/** @type {CompartmentDescriptor['modules']} */
|
|
679
|
-
const moduleDescriptors =
|
|
798
|
+
const moduleDescriptors = create(null);
|
|
680
799
|
/** @type {CompartmentDescriptor['scopes']} */
|
|
681
|
-
const scopes =
|
|
800
|
+
const scopes = create(null);
|
|
682
801
|
|
|
683
802
|
/**
|
|
684
803
|
* List of all the compartments (by name) that this compartment can import from.
|
|
@@ -838,10 +957,10 @@ const makeLanguageOptions = ({
|
|
|
838
957
|
};
|
|
839
958
|
|
|
840
959
|
const languages = new Set([
|
|
841
|
-
...
|
|
842
|
-
...
|
|
843
|
-
...
|
|
844
|
-
...
|
|
960
|
+
...values(moduleLanguageForExtension),
|
|
961
|
+
...values(commonjsLanguageForExtension),
|
|
962
|
+
...values(workspaceModuleLanguageForExtension),
|
|
963
|
+
...values(workspaceCommonjsLanguageForExtension),
|
|
845
964
|
...additionalLanguages,
|
|
846
965
|
]);
|
|
847
966
|
|
package/src/node-powers.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export function makeWritePowers({ fs, url }: {
|
|
|
37
37
|
}): {
|
|
38
38
|
write: (location: string, data: Uint8Array) => Promise<void>;
|
|
39
39
|
};
|
|
40
|
-
export function makeNodeReadPowers(fs: FsInterface, crypto?: CryptoInterface
|
|
40
|
+
export function makeNodeReadPowers(fs: FsInterface, crypto?: CryptoInterface): ReadPowers;
|
|
41
41
|
export function makeNodeWritePowers(fs: FsInterface): WritePowers;
|
|
42
42
|
import type { FsInterface } from './types/node-powers.js';
|
|
43
43
|
import type { UrlInterface } from './types/node-powers.js';
|
package/src/node-powers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-powers.d.ts","sourceRoot":"","sources":["node-powers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-powers.d.ts","sourceRoot":"","sources":["node-powers.js"],"names":[],"mappings":"AA4LO,8DANJ;IAA0B,EAAE,EAApB,WAAW;IACS,GAAG;IACA,MAAM;IACR,IAAI;CACjC,GAAU,eAAe,GAAG,aAAa,CAoC3C;AAlKD;;;;;;;;;;;GAWG;AACH,2DANG;IAA0B,EAAE,EAApB,WAAW;IACS,GAAG;IACA,MAAM;IACR,IAAI;CACjC,GAAU,eAAe,CA0G3B;AAgDD;;;;;;;;GAQG;AACH,6CAHG;IAA0B,EAAE,EAApB,WAAW;IACS,GAAG;CAAC;sBAOtB,MAAM,QACN,UAAU;EAYtB;AA2BM,uCALI,WAAW,WACX,eAAe,GACb,UAAU,CAKtB;AAWM,wCAJI,WAAW,GACT,WAAW,CAKvB;iCApRS,wBAAwB;kCAAxB,wBAAwB;qCAAxB,wBAAwB;mCAAxB,wBAAwB;qCAexB,mBAAmB;mCAAnB,mBAAmB;gCAAnB,mBAAmB;iCAAnB,mBAAmB"}
|
package/src/node-powers.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides adapters for Compartment Mapper I/O to the corresponding
|
|
3
3
|
* Node.js implementations of those behaviors.
|
|
4
4
|
*
|
|
5
5
|
* The Compartment Mapper generalizes its I/O interface to allow for a wide
|
|
6
6
|
* variety of I/O providers, but especially for reading and writing from
|
|
7
7
|
* virtualized file systems like zip files.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseArchiveCjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: true;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-archive-cjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-archive-cjs.d.ts","sourceRoot":"","sources":["parse-archive-cjs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-archive-cjs.d.ts","sourceRoot":"","sources":["parse-archive-cjs.js"],"names":[],"mappings":"AAoBA,sBAAsB;AACtB,8BADW,OAAO,CAkDhB;;;;;;;6BA/DyB,YAAY"}
|
package/src/parse-archive-cjs.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseArchiveMjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-archive-mjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-archive-mjs.d.ts","sourceRoot":"","sources":["parse-archive-mjs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-archive-mjs.d.ts","sourceRoot":"","sources":["parse-archive-mjs.js"],"names":[],"mappings":"AAcA,sBAAsB;AACtB,8BADW,OAAO,CAqBhB;;;;;;;6BA5ByB,YAAY"}
|
package/src/parse-archive-mjs.js
CHANGED
package/src/parse-bytes.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseBytes: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-bytes.d.ts.map
|
package/src/parse-bytes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-bytes.d.ts","sourceRoot":"","sources":["parse-bytes.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-bytes.d.ts","sourceRoot":"","sources":["parse-bytes.js"],"names":[],"mappings":"AAkBA,sBAAsB;AACtB,yBADW,OAAO,CA0BhB;;;;;;;6BApCyB,YAAY"}
|
package/src/parse-bytes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-cjs-shared-export-wrapper.d.ts","sourceRoot":"","sources":["parse-cjs-shared-export-wrapper.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-cjs-shared-export-wrapper.d.ts","sourceRoot":"","sources":["parse-cjs-shared-export-wrapper.js"],"names":[],"mappings":"AA0CO,2CAPI,UAAU,GAAG,MAAM,GAAG,SAAS,YAC/B,MAAM,GACJ;IACR,QAAQ,EAAC,MAAM,GAAC,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAC,IAAI,CAAA;CACrB,CAgCH;AAmBM,uGAZJ;IAAmB,uBAAuB,EAAlC,MAAM;IACU,WAAW,EAA3B,WAAW;IACgB,eAAe,EAA1C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACX,QAAQ,EAAnB,MAAM;IAC8B,UAAU,EAA9C,MAAM,GAAG,UAAU,GAAG,SAAS;CACvC,GAAU;IACR,MAAM,EAAE;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC;IACzB,aAAa,EAAE,GAAG,CAAC;IACnB,YAAY,WAAW;IACvB,OAAO,WAAW;CACnB,CA2HH;gCA5MqC,YAAY;4BAAZ,YAAY"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides shared functionality for {@link parse-cjs.js} and {@link
|
|
3
3
|
* parse-archive-cjs.js} toward importing or archiving CommonJS as a virtual
|
|
4
4
|
* module source.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
/** @import {ReadFn, ReadPowers} from './types.js' */
|
package/src/parse-cjs.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseCjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: true;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-cjs.d.ts.map
|
package/src/parse-cjs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-cjs.d.ts","sourceRoot":"","sources":["parse-cjs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-cjs.d.ts","sourceRoot":"","sources":["parse-cjs.js"],"names":[],"mappings":"AAgBA,sBAAsB;AACtB,uBADW,OAAO,CA0DhB;;;;;;;6BAnEyB,YAAY"}
|
package/src/parse-cjs.js
CHANGED
package/src/parse-json.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseJson: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
|
-
import type { ParserImplementation } from './types.js';
|
|
7
10
|
//# sourceMappingURL=parse-json.d.ts.map
|
package/src/parse-json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["parse-json.js"],"names":[],"mappings":"AAmBA,sBAAsB;AACtB,wBADW,OAAO,CAqBhB
|
|
1
|
+
{"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["parse-json.js"],"names":[],"mappings":"AAmBA,sBAAsB;AACtB,wBADW,OAAO,CAqBhB;;;;;;;6BApC8C,YAAY"}
|
package/src/parse-mjs.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseMjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-mjs.d.ts.map
|
package/src/parse-mjs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-mjs.d.ts","sourceRoot":"","sources":["parse-mjs.js"],"names":[],"mappings":"AAQA,sBAAsB;AACtB,uBADW,OAAO,CAqBhB
|
|
1
|
+
{"version":3,"file":"parse-mjs.d.ts","sourceRoot":"","sources":["parse-mjs.js"],"names":[],"mappings":"AAQA,sBAAsB;AACtB,uBADW,OAAO,CAqBhB;;;;;;;6BA3ByB,YAAY"}
|
package/src/parse-pre-cjs.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parsePreCjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: true;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-pre-cjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-pre-cjs.d.ts","sourceRoot":"","sources":["parse-pre-cjs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-pre-cjs.d.ts","sourceRoot":"","sources":["parse-pre-cjs.js"],"names":[],"mappings":"AAiBA,sBAAsB;AACtB,0BADW,OAAO,CAuDhB;;;;;;;6BA9DyB,YAAY"}
|
package/src/parse-pre-cjs.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides language-specific behavior for importing pre-compiled
|
|
3
3
|
* CommonJS.
|
|
4
4
|
* Pre-compiled CommonJS is a module in JSON format that describes its imports,
|
|
5
5
|
* exports, and source to execute in the presence of `require`, `module`, and
|
|
6
6
|
* `exports`.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
11
|
/** @import {ParseFn} from './types.js' */
|
package/src/parse-pre-mjs.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parsePreMjs: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-pre-mjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-pre-mjs.d.ts","sourceRoot":"","sources":["parse-pre-mjs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-pre-mjs.d.ts","sourceRoot":"","sources":["parse-pre-mjs.js"],"names":[],"mappings":"AAeA,sBAAsB;AACtB,0BADW,OAAO,CAsBhB;;;;;;;6BA5ByB,YAAY"}
|
package/src/parse-pre-mjs.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides language-specific behaviors for importing pre-compiled ESM.
|
|
3
3
|
* Pre-compiling or translating ESM from a module to a script with a
|
|
4
4
|
* calling-convention is necessary to prepare an archive so that it can be
|
|
5
5
|
* imported by the SES shim without entraining a dependency on Babel.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
10
|
/** @import {ParseFn} from './types.js' */
|
package/src/parse-text.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** @type {ParseFn} */
|
|
2
2
|
export const parseText: ParseFn;
|
|
3
|
-
declare const _default:
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parse: ParseFn;
|
|
5
|
+
heuristicImports: false;
|
|
6
|
+
synchronous: true;
|
|
7
|
+
};
|
|
4
8
|
export default _default;
|
|
5
9
|
import type { ParseFn } from './types.js';
|
|
6
10
|
//# sourceMappingURL=parse-text.d.ts.map
|
package/src/parse-text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-text.d.ts","sourceRoot":"","sources":["parse-text.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-text.d.ts","sourceRoot":"","sources":["parse-text.js"],"names":[],"mappings":"AAoBA,sBAAsB;AACtB,wBADW,OAAO,CAuBhB;;;;;;;6BAnCyB,YAAY"}
|
package/src/parse-text.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides language-behaviors for importing a module as a document
|
|
3
3
|
* that exports itself as a string based on a UTF-8 interpretation of the
|
|
4
4
|
* module's text.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
/** @import {ParseFn} from './types.js' */
|
package/src/policy-format.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
export const WILDCARD_POLICY_VALUE: "any";
|
|
1
2
|
export function policyLookupHelper(packagePolicy: import("./types.js").PackagePolicy, field: "builtins" | "globals" | "packages", itemName: string): boolean | import("./types.js").AttenuationDefinition;
|
|
2
3
|
export function isAllowingEverything(policyValue: unknown): policyValue is import("./types.js").WildcardPolicy;
|
|
3
4
|
export function isAttenuationDefinition(allegedDefinition: unknown): allegedDefinition is import("./types.js").AttenuationDefinition;
|
|
4
5
|
export function getAttenuatorFromDefinition(attenuationDefinition: import("./types.js").AttenuationDefinition): import("./types.js").UnifiedAttenuationDefinition;
|
|
5
|
-
export function assertPackagePolicy(allegedPackagePolicy: unknown, path: string, url?: string
|
|
6
|
+
export function assertPackagePolicy(allegedPackagePolicy: unknown, path: string, url?: string): asserts allegedPackagePolicy is SomePackagePolicy | undefined;
|
|
6
7
|
export function assertPolicy(allegedPolicy: unknown): asserts allegedPolicy is (SomePolicy | undefined);
|
|
7
8
|
import type { SomePackagePolicy } from './types.js';
|
|
8
9
|
import type { SomePolicy } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy-format.d.ts","sourceRoot":"","sources":["policy-format.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policy-format.d.ts","sourceRoot":"","sources":["policy-format.js"],"names":[],"mappings":"AAeA,oCAAqC,KAAK,CAAC;AAepC,kDALI,OAAO,YAAY,EAAE,aAAa,SAClC,UAAU,GAAC,SAAS,GAAC,UAAU,YAC/B,MAAM,GACJ,OAAO,GAAG,OAAO,YAAY,EAAE,qBAAqB,CAyBhE;AAQM,kDAHI,OAAO,GACL,WAAW,IAAI,OAAO,YAAY,EAAE,cAAc,CAGxB;AAOhC,2DAHI,OAAO,GACL,iBAAiB,IAAI,OAAO,YAAY,EAAE,qBAAqB,CAS3E;AAOM,mEAHI,OAAO,YAAY,EAAE,qBAAqB,GACxC,OAAO,YAAY,EAAE,4BAA4B,CAuB7D;AA0CM,0DALI,OAAO,QACP,MAAM,QACN,MAAM,GACJ,QAAQ,oBAAoB,IAAI,iBAAiB,GAAC,SAAS,CA4DvE;AAUM,4CAHI,OAAO,GACL,QAAQ,aAAa,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAgC7D;uCA7OgD,YAAY;gCAAZ,YAAY"}
|