aspect-build / aspect-build/rules_js

Support .npmrc public hoisting settings

Open
#239 5 comments 8 reactions 0 assignees View on GitHub
enhancement need: funding
Dominant language
Starlark
Stars
378
Forks
183
Avg merge
1d 9h
Merged PRs (30d)
32

Description

If the user has https://pnpm.io/npmrc#public-hoist-pattern and/or https://pnpm.io/npmrc#shamefully-hoist in their .npmrc, we should honor these and lay out our node_modules symlinks into the virtual store in the same way pnpm would.

These hoist dependencies matching the pattern to the root modules directory. Hoisting to the root modules directory means that application code will have access to phantom dependencies, even if they modify the resolution strategy improperly.

Note: as a temporary, partial measure, we have the `public_hoist_packages ` attribute of https://github.com/aspect-build/rules_js/blob/main/docs/npm_import.md#npm_translate_lock
and you can find an example usage of that buried in https://github.com/aspect-build/rules_jest/blob/main/scripts/mirror_release.sh#L40-L44

Contributor guide

Open the contributing guide

Research direction

Start by reading the pnpm .npmrc documentation linked in the issue, then inspect the temporary public_hoist_packages measure in docs/npm_import.md and its usage in scripts/mirror_release.sh. The work is done when public-hoist-pattern and shamefully-hoist settings are honored and node_modules symlinks are laid out like pnpm.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.