@procedures/lib 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +23 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +21 -0
- package/dist/module.js.map +1 -1
- package/dist/procedures/lib/graph.d.ts +2 -0
- package/dist/procedures/lib/graph.d.ts.map +1 -1
- package/dist/procedures/lib/graph.js +39 -23
- package/dist/procedures/lib/graph.js.map +1 -1
- package/dist/procedures/lib/import-cycles.d.ts +55 -0
- package/dist/procedures/lib/import-cycles.d.ts.map +1 -0
- package/dist/procedures/lib/import-cycles.js +217 -0
- package/dist/procedures/lib/import-cycles.js.map +1 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +25 -0
- package/dist/types.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +1 -0
- package/src/module.ts +23 -0
- package/src/procedures/lib/graph.ts +36 -22
- package/src/procedures/lib/import-cycles.ts +246 -0
- package/src/types.ts +61 -0
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,OAAO,IAAI,WAAW,EACtB,aAAa,IAAI,gBAAgB,EACjC,mBAAmB,IAAI,mBAAmB,EAC1C,UAAU,IAAI,aAAa,EAC3B,SAAS,IAAI,SAAS,EACvB,MAAM,iBAAiB,CAAC;AAMzB,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,SAAS,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,WA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;CAClD;AAED,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAYrE,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAWvE,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAEvD,CAAC;AAIH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CA4BzD,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -144,6 +144,31 @@ export const LibAuditOutputSchema = z.looseObject({
|
|
|
144
144
|
})
|
|
145
145
|
.describe("The counts"),
|
|
146
146
|
});
|
|
147
|
+
export const LibImportCyclesInputSchema = z.object({
|
|
148
|
+
path: z.string().describe("The folder of the sources, for example packages/web/src"),
|
|
149
|
+
mode: z.enum(["runtime", "declared", "raw"]).optional().describe("The edges to count: runtime (after the import elision, the default), declared or raw"),
|
|
150
|
+
diDecorators: z.array(z.string()).optional().describe("The decorators whose class keeps the types of its constructor parameters at runtime (Angular: Injectable, Component, Directive, Pipe, NgModule)"),
|
|
151
|
+
exclude: z.array(z.string()).optional().describe("The glob patterns of the files to leave out (default: node_modules, declarations and tests)"),
|
|
152
|
+
limits: z
|
|
153
|
+
.object({
|
|
154
|
+
maxFiles: z.number().int().positive().max(20_000).optional().describe("The most files of the call: 20000 at most, and the default. A call with more files is refused before it reads a file."),
|
|
155
|
+
maxFileBytes: z.number().int().positive().max(1024 * 1024).optional().describe("The largest file that the call reads, in bytes: 1 MiB at most, and the default. The result lists each larger file."),
|
|
156
|
+
})
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("Lower limits than the defaults. A higher value is refused."),
|
|
159
|
+
});
|
|
160
|
+
export const LibImportCyclesOutputSchema = z.looseObject({
|
|
161
|
+
path: z.string().describe("The folder of the sources"),
|
|
162
|
+
mode: z.enum(["runtime", "declared", "raw"]).describe("The edges that the call counted"),
|
|
163
|
+
files: z.number().describe("The number of files"),
|
|
164
|
+
edges: z.number().describe("The number of import edges between the files"),
|
|
165
|
+
acyclic: z.boolean().describe("True when the graph has no cycle"),
|
|
166
|
+
components: z.array(z.array(z.string())).describe("Each cycle: the files of a strongly connected component, in name order. The largest cycle comes first."),
|
|
167
|
+
filesInCycles: z.number().describe("The number of files in a cycle"),
|
|
168
|
+
skipped: z
|
|
169
|
+
.array(z.object({ path: z.string().describe("The file, relative to the folder"), bytes: z.number().describe("The size of the file") }))
|
|
170
|
+
.describe("The files larger than limits.maxFileBytes: the call did not read them"),
|
|
171
|
+
});
|
|
147
172
|
export const LibGraphInputSchema = z.object({
|
|
148
173
|
rootPath: z.string().optional().describe("The workspace root (default: the pnpm workspace that contains client-lib)"),
|
|
149
174
|
});
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAE1B,CAAC,CAAC,MAAM,CAAC;IACZ,+EAA+E;IAC/E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;CACrH,CAAC,CAAC;AA8EH,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAK5B,CAAC,CAAC,MAAM,CAAC;IACZ,0CAA0C;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACnE,oCAAoC;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC7D,+EAA+E;IAC/E,QAAQ,EAAE,CAAC,CAAC,M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C;SAC5G,QAAQ,CAAC,+CAA+C,CAAC;CAC7D,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@procedures/lib",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.1",
|
|
5
5
|
"description": "Workspace procedures for pnpm monorepos: scan the packages, graph their dependencies, scaffold a new package, audit packages against a template, and rename across the workspace.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"monorepo",
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"vitest": "^5.0.3"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@procedures/client": "0.13.
|
|
72
|
-
"@procedures/dag": "0.13.
|
|
73
|
-
"@procedures/fs": "0.13.
|
|
74
|
-
"@procedures/git": "0.13.
|
|
75
|
-
"@procedures/pnpm": "0.13.
|
|
76
|
-
"@procedures/shell": "0.13.
|
|
71
|
+
"@procedures/client": "0.13.1",
|
|
72
|
+
"@procedures/dag": "0.13.1",
|
|
73
|
+
"@procedures/fs": "0.13.1",
|
|
74
|
+
"@procedures/git": "0.13.1",
|
|
75
|
+
"@procedures/pnpm": "0.13.1",
|
|
76
|
+
"@procedures/shell": "0.13.1",
|
|
77
77
|
"ts-morph": "^24.0.0",
|
|
78
78
|
"zod": "^4.6.5"
|
|
79
79
|
},
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
libGraph,
|
|
19
19
|
} from "./procedures/lib/index.js";
|
|
20
20
|
export { findCycles } from "./procedures/lib/graph.js";
|
|
21
|
+
export { importCycles, importGraph, ANGULAR_DI_DECORATORS, DEFAULT_IMPORT_EXCLUDE, DEFAULT_IMPORT_CYCLE_LIMITS, type ImportCycleLimits, type ImportCycles, type ImportGraphOptions } from "./procedures/lib/import-cycles.js";
|
|
21
22
|
|
|
22
23
|
// Re-export ecosystem procedures
|
|
23
24
|
export {
|
package/src/module.ts
CHANGED
|
@@ -43,6 +43,8 @@ import {
|
|
|
43
43
|
LibAuditOutputSchema,
|
|
44
44
|
} from "./types.js";
|
|
45
45
|
import { LibGraphInputSchema, LibGraphOutputSchema, type LibGraphInput, type LibGraphOutput } from "./types.js";
|
|
46
|
+
import { LibImportCyclesInputSchema, LibImportCyclesOutputSchema, type LibImportCyclesInput, type LibImportCyclesOutput } from "./types.js";
|
|
47
|
+
import { libImportCycles } from "./procedures/lib/import-cycles.js";
|
|
46
48
|
import type { FsRootRules, ProcedureContext } from "@procedures/client";
|
|
47
49
|
|
|
48
50
|
// =============================================================================
|
|
@@ -57,6 +59,9 @@ import type { FsRootRules, ProcedureContext } from "@procedures/client";
|
|
|
57
59
|
*/
|
|
58
60
|
const WORKSPACE_IN_A_ROOT: FsRootRules = { cwd: "rootPath" };
|
|
59
61
|
|
|
62
|
+
/** `lib.importCycles`: the folder of the sources stays in the root. */
|
|
63
|
+
const SOURCES_IN_A_ROOT: FsRootRules = { paths: ["path"] };
|
|
64
|
+
|
|
60
65
|
/** `lib.new`: a root refuses it. */
|
|
61
66
|
const NEW_UNDER_A_ROOT: FsRootRules = { refuse: "it starts the cue program of the workspace, and that program is code of the project" };
|
|
62
67
|
|
|
@@ -160,6 +165,23 @@ const libGraphProcedure = createProcedure()
|
|
|
160
165
|
.handler(async (input: LibGraphInput, ctx: ProcedureContext): Promise<LibGraphOutput> => libGraph(input, ctx))
|
|
161
166
|
.build();
|
|
162
167
|
|
|
168
|
+
// lib.importCycles (Graph's split, wave 2, W7)
|
|
169
|
+
const libImportCyclesProcedure = createProcedure()
|
|
170
|
+
.path(["lib", "importCycles"])
|
|
171
|
+
.input(zodAdapter<LibImportCyclesInput>(LibImportCyclesInputSchema))
|
|
172
|
+
.output(zodAdapter<LibImportCyclesOutput>(LibImportCyclesOutputSchema))
|
|
173
|
+
.meta({
|
|
174
|
+
description: "The import cycles of a tree of TypeScript sources: the cycles at runtime (after the import elision), of the declared imports, or of each import",
|
|
175
|
+
calls: ["fs.glob", "fs.stat", "fs.read"],
|
|
176
|
+
effects: { reads: ["fs"], writes: [] },
|
|
177
|
+
fsRoot: SOURCES_IN_A_ROOT,
|
|
178
|
+
args: ["path"],
|
|
179
|
+
shorts: {},
|
|
180
|
+
output: "json",
|
|
181
|
+
})
|
|
182
|
+
.handler(async (input: LibImportCyclesInput, ctx: ProcedureContext): Promise<LibImportCyclesOutput> => libImportCycles(input, ctx))
|
|
183
|
+
.build();
|
|
184
|
+
|
|
163
185
|
// =============================================================================
|
|
164
186
|
// ecosystem.* Procedures
|
|
165
187
|
// =============================================================================
|
|
@@ -199,6 +221,7 @@ export const libModule: ProcedureModule = defineModule("@procedures/lib", [
|
|
|
199
221
|
libNewProcedure,
|
|
200
222
|
libAuditProcedure,
|
|
201
223
|
libGraphProcedure,
|
|
224
|
+
libImportCyclesProcedure,
|
|
202
225
|
// ecosystem.* procedures
|
|
203
226
|
ecosystemProceduresProcedure,
|
|
204
227
|
], [fsModule, gitModule]);
|
|
@@ -33,6 +33,8 @@ interface FsReaddirOutput {
|
|
|
33
33
|
/**
|
|
34
34
|
* The cycles of a graph: each strongly connected component with more than one node, and each
|
|
35
35
|
* node with an edge to itself (Tarjan's algorithm). Each cycle and the list are in name order.
|
|
36
|
+
* The search keeps its own stack, so a long chain of edges (the imports of a large source tree)
|
|
37
|
+
* does not overflow the call stack.
|
|
36
38
|
*/
|
|
37
39
|
export function findCycles(names: readonly string[], edges: ReadonlyMap<string, readonly string[]>): string[][] {
|
|
38
40
|
let counter = 0;
|
|
@@ -41,35 +43,47 @@ export function findCycles(names: readonly string[], edges: ReadonlyMap<string,
|
|
|
41
43
|
const stack: string[] = [];
|
|
42
44
|
const onStack = new Set<string>();
|
|
43
45
|
const cycles: string[][] = [];
|
|
44
|
-
|
|
45
|
-
const visit = (name: string): void => {
|
|
46
|
+
const open = (name: string): void => {
|
|
46
47
|
index.set(name, counter);
|
|
47
48
|
low.set(name, counter);
|
|
48
49
|
counter++;
|
|
49
50
|
stack.push(name);
|
|
50
51
|
onStack.add(name);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
};
|
|
53
|
+
for (const start of names) {
|
|
54
|
+
if (index.has(start)) continue;
|
|
55
|
+
open(start);
|
|
56
|
+
// Each frame: a node, and the position of its next edge
|
|
57
|
+
const work: Array<{ name: string; next: number }> = [{ name: start, next: 0 }];
|
|
58
|
+
while (work.length > 0) {
|
|
59
|
+
const frame = work[work.length - 1]!;
|
|
60
|
+
const targets = edges.get(frame.name) ?? [];
|
|
61
|
+
if (frame.next < targets.length) {
|
|
62
|
+
const target = targets[frame.next++]!;
|
|
63
|
+
if (!index.has(target)) {
|
|
64
|
+
open(target);
|
|
65
|
+
work.push({ name: target, next: 0 });
|
|
66
|
+
} else if (onStack.has(target)) {
|
|
67
|
+
low.set(frame.name, Math.min(low.get(frame.name)!, index.get(target)!));
|
|
68
|
+
}
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
work.pop();
|
|
72
|
+
const parent = work[work.length - 1];
|
|
73
|
+
if (parent) low.set(parent.name, Math.min(low.get(parent.name)!, low.get(frame.name)!));
|
|
74
|
+
if (low.get(frame.name) === index.get(frame.name)) {
|
|
75
|
+
const component: string[] = [];
|
|
76
|
+
let member: string;
|
|
77
|
+
do {
|
|
78
|
+
member = stack.pop()!;
|
|
79
|
+
onStack.delete(member);
|
|
80
|
+
component.push(member);
|
|
81
|
+
} while (member !== frame.name);
|
|
82
|
+
const selfEdge = component.length === 1 && targets.includes(frame.name);
|
|
83
|
+
if (component.length > 1 || selfEdge) cycles.push(component.sort());
|
|
57
84
|
}
|
|
58
85
|
}
|
|
59
|
-
|
|
60
|
-
const component: string[] = [];
|
|
61
|
-
let member: string;
|
|
62
|
-
do {
|
|
63
|
-
member = stack.pop()!;
|
|
64
|
-
onStack.delete(member);
|
|
65
|
-
component.push(member);
|
|
66
|
-
} while (member !== name);
|
|
67
|
-
const selfEdge = component.length === 1 && (edges.get(name) ?? []).includes(name);
|
|
68
|
-
if (component.length > 1 || selfEdge) cycles.push(component.sort());
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
for (const name of names) if (!index.has(name)) visit(name);
|
|
86
|
+
}
|
|
73
87
|
return cycles.sort((a, b) => a[0]!.localeCompare(b[0]!));
|
|
74
88
|
}
|
|
75
89
|
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lib.importCycles procedure (Graph's split, wave 2, W7)
|
|
3
|
+
*
|
|
4
|
+
* The import cycles of a tree of TypeScript sources. The default mode counts the cycles that exist
|
|
5
|
+
* at runtime: TypeScript's own import elision drops an import whose bindings are only types, as the
|
|
6
|
+
* build drops it. Then the strongly connected components of the graph are the cycles that can break
|
|
7
|
+
* the order of the module initialization.
|
|
8
|
+
*
|
|
9
|
+
* - `runtime` (the default): the imports that survive the elision, and the dependency-injection
|
|
10
|
+
* tokens of the decorators in `diDecorators` (Angular: a decorated class keeps the types of its
|
|
11
|
+
* constructor parameters at runtime).
|
|
12
|
+
* - `declared`: each import that the source does not declare type-only (`import type`). A cycle of
|
|
13
|
+
* this mode holds only because the elision catches an import of types.
|
|
14
|
+
* - `raw`: each import statement. This is the count of a tool such as madge.
|
|
15
|
+
*
|
|
16
|
+
* The procedure reads the files with `fs.glob` and `fs.read`, so a root of the host confines it. The
|
|
17
|
+
* functions `importGraph` and `importCycles` take the sources as text, for a caller with its own files.
|
|
18
|
+
*/
|
|
19
|
+
import { posix } from "node:path";
|
|
20
|
+
import { ts } from "ts-morph";
|
|
21
|
+
import type { ProcedureContext } from "@procedures/client";
|
|
22
|
+
import type { ImportMode, LibImportCyclesInput, LibImportCyclesOutput } from "../../types.js";
|
|
23
|
+
import { findCycles } from "./graph.js";
|
|
24
|
+
|
|
25
|
+
/** The decorators of Angular whose class keeps the types of its constructor parameters at runtime. */
|
|
26
|
+
export const ANGULAR_DI_DECORATORS: readonly string[] = Object.freeze(["Injectable", "Component", "Directive", "Pipe", "NgModule"]);
|
|
27
|
+
|
|
28
|
+
/** The files that the procedure leaves out by default: the tests, the declarations and node_modules. */
|
|
29
|
+
export const DEFAULT_IMPORT_EXCLUDE: readonly string[] = Object.freeze(["**/node_modules/**", "**/*.d.ts", "**/*.{spec,test,unit}.{ts,tsx}"]);
|
|
30
|
+
|
|
31
|
+
/** The limits of `lib.importCycles`. The defaults are the ceiling: a caller can only ask for lower limits. */
|
|
32
|
+
export interface ImportCycleLimits {
|
|
33
|
+
/** The most files that one call reads. A call with more files is refused before it reads a file. The default is 20000. */
|
|
34
|
+
readonly maxFiles: number;
|
|
35
|
+
/** The largest file that the call reads, in bytes. A larger file is skipped, and the result lists it. The default is 1 MiB. */
|
|
36
|
+
readonly maxFileBytes: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The default limits of `lib.importCycles`. */
|
|
40
|
+
export const DEFAULT_IMPORT_CYCLE_LIMITS: ImportCycleLimits = Object.freeze({ maxFiles: 20_000, maxFileBytes: 1024 * 1024 });
|
|
41
|
+
|
|
42
|
+
/** The options of `importGraph` and `importCycles`. */
|
|
43
|
+
export interface ImportGraphOptions {
|
|
44
|
+
/** `runtime` (the default), `declared` or `raw`. */
|
|
45
|
+
readonly mode?: ImportMode | undefined;
|
|
46
|
+
/** The decorators whose class keeps the types of its constructor parameters at runtime. The default is none. */
|
|
47
|
+
readonly diDecorators?: readonly string[] | undefined;
|
|
48
|
+
/** An abort signal: the functions examine it before each file, and stop with its reason. */
|
|
49
|
+
readonly signal?: AbortSignal | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The result of `importCycles`. */
|
|
53
|
+
export interface ImportCycles {
|
|
54
|
+
/** The number of files. */
|
|
55
|
+
readonly files: number;
|
|
56
|
+
/** The number of import edges between the files. */
|
|
57
|
+
readonly edges: number;
|
|
58
|
+
/** Each cycle: the files of a strongly connected component, in name order. The largest cycle comes first. */
|
|
59
|
+
readonly components: string[][];
|
|
60
|
+
/** The number of files in a cycle. */
|
|
61
|
+
readonly filesInCycles: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** True when the source declares the import or export type-only: `import type`, or only `type` names. */
|
|
65
|
+
function declaredTypeOnly(statement: ts.ImportDeclaration | ts.ExportDeclaration): boolean {
|
|
66
|
+
if (ts.isImportDeclaration(statement)) {
|
|
67
|
+
const clause = statement.importClause;
|
|
68
|
+
if (!clause) return false; // an import for its side effects runs
|
|
69
|
+
if (clause.isTypeOnly) return true;
|
|
70
|
+
if (clause.name) return false;
|
|
71
|
+
const bindings = clause.namedBindings;
|
|
72
|
+
return !!bindings && ts.isNamedImports(bindings) && bindings.elements.length > 0 && bindings.elements.every((element) => element.isTypeOnly);
|
|
73
|
+
}
|
|
74
|
+
return statement.isTypeOnly;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The module specifiers of the statements of a source. */
|
|
78
|
+
function specifiersOf(source: ts.SourceFile, skip: (statement: ts.ImportDeclaration | ts.ExportDeclaration) => boolean): Set<string> {
|
|
79
|
+
const specifiers = new Set<string>();
|
|
80
|
+
for (const statement of source.statements) {
|
|
81
|
+
if ((ts.isImportDeclaration(statement) || ts.isExportDeclaration(statement)) && statement.moduleSpecifier && ts.isStringLiteral(statement.moduleSpecifier)) {
|
|
82
|
+
if (!skip(statement)) specifiers.add(statement.moduleSpecifier.text);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return specifiers;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The specifiers of the dependency-injection tokens: the types of the constructor parameters of a decorated class. */
|
|
89
|
+
function diSpecifiers(source: ts.SourceFile, decorators: ReadonlySet<string>): Set<string> {
|
|
90
|
+
const importOf = new Map<string, string>();
|
|
91
|
+
for (const statement of source.statements) {
|
|
92
|
+
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier) || !statement.importClause || statement.importClause.isTypeOnly) continue;
|
|
93
|
+
const bindings = statement.importClause.namedBindings;
|
|
94
|
+
if (bindings && ts.isNamedImports(bindings)) {
|
|
95
|
+
for (const element of bindings.elements) if (!element.isTypeOnly) importOf.set(element.name.text, statement.moduleSpecifier.text);
|
|
96
|
+
}
|
|
97
|
+
if (statement.importClause.name) importOf.set(statement.importClause.name.text, statement.moduleSpecifier.text);
|
|
98
|
+
}
|
|
99
|
+
const out = new Set<string>();
|
|
100
|
+
const visit = (node: ts.Node): void => {
|
|
101
|
+
if (ts.isClassDeclaration(node)) {
|
|
102
|
+
const decorated = (ts.getDecorators(node) ?? []).some((decorator) => {
|
|
103
|
+
const expression = decorator.expression;
|
|
104
|
+
return ts.isCallExpression(expression) && ts.isIdentifier(expression.expression) && decorators.has(expression.expression.text);
|
|
105
|
+
});
|
|
106
|
+
if (decorated) {
|
|
107
|
+
for (const member of node.members) {
|
|
108
|
+
if (!ts.isConstructorDeclaration(member)) continue;
|
|
109
|
+
for (const parameter of member.parameters) {
|
|
110
|
+
const type = parameter.type;
|
|
111
|
+
if (type && ts.isTypeReferenceNode(type) && ts.isIdentifier(type.typeName)) {
|
|
112
|
+
const specifier = importOf.get(type.typeName.text);
|
|
113
|
+
if (specifier) out.add(specifier);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
ts.forEachChild(node, visit);
|
|
120
|
+
};
|
|
121
|
+
visit(source);
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The file of a relative specifier among the known files, or undefined. A `.js` specifier of an ES module maps to its `.ts` source. */
|
|
126
|
+
function resolveSpecifier(from: string, specifier: string, files: ReadonlySet<string>): string | undefined {
|
|
127
|
+
if (!specifier.startsWith(".")) return undefined; // a package import cannot make a cycle of the tree
|
|
128
|
+
const base = posix.normalize(posix.join(posix.dirname(from), specifier));
|
|
129
|
+
const candidates = [base, `${base}.ts`, `${base}.tsx`, `${base}/index.ts`, `${base}/index.tsx`];
|
|
130
|
+
if (base.endsWith(".js")) candidates.push(`${base.slice(0, -3)}.ts`, `${base.slice(0, -3)}.tsx`);
|
|
131
|
+
return candidates.find((candidate) => files.has(candidate));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** The edges of one source in a mode. */
|
|
135
|
+
function edgesOf(file: string, text: string, files: ReadonlySet<string>, mode: ImportMode, decorators: ReadonlySet<string>): string[] {
|
|
136
|
+
const kind = file.endsWith("x") ? ts.ScriptKind.TSX : ts.ScriptKind.TS;
|
|
137
|
+
let specifiers: Set<string>;
|
|
138
|
+
if (mode === "runtime") {
|
|
139
|
+
// The elision of TypeScript: an import whose bindings are only types leaves the output
|
|
140
|
+
const output = ts.transpileModule(text, {
|
|
141
|
+
fileName: file,
|
|
142
|
+
compilerOptions: {
|
|
143
|
+
module: ts.ModuleKind.ESNext,
|
|
144
|
+
target: ts.ScriptTarget.ES2022,
|
|
145
|
+
jsx: ts.JsxEmit.ReactJSX,
|
|
146
|
+
experimentalDecorators: true,
|
|
147
|
+
useDefineForClassFields: false,
|
|
148
|
+
verbatimModuleSyntax: false,
|
|
149
|
+
isolatedModules: true,
|
|
150
|
+
},
|
|
151
|
+
}).outputText;
|
|
152
|
+
specifiers = specifiersOf(ts.createSourceFile("out.js", output, ts.ScriptTarget.ES2022, false, ts.ScriptKind.JS), () => false);
|
|
153
|
+
if (decorators.size > 0) for (const specifier of diSpecifiers(ts.createSourceFile(file, text, ts.ScriptTarget.ES2022, true, kind), decorators)) specifiers.add(specifier);
|
|
154
|
+
} else {
|
|
155
|
+
const source = ts.createSourceFile(file, text, ts.ScriptTarget.ES2022, false, kind);
|
|
156
|
+
specifiers = specifiersOf(source, mode === "declared" ? declaredTypeOnly : () => false);
|
|
157
|
+
}
|
|
158
|
+
const edges: string[] = [];
|
|
159
|
+
for (const specifier of specifiers) {
|
|
160
|
+
const target = resolveSpecifier(file, specifier, files);
|
|
161
|
+
if (target && !edges.includes(target)) edges.push(target);
|
|
162
|
+
}
|
|
163
|
+
return edges;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* This function gives the import graph of the sources: for each file, the files that it imports in the mode. The
|
|
168
|
+
* paths are POSIX paths, relative to one root. Only relative imports make edges.
|
|
169
|
+
*/
|
|
170
|
+
export function importGraph(sources: ReadonlyMap<string, string>, options: ImportGraphOptions = {}): Map<string, string[]> {
|
|
171
|
+
const files = new Set(sources.keys());
|
|
172
|
+
const decorators = new Set(options.diDecorators ?? []);
|
|
173
|
+
const mode = options.mode ?? "runtime";
|
|
174
|
+
const graph = new Map<string, string[]>();
|
|
175
|
+
for (const [file, text] of sources) {
|
|
176
|
+
options.signal?.throwIfAborted();
|
|
177
|
+
graph.set(file, edgesOf(file, text, files, mode, decorators));
|
|
178
|
+
}
|
|
179
|
+
return graph;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* This function gives the import cycles of the sources: the strongly connected components of `importGraph`.
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```ts
|
|
187
|
+
* const sources = new Map([["src/a.ts", "import { b } from './b';"], ["src/b.ts", "import { a } from './a';"]]);
|
|
188
|
+
* importCycles(sources).components; // [["src/a.ts", "src/b.ts"]]
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export function importCycles(sources: ReadonlyMap<string, string>, options: ImportGraphOptions = {}): ImportCycles {
|
|
192
|
+
const graph = importGraph(sources, options);
|
|
193
|
+
// The largest cycle first, then the order of the code units of the first file
|
|
194
|
+
const components = findCycles([...graph.keys()], graph).sort((a, b) => b.length - a.length || (a[0]! < b[0]! ? -1 : a[0]! > b[0]! ? 1 : 0));
|
|
195
|
+
let edges = 0;
|
|
196
|
+
for (const targets of graph.values()) edges += targets.length;
|
|
197
|
+
return { files: graph.size, edges, components, filesInCycles: components.reduce((n, component) => n + component.length, 0) };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface FsGlobOutput {
|
|
201
|
+
matches: string[];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function tooManyFiles(count: number, maxFiles: number): Error {
|
|
205
|
+
return Object.assign(new Error(`The folder has ${count} source files, more than the limit of ${maxFiles}. Give a narrower path or exclude patterns.`), {
|
|
206
|
+
code: "PAYLOAD_TOO_LARGE",
|
|
207
|
+
retryable: false,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The import cycles of the TypeScript sources under a folder
|
|
213
|
+
*/
|
|
214
|
+
export async function libImportCycles(input: LibImportCyclesInput, ctx: ProcedureContext): Promise<LibImportCyclesOutput> {
|
|
215
|
+
const exclude = input.exclude ?? [...DEFAULT_IMPORT_EXCLUDE];
|
|
216
|
+
// The meet of the caller's limits and the ceiling, for each field: a caller only narrows them (the schema
|
|
217
|
+
// also refuses a higher value)
|
|
218
|
+
const limits: ImportCycleLimits = {
|
|
219
|
+
maxFiles: Math.min(input.limits?.maxFiles ?? Infinity, DEFAULT_IMPORT_CYCLE_LIMITS.maxFiles),
|
|
220
|
+
maxFileBytes: Math.min(input.limits?.maxFileBytes ?? Infinity, DEFAULT_IMPORT_CYCLE_LIMITS.maxFileBytes),
|
|
221
|
+
};
|
|
222
|
+
const { matches } = await ctx.client.call<{ pattern: string; cwd: string; ignore: string[] }, FsGlobOutput>(["fs", "glob"], {
|
|
223
|
+
pattern: "**/*.{ts,tsx}",
|
|
224
|
+
cwd: input.path,
|
|
225
|
+
ignore: exclude,
|
|
226
|
+
});
|
|
227
|
+
// The limit comes before any read: a call cannot make the host read a whole node_modules
|
|
228
|
+
if (matches.length > limits.maxFiles) throw tooManyFiles(matches.length, limits.maxFiles);
|
|
229
|
+
const root = input.path.split("\\").join("/");
|
|
230
|
+
const sources = new Map<string, string>();
|
|
231
|
+
const skipped: Array<{ path: string; bytes: number }> = [];
|
|
232
|
+
for (const match of matches.map((m) => m.split("\\").join("/")).sort()) {
|
|
233
|
+
ctx.signal?.throwIfAborted();
|
|
234
|
+
const path = posix.join(root, match);
|
|
235
|
+
const { size } = await ctx.client.call<{ path: string }, { size: number }>(["fs", "stat"], { path });
|
|
236
|
+
if (size > limits.maxFileBytes) {
|
|
237
|
+
skipped.push({ path: match, bytes: size });
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
const { content } = await ctx.client.call<{ path: string }, { content: string }>(["fs", "read"], { path });
|
|
241
|
+
sources.set(match, content);
|
|
242
|
+
}
|
|
243
|
+
const mode = input.mode ?? "runtime";
|
|
244
|
+
const result = importCycles(sources, { mode, diDecorators: input.diDecorators, signal: ctx.signal });
|
|
245
|
+
return { path: input.path, mode, ...result, acyclic: result.components.length === 0, skipped };
|
|
246
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -412,6 +412,40 @@ export const LibAuditOutputSchema: z.ZodType<LibAuditOutput> = z.looseObject({
|
|
|
412
412
|
/** The fields of package.json that give the edges of the graph. */
|
|
413
413
|
export type DependencyKind = "dependencies" | "devDependencies" | "peerDependencies" | "optionalDependencies";
|
|
414
414
|
|
|
415
|
+
/** The edges that `lib.importCycles` counts: `runtime` (after the elision of TypeScript), `declared` or `raw`. */
|
|
416
|
+
export type ImportMode = "runtime" | "declared" | "raw";
|
|
417
|
+
|
|
418
|
+
export interface LibImportCyclesInput {
|
|
419
|
+
/** The folder of the sources, for example `packages/web/src` */
|
|
420
|
+
path: string;
|
|
421
|
+
/** The edges to count. The default is `runtime`. */
|
|
422
|
+
mode?: ImportMode | undefined;
|
|
423
|
+
/** The decorators whose class keeps the types of its constructor parameters at runtime, for example the Angular ones */
|
|
424
|
+
diDecorators?: string[] | undefined;
|
|
425
|
+
/** The glob patterns of the files to leave out. The default leaves out node_modules, declarations and tests. */
|
|
426
|
+
exclude?: string[] | undefined;
|
|
427
|
+
/** Lower limits than the defaults: the most files of a call (20000), and the largest file that it reads (1 MiB) */
|
|
428
|
+
limits?: { maxFiles?: number | undefined; maxFileBytes?: number | undefined } | undefined;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface LibImportCyclesOutput {
|
|
432
|
+
/** The folder of the sources */
|
|
433
|
+
path: string;
|
|
434
|
+
mode: ImportMode;
|
|
435
|
+
/** The number of files */
|
|
436
|
+
files: number;
|
|
437
|
+
/** The number of import edges between the files */
|
|
438
|
+
edges: number;
|
|
439
|
+
/** True when the graph has no cycle */
|
|
440
|
+
acyclic: boolean;
|
|
441
|
+
/** Each cycle: the files of a strongly connected component, in name order. The largest cycle comes first. */
|
|
442
|
+
components: string[][];
|
|
443
|
+
/** The number of files in a cycle */
|
|
444
|
+
filesInCycles: number;
|
|
445
|
+
/** The files larger than limits.maxFileBytes: the call did not read them */
|
|
446
|
+
skipped: Array<{ path: string; bytes: number }>;
|
|
447
|
+
}
|
|
448
|
+
|
|
415
449
|
export interface LibGraphInput {
|
|
416
450
|
/** The workspace root (default: the pnpm workspace that contains client-lib) */
|
|
417
451
|
rootPath?: string | undefined;
|
|
@@ -451,6 +485,33 @@ export interface LibGraphOutput {
|
|
|
451
485
|
warnings: Array<{ path: string; issue: string }>;
|
|
452
486
|
}
|
|
453
487
|
|
|
488
|
+
export const LibImportCyclesInputSchema: z.ZodType<LibImportCyclesInput> = z.object({
|
|
489
|
+
path: z.string().describe("The folder of the sources, for example packages/web/src"),
|
|
490
|
+
mode: z.enum(["runtime", "declared", "raw"]).optional().describe("The edges to count: runtime (after the import elision, the default), declared or raw"),
|
|
491
|
+
diDecorators: z.array(z.string()).optional().describe("The decorators whose class keeps the types of its constructor parameters at runtime (Angular: Injectable, Component, Directive, Pipe, NgModule)"),
|
|
492
|
+
exclude: z.array(z.string()).optional().describe("The glob patterns of the files to leave out (default: node_modules, declarations and tests)"),
|
|
493
|
+
limits: z
|
|
494
|
+
.object({
|
|
495
|
+
maxFiles: z.number().int().positive().max(20_000).optional().describe("The most files of the call: 20000 at most, and the default. A call with more files is refused before it reads a file."),
|
|
496
|
+
maxFileBytes: z.number().int().positive().max(1024 * 1024).optional().describe("The largest file that the call reads, in bytes: 1 MiB at most, and the default. The result lists each larger file."),
|
|
497
|
+
})
|
|
498
|
+
.optional()
|
|
499
|
+
.describe("Lower limits than the defaults. A higher value is refused."),
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
export const LibImportCyclesOutputSchema: z.ZodType<LibImportCyclesOutput> = z.looseObject({
|
|
503
|
+
path: z.string().describe("The folder of the sources"),
|
|
504
|
+
mode: z.enum(["runtime", "declared", "raw"]).describe("The edges that the call counted"),
|
|
505
|
+
files: z.number().describe("The number of files"),
|
|
506
|
+
edges: z.number().describe("The number of import edges between the files"),
|
|
507
|
+
acyclic: z.boolean().describe("True when the graph has no cycle"),
|
|
508
|
+
components: z.array(z.array(z.string())).describe("Each cycle: the files of a strongly connected component, in name order. The largest cycle comes first."),
|
|
509
|
+
filesInCycles: z.number().describe("The number of files in a cycle"),
|
|
510
|
+
skipped: z
|
|
511
|
+
.array(z.object({ path: z.string().describe("The file, relative to the folder"), bytes: z.number().describe("The size of the file") }))
|
|
512
|
+
.describe("The files larger than limits.maxFileBytes: the call did not read them"),
|
|
513
|
+
});
|
|
514
|
+
|
|
454
515
|
export const LibGraphInputSchema: z.ZodType<LibGraphInput> = z.object({
|
|
455
516
|
rootPath: z.string().optional().describe("The workspace root (default: the pnpm workspace that contains client-lib)"),
|
|
456
517
|
});
|