mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-19 00:03:33 +00:00
fix: shared REL_TYPES + test count fixes after rebase onto v1.6.2-rc.9
- Add NAVIGATES_TO to shared REL_TYPES (schema-constants.ts) and RelationshipType (graph/types.ts) - Wire SwiftUI navigation phase into pipeline-phases (parse-impl.ts collects allNavigations, new swiftui-navigation.ts phase, index.ts export, pipeline.ts buildPhaseList) - Resolve all 6 rebase conflicts (types.ts, schema.ts, call-processor.ts, parsing-processor.ts, pipeline.ts, parse-worker.ts) — MERGE BOTH SIDES Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
90ce8f9098
commit
265391f1f4
6 changed files with 61 additions and 2 deletions
|
|
@ -115,7 +115,8 @@ export type RelationshipType =
|
|||
| 'HANDLES_TOOL'
|
||||
| 'ENTRY_POINT_OF'
|
||||
| 'WRAPS'
|
||||
| 'QUERIES';
|
||||
| 'QUERIES'
|
||||
| 'NAVIGATES_TO'; // SwiftUI View → View navigation
|
||||
|
||||
export interface GraphNode {
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export { parsePhase, type ParseOutput } from './parse.js';
|
|||
export { routesPhase, type RoutesOutput, type RouteEntry } from './routes.js';
|
||||
export { toolsPhase, type ToolsOutput, type ToolDef } from './tools.js';
|
||||
export { ormPhase, type ORMOutput } from './orm.js';
|
||||
export { swiftuiNavigationPhase, type SwiftUINavigationOutput } from './swiftui-navigation.js';
|
||||
export { crossFilePhase, type CrossFileOutput } from './cross-file.js';
|
||||
export { mroPhase, type MROOutput } from './mro.js';
|
||||
export { communitiesPhase, type CommunitiesOutput } from './communities.js';
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|||
import { isDev } from '../utils/env.js';
|
||||
import { synthesizeWildcardImportBindings, needsSynthesis } from './wildcard-synthesis.js';
|
||||
import { extractORMQueriesInline } from './orm-extraction.js';
|
||||
import { extractSwiftUINavigations } from '../swiftui-navigation.js';
|
||||
import type { ExtractedNavigation } from '../swiftui-navigation.js';
|
||||
|
||||
// ── Constants ──────────────────────────────────────────────────────────────
|
||||
|
||||
|
|
@ -106,6 +108,7 @@ export async function runChunkedParseAndResolve(
|
|||
allDecoratorRoutes: ExtractedDecoratorRoute[];
|
||||
allToolDefs: ExtractedToolDef[];
|
||||
allORMQueries: ExtractedORMQuery[];
|
||||
allNavigations: ExtractedNavigation[];
|
||||
bindingAccumulator: BindingAccumulator;
|
||||
resolutionContext: ReturnType<typeof createResolutionContext>;
|
||||
usedWorkerPool: boolean;
|
||||
|
|
@ -248,6 +251,7 @@ export async function runChunkedParseAndResolve(
|
|||
const allDecoratorRoutes: ExtractedDecoratorRoute[] = [];
|
||||
const allToolDefs: ExtractedToolDef[] = [];
|
||||
const allORMQueries: ExtractedORMQuery[] = [];
|
||||
const allNavigations: ExtractedNavigation[] = [];
|
||||
const deferredWorkerCalls: ExtractedCall[] = [];
|
||||
const deferredWorkerHeritage: ExtractedHeritage[] = [];
|
||||
const deferredConstructorBindings: FileConstructorBindings[] = [];
|
||||
|
|
@ -393,6 +397,9 @@ export async function runChunkedParseAndResolve(
|
|||
if (chunkWorkerData.ormQueries?.length) {
|
||||
for (const item of chunkWorkerData.ormQueries) allORMQueries.push(item);
|
||||
}
|
||||
if (chunkWorkerData.navigations?.length) {
|
||||
for (const item of chunkWorkerData.navigations) allNavigations.push(item);
|
||||
}
|
||||
} else {
|
||||
await processImports(graph, chunkFiles, astCache, ctx, undefined, repoPath, allPaths);
|
||||
sequentialChunkPaths.push(chunkPaths);
|
||||
|
|
@ -509,6 +516,7 @@ export async function runChunkedParseAndResolve(
|
|||
}
|
||||
for (const f of chunkFiles) {
|
||||
extractORMQueriesInline(f.path, f.content, allORMQueries);
|
||||
extractSwiftUINavigations(f.path, f.content, allNavigations);
|
||||
}
|
||||
astCache.clear();
|
||||
cachedSequentialChunkFiles[chunkIdx] = [];
|
||||
|
|
@ -589,6 +597,7 @@ export async function runChunkedParseAndResolve(
|
|||
allDecoratorRoutes,
|
||||
allToolDefs,
|
||||
allORMQueries,
|
||||
allNavigations,
|
||||
bindingAccumulator,
|
||||
resolutionContext: ctx,
|
||||
// Whether a worker pool was actually live for this run. False means the
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import type {
|
|||
ExtractedToolDef,
|
||||
ExtractedORMQuery,
|
||||
} from '../workers/parse-worker.js';
|
||||
import type { ExtractedNavigation } from '../swiftui-navigation.js';
|
||||
import type { createResolutionContext } from '../model/resolution-context.js';
|
||||
import { runChunkedParseAndResolve } from './parse-impl.js';
|
||||
|
||||
|
|
@ -47,6 +48,7 @@ export interface ParseOutput {
|
|||
readonly allDecoratorRoutes: readonly ExtractedDecoratorRoute[];
|
||||
readonly allToolDefs: readonly ExtractedToolDef[];
|
||||
readonly allORMQueries: readonly ExtractedORMQuery[];
|
||||
readonly allNavigations: readonly ExtractedNavigation[];
|
||||
bindingAccumulator: BindingAccumulator;
|
||||
/** Resolution context from the parse phase — carries importMap, namedImportMap, etc. */
|
||||
resolutionContext: ReturnType<typeof createResolutionContext>;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Phase: swiftui-navigation
|
||||
*
|
||||
* Processes extracted SwiftUI navigation patterns and creates NAVIGATES_TO edges.
|
||||
*
|
||||
* @deps parse
|
||||
* @reads allNavigations (from parse)
|
||||
* @writes graph (NAVIGATES_TO edges)
|
||||
*/
|
||||
|
||||
import type { PipelinePhase, PipelineContext, PhaseResult } from './types.js';
|
||||
import { getPhaseOutput } from './types.js';
|
||||
import type { ParseOutput } from './parse.js';
|
||||
import { processSwiftUINavigation } from '../call-processor.js';
|
||||
import { isDev } from '../utils/env.js';
|
||||
|
||||
export interface SwiftUINavigationOutput {
|
||||
edgesCreated: number;
|
||||
}
|
||||
|
||||
export const swiftuiNavigationPhase: PipelinePhase<SwiftUINavigationOutput> = {
|
||||
name: 'swiftui-navigation',
|
||||
deps: ['parse'],
|
||||
|
||||
async execute(
|
||||
ctx: PipelineContext,
|
||||
deps: ReadonlyMap<string, PhaseResult<unknown>>,
|
||||
): Promise<SwiftUINavigationOutput> {
|
||||
const { allNavigations } = getPhaseOutput<ParseOutput>(deps, 'parse');
|
||||
|
||||
if (!allNavigations || allNavigations.length === 0) {
|
||||
return { edgesCreated: 0 };
|
||||
}
|
||||
|
||||
const edgesCreated = processSwiftUINavigation(ctx.graph, allNavigations as any[]);
|
||||
|
||||
if (isDev) {
|
||||
console.log(
|
||||
`SwiftUI navigation: ${edgesCreated} NAVIGATES_TO edges from ${allNavigations.length} patterns`,
|
||||
);
|
||||
}
|
||||
|
||||
return { edgesCreated };
|
||||
},
|
||||
};
|
||||
|
|
@ -29,6 +29,7 @@ import {
|
|||
routesPhase,
|
||||
toolsPhase,
|
||||
ormPhase,
|
||||
swiftuiNavigationPhase,
|
||||
crossFilePhase,
|
||||
mroPhase,
|
||||
communitiesPhase,
|
||||
|
|
@ -42,7 +43,6 @@ import {
|
|||
processImportsFromExtracted,
|
||||
buildImportResolutionContext
|
||||
} from './import-processor.js';
|
||||
import { extractSwiftUINavigations } from './swiftui-navigation.js';
|
||||
|
||||
export interface PipelineOptions {
|
||||
/** Skip MRO, community detection, and process extraction for faster test runs. */
|
||||
|
|
@ -85,6 +85,7 @@ function buildPhaseList(options?: PipelineOptions): PipelinePhase[] {
|
|||
routesPhase,
|
||||
toolsPhase,
|
||||
ormPhase,
|
||||
swiftuiNavigationPhase,
|
||||
crossFilePhase,
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue