@@ -823,20 +823,6 @@ define('global', {
823
823
} ,
824
824
} )
825
825
826
- define ( 'global-style' , {
827
- default : false ,
828
- type : Boolean ,
829
- description : `
830
- Causes npm to install the package into your local \`node_modules\` folder
831
- with the same layout it uses with the global \`node_modules\` folder.
832
- Only your direct dependencies will show in \`node_modules\` and
833
- everything they depend on will be flattened in their \`node_modules\`
834
- folders. This obviously will eliminate some deduping. If used with
835
- \`legacy-bundling\`, \`legacy-bundling\` will be preferred.
836
- ` ,
837
- flatten,
838
- } )
839
-
840
826
// the globalconfig has its default defined outside of this module
841
827
define ( 'globalconfig' , {
842
828
type : path ,
@@ -851,6 +837,25 @@ define('globalconfig', {
851
837
flatten,
852
838
} )
853
839
840
+ define ( 'global-style' , {
841
+ default : false ,
842
+ type : Boolean ,
843
+ description : `
844
+ Only install direct dependencies in the top level \`node_modules\`,
845
+ but hoist on deeper dependendencies.
846
+ Sets \`--install-strategy=shallow\`.
847
+ ` ,
848
+ deprecated : `
849
+ This option has been deprecated in favor of \`--install-strategy=shallow\`
850
+ ` ,
851
+ flatten ( key , obj , flatOptions ) {
852
+ if ( obj [ key ] ) {
853
+ obj [ 'install-strategy' ] = 'shallow'
854
+ flatOptions . installStrategy = 'shallow'
855
+ }
856
+ } ,
857
+ } )
858
+
854
859
define ( 'heading' , {
855
860
default : 'npm' ,
856
861
type : String ,
@@ -1076,6 +1081,21 @@ define('install-links', {
1076
1081
flatten,
1077
1082
} )
1078
1083
1084
+ define ( 'install-strategy' , {
1085
+ default : 'hoisted' ,
1086
+ type : [ 'hoisted' , 'nested' , 'shallow' ] ,
1087
+ description : `
1088
+ Sets the strategy for installing packages in node_modules.
1089
+ hoisted (default): Install non-duplicated in top-level, and duplicated as
1090
+ necessary within directory structure.
1091
+ nested: (formerly --legacy-bundling) install in place, no hoisting.
1092
+ shallow (formerly --global-style) only install direct deps at top-level.
1093
+ linked: (coming soon) install in node_modules/.store, link in place,
1094
+ unhoisted.
1095
+ ` ,
1096
+ flatten,
1097
+ } )
1098
+
1079
1099
define ( 'json' , {
1080
1100
default : false ,
1081
1101
type : Boolean ,
@@ -1111,12 +1131,21 @@ define('legacy-bundling', {
1111
1131
default : false ,
1112
1132
type : Boolean ,
1113
1133
description : `
1114
- Causes npm to install the package such that versions of npm prior to 1.4,
1115
- such as the one included with node 0.8, can install the package. This
1116
- eliminates all automatic deduping. If used with \`global-style\` this
1117
- option will be preferred.
1134
+ Instead of hoisting package installs in \`node_modules\`, install packages
1135
+ in the same manner that they are depended on. This may cause very deep
1136
+ directory structures and duplicate package installs as there is no
1137
+ de-duplicating.
1138
+ Sets \`--install-strategy=nested\`.
1118
1139
` ,
1119
- flatten,
1140
+ deprecated : `
1141
+ This option has been deprecated in favor of \`--install-strategy=nested\`
1142
+ ` ,
1143
+ flatten ( key , obj , flatOptions ) {
1144
+ if ( obj [ key ] ) {
1145
+ obj [ 'install-strategy' ] = 'nested'
1146
+ flatOptions . installStrategy = 'nested'
1147
+ }
1148
+ } ,
1120
1149
} )
1121
1150
1122
1151
define ( 'legacy-peer-deps' , {
@@ -1523,8 +1552,8 @@ define('prefix', {
1523
1552
short : 'C' ,
1524
1553
default : '' ,
1525
1554
defaultDescription : `
1526
- In global mode, the folder where the node executable is installed. In
1527
- local mode , the nearest parent folder containing either a package.json
1555
+ In global mode, the folder where the node executable is installed.
1556
+ Otherwise , the nearest parent folder containing either a package.json
1528
1557
file or a node_modules folder.
1529
1558
` ,
1530
1559
description : `
0 commit comments