Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-scripts=false
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
188 changes: 188 additions & 0 deletions GRAPH_PLAN.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ packages/

## Quickstart

Use Node 22 locally (`.nvmrc`) on macOS arm64 so `better-sqlite3` can use its published prebuilds.
If you normally run with `ignore-scripts=true`, this repo overrides it via `.npmrc` because the native SQLite deps must run their install hooks.

```bash
pnpm install
pnpm build
Expand Down
9 changes: 8 additions & 1 deletion packages/core/src/chunking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ const MAX_STRUCTURAL_CHUNK_TOKENS = 1_200
const SPLIT_WINDOW_LINES = 90
const SPLIT_OVERLAP_LINES = 12

const typeScriptSourceFileCache = new WeakMap<ScannedFile, ts.SourceFile>()

export function getCachedTypeScriptSourceFile(file: ScannedFile): ts.SourceFile | undefined {
return typeScriptSourceFileCache.get(file)
}

export function buildChunks(file: ScannedFile): ChunkRecord[] {
let chunks: ChunkRecord[] = []

Expand Down Expand Up @@ -76,6 +82,7 @@ function buildTypeScriptChunks(file: ScannedFile): ChunkRecord[] {
true,
scriptKindFromPath(file.relativePath)
)
typeScriptSourceFileCache.set(file, sourceFile)

const chunks: ChunkRecord[] = []

Expand Down Expand Up @@ -1195,7 +1202,7 @@ function countRubyClosers(line: string): number {
return /^end\b/.test(line.trim()) ? 1 : 0
}

function maskCStyleSyntax(lines: string[]): string[] {
export function maskCStyleSyntax(lines: string[]): string[] {
const maskedLines: string[] = []
let inBlockComment = false
let stringQuote: '"' | "'" | '`' | null = null
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export type {
EdgeResult,
EmbeddingBatchOptions,
EmbeddingProvider,
EmbeddingRole,
FindEdgeOptions,
FindImportersOptions,
FindSymbolOptions,
ImpactNode,
ImpactOptions,
ImpactResult,
GrepHit,
GrepOptions,
IndexCompatibilitySnapshot,
Expand All @@ -27,6 +33,8 @@ export type {
StopWatching,
SymbolDefinition,
SymbolKind,
SymbolNeighbor,
SymbolRelations,
SymbolUsage,
SyncOptions,
SyncProgressEvent,
Expand Down
Loading
Loading