npm / npm-v7-blog

a repo to hold blog posts about npm v7 that'll end up on the npm blog
https://blog.npmjs.org/
14 stars 4 forks source link

[FEATURE] Running scripts in workspaces #5

Closed gustavo-iha closed 3 years ago

gustavo-iha commented 3 years ago

What / Why

I'd love to able to run scripts from a workspace package.json using the same code files as the root package.json.

When

Whenever I run npm run <script>

Where

How

Current Behavior

When I have a folder such as: root ├── src/ ├── workspace/ ------├── package.json ├── package.json

I need to replicate src/ folder into workspace/ to be able to run scripts in workspace/package.json.

Expected Behavior

Running any script from the root folder using commands such as npm workspace <workspace-name> run <script> would be awesome!!

Who

References

virtuoushub commented 3 years ago

@gustavo-iha FWIW, there is an open ticket for this at https://github.com/npm/cli/issues/1904

ruyadorno commented 3 years ago

Thanks @gustavo-iha, discussion about these new features is being held over at our RFC repo: https://github.com/npm/rfcs/pull/117

Feel free to leave comments there instead 😊