Skip to content

Conversation

@avivkeller
Copy link
Member

We use rehype-shiki in api-docs-tooling, where these addtl languages are needed

Copilot AI review requested due to automatic review settings May 28, 2025 22:21
@avivkeller avivkeller requested a review from a team as a code owner May 28, 2025 22:21
@vercel
Copy link

vercel bot commented May 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 31, 2025 3:08pm

This comment was marked as outdated.

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 35 lines in your changes missing coverage. Please review.

Project coverage is 75.46%. Comparing base (d122e58) to head (ca998e8).
Report is 11 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/rehype-shiki/src/index.mjs 19.04% 34 Missing ⚠️
packages/rehype-shiki/src/highlighter.mjs 98.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7787      +/-   ##
==========================================
+ Coverage   75.35%   75.46%   +0.10%     
==========================================
  Files          96      101       +5     
  Lines        7861     8309     +448     
  Branches      192      218      +26     
==========================================
+ Hits         5924     6270     +346     
- Misses       1936     2037     +101     
- Partials        1        2       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@ovflowd

This comment has been minimized.

@ovflowd

This comment has been minimized.

@avivkeller avivkeller changed the title chore(shiki): add languages used in core chore(shiki): only send required langs to client, and support more on server May 31, 2025
@avivkeller avivkeller requested a review from ovflowd May 31, 2025 14:14
@avivkeller avivkeller requested a review from Copilot May 31, 2025 14:47
@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label May 31, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label May 31, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 31, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 97 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟠 82 🔗
/en/about/previous-releases 🟢 98 🟢 100 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

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 refines language loading and exports for rehype-shiki, introducing a minimal build for client usage and expanding server-side language support.

  • Refactored plugin export to default and adjusted import paths.
  • Consolidated all language registrations in index.mjs and added a lightweight minimal.mjs for client-only needs.
  • Updated package exports, test scripts, and turbo tasks.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rehype-shiki/turbo.json Renamed test task to test:unit for Turbo alignment
packages/rehype-shiki/src/plugin.mjs Switched to default export and updated highlightToHast import
packages/rehype-shiki/src/minimal.mjs New minimal highlighter with only PowerShell and ShellScript
packages/rehype-shiki/src/languages.mjs Removed standalone languages file
packages/rehype-shiki/src/index.mjs Inlined all languages into createHighlighter call and reexported utilities
packages/rehype-shiki/src/highlighter.mjs Transformed memoized loader into createHighlighter factory
packages/rehype-shiki/src/tests/plugin.test.mjs Added plugin tests
packages/rehype-shiki/src/tests/highlighter.test.mjs Adjusted tests for new createHighlighter API
packages/rehype-shiki/package.json Switched to conditional exports and updated scripts
apps/site/next.mdx.plugins.mjs Updated the rehype-shiki plugin import path
apps/site/components/Downloads/Release/ReleaseCodeBox.tsx Switched to minimal import for client rendering
Comments suppressed due to low confidence (2)

packages/rehype-shiki/src/minimal.mjs:1

  • There are no tests for minimal.mjs. Consider adding tests to verify that the minimal highlighter exports (shiki, getLanguageDisplayName, highlightToHast, highlightToHtml) work correctly with the reduced language set.
import powershellLanguage from 'shiki/langs/powershell.mjs';

apps/site/next.mdx.plugins.mjs:3

  • The import path for the plugin has changed—update the project’s README or migration guide to show @node-core/rehype-shiki/plugin as the new import source for rehypeShikiji.
import rehypeShikiji from '@node-core/rehype-shiki/plugin';

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Aviv Keller <me@aviv.sh>
@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label May 31, 2025
Co-authored-by: Claudio W. <cwunder@gnome.org>
Signed-off-by: Aviv Keller <me@aviv.sh>
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM! Can you verify bundle size decrease?

@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label May 31, 2025
@ovflowd
Copy link
Member

ovflowd commented May 31, 2025

(Thanks for the good stuff here ❤️)

@avivkeller
Copy link
Member Author

avivkeller commented May 31, 2025

LGTM! Can you verify bundle size decrease?

Patch

https://github.com/nodejs/nodejs.org/actions/runs/15364890771/job/43236518885?pr=7787

  Route (app)                                                       Size  First Load JS
  ├ ○ /[locale]                                                    179 B         357 kB
  ├ ○ /[locale]/[...path]                                          179 B         357 kB

main

https://github.com/nodejs/nodejs.org/actions/runs/15364893537/job/43236524059

  Route (app)                                                       Size  First Load JS
  ├ ○ /[locale]                                                    186 B         393 kB
  ├ ○ /[locale]/[...path]                                          184 B         393 kB

@avivkeller avivkeller added this pull request to the merge queue May 31, 2025
Merged via the queue into main with commit 601b74e May 31, 2025
17 checks passed
@avivkeller avivkeller deleted the shiki/more branch May 31, 2025 15:18
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.

5 participants