@zipbul/gildash 0.6.0 → 0.7.0
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/README.ko.md +72 -54
- package/README.md +73 -54
- package/dist/index.js +7 -7
- package/dist/index.js.map +12 -12
- package/dist/src/errors.d.ts +8 -6
- package/dist/src/gildash/extract-api.d.ts +2 -4
- package/dist/src/gildash/graph-api.d.ts +8 -10
- package/dist/src/gildash/index.d.ts +38 -39
- package/dist/src/gildash/lifecycle.d.ts +4 -6
- package/dist/src/gildash/misc-api.d.ts +4 -6
- package/dist/src/gildash/parse-api.d.ts +2 -4
- package/dist/src/gildash/query-api.d.ts +12 -14
- package/dist/src/gildash/semantic-api.d.ts +4 -6
- package/dist/src/gildash/types.d.ts +2 -0
- package/dist/src/index.d.ts +2 -2
- package/package.json +8 -3
package/dist/src/errors.d.ts
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type GildashErrorType = 'watcher' | 'parse' | 'extract' | 'index' | 'store' | 'search' | 'closed' | 'validation' | 'close' | 'semantic';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Error class used throughout Gildash.
|
|
7
|
+
* Extends `Error` so that `instanceof Error` checks work and stack traces are captured.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
type: GildashErrorType;
|
|
11
|
-
message: string
|
|
12
|
-
|
|
9
|
+
export declare class GildashError extends Error {
|
|
10
|
+
readonly type: GildashErrorType;
|
|
11
|
+
constructor(type: GildashErrorType, message: string, options?: {
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
});
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Factory function that creates a {@link GildashError} value.
|
|
@@ -18,5 +19,6 @@ export interface GildashError {
|
|
|
18
19
|
* @param message - Human-readable description of the error.
|
|
19
20
|
* @param cause - Optional root cause (any value). When `undefined`, the `cause`
|
|
20
21
|
* property is omitted from the returned object entirely.
|
|
22
|
+
* @deprecated Use `new GildashError(type, message, { cause })` instead.
|
|
21
23
|
*/
|
|
22
24
|
export declare function gildashError(type: GildashErrorType, message: string, cause?: unknown): GildashError;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { ParsedFile } from '../parser/types';
|
|
3
2
|
import type { ExtractedSymbol, CodeRelation } from '../extractor/types';
|
|
4
|
-
import type { GildashError } from '../errors';
|
|
5
3
|
import type { GildashContext } from './context';
|
|
6
4
|
/** Extract all symbol declarations from a previously parsed file. */
|
|
7
|
-
export declare function extractSymbols(ctx: GildashContext, parsed: ParsedFile):
|
|
5
|
+
export declare function extractSymbols(ctx: GildashContext, parsed: ParsedFile): ExtractedSymbol[];
|
|
8
6
|
/** Extract inter-file relationships from a previously parsed file. */
|
|
9
|
-
export declare function extractRelations(ctx: GildashContext, parsed: ParsedFile):
|
|
7
|
+
export declare function extractRelations(ctx: GildashContext, parsed: ParsedFile): CodeRelation[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
|
-
import type { GildashError } from '../errors';
|
|
3
1
|
import { DependencyGraph } from '../search/dependency-graph';
|
|
4
2
|
import type { GildashContext } from './context';
|
|
5
3
|
import type { FanMetrics } from './types';
|
|
@@ -11,20 +9,20 @@ export declare function invalidateGraphCache(ctx: GildashContext): void;
|
|
|
11
9
|
*/
|
|
12
10
|
export declare function getOrBuildGraph(ctx: GildashContext, project?: string): DependencyGraph;
|
|
13
11
|
/** List the files that a given file directly imports. */
|
|
14
|
-
export declare function getDependencies(ctx: GildashContext, filePath: string, project?: string, limit?: number):
|
|
12
|
+
export declare function getDependencies(ctx: GildashContext, filePath: string, project?: string, limit?: number): string[];
|
|
15
13
|
/** List the files that directly import a given file. */
|
|
16
|
-
export declare function getDependents(ctx: GildashContext, filePath: string, project?: string, limit?: number):
|
|
14
|
+
export declare function getDependents(ctx: GildashContext, filePath: string, project?: string, limit?: number): string[];
|
|
17
15
|
/** Compute the full set of files transitively affected by changes. */
|
|
18
|
-
export declare function getAffected(ctx: GildashContext, changedFiles: string[], project?: string): Promise<
|
|
16
|
+
export declare function getAffected(ctx: GildashContext, changedFiles: string[], project?: string): Promise<string[]>;
|
|
19
17
|
/** Check whether the import graph contains a circular dependency. */
|
|
20
|
-
export declare function hasCycle(ctx: GildashContext, project?: string): Promise<
|
|
18
|
+
export declare function hasCycle(ctx: GildashContext, project?: string): Promise<boolean>;
|
|
21
19
|
/** Return the full import graph as an adjacency list. */
|
|
22
|
-
export declare function getImportGraph(ctx: GildashContext, project?: string): Promise<
|
|
20
|
+
export declare function getImportGraph(ctx: GildashContext, project?: string): Promise<Map<string, string[]>>;
|
|
23
21
|
/** Return all files that `filePath` transitively imports (forward BFS). */
|
|
24
|
-
export declare function getTransitiveDependencies(ctx: GildashContext, filePath: string, project?: string): Promise<
|
|
22
|
+
export declare function getTransitiveDependencies(ctx: GildashContext, filePath: string, project?: string): Promise<string[]>;
|
|
25
23
|
/** Return all cycle paths in the import graph. */
|
|
26
24
|
export declare function getCyclePaths(ctx: GildashContext, project?: string, options?: {
|
|
27
25
|
maxCycles?: number;
|
|
28
|
-
}): Promise<
|
|
26
|
+
}): Promise<string[][]>;
|
|
29
27
|
/** Compute import-graph fan metrics (fan-in / fan-out) for a single file. */
|
|
30
|
-
export declare function getFanMetrics(ctx: GildashContext, filePath: string, project?: string): Promise<
|
|
28
|
+
export declare function getFanMetrics(ctx: GildashContext, filePath: string, project?: string): Promise<FanMetrics>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { ParsedFile } from '../parser/types';
|
|
3
2
|
import type { ParserOptions } from 'oxc-parser';
|
|
4
3
|
import type { ExtractedSymbol, CodeRelation } from '../extractor/types';
|
|
@@ -9,7 +8,6 @@ import type { RelationSearchQuery } from '../search/relation-search';
|
|
|
9
8
|
import type { SymbolStats } from '../store/repositories/symbol.repository';
|
|
10
9
|
import type { FileRecord } from '../store/repositories/file.repository';
|
|
11
10
|
import type { PatternMatch } from '../search/pattern-search';
|
|
12
|
-
import type { GildashError } from '../errors';
|
|
13
11
|
import type { ResolvedType, SemanticReference, Implementation, SemanticModuleInterface } from '../semantic/types';
|
|
14
12
|
import type { GildashContext } from './context';
|
|
15
13
|
import type { GildashOptions, SymbolDiff, ModuleInterface, HeritageNode, FullSymbol, FileStats, FanMetrics, ResolvedSymbol } from './types';
|
|
@@ -22,9 +20,9 @@ export type { GildashInternalOptions } from './lifecycle';
|
|
|
22
20
|
* `Gildash` indexes TypeScript source code into a local SQLite database,
|
|
23
21
|
* watches for file changes, and provides search / dependency-graph queries.
|
|
24
22
|
*
|
|
25
|
-
* Every public method returns a
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* Every public method either returns a value directly or throws a
|
|
24
|
+
* `GildashError` on failure. Use `try/catch` with `instanceof GildashError`
|
|
25
|
+
* to handle errors.
|
|
28
26
|
*
|
|
29
27
|
* Create an instance with the static {@link Gildash.open} factory.
|
|
30
28
|
* Always call {@link Gildash.close} when done to release resources.
|
|
@@ -41,52 +39,53 @@ export declare class Gildash {
|
|
|
41
39
|
private constructor();
|
|
42
40
|
/**
|
|
43
41
|
* Create and initialise a new `Gildash` instance.
|
|
42
|
+
* @throws {GildashError} if initialization fails.
|
|
44
43
|
*/
|
|
45
|
-
static open(options: GildashOptions & GildashInternalOptions): Promise<
|
|
44
|
+
static open(options: GildashOptions & GildashInternalOptions): Promise<Gildash>;
|
|
46
45
|
/** Shut down the instance and release all resources. */
|
|
47
46
|
close(opts?: {
|
|
48
47
|
cleanup?: boolean;
|
|
49
|
-
}): Promise<
|
|
50
|
-
parseSource(filePath: string, sourceText: string, options?: ParserOptions):
|
|
51
|
-
batchParse(filePaths: string[], options?: ParserOptions): Promise<
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
parseSource(filePath: string, sourceText: string, options?: ParserOptions): ParsedFile;
|
|
50
|
+
batchParse(filePaths: string[], options?: ParserOptions): Promise<Map<string, ParsedFile>>;
|
|
52
51
|
getParsedAst(filePath: string): ParsedFile | undefined;
|
|
53
|
-
extractSymbols(parsed: ParsedFile):
|
|
54
|
-
extractRelations(parsed: ParsedFile):
|
|
55
|
-
getStats(project?: string):
|
|
56
|
-
searchSymbols(query: SymbolSearchQuery):
|
|
57
|
-
searchRelations(query: RelationSearchQuery):
|
|
52
|
+
extractSymbols(parsed: ParsedFile): ExtractedSymbol[];
|
|
53
|
+
extractRelations(parsed: ParsedFile): CodeRelation[];
|
|
54
|
+
getStats(project?: string): SymbolStats;
|
|
55
|
+
searchSymbols(query: SymbolSearchQuery): SymbolSearchResult[];
|
|
56
|
+
searchRelations(query: RelationSearchQuery): CodeRelation[];
|
|
58
57
|
searchAllSymbols(query: Omit<SymbolSearchQuery, 'project'> & {
|
|
59
58
|
project?: string;
|
|
60
|
-
}):
|
|
61
|
-
searchAllRelations(query: RelationSearchQuery):
|
|
62
|
-
listIndexedFiles(project?: string):
|
|
63
|
-
getInternalRelations(filePath: string, project?: string):
|
|
64
|
-
getFullSymbol(symbolName: string, filePath: string, project?: string):
|
|
65
|
-
getFileStats(filePath: string, project?: string):
|
|
66
|
-
getFileInfo(filePath: string, project?: string):
|
|
67
|
-
getSymbolsByFile(filePath: string, project?: string):
|
|
68
|
-
getModuleInterface(filePath: string, project?: string):
|
|
69
|
-
getDependencies(filePath: string, project?: string, limit?: number):
|
|
70
|
-
getDependents(filePath: string, project?: string, limit?: number):
|
|
71
|
-
getAffected(changedFiles: string[], project?: string): Promise<
|
|
72
|
-
hasCycle(project?: string): Promise<
|
|
73
|
-
getImportGraph(project?: string): Promise<
|
|
74
|
-
getTransitiveDependencies(filePath: string, project?: string): Promise<
|
|
59
|
+
}): SymbolSearchResult[];
|
|
60
|
+
searchAllRelations(query: RelationSearchQuery): CodeRelation[];
|
|
61
|
+
listIndexedFiles(project?: string): FileRecord[];
|
|
62
|
+
getInternalRelations(filePath: string, project?: string): CodeRelation[];
|
|
63
|
+
getFullSymbol(symbolName: string, filePath: string, project?: string): FullSymbol | null;
|
|
64
|
+
getFileStats(filePath: string, project?: string): FileStats;
|
|
65
|
+
getFileInfo(filePath: string, project?: string): FileRecord | null;
|
|
66
|
+
getSymbolsByFile(filePath: string, project?: string): SymbolSearchResult[];
|
|
67
|
+
getModuleInterface(filePath: string, project?: string): ModuleInterface;
|
|
68
|
+
getDependencies(filePath: string, project?: string, limit?: number): string[];
|
|
69
|
+
getDependents(filePath: string, project?: string, limit?: number): string[];
|
|
70
|
+
getAffected(changedFiles: string[], project?: string): Promise<string[]>;
|
|
71
|
+
hasCycle(project?: string): Promise<boolean>;
|
|
72
|
+
getImportGraph(project?: string): Promise<Map<string, string[]>>;
|
|
73
|
+
getTransitiveDependencies(filePath: string, project?: string): Promise<string[]>;
|
|
75
74
|
getCyclePaths(project?: string, options?: {
|
|
76
75
|
maxCycles?: number;
|
|
77
|
-
}): Promise<
|
|
78
|
-
getFanMetrics(filePath: string, project?: string): Promise<
|
|
79
|
-
getResolvedType(symbolName: string, filePath: string, project?: string):
|
|
80
|
-
getSemanticReferences(symbolName: string, filePath: string, project?: string):
|
|
81
|
-
getImplementations(symbolName: string, filePath: string, project?: string):
|
|
82
|
-
getSemanticModuleInterface(filePath: string):
|
|
76
|
+
}): Promise<string[][]>;
|
|
77
|
+
getFanMetrics(filePath: string, project?: string): Promise<FanMetrics>;
|
|
78
|
+
getResolvedType(symbolName: string, filePath: string, project?: string): ResolvedType | null;
|
|
79
|
+
getSemanticReferences(symbolName: string, filePath: string, project?: string): SemanticReference[];
|
|
80
|
+
getImplementations(symbolName: string, filePath: string, project?: string): Implementation[];
|
|
81
|
+
getSemanticModuleInterface(filePath: string): SemanticModuleInterface;
|
|
83
82
|
diffSymbols(before: SymbolSearchResult[], after: SymbolSearchResult[]): SymbolDiff;
|
|
84
83
|
onIndexed(callback: (result: IndexResult) => void): () => void;
|
|
85
|
-
reindex(): Promise<
|
|
86
|
-
resolveSymbol(symbolName: string, filePath: string, project?: string):
|
|
84
|
+
reindex(): Promise<IndexResult>;
|
|
85
|
+
resolveSymbol(symbolName: string, filePath: string, project?: string): ResolvedSymbol;
|
|
87
86
|
findPattern(pattern: string, opts?: {
|
|
88
87
|
filePaths?: string[];
|
|
89
88
|
project?: string;
|
|
90
|
-
}): Promise<
|
|
91
|
-
getHeritageChain(symbolName: string, filePath: string, project?: string): Promise<
|
|
89
|
+
}): Promise<PatternMatch[]>;
|
|
90
|
+
getHeritageChain(symbolName: string, filePath: string, project?: string): Promise<HeritageNode>;
|
|
92
91
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import { FileRepository } from '../store/repositories/file.repository';
|
|
3
2
|
import { SymbolRepository } from '../store/repositories/symbol.repository';
|
|
4
3
|
import { RelationRepository } from '../store/repositories/relation.repository';
|
|
@@ -13,7 +12,6 @@ import { symbolSearch as defaultSymbolSearch } from '../search/symbol-search';
|
|
|
13
12
|
import { relationSearch as defaultRelationSearch } from '../search/relation-search';
|
|
14
13
|
import type { PatternMatch } from '../search/pattern-search';
|
|
15
14
|
import { SemanticLayer } from '../semantic/index';
|
|
16
|
-
import type { GildashError } from '../errors';
|
|
17
15
|
import type { GildashContext, CoordinatorLike, WatcherLike, DbStore } from './context';
|
|
18
16
|
import type { GildashOptions } from './types';
|
|
19
17
|
export declare const HEARTBEAT_INTERVAL_MS = 30000;
|
|
@@ -46,17 +44,17 @@ export interface GildashInternalOptions {
|
|
|
46
44
|
loadTsconfigPathsFn?: typeof loadTsconfigPaths;
|
|
47
45
|
readFileFn?: (filePath: string) => Promise<string>;
|
|
48
46
|
unlinkFn?: (filePath: string) => Promise<void>;
|
|
49
|
-
semanticLayerFactory?: (tsconfigPath: string) =>
|
|
47
|
+
semanticLayerFactory?: (tsconfigPath: string) => SemanticLayer;
|
|
50
48
|
}
|
|
51
49
|
/** Create coordinator + watcher, start watcher, heartbeat timer, run fullIndex. */
|
|
52
50
|
export declare function setupOwnerInfrastructure(ctx: GildashContext, opts: {
|
|
53
51
|
isWatchMode: boolean;
|
|
54
52
|
}): Promise<void>;
|
|
55
53
|
/** Register SIGTERM / SIGINT / beforeExit handlers. */
|
|
56
|
-
export declare function registerSignalHandlers(ctx: GildashContext, closeFn: () => Promise<
|
|
54
|
+
export declare function registerSignalHandlers(ctx: GildashContext, closeFn: () => Promise<void>): void;
|
|
57
55
|
/** Initialize a GildashContext (replaces the old `Gildash.open()` body). */
|
|
58
|
-
export declare function initializeContext(options: GildashOptions & GildashInternalOptions): Promise<
|
|
56
|
+
export declare function initializeContext(options: GildashOptions & GildashInternalOptions): Promise<GildashContext>;
|
|
59
57
|
/** Shut down the context and release all resources. */
|
|
60
58
|
export declare function closeContext(ctx: GildashContext, opts?: {
|
|
61
59
|
cleanup?: boolean;
|
|
62
|
-
}): Promise<
|
|
60
|
+
}): Promise<void>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { SymbolSearchResult } from '../search/symbol-search';
|
|
3
2
|
import type { IndexResult } from '../indexer/index-coordinator';
|
|
4
3
|
import type { PatternMatch } from '../search/pattern-search';
|
|
5
|
-
import type { GildashError } from '../errors';
|
|
6
4
|
import type { GildashContext } from './context';
|
|
7
5
|
import type { SymbolDiff, ResolvedSymbol, HeritageNode } from './types';
|
|
8
6
|
/** Compare two snapshots of symbol search results and return a structured diff. */
|
|
@@ -10,13 +8,13 @@ export declare function diffSymbols(before: SymbolSearchResult[], after: SymbolS
|
|
|
10
8
|
/** Register a callback that fires after each indexing run completes. */
|
|
11
9
|
export declare function onIndexed(ctx: GildashContext, callback: (result: IndexResult) => void): () => void;
|
|
12
10
|
/** Trigger a full re-index of all tracked files. */
|
|
13
|
-
export declare function reindex(ctx: GildashContext): Promise<
|
|
11
|
+
export declare function reindex(ctx: GildashContext): Promise<IndexResult>;
|
|
14
12
|
/** Resolve the original definition location of a symbol by following its re-export chain. */
|
|
15
|
-
export declare function resolveSymbol(ctx: GildashContext, symbolName: string, filePath: string, project?: string):
|
|
13
|
+
export declare function resolveSymbol(ctx: GildashContext, symbolName: string, filePath: string, project?: string): ResolvedSymbol;
|
|
16
14
|
/** Search for an AST structural pattern across indexed TypeScript files. */
|
|
17
15
|
export declare function findPattern(ctx: GildashContext, pattern: string, opts?: {
|
|
18
16
|
filePaths?: string[];
|
|
19
17
|
project?: string;
|
|
20
|
-
}): Promise<
|
|
18
|
+
}): Promise<PatternMatch[]>;
|
|
21
19
|
/** Recursively traverse extends/implements relations to build a heritage tree. */
|
|
22
|
-
export declare function getHeritageChain(ctx: GildashContext, symbolName: string, filePath: string, project?: string): Promise<
|
|
20
|
+
export declare function getHeritageChain(ctx: GildashContext, symbolName: string, filePath: string, project?: string): Promise<HeritageNode>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { ParsedFile } from '../parser/types';
|
|
3
2
|
import type { ParserOptions } from 'oxc-parser';
|
|
4
|
-
import type { GildashError } from '../errors';
|
|
5
3
|
import type { GildashContext } from './context';
|
|
6
4
|
/** Parse a TypeScript source string into an AST and cache the result. */
|
|
7
|
-
export declare function parseSource(ctx: GildashContext, filePath: string, sourceText: string, options?: ParserOptions):
|
|
5
|
+
export declare function parseSource(ctx: GildashContext, filePath: string, sourceText: string, options?: ParserOptions): ParsedFile;
|
|
8
6
|
/** Parse multiple files concurrently and return a map of results. */
|
|
9
|
-
export declare function batchParse(ctx: GildashContext, filePaths: string[], options?: ParserOptions): Promise<
|
|
7
|
+
export declare function batchParse(ctx: GildashContext, filePaths: string[], options?: ParserOptions): Promise<Map<string, ParsedFile>>;
|
|
10
8
|
/** Retrieve a previously-parsed AST from the internal LRU cache. */
|
|
11
9
|
export declare function getParsedAst(ctx: GildashContext, filePath: string): ParsedFile | undefined;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { SymbolSearchQuery, SymbolSearchResult } from '../search/symbol-search';
|
|
3
2
|
import type { RelationSearchQuery } from '../search/relation-search';
|
|
4
3
|
import type { CodeRelation } from '../extractor/types';
|
|
5
4
|
import type { FileRecord } from '../store/repositories/file.repository';
|
|
6
5
|
import type { SymbolStats } from '../store/repositories/symbol.repository';
|
|
7
|
-
import type { GildashError } from '../errors';
|
|
8
6
|
import type { GildashContext } from './context';
|
|
9
7
|
import type { FullSymbol, FileStats, ModuleInterface } from './types';
|
|
10
8
|
/** Return aggregate symbol statistics for the given project. */
|
|
11
|
-
export declare function getStats(ctx: GildashContext, project?: string):
|
|
9
|
+
export declare function getStats(ctx: GildashContext, project?: string): SymbolStats;
|
|
12
10
|
/** Search indexed symbols by name, kind, file path, or export status. */
|
|
13
|
-
export declare function searchSymbols(ctx: GildashContext, query: SymbolSearchQuery):
|
|
11
|
+
export declare function searchSymbols(ctx: GildashContext, query: SymbolSearchQuery): SymbolSearchResult[];
|
|
14
12
|
/** Search indexed code relationships (imports, calls, extends, implements). */
|
|
15
|
-
export declare function searchRelations(ctx: GildashContext, query: RelationSearchQuery):
|
|
13
|
+
export declare function searchRelations(ctx: GildashContext, query: RelationSearchQuery): CodeRelation[];
|
|
16
14
|
/** Search symbols across all projects (no project filter). */
|
|
17
15
|
export declare function searchAllSymbols(ctx: GildashContext, query: Omit<SymbolSearchQuery, 'project'> & {
|
|
18
16
|
project?: string;
|
|
19
|
-
}):
|
|
17
|
+
}): SymbolSearchResult[];
|
|
20
18
|
/** Search relations across all projects (no project filter). */
|
|
21
|
-
export declare function searchAllRelations(ctx: GildashContext, query: RelationSearchQuery):
|
|
19
|
+
export declare function searchAllRelations(ctx: GildashContext, query: RelationSearchQuery): CodeRelation[];
|
|
22
20
|
/** List all files indexed for a given project. */
|
|
23
|
-
export declare function listIndexedFiles(ctx: GildashContext, project?: string):
|
|
21
|
+
export declare function listIndexedFiles(ctx: GildashContext, project?: string): FileRecord[];
|
|
24
22
|
/** Get all intra-file relations for a given file. */
|
|
25
|
-
export declare function getInternalRelations(ctx: GildashContext, filePath: string, project?: string):
|
|
23
|
+
export declare function getInternalRelations(ctx: GildashContext, filePath: string, project?: string): CodeRelation[];
|
|
26
24
|
/** Retrieve full details for a named symbol in a specific file. */
|
|
27
|
-
export declare function getFullSymbol(ctx: GildashContext, symbolName: string, filePath: string, project?: string):
|
|
25
|
+
export declare function getFullSymbol(ctx: GildashContext, symbolName: string, filePath: string, project?: string): FullSymbol | null;
|
|
28
26
|
/** Retrieve statistics for an indexed file. */
|
|
29
|
-
export declare function getFileStats(ctx: GildashContext, filePath: string, project?: string):
|
|
27
|
+
export declare function getFileStats(ctx: GildashContext, filePath: string, project?: string): FileStats;
|
|
30
28
|
/** Retrieve metadata for an indexed file. */
|
|
31
|
-
export declare function getFileInfo(ctx: GildashContext, filePath: string, project?: string):
|
|
29
|
+
export declare function getFileInfo(ctx: GildashContext, filePath: string, project?: string): FileRecord | null;
|
|
32
30
|
/** List all symbols declared in a specific file. */
|
|
33
|
-
export declare function getSymbolsByFile(ctx: GildashContext, filePath: string, project?: string):
|
|
31
|
+
export declare function getSymbolsByFile(ctx: GildashContext, filePath: string, project?: string): SymbolSearchResult[];
|
|
34
32
|
/** Return the public interface of a module. */
|
|
35
|
-
export declare function getModuleInterface(ctx: GildashContext, filePath: string, project?: string):
|
|
33
|
+
export declare function getModuleInterface(ctx: GildashContext, filePath: string, project?: string): ModuleInterface;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type Result } from '@zipbul/result';
|
|
2
1
|
import type { SymbolSearchResult } from '../search/symbol-search';
|
|
3
|
-
import type { GildashError } from '../errors';
|
|
4
2
|
import type { ResolvedType, SemanticReference, Implementation, SemanticModuleInterface } from '../semantic/types';
|
|
5
3
|
import type { GildashContext } from './context';
|
|
6
4
|
/**
|
|
@@ -13,10 +11,10 @@ export declare function resolveSymbolPosition(ctx: GildashContext, symbolName: s
|
|
|
13
11
|
absPath: string;
|
|
14
12
|
} | null;
|
|
15
13
|
/** Retrieve the resolved type of a symbol using the Semantic Layer. */
|
|
16
|
-
export declare function getResolvedType(ctx: GildashContext, symbolName: string, filePath: string, project?: string):
|
|
14
|
+
export declare function getResolvedType(ctx: GildashContext, symbolName: string, filePath: string, project?: string): ResolvedType | null;
|
|
17
15
|
/** Find all semantic references to a symbol. */
|
|
18
|
-
export declare function getSemanticReferences(ctx: GildashContext, symbolName: string, filePath: string, project?: string):
|
|
16
|
+
export declare function getSemanticReferences(ctx: GildashContext, symbolName: string, filePath: string, project?: string): SemanticReference[];
|
|
19
17
|
/** Find implementations of an interface/abstract class. */
|
|
20
|
-
export declare function getImplementations(ctx: GildashContext, symbolName: string, filePath: string, project?: string):
|
|
18
|
+
export declare function getImplementations(ctx: GildashContext, symbolName: string, filePath: string, project?: string): Implementation[];
|
|
21
19
|
/** Retrieve the semantic module interface — exported symbols with resolved types. */
|
|
22
|
-
export declare function getSemanticModuleInterface(ctx: GildashContext, filePath: string):
|
|
20
|
+
export declare function getSemanticModuleInterface(ctx: GildashContext, filePath: string): SemanticModuleInterface;
|
|
@@ -123,6 +123,8 @@ export interface ResolvedSymbol {
|
|
|
123
123
|
filePath: string;
|
|
124
124
|
exportedAs: string;
|
|
125
125
|
}>;
|
|
126
|
+
/** Whether a circular re-export chain was detected. */
|
|
127
|
+
circular: boolean;
|
|
126
128
|
}
|
|
127
129
|
/**
|
|
128
130
|
* Options for creating a {@link Gildash} instance via {@link Gildash.open}.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Gildash } from "./gildash";
|
|
2
2
|
export type { GildashOptions, Logger, SymbolDiff, ModuleInterface, HeritageNode, FullSymbol, FileStats, FanMetrics, ResolvedSymbol } from "./gildash";
|
|
3
|
-
export { gildashError } from "./errors";
|
|
4
|
-
export type {
|
|
3
|
+
export { GildashError, gildashError } from "./errors";
|
|
4
|
+
export type { GildashErrorType } from "./errors";
|
|
5
5
|
export { symbolSearch } from "./search/symbol-search";
|
|
6
6
|
export type { SymbolSearchQuery, SymbolSearchResult } from "./search/symbol-search";
|
|
7
7
|
export { relationSearch } from "./search/relation-search";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zipbul/gildash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "TypeScript code indexing and dependency graph engine for Bun",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ast-grep/napi": "^0.41.0",
|
|
46
46
|
"@parcel/watcher": "^2.5.6",
|
|
47
|
+
"@zipbul/result": "^0.1.4",
|
|
47
48
|
"comment-parser": "1.4.5",
|
|
48
49
|
"drizzle-orm": "^0.45.1",
|
|
49
50
|
"oxc-parser": "0.115.0"
|
|
@@ -59,7 +60,11 @@
|
|
|
59
60
|
"typescript": "^5.8.0"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
|
-
"
|
|
63
|
-
|
|
63
|
+
"typescript": ">=5.0.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"typescript": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
}
|