mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
* test(support): copy isolated-repository scripts with their runtime import closure * fix(test): resolve package imports to the file Node loads in the import closure
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
/** One dependency crossing a settled source ownership boundary. */
|
|
export interface ModuleBoundaryViolation {
|
|
readonly file: string;
|
|
readonly line: number;
|
|
readonly specifier: string;
|
|
readonly target: string;
|
|
readonly boundary:
|
|
| "artifact-acquisition"
|
|
| "process-capture"
|
|
| "pure-layer"
|
|
| "application-composition"
|
|
| "provider-construction"
|
|
| "provider-generated-catalog";
|
|
}
|
|
|
|
/** Check resolved source ownership, including type imports and reexports. */
|
|
export function inspectModuleBoundaries(
|
|
file: string,
|
|
source: string,
|
|
root: string,
|
|
): readonly ModuleBoundaryViolation[];
|
|
|
|
/** One own-source import, resolved to its repository path. */
|
|
export interface ResolvedModuleImport {
|
|
readonly file: string;
|
|
readonly line: number;
|
|
readonly specifier: string;
|
|
readonly typeOnly: boolean;
|
|
readonly target: string;
|
|
}
|
|
|
|
/** Each own-source import of a file, resolved to its repository path. */
|
|
export function resolveModuleImports(
|
|
file: string,
|
|
source: string,
|
|
root: string,
|
|
): readonly ResolvedModuleImport[];
|
|
|
|
/** Check already resolved imports, as returned by resolveModuleImports. */
|
|
export function inspectResolvedModuleBoundaries(
|
|
imports: readonly ResolvedModuleImport[],
|
|
): readonly ModuleBoundaryViolation[];
|
|
|
|
/**
|
|
* The file an exact-string package-map specifier names, as Node loads it.
|
|
* Conditional, array, pattern, undeclared and non-relative mappings are refused.
|
|
*/
|
|
export function packageImportTarget(root: string, specifier: string): string;
|