File tree Expand file tree Collapse file tree 5 files changed +24
-21
lines changed
packages/plugin-js-packages/src/lib/package-managers Expand file tree Collapse file tree 5 files changed +24
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { objectToKeys } from '@code-pushup/utils' ;
22import type { DependencyGroup } from '../../config.js' ;
33import { filterAuditResult } from '../../runner/utils.js' ;
4- import { COMMON_AUDIT_ARGS , COMMON_OUTDATED_ARGS } from '../constants.js' ;
54import type { AuditResults , PackageManager } from '../types.js' ;
65import { npmToAuditResult } from './audit-result.js' ;
76import { npmToOutdatedResult } from './outdated-result.js' ;
@@ -24,9 +23,10 @@ export const npmPackageManager: PackageManager = {
2423 } ,
2524 audit : {
2625 getCommandArgs : groupDep => [
27- ... COMMON_AUDIT_ARGS ,
26+ 'audit' ,
2827 ...npmDependencyOptions [ groupDep ] ,
2928 '--audit-level=none' ,
29+ '--json' ,
3030 ] ,
3131 unifyResult : npmToAuditResult ,
3232 // prod dependencies need to be filtered out manually since v10
@@ -49,7 +49,7 @@ export const npmPackageManager: PackageManager = {
4949 } ,
5050 } ,
5151 outdated : {
52- commandArgs : [ ... COMMON_OUTDATED_ARGS , '--long' ] ,
52+ commandArgs : [ 'outdated' , '--long' , '--json '] ,
5353 unifyResult : npmToOutdatedResult ,
5454 } ,
5555} ;
Original file line number Diff line number Diff line change 11import { objectToKeys } from '@code-pushup/utils' ;
22import type { DependencyGroup } from '../../config.js' ;
33import { filterAuditResult } from '../../runner/utils.js' ;
4- import { COMMON_AUDIT_ARGS , COMMON_OUTDATED_ARGS } from '../constants.js' ;
54import type { AuditResults , PackageManager } from '../types.js' ;
65import { pnpmToAuditResult } from './audit-result.js' ;
76import { pnpmToOutdatedResult } from './outdated-result.js' ;
@@ -24,8 +23,9 @@ export const pnpmPackageManager: PackageManager = {
2423 } ,
2524 audit : {
2625 getCommandArgs : groupDep => [
27- ... COMMON_AUDIT_ARGS ,
26+ 'audit' ,
2827 ...pnpmDependencyOptions [ groupDep ] ,
28+ '--json' ,
2929 ] ,
3030 ignoreExitCode : true ,
3131 unifyResult : pnpmToAuditResult ,
@@ -49,7 +49,7 @@ export const pnpmPackageManager: PackageManager = {
4949 } ,
5050 } ,
5151 outdated : {
52- commandArgs : COMMON_OUTDATED_ARGS ,
52+ commandArgs : [ 'outdated' , '--json' ] ,
5353 unifyResult : pnpmToOutdatedResult ,
5454 } ,
5555} ;
Original file line number Diff line number Diff line change 11import { dependencyGroupToLong } from '../../constants.js' ;
2- import { COMMON_AUDIT_ARGS , COMMON_OUTDATED_ARGS } from '../constants.js' ;
32import type { PackageManager } from '../types.js' ;
43import { yarnClassicToAuditResult } from './audit-result.js' ;
54import { yarnClassicToOutdatedResult } from './outdated-result.js' ;
@@ -16,15 +15,15 @@ export const yarnClassicPackageManager: PackageManager = {
1615 } ,
1716 audit : {
1817 getCommandArgs : groupDep => [
19- ... COMMON_AUDIT_ARGS ,
20- ' --groups' ,
21- dependencyGroupToLong [ groupDep ] ,
18+ 'audit' ,
19+ ` --groups= ${ dependencyGroupToLong [ groupDep ] } ` ,
20+ '--json' ,
2221 ] ,
2322 ignoreExitCode : true ,
2423 unifyResult : yarnClassicToAuditResult ,
2524 } ,
2625 outdated : {
27- commandArgs : COMMON_OUTDATED_ARGS ,
26+ commandArgs : [ 'outdated' , '--json' ] ,
2827 unifyResult : yarnClassicToOutdatedResult ,
2928 } ,
3029} ;
Original file line number Diff line number Diff line change 11// Yarn v2 does not currently audit optional dependencies
22import type { DependencyGroup } from '../../config.js' ;
3- import { COMMON_AUDIT_ARGS , COMMON_OUTDATED_ARGS } from '../constants.js' ;
43import type { PackageManager } from '../types.js' ;
54import { yarnBerryToAuditResult } from './audit-result.js' ;
65import { yarnBerryToOutdatedResult } from './outdated-result.js' ;
@@ -23,18 +22,25 @@ export const yarnModernPackageManager: PackageManager = {
2322 outdated : 'https://github.com/mskelton/yarn-plugin-outdated' ,
2423 } ,
2524 audit : {
26- getCommandArgs : groupDep => [
27- 'npm' ,
28- ...COMMON_AUDIT_ARGS ,
29- '--environment' ,
30- yarnModernEnvironmentOptions [ groupDep ] ,
31- ] ,
25+ getCommandArgs : groupDep => {
26+ const environment = yarnModernEnvironmentOptions [ groupDep ] ;
27+ return [
28+ 'npm' ,
29+ 'audit' ,
30+ ...( environment ? [ `--environment=${ environment } ` ] : [ ] ) ,
31+ '--json' ,
32+ ] ;
33+ } ,
3234 supportedDepGroups : [ 'prod' , 'dev' ] , // Yarn v2 does not support audit for optional dependencies
3335 unifyResult : yarnBerryToAuditResult ,
3436 ignoreExitCode : true ,
3537 } ,
3638 outdated : {
37- commandArgs : [ ...COMMON_OUTDATED_ARGS , '--workspace=.' ] , // filter out other packages in case of Yarn workspaces
39+ commandArgs : [
40+ 'outdated' ,
41+ '--workspace=.' , // filter out other packages in case of Yarn workspaces
42+ '--json' ,
43+ ] ,
3844 unifyResult : yarnBerryToOutdatedResult ,
3945 } ,
4046} ;
You can’t perform that action at this time.
0 commit comments