tree-sitter / tree-sitter

An incremental parsing system for programming tools

Home Page:https://tree-sitter.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-cli 0.22.1 break tree-sitter-typescript wasm build

bytemain opened this issue · comments

Problem

when using tree-sitter-cli 0.22.1 with docker
will encounter this issue:

CleanShot 2024-03-29 at 10 30 54@2x

because it include a header file out of its src directory

Steps to reproduce

npm install tree-sitter-cli tree-sitter-typescript

tree-sitter build --wasm --output ./tree-sitter-typescript.wasm ./node_modules/tree-sitter-typescript/typescript

Expected behavior

tree-sitter-typescript.wasm can be output

Tree-sitter version (tree-sitter --version)

tree-sitter-cli 0.22.1

Operating system/version

macOS Sonoma 14.4

I think the build subcommand may have been added between 0.22.1 and 0.22.2.


For tree-sitter 0.22.1 (locally built) I get an error if trying to use build as a subcommand name:

error: unrecognized subcommand 'build'

  tip: a similar subcommand exists: 'build-wasm'

Usage: tree-sitter <COMMAND>

For more information, try '--help'.
$ tree-sitter --version
tree-sitter 0.22.1 (1c38d34deac5ae7ea797a559f596fb4ec9008eb4)

For tree-sitter 0.22.2 (also locally built) I had success, though I'm not using npm and friends:

git clone https://github.com/tree-sitter/tree-sitter-typescript
cd tree-sitter-typescript/typescript
# ensure appropriate emsdk is available
source ~/src/emsdk.3.1.37/emsdk_env.sh
tree-sitter build --wasm --output tree-sitter-typescript.wasm
tree-sitter --version
tree-sitter 0.22.2 (fc15f621334a262039ffaded5937e2844f88da61)

I forgot to mention, this should only appear when using docker