-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(download): externalize labels and constants to JSON file #7750
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
feat(download): externalize labels and constants to JSON file #7750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes a lot of unrelated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a lot more constants that can also be moved to this JSON file.
On my local development branch, I also put the objects where the comparability is into the JSON file.
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #7750 +/- ##
==========================================
+ Coverage 74.85% 75.01% +0.15%
==========================================
Files 98 99 +1
Lines 7895 7949 +54
Branches 200 198 -2
==========================================
+ Hits 5910 5963 +53
- Misses 1984 1985 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bbb2c53
to
60dcdd6
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@avivkeller can you review! |
apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx
Outdated
Show resolved
Hide resolved
@Vishal-K-988 I had a development branch of this a little while ago. If you'd like, I can merge it into this PR to give you a "boost"? If not, that's fine too. |
Hey Aviv, I have resolved the issue and the changes we had discussed! Hey @avivkeller can you please look into this |
This PR still changes unrelated files, can you revert those changes? |
like ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting closer!
apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx
Outdated
Show resolved
Hide resolved
Hey @avivkeller The yaml tile I'm not adding or changing. Not sure ! |
Not to worry. Let's ignore it for now, and once this is ready, I'll commit to fix it. |
@Vishal-K-988 This looks good. Do you mind if I push a commit to your PR which:
(FYI @bjohansebas I've resolved your reviews since I will address them shortly) |
That sounds great, thank you for offering! Please feel free to push that commit with the formatting updates, removal of unrelated changes, and minor improvements to index.tsx. I'm still in the process of learning and understanding best practices, so seeing your commit will be really helpful for me to grasp where I might be missing things or could improve. I appreciate your guidance! |
68ab76c
to
13b4ba6
Compare
You're doing great! The only things needing to be adjusted (which I did via this commit) were the styling, plus I rebased. Secondly, I just extracted |
Lighthouse Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a side effect of my commit, so I'll investigate and fix it. 😅 |
Co-Authored-By: Aviv Keller <me@aviv.sh>
Yep: I changed a |
13b4ba6
to
75fa432
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Moved hardcoded OS, installation methods, and package manager labels from
downloadUtils.tsx
to a separatedownloadConstants.json
file for better maintainability. Updated the utility to import and use data from JSON without changing existing behavior.Fixes: #7561
Description
This PR introduces a refactor to externalize static label constants used for Operating Systems, Installation Methods, and Package Managers into a separate
downloadConstants.json
file. The goal is to improve maintainability and allow future updates without modifying TypeScript source files.The
downloadUtils.tsx
file was updated to import these values directly from the new JSON file. No changes were made to user-facing behavior or UI rendering — functionality remains identical.Validation
pnpm dev
and verified the Downloads page renders correctly with all dropdowns displaying expected options.pnpm format
,pnpm lint
,pnpm test
, andpnpm build
with no errors.downloadUtils.tsx
.Related Issues
Fixes: #7561
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.