nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

feat: Add PowerShell support to Shiki

Open thisalihassan opened this issue 1 year ago • 9 comments

Description

This PR addresses issue #6511 by integrating PowerShell (ps1) syntax highlighting support into the Shiki configuration used on the 'Install on Windows using Package Manager' page. It ensures that when Windows is selected from the dropdown, the codebox correctly highlights PowerShell scripts. This enhancement improves readability for PowerShell users

Validation

Before:

image

After:

image

Related Issues

closes #6511

Check List

  • [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [x] I have run npx turbo format to ensure the code follows the style guide.
  • [x] I have run npx turbo test to check if all tests are passing.
  • [x] I have run npx turbo build to check if the website builds without errors.
  • [ ] I've covered new added functionality with unit tests if necessary.

thisalihassan avatar Mar 24 '24 23:03 thisalihassan

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Mar 25, 2024 10:32am

vercel[bot] avatar Mar 24 '24 23:03 vercel[bot]

@AugustinMauroy it actually increases the build size by aprox ~ 20 KB

thisalihassan avatar Mar 25 '24 08:03 thisalihassan

@AugustinMauroy it actually increases the build size by aprox ~ 20 KB

hummmm really interesting. And what do you think about keeping the bash highlight but changing the display name. That way, it doesn't make the bundle bigger and it displays the right language.

AugustinMauroy avatar Mar 25 '24 08:03 AugustinMauroy

@AugustinMauroy so you mean remove PowerShell config but change display name? it won't highlight according to .ps1

thisalihassan avatar Mar 25 '24 09:03 thisalihassan

with this we are not increasing the bundle size. And we display correct name of "language"

@AugustinMauroy Done

thisalihassan avatar Mar 25 '24 10:03 thisalihassan

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 90 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 91 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 98 🟢 90 🟢 100 🟢 92 🔗
/en/download 🟢 100 🟠 89 🟢 100 🟢 91 🔗
/en/blog 🟢 99 🟢 90 🟢 100 🟢 92 🔗

github-actions[bot] avatar Mar 25 '24 13:03 github-actions[bot]

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 84%
80.1% (451/563) 79.44% (143/180) 71.17% (79/111)

Unit Test Report

Tests Skipped Failures Errors Time
90 0 :zzz: 0 :x: 0 :fire: 4.925s :stopwatch:

github-actions[bot] avatar Mar 25 '24 13:03 github-actions[bot]

Wait, is the total bundle of the website being increased by 20kb? That's a lot.

Anyhow, that gets gzipped I assume, and might not be such a big deal.

ovflowd avatar Mar 25 '24 19:03 ovflowd

@ovflowd vscode import cost shows after gzip it's 4.7k

thisalihassan avatar Mar 25 '24 20:03 thisalihassan

Hi @ovflowd @AugustinMauroy @aymen94 can we merge this? or do you have any comments for this PR?

thisalihassan avatar Mar 26 '24 16:03 thisalihassan