unjs / nypm

🌈 Unified Package Manager for Node.js and Bun
MIT License
474 stars 17 forks source link

`workspace` options does not work correctly in `addDependency` #79

Closed AndreyYolkin closed 1 year ago

AndreyYolkin commented 1 year ago

Environment

node: 16.15.1 nypm: 0.2.2

Reproduction

run the tests and see the fixtures

Describe the bug

addDependency has support of workspace option, but for some reasons it behaves like a boolean.

Expected behavior: if workspace is specified. then install package into workspace that matches the workspace name, otherwise install in project root

Actual behaviour: If workspace is true, addDependency does flag calculations (which is broken, too) to install in project root.

Additional context

Seems that it's fixed in https://github.com/unjs/nypm/pull/75

Logs

No response

AndreyYolkin commented 1 year ago

Yep, #75 resolved this.