MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / angularComponents

Function angularComponents

src/resolution/angular-template-synthesizer.ts:134–148  ·  view source on GitHub ↗
(ctx: ResolutionContext)

Source from the content-addressed store, hash-verified

132
133/** Every component in the project, read once per resolution state. */
134export function angularComponents(ctx: ResolutionContext): AngularComponent[] {
135 const source = ctx.getNodesByKind('route');
136 const hit = componentIndexes.get(ctx);
137 if (hit && hit.source === source) return hit.components;
138 const components: AngularComponent[] = [];
139 for (const file of ctx.getAllFiles()) {
140 if (!/\.[cm]?ts$/.test(file) || file.endsWith('.d.ts') || isTestPath(file)) continue;
141 if (!(ctx.fileContains?.(file, '@Component') ?? ctx.readFile(file)?.includes('@Component'))) continue;
142 const content = ctx.readFile(file);
143 if (!content) continue;
144 components.push(...componentsIn(file, content, ctx.getNodesInFile(file), ctx));
145 }
146 componentIndexes.set(ctx, { source, components });
147 return components;
148}
149
150// =============================================================================
151// Reading a template

Callers 1

angularTemplateEdgesFunction · 0.85

Calls 10

isTestPathFunction · 0.90
componentsInFunction · 0.85
readFileMethod · 0.80
pushMethod · 0.80
getNodesByKindMethod · 0.65
getMethod · 0.65
getAllFilesMethod · 0.65
fileContainsMethod · 0.65
getNodesInFileMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected