@ttt-productions/repo-guards 0.1.9 → 0.1.10
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/dist/modules/import-paths/analyzer.d.ts +8 -2
- package/dist/modules/import-paths/analyzer.d.ts.map +1 -1
- package/dist/modules/import-paths/analyzer.js +22 -12
- package/dist/modules/import-paths/analyzer.js.map +1 -1
- package/dist/modules/import-paths/guard.d.ts.map +1 -1
- package/dist/modules/import-paths/guard.js +11 -1
- package/dist/modules/import-paths/guard.js.map +1 -1
- package/dist/modules/repo/guards.d.ts +2 -0
- package/dist/modules/repo/guards.d.ts.map +1 -1
- package/dist/modules/repo/guards.js +2 -0
- package/dist/modules/repo/guards.js.map +1 -1
- package/dist/modules/repo/shared-fakes.d.ts +34 -0
- package/dist/modules/repo/shared-fakes.d.ts.map +1 -0
- package/dist/modules/repo/shared-fakes.js +352 -0
- package/dist/modules/repo/shared-fakes.js.map +1 -0
- package/dist/node/reports/index.d.ts +1 -1
- package/dist/node/reports/index.d.ts.map +1 -1
- package/dist/node/reports/index.js +1 -1
- package/dist/node/reports/index.js.map +1 -1
- package/dist/node/reports/reports.d.ts +6 -0
- package/dist/node/reports/reports.d.ts.map +1 -1
- package/dist/node/reports/reports.js +22 -0
- package/dist/node/reports/reports.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
* exceptions?: Array<{ file: string, why: string }>,
|
|
7
7
|
* codeExtensions?: string[],
|
|
8
8
|
* isTestFile?: (path: string) => boolean,
|
|
9
|
+
* isExcludedModule?: (path: string) => boolean,
|
|
9
10
|
* }} [options]
|
|
10
11
|
* `importAliases` maps a specifier prefix to a repo-relative folder (`{ '@/': 'src/' }`).
|
|
11
12
|
* `exceptions` names the framework entry modules that may re-export; every one needs a `why`.
|
|
12
13
|
* `isTestFile` decides which modules are tests (default: a `.test.` / `.spec.` name, or any
|
|
13
14
|
* `__tests__` folder on the path).
|
|
15
|
+
* `isExcludedModule` says whether a module file exists inside a path the analyzed set leaves out
|
|
16
|
+
* on purpose; an import of one resolves without being judged, the way a package import does.
|
|
14
17
|
*/
|
|
15
|
-
export function createImportPathProfile({ importAliases, exceptions, codeExtensions, isTestFile, }?: {
|
|
18
|
+
export function createImportPathProfile({ importAliases, exceptions, codeExtensions, isTestFile, isExcludedModule, }?: {
|
|
16
19
|
importAliases?: Record<string, string>;
|
|
17
20
|
exceptions?: Array<{
|
|
18
21
|
file: string;
|
|
@@ -20,6 +23,7 @@ export function createImportPathProfile({ importAliases, exceptions, codeExtensi
|
|
|
20
23
|
}>;
|
|
21
24
|
codeExtensions?: string[];
|
|
22
25
|
isTestFile?: (path: string) => boolean;
|
|
26
|
+
isExcludedModule?: (path: string) => boolean;
|
|
23
27
|
}): Readonly<{
|
|
24
28
|
importAliases: Readonly<{
|
|
25
29
|
[x: string]: string;
|
|
@@ -30,6 +34,7 @@ export function createImportPathProfile({ importAliases, exceptions, codeExtensi
|
|
|
30
34
|
}>[];
|
|
31
35
|
codeExtensions: readonly string[];
|
|
32
36
|
isTestFile: (path: string) => boolean;
|
|
37
|
+
isExcludedModule: (path: string) => boolean;
|
|
33
38
|
}>;
|
|
34
39
|
/**
|
|
35
40
|
* One module's import edges, re-exports, and exported names. An edge is `typeOnly` when the build
|
|
@@ -60,7 +65,8 @@ export function parseModule(path: string, text: string, sourceFile?: import("typ
|
|
|
60
65
|
* @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input
|
|
61
66
|
* `files` maps every analyzed module (repo-relative, forward-slashed) to its text; `roots` are the
|
|
62
67
|
* analyzed folders. A local specifier that resolves under a root to no analyzed module is
|
|
63
|
-
* `unresolved-import` — the guard never treats a path it cannot read as clean
|
|
68
|
+
* `unresolved-import` — the guard never treats a path it cannot read as clean — unless the
|
|
69
|
+
* profile's `isExcludedModule` says the module exists inside a path left out on purpose.
|
|
64
70
|
*/
|
|
65
71
|
export function analyzeImportPaths({ files, roots, profile }: {
|
|
66
72
|
files: Map<string, string | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/modules/import-paths/analyzer.js"],"names":[],"mappings":"AAiEA
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../src/modules/import-paths/analyzer.js"],"names":[],"mappings":"AAiEA;;;;;;;;;;;;;;;;GAgBG;AACH,uHAdW;IACN,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9C;;;;;;;;;uBAFqB,MAAM,KAAK,OAAO;6BACZ,MAAM,KAAK,OAAO;GAkChD;AAuGD;;;;;;;GAOG;AACH,kCAJW,MAAM,QACN,MAAM,eACN,OAAO,YAAY,EAAE,UAAU,GAAG,IAAI;;cAMtB,MAAM;cAAQ,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa;eAAS,MAAM,EAAE,GAAG,GAAG;kBAAY,OAAO;;;cAIrG,MAAM;cAAQ,MAAM;kBAAY,MAAM;cAAQ,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe;;;EAkIpI;AAaD;;;;;;;;GAQG;AACH,8DANW;IAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,YAAY,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;CAAE;;;;;;EAqG9K;AAED;;;GAGG;AACH;;;;;;;IAsBC;AAkCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,gGAVW;IACN,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,YAAY,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAC3F,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;CACrD;;EAkHH;AAED;;;;;;GAMG;AACH,4DAFW;IAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,YAAY,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA;CAAE;;;;IA8F9K;AAkJD,0DAA0D;AAC1D;;WAKC;AA93BD,8CAA8C;AAC9C,4DAQG"}
|
|
@@ -64,13 +64,16 @@ const defaultIsTestFile = (p) => /\.(test|spec)\.[cm]?[jt]sx?$/.test(p) || p.spl
|
|
|
64
64
|
* exceptions?: Array<{ file: string, why: string }>,
|
|
65
65
|
* codeExtensions?: string[],
|
|
66
66
|
* isTestFile?: (path: string) => boolean,
|
|
67
|
+
* isExcludedModule?: (path: string) => boolean,
|
|
67
68
|
* }} [options]
|
|
68
69
|
* `importAliases` maps a specifier prefix to a repo-relative folder (`{ '@/': 'src/' }`).
|
|
69
70
|
* `exceptions` names the framework entry modules that may re-export; every one needs a `why`.
|
|
70
71
|
* `isTestFile` decides which modules are tests (default: a `.test.` / `.spec.` name, or any
|
|
71
72
|
* `__tests__` folder on the path).
|
|
73
|
+
* `isExcludedModule` says whether a module file exists inside a path the analyzed set leaves out
|
|
74
|
+
* on purpose; an import of one resolves without being judged, the way a package import does.
|
|
72
75
|
*/
|
|
73
|
-
export function createImportPathProfile({ importAliases = {}, exceptions = [], codeExtensions = DEFAULT_CODE_EXTENSIONS, isTestFile = defaultIsTestFile, } = {}) {
|
|
76
|
+
export function createImportPathProfile({ importAliases = {}, exceptions = [], codeExtensions = DEFAULT_CODE_EXTENSIONS, isTestFile = defaultIsTestFile, isExcludedModule = () => false, } = {}) {
|
|
74
77
|
const problems = [];
|
|
75
78
|
reviewedProblems(exceptions, 'exceptions', problems, { key: 'file' });
|
|
76
79
|
if (problems.length)
|
|
@@ -85,6 +88,7 @@ export function createImportPathProfile({ importAliases = {}, exceptions = [], c
|
|
|
85
88
|
exceptions: Object.freeze(exceptions.map((e) => Object.freeze({ file: e.file, why: e.why }))),
|
|
86
89
|
codeExtensions: Object.freeze([...codeExtensions]),
|
|
87
90
|
isTestFile,
|
|
91
|
+
isExcludedModule,
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
94
|
function scriptKindOf(path) {
|
|
@@ -354,7 +358,8 @@ const within = (path, dir) => dir === '' || isUnder(path, dir);
|
|
|
354
358
|
* @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input
|
|
355
359
|
* `files` maps every analyzed module (repo-relative, forward-slashed) to its text; `roots` are the
|
|
356
360
|
* analyzed folders. A local specifier that resolves under a root to no analyzed module is
|
|
357
|
-
* `unresolved-import` — the guard never treats a path it cannot read as clean
|
|
361
|
+
* `unresolved-import` — the guard never treats a path it cannot read as clean — unless the
|
|
362
|
+
* profile's `isExcludedModule` says the module exists inside a path left out on purpose.
|
|
358
363
|
*/
|
|
359
364
|
export function analyzeImportPaths({ files, roots, profile }) {
|
|
360
365
|
if (!profile)
|
|
@@ -386,6 +391,9 @@ export function analyzeImportPaths({ files, roots, profile }) {
|
|
|
386
391
|
if (!index) {
|
|
387
392
|
add('reexport-outside-index', path, `${re.form} re-export of ${shown}`);
|
|
388
393
|
}
|
|
394
|
+
else if (target.kind === 'excluded') {
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
389
397
|
else if (target.kind !== 'file' || !within(target.path, dirnameOf(path))) {
|
|
390
398
|
add('index-forwards-outside-folder', path, `forwards ${shown}, which is outside ${dirnameOf(path) || 'the repo root'}/`);
|
|
391
399
|
}
|
|
@@ -734,6 +742,8 @@ function buildModel(files, roots, profile) {
|
|
|
734
742
|
const found = findModule(base);
|
|
735
743
|
if (found)
|
|
736
744
|
result = { kind: 'file', path: found };
|
|
745
|
+
else if (moduleCandidates(base).some(profile.isExcludedModule))
|
|
746
|
+
result = { kind: 'excluded' };
|
|
737
747
|
else {
|
|
738
748
|
const ext = extensionOf(base);
|
|
739
749
|
if (ext && !profile.codeExtensions.includes(ext))
|
|
@@ -747,23 +757,23 @@ function buildModel(files, roots, profile) {
|
|
|
747
757
|
resolveCache.set(key, result);
|
|
748
758
|
return result;
|
|
749
759
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
760
|
+
/** Every module file a specifier's resolved base may name, in the order they are tried. */
|
|
761
|
+
function moduleCandidates(base) {
|
|
762
|
+
const out = [base];
|
|
753
763
|
const ext = extensionOf(base);
|
|
754
764
|
if (EMITTED_TO_SOURCE[ext]) {
|
|
755
765
|
const stem = base.slice(0, -ext.length);
|
|
756
766
|
for (const src of EMITTED_TO_SOURCE[ext])
|
|
757
|
-
|
|
758
|
-
return stem + src;
|
|
767
|
+
out.push(stem + src);
|
|
759
768
|
}
|
|
760
769
|
for (const e of profile.codeExtensions)
|
|
761
|
-
|
|
762
|
-
return base + e;
|
|
770
|
+
out.push(base + e);
|
|
763
771
|
for (const e of profile.codeExtensions)
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
772
|
+
out.push(`${base}/index${e}`);
|
|
773
|
+
return out;
|
|
774
|
+
}
|
|
775
|
+
function findModule(base) {
|
|
776
|
+
return moduleCandidates(base).find((candidate) => modules.has(candidate)) ?? null;
|
|
767
777
|
}
|
|
768
778
|
/** Every index whose folder holds `target` but not `from`, innermost first; `target` is never its own crossing. */
|
|
769
779
|
function indexesCrossed(from, target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../../src/modules/import-paths/analyzer.js"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,0EAA0E;AAC1E,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,+FAA+F;AAC/F,oCAAoC;AACpC,mGAAmG;AACnG,gGAAgG;AAChG,kGAAkG;AAClG,+BAA+B;AAC/B,oGAAoG;AACpG,sFAAsF;AACtF,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,EAAE;AACF,gGAAgG;AAChG,4FAA4F;AAE5F,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,wBAAwB;IACxB,+BAA+B;IAC/B,mBAAmB;IACnB,0BAA0B;IAC1B,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,M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CAAC,CAAC,CAAC;wBAAE,OAAO,IAAI,CAAC;gBACpF,CAAC;qBAAM,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC;oBAAE,OAAO,IAAI,CAAC;YAClD,CAAC;iBAAM,IAAI,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBAC5F,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC;oBAAE,OAAO,IAAI,CAAC;YAC7D,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,OAAO;QACP,cAAc;QACd,SAAS;QACT,OAAO;QACP,cAAc;QACd,gBAAgB;QAChB,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,sBAAsB,CAAC,EAAE,UAAU,EAAE;IACnD,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,OAAO,kEAAkE,CAAC;IAClG,MAAM,KAAK,GAAG,CAAC,sBAAsB,UAAU,CAAC,MAAM,eAAe,CAAC,CAAC;IACvE,KAAK,MAAM,CAAC,IAAI,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAChF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// The import-path guard: every definition has exactly one import path.\n//\n// Four structural facts, checked over an app's module set held in memory:\n//\n// 1. A module that is not a folder `index` never re-exports — value or type, named, aliased,\n// star, or the two-statement `import { x } …; export { x }`. Its consumers import the owner.\n// 2. A folder `index` forwards only modules inside its own folder's subtree — never a module\n// outside it, never a package.\n// 3. Code outside a folder that has an `index` imports through that index, never past it. A test\n// may import a file inside the folder only for names the index does not forward from it. A\n// test's module mocks (`vi.mock` and kin) name the path the code under test imports, so they\n// are never held to this.\n// 4. Code inside a folder never imports the `index` of a folder that contains it — it imports its\n// siblings directly, so a folder entry point can never import itself in a cycle.\n//\n// An exception (a framework entry module such as a deploy manifest) may re-export and is not a\n// folder entry point. Each one carries a justification, and one that stops re-exporting is stale.\n//\n// Whether an index member is still imported by anything outside its folder is a usage question,\n// not a boundary, so it is a separate report (`findUnusedIndexMembers`), never a violation.\n\nimport ts from 'typescript';\nimport { moduleImports } from '../../support/imports.js';\nimport { reviewedProblems } from '../../support/facts.js';\nimport { dirnameOf, normalizePath } from '../../support/paths.js';\nimport { isUnder } from '../../support/text.js';\n\n/** Every violation kind the guard reports. */\nexport const IMPORT_PATH_VIOLATION_KINDS = Object.freeze([\n 'reexport-outside-index',\n 'index-forwards-outside-folder',\n 'import-past-index',\n 'import-through-own-index',\n 'unresolved-import',\n 'stale-exception',\n 'stale-exclusion',\n]);\n\nconst DEFAULT_CODE_EXTENSIONS = Object.freeze([\n '.ts',\n '.tsx',\n '.mts',\n '.cts',\n '.js',\n '.jsx',\n '.mjs',\n '.cjs',\n]);\n// TypeScript's ESM convention writes the emitted extension in the specifier: `./x.js` names `x.ts`.\nconst EMITTED_TO_SOURCE = Object.freeze({\n '.js': ['.ts', '.tsx'],\n '.jsx': ['.tsx'],\n '.mjs': ['.mts'],\n '.cjs': ['.cts'],\n});\n\nconst extensionOf = (p) => {\n const base = p.slice(p.lastIndexOf('/') + 1);\n const dot = base.lastIndexOf('.');\n return dot <= 0 ? '' : base.slice(dot);\n};\n\nconst defaultIsTestFile = (p) =>\n /\\.(test|spec)\\.[cm]?[jt]sx?$/.test(p) || p.split('/').includes('__tests__');\n\n/**\n * Everything the guard knows about one app.\n *\n * @param {{\n * importAliases?: Record<string, string>,\n * exceptions?: Array<{ file: string, why: string }>,\n * codeExtensions?: string[],\n * isTestFile?: (path: string) => boolean,\n * }} [options]\n * `importAliases` maps a specifier prefix to a repo-relative folder (`{ '@/': 'src/' }`).\n * `exceptions` names the framework entry modules that may re-export; every one needs a `why`.\n * `isTestFile` decides which modules are tests (default: a `.test.` / `.spec.` name, or any\n * `__tests__` folder on the path).\n */\nexport function createImportPathProfile({\n importAliases = {},\n exceptions = [],\n codeExtensions = DEFAULT_CODE_EXTENSIONS,\n isTestFile = defaultIsTestFile,\n} = {}) {\n const problems = [];\n reviewedProblems(exceptions, 'exceptions', problems, { key: 'file' });\n if (problems.length)\n throw new Error(\n `repo-guards: the import-path exceptions are malformed: ${problems.join('; ')}`,\n );\n for (const [prefix, target] of Object.entries(importAliases)) {\n if (!prefix || typeof target !== 'string') {\n throw new Error(`repo-guards: alias ${JSON.stringify(prefix)} needs a target folder`);\n }\n }\n return Object.freeze({\n importAliases: Object.freeze({ ...importAliases }),\n exceptions: Object.freeze(exceptions.map((e) => Object.freeze({ file: e.file, why: e.why }))),\n codeExtensions: Object.freeze([...codeExtensions]),\n isTestFile,\n });\n}\n\nfunction scriptKindOf(path) {\n const ext = extensionOf(path);\n if (ext === '.tsx') return ts.ScriptKind.TSX;\n if (ext === '.jsx') return ts.ScriptKind.JSX;\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') return ts.ScriptKind.JS;\n return ts.ScriptKind.TS;\n}\n\nconst hasExportModifier = (node) =>\n ts.canHaveModifiers(node) &&\n (ts.getModifiers(node) ?? []).some((m) => m.kind === ts.SyntaxKind.ExportKeyword);\nconst hasDefaultModifier = (node) =>\n ts.canHaveModifiers(node) &&\n (ts.getModifiers(node) ?? []).some((m) => m.kind === ts.SyntaxKind.DefaultKeyword);\n\n/** The names a dynamic import or `require` reads, when the code says; `'*'` when it does not. */\nfunction namesReadFromCall(call) {\n let node = call;\n if (ts.isAwaitExpression(node.parent)) node = node.parent;\n while (ts.isParenthesizedExpression(node.parent)) node = node.parent;\n const parent = node.parent;\n if (\n ts.isVariableDeclaration(parent) &&\n parent.initializer === node &&\n ts.isObjectBindingPattern(parent.name)\n ) {\n const names = [];\n for (const el of parent.name.elements) {\n if (el.dotDotDotToken) return '*';\n const key = el.propertyName ?? el.name;\n if (!ts.isIdentifier(key) && !ts.isStringLiteral(key)) return '*';\n names.push(key.text);\n }\n return names;\n }\n if (ts.isPropertyAccessExpression(parent) && parent.expression === node)\n return [parent.name.text];\n return '*';\n}\n\nconst isClassExtends = (node) =>\n ts.isHeritageClause(node.parent) &&\n node.parent.token === ts.SyntaxKind.ExtendsKeyword &&\n (ts.isClassDeclaration(node.parent.parent) || ts.isClassExpression(node.parent.parent));\n\n/** A declaration's own name, or a property name read off an object — never a reference to a binding. */\nfunction isNameNotReference(node) {\n const p = node.parent;\n if (!p) return false;\n if (ts.isPropertyAccessExpression(p) || ts.isQualifiedName(p))\n return p.name === node || p.right === node;\n return (\n (ts.isPropertyAssignment(p) ||\n ts.isPropertyDeclaration(p) ||\n ts.isMethodDeclaration(p) ||\n ts.isGetAccessorDeclaration(p) ||\n ts.isSetAccessorDeclaration(p) ||\n ts.isEnumMember(p) ||\n ts.isBindingElement(p) ||\n ts.isLabeledStatement(p) ||\n ts.isJsxAttribute(p)) &&\n p.name === node\n );\n}\n\n/**\n * Every name the module reads as a value. An imported binding read only in type positions is erased\n * by the build, so its import loads nothing at run time.\n */\nfunction valueReferencedNames(sf) {\n const used = new Set();\n const visit = (node) => {\n if (ts.isImportDeclaration(node) || ts.isImportEqualsDeclaration(node)) return;\n if (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) return;\n if (ts.isExpressionWithTypeArguments(node)) {\n if (isClassExtends(node)) visit(node.expression);\n return;\n }\n if (ts.isTypeNode(node)) return;\n if (ts.isExportDeclaration(node)) {\n if (\n node.isTypeOnly ||\n node.moduleSpecifier ||\n !node.exportClause ||\n !ts.isNamedExports(node.exportClause)\n )\n return;\n for (const el of node.exportClause.elements)\n if (!el.isTypeOnly) used.add((el.propertyName ?? el.name).text);\n return;\n }\n if (ts.isIdentifier(node)) {\n if (!isNameNotReference(node)) used.add(node.text);\n return;\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return used;\n}\n\n/**\n * One module's import edges, re-exports, and exported names. An edge is `typeOnly` when the build\n * erases it: written type-only, or binding only names the module reads in type positions.\n *\n * @param {string} path repo-relative, forward-slashed\n * @param {string} text\n * @param {import('typescript').SourceFile | null} [sourceFile] the file already parsed\n */\nexport function parseModule(path, text, sourceFile = null) {\n // A module the reader already parsed is never parsed a second time.\n const sf =\n sourceFile ?? ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, scriptKindOf(path));\n /** @type {Array<{ spec: string, kind: 'static' | 'dynamic' | 'mock' | 'export-from', names: string[] | '*', typeOnly: boolean }>} */\n const imports = [];\n let valueNames = null;\n const readAsValue = (local) => (valueNames ??= valueReferencedNames(sf)).has(local);\n /** @type {Array<{ spec: string, name: string, imported: string, form: 'named' | 'aliased' | 'star' | 'namespace' | 'two-statement' }>} */\n const reExports = [];\n /** Names this module exports from its own declarations (not forwards). */\n const ownExports = new Set();\n const importedBindings = new Map();\n\n const sites = moduleImports(sf);\n for (const site of sites) {\n if (!site.topLevel) continue;\n const { spec } = site;\n if (site.kind === 'import') {\n const names = [];\n const valueLocals = [];\n if (site.defaultName) {\n names.push('default');\n importedBindings.set(site.defaultName, { spec, imported: 'default' });\n valueLocals.push(site.defaultName);\n }\n if (site.namespace) {\n importedBindings.set(site.namespace, { spec, imported: '*' });\n valueLocals.push(site.namespace);\n }\n for (const { imported, local, typeOnly } of site.named) {\n names.push(imported);\n importedBindings.set(local, { spec, imported });\n if (!typeOnly) valueLocals.push(local);\n }\n const typeOnly = site.typeOnly || (!site.sideEffect && !valueLocals.some(readAsValue));\n imports.push({ spec, kind: 'static', names: site.namespace ? '*' : names, typeOnly });\n } else if (site.kind === 'importEquals') {\n imports.push({ spec, kind: 'static', names: '*', typeOnly: site.typeOnly });\n }\n }\n\n const exportFrom = new Map(\n sites\n .filter((site) => site.kind === 'export' && site.topLevel)\n .map((site) => [site.node, site]),\n );\n for (const stmt of sf.statements) {\n if (ts.isExportDeclaration(stmt)) {\n const site = exportFrom.get(stmt);\n const clause = stmt.exportClause;\n if (site) {\n const { spec } = site;\n if (site.star) {\n reExports.push(\n site.namespace\n ? { spec, name: site.namespace, imported: '*', form: 'namespace' }\n : { spec, name: '*', imported: '*', form: 'star' },\n );\n imports.push({ spec, kind: 'export-from', names: '*', typeOnly: site.typeOnly });\n } else {\n for (const { imported, local } of site.named) {\n reExports.push({\n spec,\n name: local,\n imported,\n form: imported === local ? 'named' : 'aliased',\n });\n }\n const typeOnly =\n site.typeOnly || (site.named.length > 0 && site.named.every((n) => n.typeOnly));\n imports.push({\n spec,\n kind: 'export-from',\n names: site.named.map((n) => n.imported),\n typeOnly,\n });\n }\n } else if (clause && ts.isNamedExports(clause)) {\n for (const el of clause.elements) {\n const local = (el.propertyName ?? el.name).text;\n const binding = importedBindings.get(local);\n if (binding) {\n reExports.push({\n spec: binding.spec,\n name: el.name.text,\n imported: binding.imported,\n form: 'two-statement',\n });\n } else {\n ownExports.add(el.name.text);\n }\n }\n }\n } else if (ts.isExportAssignment(stmt) && !stmt.isExportEquals) {\n const expr = stmt.expression;\n const binding = ts.isIdentifier(expr) ? importedBindings.get(expr.text) : undefined;\n if (binding)\n reExports.push({\n spec: binding.spec,\n name: 'default',\n imported: binding.imported,\n form: 'two-statement',\n });\n else ownExports.add('default');\n } else if (hasExportModifier(stmt)) {\n if (ts.isVariableStatement(stmt)) {\n const add = (name) => {\n if (ts.isIdentifier(name)) ownExports.add(name.text);\n else for (const el of name.elements) if (ts.isBindingElement(el)) add(el.name);\n };\n for (const d of stmt.declarationList.declarations) add(d.name);\n } else if (hasDefaultModifier(stmt)) {\n ownExports.add('default');\n } else if (stmt.name && (ts.isIdentifier(stmt.name) || ts.isStringLiteral(stmt.name))) {\n ownExports.add(stmt.name.text);\n }\n }\n }\n\n for (const { kind, node, spec } of sites) {\n if (kind === 'dynamic' || kind === 'require')\n imports.push({ spec, kind: 'dynamic', names: namesReadFromCall(node), typeOnly: false });\n else if (kind === 'mock') imports.push({ spec, kind: 'mock', names: '*', typeOnly: false });\n else if (kind === 'importType') {\n const q = node.qualifier;\n const first = q\n ? ts.isIdentifier(q)\n ? q.text\n : q.left && ts.isIdentifier(q.left)\n ? q.left.text\n : null\n : null;\n imports.push({ spec, kind: 'static', names: first ? [first] : '*', typeOnly: true });\n }\n }\n\n return { imports, reExports, ownExports };\n}\n\nfunction isIndexFile(path, profile) {\n const base = path.slice(path.lastIndexOf('/') + 1);\n const ext = extensionOf(base);\n return (\n base.slice(0, base.length - ext.length) === 'index' && profile.codeExtensions.includes(ext)\n );\n}\n\n/** Under a folder, the repository root (`''`) holding everything. */\nconst within = (path, dir) => dir === '' || isUnder(path, dir);\n\n/**\n * The guard over an in-memory module set.\n *\n * @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input\n * `files` maps every analyzed module (repo-relative, forward-slashed) to its text; `roots` are the\n * analyzed folders. A local specifier that resolves under a root to no analyzed module is\n * `unresolved-import` — the guard never treats a path it cannot read as clean.\n */\nexport function analyzeImportPaths({ files, roots, profile }) {\n if (!profile) throw new Error('repo-guards: analyzeImportPaths needs a profile');\n if (!Array.isArray(roots) || roots.length === 0)\n throw new Error('repo-guards: analyzeImportPaths needs its roots');\n const model = buildModel(files, roots, profile);\n const violations = [];\n const add = (kind, file, detail) => violations.push({ kind, file, detail });\n\n for (const exception of profile.exceptions) {\n const mod = model.modules.get(exception.file);\n if (!mod)\n add(\n 'stale-exception',\n exception.file,\n 'the exception names a module that is not in the analyzed trees',\n );\n else if (mod.parsed.reExports.length === 0)\n add(\n 'stale-exception',\n exception.file,\n 'the exception names a module that no longer re-exports anything',\n );\n }\n\n for (const [path, mod] of model.modules) {\n const exception = model.exceptionFiles.has(path);\n const index = model.indexDirs.get(dirnameOf(path)) === path;\n\n for (const re of mod.parsed.reExports) {\n const target = model.resolve(path, re.spec);\n if (target.kind === 'unresolved') continue; // reported once, on the import edge below\n if (exception) continue;\n const shown =\n re.form === 'star'\n ? `* from '${re.spec}'`\n : `${re.imported === re.name ? re.name : `${re.imported} as ${re.name}`} from '${re.spec}'`;\n if (!index) {\n add('reexport-outside-index', path, `${re.form} re-export of ${shown}`);\n } else if (target.kind !== 'file' || !within(target.path, dirnameOf(path))) {\n add(\n 'index-forwards-outside-folder',\n path,\n `forwards ${shown}, which is outside ${dirnameOf(path) || 'the repo root'}/`,\n );\n }\n }\n\n const test = profile.isTestFile(path);\n for (const edge of mod.parsed.imports) {\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'unresolved') {\n add(\n 'unresolved-import',\n path,\n `'${edge.spec}' names no module under the analyzed trees (looked for ${target.base})`,\n );\n continue;\n }\n if (target.kind !== 'file' || target.path === path) continue;\n\n const own = model.ownIndexCrossing(path, target.path);\n if (own) {\n add(\n 'import-through-own-index',\n path,\n `imports '${edge.spec}', the entry point of ${own}/ which contains it — import the sibling module directly`,\n );\n continue;\n }\n if (edge.kind === 'mock' && test) continue;\n // A non-index forward is already a violation above; an exception's forwards are allowed. An\n // index's own forward still may not reach past a nested folder's index.\n if (edge.kind === 'export-from' && (!index || exception)) continue;\n const crossed = model.indexesCrossed(path, target.path);\n if (!crossed.length) continue;\n const outer = crossed[crossed.length - 1];\n if (\n test &&\n !crossed.some((indexPath) => model.forwardsFrom(indexPath, target.path, edge.names))\n )\n continue;\n add(\n 'import-past-index',\n path,\n `imports '${edge.spec}' past ${outer} — import it through that entry point`,\n );\n }\n }\n\n violations.sort((a, b) =>\n a.file === b.file ? (a.detail < b.detail ? -1 : 1) : a.file < b.file ? -1 : 1,\n );\n return { violations, stats: { modules: model.modules.size, indexes: model.indexDirs.size } };\n}\n\n/**\n * Report-only: index members no module outside the index's folder imports. Never a violation —\n * whether a member is used is a usage question, not a boundary.\n */\nexport function findUnusedIndexMembers({ files, roots, profile }) {\n const model = buildModel(files, roots, profile);\n const used = new Map();\n for (const indexPath of model.indexDirs.values()) used.set(indexPath, new Set());\n for (const [path, mod] of model.modules) {\n for (const edge of mod.parsed.imports) {\n if (edge.kind === 'mock') continue;\n const target = model.resolve(path, edge.spec);\n if (target.kind !== 'file' || !used.has(target.path)) continue;\n if (within(path, dirnameOf(target.path))) continue;\n const set = used.get(target.path);\n if (edge.names === '*') set.add('*');\n else for (const n of edge.names) set.add(n);\n }\n }\n const report = [];\n for (const [indexPath, set] of used) {\n if (set.has('*')) continue;\n const unused = [...model.exportedNames(indexPath)].filter((n) => !set.has(n)).sort();\n if (unused.length) report.push({ file: indexPath, unused });\n }\n return report.sort((a, b) => (a.file < b.file ? -1 : 1));\n}\n\n/** The one kind of test that may import an entry index: one that proves the entry forwards a name. */\nconst ENTRY_SURFACE_TEST = /\\.entry\\.(test|spec)\\.[cm]?[jt]sx?$/;\n\n// The extension a module's built file carries, which is the one a relative specifier names it by.\nconst BUILT_EXTENSION = Object.freeze({\n '.ts': '.js',\n '.tsx': '.js',\n '.js': '.js',\n '.jsx': '.jsx',\n '.mts': '.mjs',\n '.mjs': '.mjs',\n '.cts': '.cjs',\n '.cjs': '.cjs',\n});\n\nconst isRelative = (spec) =>\n spec === '.' || spec === '..' || spec.startsWith('./') || spec.startsWith('../');\n\n/** The specifier that names `targetPath` by its built file, written the way `spec` reaches it. */\nfunction specifierWithExtension(spec, targetPath) {\n const built = BUILT_EXTENSION[extensionOf(targetPath)];\n const targetBase = targetPath.slice(targetPath.lastIndexOf('/') + 1);\n const stem = targetBase.slice(0, targetBase.length - extensionOf(targetBase).length);\n const trimmed = spec.replace(/\\/$/, '');\n const specBase = trimmed.slice(trimmed.lastIndexOf('/') + 1);\n // A specifier naming a folder reaches its index; one naming a file carries the file's stem.\n if (stem === 'index' && specBase !== 'index' && extensionOf(specBase) === '')\n return `${trimmed}/index${built}`;\n const specExt = extensionOf(specBase);\n return `${specExt ? trimmed.slice(0, -specExt.length) : trimmed}${built}`;\n}\n\n/**\n * The import rules inside one package, over its module set:\n *\n * 1. Code imports the file that defines each name — never an index (a folder's, a nested\n * entry's, or the package root's) and never the package's own name. A test does the same,\n * except an entry-surface test (`<name>.entry.test.ts`), which may import an entry index.\n * 2. Only an entry index re-exports, and only files inside its own folder, each named directly\n * (never through another index). An index declares nothing of its own, and an `index` that is\n * not a package entry does not exist.\n * 3. Every relative specifier names its file with the file's built extension — `./x.js` for\n * `x.ts` or `x.tsx`, `./folder/index.js` for a folder — in source and tests alike: a static\n * import or `export … from`, an `import()`, and a test runner's module mock.\n *\n * @param {{\n * files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>,\n * packageRoot: string,\n * packageName: string,\n * entryFiles: string[],\n * profile: ReturnType<typeof createImportPathProfile>,\n * }} input\n * `packageRoot` is the package's repo-relative folder; `entryFiles` are the source modules its\n * `exports` are built from.\n */\nexport function analyzePackageImports({ files, packageRoot, packageName, entryFiles, profile }) {\n if (!profile) throw new Error('repo-guards: analyzePackageImports needs a profile');\n const model = buildModel(files, [packageRoot], profile);\n const entries = new Set(entryFiles);\n const source = `${packageRoot}/src`;\n const violations = [];\n const add = (kind, file, detail) => violations.push({ kind, file, detail });\n const ownName = (spec) => spec === packageName || spec.startsWith(`${packageName}/`);\n // Only the package's own code has indexes the rules govern; an index a test fixture holds models\n // another package's entry.\n const packageIndex = (p) => isIndexFile(p, profile) && within(p, source);\n\n for (const [path, mod] of model.modules) {\n const indexFile = packageIndex(path);\n const entryIndex = indexFile && entries.has(path);\n if (indexFile && !entryIndex) {\n add(\n 'non-entry-index',\n path,\n 'an index that is not a package entry — delete it and import the files it forwarded directly',\n );\n }\n if (entryIndex && mod.parsed.ownExports.size) {\n const names = [...mod.parsed.ownExports].sort().join(', ');\n add(\n 'index-declares',\n path,\n `declares ${names} — an index only forwards; move each definition into a named file and forward that file`,\n );\n }\n\n const forwardedSpecs = new Set();\n for (const re of mod.parsed.reExports) {\n forwardedSpecs.add(re.spec);\n const shown =\n re.form === 'star'\n ? `* from '${re.spec}'`\n : `${re.imported === re.name ? re.name : `${re.imported} as ${re.name}`} from '${re.spec}'`;\n if (!entryIndex) {\n // A non-entry index is reported once, as itself: deleting it removes its forwards too.\n if (!indexFile)\n add(\n 'reexport-outside-entry',\n path,\n `${re.form} re-export of ${shown} — only an entry index re-exports`,\n );\n continue;\n }\n const target = model.resolve(path, re.spec);\n if (target.kind === 'unresolved') continue; // reported once, on the import edge below\n if (target.kind !== 'file' || !within(target.path, dirnameOf(path))) {\n add(\n 'entry-forwards-outside-folder',\n path,\n `forwards ${shown}, which is outside ${dirnameOf(path)}/`,\n );\n } else if (packageIndex(target.path)) {\n add(\n 'entry-forwards-index',\n path,\n `forwards ${shown}, an index — name the file that defines it`,\n );\n }\n }\n\n const entrySurfaceTest = profile.isTestFile(path) && ENTRY_SURFACE_TEST.test(path);\n for (const edge of mod.parsed.imports) {\n if (ownName(edge.spec)) {\n add(\n 'import-own-package-name',\n path,\n `imports '${edge.spec}', the package's own name — import the file that defines each name`,\n );\n continue;\n }\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'unresolved') {\n add(\n 'unresolved-import',\n path,\n `'${edge.spec}' names no module in the package (looked for ${target.base})`,\n );\n continue;\n }\n if (target.kind === 'file' && isRelative(edge.spec)) {\n const named = specifierWithExtension(edge.spec, target.path);\n if (named !== edge.spec) {\n add(\n 'relative-import-without-extension',\n path,\n `imports '${edge.spec}' — a relative import names its file with its built extension: '${named}'`,\n );\n }\n }\n if (target.kind !== 'file' || target.path === path || !packageIndex(target.path)) continue;\n // A forward is judged as a re-export above.\n if (edge.kind === 'export-from' || (entryIndex && forwardedSpecs.has(edge.spec))) continue;\n if (entrySurfaceTest && entries.has(target.path)) continue;\n add(\n 'import-through-index',\n path,\n `imports '${edge.spec}', an index — import the file that defines each name`,\n );\n }\n }\n\n violations.sort((a, b) =>\n a.file === b.file ? (a.detail < b.detail ? -1 : 1) : a.file < b.file ? -1 : 1,\n );\n return { violations };\n}\n\n/**\n * Every runtime import cycle among a module set: the strongly connected groups of its static\n * imports and forwards, type-only edges and lazy `import()` left out (neither runs while a module\n * evaluates). Each cycle is reported once, as one closed path through it.\n *\n * @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input\n */\nexport function findImportCycles({ files, roots, profile }) {\n const model = buildModel(files, roots, profile);\n const edges = new Map();\n for (const [path, mod] of model.modules) {\n const out = new Set();\n for (const edge of mod.parsed.imports) {\n if (edge.typeOnly || (edge.kind !== 'static' && edge.kind !== 'export-from')) continue;\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'file') out.add(target.path);\n }\n edges.set(path, [...out].sort());\n }\n\n // Tarjan's strongly connected components, iterative so a deep import chain cannot overflow.\n let counter = 0;\n const index = new Map();\n const low = new Map();\n const stack = [];\n const onStack = new Set();\n const groups = [];\n for (const start of [...edges.keys()].sort()) {\n if (index.has(start)) continue;\n const work = [{ node: start, next: 0 }];\n index.set(start, counter);\n low.set(start, counter);\n counter += 1;\n stack.push(start);\n onStack.add(start);\n while (work.length) {\n const frame = work[work.length - 1];\n const targets = edges.get(frame.node) ?? [];\n if (frame.next < targets.length) {\n const target = targets[frame.next];\n frame.next += 1;\n if (!index.has(target)) {\n index.set(target, counter);\n low.set(target, counter);\n counter += 1;\n stack.push(target);\n onStack.add(target);\n work.push({ node: target, next: 0 });\n } else if (onStack.has(target)) {\n low.set(frame.node, Math.min(low.get(frame.node), index.get(target)));\n }\n continue;\n }\n work.pop();\n if (work.length) {\n const parent = work[work.length - 1].node;\n low.set(parent, Math.min(low.get(parent), low.get(frame.node)));\n }\n if (low.get(frame.node) === index.get(frame.node)) {\n const group = [];\n let member;\n do {\n member = stack.pop();\n onStack.delete(member);\n group.push(member);\n } while (member !== frame.node);\n if (group.length > 1 || (edges.get(frame.node) ?? []).includes(frame.node))\n groups.push(group.sort());\n }\n }\n }\n\n return groups\n .map((group) => {\n const members = new Set(group);\n const first = group[0];\n // The shortest way back to the group's first module, through the group alone.\n const previous = new Map([[first, null]]);\n const queue = [first];\n let closing = null;\n while (queue.length && !closing) {\n const node = queue.shift();\n for (const target of edges.get(node) ?? []) {\n if (!members.has(target)) continue;\n if (target === first) {\n closing = node;\n break;\n }\n if (!previous.has(target)) {\n previous.set(target, node);\n queue.push(target);\n }\n }\n }\n const path = [];\n for (let node = closing; node !== null; node = previous.get(node)) path.unshift(node);\n return { file: first, modules: group, path: [...path, first] };\n })\n .sort((a, b) => (a.file < b.file ? -1 : 1));\n}\n\nfunction buildModel(files, roots, profile) {\n const modules = new Map();\n // A module's entry is its text, or the reader's view of it ({ text, sourceFile }).\n for (const [path, entry] of files) {\n modules.set(path, {\n parsed:\n typeof entry === 'string'\n ? parseModule(path, entry)\n : parseModule(path, entry.text, entry.sourceFile),\n });\n }\n const exceptionFiles = new Set(profile.exceptions.map((e) => e.file));\n /** folder → its index module (exceptions are not folder entry points). */\n const indexDirs = new Map();\n for (const path of modules.keys()) {\n if (isIndexFile(path, profile) && !exceptionFiles.has(path)) {\n const dir = dirnameOf(path);\n if (indexDirs.has(dir))\n throw new Error(\n `repo-guards: ${dir}/ has two index modules (${indexDirs.get(dir)}, ${path})`,\n );\n indexDirs.set(dir, path);\n }\n }\n const normalizedRoots = roots.map((r) => normalizePath(r).path);\n const aliases = Object.entries(profile.importAliases).sort((a, b) => b[0].length - a[0].length);\n\n const resolveCache = new Map();\n function resolve(from, spec) {\n const key = `${from}\\0${spec}`;\n if (resolveCache.has(key)) return resolveCache.get(key);\n let base = null;\n for (const [prefix, target] of aliases) {\n if (spec === prefix.replace(/\\/$/, '') || spec.startsWith(prefix)) {\n base = normalizePath(`${target}/${spec.slice(prefix.length)}`).path;\n break;\n }\n }\n if (\n base === null &&\n (spec === '.' || spec === '..' || spec.startsWith('./') || spec.startsWith('../'))\n ) {\n base = normalizePath(`${dirnameOf(from)}/${spec}`).path;\n }\n let result;\n if (base === null) {\n result = { kind: 'package' };\n } else {\n const found = findModule(base);\n if (found) result = { kind: 'file', path: found };\n else {\n const ext = extensionOf(base);\n if (ext && !profile.codeExtensions.includes(ext)) result = { kind: 'asset' };\n else if (normalizedRoots.some((r) => within(base, r) || base === r))\n result = { kind: 'unresolved', base };\n else result = { kind: 'outside' };\n }\n }\n resolveCache.set(key, result);\n return result;\n }\n function findModule(base) {\n if (modules.has(base)) return base;\n const ext = extensionOf(base);\n if (EMITTED_TO_SOURCE[ext]) {\n const stem = base.slice(0, -ext.length);\n for (const src of EMITTED_TO_SOURCE[ext]) if (modules.has(stem + src)) return stem + src;\n }\n for (const e of profile.codeExtensions) if (modules.has(base + e)) return base + e;\n for (const e of profile.codeExtensions)\n if (modules.has(`${base}/index${e}`)) return `${base}/index${e}`;\n return null;\n }\n\n /** Every index whose folder holds `target` but not `from`, innermost first; `target` is never its own crossing. */\n function indexesCrossed(from, target) {\n const out = [];\n for (let dir = dirnameOf(target); ; dir = dirnameOf(dir)) {\n const indexPath = indexDirs.get(dir);\n if (indexPath && !within(from, dir) && indexPath !== target) out.push(indexPath);\n if (within(from, dir) || dir === '') break;\n }\n return out;\n }\n /** The folder whose index `target` is, when that folder also contains `from`. */\n function ownIndexCrossing(from, target) {\n const dir = dirnameOf(target);\n return indexDirs.get(dir) === target && within(from, dir) && from !== target ? dir : null;\n }\n\n const exportCache = new Map();\n /** Every name `path` exports, its forwards followed. */\n function exportedNames(path, seen = new Set()) {\n if (exportCache.has(path)) return exportCache.get(path);\n if (seen.has(path)) return new Set();\n seen.add(path);\n const mod = modules.get(path);\n const names = new Set(mod ? mod.parsed.ownExports : []);\n for (const re of mod ? mod.parsed.reExports : []) {\n if (re.form === 'star') {\n const t = resolve(path, re.spec);\n if (t.kind === 'file')\n for (const n of exportedNames(t.path, seen)) if (n !== 'default') names.add(n);\n } else names.add(re.name);\n }\n exportCache.set(path, names);\n return names;\n }\n\n /** Does `indexPath` forward, directly or through a nested index, any of `names` defined in `target`? */\n function forwardsFrom(indexPath, target, names, seen = new Set()) {\n if (seen.has(indexPath)) return false;\n seen.add(indexPath);\n const wanted = names === '*' ? null : new Set(names);\n for (const re of modules.get(indexPath)?.parsed.reExports ?? []) {\n const t = resolve(indexPath, re.spec);\n if (t.kind !== 'file') continue;\n if (t.path === target) {\n if (!wanted || re.form === 'star' || re.form === 'namespace') {\n if (!wanted || [...wanted].some((n) => exportedNames(target).has(n))) return true;\n } else if (wanted.has(re.imported)) return true;\n } else if (indexDirs.get(dirnameOf(t.path)) === t.path && within(target, dirnameOf(t.path))) {\n if (forwardsFrom(t.path, target, names, seen)) return true;\n }\n }\n return false;\n }\n\n return {\n modules,\n exceptionFiles,\n indexDirs,\n resolve,\n indexesCrossed,\n ownIndexCrossing,\n exportedNames,\n forwardsFrom,\n };\n}\n\n/** A printable report of `analyzeImportPaths`' result. */\nexport function formatImportPathReport({ violations }) {\n if (!violations.length) return 'import-path guard: clean — every definition has one import path.';\n const lines = [`import-path guard: ${violations.length} violation(s)`];\n for (const v of violations) lines.push(` [${v.kind}] ${v.file} — ${v.detail}`);\n return lines.join('\\n');\n}\n"]}
|
|
1
|
+
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../../src/modules/import-paths/analyzer.js"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,0EAA0E;AAC1E,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,+FAA+F;AAC/F,oCAAoC;AACpC,mGAAmG;AACnG,gGAAgG;AAChG,kGAAkG;AAClG,+BAA+B;AAC/B,oGAAoG;AACpG,sFAAsF;AACtF,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,EAAE;AACF,gGAAgG;AAChG,4FAA4F;AAE5F,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,aAA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,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO;QACL,OAAO;QACP,cAAc;QACd,SAAS;QACT,OAAO;QACP,cAAc;QACd,gBAAgB;QAChB,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,sBAAsB,CAAC,EAAE,UAAU,EAAE;IACnD,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,OAAO,kEAAkE,CAAC;IAClG,MAAM,KAAK,GAAG,CAAC,sBAAsB,UAAU,CAAC,MAAM,eAAe,CAAC,CAAC;IACvE,KAAK,MAAM,CAAC,IAAI,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAChF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// The import-path guard: every definition has exactly one import path.\n//\n// Four structural facts, checked over an app's module set held in memory:\n//\n// 1. A module that is not a folder `index` never re-exports — value or type, named, aliased,\n// star, or the two-statement `import { x } …; export { x }`. Its consumers import the owner.\n// 2. A folder `index` forwards only modules inside its own folder's subtree — never a module\n// outside it, never a package.\n// 3. Code outside a folder that has an `index` imports through that index, never past it. A test\n// may import a file inside the folder only for names the index does not forward from it. A\n// test's module mocks (`vi.mock` and kin) name the path the code under test imports, so they\n// are never held to this.\n// 4. Code inside a folder never imports the `index` of a folder that contains it — it imports its\n// siblings directly, so a folder entry point can never import itself in a cycle.\n//\n// An exception (a framework entry module such as a deploy manifest) may re-export and is not a\n// folder entry point. Each one carries a justification, and one that stops re-exporting is stale.\n//\n// Whether an index member is still imported by anything outside its folder is a usage question,\n// not a boundary, so it is a separate report (`findUnusedIndexMembers`), never a violation.\n\nimport ts from 'typescript';\nimport { moduleImports } from '../../support/imports.js';\nimport { reviewedProblems } from '../../support/facts.js';\nimport { dirnameOf, normalizePath } from '../../support/paths.js';\nimport { isUnder } from '../../support/text.js';\n\n/** Every violation kind the guard reports. */\nexport const IMPORT_PATH_VIOLATION_KINDS = Object.freeze([\n 'reexport-outside-index',\n 'index-forwards-outside-folder',\n 'import-past-index',\n 'import-through-own-index',\n 'unresolved-import',\n 'stale-exception',\n 'stale-exclusion',\n]);\n\nconst DEFAULT_CODE_EXTENSIONS = Object.freeze([\n '.ts',\n '.tsx',\n '.mts',\n '.cts',\n '.js',\n '.jsx',\n '.mjs',\n '.cjs',\n]);\n// TypeScript's ESM convention writes the emitted extension in the specifier: `./x.js` names `x.ts`.\nconst EMITTED_TO_SOURCE = Object.freeze({\n '.js': ['.ts', '.tsx'],\n '.jsx': ['.tsx'],\n '.mjs': ['.mts'],\n '.cjs': ['.cts'],\n});\n\nconst extensionOf = (p) => {\n const base = p.slice(p.lastIndexOf('/') + 1);\n const dot = base.lastIndexOf('.');\n return dot <= 0 ? '' : base.slice(dot);\n};\n\nconst defaultIsTestFile = (p) =>\n /\\.(test|spec)\\.[cm]?[jt]sx?$/.test(p) || p.split('/').includes('__tests__');\n\n/**\n * Everything the guard knows about one app.\n *\n * @param {{\n * importAliases?: Record<string, string>,\n * exceptions?: Array<{ file: string, why: string }>,\n * codeExtensions?: string[],\n * isTestFile?: (path: string) => boolean,\n * isExcludedModule?: (path: string) => boolean,\n * }} [options]\n * `importAliases` maps a specifier prefix to a repo-relative folder (`{ '@/': 'src/' }`).\n * `exceptions` names the framework entry modules that may re-export; every one needs a `why`.\n * `isTestFile` decides which modules are tests (default: a `.test.` / `.spec.` name, or any\n * `__tests__` folder on the path).\n * `isExcludedModule` says whether a module file exists inside a path the analyzed set leaves out\n * on purpose; an import of one resolves without being judged, the way a package import does.\n */\nexport function createImportPathProfile({\n importAliases = {},\n exceptions = [],\n codeExtensions = DEFAULT_CODE_EXTENSIONS,\n isTestFile = defaultIsTestFile,\n isExcludedModule = () => false,\n} = {}) {\n const problems = [];\n reviewedProblems(exceptions, 'exceptions', problems, { key: 'file' });\n if (problems.length)\n throw new Error(\n `repo-guards: the import-path exceptions are malformed: ${problems.join('; ')}`,\n );\n for (const [prefix, target] of Object.entries(importAliases)) {\n if (!prefix || typeof target !== 'string') {\n throw new Error(`repo-guards: alias ${JSON.stringify(prefix)} needs a target folder`);\n }\n }\n return Object.freeze({\n importAliases: Object.freeze({ ...importAliases }),\n exceptions: Object.freeze(exceptions.map((e) => Object.freeze({ file: e.file, why: e.why }))),\n codeExtensions: Object.freeze([...codeExtensions]),\n isTestFile,\n isExcludedModule,\n });\n}\n\nfunction scriptKindOf(path) {\n const ext = extensionOf(path);\n if (ext === '.tsx') return ts.ScriptKind.TSX;\n if (ext === '.jsx') return ts.ScriptKind.JSX;\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') return ts.ScriptKind.JS;\n return ts.ScriptKind.TS;\n}\n\nconst hasExportModifier = (node) =>\n ts.canHaveModifiers(node) &&\n (ts.getModifiers(node) ?? []).some((m) => m.kind === ts.SyntaxKind.ExportKeyword);\nconst hasDefaultModifier = (node) =>\n ts.canHaveModifiers(node) &&\n (ts.getModifiers(node) ?? []).some((m) => m.kind === ts.SyntaxKind.DefaultKeyword);\n\n/** The names a dynamic import or `require` reads, when the code says; `'*'` when it does not. */\nfunction namesReadFromCall(call) {\n let node = call;\n if (ts.isAwaitExpression(node.parent)) node = node.parent;\n while (ts.isParenthesizedExpression(node.parent)) node = node.parent;\n const parent = node.parent;\n if (\n ts.isVariableDeclaration(parent) &&\n parent.initializer === node &&\n ts.isObjectBindingPattern(parent.name)\n ) {\n const names = [];\n for (const el of parent.name.elements) {\n if (el.dotDotDotToken) return '*';\n const key = el.propertyName ?? el.name;\n if (!ts.isIdentifier(key) && !ts.isStringLiteral(key)) return '*';\n names.push(key.text);\n }\n return names;\n }\n if (ts.isPropertyAccessExpression(parent) && parent.expression === node)\n return [parent.name.text];\n return '*';\n}\n\nconst isClassExtends = (node) =>\n ts.isHeritageClause(node.parent) &&\n node.parent.token === ts.SyntaxKind.ExtendsKeyword &&\n (ts.isClassDeclaration(node.parent.parent) || ts.isClassExpression(node.parent.parent));\n\n/** A declaration's own name, or a property name read off an object — never a reference to a binding. */\nfunction isNameNotReference(node) {\n const p = node.parent;\n if (!p) return false;\n if (ts.isPropertyAccessExpression(p) || ts.isQualifiedName(p))\n return p.name === node || p.right === node;\n return (\n (ts.isPropertyAssignment(p) ||\n ts.isPropertyDeclaration(p) ||\n ts.isMethodDeclaration(p) ||\n ts.isGetAccessorDeclaration(p) ||\n ts.isSetAccessorDeclaration(p) ||\n ts.isEnumMember(p) ||\n ts.isBindingElement(p) ||\n ts.isLabeledStatement(p) ||\n ts.isJsxAttribute(p)) &&\n p.name === node\n );\n}\n\n/**\n * Every name the module reads as a value. An imported binding read only in type positions is erased\n * by the build, so its import loads nothing at run time.\n */\nfunction valueReferencedNames(sf) {\n const used = new Set();\n const visit = (node) => {\n if (ts.isImportDeclaration(node) || ts.isImportEqualsDeclaration(node)) return;\n if (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) return;\n if (ts.isExpressionWithTypeArguments(node)) {\n if (isClassExtends(node)) visit(node.expression);\n return;\n }\n if (ts.isTypeNode(node)) return;\n if (ts.isExportDeclaration(node)) {\n if (\n node.isTypeOnly ||\n node.moduleSpecifier ||\n !node.exportClause ||\n !ts.isNamedExports(node.exportClause)\n )\n return;\n for (const el of node.exportClause.elements)\n if (!el.isTypeOnly) used.add((el.propertyName ?? el.name).text);\n return;\n }\n if (ts.isIdentifier(node)) {\n if (!isNameNotReference(node)) used.add(node.text);\n return;\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return used;\n}\n\n/**\n * One module's import edges, re-exports, and exported names. An edge is `typeOnly` when the build\n * erases it: written type-only, or binding only names the module reads in type positions.\n *\n * @param {string} path repo-relative, forward-slashed\n * @param {string} text\n * @param {import('typescript').SourceFile | null} [sourceFile] the file already parsed\n */\nexport function parseModule(path, text, sourceFile = null) {\n // A module the reader already parsed is never parsed a second time.\n const sf =\n sourceFile ?? ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, scriptKindOf(path));\n /** @type {Array<{ spec: string, kind: 'static' | 'dynamic' | 'mock' | 'export-from', names: string[] | '*', typeOnly: boolean }>} */\n const imports = [];\n let valueNames = null;\n const readAsValue = (local) => (valueNames ??= valueReferencedNames(sf)).has(local);\n /** @type {Array<{ spec: string, name: string, imported: string, form: 'named' | 'aliased' | 'star' | 'namespace' | 'two-statement' }>} */\n const reExports = [];\n /** Names this module exports from its own declarations (not forwards). */\n const ownExports = new Set();\n const importedBindings = new Map();\n\n const sites = moduleImports(sf);\n for (const site of sites) {\n if (!site.topLevel) continue;\n const { spec } = site;\n if (site.kind === 'import') {\n const names = [];\n const valueLocals = [];\n if (site.defaultName) {\n names.push('default');\n importedBindings.set(site.defaultName, { spec, imported: 'default' });\n valueLocals.push(site.defaultName);\n }\n if (site.namespace) {\n importedBindings.set(site.namespace, { spec, imported: '*' });\n valueLocals.push(site.namespace);\n }\n for (const { imported, local, typeOnly } of site.named) {\n names.push(imported);\n importedBindings.set(local, { spec, imported });\n if (!typeOnly) valueLocals.push(local);\n }\n const typeOnly = site.typeOnly || (!site.sideEffect && !valueLocals.some(readAsValue));\n imports.push({ spec, kind: 'static', names: site.namespace ? '*' : names, typeOnly });\n } else if (site.kind === 'importEquals') {\n imports.push({ spec, kind: 'static', names: '*', typeOnly: site.typeOnly });\n }\n }\n\n const exportFrom = new Map(\n sites\n .filter((site) => site.kind === 'export' && site.topLevel)\n .map((site) => [site.node, site]),\n );\n for (const stmt of sf.statements) {\n if (ts.isExportDeclaration(stmt)) {\n const site = exportFrom.get(stmt);\n const clause = stmt.exportClause;\n if (site) {\n const { spec } = site;\n if (site.star) {\n reExports.push(\n site.namespace\n ? { spec, name: site.namespace, imported: '*', form: 'namespace' }\n : { spec, name: '*', imported: '*', form: 'star' },\n );\n imports.push({ spec, kind: 'export-from', names: '*', typeOnly: site.typeOnly });\n } else {\n for (const { imported, local } of site.named) {\n reExports.push({\n spec,\n name: local,\n imported,\n form: imported === local ? 'named' : 'aliased',\n });\n }\n const typeOnly =\n site.typeOnly || (site.named.length > 0 && site.named.every((n) => n.typeOnly));\n imports.push({\n spec,\n kind: 'export-from',\n names: site.named.map((n) => n.imported),\n typeOnly,\n });\n }\n } else if (clause && ts.isNamedExports(clause)) {\n for (const el of clause.elements) {\n const local = (el.propertyName ?? el.name).text;\n const binding = importedBindings.get(local);\n if (binding) {\n reExports.push({\n spec: binding.spec,\n name: el.name.text,\n imported: binding.imported,\n form: 'two-statement',\n });\n } else {\n ownExports.add(el.name.text);\n }\n }\n }\n } else if (ts.isExportAssignment(stmt) && !stmt.isExportEquals) {\n const expr = stmt.expression;\n const binding = ts.isIdentifier(expr) ? importedBindings.get(expr.text) : undefined;\n if (binding)\n reExports.push({\n spec: binding.spec,\n name: 'default',\n imported: binding.imported,\n form: 'two-statement',\n });\n else ownExports.add('default');\n } else if (hasExportModifier(stmt)) {\n if (ts.isVariableStatement(stmt)) {\n const add = (name) => {\n if (ts.isIdentifier(name)) ownExports.add(name.text);\n else for (const el of name.elements) if (ts.isBindingElement(el)) add(el.name);\n };\n for (const d of stmt.declarationList.declarations) add(d.name);\n } else if (hasDefaultModifier(stmt)) {\n ownExports.add('default');\n } else if (stmt.name && (ts.isIdentifier(stmt.name) || ts.isStringLiteral(stmt.name))) {\n ownExports.add(stmt.name.text);\n }\n }\n }\n\n for (const { kind, node, spec } of sites) {\n if (kind === 'dynamic' || kind === 'require')\n imports.push({ spec, kind: 'dynamic', names: namesReadFromCall(node), typeOnly: false });\n else if (kind === 'mock') imports.push({ spec, kind: 'mock', names: '*', typeOnly: false });\n else if (kind === 'importType') {\n const q = node.qualifier;\n const first = q\n ? ts.isIdentifier(q)\n ? q.text\n : q.left && ts.isIdentifier(q.left)\n ? q.left.text\n : null\n : null;\n imports.push({ spec, kind: 'static', names: first ? [first] : '*', typeOnly: true });\n }\n }\n\n return { imports, reExports, ownExports };\n}\n\nfunction isIndexFile(path, profile) {\n const base = path.slice(path.lastIndexOf('/') + 1);\n const ext = extensionOf(base);\n return (\n base.slice(0, base.length - ext.length) === 'index' && profile.codeExtensions.includes(ext)\n );\n}\n\n/** Under a folder, the repository root (`''`) holding everything. */\nconst within = (path, dir) => dir === '' || isUnder(path, dir);\n\n/**\n * The guard over an in-memory module set.\n *\n * @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input\n * `files` maps every analyzed module (repo-relative, forward-slashed) to its text; `roots` are the\n * analyzed folders. A local specifier that resolves under a root to no analyzed module is\n * `unresolved-import` — the guard never treats a path it cannot read as clean — unless the\n * profile's `isExcludedModule` says the module exists inside a path left out on purpose.\n */\nexport function analyzeImportPaths({ files, roots, profile }) {\n if (!profile) throw new Error('repo-guards: analyzeImportPaths needs a profile');\n if (!Array.isArray(roots) || roots.length === 0)\n throw new Error('repo-guards: analyzeImportPaths needs its roots');\n const model = buildModel(files, roots, profile);\n const violations = [];\n const add = (kind, file, detail) => violations.push({ kind, file, detail });\n\n for (const exception of profile.exceptions) {\n const mod = model.modules.get(exception.file);\n if (!mod)\n add(\n 'stale-exception',\n exception.file,\n 'the exception names a module that is not in the analyzed trees',\n );\n else if (mod.parsed.reExports.length === 0)\n add(\n 'stale-exception',\n exception.file,\n 'the exception names a module that no longer re-exports anything',\n );\n }\n\n for (const [path, mod] of model.modules) {\n const exception = model.exceptionFiles.has(path);\n const index = model.indexDirs.get(dirnameOf(path)) === path;\n\n for (const re of mod.parsed.reExports) {\n const target = model.resolve(path, re.spec);\n if (target.kind === 'unresolved') continue; // reported once, on the import edge below\n if (exception) continue;\n const shown =\n re.form === 'star'\n ? `* from '${re.spec}'`\n : `${re.imported === re.name ? re.name : `${re.imported} as ${re.name}`} from '${re.spec}'`;\n if (!index) {\n add('reexport-outside-index', path, `${re.form} re-export of ${shown}`);\n } else if (target.kind === 'excluded') {\n continue;\n } else if (target.kind !== 'file' || !within(target.path, dirnameOf(path))) {\n add(\n 'index-forwards-outside-folder',\n path,\n `forwards ${shown}, which is outside ${dirnameOf(path) || 'the repo root'}/`,\n );\n }\n }\n\n const test = profile.isTestFile(path);\n for (const edge of mod.parsed.imports) {\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'unresolved') {\n add(\n 'unresolved-import',\n path,\n `'${edge.spec}' names no module under the analyzed trees (looked for ${target.base})`,\n );\n continue;\n }\n if (target.kind !== 'file' || target.path === path) continue;\n\n const own = model.ownIndexCrossing(path, target.path);\n if (own) {\n add(\n 'import-through-own-index',\n path,\n `imports '${edge.spec}', the entry point of ${own}/ which contains it — import the sibling module directly`,\n );\n continue;\n }\n if (edge.kind === 'mock' && test) continue;\n // A non-index forward is already a violation above; an exception's forwards are allowed. An\n // index's own forward still may not reach past a nested folder's index.\n if (edge.kind === 'export-from' && (!index || exception)) continue;\n const crossed = model.indexesCrossed(path, target.path);\n if (!crossed.length) continue;\n const outer = crossed[crossed.length - 1];\n if (\n test &&\n !crossed.some((indexPath) => model.forwardsFrom(indexPath, target.path, edge.names))\n )\n continue;\n add(\n 'import-past-index',\n path,\n `imports '${edge.spec}' past ${outer} — import it through that entry point`,\n );\n }\n }\n\n violations.sort((a, b) =>\n a.file === b.file ? (a.detail < b.detail ? -1 : 1) : a.file < b.file ? -1 : 1,\n );\n return { violations, stats: { modules: model.modules.size, indexes: model.indexDirs.size } };\n}\n\n/**\n * Report-only: index members no module outside the index's folder imports. Never a violation —\n * whether a member is used is a usage question, not a boundary.\n */\nexport function findUnusedIndexMembers({ files, roots, profile }) {\n const model = buildModel(files, roots, profile);\n const used = new Map();\n for (const indexPath of model.indexDirs.values()) used.set(indexPath, new Set());\n for (const [path, mod] of model.modules) {\n for (const edge of mod.parsed.imports) {\n if (edge.kind === 'mock') continue;\n const target = model.resolve(path, edge.spec);\n if (target.kind !== 'file' || !used.has(target.path)) continue;\n if (within(path, dirnameOf(target.path))) continue;\n const set = used.get(target.path);\n if (edge.names === '*') set.add('*');\n else for (const n of edge.names) set.add(n);\n }\n }\n const report = [];\n for (const [indexPath, set] of used) {\n if (set.has('*')) continue;\n const unused = [...model.exportedNames(indexPath)].filter((n) => !set.has(n)).sort();\n if (unused.length) report.push({ file: indexPath, unused });\n }\n return report.sort((a, b) => (a.file < b.file ? -1 : 1));\n}\n\n/** The one kind of test that may import an entry index: one that proves the entry forwards a name. */\nconst ENTRY_SURFACE_TEST = /\\.entry\\.(test|spec)\\.[cm]?[jt]sx?$/;\n\n// The extension a module's built file carries, which is the one a relative specifier names it by.\nconst BUILT_EXTENSION = Object.freeze({\n '.ts': '.js',\n '.tsx': '.js',\n '.js': '.js',\n '.jsx': '.jsx',\n '.mts': '.mjs',\n '.mjs': '.mjs',\n '.cts': '.cjs',\n '.cjs': '.cjs',\n});\n\nconst isRelative = (spec) =>\n spec === '.' || spec === '..' || spec.startsWith('./') || spec.startsWith('../');\n\n/** The specifier that names `targetPath` by its built file, written the way `spec` reaches it. */\nfunction specifierWithExtension(spec, targetPath) {\n const built = BUILT_EXTENSION[extensionOf(targetPath)];\n const targetBase = targetPath.slice(targetPath.lastIndexOf('/') + 1);\n const stem = targetBase.slice(0, targetBase.length - extensionOf(targetBase).length);\n const trimmed = spec.replace(/\\/$/, '');\n const specBase = trimmed.slice(trimmed.lastIndexOf('/') + 1);\n // A specifier naming a folder reaches its index; one naming a file carries the file's stem.\n if (stem === 'index' && specBase !== 'index' && extensionOf(specBase) === '')\n return `${trimmed}/index${built}`;\n const specExt = extensionOf(specBase);\n return `${specExt ? trimmed.slice(0, -specExt.length) : trimmed}${built}`;\n}\n\n/**\n * The import rules inside one package, over its module set:\n *\n * 1. Code imports the file that defines each name — never an index (a folder's, a nested\n * entry's, or the package root's) and never the package's own name. A test does the same,\n * except an entry-surface test (`<name>.entry.test.ts`), which may import an entry index.\n * 2. Only an entry index re-exports, and only files inside its own folder, each named directly\n * (never through another index). An index declares nothing of its own, and an `index` that is\n * not a package entry does not exist.\n * 3. Every relative specifier names its file with the file's built extension — `./x.js` for\n * `x.ts` or `x.tsx`, `./folder/index.js` for a folder — in source and tests alike: a static\n * import or `export … from`, an `import()`, and a test runner's module mock.\n *\n * @param {{\n * files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>,\n * packageRoot: string,\n * packageName: string,\n * entryFiles: string[],\n * profile: ReturnType<typeof createImportPathProfile>,\n * }} input\n * `packageRoot` is the package's repo-relative folder; `entryFiles` are the source modules its\n * `exports` are built from.\n */\nexport function analyzePackageImports({ files, packageRoot, packageName, entryFiles, profile }) {\n if (!profile) throw new Error('repo-guards: analyzePackageImports needs a profile');\n const model = buildModel(files, [packageRoot], profile);\n const entries = new Set(entryFiles);\n const source = `${packageRoot}/src`;\n const violations = [];\n const add = (kind, file, detail) => violations.push({ kind, file, detail });\n const ownName = (spec) => spec === packageName || spec.startsWith(`${packageName}/`);\n // Only the package's own code has indexes the rules govern; an index a test fixture holds models\n // another package's entry.\n const packageIndex = (p) => isIndexFile(p, profile) && within(p, source);\n\n for (const [path, mod] of model.modules) {\n const indexFile = packageIndex(path);\n const entryIndex = indexFile && entries.has(path);\n if (indexFile && !entryIndex) {\n add(\n 'non-entry-index',\n path,\n 'an index that is not a package entry — delete it and import the files it forwarded directly',\n );\n }\n if (entryIndex && mod.parsed.ownExports.size) {\n const names = [...mod.parsed.ownExports].sort().join(', ');\n add(\n 'index-declares',\n path,\n `declares ${names} — an index only forwards; move each definition into a named file and forward that file`,\n );\n }\n\n const forwardedSpecs = new Set();\n for (const re of mod.parsed.reExports) {\n forwardedSpecs.add(re.spec);\n const shown =\n re.form === 'star'\n ? `* from '${re.spec}'`\n : `${re.imported === re.name ? re.name : `${re.imported} as ${re.name}`} from '${re.spec}'`;\n if (!entryIndex) {\n // A non-entry index is reported once, as itself: deleting it removes its forwards too.\n if (!indexFile)\n add(\n 'reexport-outside-entry',\n path,\n `${re.form} re-export of ${shown} — only an entry index re-exports`,\n );\n continue;\n }\n const target = model.resolve(path, re.spec);\n if (target.kind === 'unresolved') continue; // reported once, on the import edge below\n if (target.kind !== 'file' || !within(target.path, dirnameOf(path))) {\n add(\n 'entry-forwards-outside-folder',\n path,\n `forwards ${shown}, which is outside ${dirnameOf(path)}/`,\n );\n } else if (packageIndex(target.path)) {\n add(\n 'entry-forwards-index',\n path,\n `forwards ${shown}, an index — name the file that defines it`,\n );\n }\n }\n\n const entrySurfaceTest = profile.isTestFile(path) && ENTRY_SURFACE_TEST.test(path);\n for (const edge of mod.parsed.imports) {\n if (ownName(edge.spec)) {\n add(\n 'import-own-package-name',\n path,\n `imports '${edge.spec}', the package's own name — import the file that defines each name`,\n );\n continue;\n }\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'unresolved') {\n add(\n 'unresolved-import',\n path,\n `'${edge.spec}' names no module in the package (looked for ${target.base})`,\n );\n continue;\n }\n if (target.kind === 'file' && isRelative(edge.spec)) {\n const named = specifierWithExtension(edge.spec, target.path);\n if (named !== edge.spec) {\n add(\n 'relative-import-without-extension',\n path,\n `imports '${edge.spec}' — a relative import names its file with its built extension: '${named}'`,\n );\n }\n }\n if (target.kind !== 'file' || target.path === path || !packageIndex(target.path)) continue;\n // A forward is judged as a re-export above.\n if (edge.kind === 'export-from' || (entryIndex && forwardedSpecs.has(edge.spec))) continue;\n if (entrySurfaceTest && entries.has(target.path)) continue;\n add(\n 'import-through-index',\n path,\n `imports '${edge.spec}', an index — import the file that defines each name`,\n );\n }\n }\n\n violations.sort((a, b) =>\n a.file === b.file ? (a.detail < b.detail ? -1 : 1) : a.file < b.file ? -1 : 1,\n );\n return { violations };\n}\n\n/**\n * Every runtime import cycle among a module set: the strongly connected groups of its static\n * imports and forwards, type-only edges and lazy `import()` left out (neither runs while a module\n * evaluates). Each cycle is reported once, as one closed path through it.\n *\n * @param {{ files: Map<string, string | { text: string, sourceFile: import('typescript').SourceFile }>, roots: string[], profile: ReturnType<typeof createImportPathProfile> }} input\n */\nexport function findImportCycles({ files, roots, profile }) {\n const model = buildModel(files, roots, profile);\n const edges = new Map();\n for (const [path, mod] of model.modules) {\n const out = new Set();\n for (const edge of mod.parsed.imports) {\n if (edge.typeOnly || (edge.kind !== 'static' && edge.kind !== 'export-from')) continue;\n const target = model.resolve(path, edge.spec);\n if (target.kind === 'file') out.add(target.path);\n }\n edges.set(path, [...out].sort());\n }\n\n // Tarjan's strongly connected components, iterative so a deep import chain cannot overflow.\n let counter = 0;\n const index = new Map();\n const low = new Map();\n const stack = [];\n const onStack = new Set();\n const groups = [];\n for (const start of [...edges.keys()].sort()) {\n if (index.has(start)) continue;\n const work = [{ node: start, next: 0 }];\n index.set(start, counter);\n low.set(start, counter);\n counter += 1;\n stack.push(start);\n onStack.add(start);\n while (work.length) {\n const frame = work[work.length - 1];\n const targets = edges.get(frame.node) ?? [];\n if (frame.next < targets.length) {\n const target = targets[frame.next];\n frame.next += 1;\n if (!index.has(target)) {\n index.set(target, counter);\n low.set(target, counter);\n counter += 1;\n stack.push(target);\n onStack.add(target);\n work.push({ node: target, next: 0 });\n } else if (onStack.has(target)) {\n low.set(frame.node, Math.min(low.get(frame.node), index.get(target)));\n }\n continue;\n }\n work.pop();\n if (work.length) {\n const parent = work[work.length - 1].node;\n low.set(parent, Math.min(low.get(parent), low.get(frame.node)));\n }\n if (low.get(frame.node) === index.get(frame.node)) {\n const group = [];\n let member;\n do {\n member = stack.pop();\n onStack.delete(member);\n group.push(member);\n } while (member !== frame.node);\n if (group.length > 1 || (edges.get(frame.node) ?? []).includes(frame.node))\n groups.push(group.sort());\n }\n }\n }\n\n return groups\n .map((group) => {\n const members = new Set(group);\n const first = group[0];\n // The shortest way back to the group's first module, through the group alone.\n const previous = new Map([[first, null]]);\n const queue = [first];\n let closing = null;\n while (queue.length && !closing) {\n const node = queue.shift();\n for (const target of edges.get(node) ?? []) {\n if (!members.has(target)) continue;\n if (target === first) {\n closing = node;\n break;\n }\n if (!previous.has(target)) {\n previous.set(target, node);\n queue.push(target);\n }\n }\n }\n const path = [];\n for (let node = closing; node !== null; node = previous.get(node)) path.unshift(node);\n return { file: first, modules: group, path: [...path, first] };\n })\n .sort((a, b) => (a.file < b.file ? -1 : 1));\n}\n\nfunction buildModel(files, roots, profile) {\n const modules = new Map();\n // A module's entry is its text, or the reader's view of it ({ text, sourceFile }).\n for (const [path, entry] of files) {\n modules.set(path, {\n parsed:\n typeof entry === 'string'\n ? parseModule(path, entry)\n : parseModule(path, entry.text, entry.sourceFile),\n });\n }\n const exceptionFiles = new Set(profile.exceptions.map((e) => e.file));\n /** folder → its index module (exceptions are not folder entry points). */\n const indexDirs = new Map();\n for (const path of modules.keys()) {\n if (isIndexFile(path, profile) && !exceptionFiles.has(path)) {\n const dir = dirnameOf(path);\n if (indexDirs.has(dir))\n throw new Error(\n `repo-guards: ${dir}/ has two index modules (${indexDirs.get(dir)}, ${path})`,\n );\n indexDirs.set(dir, path);\n }\n }\n const normalizedRoots = roots.map((r) => normalizePath(r).path);\n const aliases = Object.entries(profile.importAliases).sort((a, b) => b[0].length - a[0].length);\n\n const resolveCache = new Map();\n function resolve(from, spec) {\n const key = `${from}\\0${spec}`;\n if (resolveCache.has(key)) return resolveCache.get(key);\n let base = null;\n for (const [prefix, target] of aliases) {\n if (spec === prefix.replace(/\\/$/, '') || spec.startsWith(prefix)) {\n base = normalizePath(`${target}/${spec.slice(prefix.length)}`).path;\n break;\n }\n }\n if (\n base === null &&\n (spec === '.' || spec === '..' || spec.startsWith('./') || spec.startsWith('../'))\n ) {\n base = normalizePath(`${dirnameOf(from)}/${spec}`).path;\n }\n let result;\n if (base === null) {\n result = { kind: 'package' };\n } else {\n const found = findModule(base);\n if (found) result = { kind: 'file', path: found };\n else if (moduleCandidates(base).some(profile.isExcludedModule)) result = { kind: 'excluded' };\n else {\n const ext = extensionOf(base);\n if (ext && !profile.codeExtensions.includes(ext)) result = { kind: 'asset' };\n else if (normalizedRoots.some((r) => within(base, r) || base === r))\n result = { kind: 'unresolved', base };\n else result = { kind: 'outside' };\n }\n }\n resolveCache.set(key, result);\n return result;\n }\n /** Every module file a specifier's resolved base may name, in the order they are tried. */\n function moduleCandidates(base) {\n const out = [base];\n const ext = extensionOf(base);\n if (EMITTED_TO_SOURCE[ext]) {\n const stem = base.slice(0, -ext.length);\n for (const src of EMITTED_TO_SOURCE[ext]) out.push(stem + src);\n }\n for (const e of profile.codeExtensions) out.push(base + e);\n for (const e of profile.codeExtensions) out.push(`${base}/index${e}`);\n return out;\n }\n function findModule(base) {\n return moduleCandidates(base).find((candidate) => modules.has(candidate)) ?? null;\n }\n\n /** Every index whose folder holds `target` but not `from`, innermost first; `target` is never its own crossing. */\n function indexesCrossed(from, target) {\n const out = [];\n for (let dir = dirnameOf(target); ; dir = dirnameOf(dir)) {\n const indexPath = indexDirs.get(dir);\n if (indexPath && !within(from, dir) && indexPath !== target) out.push(indexPath);\n if (within(from, dir) || dir === '') break;\n }\n return out;\n }\n /** The folder whose index `target` is, when that folder also contains `from`. */\n function ownIndexCrossing(from, target) {\n const dir = dirnameOf(target);\n return indexDirs.get(dir) === target && within(from, dir) && from !== target ? dir : null;\n }\n\n const exportCache = new Map();\n /** Every name `path` exports, its forwards followed. */\n function exportedNames(path, seen = new Set()) {\n if (exportCache.has(path)) return exportCache.get(path);\n if (seen.has(path)) return new Set();\n seen.add(path);\n const mod = modules.get(path);\n const names = new Set(mod ? mod.parsed.ownExports : []);\n for (const re of mod ? mod.parsed.reExports : []) {\n if (re.form === 'star') {\n const t = resolve(path, re.spec);\n if (t.kind === 'file')\n for (const n of exportedNames(t.path, seen)) if (n !== 'default') names.add(n);\n } else names.add(re.name);\n }\n exportCache.set(path, names);\n return names;\n }\n\n /** Does `indexPath` forward, directly or through a nested index, any of `names` defined in `target`? */\n function forwardsFrom(indexPath, target, names, seen = new Set()) {\n if (seen.has(indexPath)) return false;\n seen.add(indexPath);\n const wanted = names === '*' ? null : new Set(names);\n for (const re of modules.get(indexPath)?.parsed.reExports ?? []) {\n const t = resolve(indexPath, re.spec);\n if (t.kind !== 'file') continue;\n if (t.path === target) {\n if (!wanted || re.form === 'star' || re.form === 'namespace') {\n if (!wanted || [...wanted].some((n) => exportedNames(target).has(n))) return true;\n } else if (wanted.has(re.imported)) return true;\n } else if (indexDirs.get(dirnameOf(t.path)) === t.path && within(target, dirnameOf(t.path))) {\n if (forwardsFrom(t.path, target, names, seen)) return true;\n }\n }\n return false;\n }\n\n return {\n modules,\n exceptionFiles,\n indexDirs,\n resolve,\n indexesCrossed,\n ownIndexCrossing,\n exportedNames,\n forwardsFrom,\n };\n}\n\n/** A printable report of `analyzeImportPaths`' result. */\nexport function formatImportPathReport({ violations }) {\n if (!violations.length) return 'import-path guard: clean — every definition has one import path.';\n const lines = [`import-path guard: ${violations.length} violation(s)`];\n for (const v of violations) lines.push(` [${v.kind}] ${v.file} — ${v.detail}`);\n return lines.join('\\n');\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../src/modules/import-paths/guard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAIzE,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,yFAAyF;IACzF,UAAU,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../src/modules/import-paths/guard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAIzE,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,yFAAyF;IACzF,UAAU,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AA0CD,eAAO,MAAM,eAAe,EAAE,sBAAsB,CAAC,eAAe,CAiCnE,CAAC;AAEF,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,eAAe,GACrB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAM3C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The import-path guard as the suite runs it: the app's code (tests included, since a test's imports
|
|
2
2
|
// are held to the rules too) read through the one reader and handed to the analyzer.
|
|
3
|
-
import { isTestPath } from '../../node/layout.js';
|
|
3
|
+
import { isTestPath, isUnderRoot, kindOfFile } from '../../node/layout.js';
|
|
4
4
|
import { objectProblem, reviewedProblems } from '../../support/facts.js';
|
|
5
5
|
import { analyzeImportPaths, createImportPathProfile, findUnusedIndexMembers } from './analyzer.js';
|
|
6
6
|
const SCOPE = {
|
|
@@ -19,11 +19,21 @@ function analyzedRoots(reader) {
|
|
|
19
19
|
const { app, functions } = reader.layout.roots;
|
|
20
20
|
return [app.path, ...(functions ? [functions.path] : [])];
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* A code file on disk inside a path the layout excludes. The reader never reads it, so an import of
|
|
24
|
+
* it resolves without being judged; a missing file is still an unresolved import.
|
|
25
|
+
*/
|
|
26
|
+
function excludedModuleExists(reader, p) {
|
|
27
|
+
return ((reader.layout.exclusions ?? []).some((e) => isUnderRoot(p, e.path)) &&
|
|
28
|
+
kindOfFile(p.slice(p.lastIndexOf('/') + 1)) === 'code' &&
|
|
29
|
+
reader.exists(p));
|
|
30
|
+
}
|
|
22
31
|
function profileFor(reader, facts) {
|
|
23
32
|
return createImportPathProfile({
|
|
24
33
|
importAliases: { ...facts.importAliases },
|
|
25
34
|
exceptions: facts.exceptions.map((e) => ({ ...e })),
|
|
26
35
|
isTestFile: (p) => isTestPath(reader.layout, p),
|
|
36
|
+
isExcludedModule: (p) => excludedModuleExists(reader, p),
|
|
27
37
|
});
|
|
28
38
|
}
|
|
29
39
|
export const importPathGuard = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../../src/modules/import-paths/guard.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,qFAAqF;AAIrF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../../src/modules/import-paths/guard.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,qFAAqF;AAIrF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AASpG,MAAM,KAAK,GAAU;IACnB,KAAK,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;IAC3B,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,CAAC,WAAW,CAAC;CAC7B,CAAC;AAEF,SAAS,WAAW,CAAC,KAAsC;IACzD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyE,CAAC;IACjG,KAAK,MAAM,IAAI,IAAI,KAAK;QACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,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AK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC;QAC5B,OAAO,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC;KACnC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// The import-path guard as the suite runs it: the app's code (tests included, since a test's imports\n// are held to the rules too) read through the one reader and handed to the analyzer.\n\nimport type { Finding, GuardContext } from '../../guard.js';\nimport type { RepoReader, Scope } from '../../node/reader.js';\nimport { isTestPath, isUnderRoot, kindOfFile } from '../../node/layout.js';\nimport type { GenericGuardDefinition } from '../../node/suite/config.js';\nimport { objectProblem, reviewedProblems } from '../../support/facts.js';\nimport { analyzeImportPaths, createImportPathProfile, findUnusedIndexMembers } from './analyzer.js';\n\nexport interface ImportPathFacts {\n /** Specifier prefix → repo-relative folder (`{ '@/': 'src/' }`). */\n importAliases: Readonly<Record<string, string>>;\n /** Framework entry modules that may re-export (a deploy manifest), each with its why. */\n exceptions: ReadonlyArray<{ file: string; why: string }>;\n}\n\nconst SCOPE: Scope = {\n roots: ['app', 'functions'],\n kinds: ['code'],\n tests: true,\n optionalRoots: ['functions'],\n};\n\nfunction readModules(files: ReturnType<RepoReader['files']>) {\n const modules = new Map<string, { text: string; sourceFile: import('typescript').SourceFile }>();\n for (const file of files)\n modules.set(file.path, { text: file.text, sourceFile: file.sourceFile });\n return modules;\n}\n\nfunction analyzedRoots(reader: RepoReader) {\n const { app, functions } = reader.layout.roots;\n return [app.path, ...(functions ? [functions.path] : [])];\n}\n\n/**\n * A code file on disk inside a path the layout excludes. The reader never reads it, so an import of\n * it resolves without being judged; a missing file is still an unresolved import.\n */\nfunction excludedModuleExists(reader: RepoReader, p: string): boolean {\n return (\n (reader.layout.exclusions ?? []).some((e) => isUnderRoot(p, e.path)) &&\n kindOfFile(p.slice(p.lastIndexOf('/') + 1)) === 'code' &&\n reader.exists(p)\n );\n}\n\nfunction profileFor(reader: RepoReader, facts: ImportPathFacts) {\n return createImportPathProfile({\n importAliases: { ...facts.importAliases },\n exceptions: facts.exceptions.map((e) => ({ ...e })),\n isTestFile: (p: string) => isTestPath(reader.layout, p),\n isExcludedModule: (p: string) => excludedModuleExists(reader, p),\n });\n}\n\nexport const importPathGuard: GenericGuardDefinition<ImportPathFacts> = {\n id: 'importPaths',\n absentWhen: false,\n factProblems(facts) {\n const problems: string[] = [];\n objectProblem(facts?.importAliases, 'importAliases', problems);\n reviewedProblems(facts?.exceptions, 'exceptions', problems, { key: 'file' });\n return problems;\n },\n build(facts) {\n return [\n {\n title: 'every definition has exactly one import path',\n description:\n 'A module that is not a folder index never re-exports; a folder index forwards only files inside its folder; ' +\n 'code outside a folder that has an index imports through it, never past it; code inside a folder imports its ' +\n 'siblings directly, never through an index of a folder that contains it. Import the owner — the sibling file or the package.',\n timeoutMs: 120_000,\n run(context: GuardContext): Finding[] {\n const files = context.files(SCOPE);\n const result = analyzeImportPaths({\n files: readModules(files),\n roots: analyzedRoots(context.reader),\n profile: profileFor(context.reader, facts),\n });\n return result.violations.map((v: { kind: string; file: string; detail: string }) => ({\n file: v.file,\n detail: `${v.kind.replace(/-/g, ' ')}: ${v.detail}`,\n }));\n },\n },\n ];\n },\n};\n\n/** Report-only: folder index members nothing outside the folder imports. Never a failure. */\nexport function unusedIndexMembers(\n reader: RepoReader,\n facts: ImportPathFacts,\n): Array<{ file: string; unused: string[] }> {\n return findUnusedIndexMembers({\n files: readModules(reader.files(SCOPE)),\n roots: analyzedRoots(reader),\n profile: profileFor(reader, facts),\n });\n}\n"]}
|
|
@@ -8,6 +8,7 @@ import { type InstalledPackagesAgnosticFacts } from './installed-packages-agnost
|
|
|
8
8
|
import { type LocalOnlyVariablesFacts } from './local-only-variables.js';
|
|
9
9
|
import { type ProjectScriptFacts } from './project-scripts.js';
|
|
10
10
|
import { type SecretBindingFacts } from './secret-bindings.js';
|
|
11
|
+
import { type SharedFakeFacts } from './shared-fakes.js';
|
|
11
12
|
import { type ShellSafeFacts } from './shell-safe.js';
|
|
12
13
|
import { type TestCaseModuleLoadFacts } from './test-case-module-loads.js';
|
|
13
14
|
import { type TestSourceRootFacts } from './test-source-root.js';
|
|
@@ -20,6 +21,7 @@ export interface RepoGuardFacts {
|
|
|
20
21
|
walkerReadFailure: WalkerReadFailureFacts;
|
|
21
22
|
testSourceRoot: TestSourceRootFacts | Absent;
|
|
22
23
|
testCaseModuleLoads: TestCaseModuleLoadFacts;
|
|
24
|
+
sharedFakes: SharedFakeFacts;
|
|
23
25
|
localOnlyVariables: LocalOnlyVariablesFacts;
|
|
24
26
|
workerConfigIsolation: WorkerConfigFacts | Absent;
|
|
25
27
|
workerBoundedBody: WorkerBoundedBodyFacts | Absent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/modules/repo/guards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC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