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
[feat] List workspace names/paths only #4086
Comments
This is especially important to understand what packages and in what order npm will run scripts in. Related to the issue I just filed about running scripts in topological order: #4139 |
this is now possible with > npm query .workspace | jq -r '.[].location'
docs
workspaces/arborist
workspaces/libnpmaccess
workspaces/libnpmdiff
workspaces/libnpmexec
workspaces/libnpmfund
workspaces/libnpmhook
workspaces/libnpmorg
workspaces/libnpmpack
workspaces/libnpmpublish
workspaces/libnpmsearch
workspaces/libnpmteam
workspaces/libnpmversion
smoke-tests |
|
You can use |
Actually my bad, Still something odd to me: the order of packages being listed. My workspaces config: "workspaces": [
"./packages/internal/*",
"./packages/plugins/*",
"./packages/rest/*"
] And the output in the terminal is mixing package directories packages/rest/a
packages/plugins/plugin-a
packages/internal/internal-a
packages/plugins/plugin-b
packages/rest/b I would expect them to stay grouped by directory (and in the order provided by packages/internal/internal-a
packages/plugins/plugin-a
packages/plugins/plugin-b
packages/rest/a
packages/rest/b |
You can get pretty close with |
not the fastest but this seems to work and it should be supported on all platforms. npm exec -c 'node -p "process.env.npm_package_name + \":\" + process.env.PWD"' -w packages
|
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I'm looking for an NPM command similar to
lerna ls
that would print out only the paths of all workspaces.npm ls --production --depth 0 -json
does contain the information, but it's difficult to parse ("resolved": "file:../../packages/package1",
instead of justpath: packages/package1
for example)Related Stackoverflow post: https://stackoverflow.com/questions/69980663/list-npm-workspaces-similar-to-lerna-ls
Expected Behavior
Maybe
npm ls -ws
could just print out the paths, e.g.Steps To Reproduce
See above
Environment
P.S.: This is not a bug, but a feature request. I could not find another template.
The text was updated successfully, but these errors were encountered: