File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
lib/dep-graph-builders/pnpm Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ import {
1212 LOCK_FILE_NAME ,
1313} from '../../errors/out-of-sync-error' ;
1414import { LockfileType } from '../..' ;
15+ import * as debugModule from 'debug' ;
16+
17+ const debug = debugModule ( 'snyk-pnpm-workspaces' ) ;
1518
1619export const buildDepGraphPnpm = async (
1720 lockFileParser : PnpmLockfileParser ,
@@ -48,14 +51,15 @@ export const buildDepGraphPnpm = async (
4851
4952 for ( const name of Object . keys ( topLevelDeps ) ) {
5053 if ( ! extractedTopLevelDeps [ name ] ) {
51- throw new OpenSourceEcosystems . PnpmOutOfSyncError (
54+ const errMessage =
5255 `Dependency ${ name } was not found in ` +
53- `${ LOCK_FILE_NAME [ LockfileType . pnpm ] } . Your package.json and ` +
54- `${
55- LOCK_FILE_NAME [ LockfileType . pnpm ]
56- } are probably out of sync. Please run ` +
57- `"${ INSTALL_COMMAND [ LockfileType . pnpm ] } " and try again.` ,
58- ) ;
56+ `${ LOCK_FILE_NAME [ LockfileType . pnpm ] } . Your package.json and ` +
57+ `${
58+ LOCK_FILE_NAME [ LockfileType . pnpm ]
59+ } are probably out of sync. Please run ` +
60+ `"${ INSTALL_COMMAND [ LockfileType . pnpm ] } " and try again.` ;
61+ debug ( errMessage ) ;
62+ throw new OpenSourceEcosystems . PnpmOutOfSyncError ( errMessage ) ;
5963 }
6064 topLevelDeps [ name ] . version = extractedTopLevelDeps [ name ] . version ;
6165 }
Original file line number Diff line number Diff line change @@ -145,8 +145,8 @@ export abstract class PnpmLockfileParser {
145145 ( depName ) =>
146146 ( topLevel [ depName ] = {
147147 name : depName ,
148- version : pkg . dependencies [ depName ] ,
149- isDev : false ,
148+ version : pkg . devDependencies [ depName ] ,
149+ isDev : true ,
150150 } ) ,
151151 ) ;
152152 return topLevel ;
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import {
1010 INSTALL_COMMAND ,
1111 LOCK_FILE_NAME ,
1212} from '../../errors/out-of-sync-error' ;
13+ import * as debugModule from 'debug' ;
1314
15+ const debug = debugModule ( 'snyk-pnpm-workspaces' ) ;
1416export const getPnpmChildNode = (
1517 name : string ,
1618 depInfo : { version : string ; isDev : boolean } ,
@@ -42,6 +44,7 @@ export const getPnpmChildNode = (
4244 LOCK_FILE_NAME [ LockfileType . pnpm ]
4345 } are probably out of sync. Please run ` +
4446 `"${ INSTALL_COMMAND [ LockfileType . pnpm ] } " and try again.` ;
47+ debug ( errMessage ) ;
4548 throw new OpenSourceEcosystems . PnpmOutOfSyncError ( errMessage ) ;
4649 } else {
4750 return {
You can’t perform that action at this time.
0 commit comments