diff --git a/src/lib/plugins/nodejs-plugin/index.ts b/src/lib/plugins/nodejs-plugin/index.ts index c850e4fdc1..d48b64a634 100644 --- a/src/lib/plugins/nodejs-plugin/index.ts +++ b/src/lib/plugins/nodejs-plugin/index.ts @@ -2,12 +2,13 @@ import * as modulesParser from './npm-modules-parser'; import * as lockParser from './npm-lock-parser'; import * as types from '../types'; import { MissingTargetFileError } from '../../errors/missing-targetfile-error'; +import { MultiProjectResult } from '@snyk/cli-interface/legacy/plugin'; export async function inspect( root: string, targetFile: string, options: types.Options = {}, -): Promise { +): Promise { if (!targetFile) { throw MissingTargetFileError(root); } @@ -16,13 +17,15 @@ export async function inspect( targetFile.endsWith('yarn.lock'); const getLockFileDeps = isLockFileBased && !options.traverseNodeModules; + const depTree: any = getLockFileDeps + ? await lockParser.parse(root, targetFile, options) + : await modulesParser.parse(root, targetFile, options); + return { plugin: { name: 'snyk-nodejs-lockfile-parser', runtime: process.version, }, - package: getLockFileDeps - ? await lockParser.parse(root, targetFile, options) - : await modulesParser.parse(root, targetFile, options), + scannedProjects: [{ depTree }], }; } diff --git a/src/lib/plugins/rubygems/index.ts b/src/lib/plugins/rubygems/index.ts index fe0d2e3401..7dbbda7530 100644 --- a/src/lib/plugins/rubygems/index.ts +++ b/src/lib/plugins/rubygems/index.ts @@ -24,6 +24,7 @@ export async function inspect( name: 'bundled:rubygems', runtime: 'unknown', }, + // TODO: must be a depTree! package: { name: specs.packageName, targetFile: specs.targetFile,