-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs: generate adev-compatible api json #30857
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
base: main
Are you sure you want to change the base?
Conversation
0c6a191
to
50e19f9
Compare
dc03d7b
to
de4f33a
Compare
a0aa103
to
82f26cf
Compare
@@ -0,0 +1,70 @@ | |||
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") |
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.
Can you use js_binary
? nodejs_binary
is the old one and doesn't support ESM
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 gave this a try, and it tells me that I have to run the js_binary
with js_run_binary
and that seems to be a whole can of worms that involves converting extract_api_to_json
from a rule to a macro. And that probably entails changing the format of the parameters passed into the actual script.
This is all just copy/pasted from the fw repo with the idea that I would make minimal changes to it and it would eventually be refactored to just call the same script from some shared location.
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.
You should be able to just call the js_binary like the nodejs_binary. You just need to set BAZEL_BINDIR
as environment variable.
I don't think, even if it's for copy/pasting, that we should introduce new instances of legacy code that we were removing/replacing in the last weeks/month.
# Pass the import path map | ||
# TODO: consider module_mappings_aspect to deal with path mappings instead of manually | ||
# specifying them | ||
# https://github.com/bazelbuild/rules_nodejs/blob/5.x/internal/linker/link_node_modules.bzl#L236 |
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: update this TODO. With our new Bazel toolchain, this whole concept no longer exists (probably module_name
attributes still need to be cleaned up though).
This way seems correct, but even better would be just leveraging the real tsconfig from src/bazel-tsconfig-build
with the "real path mappings".
Currently using copied in script from adev, need to move the script to a shared location