Skip to content

feat: remove the ability to customize node_modules path #2202

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented Apr 25, 2025

Fix #2196

Changes are visible to end-users: yes/no

  • Searched for relevant documentation and updated as needed: yes/no
  • Breaking change (forces users to change their own code or config): yes/no
  • Suggested release notes appear below: yes/no

Test plan

  • Covered by existing test cases
  • New test cases added
  • Manual testing; please provide instructions so we can reproduce:

Copy link

aspect-workflows bot commented Apr 25, 2025

Test

⚠️ Buildkite build #8409 failed.

//js/private/test/image/non_ascii:bin2 failed to build

errors encountered resolving select() keys for //js/private/test/image/non_ascii:bin2

💡 To reproduce the build failures, run

bazel build //js/private/test/image/non_ascii:bin2

Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 502ms.


Test

e2e/gyp_no_install_script

⚠️ Buildkite build #8409 failed.

Failed tests (1)
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //:write_npm_translate_lock_bzlmod_test

Test

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 2s.


Test

e2e/npm_link_package

All tests were cache hits

3 tests (100.0%) were fully cached saving 448ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

3 tests (100.0%) were fully cached saving 533ms.


Test

e2e/npm_translate_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Test

e2e/npm_translate_lock_empty

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Test

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 268ms.


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 31ms.


Test

e2e/npm_translate_lock_replace_packages

⚠️ Buildkite build #8409 failed.

Failed tests (1)
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //:write_npm_translate_lock_bzlmod_test

Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 98ms.


Test

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 31ms.


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 31ms.


Test

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 253ms.


Test

e2e/pnpm_lockfiles

8 test targets passed

Targets
//v54:repos_0_test [k8-fastbuild]29ms
//v54:repos_3_test [k8-fastbuild]31ms
//v60:repos_0_test [k8-fastbuild]29ms
//v60:repos_3_test [k8-fastbuild]31ms
//v61:repos_0_test [k8-fastbuild]26ms
//v61:repos_3_test [k8-fastbuild]36ms
//v90:repos_0_test [k8-fastbuild]29ms
//v90:repos_3_test [k8-fastbuild]29ms

Total test execution time was 240ms. 35 tests (81.4%) were fully cached saving 3s.


Test

e2e/pnpm_workspace

All tests were cache hits

15 tests (100.0%) were fully cached saving 2s.


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

15 tests (100.0%) were fully cached saving 2s.


Test

e2e/repo_mapping

All tests were cache hits

3 tests (100.0%) were fully cached saving 404ms.


Test

e2e/rules_foo

All tests were cache hits

2 tests (100.0%) were fully cached saving 187ms.


Test

e2e/runfiles

All tests were cache hits

1 test (100.0%) was fully cached saving 173ms.


Test

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 99ms.


Buildifier      Format

@jbedard jbedard force-pushed the 2196-rm-the-node_modules branch from 8abf4c3 to cf54f5a Compare April 25, 2025 07:48
@jbedard jbedard requested a review from dzbarsky April 25, 2025 07:49
@jbedard jbedard force-pushed the 2196-rm-the-node_modules branch 2 times, most recently from 5102c89 to 935d9c2 Compare April 28, 2025 17:46
""" {bin_name} = lambda name, **kwargs: _{bin_name}_internal(name, link_root_name = link_root_name, **kwargs),
{bin_name}_test = lambda name, **kwargs: _{bin_name}_test_internal(name, link_root_name = link_root_name, **kwargs),
{bin_name}_binary = lambda name, **kwargs: _{bin_name}_binary_internal(name, link_root_name = link_root_name, **kwargs),
""" {bin_name} = {bin_name},
Copy link
Collaborator

@dzbarsky dzbarsky Apr 28, 2025

Choose a reason for hiding this comment

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

maybe leave a TODO to cleanup eihter this or the macros above? Seems weird to have both APIs (my vote is to remove this struct)

@@ -48,19 +48,19 @@ _ATTRS = {
For example,

```
//:.aspect_rules_js/node_modules/cliui/7.0.4
//:.aspect_rules_js/cliui/7.0.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is to align with pnpm naming right?

Copy link
Collaborator

@dzbarsky dzbarsky left a comment

Choose a reason for hiding this comment

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

i love this

@@ -217,7 +216,7 @@ def npm_link_targets(name = "node_modules", package = None):
npm_link_all_packages_bzl = [
"""\
# buildifier: disable=function-docstring
def npm_link_all_packages(name = "node_modules", imported_links = []):
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess one question would be... should we keep the name param for consistency across rules but throw if it is not the default? Does that help IDEs or anything like that? 🤷

@jbedard jbedard force-pushed the 2196-rm-the-node_modules branch from 935d9c2 to 2be2231 Compare April 29, 2025 18:40
@jbedard jbedard force-pushed the 2196-rm-the-node_modules branch from 2be2231 to f0c9856 Compare May 1, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ability to customize virtual store name
2 participants