-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix(npm): replace npm_translate_lock(replace_packages) with replace_package module extension #1886
base: main
Are you sure you want to change the base?
Conversation
@@ -26,13 +26,22 @@ def _npm_extension_impl(module_ctx): | |||
fail("A minimum version of Bazel 6 required to use rules_js") | |||
|
|||
for mod in module_ctx.modules: | |||
replace_packages = {} |
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.
Should this be computed outside the module_ctx.modules
loop?
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.
probably, since module extensions have a global view over the build, in theory you could have a translate lock from module A and a replacement coming from module B.
1ee7f68
to
e06bb0a
Compare
@@ -26,13 +26,22 @@ def _npm_extension_impl(module_ctx): | |||
fail("A minimum version of Bazel 6 required to use rules_js") | |||
|
|||
for mod in module_ctx.modules: | |||
replace_packages = {} |
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.
probably, since module extensions have a global view over the build, in theory you could have a translate lock from module A and a replacement coming from module B.
TestAll tests were cache hits 193 tests (100.0%) were fully cached saving 48s. Teste2e/bzlmodAll tests were cache hits 5 tests (100.0%) were fully cached saving 631ms. Teste2e/gyp_no_install_scriptAll tests were cache hits 2 tests (100.0%) were fully cached saving 516ms. Teste2e/js_image_ociAll tests were cache hits 1 test (100.0%) was fully cached saving 6s. Teste2e/npm_link_packageAll tests were cache hits 3 tests (100.0%) were fully cached saving 925ms. Teste2e/npm_link_package-esmAll tests were cache hits 3 tests (100.0%) were fully cached saving 925ms. Teste2e/npm_translate_lockAll tests were cache hits 1 test (100.0%) was fully cached saving 59ms. Teste2e/npm_translate_lock_emptyAll tests were cache hits 1 test (100.0%) was fully cached saving 59ms. Teste2e/npm_translate_lock_multiAll tests were cache hits 2 tests (100.0%) were fully cached saving 184ms. Teste2e/npm_translate_lock_partial_cloneAll tests were cache hits 1 test (100.0%) was fully cached saving 55ms. Teste2e/npm_translate_lock_replace_packagesTeste2e/npm_translate_lock_subdir_patchAll tests were cache hits 1 test (100.0%) was fully cached saving 167ms. Teste2e/npm_translate_package_lockAll tests were cache hits 1 test (100.0%) was fully cached saving 59ms. Teste2e/npm_translate_yarn_lockAll tests were cache hits 1 test (100.0%) was fully cached saving 59ms. Teste2e/package_json_moduleAll tests were cache hits 1 test (100.0%) was fully cached saving 507ms. Teste2e/pnpm_lockfilesAll tests were cache hits 40 tests (100.0%) were fully cached saving 16s. Teste2e/pnpm_workspaceAll tests were cache hits 10 tests (100.0%) were fully cached saving 7s. Teste2e/pnpm_workspace_rerootedAll tests were cache hits 10 tests (100.0%) were fully cached saving 4s. Teste2e/repo_mappingAll tests were cache hits 2 tests (100.0%) were fully cached saving 324ms. Teste2e/rules_fooAll tests were cache hits 2 tests (100.0%) were fully cached saving 562ms. Teste2e/vendored_nodeAll tests were cache hits 1 test (100.0%) was fully cached saving 251ms. Buildifier Format |
e06bb0a
to
30fdb9a
Compare
8d7ad3d
to
c7112b5
Compare
591b1b9
to
f847434
Compare
096bdad
to
7582f4a
Compare
7582f4a
to
9a24802
Compare
A replacement of the
npm_translate_lock(replace_packages)
API for bzlmod to ensure labels are passed from the user module instead of strings.Changes are visible to end-users: no
Test plan