feat(web)!: rewrite the library in TypeScript

This commit is contained in:
Amaan Qureshi 2025-01-13 01:48:42 -05:00
parent 07a86b1729
commit 2cae67892e
39 changed files with 7856 additions and 3629 deletions

View file

@ -0,0 +1,25 @@
import fs from 'fs';
import path from 'path';
const isDebug = process.env.npm_config_web_tree_sitter_debug === 'true';
if (isDebug) {
// Copy debug versions to root
fs.copyFileSync(
path.join(__dirname, '../debug/tree-sitter.js'),
path.join(__dirname, '../tree-sitter.js')
);
fs.copyFileSync(
path.join(__dirname, '../debug/tree-sitter.wasm'),
path.join(__dirname, '../tree-sitter.wasm')
);
// Copy sourcemaps too
fs.copyFileSync(
path.join(__dirname, '../debug/tree-sitter.js.map'),
path.join(__dirname, '../tree-sitter.js.map')
);
fs.copyFileSync(
path.join(__dirname, '../debug/tree-sitter.wasm.map'),
path.join(__dirname, '../tree-sitter.wasm.map')
);
}