Commit graph

255 commits

Author SHA1 Message Date
ObserverOfTime 88e0b4cea4 docs: change WASM/wasm to Wasm
That is the official capitalisation.
2025-08-21 09:56:32 +03:00
Carlos Scheidegger c60264b87f
docs(web): fix deno import example 2025-08-13 22:56:21 +03:00
Will Lillis 7d0b94c008 fix(docs): indicate CJS env var export is different on Windows platforms 2025-08-03 12:58:34 -04:00
RedCMD 912167a9cd
chore(web): fix indentation in type files 2025-07-14 12:50:04 +02:00
dependabot[bot] 8a15b881fd build(deps): bump esbuild and tsx in /lib/binding_web
Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.0 and updates ancestor dependency [tsx](https://github.com/privatenumber/tsx). These dependencies need to be updated together.


Updates `esbuild` from 0.23.1 to 0.25.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.23.1...v0.25.0)

Updates `tsx` from 4.19.2 to 4.19.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.19.2...v4.19.3)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.25.0
  dependency-type: indirect
- dependency-name: tsx
  dependency-version: 4.19.3
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-15 12:48:55 +03:00
Tamir Bahar 64760ffa76
fix(web): fix typing for Parser.init
Since we're usually only providing `locateFile`, we need the type to be
`Partial<>` to allow it.

