-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathbuild.tree-sitter.mjs
More file actions
32 lines (27 loc) · 1.09 KB
/
build.tree-sitter.mjs
File metadata and controls
32 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Copyright (c) 2026, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: Apache-2.0
* For full license text, see the LICENSE file in the repo root or https://www.apache.org/licenses/LICENSE-2.0
*/
/**
* Build script for @agentscript/lsp-browser — tree-sitter mode.
*
* Bundles web-tree-sitter for WASM parsing in the browser.
* Native tree-sitter is externalized (Node.js only).
*
* Run via: node build.mjs --tree-sitter
*/
import { buildBrowserBundle, buildDeclarations } from './build.shared.mjs';
console.log('📦 Building bundles (tree-sitter)...\n');
console.log('1️⃣ Building browser ESM bundle (includes web-tree-sitter)...');
await buildBrowserBundle({ external: [] });
console.log(' ✓ dist/index.bundle.js created\n');
console.log('2️⃣ Generating TypeScript declarations...');
buildDeclarations();
console.log(' ✓ dist/index.d.ts created\n');
console.log('✅ Build complete!\n');
console.log(
' 📁 dist/index.bundle.js → Browser ESM (includes web-tree-sitter)'
);
console.log(' 📁 dist/index.d.ts → TypeScript declarations\n');