Files
reverse-engineering-anything/scripts/lib/module-boundaries.d.mts
T
morluto a93a9f43c9 test(support): copy isolated-repository scripts with their runtime import closure (#11281)
* 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
2026-11-15 23:49:11 +08:00

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;