Skip to content

Conversation

@wraithgar
Copy link
Member

@wraithgar wraithgar commented Aug 23, 2022

Two commits here, one is a refactor so that we could more easily find the bug, the second is the bugfix.

When installing a relative path into a workspace, arborist was trying to install it relative to the project root. This was ok before workspaces as that was the only place you could add new deps. With workspaces we need to now add new deps relative to the tree it's being added to. The second commit does this.

~/D/n/s/ws $ npm pkg delete dependencies.a -w b
{}
~/D/n/s/ws $ node ../../cli i ./workspaces/a -w b

up to date, audited 5 packages in 871ms

found 0 vulnerabilities
~/D/n/s/ws $ npm pkg get dependencies -w b
{
  "b": {
    "a": "file:../a"
  }
}
~/D/n/s/ws $ npm ls
[email protected] /Users/wraithgar/Development/npm/scratch/ws
├── [email protected] -> ./workspaces/a
└─┬ [email protected] -> ./workspaces/b
  └── [email protected] deduped -> ./workspaces/a

@wraithgar wraithgar requested a review from a team as a code owner August 23, 2022 22:40
@wraithgar
Copy link
Member Author

This was refactoring and cleanup trying to debug an issue, the bug still stands but this code allowed us to find where the bug starts, to be fixed later.

@wraithgar wraithgar changed the title fix: inline single-use functions refactor AND bugfix Aug 24, 2022
@wraithgar wraithgar force-pushed the gar/ws-relative-paths branch from 6fe7630 to ec05579 Compare August 24, 2022 14:30
Added link deps need to be relative to the package they're being added
to, not the project root.  In the past the project root was the only
place you could add things but workspaces changed this.
@wraithgar wraithgar force-pushed the gar/ws-relative-paths branch from ec05579 to d30586e Compare August 24, 2022 14:37
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.

3 participants