@endo/compartment-mapper 2.0.0 → 2.1.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.
- package/package.json +23 -9
- package/src/archive-lite.js +3 -3
- package/src/capture-lite.d.ts.map +1 -1
- package/src/capture-lite.js +29 -3
- package/src/compartment-map.d.ts.map +1 -1
- package/src/compartment-map.js +3 -2
- package/src/digest.js +1 -1
- package/src/generic-graph.d.ts +7 -25
- package/src/generic-graph.d.ts.map +1 -1
- package/src/generic-graph.js +75 -105
- package/src/import-hook.d.ts.map +1 -1
- package/src/import-hook.js +4 -3
- package/src/infer-exports.d.ts +4 -2
- package/src/infer-exports.d.ts.map +1 -1
- package/src/infer-exports.js +158 -19
- package/src/link.d.ts.map +1 -1
- package/src/link.js +61 -3
- package/src/node-modules.d.ts.map +1 -1
- package/src/node-modules.js +33 -39
- package/src/pattern-replacement.d.ts +6 -0
- package/src/pattern-replacement.d.ts.map +1 -0
- package/src/pattern-replacement.js +198 -0
- package/src/types/compartment-map-schema.d.ts +8 -1
- package/src/types/compartment-map-schema.d.ts.map +1 -1
- package/src/types/compartment-map-schema.ts +9 -0
- package/src/types/external.d.ts +79 -55
- package/src/types/external.d.ts.map +1 -1
- package/src/types/external.ts +104 -62
- package/src/types/generic-graph.d.ts +8 -2
- package/src/types/generic-graph.d.ts.map +1 -1
- package/src/types/generic-graph.ts +7 -2
- package/src/types/internal.d.ts +8 -8
- package/src/types/internal.d.ts.map +1 -1
- package/src/types/internal.ts +9 -8
- package/src/types/node-modules.d.ts +45 -8
- package/src/types/node-modules.d.ts.map +1 -1
- package/src/types/node-modules.ts +56 -15
- package/src/types/pattern-replacement.d.ts +62 -0
- package/src/types/pattern-replacement.d.ts.map +1 -0
- package/src/types/pattern-replacement.ts +70 -0
- package/src/types/powers.d.ts +11 -9
- package/src/types/powers.d.ts.map +1 -1
- package/src/types/powers.ts +11 -10
package/src/types/external.ts
CHANGED
|
@@ -25,6 +25,11 @@ import type { SomePolicy } from './policy-schema.js';
|
|
|
25
25
|
import type { HashFn, ReadFn, ReadPowers } from './powers.js';
|
|
26
26
|
import type { CanonicalName } from './canonical-name.js';
|
|
27
27
|
import type { PackageDescriptor } from './node-modules.js';
|
|
28
|
+
import type {
|
|
29
|
+
ATTENUATORS_COMPARTMENT,
|
|
30
|
+
ENTRY_COMPARTMENT,
|
|
31
|
+
} from '../policy-format.js';
|
|
32
|
+
import type { LiteralUnion } from './typescript.js';
|
|
28
33
|
|
|
29
34
|
export type { CanonicalName };
|
|
30
35
|
export type { PackageDescriptor };
|
|
@@ -59,7 +64,15 @@ export type PackageData = {
|
|
|
59
64
|
* Called once before `translateGraph`.
|
|
60
65
|
*/
|
|
61
66
|
export type PackageDataHook = (params: {
|
|
62
|
-
packageData: Readonly<
|
|
67
|
+
packageData: Readonly<
|
|
68
|
+
Map<
|
|
69
|
+
LiteralUnion<
|
|
70
|
+
typeof ATTENUATORS_COMPARTMENT | typeof ENTRY_COMPARTMENT,
|
|
71
|
+
FileUrlString
|
|
72
|
+
>,
|
|
73
|
+
PackageData
|
|
74
|
+
>
|
|
75
|
+
>;
|
|
63
76
|
log: LogFn;
|
|
64
77
|
}) => void;
|
|
65
78
|
|
|
@@ -85,17 +98,30 @@ export type PackageDependenciesHook = (params: {
|
|
|
85
98
|
* The `moduleSource` property value for {@link ModuleSourceHook}
|
|
86
99
|
*/
|
|
87
100
|
export type ModuleSourceHookModuleSource =
|
|
88
|
-
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
| ModuleSourceHookFileModuleSource
|
|
102
|
+
| ModuleSourceHookExitModuleSource;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The `moduleSource` property value for {@link ModuleSourceHook} for a module
|
|
106
|
+
* on disk
|
|
107
|
+
*/
|
|
108
|
+
export type ModuleSourceHookFileModuleSource = {
|
|
109
|
+
location: FileUrlString;
|
|
110
|
+
language: Language;
|
|
111
|
+
bytes: Uint8Array;
|
|
112
|
+
imports?: string[] | undefined;
|
|
113
|
+
exports?: string[] | undefined;
|
|
114
|
+
reexports?: string[] | undefined;
|
|
115
|
+
sha512?: string | undefined;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The `moduleSource` property value for {@link ModuleSourceHook} for an exit
|
|
120
|
+
* module (virtual)
|
|
121
|
+
*/
|
|
122
|
+
export type ModuleSourceHookExitModuleSource = {
|
|
123
|
+
exit: string;
|
|
124
|
+
};
|
|
99
125
|
|
|
100
126
|
/**
|
|
101
127
|
* Hook executed when processing a module source.
|
|
@@ -115,28 +141,38 @@ export type PackageConnectionsHook = (params: {
|
|
|
115
141
|
log: LogFn;
|
|
116
142
|
}) => void;
|
|
117
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Hook executed during preloading when a compartment designated to be preloaded
|
|
146
|
+
* is already loaded.
|
|
147
|
+
*/
|
|
148
|
+
export type RedundantPreloadHook = (params: {
|
|
149
|
+
canonicalName: CanonicalName;
|
|
150
|
+
entry: string;
|
|
151
|
+
log: LogFn;
|
|
152
|
+
}) => void;
|
|
153
|
+
|
|
118
154
|
/**
|
|
119
155
|
* Set of options available in the context of code execution.
|
|
120
156
|
*
|
|
121
157
|
* May be used only as an intersection with other options types.
|
|
122
158
|
*/
|
|
123
159
|
export type ExecuteOptions = Partial<{
|
|
124
|
-
globals: object;
|
|
125
|
-
transforms: Array<Transform
|
|
126
|
-
__shimTransforms__: Array<Transform
|
|
127
|
-
attenuations: Record<string, object
|
|
128
|
-
Compartment: typeof Compartment;
|
|
129
|
-
__native__: boolean;
|
|
160
|
+
globals: object | undefined;
|
|
161
|
+
transforms: Array<Transform> | undefined;
|
|
162
|
+
__shimTransforms__: Array<Transform> | undefined;
|
|
163
|
+
attenuations: Record<string, object> | undefined;
|
|
164
|
+
Compartment: typeof Compartment | undefined;
|
|
165
|
+
__native__: boolean | undefined;
|
|
130
166
|
}> &
|
|
131
167
|
ModulesOption &
|
|
132
168
|
ExitModuleImportHookOption;
|
|
133
169
|
|
|
134
170
|
export type ParseArchiveOptions = Partial<{
|
|
135
|
-
expectedSha512: string;
|
|
136
|
-
computeSha512: HashFn;
|
|
137
|
-
computeSourceLocation: ComputeSourceLocationHook;
|
|
138
|
-
computeSourceMapLocation: ComputeSourceMapLocationHook;
|
|
139
|
-
__native__: boolean;
|
|
171
|
+
expectedSha512: string | undefined;
|
|
172
|
+
computeSha512: HashFn | undefined;
|
|
173
|
+
computeSourceLocation: ComputeSourceLocationHook | undefined;
|
|
174
|
+
computeSourceMapLocation: ComputeSourceMapLocationHook | undefined;
|
|
175
|
+
__native__: boolean | undefined;
|
|
140
176
|
}> &
|
|
141
177
|
ModulesOption &
|
|
142
178
|
CompartmentOption &
|
|
@@ -152,7 +188,7 @@ export interface LogOptions {
|
|
|
152
188
|
/**
|
|
153
189
|
* A logger (for logging)
|
|
154
190
|
*/
|
|
155
|
-
log?: LogFn;
|
|
191
|
+
log?: LogFn | undefined;
|
|
156
192
|
}
|
|
157
193
|
|
|
158
194
|
/**
|
|
@@ -165,7 +201,7 @@ export type MapNodeModulesOptions = MapNodeModulesOptionsOmitPolicy &
|
|
|
165
201
|
|
|
166
202
|
type MapNodeModulesOptionsOmitPolicy = Partial<{
|
|
167
203
|
/** @deprecated renamed `conditions` to be consistent with Node.js */
|
|
168
|
-
tags: Set<string
|
|
204
|
+
tags: Set<string> | undefined;
|
|
169
205
|
/**
|
|
170
206
|
* Conditions for package `"imports"` and `"exports"`.
|
|
171
207
|
*
|
|
@@ -177,7 +213,7 @@ type MapNodeModulesOptionsOmitPolicy = Partial<{
|
|
|
177
213
|
* `devDependencies`, use the {@link MapNodeModulesOptions.dev dev} flag
|
|
178
214
|
* instead.
|
|
179
215
|
*/
|
|
180
|
-
conditions: Set<string
|
|
216
|
+
conditions: Set<string> | undefined;
|
|
181
217
|
/**
|
|
182
218
|
* If `true`, include packages from `devDependencies` in the resulting {@link CompartmentMapDescriptor}.
|
|
183
219
|
*
|
|
@@ -185,41 +221,41 @@ type MapNodeModulesOptionsOmitPolicy = Partial<{
|
|
|
185
221
|
* {@link MapNodeModulesOptions.conditions condition}, but this behavior may
|
|
186
222
|
* be deprecated in a future version.
|
|
187
223
|
*/
|
|
188
|
-
dev: boolean;
|
|
224
|
+
dev: boolean | undefined;
|
|
189
225
|
/**
|
|
190
226
|
* Indicates that the node_modules tree should fail to map if it does not
|
|
191
227
|
* strictly reach every expected package.
|
|
192
228
|
* By default, unreachable packages are simply omitted from the map,
|
|
193
229
|
* which defers some errors to when modules load.
|
|
194
230
|
*/
|
|
195
|
-
strict: boolean;
|
|
231
|
+
strict: boolean | undefined;
|
|
196
232
|
/** Dependencies to make reachable from any package */
|
|
197
|
-
commonDependencies: Record<string, string
|
|
233
|
+
commonDependencies: Record<string, string> | undefined;
|
|
198
234
|
/** Maps extensions to languages for all packages, like `txt` to `text` */
|
|
199
|
-
languageForExtension: LanguageForExtension;
|
|
235
|
+
languageForExtension: LanguageForExtension | undefined;
|
|
200
236
|
/** Maps additional extensions to languages for all type=module packages */
|
|
201
|
-
moduleLanguageForExtension: LanguageForExtension;
|
|
237
|
+
moduleLanguageForExtension: LanguageForExtension | undefined;
|
|
202
238
|
/** Maps additional extensions to languages for all type=commonjs packages (default) */
|
|
203
|
-
commonjsLanguageForExtension: LanguageForExtension;
|
|
239
|
+
commonjsLanguageForExtension: LanguageForExtension | undefined;
|
|
204
240
|
/** Maps extensions to languages for packages not under node_modules */
|
|
205
|
-
workspaceLanguageForExtension: LanguageForExtension;
|
|
241
|
+
workspaceLanguageForExtension: LanguageForExtension | undefined;
|
|
206
242
|
/**
|
|
207
243
|
* Maps additional extensions to languages for all type=module packages that
|
|
208
244
|
* are not under node_modules
|
|
209
245
|
*/
|
|
210
|
-
workspaceModuleLanguageForExtension: LanguageForExtension;
|
|
246
|
+
workspaceModuleLanguageForExtension: LanguageForExtension | undefined;
|
|
211
247
|
/**
|
|
212
248
|
* Maps additional extensions to languages for all type=commonjs packages
|
|
213
249
|
* (default)
|
|
214
250
|
*/
|
|
215
|
-
workspaceCommonjsLanguageForExtension: LanguageForExtension;
|
|
251
|
+
workspaceCommonjsLanguageForExtension: LanguageForExtension | undefined;
|
|
216
252
|
/**
|
|
217
253
|
* Accounts for languages not present as values in any of the extension to
|
|
218
254
|
* language mappings.
|
|
219
255
|
* For higher level functions like `importLocation`, these are inferred
|
|
220
256
|
* from the `parserForLanguage` option.
|
|
221
257
|
*/
|
|
222
|
-
languages: Array<Language
|
|
258
|
+
languages: Array<Language> | undefined;
|
|
223
259
|
}>;
|
|
224
260
|
|
|
225
261
|
/**
|
|
@@ -265,7 +301,13 @@ export interface PreloadOption {
|
|
|
265
301
|
*
|
|
266
302
|
* If an array of strings is provided, the entry is assumed to be `.`.
|
|
267
303
|
*/
|
|
268
|
-
_preload?: Array<string
|
|
304
|
+
_preload?: Array<string | { compartment: string; entry: string }>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Hook executed during preloading when a compartment designated to be preloaded
|
|
308
|
+
* has already been loaded (via entry Compartment).
|
|
309
|
+
*/
|
|
310
|
+
_redundantPreloadHook?: RedundantPreloadHook | undefined;
|
|
269
311
|
}
|
|
270
312
|
|
|
271
313
|
export type ArchiveLiteOptions = SyncOrAsyncArchiveOptions &
|
|
@@ -293,20 +335,20 @@ export type BundleOptions = ArchiveOptions & {
|
|
|
293
335
|
* Specifying `cjs` makes `require` available for modules outside the bundle
|
|
294
336
|
* (exits to the import graph).
|
|
295
337
|
*/
|
|
296
|
-
format?: 'cjs';
|
|
338
|
+
format?: 'cjs' | undefined;
|
|
297
339
|
/**
|
|
298
340
|
* Evaluates individual module functors in-place so stack traces represent
|
|
299
341
|
* original source locations better.
|
|
300
342
|
* The resulting script cannot be used on a web page with a no-unsafe-eval
|
|
301
343
|
* Content Security Policy.
|
|
302
344
|
*/
|
|
303
|
-
useEvaluate?: boolean;
|
|
345
|
+
useEvaluate?: boolean | undefined;
|
|
304
346
|
/**
|
|
305
347
|
* A prefix for the sourceURL comment in each module format that supports
|
|
306
348
|
* sourceURL comments.
|
|
307
349
|
* Requires `useEvaluate` for effect.
|
|
308
350
|
*/
|
|
309
|
-
sourceUrlPrefix?: string;
|
|
351
|
+
sourceUrlPrefix?: string | undefined;
|
|
310
352
|
};
|
|
311
353
|
|
|
312
354
|
export type SyncArchiveOptions = Omit<
|
|
@@ -364,7 +406,7 @@ export type ComputeSha512Option = {
|
|
|
364
406
|
/**
|
|
365
407
|
* For computing integrity hashes for module descriptors based on captured sources.
|
|
366
408
|
*/
|
|
367
|
-
computeSha512?: HashFn;
|
|
409
|
+
computeSha512?: HashFn | undefined;
|
|
368
410
|
};
|
|
369
411
|
|
|
370
412
|
export type SearchSuffixesOption = {
|
|
@@ -376,15 +418,15 @@ export type SearchSuffixesOption = {
|
|
|
376
418
|
* bundler, and does not attempt to vary the behavior of resolution depending
|
|
377
419
|
* on the language of the importing module.
|
|
378
420
|
*/
|
|
379
|
-
searchSuffixes?: string[];
|
|
421
|
+
searchSuffixes?: string[] | undefined;
|
|
380
422
|
};
|
|
381
423
|
|
|
382
424
|
export type SourceMapHookOption = {
|
|
383
|
-
sourceMapHook?: SourceMapHook;
|
|
425
|
+
sourceMapHook?: SourceMapHook | undefined;
|
|
384
426
|
};
|
|
385
427
|
|
|
386
428
|
export type ModulesOption = {
|
|
387
|
-
modules?: Record<string, any
|
|
429
|
+
modules?: Record<string, any> | undefined;
|
|
388
430
|
};
|
|
389
431
|
|
|
390
432
|
export type ExitModuleImportHookOption = {
|
|
@@ -392,7 +434,7 @@ export type ExitModuleImportHookOption = {
|
|
|
392
434
|
* For obtaining module descriptors for modules that must be provided
|
|
393
435
|
* by the eventual runtime execution environment, asynchronously.
|
|
394
436
|
*/
|
|
395
|
-
importHook?: ExitModuleImportHook;
|
|
437
|
+
importHook?: ExitModuleImportHook | undefined;
|
|
396
438
|
};
|
|
397
439
|
|
|
398
440
|
export type ExitModuleImportNowHookOption = {
|
|
@@ -400,23 +442,23 @@ export type ExitModuleImportNowHookOption = {
|
|
|
400
442
|
* For obtaining module descriptors for modules that must be provided
|
|
401
443
|
* by the eventual runtime execution environment, synchronusly.
|
|
402
444
|
*/
|
|
403
|
-
importNowHook?: ExitModuleImportNowHook;
|
|
445
|
+
importNowHook?: ExitModuleImportNowHook | undefined;
|
|
404
446
|
};
|
|
405
447
|
|
|
406
448
|
export type ParserForLanguageOption = {
|
|
407
|
-
parserForLanguage?: ParserForLanguage;
|
|
449
|
+
parserForLanguage?: ParserForLanguage | undefined;
|
|
408
450
|
};
|
|
409
451
|
|
|
410
452
|
export type CompartmentOption = {
|
|
411
|
-
Compartment?: typeof Compartment;
|
|
453
|
+
Compartment?: typeof Compartment | undefined;
|
|
412
454
|
};
|
|
413
455
|
|
|
414
456
|
export type ModuleTransformsOption = {
|
|
415
|
-
moduleTransforms?: ModuleTransforms;
|
|
457
|
+
moduleTransforms?: ModuleTransforms | undefined;
|
|
416
458
|
};
|
|
417
459
|
|
|
418
460
|
export type SyncModuleTransformsOption = {
|
|
419
|
-
syncModuleTransforms?: SyncModuleTransforms;
|
|
461
|
+
syncModuleTransforms?: SyncModuleTransforms | undefined;
|
|
420
462
|
};
|
|
421
463
|
|
|
422
464
|
export type ArchiveOnlyOption = {
|
|
@@ -444,22 +486,22 @@ export type ArchiveOnlyOption = {
|
|
|
444
486
|
* This option does not generally surface to users, but is set by the scenario,
|
|
445
487
|
* off for `importLocation`, on for `makeArchive` and `makeScript`.
|
|
446
488
|
*/
|
|
447
|
-
archiveOnly?: boolean;
|
|
489
|
+
archiveOnly?: boolean | undefined;
|
|
448
490
|
};
|
|
449
491
|
|
|
450
492
|
export type PolicyOption = {
|
|
451
|
-
policy?: SomePolicy;
|
|
493
|
+
policy?: SomePolicy | undefined;
|
|
452
494
|
};
|
|
453
495
|
|
|
454
496
|
export type LanguageForExtensionOption = {
|
|
455
|
-
languageForExtension?: LanguageForExtension;
|
|
497
|
+
languageForExtension?: LanguageForExtension | undefined;
|
|
456
498
|
};
|
|
457
499
|
|
|
458
500
|
// ////////////////////////////////////////////////////////////////////////////////
|
|
459
501
|
// Common option groups:
|
|
460
502
|
|
|
461
503
|
export type SyncOrAsyncArchiveOptions = Partial<{
|
|
462
|
-
captureSourceLocation: CaptureSourceLocationHook;
|
|
504
|
+
captureSourceLocation: CaptureSourceLocationHook | undefined;
|
|
463
505
|
}> &
|
|
464
506
|
ParserForLanguageOption &
|
|
465
507
|
CompartmentOption &
|
|
@@ -626,14 +668,14 @@ type ModuleTransformArguments = [
|
|
|
626
668
|
moduleLocation: string,
|
|
627
669
|
packageLocation: string,
|
|
628
670
|
params: {
|
|
629
|
-
sourceMap?: string;
|
|
671
|
+
sourceMap?: string | undefined;
|
|
630
672
|
},
|
|
631
673
|
];
|
|
632
674
|
|
|
633
675
|
type ModuleTransformResult = {
|
|
634
676
|
bytes: Uint8Array;
|
|
635
677
|
parser: Language;
|
|
636
|
-
sourceMap?: string;
|
|
678
|
+
sourceMap?: string | undefined;
|
|
637
679
|
};
|
|
638
680
|
|
|
639
681
|
export type ExitModuleImportHook = (
|
|
@@ -692,11 +734,11 @@ type ParseArguments = [
|
|
|
692
734
|
moduleLocation: string,
|
|
693
735
|
packageLocation: string,
|
|
694
736
|
options?: Partial<{
|
|
695
|
-
sourceMap: string;
|
|
696
|
-
sourceMapHook: SourceMapHook;
|
|
697
|
-
sourceMapUrl: string;
|
|
698
|
-
readPowers: ReadFn | ReadPowers;
|
|
699
|
-
compartmentDescriptor: CompartmentDescriptor;
|
|
737
|
+
sourceMap: string | undefined;
|
|
738
|
+
sourceMapHook: SourceMapHook | undefined;
|
|
739
|
+
sourceMapUrl: string | undefined;
|
|
740
|
+
readPowers: ReadFn | ReadPowers | undefined;
|
|
741
|
+
compartmentDescriptor: CompartmentDescriptor | undefined;
|
|
700
742
|
}> &
|
|
701
743
|
ArchiveOnlyOption,
|
|
702
744
|
];
|
|
@@ -708,7 +750,7 @@ export type ParseResult = {
|
|
|
708
750
|
bytes: Uint8Array;
|
|
709
751
|
parser: Language;
|
|
710
752
|
record: FinalStaticModuleType;
|
|
711
|
-
sourceMap?: string;
|
|
753
|
+
sourceMap?: string | undefined;
|
|
712
754
|
};
|
|
713
755
|
|
|
714
756
|
export type AsyncParseFn = (...args: ParseArguments) => Promise<ParseResult>;
|
|
@@ -3,14 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* A node in a `GenericGraph`.
|
|
8
|
+
*/
|
|
9
|
+
export type GenericGraphNode = string | {
|
|
10
|
+
toString: () => string;
|
|
11
|
+
};
|
|
6
12
|
/**
|
|
7
13
|
* Context used for shortest-path traversal algorithm
|
|
8
14
|
*
|
|
9
15
|
* @template T The type of nodes in the graph
|
|
10
16
|
* @internal
|
|
11
17
|
*/
|
|
12
|
-
export interface TraversalContext<T
|
|
13
|
-
|
|
18
|
+
export interface TraversalContext<T extends GenericGraphNode = string> {
|
|
19
|
+
paths: Map<T, T[]>;
|
|
14
20
|
predecessors: Map<T, T>;
|
|
15
21
|
queue: Set<T>;
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-graph.d.ts","sourceRoot":"","sources":["generic-graph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"generic-graph.d.ts","sourceRoot":"","sources":["generic-graph.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;CAAE,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,GAAG,MAAM;IACnE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CACf"}
|
|
@@ -4,14 +4,19 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* A node in a `GenericGraph`.
|
|
9
|
+
*/
|
|
10
|
+
export type GenericGraphNode = string | { toString: () => string };
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Context used for shortest-path traversal algorithm
|
|
9
14
|
*
|
|
10
15
|
* @template T The type of nodes in the graph
|
|
11
16
|
* @internal
|
|
12
17
|
*/
|
|
13
|
-
export interface TraversalContext<T
|
|
14
|
-
|
|
18
|
+
export interface TraversalContext<T extends GenericGraphNode = string> {
|
|
19
|
+
paths: Map<T, T[]>;
|
|
15
20
|
predecessors: Map<T, T>;
|
|
16
21
|
queue: Set<T>;
|
|
17
22
|
}
|
package/src/types/internal.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ import type { PackageDescriptor } from './node-modules.js';
|
|
|
11
11
|
import type { DeferredAttenuatorsProvider } from './policy.js';
|
|
12
12
|
import type { MaybeReadFn, MaybeReadNowFn, ReadFn, ReadPowers } from './powers.js';
|
|
13
13
|
export type LinkOptions = {
|
|
14
|
-
resolve?: ResolveHook;
|
|
14
|
+
resolve?: ResolveHook | undefined;
|
|
15
15
|
makeImportHook: ImportHookMaker;
|
|
16
|
-
makeImportNowHook?: ImportNowHookMaker;
|
|
17
|
-
parserForLanguage?: ParserForLanguage;
|
|
18
|
-
moduleTransforms?: ModuleTransforms;
|
|
19
|
-
syncModuleTransforms?: SyncModuleTransforms;
|
|
20
|
-
__native__?: boolean;
|
|
16
|
+
makeImportNowHook?: ImportNowHookMaker | undefined;
|
|
17
|
+
parserForLanguage?: ParserForLanguage | undefined;
|
|
18
|
+
moduleTransforms?: ModuleTransforms | undefined;
|
|
19
|
+
syncModuleTransforms?: SyncModuleTransforms | undefined;
|
|
20
|
+
__native__?: boolean | undefined;
|
|
21
21
|
} & ArchiveOnlyOption & ExecuteOptions & LogOptions;
|
|
22
22
|
export type LinkResult = {
|
|
23
23
|
compartment: Compartment;
|
|
@@ -155,12 +155,12 @@ export type MakeMapParsersOptions = {
|
|
|
155
155
|
* If non-empty, synchronous import (specifically dynamic `require` in
|
|
156
156
|
* CommonJS or `compartment.importNow`) are unsupported.
|
|
157
157
|
*/
|
|
158
|
-
moduleTransforms?: ModuleTransforms;
|
|
158
|
+
moduleTransforms?: ModuleTransforms | undefined;
|
|
159
159
|
/**
|
|
160
160
|
* Sync module transforms.
|
|
161
161
|
* Always supported.
|
|
162
162
|
*/
|
|
163
|
-
syncModuleTransforms?: SyncModuleTransforms;
|
|
163
|
+
syncModuleTransforms?: SyncModuleTransforms | undefined;
|
|
164
164
|
};
|
|
165
165
|
/**
|
|
166
166
|
* Options for `search()`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACR,oBAAoB,EACpB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,6BAA6B,EAC7B,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,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AAG,2BAA2B,CAAC"}
|
package/src/types/internal.ts
CHANGED
|
@@ -41,6 +41,7 @@ import type {
|
|
|
41
41
|
Sources,
|
|
42
42
|
SyncModuleTransforms,
|
|
43
43
|
CompartmentsRenameFn,
|
|
44
|
+
RedundantPreloadHook,
|
|
44
45
|
} from './external.js';
|
|
45
46
|
import type { PackageDescriptor } from './node-modules.js';
|
|
46
47
|
import type { DeferredAttenuatorsProvider } from './policy.js';
|
|
@@ -52,13 +53,13 @@ import type {
|
|
|
52
53
|
} from './powers.js';
|
|
53
54
|
|
|
54
55
|
export type LinkOptions = {
|
|
55
|
-
resolve?: ResolveHook;
|
|
56
|
+
resolve?: ResolveHook | undefined;
|
|
56
57
|
makeImportHook: ImportHookMaker;
|
|
57
|
-
makeImportNowHook?: ImportNowHookMaker;
|
|
58
|
-
parserForLanguage?: ParserForLanguage;
|
|
59
|
-
moduleTransforms?: ModuleTransforms;
|
|
60
|
-
syncModuleTransforms?: SyncModuleTransforms;
|
|
61
|
-
__native__?: boolean;
|
|
58
|
+
makeImportNowHook?: ImportNowHookMaker | undefined;
|
|
59
|
+
parserForLanguage?: ParserForLanguage | undefined;
|
|
60
|
+
moduleTransforms?: ModuleTransforms | undefined;
|
|
61
|
+
syncModuleTransforms?: SyncModuleTransforms | undefined;
|
|
62
|
+
__native__?: boolean | undefined;
|
|
62
63
|
} & ArchiveOnlyOption &
|
|
63
64
|
ExecuteOptions &
|
|
64
65
|
LogOptions;
|
|
@@ -234,12 +235,12 @@ export type MakeMapParsersOptions = {
|
|
|
234
235
|
* If non-empty, synchronous import (specifically dynamic `require` in
|
|
235
236
|
* CommonJS or `compartment.importNow`) are unsupported.
|
|
236
237
|
*/
|
|
237
|
-
moduleTransforms?: ModuleTransforms;
|
|
238
|
+
moduleTransforms?: ModuleTransforms | undefined;
|
|
238
239
|
/**
|
|
239
240
|
* Sync module transforms.
|
|
240
241
|
* Always supported.
|
|
241
242
|
*/
|
|
242
|
-
syncModuleTransforms?: SyncModuleTransforms;
|
|
243
|
+
syncModuleTransforms?: SyncModuleTransforms | undefined;
|
|
243
244
|
};
|
|
244
245
|
|
|
245
246
|
/**
|
|
@@ -2,7 +2,41 @@ import type { GenericGraph } from '../generic-graph.js';
|
|
|
2
2
|
import type { CanonicalName, PackageCompartmentDescriptorName, PolicyOption } from '../types.js';
|
|
3
3
|
import type { Language, LanguageForExtension } from './compartment-map-schema.js';
|
|
4
4
|
import type { FileUrlString, LogOptions, PackageDependenciesHook } from './external.js';
|
|
5
|
+
import type { PatternDescriptor } from './pattern-replacement.js';
|
|
5
6
|
import type { LiteralUnion } from './typescript.js';
|
|
7
|
+
import { ATTENUATORS_COMPARTMENT } from '../policy-format.js';
|
|
8
|
+
/**
|
|
9
|
+
* A mapping of conditions to their resolved exports.
|
|
10
|
+
* Each condition key (e.g., "import", "require", "node", "default")
|
|
11
|
+
* maps to an {@link Exports} value.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest ExportConditions}
|
|
14
|
+
*/
|
|
15
|
+
export type ExportConditions = {
|
|
16
|
+
[condition: string]: Exports;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Entry points of a module, optionally with conditions and subpath exports.
|
|
20
|
+
* Follows the recursive structure defined by Node.js for `package.json`
|
|
21
|
+
* `exports` and `imports` fields.
|
|
22
|
+
*
|
|
23
|
+
* - `null` excludes a subpath (null target).
|
|
24
|
+
* - `string` is a direct path.
|
|
25
|
+
* - `Array` is a fallback list (first match wins).
|
|
26
|
+
* - `ExportConditions` is a mapping of conditions to nested `Exports`.
|
|
27
|
+
*
|
|
28
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Exports}
|
|
29
|
+
*/
|
|
30
|
+
export type Exports = null | string | Array<string | ExportConditions> | ExportConditions;
|
|
31
|
+
/**
|
|
32
|
+
* The `imports` field of `package.json`.
|
|
33
|
+
* Keys must start with `#`.
|
|
34
|
+
*
|
|
35
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Imports}
|
|
36
|
+
*/
|
|
37
|
+
export type Imports = {
|
|
38
|
+
[key: `#${string}`]: Exports;
|
|
39
|
+
};
|
|
6
40
|
export type CommonDependencyDescriptors = Record<string, {
|
|
7
41
|
spec: string;
|
|
8
42
|
alias: string;
|
|
@@ -15,7 +49,7 @@ export type CommonDependencyDescriptorsOptions = {
|
|
|
15
49
|
/**
|
|
16
50
|
* Dependencies added to _all_ packages
|
|
17
51
|
*/
|
|
18
|
-
commonDependencyDescriptors?: CommonDependencyDescriptors;
|
|
52
|
+
commonDependencyDescriptors?: CommonDependencyDescriptors | undefined;
|
|
19
53
|
};
|
|
20
54
|
/**
|
|
21
55
|
* Options bag containing a {@link PackageDependenciesHook}
|
|
@@ -35,11 +69,11 @@ export type GraphPackagesOptions = LogOptions & PolicyOption & PackageDependenci
|
|
|
35
69
|
* Options for `gatherDependency()`
|
|
36
70
|
*/
|
|
37
71
|
export type GatherDependencyOptions = {
|
|
38
|
-
childLogicalPath?: string[];
|
|
72
|
+
childLogicalPath?: string[] | undefined;
|
|
39
73
|
/**
|
|
40
74
|
* If `true` the dependency is optional
|
|
41
75
|
*/
|
|
42
|
-
optional?: boolean;
|
|
76
|
+
optional?: boolean | undefined;
|
|
43
77
|
} & LogOptions & PackageDependenciesHookOption & PolicyOption & CommonDependencyDescriptorsOptions;
|
|
44
78
|
/**
|
|
45
79
|
* The type of a `package.json` file containing relevant fields; used by `graphPackages` and its ilk
|
|
@@ -52,10 +86,8 @@ export interface PackageDescriptor {
|
|
|
52
86
|
*/
|
|
53
87
|
name: string;
|
|
54
88
|
version?: string;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*/
|
|
58
|
-
exports?: unknown;
|
|
89
|
+
exports?: Exports;
|
|
90
|
+
imports?: Imports;
|
|
59
91
|
type?: 'module' | 'commonjs';
|
|
60
92
|
dependencies?: Record<string, string>;
|
|
61
93
|
devDependencies?: Record<string, string>;
|
|
@@ -90,6 +122,11 @@ export interface Node {
|
|
|
90
122
|
explicitExports: boolean;
|
|
91
123
|
internalAliases: Record<string, string>;
|
|
92
124
|
externalAliases: Record<string, string>;
|
|
125
|
+
/**
|
|
126
|
+
* Wildcard patterns extracted from the `exports` and `imports` fields.
|
|
127
|
+
* `*` matches exactly one path segment (Node.js semantics).
|
|
128
|
+
*/
|
|
129
|
+
patterns: PatternDescriptor[];
|
|
93
130
|
/**
|
|
94
131
|
* The name of the original package's parent directory, for reconstructing
|
|
95
132
|
* a sourceURL that is likely to converge with the original location in an IDE.
|
|
@@ -126,7 +163,7 @@ export interface FinalNode extends Node {
|
|
|
126
163
|
* Keys may either be a file URL string to a package or the special
|
|
127
164
|
* `<ATTENUATORS>` string.
|
|
128
165
|
*/
|
|
129
|
-
export type Graph = Record<LiteralUnion<
|
|
166
|
+
export type Graph = Record<LiteralUnion<typeof ATTENUATORS_COMPARTMENT, FileUrlString>, Node>;
|
|
130
167
|
/**
|
|
131
168
|
* A graph, but contains {@link FinalNode}s instead of {@link Node}s.
|
|
132
169
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-modules.d.ts","sourceRoot":"","sources":["node-modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"node-modules.d.ts","sourceRoot":"","sources":["node-modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,aAAa,EACb,gCAAgC,EAChC,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACrB,MAAM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