@@ -102,15 +102,15 @@ export class DependencyInstaller {
102
102
103
103
private preferOffline ?: boolean ,
104
104
105
- private installingContext : DepInstallerContext = { } ,
105
+ private installingContext : DepInstallerContext = { }
106
106
) { }
107
107
108
108
async install (
109
109
rootDir : string | undefined ,
110
110
rootPolicy : WorkspacePolicy ,
111
111
componentDirectoryMap : ComponentMap < string > ,
112
112
options : InstallOptions = DEFAULT_INSTALL_OPTIONS ,
113
- packageManagerOptions : PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS ,
113
+ packageManagerOptions : PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS
114
114
) {
115
115
const finalRootDir = rootDir ?? this . rootDir ;
116
116
if ( ! finalRootDir ) {
@@ -131,7 +131,7 @@ export class DependencyInstaller {
131
131
rootPolicy ,
132
132
componentDirectoryMap ,
133
133
options ,
134
- packageManagerOptions ,
134
+ packageManagerOptions
135
135
) ;
136
136
}
137
137
@@ -141,7 +141,7 @@ export class DependencyInstaller {
141
141
rootPolicy : WorkspacePolicy ,
142
142
componentDirectoryMap : ComponentMap < string > ,
143
143
options : InstallOptions = DEFAULT_INSTALL_OPTIONS ,
144
- packageManagerOptions : PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS ,
144
+ packageManagerOptions : PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS
145
145
) : Promise < { dependenciesChanged : boolean } > {
146
146
const args = {
147
147
componentDirectoryMap,
@@ -159,7 +159,7 @@ export class DependencyInstaller {
159
159
if ( options . linkedDependencies ) {
160
160
manifests = JSON . parse ( JSON . stringify ( manifests ) ) ;
161
161
const linkedDependencies = JSON . parse (
162
- JSON . stringify ( options . linkedDependencies ) ,
162
+ JSON . stringify ( options . linkedDependencies )
163
163
) as typeof options . linkedDependencies ;
164
164
if ( linkedDependencies [ finalRootDir ] ) {
165
165
const directDeps = new Set < string > ( ) ;
@@ -188,7 +188,9 @@ export class DependencyInstaller {
188
188
} ;
189
189
} ) ;
190
190
}
191
- const hidePackageManagerOutput = ! ! ( this . installingContext . inCapsule && process . env . VERBOSE_PM_OUTPUT !== 'true' ) ;
191
+ const isJsonCmd = process . argv . includes ( '--json' ) || process . argv . includes ( '-j' ) ;
192
+ const hidePackageManagerOutput =
193
+ Boolean ( this . installingContext . inCapsule && process . env . VERBOSE_PM_OUTPUT !== 'true' ) || isJsonCmd ;
192
194
193
195
// Make sure to take other default if passed options with only one option
194
196
const calculatedPmOpts = {
@@ -252,7 +254,7 @@ export class DependencyInstaller {
252
254
manifests,
253
255
componentDirectoryMap,
254
256
} ,
255
- calculatedPmOpts ,
257
+ calculatedPmOpts
256
258
) ;
257
259
if ( ! hidePackageManagerOutput ) {
258
260
this . logger . consoleSuccess ( `done ${ message } ` , startTime ) ;
@@ -303,7 +305,7 @@ export class DependencyInstaller {
303
305
rootDir ,
304
306
componentDirectoryMap . components ,
305
307
options ,
306
- this . installingContext ,
308
+ this . installingContext
307
309
) ;
308
310
const manifests : Record < string , ProjectManifest > = componentDirectoryMap
309
311
. toArray ( )
@@ -335,7 +337,7 @@ export class DependencyInstaller {
335
337
private async runPrePostSubscribers (
336
338
subscribers : PreInstallSubscriberList | PostInstallSubscriberList = [ ] ,
337
339
type : 'pre' | 'post' ,
338
- args : InstallArgs ,
340
+ args : InstallArgs
339
341
) : Promise < void > {
340
342
const message = this . installingContext ?. inCapsule
341
343
? `(capsule) running ${ type } install subscribers in root dir ${ this . rootDir } `
0 commit comments