Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ls.js
AgeCommit message (Collapse)Author
2021-04-29ls: do not warn on missing optional depsisaacs
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
2021-04-22fix: npm ls --long missing depsRuy Adorno
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
2021-04-22fix(ls): do not exit with error when all problems are extraneous depsnlf
PR-URL: https://github.com/npm/cli/pull/3086 Credit: @nlf Close: #3086 Reviewed-by: @wraithgar, @ruyadorno
2021-03-18feat(help): refactor npm help/help-searchGar
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
2021-03-18chore(config): remove flatOptions referencesGar
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
2021-03-09fix(usage): clean up usage declarationsGar
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
2021-03-09fix(npm.output): make output go through npm.outputGar
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
2021-03-05fix(npm) pass npm context everywhereGar
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
2021-03-04Remove unused arguments on various function callsNathan Shively-Sanders
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
2021-02-08fix: prune optionalDeps ls compatRuy Adorno
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.
2021-01-15fix: npm ls global testsRuy Adorno
2020-12-11Remove 'use strict'isaacs
We have a linter. yolo
2020-10-23update lint rules to match @npmcli/arboristisaacs
2020-10-20fix: check `result` when determining exit code of `ls <filter>`Gareth Jones
PR-URL: https://github.com/npm/cli/pull/1986 Credit: @G-Rath Close: #1986 Reviewed-by: @ruyadorno
2020-09-29fix: listing deps of a linked depRuy Adorno
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
2020-09-29fix: npm ls <pkg> with depth cli configRuy Adorno
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
2020-07-30fix: npm ls duplicated itemsRuy Adorno
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
2020-07-29lint the lib folderisaacs
2020-07-23fix: more dedupe edge casesRuy Adorno
PR-URL: https://github.com/npm/cli/pull/1545 Credit: @ruyadorno Close: #1545 Reviewed-by: @isaacs
2020-07-23fix: unmet label on deduped depsRuy Adorno
2020-07-23fix: archy output dedupe label colorRuy Adorno
2020-07-23fix: better handle problemsRuy Adorno
- 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
2020-07-23fix: deduped+filter issuesRuy Adorno
- 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
2020-07-22fix: add support to global npm lsRuy Adorno
Paired-with: @darcyclarke
2020-07-21BREAKING: changed npm ls default to depth=0Ruy Adorno
- 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
2020-07-21BREAKING: rewrite npm lsRuy Adorno
- 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
2019-02-19install: add support for package aliases (#3)Kat Marchán
PR-URL: https://github.com/npm/cli/pull/3 Credit: @zkat Reviewed-By: @aeschright
2019-02-14ls: show installed but unmet peer deps (#145)Lars Willighagen
PR-URL: https://github.com/npm/cli/pull/145 Fixes: https://npm.community/t/4770 Credit: @larsgw Reviewed-By: @aeschright
2018-03-23standardizeRebecca Turner
2017-08-13ls: Don't exclude modules that are both dev & prod with --productionRebecca Turner
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
2017-07-12ls: add --link filter (#17616)Richard Simko
* 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
2017-07-11install: fix max callstack exceeded loops with linksRebecca Turner
PR-URL: https://github.com/npm/npm/pull/17652 Credit: @iarna Reviewed-By: @zkat
2017-07-06config: refactor to use Object.assign (#17563)Ramana Venkata
Object.assign is available in Node >= 4 PR-URL: https://github.com/npm/npm/pull/17563 Credit: @vramana Reviewed-By: @zkat
2017-07-06install: Insist on full tree when mutating with a package.lockRebecca Turner
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
2017-07-06ls: Take shrinkwrap into account in lsRebecca Turner
PR-URL: https://github.com/npm/npm/pull/17508 Credit: @iarna Reviewed-By: @zkat
2017-05-27ls: remove unused argument (#16756)薛定谔的猫
PR-URL: https://github.com/npm/npm/pull/16756 Credit: @Aladdin-ADD Reviewed-By: @zkat
2017-05-26filespecs: Implement new file: specifier behaviorRebecca Turner
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
2017-05-26ls: Remove blank lines from `npm ls --parseable`Rebecca Turner
2017-04-28*: Patch to support npm-package-arg@5Rebecca Turner
2017-03-10ls: stop flattening output, show the actual treeRebecca Turner
PR-URL: https://github.com/npm/npm/pull/15888 Credit: @iarna Reviewed-By: @zkat
2016-06-16output: Standardize how we write to stdoutRebecca Turner
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
2016-05-20ls: fix filter when prerelease version presentKat Marchán
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
2016-04-28lib: Refactor summary usage to use utils/usageDaijiro Wachi
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
2016-03-11ls: Made `npm ls --parseable` honor the `depth` optionZac
Credit: @zacdoe Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/11773 Fixes: #11495
2016-03-04install: Make install reports only include versions installedRebecca Turner
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).
2016-02-19ls: Only list runtime dependencies when doing `npm ls --production`zoujie.wzj
Fixes: #11559 Credit: @yibn2008 Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/11562
2016-01-29ls: don't subtract dev from production depsDave
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
2015-12-11ls: fix depth when outputting JSONMark Reeder
Credit: @MarkReeder Reviewed-By: @othiym23 PR-URL: https://github.com/npm/npm/pull/10505
2015-10-09package-id: rename into utils, from install/get-package-idRebecca Turner
PR-URL: //github.com/npm/npm/pull/9890 Fixes: #9766
2015-10-01logical-tree: Make it mutate to improve performanceRebecca Turner
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