@zipbul/gildash 0.0.1 → 0.0.2

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,408 +0,0 @@
1
- {
2
- "version": "6",
3
- "dialect": "sqlite",
4
- "id": "dde10964-60b8-4981-af9f-7d4664d0d20a",
5
- "prevId": "00000000-0000-0000-0000-000000000000",
6
- "tables": {
7
- "files": {
8
- "name": "files",
9
- "columns": {
10
- "project": {
11
- "name": "project",
12
- "type": "text",
13
- "primaryKey": false,
14
- "notNull": true,
15
- "autoincrement": false
16
- },
17
- "file_path": {
18
- "name": "file_path",
19
- "type": "text",
20
- "primaryKey": false,
21
- "notNull": true,
22
- "autoincrement": false
23
- },
24
- "mtime_ms": {
25
- "name": "mtime_ms",
26
- "type": "real",
27
- "primaryKey": false,
28
- "notNull": true,
29
- "autoincrement": false
30
- },
31
- "size": {
32
- "name": "size",
33
- "type": "integer",
34
- "primaryKey": false,
35
- "notNull": true,
36
- "autoincrement": false
37
- },
38
- "content_hash": {
39
- "name": "content_hash",
40
- "type": "text",
41
- "primaryKey": false,
42
- "notNull": true,
43
- "autoincrement": false
44
- },
45
- "updated_at": {
46
- "name": "updated_at",
47
- "type": "text",
48
- "primaryKey": false,
49
- "notNull": true,
50
- "autoincrement": false
51
- }
52
- },
53
- "indexes": {},
54
- "foreignKeys": {},
55
- "compositePrimaryKeys": {
56
- "files_project_file_path_pk": {
57
- "columns": [
58
- "project",
59
- "file_path"
60
- ],
61
- "name": "files_project_file_path_pk"
62
- }
63
- },
64
- "uniqueConstraints": {},
65
- "checkConstraints": {}
66
- },
67
- "relations": {
68
- "name": "relations",
69
- "columns": {
70
- "id": {
71
- "name": "id",
72
- "type": "integer",
73
- "primaryKey": true,
74
- "notNull": true,
75
- "autoincrement": true
76
- },
77
- "project": {
78
- "name": "project",
79
- "type": "text",
80
- "primaryKey": false,
81
- "notNull": true,
82
- "autoincrement": false
83
- },
84
- "type": {
85
- "name": "type",
86
- "type": "text",
87
- "primaryKey": false,
88
- "notNull": true,
89
- "autoincrement": false
90
- },
91
- "src_file_path": {
92
- "name": "src_file_path",
93
- "type": "text",
94
- "primaryKey": false,
95
- "notNull": true,
96
- "autoincrement": false
97
- },
98
- "src_symbol_name": {
99
- "name": "src_symbol_name",
100
- "type": "text",
101
- "primaryKey": false,
102
- "notNull": false,
103
- "autoincrement": false
104
- },
105
- "dst_file_path": {
106
- "name": "dst_file_path",
107
- "type": "text",
108
- "primaryKey": false,
109
- "notNull": true,
110
- "autoincrement": false
111
- },
112
- "dst_symbol_name": {
113
- "name": "dst_symbol_name",
114
- "type": "text",
115
- "primaryKey": false,
116
- "notNull": false,
117
- "autoincrement": false
118
- },
119
- "meta_json": {
120
- "name": "meta_json",
121
- "type": "text",
122
- "primaryKey": false,
123
- "notNull": false,
124
- "autoincrement": false
125
- }
126
- },
127
- "indexes": {
128
- "idx_relations_src": {
129
- "name": "idx_relations_src",
130
- "columns": [
131
- "project",
132
- "src_file_path"
133
- ],
134
- "isUnique": false
135
- },
136
- "idx_relations_dst": {
137
- "name": "idx_relations_dst",
138
- "columns": [
139
- "project",
140
- "dst_file_path"
141
- ],
142
- "isUnique": false
143
- },
144
- "idx_relations_type": {
145
- "name": "idx_relations_type",
146
- "columns": [
147
- "project",
148
- "type"
149
- ],
150
- "isUnique": false
151
- }
152
- },
153
- "foreignKeys": {
154
- "relations_project_src_file_path_files_project_file_path_fk": {
155
- "name": "relations_project_src_file_path_files_project_file_path_fk",
156
- "tableFrom": "relations",
157
- "tableTo": "files",
158
- "columnsFrom": [
159
- "project",
160
- "src_file_path"
161
- ],
162
- "columnsTo": [
163
- "project",
164
- "file_path"
165
- ],
166
- "onDelete": "cascade",
167
- "onUpdate": "no action"
168
- },
169
- "relations_project_dst_file_path_files_project_file_path_fk": {
170
- "name": "relations_project_dst_file_path_files_project_file_path_fk",
171
- "tableFrom": "relations",
172
- "tableTo": "files",
173
- "columnsFrom": [
174
- "project",
175
- "dst_file_path"
176
- ],
177
- "columnsTo": [
178
- "project",
179
- "file_path"
180
- ],
181
- "onDelete": "cascade",
182
- "onUpdate": "no action"
183
- }
184
- },
185
- "compositePrimaryKeys": {},
186
- "uniqueConstraints": {},
187
- "checkConstraints": {}
188
- },
189
- "symbols": {
190
- "name": "symbols",
191
- "columns": {
192
- "id": {
193
- "name": "id",
194
- "type": "integer",
195
- "primaryKey": true,
196
- "notNull": true,
197
- "autoincrement": true
198
- },
199
- "project": {
200
- "name": "project",
201
- "type": "text",
202
- "primaryKey": false,
203
- "notNull": true,
204
- "autoincrement": false
205
- },
206
- "file_path": {
207
- "name": "file_path",
208
- "type": "text",
209
- "primaryKey": false,
210
- "notNull": true,
211
- "autoincrement": false
212
- },
213
- "kind": {
214
- "name": "kind",
215
- "type": "text",
216
- "primaryKey": false,
217
- "notNull": true,
218
- "autoincrement": false
219
- },
220
- "name": {
221
- "name": "name",
222
- "type": "text",
223
- "primaryKey": false,
224
- "notNull": true,
225
- "autoincrement": false
226
- },
227
- "start_line": {
228
- "name": "start_line",
229
- "type": "integer",
230
- "primaryKey": false,
231
- "notNull": true,
232
- "autoincrement": false
233
- },
234
- "start_column": {
235
- "name": "start_column",
236
- "type": "integer",
237
- "primaryKey": false,
238
- "notNull": true,
239
- "autoincrement": false
240
- },
241
- "end_line": {
242
- "name": "end_line",
243
- "type": "integer",
244
- "primaryKey": false,
245
- "notNull": true,
246
- "autoincrement": false
247
- },
248
- "end_column": {
249
- "name": "end_column",
250
- "type": "integer",
251
- "primaryKey": false,
252
- "notNull": true,
253
- "autoincrement": false
254
- },
255
- "is_exported": {
256
- "name": "is_exported",
257
- "type": "integer",
258
- "primaryKey": false,
259
- "notNull": true,
260
- "autoincrement": false,
261
- "default": 0
262
- },
263
- "signature": {
264
- "name": "signature",
265
- "type": "text",
266
- "primaryKey": false,
267
- "notNull": false,
268
- "autoincrement": false
269
- },
270
- "fingerprint": {
271
- "name": "fingerprint",
272
- "type": "text",
273
- "primaryKey": false,
274
- "notNull": false,
275
- "autoincrement": false
276
- },
277
- "detail_json": {
278
- "name": "detail_json",
279
- "type": "text",
280
- "primaryKey": false,
281
- "notNull": false,
282
- "autoincrement": false
283
- },
284
- "content_hash": {
285
- "name": "content_hash",
286
- "type": "text",
287
- "primaryKey": false,
288
- "notNull": true,
289
- "autoincrement": false
290
- },
291
- "indexed_at": {
292
- "name": "indexed_at",
293
- "type": "text",
294
- "primaryKey": false,
295
- "notNull": true,
296
- "autoincrement": false
297
- }
298
- },
299
- "indexes": {
300
- "idx_symbols_project_file": {
301
- "name": "idx_symbols_project_file",
302
- "columns": [
303
- "project",
304
- "file_path"
305
- ],
306
- "isUnique": false
307
- },
308
- "idx_symbols_project_kind": {
309
- "name": "idx_symbols_project_kind",
310
- "columns": [
311
- "project",
312
- "kind"
313
- ],
314
- "isUnique": false
315
- },
316
- "idx_symbols_project_name": {
317
- "name": "idx_symbols_project_name",
318
- "columns": [
319
- "project",
320
- "name"
321
- ],
322
- "isUnique": false
323
- },
324
- "idx_symbols_fingerprint": {
325
- "name": "idx_symbols_fingerprint",
326
- "columns": [
327
- "project",
328
- "fingerprint"
329
- ],
330
- "isUnique": false
331
- }
332
- },
333
- "foreignKeys": {
334
- "symbols_project_file_path_files_project_file_path_fk": {
335
- "name": "symbols_project_file_path_files_project_file_path_fk",
336
- "tableFrom": "symbols",
337
- "tableTo": "files",
338
- "columnsFrom": [
339
- "project",
340
- "file_path"
341
- ],
342
- "columnsTo": [
343
- "project",
344
- "file_path"
345
- ],
346
- "onDelete": "cascade",
347
- "onUpdate": "no action"
348
- }
349
- },
350
- "compositePrimaryKeys": {},
351
- "uniqueConstraints": {},
352
- "checkConstraints": {}
353
- },
354
- "watcher_owner": {
355
- "name": "watcher_owner",
356
- "columns": {
357
- "id": {
358
- "name": "id",
359
- "type": "integer",
360
- "primaryKey": true,
361
- "notNull": true,
362
- "autoincrement": false
363
- },
364
- "pid": {
365
- "name": "pid",
366
- "type": "integer",
367
- "primaryKey": false,
368
- "notNull": true,
369
- "autoincrement": false
370
- },
371
- "started_at": {
372
- "name": "started_at",
373
- "type": "text",
374
- "primaryKey": false,
375
- "notNull": true,
376
- "autoincrement": false
377
- },
378
- "heartbeat_at": {
379
- "name": "heartbeat_at",
380
- "type": "text",
381
- "primaryKey": false,
382
- "notNull": true,
383
- "autoincrement": false
384
- }
385
- },
386
- "indexes": {},
387
- "foreignKeys": {},
388
- "compositePrimaryKeys": {},
389
- "uniqueConstraints": {},
390
- "checkConstraints": {
391
- "watcher_owner_singleton": {
392
- "name": "watcher_owner_singleton",
393
- "value": "\"watcher_owner\".\"id\" = 1"
394
- }
395
- }
396
- }
397
- },
398
- "views": {},
399
- "enums": {},
400
- "_meta": {
401
- "schemas": {},
402
- "tables": {},
403
- "columns": {}
404
- },
405
- "internal": {
406
- "indexes": {}
407
- }
408
- }
@@ -1,13 +0,0 @@
1
- {
2
- "version": "7",
3
- "dialect": "sqlite",
4
- "entries": [
5
- {
6
- "idx": 0,
7
- "version": "6",
8
- "when": 1771705270251,
9
- "tag": "0000_soft_revanche",
10
- "breakpoints": true
11
- }
12
- ]
13
- }
@@ -1,103 +0,0 @@
1
- import type { ParsedFile } from './parser/types';
2
- import { parseSource as defaultParseSource } from './parser/parse-source';
3
- import { ParseCache } from './parser/parse-cache';
4
- import type { ExtractedSymbol } from './extractor/types';
5
- import { extractSymbols as defaultExtractSymbols } from './extractor/symbol-extractor';
6
- import { extractRelations as defaultExtractRelations } from './extractor/relation-extractor';
7
- import type { CodeRelation } from './extractor/types';
8
- import { DbConnection } from './store/connection';
9
- import { FileRepository } from './store/repositories/file.repository';
10
- import { SymbolRepository } from './store/repositories/symbol.repository';
11
- import { RelationRepository } from './store/repositories/relation.repository';
12
- import { ProjectWatcher } from './watcher/project-watcher';
13
- import { IndexCoordinator } from './indexer/index-coordinator';
14
- import type { IndexResult } from './indexer/index-coordinator';
15
- import type { FileChangeEvent } from './watcher/types';
16
- import { acquireWatcherRole, releaseWatcherRole, updateHeartbeat } from './watcher/ownership';
17
- import type { WatcherOwnerStore } from './watcher/ownership';
18
- import { discoverProjects } from './common/project-discovery';
19
- import type { ProjectBoundary } from './common/project-discovery';
20
- import { loadTsconfigPaths } from './common/tsconfig-resolver';
21
- import type { TsconfigPaths } from './common/tsconfig-resolver';
22
- import { symbolSearch as defaultSymbolSearch } from './search/symbol-search';
23
- import type { SymbolSearchQuery, SymbolSearchResult } from './search/symbol-search';
24
- import { relationSearch as defaultRelationSearch } from './search/relation-search';
25
- import type { RelationSearchQuery } from './search/relation-search';
26
- import type { SymbolStats } from './store/repositories/symbol.repository';
27
- export interface Logger {
28
- error(...args: unknown[]): void;
29
- }
30
- export interface CodeledgerOptions {
31
- projectRoot: string;
32
- extensions?: string[];
33
- ignorePatterns?: string[];
34
- parseCacheCapacity?: number;
35
- logger?: Logger;
36
- }
37
- /** @internal */
38
- interface CodeledgerInternalOptions {
39
- existsSyncFn?: (p: string) => boolean;
40
- dbConnectionFactory?: () => Pick<DbConnection, 'open' | 'close' | 'transaction'> & WatcherOwnerStore;
41
- watcherFactory?: () => Pick<ProjectWatcher, 'start' | 'close'>;
42
- coordinatorFactory?: () => Pick<IndexCoordinator, 'fullIndex' | 'shutdown' | 'onIndexed'> & {
43
- tsconfigPaths?: Promise<TsconfigPaths | null>;
44
- handleWatcherEvent?(event: FileChangeEvent): void;
45
- };
46
- repositoryFactory?: () => {
47
- fileRepo: Pick<FileRepository, 'upsertFile' | 'getAllFiles' | 'getFilesMap' | 'deleteFile'>;
48
- symbolRepo: SymbolRepository;
49
- relationRepo: RelationRepository;
50
- parseCache: Pick<ParseCache, 'set' | 'get' | 'invalidate'>;
51
- };
52
- acquireWatcherRoleFn?: typeof acquireWatcherRole;
53
- releaseWatcherRoleFn?: typeof releaseWatcherRole;
54
- updateHeartbeatFn?: typeof updateHeartbeat;
55
- discoverProjectsFn?: typeof discoverProjects;
56
- parseSourceFn?: typeof defaultParseSource;
57
- extractSymbolsFn?: typeof defaultExtractSymbols;
58
- extractRelationsFn?: typeof defaultExtractRelations;
59
- symbolSearchFn?: typeof defaultSymbolSearch;
60
- relationSearchFn?: typeof defaultRelationSearch;
61
- loadTsconfigPathsFn?: typeof loadTsconfigPaths;
62
- }
63
- export declare class Codeledger {
64
- readonly projectRoot: string;
65
- private readonly db;
66
- private readonly symbolRepo;
67
- private readonly relationRepo;
68
- private readonly parseCache;
69
- private coordinator;
70
- private watcher;
71
- private readonly releaseWatcherRoleFn;
72
- private readonly parseSourceFn;
73
- private readonly extractSymbolsFn;
74
- private readonly extractRelationsFn;
75
- private readonly symbolSearchFn;
76
- private readonly relationSearchFn;
77
- private readonly logger;
78
- private readonly defaultProject;
79
- private readonly role;
80
- private timer;
81
- private signalHandlers;
82
- private closed;
83
- private tsconfigPaths;
84
- private boundaries;
85
- private readonly onIndexedCallbacks;
86
- private constructor();
87
- static open(options: CodeledgerOptions & CodeledgerInternalOptions): Promise<Codeledger>;
88
- close(): Promise<void>;
89
- onIndexed(callback: (result: IndexResult) => void): () => void;
90
- parseSource(filePath: string, sourceText: string): ParsedFile;
91
- extractSymbols(parsed: ParsedFile): ExtractedSymbol[];
92
- extractRelations(parsed: ParsedFile): CodeRelation[];
93
- reindex(): Promise<IndexResult>;
94
- get projects(): ProjectBoundary[];
95
- getStats(project?: string): SymbolStats;
96
- searchSymbols(query: SymbolSearchQuery): SymbolSearchResult[];
97
- searchRelations(query: RelationSearchQuery): CodeRelation[];
98
- getDependencies(filePath: string, project?: string, limit?: number): string[];
99
- getDependents(filePath: string, project?: string, limit?: number): string[];
100
- getAffected(changedFiles: string[], project?: string): Promise<string[]>;
101
- hasCycle(project?: string): Promise<boolean>;
102
- }
103
- export {};