File tree 6 files changed +816
-11
lines changed
6 files changed +816
-11
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class LS extends ArboristWorkspaceCmd {
50
50
'depth' ,
51
51
'omit' ,
52
52
'link' ,
53
+ 'package-lock-only' ,
53
54
'unicode' ,
54
55
...super . params ,
55
56
]
@@ -79,6 +80,7 @@ class LS extends ArboristWorkspaceCmd {
79
80
const prod = this . npm . config . get ( 'prod' )
80
81
const production = this . npm . config . get ( 'production' )
81
82
const unicode = this . npm . config . get ( 'unicode' )
83
+ const packageLockOnly = this . npm . config . get ( 'package-lock-only' )
82
84
83
85
const path = global ? resolve ( this . npm . globalDir , '..' ) : this . npm . prefix
84
86
@@ -88,7 +90,7 @@ class LS extends ArboristWorkspaceCmd {
88
90
legacyPeerDeps : false ,
89
91
path,
90
92
} )
91
- const tree = await this . initTree ( { arb, args } )
93
+ const tree = await this . initTree ( { arb, args, packageLockOnly } )
92
94
93
95
// filters by workspaces nodes when using -w <workspace-name>
94
96
// We only have to filter the first layer of edges, so we don't
@@ -216,8 +218,13 @@ class LS extends ArboristWorkspaceCmd {
216
218
}
217
219
}
218
220
219
- async initTree ( { arb, args } ) {
220
- const tree = await arb . loadActual ( )
221
+ async initTree ( { arb, args, packageLockOnly } ) {
222
+ const tree = await (
223
+ packageLockOnly
224
+ ? arb . loadVirtual ( )
225
+ : arb . loadActual ( )
226
+ )
227
+
221
228
tree [ _include ] = args . length === 0
222
229
tree [ _depth ] = 0
223
230
Original file line number Diff line number Diff line change @@ -1333,8 +1333,14 @@ define('package-lock-only', {
1333
1333
default : false ,
1334
1334
type : Boolean ,
1335
1335
description : `
1336
- If set to true, it will update only the \`package-lock.json\`, instead of
1337
- checking \`node_modules\` and downloading dependencies.
1336
+ If set to true, the current operation will only use the \`package-lock.json\`,
1337
+ ignoring \`node_modules\`.
1338
+
1339
+ For \`update\` this means only the \`package-lock.json\` will be updated,
1340
+ instead of checking \`node_modules\` and downloading dependencies.
1341
+
1342
+ For \`list\` this means the output will be based on the tree described by the
1343
+ \`package-lock.json\`, rather than the contents of \`node_modules\`.
1338
1344
` ,
1339
1345
flatten,
1340
1346
} )
Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ npm ll [[<@scope>/]<pkg> ...]
538
538
Options:
539
539
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth <depth>]
540
540
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--link]
541
- [--unicode]
541
+ [--package-lock-only] [-- unicode]
542
542
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
543
543
[-ws|--workspaces]
544
544
@@ -588,7 +588,7 @@ npm ls [[<@scope>/]<pkg> ...]
588
588
Options:
589
589
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth <depth>]
590
590
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--link]
591
- [--unicode]
591
+ [--package-lock-only] [-- unicode]
592
592
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
593
593
[-ws|--workspaces]
594
594
Original file line number Diff line number Diff line change @@ -781,8 +781,14 @@ package-locks disabled use \`npm prune\`.
781
781
* Default: false
782
782
* Type: Boolean
783
783
784
- If set to true, it will update only the \`package-lock.json\`, instead of
785
- checking \`node_modules\` and downloading dependencies.
784
+ If set to true, the current operation will only use the \`package-lock.json\`,
785
+ ignoring \`node_modules\`.
786
+
787
+ For \`update\` this means only the \`package-lock.json\` will be updated,
788
+ instead of checking \`node_modules\` and downloading dependencies.
789
+
790
+ For \`list\` this means the output will be based on the tree described by the
791
+ \`package-lock.json\`, rather than the contents of \`node_modules\`.
786
792
787
793
#### \`parseable\`
788
794
Original file line number Diff line number Diff line change @@ -639,7 +639,7 @@ All commands:
639
639
Options:
640
640
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth <depth>]
641
641
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--link]
642
- [--unicode]
642
+ [--package-lock-only] [-- unicode]
643
643
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
644
644
[-ws|--workspaces]
645
645
@@ -683,7 +683,7 @@ All commands:
683
683
Options:
684
684
[-a|--all] [--json] [-l|--long] [-p|--parseable] [-g|--global] [--depth <depth>]
685
685
[--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]] [--link]
686
- [--unicode]
686
+ [--package-lock-only] [-- unicode]
687
687
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
688
688
[-ws|--workspaces]
689
689
You can’t perform that action at this time.
0 commit comments