Skip to content
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: Add support for different Node versions (NVM support) #1357

Merged
merged 27 commits into from
Sep 6, 2024

Conversation

aryan-rajoria
Copy link
Collaborator

@aryan-rajoria aryan-rajoria commented Sep 5, 2024

This PR aims to add support to different Node.js versions, through -t nodejs<version>.
Tested on the following github repos:
For node-8:

    "https://github.com/kriasoft/react-app.git",
    "https://github.com/deepraining/blogs.git",

react-appbom.json
blogsbom.json

For node-10:

    "https://github.com/patrickjuchli/basic-ftp.git",
    "https://github.com/donavon/use-thwack.git",

basic-ftpbom.json
use-thwackbom.json

For node-12:

    "https://github.com/postcss/sugarss.git",
    "https://github.com/sindresorhus/pupa.git",

sugarssbom.json
pupabom.json

For node-14:

    "https://github.com/zabirauf/AutoGPT.js.git",
    "https://github.com/plexidev/quick.db.git",

AutoGPT.jsbom.json
quick.dbbom.json

For node-16:

    "https://github.com/Atome-FE/llama-node.git",
    "https://github.com/sindresorhus/react-extras.git",

llama-nodebom.json
react-extrasbom.json

For node-18:

    "https://github.com/glitch-soc/mastodon.git",
    "https://github.com/sindresorhus/element-ready.git"

mastodonbom.json
element-readybom.json

@aryan-rajoria
Copy link
Collaborator Author

For the dvna project:
https://github.com/appsecco/dvna.git
sbom generated using args:

"args": [
                "-t",
                "nodejs8",
                "-o",
                "~/dvnasbom.json",
                "~/dvna"
            ]

dvnasbom.json

@aryan-rajoria aryan-rajoria changed the title Feat: Add support for Different Node versions (NVM support) Feat: Add support for different Node versions (NVM support) Sep 5, 2024
pregen.js Outdated Show resolved Hide resolved
utils.js Show resolved Hide resolved
pregen.js Outdated Show resolved Hide resolved
pregen.js Outdated Show resolved Hide resolved
envcontext.js Show resolved Hide resolved
@aryan-rajoria
Copy link
Collaborator Author

For node-20:

    "https://github.com/nowsecure/node-applesign.git",
    "https://github.com/Mojang/minecraft-scripting-libraries.git",

node-applesignbom.json
minecraft-scripting-librariesbom.json

For node-22:

    "https://github.com/DIYgod/RSSHub.git",
    "https://github.com/pex-gl/pex-gl.git",

RSSHubbom.json
pex-glbom.json

pregen.js Fixed Show resolved Hide resolved
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
envcontext.js Show resolved Hide resolved
pregen.js Show resolved Hide resolved
pregen.js Outdated Show resolved Hide resolved
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
pregen.js Dismissed Show dismissed Hide dismissed
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
Signed-off-by: Aryan Rajoria <[email protected]>
envcontext.js Show resolved Hide resolved
envcontext.js Outdated Show resolved Hide resolved
envcontext.js Outdated Show resolved Hide resolved
Signed-off-by: Aryan Rajoria <[email protected]>
export function tryLoadNvmAndInstallTool(nodeVersion) {
const NVM_DIR = process.env.NVM_DIR;

const command = `
Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok for this PR, but this won't work in Windows powershell. Maybe this could be added in another PR.

@prabhu
Copy link
Contributor

prabhu commented Sep 6, 2024

Great job on your first sponsored PR! Just a couple of rename suggestions.

@aryan-rajoria aryan-rajoria merged commit f1a60cd into master Sep 6, 2024
20 of 21 checks passed
@aryan-rajoria aryan-rajoria deleted the nvm-support branch September 6, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants