Skip to content

fix(core): add tsconfig so global generator types resolve - #985

Open
btea wants to merge 1 commit into
nodejs:mainfrom
btea:fix/tsconfig-global-types
Open

fix(core): add tsconfig so global generator types resolve#985
btea wants to merge 1 commit into
nodejs:mainfrom
btea:fix/tsconfig-global-types

Conversation

@btea

@btea btea commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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 [].

image

Description

Validation

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

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 [].
Copilot AI review requested due to automatic review settings August 3, 2026 04:17
@btea
btea requested a review from a team as a code owner August 3, 2026 04:17
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Aug 3, 2026 4:19am

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to TypeScript project configuration and type-only import fixes; no runtime or build output behavior is altered.

Overview
Fixes editor/TypeScript resolution for generator types.d.ts files by adding a packages/core/tsconfig.json that includes src, so globals like GeneratorMetadata, Generate, and ProcessChunk are part of the inferred project (previously unresolved errors in generators such as orama-db/types.d.ts).

The new config uses allowJs, noEmit, moduleResolution: "bundler", and explicitly types": ["node"] because TypeScript 6.0 defaults types to an empty list.

In metadata/types.d.ts, Position is imported from unist instead of mdast, matching @types/mdast v4 where Position is no longer exported from mdast.

Reviewed by Cursor Bugbot for commit 4621d8f. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (3ca6de5) to head (4621d8f).
⚠️ Report is 12 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json to ensure src/** (including src/generators/types.d.ts) is part of the inferred TS project and Node ambient types are available.
  • Fix Position type import in metadata/types.d.ts by importing it from unist instead of mdast.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants