fix(core): add tsconfig so global generator types resolve - #985
Conversation
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 [].
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The new config uses In Reviewed by Cursor Bugbot for commit 4621d8f. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #985 +/- ##
=======================================
Coverage 89.12% 89.12%
=======================================
Files 196 196
Lines 18083 18083
Branches 1667 1667
=======================================
Hits 16116 16116
Misses 1960 1960
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a local TypeScript project configuration for packages/core so editors/tsserver consistently include the generator ambient type declarations, and updates the metadata generator’s type imports to match the @types/mdast v4 ecosystem.
Changes:
- Add
packages/core/tsconfig.jsonto ensuresrc/**(includingsrc/generators/types.d.ts) is part of the inferred TS project and Node ambient types are available. - Fix
Positiontype import inmetadata/types.d.tsby importing it fromunistinstead ofmdast.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/tsconfig.json | Establishes an editor/tsserver TS project for packages/core/src and explicitly enables Node types. |
| packages/core/src/generators/metadata/types.d.ts | Updates Position import source to align with @types/mdast v4 exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 [].
Description
Validation
Related Issues
Check List
node --run testand all tests passed.node --run format:check&node --run lint.