@zipbul/gildash 0.14.0 → 0.15.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.
@@ -1,19 +1,19 @@
1
1
  export { Gildash } from "./gildash";
2
- export type { GildashOptions, Logger, SymbolDiff, ModuleInterface, HeritageNode, FullSymbol, FileStats, FanMetrics, ResolvedSymbol } from "./gildash";
2
+ export type { GildashOptions, Logger, SymbolDiff, ModuleInterface, HeritageNode, FullSymbol, FileStats, FanMetrics, ResolvedSymbol, BatchParseResult } from "./gildash";
3
3
  export { GildashError } from "./errors";
4
4
  export type { GildashErrorType } from "./errors";
5
5
  export { symbolSearch } from "./search/symbol-search";
6
- export type { SymbolSearchQuery, SymbolSearchResult } from "./search/symbol-search";
6
+ export type { SymbolSearchQuery, SymbolSearchResult, SymbolDetail } from "./search/symbol-search";
7
7
  export { relationSearch } from "./search/relation-search";
8
8
  export type { RelationSearchQuery, StoredCodeRelation } from "./search/relation-search";
9
9
  export { DependencyGraph } from "./search/dependency-graph";
10
10
  export { patternSearch } from "./search/pattern-search";
11
- export type { PatternMatch, PatternSearchOptions } from "./search/pattern-search";
11
+ export type { PatternMatch } from "./search/pattern-search";
12
12
  export type { IndexResult } from "./indexer/index-coordinator";
13
13
  export type { ProjectBoundary } from "./common/project-discovery";
14
- export type { CodeRelation, SymbolKind } from "./extractor/types";
14
+ export type { CodeRelation, ExtractedSymbol, SymbolKind, Decorator, Parameter, Heritage, Modifier, JsDocBlock, JsDocTag } from "./extractor/types";
15
15
  export type { SymbolStats } from "./store/repositories/symbol.repository";
16
- export type { WatcherRole } from "./watcher/types";
16
+ export type { WatcherRole, FileChangeEvent } from "./watcher/types";
17
17
  export type { ParsedFile } from "./parser/types";
18
18
  export type { FileRecord } from "./store/repositories/file.repository";
19
19
  export type { ResolvedType, SemanticReference, Implementation, SemanticModuleInterface, SemanticDiagnostic, GetDiagnosticsOptions } from "./semantic/types";
@@ -21,3 +21,8 @@ export type { SymbolNode } from "./semantic/symbol-graph";
21
21
  export type { AnnotationSource, ExtractedAnnotation } from "./extractor/types";
22
22
  export type { AnnotationSearchQuery, AnnotationSearchResult } from "./search/annotation-search";
23
23
  export type { SymbolChange, SymbolChangeType, SymbolChangeQueryOptions } from "./gildash/types";
24
+ export { buildLineOffsets, getLineColumn } from './parser/source-position';
25
+ export type { SourcePosition, SourceSpan } from './parser/types';
26
+ export type { Program, Node } from 'oxc-parser';
27
+ export { Visitor, visitorKeys } from 'oxc-parser';
28
+ export type { VisitorObject } from 'oxc-parser';
@@ -79,19 +79,19 @@ export interface IndexResult {
79
79
  added: Array<{
80
80
  type: string;
81
81
  srcFilePath: string;
82
- dstFilePath: string;
82
+ dstFilePath: string | null;
83
83
  srcSymbolName: string | null;
84
84
  dstSymbolName: string | null;
85
- dstProject: string;
85
+ dstProject: string | null;
86
86
  metaJson: string | null;
87
87
  }>;
88
88
  removed: Array<{
89
89
  type: string;
90
90
  srcFilePath: string;
91
- dstFilePath: string;
91
+ dstFilePath: string | null;
92
92
  srcSymbolName: string | null;
93
93
  dstSymbolName: string | null;
94
- dstProject: string;
94
+ dstProject: string | null;
95
95
  metaJson: string | null;
96
96
  }>;
97
97
  };
