-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Initial PR for migrating to rules_js
#30629
Conversation
f452498
to
f3b322b
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.
Do we also plan to update the various utility scripts (e.g. yarn test
) and the docs?
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
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") | ||
|
||
NODE_VERSION = "22.0.0" |
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.
Shouldn't we be on 20.11.1
?
Typically we have our version of node within our repository as the earliest maintenance
version (and moving to 20 now instead of waiting til mid april makes sense to me) instead of the current
version.
I know that it was already at 22.0.0
when you moved this part over, but I wanted to check in on this now.
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.
I think for the Bazel invocation it doesn't necessarily matter as everyone gets the same. What do you think would be the value for staying at the earliest maintenance version?
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.
Since we still support the lower versions, the value is mostly in making sure we don't incidentally rely on something unsupported in the lower versions. It likely doesn't really make a difference, but just wanted to flag it
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.
Yeah, I think for CLI this matters, but here the risk is very low yeah.
Good idea to follow-up on this though. I can see this being a potential issue for the shipped schematics code.
rules_ts_dependencies( | ||
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.8.2 | jq -r '.dist.integrity' | ||
ts_integrity = "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", | ||
ts_version_from = "//:package.json", |
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.
Note that I don't know if we want to align on, for angular-cli
we define the ts_version
here instead of getting it from package.json
. I don't have a really strong feeling on either way, but since we have to obtain the integrity sha anyway, maybe it makes sense to have the version directly defined here as well.
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.
Yeah, in CLI I have a clean-up PR (blocked currently) that also leverages the version from the package.json
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.
I see your point. Not feeling strongly, but ideally, long-term rules_js
would automatically have the right integrity available. That's what I'm hoping for.
remote = "https://github.com/angular/dev-infra.git", | ||
) | ||
|
||
load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1") |
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.
Noting this while I am looking at it now. We should name these setup functions to include the repo they are setting up so that we don't have name collisions in the functions we bring in as well.
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.
Agreed. Let's follow-up on this and also align rules_angular
@@ -1,4 +1,4 @@ | |||
## API Report File for "components-srcs" | |||
## API Report File for "@angular/cdk_collections" |
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.
Nit: In an ideal world we would have the package string listing here correctly end up with the deeper entry point @angular/cdk/collections
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.
Agreed, that's a fix we'd need to make in api_golden
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
Can we also include the necessary updates to renovate.json
for the pnpm-lockfile
changes?
@crisbeto for sure! Can you help quickly in how you think |
|
yeah, they follow the same convention, so should work. Also this is just the initial PR and we are doing an incremental migration. You will still use Will make this more clear in the team's Slack chat. |
This is necessary for an incremental migration to `rules_js` which requires Bazel v6. Bazel v6 removed the managed directories feature, which means we no longer can rely on symlinked node modules as the Bazel repository; but rather need to duplicate dependencies. This is okay/acceptable to enable the incremental migration.
Sets up `rules_js` and links dependencies into the bazel-bin.
This commit sets up `rules_ts`, providing the `ts_library` equivalent for the `rules_js` migration.
The `ts_project` interop rule that we've built was also used in the Angular CLI migration, and it allows us to mix `ts_project` and `ts_library` targets; enabling an incremental migration.
This is an initial commit to migrate some `testing/` targets to `ts_project`, leveraging the interop rule we've built. Notably we also turn of strict deps checking temporarily as the deps checking is only applicable when there are no interop deps anymore!
* Moves the public API goldens to `goldens/` * Switches us to the `npm_package` variant of the golden testing rule. This variant is more future proof and will work well with the `rules_js` migration (as it takes arbitrary Bazel tree artifacts)
This will automatically result in Renovate updating the Aspect lock files.
This will result in the release tool automatically updating the Aspect lock files when necessary.
See individual commits