This also matches the typing in `@types/emscripten`'s
`EmscriptenModuleFactory` type signature.
2025-06-15 12:41:21 +03:00
Andrew Dupont 02fff92b91 Fix type definitions in exports
…and generate `.d.cts` files for CommonJS exports.
2025-06-15 09:46:05 +03:00
dependabot[bot] bfc5d1180c build(deps): bump vite from 6.3.2 to 6.3.4 in /lib/binding_web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.3.2 to 6.3.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-01 09:18:47 +02:00
WillLillis eee41925aa fix(ci): increase timeouts for flaky tests 2025-04-19 10:59:09 +02:00
dependabot[bot] 043e0c65ec build(deps): bump vite from 6.1.0 to 6.2.6 in /lib/binding_web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.1.0 to 6.2.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 23:57:56 -04:00
vemoo 4dffb818e2
feat(web): export wasm files to better support bundling use cases 2025-04-18 23:47:27 -04:00
Tamir Bahar 27fa1088b9
fix(web): replace dynamic require with import 2025-04-18 23:40:40 -04:00
Riley Bruins 21390af2dd fix(web): correct childWithDescendant() functionality
This fix allows for more granular address control when marshalling nodes
across WASM. This is necessary for node methods which accept another
node as a parameter (i.e., `childWithDescendant()`)
2025-04-18 18:11:42 -04:00
Tamir Bahar a380e1a259
refactor(web): change return types to Node[] in child-related methods 2025-03-15 09:09:31 -04:00
Christian Clason 07a1b7fc00 fix(build): bump version to 0.26.0
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 12s
CI / checks (push) Has been cancelled
Check WASM Exports / check-wasm-exports (push) Has been cancelled
After a release, `master` branch should be bumped to the next _minor_ version.
2025-03-12 14:52:09 +01:00
WillLillis 998fb34d15 fix(test): update expected tree-sitter-rust supertypes 2025-03-02 16:37:03 -05:00
Will Lillis 3b67861def
fix(wasm): restore passing in ERROR to descendantsOfType (#4226)
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 15s
CI / checks (push) Has been cancelled
2025-02-19 14:47:10 -08:00
Amaan Qureshi a40265cbeb refactor(web): rename tree-sitter.js to web-tree-sitter.js
This is not breaking for consumers of the web bindings, nor the
playground as both filenames will be kept in the .github.io repo
2025-02-11 22:56:50 -05:00
Roberto Huertas f95e0e3a56 fix(web): provide type in the exports
When using TypeScript projects using other module settings than CommonJs, the types were not correctly exposed, and the compilation failed.

This adds the types path to the exports so compilation works for `module: NodeNext` and other variants.
2025-02-08 12:47:17 -05:00
Amaan Qureshi f5afe475de
build: bump version to 0.25.1
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 14s
Deploy Docs / deploy-docs (push) Has been cancelled
Check WASM Exports / check-wasm-exports (push) Has been cancelled
2025-02-02 02:07:36 -05:00
Amaan Qureshi a115e515ff feat(web): include C source files for debugging 2025-01-31 20:41:11 -05:00
Amaan Qureshi 060e69e671 build(web): relocate source files in WASM sourcemap 2025-01-31 20:41:11 -05:00
Amaan Qureshi 40dfe6bd51 build(web): bump deps 2025-01-31 20:41:11 -05:00
Amaan Qureshi 304e56850f chore(web): update type definitions
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 14s
CI / checks (push) Has been cancelled
2025-01-28 20:59:37 -05:00
Amaan Qureshi 9d62f17bc4 fix(web): correct doc comment 2025-01-28 20:59:37 -05:00
Amaan Qureshi 9515be4fc1 fix(web): update check-artifacts script
Some checks failed
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 13s
CI / checks (push) Has been cancelled
2025-01-26 14:39:01 -05:00
Amaan Qureshi 5546862bb7 fix(web): correct debug file location 2025-01-26 14:15:01 -05:00
Allan Clements cda634a1c4 feat: add error information in the progress callback
This allows users to bail parsing if an error was *definitely* detected
using the progress callback, as all possible stack versions have a
non-zero error cost.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-25 02:47:39 -05:00
Amaan Qureshi 8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
dependabot[bot] 9003b883f1 build(deps-dev): bump vite from 6.0.7 to 6.0.11 in /lib/binding_web
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.0.7 to 6.0.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.0.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-25 00:18:35 -05:00
Amaan Qureshi e1eb2fdbca refactor(web): break apart the logic for constructing a query
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 13s
2025-01-23 00:43:27 -05:00
Amaan Qureshi b5894fac95 feat(web): use custom error type for query errors 2025-01-23 00:43:27 -05:00
Amaan Qureshi 6c3eb760a9 feat: improve PredicateStep types 2025-01-23 00:43:27 -05:00
Amaan Qureshi a76934dda0 test: update tests 2025-01-23 00:43:27 -05:00
Amaan Qureshi a18ae03e0b docs(web): update type definitions 2025-01-23 00:43:27 -05:00
Amaan Qureshi e901716ebd refactor(web)!: deprecate Language.query in favor of new Query 2025-01-23 00:43:27 -05:00
Amaan Qureshi e874d2d8f8 feat: add a patternIndex field to QueryCapture
This lets users look up the predicates associated with a given
`QueryCapture`, by using the `patternIndex` field and calling
`predicatesForPattern`
2025-01-23 00:43:27 -05:00
Amaan Qureshi d60c6f163d refactor(web)!: rename pattern to patternIndex in QueryMatch
This aligns with other bindings
2025-01-23 00:43:27 -05:00
Amaan Qureshi e3ac504e86 refactor(web): move CaptureQuantifier definition 2025-01-23 00:43:27 -05:00
Amaan Qureshi 58662417a6 fix(web): only export public types
This avoids exporting extra unnecessary stuff in the final JS file
2025-01-23 00:43:27 -05:00
Amaan Qureshi 79244b5815 fix(web): correct builds for CJS
Some checks failed
CI / checks (push) Waiting to run
Deploy Docs / deploy-docs (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 12s
2025-01-21 12:36:15 -05:00
Amaan Qureshi f6a943a1ad docs(web): update README and add CONTRIBUTING docs 2025-01-21 12:36:15 -05:00
Amaan Qureshi 0dba35c30f docs(web): update docs 2025-01-21 12:36:15 -05:00
Amaan Qureshi 1f66d156b5 test: update tests 2025-01-21 12:36:15 -05:00
Amaan Qureshi 09cb4c5729 feat(web): document the API 2025-01-21 12:36:15 -05:00
Amaan Qureshi a4b20c1c56 feat: publish both CJS and ESM files
This way, users can pick whichever one works for their needs
2025-01-21 12:36:15 -05:00
Amaan Qureshi 10e6ecf162 feat: begin autogenerating web-tree-sitter.d.ts 2025-01-21 12:36:15 -05:00
Amaan Qureshi be7716dfa7 feat(web)!: use the WASM module in the bindings, and not the other way around
Parser is no longer the default export, but you *must* call
`Parser.init()` before doing anything still
2025-01-21 12:36:15 -05:00
Amaan Qureshi 25e6de4a0a docs(web): update process on fetching WASM fiels 2025-01-21 12:36:15 -05:00
Amaan Qureshi 169d7ad57f refactor: rewrite scripts in typescript 2025-01-21 12:36:15 -05:00