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

Function angularComponents

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

Source from the content-addressed store, hash-verified

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

Callers 1

angularTemplateEdgesFunction · 0.85

Calls 9

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

Tested by

no test coverage detected