@@ -132,6 +132,7 @@ export interface IndexCoordinatorOptions {
132
132
  newDstProject?: string;
133
133
  }): void;
134
134
  deleteFileRelations(project: string, filePath: string): void;
135
+ deleteIncomingRelations(dstProject: string, dstFilePath: string): void;
135
136
  getOutgoing(project: string, srcFilePath: string): RelationRecord[];
136
137
  };
137
138
  annotationRepo?: {
@@ -6,10 +6,12 @@ export interface RelationDbRow {
6
6
  type: string;
7
7
  srcFilePath: string;
8
8
  srcSymbolName: string | null;
9
- dstProject: string;
10
- dstFilePath: string;
9
+ dstProject: string | null;
10
+ dstFilePath: string | null;
11
11
  dstSymbolName: string | null;
12
12
  metaJson: string | null;
13
+ specifier: string | null;
14
+ isExternal: number;
13
15
  }
14
16
  interface RelationRepoPart {
15
17
  replaceFileRelations(project: string, filePath: string, relations: RelationDbRow[]): void;
@@ -25,6 +27,8 @@ export interface IndexFileRelationsOptions {
25
27
  knownFiles?: Set<string>;
26
28
  /** 프로젝트 경계 목록 (dstProject 결정용) */
27
29
  boundaries?: ProjectBoundary[];
30
+ /** Pre-extracted module metadata for re-export pattern B/C detection. */
31
+ module?: import('oxc-parser').EcmaScriptModule;
28
32
  }
29
33
  export declare function indexFileRelations(opts: IndexFileRelationsOptions): number;
30
34
  export {};
@@ -1,8 +1,4 @@
1
1
  import type { QualifiedName } from '../extractor/types';
2
- export declare function isNode(value: unknown): value is Record<string, unknown>;
3
- export declare function isNodeArray(value: unknown): value is ReadonlyArray<unknown>;
4
- export declare function visit(node: unknown, callback: (node: Record<string, unknown>) => void): void;
5
- export declare function collectNodes(root: unknown, predicate: (node: Record<string, unknown>) => boolean): Record<string, unknown>[];
6
2
  export declare function getNodeHeader(node: Record<string, unknown>, parent?: Record<string, unknown> | null): string;
7
3
  export declare function isFunctionNode(node: Record<string, unknown>): boolean;
8
4
  export declare function getNodeName(node: unknown): string | null;
@@ -1,6 +1,6 @@
1
1
  export { parseSource } from './parse-source';
2
2
  export { ParseCache } from './parse-cache';
3
3
  export { buildLineOffsets, getLineColumn, } from './source-position';
4
- export { isNode, isNodeArray, visit, collectNodes, getNodeHeader, isFunctionNode, getNodeName, getStringLiteralValue, getQualifiedName, } from './ast-utils';
4
+ export { getNodeHeader, isFunctionNode, getNodeName, getStringLiteralValue, getQualifiedName, } from './ast-utils';
5
5
  export { parseJsDoc } from './jsdoc-parser';
6
6
  export type { ParsedFile, SourcePosition, SourceSpan } from './types';
@@ -1,4 +1,4 @@
1
- import type { Program, Comment, OxcError } from 'oxc-parser';
1
+ import type { Program, Comment, OxcError, EcmaScriptModule } from 'oxc-parser';
2
2
  export interface SourcePosition {
3
3
  line: number;
4
4
  column: number;
@@ -31,4 +31,6 @@ export interface ParsedFile {
31
31
  comments: readonly Comment[];
32
32
  /** Raw source text that was parsed. */
33
33
  sourceText: string;
34
+ /** Pre-extracted ESM module metadata (imports, exports, dynamic imports). */
35
+ module: EcmaScriptModule;
34
36
  }
@@ -34,7 +34,7 @@ export interface IAnnotationRepo {
34
34
  symbolName?: string;
35
35
  source?: string;
36
36
  ftsQuery?: string;
37
- limit: number;
37
+ limit?: number;
38
38
  }): AnnotationRecord[];
39
39
  }
40
40
  export declare function annotationSearch(options: {
@@ -5,7 +5,7 @@ import type { RelationRecord } from '../store/repositories/relation.repository';
5
5
  * as stored in the relation index.
6
6
  */
7
7
  export interface StoredCodeRelation extends CodeRelation {
8
- dstProject: string;
8
+ dstProject: string | null;
9
9
  }
10
10
  /**
11
11
  * Filters for {@link relationSearch}.
@@ -31,8 +31,12 @@ export interface RelationSearchQuery {
31
31
  type?: CodeRelation['type'];
32
32
  /** Limit results to this project. */
33
33
  project?: string;
34
- /** Maximum number of results. Defaults to `500`. */
34
+ /** Maximum number of results. When omitted, no limit is applied. */
35
35
  limit?: number;
36
+ /** Filter by raw import specifier. */
37
+ specifier?: string;
38
+ /** Filter by external package flag. */
39
+ isExternal?: boolean;
36
40
  }
37
41
  export interface IRelationRepo {
38
42
  searchRelations(opts: {
@@ -43,7 +47,9 @@ export interface IRelationRepo {
43
47
  dstProject?: string;
44
48
  type?: string;
45
49
  project?: string;
46
- limit: number;
50
+ specifier?: string;
51
+ isExternal?: boolean;
52
+ limit?: number;
47
53
  }): RelationRecord[];
48
54
  }
49
55
  /**
@@ -1,4 +1,4 @@
1
- import type { SymbolKind } from '../extractor/types';
1
+ import type { SymbolKind, Modifier, Decorator, JsDocBlock } from '../extractor/types';
2
2
  import type { SymbolRecord } from '../store/repositories/symbol.repository';
3
3
  /**
4
4
  * Filters for {@link symbolSearch}.
@@ -18,7 +18,7 @@ export interface SymbolSearchQuery {
18
18
  isExported?: boolean;
19
19
  /** Limit results to this project. Defaults to the primary project. */
20
20
  project?: string;
21
- /** Maximum number of results. Defaults to `100`. */
21
+ /** Maximum number of results. When omitted, no limit is applied. */
22
22
  limit?: number;
23
23
  /**
24
24
  * Filter by decorator name (LEG-1).
@@ -36,6 +36,48 @@ export interface SymbolSearchQuery {
36
36
  */
37
37
  resolvedType?: string;
38
38
  }
39
+ /**
40
+ * Typed detail fields stored in the symbol's `detailJson` column.
41
+ *
42
+ * These fields match what {@link buildDetailJson} in `symbol-indexer.ts` serialises.
43
+ * Not every field is present on every symbol — only the fields relevant to the
44
+ * symbol's kind are populated.
45
+ */
46
+ export interface SymbolDetail {
47
+ /** Function/method parameters. */
48
+ parameters?: Array<{
49
+ name: string;
50
+ type?: string;
51
+ isOptional: boolean;
52
+ defaultValue?: string;
53
+ decorators?: Decorator[];
54
+ }>;
55
+ /** Return type annotation as source text. */
56
+ returnType?: string;
57
+ /** Heritage clauses (`extends` / `implements`). */
58
+ heritage?: Array<{
59
+ kind: 'extends' | 'implements';
60
+ name: string;
61
+ typeArguments?: string[];
62
+ }>;
63
+ /** Decorators applied to this symbol. */
64
+ decorators?: Decorator[];
65
+ /** Generic type parameter names. */
66
+ typeParameters?: string[];
67
+ /** Declaration modifiers. */
68
+ modifiers?: Modifier[];
69
+ /** Class/interface members. */
70
+ members?: Array<{
71
+ name: string;
72
+ kind: string;
73
+ type?: string;
74
+ visibility?: string;
75
+ isStatic?: boolean;
76
+ isReadonly?: boolean;
77
+ }>;
78
+ /** Parsed JSDoc comment associated with this symbol. */
79
+ jsDoc?: JsDocBlock;
80
+ }
39
81
  /**
40
82
  * A single result returned by {@link symbolSearch}.
41
83
  */
@@ -67,8 +109,8 @@ export interface SymbolSearchResult {
67
109
  signature: string | null;
68
110
  /** Content-hash fingerprint for change detection. */
69
111
  fingerprint: string | null;
70
- /** Arbitrary detail fields stored as JSON. */
71
- detail: Record<string, unknown>;
112
+ /** Typed detail fields parsed from the stored JSON. */
113
+ detail: SymbolDetail;
72
114
  }
73
115
  export interface ISymbolRepo {
74
116
  searchByQuery(opts: {
@@ -78,7 +120,7 @@ export interface ISymbolRepo {
78
120
  filePath?: string;
79
121
  isExported?: boolean;
80
122
  project?: string;
81
- limit: number;
123
+ limit?: number;
82
124
  decorator?: string;
83
125
  regex?: string;
84
126
  resolvedType?: string;
@@ -46,6 +46,13 @@ export declare class SemanticLayer {
46
46
  anyConstituent?: boolean;
47
47
  }): boolean | null;
48
48
  getSymbolNode(filePath: string, position: number): SymbolNode | null;
49
+ /**
50
+ * Return the base types (supertypes) of the class/interface at the given position.
51
+ *
52
+ * Uses `checker.getBaseTypes()` which only works on interface/class types.
53
+ * Returns `null` if the type at position is not a class or interface.
54
+ */
55
+ getBaseTypes(filePath: string, position: number): ResolvedType[] | null;
49
56
  getModuleInterface(filePath: string): SemanticModuleInterface;
50
57
  notifyFileChanged(filePath: string, content: string): void;
51
58
  /**
@@ -4,8 +4,15 @@
4
4
  * TscProgram에서 Program/TypeChecker를 가져와 AST를 탐색하고
5
5
  * 각 심볼 위치의 타입을 ResolvedType으로 변환한다.
6
6
  */
7
+ import ts from "typescript";
7
8
  import type { ResolvedType } from "./types";
8
9
  import type { TscProgram } from "./tsc-program";
10
+ /**
11
+ * `ts.Type`을 `ResolvedType`으로 재귀 변환한다.
12
+ *
13
+ * 순환 타입에 대비해 `depth`로 재귀 깊이를 제한한다.
14
+ */
15
+ export declare function buildResolvedType(checker: ts.TypeChecker, type: ts.Type, depth?: number): ResolvedType;
9
16
  export declare class TypeCollector {
10
17
  private readonly program;
11
18
  constructor(program: TscProgram);
@@ -40,6 +40,15 @@ export interface ResolvedType {
40
40
  * e.g. `Promise<string>` → `[{ text: "string", ... }]`
41
41
  */
42
42
  typeArguments?: ResolvedType[];
43
+ /**
44
+ * Properties of an object type, enumerated via `checker.getPropertiesOfType()`.
45
+ * Only populated for non-union, non-intersection, non-primitive object types.
46
+ * Capped at 50 properties to avoid huge type expansions.
47
+ */
48
+ properties?: Array<{
49
+ name: string;
50
+ type: ResolvedType;
51
+ }>;
43
52
  }
44
53
  /**
45
54
  * A single reference to a symbol, resolved via `LanguageService.findReferences`.
@@ -25,6 +25,6 @@ export declare class AnnotationRepository {
25
25
  symbolName?: string;
26
26
  source?: string;
27
27
  ftsQuery?: string;
28
- limit: number;
28
+ limit?: number;
29
29
  }): AnnotationRecord[];
30
30
  }
@@ -4,10 +4,12 @@ export interface RelationRecord {
4
4
  type: string;
5
5
  srcFilePath: string;
6
6
  srcSymbolName: string | null;
7
- dstProject: string;
8
- dstFilePath: string;
7
+ dstProject: string | null;
8
+ dstFilePath: string | null;
9
9
  dstSymbolName: string | null;
10
10
  metaJson: string | null;
11
+ specifier: string | null;
12
+ isExternal: number;
11
13
  }
12
14
  export declare class RelationRepository {
13
15
  private readonly db;
@@ -20,6 +22,7 @@ export declare class RelationRepository {
20
22
  }): RelationRecord[];
21
23
  getByType(project: string, type: string): RelationRecord[];
22
24
  deleteFileRelations(project: string, srcFilePath: string): void;
25
+ deleteIncomingRelations(dstProject: string, dstFilePath: string): void;
23
26
  searchRelations(opts: {
24
27
  srcFilePath?: string;
25
28
  srcSymbolName?: string;
@@ -28,7 +31,9 @@ export declare class RelationRepository {
28
31
  dstSymbolName?: string;
29
32
  type?: string;
30
33
  project?: string;
31
- limit: number;
34
+ specifier?: string;
35
+ isExternal?: boolean;
36
+ limit?: number;
32
37
  }): RelationRecord[];
33
38
  retargetRelations(opts: {
34
39
  dstProject: string;
@@ -49,7 +49,7 @@ export declare class SymbolRepository {
49
49
  filePath?: string;
50
50
  isExported?: boolean;
51
51
  project?: string;
52
- limit: number;
52
+ limit?: number;
53
53
  decorator?: string;
54
54
  regex?: string;
55
55
  resolvedType?: string;
@@ -554,7 +554,7 @@ export declare const relations: import("drizzle-orm/sqlite-core").SQLiteTableWit
554
554
  columnType: "SQLiteText";
555
555
  data: string;
556
556
  driverParam: string;
557
- notNull: true;
557
+ notNull: false;
558
558
  hasDefault: false;
559
559
  isPrimaryKey: false;
560
560
  isAutoincrement: false;
@@ -573,7 +573,7 @@ export declare const relations: import("drizzle-orm/sqlite-core").SQLiteTableWit
573
573
  columnType: "SQLiteText";
574
574
  data: string;
575
575
  driverParam: string;
576
- notNull: true;
576
+ notNull: false;
577
577
  hasDefault: false;
578
578
  isPrimaryKey: false;
579
579
  isAutoincrement: false;
@@ -623,6 +623,42 @@ export declare const relations: import("drizzle-orm/sqlite-core").SQLiteTableWit
623
623
  }, {}, {
624
624
  length: number | undefined;
625
625
  }>;
626
+ specifier: import("drizzle-orm/sqlite-core").SQLiteColumn<{
627
+ name: "specifier";
628
+ tableName: "relations";
629
+ dataType: "string";
630
+ columnType: "SQLiteText";
631
+ data: string;
632
+ driverParam: string;
633
+ notNull: false;
634
+ hasDefault: false;
635
+ isPrimaryKey: false;
636
+ isAutoincrement: false;
637
+ hasRuntimeDefault: false;
638
+ enumValues: [string, ...string[]];
639
+ baseColumn: never;
640
+ identity: undefined;
641
+ generated: undefined;
642
+ }, {}, {
643
+ length: number | undefined;
644
+ }>;
645
+ isExternal: import("drizzle-orm/sqlite-core").SQLiteColumn<{
646
+ name: "is_external";
647
+ tableName: "relations";
648
+ dataType: "number";
649
+ columnType: "SQLiteInteger";
650
+ data: number;
651
+ driverParam: number;
652
+ notNull: true;
653
+ hasDefault: true;
654
+ isPrimaryKey: false;
655
+ isAutoincrement: false;
656
+ hasRuntimeDefault: false;
657
+ enumValues: undefined;
658
+ baseColumn: never;
659
+ identity: undefined;
660
+ generated: undefined;
661
+ }, {}, {}>;
626
662
  };
627
663
  dialect: "sqlite";
628
664
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zipbul/gildash",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "TypeScript code indexing and dependency graph engine for Bun",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,7 +49,8 @@
49
49
  "@zipbul/result": "^0.1.4",
50
50
  "comment-parser": "1.4.5",
51
51
  "drizzle-orm": "^0.45.1",
52
- "oxc-parser": "0.115.0"
52
+ "oxc-parser": "0.121.0",
53
+ "oxc-walker": "^0.7.0"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@changesets/changelog-github": "^0.5.2",