Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a9f9a00
refactor: standardize C# Tree-Sitter parser tests
Apr 9, 2025
3d9ea93
refactor: standardize C Tree-Sitter parser tests
Apr 9, 2025
7cb7d32
feat: standardize Kotlin Tree-Sitter parser
Apr 9, 2025
0305fc7
feat: standardize PHP Tree-Sitter parser
Apr 9, 2025
d55d0c4
feat: standardize Ruby Tree-Sitter parser
Apr 9, 2025
a66d299
feat: standardize Swift Tree-Sitter parser
Apr 9, 2025
a1104fa
feat: dynamically include all tree-sitter WASM files in build process
Apr 9, 2025
69bd7c1
refactor: move test mocks and fixtures to shared locations
Apr 12, 2025
3278ee7
refactor: simplify tree-sitter debug output
Apr 12, 2025
79eb44d
refactor: standardize C# tree-sitter test structure
Apr 12, 2025
453b669
feat: add language-specific capture processing
Apr 12, 2025
8f1678e
refactor: move tree-sitter test samples to fixtures
Apr 12, 2025
d7f5077
refactor: standardize tree-sitter test code across languages
Apr 12, 2025
4dbb9f3
refactor: standardize tree-sitter parser tests across all languages
Apr 13, 2025
13caf8d
first pass all but elm-bash
Apr 23, 2025
55c585e
test: inspectTreeStructure helper now returns a string
Apr 24, 2025
3d7d353
refactor: establish single source of truth for MIN_COMPONENT_LINES
Apr 25, 2025
155c9be
refactor: improve MIN_COMPONENT_LINES implementation
Apr 25, 2025
1aa8809
feat: standardize tree-sitter test implementations
Apr 25, 2025
6a982c7
docs: document tree-sitter parseable but unsupported structures
Apr 26, 2025
e63ffc1
fix: use correct distDir variable for WASM file copying
Apr 26, 2025
23d9056
lint: remove unused imports and variables from tree-sitter tests
Apr 27, 2025
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
42 changes: 14 additions & 28 deletions esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,21 @@ const copyWasmFiles = {
path.join(distDir, "tiktoken_bg.wasm"),
)

// tree-sitter WASM
fs.copyFileSync(
path.join(nodeModulesDir, "web-tree-sitter", "tree-sitter.wasm"),
path.join(distDir, "tree-sitter.wasm"),
)
// Copy language-specific WASM files
const languageWasmDir = path.join(__dirname, "node_modules", "tree-sitter-wasms", "out")

// language-specific tree-sitter WASMs
const languageWasmDir = path.join(nodeModulesDir, "tree-sitter-wasms", "out")
const languages = [
"typescript",
"tsx",
"python",
"rust",
"javascript",
"go",
"cpp",
"c",
"c_sharp",
"ruby",
"java",
"php",
"swift",
"kotlin",
]

languages.forEach((lang) => {
const filename = `tree-sitter-${lang}.wasm`
fs.copyFileSync(path.join(languageWasmDir, filename), path.join(distDir, filename))
})
// Dynamically read all WASM files from the directory instead of using a hardcoded list
if (fs.existsSync(languageWasmDir)) {
const wasmFiles = fs.readdirSync(languageWasmDir).filter((file) => file.endsWith(".wasm"))

console.log(`Copying ${wasmFiles.length} tree-sitter WASM files to dist directory`)

wasmFiles.forEach((filename) => {
fs.copyFileSync(path.join(languageWasmDir, filename), path.join(distDir, filename))
})
} else {
console.warn(`Tree-sitter WASM directory not found: ${languageWasmDir}`)
}
})
},
}
Expand Down
Loading