Age | Commit message (Collapse) | Author |
|
There was code checking node[_type], but we didn't include that field on
the object that is actually checked when we are looking for problems.
Fix: #3137
PR-URL: https://github.com/npm/cli/pull/3140
Credit: @isaacs
Close: #3140
Reviewed-by: @ruyadorno
|
|
Running `npm ls --json --long --all` was broken for any project
containing a missing dependency from the node_modules folder. This
fixes it by avoiding trying to read the extra data required by the
--long option in case a dependency is missing.
Fixes: https://github.com/npm/cli/issues/2724
PR-URL: https://github.com/npm/cli/pull/3119
Credit: @ruyadorno
Close: #3119
Reviewed-by: @wraithgar
|
|
PR-URL: https://github.com/npm/cli/pull/3086
Credit: @nlf
Close: #3086
Reviewed-by: @wraithgar, @ruyadorno
|
|
Lots of dead code removed thanks to streamlining of logic.
`npm help` `npm <command>` and `npm help-search` are all now separated
concerns, handling their own use cases. `help` calls `help-search` as a
last resort, but `npm <command>` no longer tries to wind its way through
to `help-search` just to get the basic npm usage displayed.
The `did you mean` output has been expanded. It now always suggests top
level commands, scripts, and bins, and suggests them in the way they
should be called.
PR-URL: https://github.com/npm/cli/pull/2859
Credit: @wraithgar
Close: #2859
Reviewed-by: @ruyadorno
|
|
Iterative change moving us towards a more unified config.
No longer pulling config from flatOptions where we don't have to.
PR-URL: https://github.com/npm/cli/pull/2892
Credit: @wraithgar
Close: #2892
Reviewed-by: @ruyadorno
|
|
Small refactor of commands to allow usage to be more programmatically
generated, leading us in the direction of more tighly coupling each
command to the params it accepts.
PR-URL: https://github.com/npm/cli/pull/2821
Credit: @wraithgar
Close: #2821
Reviewed-by: @isaacs
|
|
All output that anything wants to make now goes through
`npm.output()`. This is an incremental change getting us
closer to where we want to be with testing.
PR-URL: https://github.com/npm/cli/pull/2795
Credit: @wraithgar
Close: #2795
Reviewed-by: @ruyadorno, @isaacs
|
|
Instead of files randomly requiring the npm singleton,
we pass it where it needs to go so that tests don't need
to do so much require mocking everywhere
PR-URL: https://github.com/npm/cli/pull/2772
Credit: @wraithgar
Close: #2772
Reviewed-by: @ruyadorno
|
|
I checked cli's code with Typescript using the tsconfig below. The
compiler found a few arguments that are not used, so I removed them. In
the case of `npm whoami`, it is clearer that it ignores its `args`
and instead relies on `npm.flatOptions`.
```json
{
"compilerOptions": {
"moduleResolution": "node",
"module": "commonjs",
"resolveJsonModule": true,
"target": "es2019",
"noImplicitAny": false,
"noImplicitThis": true,
"strict": true,
"maxNodeModuleJsDepth": 0,
"noEmit": true,
"allowJs": true,
"checkJs": true,
"types": ["node"],
"lib": ["esnext"]
},
"include": ["lib"]
}
```
PR-URL: https://github.com/npm/cli/pull/2766
Credit: @sandersn
Close: #2766
Reviewed-by: @nlf, @ruyadorno, @Matausi29
|
|
Fixes a compatibility issue in `npm ls` due to the subtle internal
change of optional dependencies being pruned from dependencies in
`read-package-json-fast@2.0.0` update.
|
|
|
|
We have a linter.
yolo
|
|
|
|
PR-URL: https://github.com/npm/cli/pull/1986
Credit: @G-Rath
Close: #1986
Reviewed-by: @ruyadorno
|
|
npm ls was failing to properly follow symlink targets in order to find
its dependencies to get printed output.
PR-URL: https://github.com/npm/cli/pull/1871
Credit: @ruyadorno
Close: #1871
Reviewed-by: @nlf
|
|
Using the cli option --depth is currently not resulting in the expected
behavior of filtering depth level when running npm ls <pkg> - that's due
the special behavior of printing all results when using a filter arg.
This commit fixes it by adding support to limiting depth if a config
value is set by the user.
Fixes #1861
PR-URL: https://github.com/npm/cli/pull/1862
Credit: @ruyadorno
Close: #1862
Reviewed-by: @nlf
|
|
When having nodes that are children of extraneous nodes, items were
getting printed twice using `npm ls`.
This fixes it by keeping track of seen nodes while iterating in a same
children level and effectively avoiding printing a same item twice.
fix: #1573
PR-URL: https://github.com/npm/cli/pull/1576
Credit: @ruyadorno
Close: #1576
Reviewed-by: @isaacs
|
|
|
|
PR-URL: https://github.com/npm/cli/pull/1545
Credit: @ruyadorno
Close: #1545
Reviewed-by: @isaacs
|
|
|
|
|
|
- Only assign problems if the related node is included in output
- Avoid breaking if using dummy node on node.satisfies
- Added test case for `npm ls .` edge case
|
|
- When using args to filter out items deduped pkgs were broken
- Fixed highlight color when using filter args
- Changed default behavior to show all packages when using args filter
Paired-with: @isaacs
|
|
Paired-with: @darcyclarke
|
|
- npm ls now defaults to only printing root children
- added --all flag that is same as --depth=Infinity
- --depth now defaults to 0 and can still be used if --all is not truthy
|
|
- Rewrites lib/ls.js command to use @npmcli/arborist
- Updates unit tests
- Breaking changes:
- added error codes: ELSPROBLEMS, EJSONPARSE to callback errors
- extraneous deps depth will match current location in nm folder
- mark top-level deps as extraneous when missing root package.json
- don't mark deps as extraneous if they're valid deps of invalid deps
- peer deps are now listed as regular deps, removed oddities such as
peerinvalid label and stops labeling peer deps extraneous
- might print diff git resolved values,
see: https://github.com/npm/hosted-git-info
- Parseable (--parseable) output:
- possible order of printed elements changed
- fixed consistency problems in which it would print root folder
name if using a filter argument that could not match against
any of the deps in the current installed tree
- fixed printing non-existing paths for missing dependencies
- fixed undefined symlink output when using --long output
- JSON (--json) output:
- removed: `from` property from --json output
- removed: "[Circular]" references
- added "missing" to list of peer-dep problems listed
- added peerDependencies ref when using --long output
- removed readme properties using --long output
- Renamed error msg:
`Failed to parse json` -> `Failed to parse root package.json`
refs:
- https://github.com/npm/statusboard/issues/99
- https://github.com/npm/statusboard/issues/103
|
|
PR-URL: https://github.com/npm/cli/pull/3
Credit: @zkat
Reviewed-By: @aeschright
|
|
PR-URL: https://github.com/npm/cli/pull/145
Fixes: https://npm.community/t/4770
Credit: @larsgw
Reviewed-By: @aeschright
|
|
|
|
Previously if a module was in devDependencies then it would never show
up with `npm ls --production` even if it was ALSO in dependencies.
Credit: @iarna
PR-URL: https://github.com/npm/npm/pull/15088
|
|
* feature: Added possibility to ls only linked packages
* test: added test case for ls --link
* docs: documented --link for npm-ls
PR-URL: https://github.com/npm/npm/pull/17616
Credit: @richardsimko
Reviewed-By: @zkat
|
|
PR-URL: https://github.com/npm/npm/pull/17652
Credit: @iarna
Reviewed-By: @zkat
|
|
Object.assign is available in Node >= 4
PR-URL: https://github.com/npm/npm/pull/17563
Credit: @vramana
Reviewed-By: @zkat
|
|
That is, if you have a package-lock but haven't installed anything yet then
we're going to insist that all of the bits be there. This is necessary in order
to be able to cleanly upgrade old package-lock files. This means if you type
`npm install foo` or `npm rm foo` and don't have a `node_modules` but do have
a `package-lock.json` it's gonna install everything from the
`package-lock.json` in addition to making your change.
The one thing we won't do is update your package-lock from your
package.json. We only do that when you request a full install.
This does not change the behavior if you don't have a lock file.
PR-URL: https://github.com/npm/npm/pull/17508
Credit: @iarna
Reviewed-By: @zkat
|
|
PR-URL: https://github.com/npm/npm/pull/17508
Credit: @iarna
Reviewed-By: @zkat
|
|
PR-URL: https://github.com/npm/npm/pull/16756
Credit: @Aladdin-ADD
Reviewed-By: @zkat
|
|
PR-URL: https://github.com/npm/npm/pull/15900
Credit: @iarna
actions: Allow actions to return promises
extract: Eliminate extra callback
finalize: Rewrite finalize as promises
update-linked: Remove update-linked action
install: Remove obsolete invalid action filtering
fetch-package-metadata: Error on installing windows paths on non-windows systems
fetch-package-metadata: Read in modules installed inside of new links
finalize: Act on realpaths because we may be installing inside a link prior to the symlink being made
finalize: Create symlinks of directory deps
deps: Resolve ambiguity for file specifiers in the traditional way
deps: Set link and realpath properties for directory deps
inflate-bundled: Distinguish published bundles from lined modules
node: Add new fromLink attribute to track sourced-to-symlinks deps
diff-trees: Don't try to install deps that are already inside a link
fetch-package-metadata: Improve error messages for link failures
install: Run preinstall lifecycle after finalize
finalize: Start reading package.json files here
decompose-actions: Don't fetch or extract links
deps: Determine if a link matches spec based on where it points
deps: Compute correct save specifier for file spec
deps: Set the isInLink property on new children
deps: When finding the install location, don't walk up out of a symlink unless PRESERVE_SYMLINKS is on
diff-trees: Stop setting isInLink, this is now a first class property
diff-trees: Only exclude children of links from adding if they were already there behind the symlink
inflate-bundled: We are using isInLink now not fromLink
inflate-bundled: realpaths should be built on realpaths
node: Eliminate fromLink as a thing
node: Fill in values for inLink, isInLink & fromBundle
save: When updating a lock/shrinkwrap don't read the damn tree again
shrinkwrap: Fill in version per the new shrinkwrap spec
install: Make _inBundle purely a debugging artifact
inflate-shrinkwrap: Fix how bundle deps are inflated
save: Detect dependency type when saving
recalculateMetadata: Rewrite as simpler and synchronous
prune: Work off computed metadata
refreshPackageJson: Copy all of the in memory version over the on-disk version except empty items
install: Reduce normalize tree function to minimum
realize-package-specifier: Bring into closer alignment with spec
read-shrinkwrap: Use child.isTop not !child.parent
copy-tree: Don't crash of requires or requiredBy are missing
copy-tree: Initialize copied nodes
dedupe: use getRequested instead of child.package._requested
install: recompute the pkg relationships after finalize
Neccessary to align behavior with shrinkwraps where relationship information
isn't available until we read the module off disk.
install: Prune the tree after building it
install: Only save deps if we made changes
inflate-shrinkwrap: Better metadata while inflating
|
|
|
|
|
|
PR-URL: https://github.com/npm/npm/pull/15888
Credit: @iarna
Reviewed-By: @zkat
|
|
This allows us to consistently make sure that the progress bar is hidden
before we try to write to stdout.
PR-URL: https://github.com/npm/npm/pull/13075
Credit: @iarna
|
|
If `ls` for a package without using a semver filter,
for example, `npm ls foo` vs `foo@1.2.3`, `ls` was using semver
ranges based on `*`, which doesn't match prerelease versions.
So, if you had installed a prerelease version (`foo@1.2.3-xyz`),
the `npm ls` will return no results for `foo`, at all.
This patch bypasses the semver check entirely when there's no semver
filter for the search.
Fixes: https://github.com/npm/npm/issues/9436
Credit: @zkat
PR-URL: https://github.com/npm/npm/pull/12685
Reviewed-By: @othiym23
|
|
This also helps by DRYing up our lists of command aliases.
Credit: @watilde
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/12485
|
|
Credit: @zacdoe
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/11773
Fixes: #11495
|
|
This makes install select modules to display by install path. Previously it
was using name@version, which worked as long as you didn't have duplicates
in your tree, but was basically wrong forever if you did (as in npm's own
tree).
|
|
Fixes: #11559
Credit: @yibn2008
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/11562
|
|
If a package is in dependencies and devDependencies,
filterByEnv removes it from ls --production. This doesn't
make sense, since the package is still a prod dependency.
Fixes: #10820
PR-URL: https://github.com/npm/npm/pull/11245
Credit: @davidvgalbraith
Reviewed-By: @iarna
|
|
Credit: @MarkReeder
Reviewed-By: @othiym23
PR-URL: https://github.com/npm/npm/pull/10505
|
|
PR-URL: //github.com/npm/npm/pull/9890
Fixes: #9766
|
|
The clone we were doing to save ourselves from mutation proved to be
excessively slow. While lodash is being updated to not have the
same scaling issues, it was determined that we weren't gaining
anything from not mutating here, so there was no reason to pay
even a lesser price.
PR-URL: https://github.com/npm/npm/pull/9803
Fixes: #8826
|