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.

(cherry picked from commit f95e0e3a56)
This commit is contained in:
Roberto Huertas 2025-02-05 13:04:08 +01:00 committed by Christian Clason
parent 637a3e111b
commit d73126d582
2 changed files with 6 additions and 4 deletions

View file

@ -1,12 +1,12 @@
{
"name": "web-tree-sitter",
"version": "0.25.0",
"version": "0.25.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "web-tree-sitter",
"version": "0.25.0",
"version": "0.25.1",
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.19.0",

View file

@ -19,11 +19,13 @@
"exports": {
".": {
"import": "./tree-sitter.js",
"require": "./tree-sitter.cjs"
"require": "./tree-sitter.cjs",
"types": "./web-tree-sitter.d.ts"
},
"./debug": {
"import": "./debug/tree-sitter.js",
"require": "./debug/tree-sitter.cjs"
"require": "./debug/tree-sitter.cjs",
"types": "./web-tree-sitter.d.ts"
}
},
"types": "web-tree-sitter.d.ts",