Skip to content

chore(site): rename and merge utilities #7853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 27, 2025
Merged

chore(site): rename and merge utilities #7853

merged 6 commits into from
Jun 27, 2025

Conversation

avivkeller
Copy link
Member

Description

All of our utility files are either: suffixed with Utils (Why? We are already in a utility folder), or named after a single-function that the contain. This PR updates those files to have names based on what functions they contain, rather than the function names themselves (i.e. download over downloadUtils, and api over getNodeApiLink)

Validation

Nothing should change

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller
@Copilot Copilot AI review requested due to automatic review settings June 8, 2025 21:06
@avivkeller avivkeller requested a review from a team as a code owner June 8, 2025 21:06
Copy link

vercel bot commented Jun 8, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jun 27, 2025 8:19pm

Copy link
Contributor

@Copilot 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 renames several utility files and updates their import paths to improve clarity and consistency in the utility folder. The changes remove redundant naming patterns and merge similar utility functions under consolidated names.

  • Updated import paths to remove "Utils" suffixes.
  • Renamed modules (e.g., stringUtils to string, authorUtils to author, dateUtils to date, downloadUtils to download, etc.) for clarity.
  • Updated internal references in components and pages accordingly.

Reviewed Changes

Copilot reviewed 60 out of 60 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/site/components/withBreadcrumbs.tsx Updated import for dashToCamelCase from stringUtils to string
apps/site/components/withBlogCategories.tsx Updated import for mapAuthorToCardAuthors from authorUtils to author
apps/site/components/withBanner.tsx Updated import for dateIsBetween from dateUtils to date
apps/site/components/withBadgeGroup.tsx Updated import for dateIsBetween from dateUtils to date
apps/site/components/withAvatarGroup.tsx Updated import for getAuthors from authorUtils to author
apps/site/components/Downloads/Release/ReleaseCodeBox.tsx Updated import for INSTALL_METHODS from downloadUtils to download
apps/site/components/Downloads/Release/PrebuiltDownloadButtons.tsx Updated imports from downloadUtils to download for getNodeDownloadUrl and others
apps/site/components/Downloads/Release/PlatformDropdown.tsx Updated imports for download utilities including getUserPlatform from downloadUtils to ua
apps/site/components/Downloads/Release/PackageManagerDropdown.tsx Updated imports from downloadUtils to download
apps/site/components/Downloads/Release/OperatingSystemDropdown.tsx Updated imports from downloadUtils to download
apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx Updated imports from downloadUtils to download
apps/site/components/Downloads/Release/DownloadLink.tsx Updated import for DownloadKind from getNodeDownloadUrl to download
apps/site/components/Downloads/MinorReleasesTable/index.tsx Updated import for getNodeApiLink from getNodeApiLink to api
apps/site/components/Downloads/DownloadLink.tsx Updated imports for getNodeDownloadUrl and getUserPlatform from legacy paths to new ones
apps/site/components/Downloads/DownloadButton/index.tsx Updated imports for getNodeDownloadUrl and getUserPlatform from legacy paths to new ones
apps/site/components/Blog/BlogPostCard/index.tsx Updated import for mapBlogCategoryToPreviewType from blogUtils to blog
apps/site/client-context.ts Updated import for assignClientContext from assignClientContext to context
apps/site/app/[locale]/next-data/page-data/route.ts Updated import for parseRichTextIntoPlainText from stringUtils to string
apps/site/app/[locale]/next-data/og/[category]/[title]/route.tsx Updated variable naming and removed hexToRGBA conversion to use rgb() strings directly
apps/site/app/[locale]/next-data/api-data/route.ts Updated imports for getGitHubApiDocsUrl, parseRichTextIntoPlainText from legacy paths to github and string respectively

Copy link

codecov bot commented Jun 8, 2025

Codecov Report

Attention: Patch coverage is 91.55844% with 13 lines in your changes missing coverage. Please review.

Project coverage is 75.36%. Comparing base (4d1ce7b) to head (cbd7e9b).
Report is 35 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/site/util/userAgent.ts 86.36% 12 Missing ⚠️
apps/site/util/objects.ts 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7853      +/-   ##
==========================================
- Coverage   75.46%   75.36%   -0.10%     
==========================================
  Files         101       96       -5     
  Lines        8305     8350      +45     
  Branches      218      220       +2     
==========================================
+ Hits         6267     6293      +26     
- Misses       2036     2055      +19     
  Partials        2        2              

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

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller
@avivkeller
Copy link
Member Author

👋 Sorry for the wait, everyone! I've been out-of-town, but I'm back, and ready to contribute!

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller
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.

SGTM !

@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Jun 26, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jun 26, 2025
Copy link
Contributor

github-actions bot commented Jun 26, 2025

Lighthouse Results

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

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.

In general LGTM, left a few comments!

Verified

This commit was signed with the committer’s verified signature.
avivkeller Aviv Keller
@avivkeller avivkeller added the github_actions:pull-request Trigger Pull Request Checks label Jun 27, 2025
@avivkeller avivkeller enabled auto-merge June 27, 2025 23:43
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Jun 27, 2025
@avivkeller avivkeller added this pull request to the merge queue Jun 27, 2025
Merged via the queue into main with commit b582b77 Jun 27, 2025
15 checks passed
@avivkeller avivkeller deleted the chore/utils branch June 27, 2025 23:50
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.

None yet

5 participants