Skip to content

Conversation

@alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented May 7, 2025

This commit introduces a new ng-dev command:
misc generate-nodejs-toolchain <version>

This command automates the creation of nodejs_register_toolchains Bazel rules by fetching official Node.js release checksums for a given version and outputting the Starlark definition. This simplifies managing Node.js versions in Bazel.

Example usage:

$ pnpm ng-dev misc generate-nodejs-toolchain 24.0.0

nodejs_register_toolchains(
    name = "node24",
    node_repositories = {
        "24.0.0-darwin_arm64": ("node-v24.0.0-darwin-arm64.tar.gz", "node-v24.0.0-darwin-arm64", "194e2f3dd3ec8c2adcaa713ed40f44c5ca38467880e160974ceac1659be60121"),
        "24.0.0-darwin_amd64": ("node-v24.0.0-darwin-x64.tar.gz", "node-v24.0.0-darwin-x64", "f716b3ce14a7e37a6cbf97c9de10d444d7da07ef833cd8da81dd944d111e6a4a"),
        # ... other platforms
    },
    node_version = "24.0.0",
)

…ions

This commit introduces a new `ng-dev` command:
`misc generate-nodejs-toolchain <version>`

This command automates the creation of `nodejs_register_toolchains`
Bazel rules by fetching official Node.js release checksums for a given version and outputting the Starlark definition. This simplifies managing Node.js versions in Bazel.

Example usage:
```
$ pnpm ng-dev misc generate-nodejs-toolchain 24.0.0

This will output:
nodejs_register_toolchains(
    name = "node24",
    node_repositories = {
        "24.0.0-darwin_arm64": ("node-v24.0.0-darwin-arm64.tar.gz", "node-v24.0.0-darwin-arm64", "194e2f3dd3ec8c2adcaa713ed40f44c5ca38467880e160974ceac1659be60121"),
        "24.0.0-darwin_amd64": ("node-v24.0.0-darwin-x64.tar.gz", "node-v24.0.0-darwin-x64", "f716b3ce14a7e37a6cbf97c9de10d444d7da07ef833cd8da81dd944d111e6a4a"),
        # ... other platforms
    },
    node_version = "24.0.0",
)
```
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label May 7, 2025
@alan-agius4 alan-agius4 requested a review from devversion May 7, 2025 08:21
@devversion devversion merged commit 2c7bab7 into angular:main May 7, 2025
9 checks passed
@alan-agius4 alan-agius4 deleted the ng-dev-toolchain-generate branch May 7, 2025 10:40
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants