Skip to content

Create a JSON file for download utilities #7561

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

Closed
avivkeller opened this issue Mar 22, 2025 · 0 comments · Fixed by #7750
Closed

Create a JSON file for download utilities #7561

avivkeller opened this issue Mar 22, 2025 · 0 comments · Fixed by #7750

Comments

@avivkeller
Copy link
Member

Would you mind opening an issue so we could create a JSON file to define the OPERATING_SYSTEMS, INSTALL_METHODS, PACKAGE_MANAGERS and PLATFORMS constants? I think it makes sense for them to be defined on an easy to edit JSON file, since they're not technically code.

Originally posted by @ovflowd in #7401 (comment)


In the apps/site/util/downloadUtils.tsx file, we have several constants that could probably find a new home in a JSON file, for ease of editing.

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Node.js Website Mar 22, 2025
Vishal-K-988 added a commit to Vishal-K-988/nodejs.org that referenced this issue May 15, 2025
Moved hardcoded OS, installation methods, and package manager labels from
downloadUtils.tsx to a separate downloadConstants.json file for better
maintainability. Updated the utility to import and use data from JSON
without changing existing behavior.

Fixes: nodejs#7561
Signed-off-by: vishal <vishalkumarvkvk988@gmail.com>
Vishal-K-988 added a commit to Vishal-K-988/nodejs.org that referenced this issue May 16, 2025
… utils

Moved downloadConstants.json and downloadUtils.tsx into a dedicated subdirectory.
Removed redundant UserOs array and now infer it dynamically from OperatingSystemLabel keys.

Fixes: nodejs#7561
Signed-off-by: vishal <vishalkumarvkvk988@gmail.com>
Vishal-K-988 added a commit to Vishal-K-988/nodejs.org that referenced this issue May 16, 2025
… utils

Moved constants.json and index.tsx into a dedicated subdirectory.
Reorganized constants such as PLATFORMS into constants.json using object destructuring.
Refactored INSTALL_METHODS to use object destructuring and removed explicit any types.
Similarly for OS_NOT_SUPPORTING_INSTALLERS, OperatingSystems

Fixes: nodejs#7561
Signed-off-by: vishal <vishalkumarvkvk988@gmail.com>
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Node.js Website May 17, 2025
Vishal-K-988 added a commit to Vishal-K-988/nodejs.org that referenced this issue May 18, 2025
… utils

>>
>> Moved constants.json and index.tsx into a dedicated subdirectory.
>> Reorganized constants such as PLATFORMS into constants.json using object destructuring.
>> Similarly for OS_NOT_SUPPORTING_INSTALLERS, OperatingSystems
>>
>> Fixes: nodejs#7561

Signed-off-by: vishal <vishalkumarvkvk988@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant