Skip to content

Commit e47d0ce

Browse files
authored
fix(core): add tsconfig so global generator types resolve (#985)
Without a tsconfig, the editor's inferred project never included generators/types.d.ts, so the global GeneratorMetadata/Generate/ ProcessChunk types were unresolved in every generator's types.d.ts (reported at orama-db/types.d.ts:27). Also fix the Position import in metadata/types.d.ts: @types/mdast v4 no longer exports it, so import it from unist instead. Explicitly set "types": ["node"] since TypeScript 6.0 defaults types to [].
1 parent 66899e3 commit e47d0ce

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎packages/core/src/generators/metadata/types.d.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { Root, Position, Node, Data, Blockquote, Heading } from 'mdast';
1+
import type { Position } from 'unist';
2+
import type { Root, Node, Data, Blockquote, Heading } from 'mdast';
23

34
export type Generator = GeneratorMetadata<
45
{},

‎packages/core/tsconfig.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"checkJs": false,
5+
"noEmit": true,
6+
"target": "esnext",
7+
"module": "esnext",
8+
"moduleResolution": "bundler",
9+
"types": ["node"],
10+
"skipLibCheck": true
11+
},
12+
"include": ["src"]
13+
}

0 commit comments

Comments
 (0)