Fix type definitions in exports…
…and generate `.d.cts` files for CommonJS exports.
This commit is contained in:
parent
876d5a96bf
commit
02fff92b91
5 changed files with 1118 additions and 16 deletions
2
lib/binding_web/.gitignore
vendored
2
lib/binding_web/.gitignore
vendored
|
|
@ -3,6 +3,8 @@ dist/
|
|||
web-tree-sitter*
|
||||
!web-tree-sitter.d.ts
|
||||
!web-tree-sitter.d.ts.map
|
||||
!web-tree-sitter.d.cts
|
||||
!web-tree-sitter.d.cts.map
|
||||
lib/tree-sitter*
|
||||
lib/*.c
|
||||
lib/*.h
|
||||
|
|
|
|||
|
|
@ -18,15 +18,25 @@
|
|||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./web-tree-sitter.js",
|
||||
"require": "./web-tree-sitter.cjs",
|
||||
"types": "./web-tree-sitter.d.ts"
|
||||
"import": {
|
||||
"types": "./web-tree-sitter.d.ts",
|
||||
"default": "./web-tree-sitter.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./web-tree-sitter.d.cts",
|
||||
"default": "./web-tree-sitter.cjs"
|
||||
}
|
||||
},
|
||||
"./web-tree-sitter.wasm": "./web-tree-sitter.wasm",
|
||||
"./debug": {
|
||||
"import": "./debug/web-tree-sitter.js",
|
||||
"require": "./debug/web-tree-sitter.cjs",
|
||||
"types": "./web-tree-sitter.d.ts"
|
||||
"import": {
|
||||
"types": "./web-tree-sitter.d.ts",
|
||||
"default": "./debug/web-tree-sitter.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./web-tree-sitter.d.cts",
|
||||
"default": "./debug/web-tree-sitter.cjs"
|
||||
}
|
||||
},
|
||||
"./debug/web-tree-sitter.wasm": "./debug/web-tree-sitter.wasm"
|
||||
},
|
||||
|
|
@ -53,6 +63,8 @@
|
|||
"debug/web-tree-sitter.wasm.map",
|
||||
"web-tree-sitter.d.ts",
|
||||
"web-tree-sitter.d.ts.map",
|
||||
"web-tree-sitter.d.cts",
|
||||
"web-tree-sitter.d.cts.map",
|
||||
"src/**/*.ts",
|
||||
"lib/*.c",
|
||||
"lib/*.h"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import { createBundle } from 'dts-buddy';
|
||||
|
||||
await createBundle({
|
||||
project: 'tsconfig.json',
|
||||
output: 'web-tree-sitter.d.ts',
|
||||
modules: {
|
||||
'web-tree-sitter': 'src/index.ts'
|
||||
},
|
||||
compilerOptions: {
|
||||
stripInternal: true,
|
||||
},
|
||||
});
|
||||
for (let ext of ['ts', 'cts']) {
|
||||
await createBundle({
|
||||
project: 'tsconfig.json',
|
||||
output: `web-tree-sitter.d.${ext}`,
|
||||
modules: {
|
||||
'web-tree-sitter': 'src/index.ts'
|
||||
},
|
||||
compilerOptions: {
|
||||
stripInternal: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
1030
lib/binding_web/web-tree-sitter.d.cts
Normal file
1030
lib/binding_web/web-tree-sitter.d.cts
Normal file
File diff suppressed because it is too large
Load diff
56
lib/binding_web/web-tree-sitter.d.cts.map
Normal file
56
lib/binding_web/web-tree-sitter.d.cts.map
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"version": 3,
|
||||
"file": "web-tree-sitter.d.cts",
|
||||
"names": [
|
||||
"Point",
|
||||
"Range",
|
||||
"Edit",
|
||||
"ParseCallback",
|
||||
"ProgressCallback",
|
||||
"LogCallback",
|
||||
"ParseOptions",
|
||||
"ParseState",
|
||||
"LANGUAGE_VERSION",
|
||||
"MIN_COMPATIBLE_VERSION",
|
||||
"Parser",
|
||||
"LanguageMetadata",
|
||||
"Language",
|
||||
"Tree",
|
||||
"Node",
|
||||
"TreeCursor",
|
||||
"QueryOptions",
|
||||
"QueryState",
|
||||
"QueryProperties",
|
||||
"QueryPredicate",
|
||||
"QueryCapture",
|
||||
"QueryMatch",
|
||||
"CaptureQuantifier",
|
||||
"PredicateStep",
|
||||
"CapturePredicateStep",
|
||||
"StringPredicateStep",
|
||||
"Query",
|
||||
"LookaheadIterator"
|
||||
],
|
||||
"sources": [
|
||||
"src/constants.ts",
|
||||
"src/parser.ts",
|
||||
"src/language.ts",
|
||||
"src/tree.ts",
|
||||
"src/node.ts",
|
||||
"src/tree_cursor.ts",
|
||||
"src/query.ts",
|
||||
"src/lookahead_iterator.ts"
|
||||
],
|
||||
"sourcesContent": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
],
|
||||
"mappings": ";;;;;;mBASiBA,KAAKA;;;;;;;;;;mBAYLC,KAAKA;;;;;;;;;;;;;mBAiBLC,IAAIA;;;;;;;;;;;;;;;;;cA4CTC,aAAaA;;;;cAKbC,gBAAgBA;;;;;;cAOhBC,WAAWA;;;;;;;;;;;;kBC7ENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;;YAwBhBC,gBAAgBA;;;;;YAMhBC,sBAAsBA;;;;;cAMpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OChFNC,gBAAgBA;;;;;;;;;cAUhBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCYRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCrBJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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