Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ rules_ts_ext.deps(
use_repo(rules_ts_ext, **{"npm_typescript": "components_npm_typescript"})

node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "22.12.0")
node.toolchain(node_version_from_nvmrc = "//:.nvmrc")
use_repo(node, "nodejs_toolchains")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
Copy link
Member

Choose a reason for hiding this comment

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

Why are we updating the pnpm version as well? If we just use the default, it still runs the version we define in our package.json anyway and then we don't have to maintain another location and keep them in sync.

Copy link
Contributor Author

@alan-agius4 alan-agius4 Dec 19, 2025

Choose a reason for hiding this comment

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

Does it? The default is pnpm version 8 is rules node.js and is not auto inferred from the engines field.

https://github.com/angular/components/pull/32575/changes#diff-ae888452fd6b0b69f2f29dd1e29430c0f3f59f8b68b313f120b62b855c5f9fe0L418

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

If we are going to start inferring the node version from .nvmrc why not infer pnpm from packageManager in package.json?

Copy link
Contributor Author

@alan-agius4 alan-agius4 Dec 19, 2025

Choose a reason for hiding this comment

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

There are two problems with that.

1: rules_js doesn’t have a full list of pnpm versions (currently the latest available is 10.21.0)
2. Whenever we cut a release we need to also update the bazel lock file, because the hash of the contents of the package.json that is in the bazel lock file will be invalidated.

Same problems/approach we use the TS versions.

Copy link
Member

@josephperrott josephperrott Dec 19, 2025

Choose a reason for hiding this comment

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

rules_js doesn’t have a full list of pnpm versions

I think that is true for node version as well, and I think it might be a limitation we can accept.

Whenever we cut a release we need to also update the bazel lock file.

If this is happening in multiple places now, maybe we should just update the bazel lock file during release. It seems more straightforward to do this one update than us having to set up of multiple pieces of tooling to update and monitor the versions.


What do you think?

Copy link
Contributor Author

@alan-agius4 alan-agius4 Dec 19, 2025

Choose a reason for hiding this comment

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

That will still not be enough, since rules_ts/rules_js doesn’t check available version of “pnpm” and “typescript”, on NPM but against an internal list. The integrity value needs to be passed explicitly.

https://github.com/aspect-build/rules_js/blob/main/npm/private/versions.bzl

https://github.com/aspect-build/rules_ts/blob/main/ts/private/versions.bzl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to drop the last commit if you want to discuss this more after the break.

Copy link
Member

Choose a reason for hiding this comment

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

Why don't we merge this as it is and we can have this discussion within the tooling pull request in dev-infra where the management of the versions would actually be handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM

name = "pnpm",
pnpm_version = "10.26.0",
pnpm_version_integrity = "sha512-Oz9scl6+cSUGwKsa1BM8+GsfS2h+/85iqbOLTXLjlUJC5kMZD8UfoWQpScc19APevUT1yw7dZXq+Y6i2p+HkAg==",
)
use_repo(pnpm, "pnpm")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
Expand Down
34 changes: 21 additions & 13 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading