Skip to content

meta: export types for rehype-shiki#8632

Open
ovflowd wants to merge 6 commits intomainfrom
meta/export-types-rehype-shiki
Open

meta: export types for rehype-shiki#8632
ovflowd wants to merge 6 commits intomainfrom
meta/export-types-rehype-shiki

Conversation

@ovflowd
Copy link
Member

@ovflowd ovflowd commented Feb 15, 2026

This PR introduces type exports for @node-core/rehype-shiki, which IMO is important for downstream consumers/importers of the package, such as doc-kit. Even if the runtime doesn't require the types.

Copilot AI review requested due to automatic review settings February 15, 2026 17:27
@ovflowd ovflowd requested a review from a team as a code owner February 15, 2026 17:27
@vercel
Copy link

vercel bot commented Feb 15, 2026

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Feb 15, 2026 10:48pm

Request Review

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.11%. Comparing base (fa01ac6) to head (4e4e092).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8632      +/-   ##
==========================================
+ Coverage   75.09%   75.11%   +0.01%     
==========================================
  Files         104      104              
  Lines        9088     9094       +6     
  Branches      314      314              
==========================================
+ Hits         6825     6831       +6     
  Misses       2261     2261              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ovflowd
Copy link
Member Author

ovflowd commented Feb 15, 2026

cc @nodejs/nodejs-website

Copy link
Contributor

Copilot AI left a comment

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 TypeScript type publishing support for @node-core/rehype-shiki (via generated declaration files) to improve downstream TypeScript consumption, and refactors internal imports to use a package-scoped #rs/* alias.

Changes:

  • Add tsconfig.json + TypeScript tooling/scripts to emit declaration files for @node-core/rehype-shiki, and expose them via package.json types/exports.
  • Introduce #rs/* internal import map and update internal imports/JSDoc type imports to use it.
  • Remove incremental from @node-core/ui-components TypeScript config.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/ui-components/tsconfig.json Removes incremental setting (unrelated to rehype-shiki type export goal).
packages/rehype-shiki/tsconfig.json New TS config to emit declarations only into dist/.
packages/rehype-shiki/package.json Adds types + exports types condition, imports map, and TS-related scripts/devDependency.
packages/rehype-shiki/eslint.config.js Enables type-aware linting via local tsconfig.json.
packages/rehype-shiki/src/plugin.mjs Switches to #rs/* import and updates JSDoc type import paths accordingly.
packages/rehype-shiki/src/minimal.mjs Switches internal import to #rs/*.
packages/rehype-shiki/src/index.mjs Switches internal import + dynamic import to #rs/*.
packages/rehype-shiki/src/highlighter.mjs Adds JSDoc-typed helper export and adjusts exposed Shiki core type annotation.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 15, 2026

📦 Build Size Comparison

Summary

Metric Value
Old Total Size 3.74 MB
New Total Size 3.74 MB
Delta 0 B (0.00%)

Changes

➕ Added Assets (1)
Name Size
.next/static/chunks/a034edef5355bdd7.js 207.34 KB
➖ Removed Assets (1)
Name Size
.next/static/chunks/42bb8307ca53d9f6.js 207.34 KB

@avivkeller
Copy link
Member

I don't think this is necessary, but I could be wrong

@ovflowd
Copy link
Member Author

ovflowd commented Feb 15, 2026

I don't think this is necessary, but I could be wrong

Kinda. Technically speaking VS Code will automatically resolve with its own IntelliSense, yes and use the JSDocs. But, adding this actually allows us to check for type errors. For example, this allowed me to see that HighlighterCoreSync type didn't exist anymore. So this allows us to catch errors. Even if the source is pure .mjs and TS is not needed tho.

We could even simply not ship the d.ts, but I want to also be a TypeScript citizen without really needing TypeScript lol

@ovflowd
Copy link
Member Author

ovflowd commented Feb 16, 2026

cc @nodejs/nodejs-website

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

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

Minus the ui-components changes, LGTM

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

LGMT ! that's good idea

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.

3 participants