Skip to content

Commit

Permalink
chore: Refactor to use snyk-cli-interface PluginMetadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
anthogez committed Feb 20, 2020
1 parent 64b5fd4 commit aabe1ef
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"author": "snyk.io",
"license": "Apache-2.0",
"dependencies": {
"@snyk/cli-interface": "2.3.0",
"@snyk/cli-interface": "2.3.2",
"@snyk/configstore": "^3.2.0-rc1",
"@snyk/dep-graph": "1.13.1",
"@snyk/gemfile": "1.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
MonitorOptions,
MonitorMeta,
MonitorResult,
PluginMetadata,
Options,
} from '../../../lib/types';
import * as config from '../../../lib/config';
Expand All @@ -31,6 +30,7 @@ import { extractPackageManager } from '../../../lib/plugins/extract-package-mana
import { MultiProjectResultCustom } from '../../../lib/plugins/get-multi-plugin-result';
import { convertMultiResultToMultiCustom } from '../../../lib/plugins/convert-multi-plugin-res-to-multi-custom';
import { convertSingleResultToMultiCustom } from '../../../lib/plugins/convert-single-splugin-res-to-multi-custom';
import { PluginMetadata } from '@snyk/cli-interface/legacy/plugin';

const SEPARATOR = '\n-------------------------------------------------------\n';
const debug = Debug('snyk');
Expand Down
3 changes: 2 additions & 1 deletion src/lib/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as os from 'os';
import * as _ from 'lodash';
import { isCI } from '../is-ci';
import * as analytics from '../analytics';
import { DepTree, MonitorMeta, MonitorResult, PluginMetadata } from '../types';
import { DepTree, MonitorMeta, MonitorResult } from '../types';
import * as projectMetadata from '../project-metadata';
import * as path from 'path';
import {
Expand All @@ -25,6 +25,7 @@ import { filterOutMissingDeps } from './filter-out-missing-deps';
import { dropEmptyDeps } from './drop-empty-deps';
import { pruneTree } from './prune-dep-tree';
import { pluckPolicies } from '../policy';
import { PluginMetadata } from '@snyk/cli-interface/legacy/plugin';

const debug = Debug('snyk');

Expand Down
3 changes: 2 additions & 1 deletion src/lib/plugins/get-multi-plugin-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import * as _ from 'lodash';
import * as path from 'path';
import * as cliInterface from '@snyk/cli-interface';

import { TestOptions, Options, MonitorOptions, PluginMetadata } from '../types';
import { TestOptions, Options, MonitorOptions } from '../types';
import { detectPackageManagerFromFile } from '../detect';
import { SupportedPackageManagers } from '../package-managers';
import { getSinglePluginResult } from './get-single-plugin-result';
import { convertSingleResultToMultiCustom } from './convert-single-splugin-res-to-multi-custom';
import { convertMultiResultToMultiCustom } from './convert-multi-plugin-res-to-multi-custom';
import { PluginMetadata } from '@snyk/cli-interface/legacy/plugin';

export interface ScannedProjectCustom
extends cliInterface.legacyCommon.ScannedProject {
Expand Down
13 changes: 0 additions & 13 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ import { legacyCommon as legacyApi } from '@snyk/cli-interface';
import { SEVERITY } from './snyk-test/legacy';
import { FailOn } from './snyk-test/common';

export interface PluginMetadata {
name: string;
packageFormatVersion?: string;
packageManager: SupportedPackageManagers;
imageLayers?: any;
targetFile?: string; // this is wrong (because Shaun said it)
runtime?: any;
dockerImageId: any;
meta?: {
allSubProjectNames: string[]; // To warn the user about subprojects not being scanned
};
}

export interface DepDict {
[name: string]: DepTree;
}
Expand Down

0 comments on commit aabe1ef

Please sign in to comment.