Skip to content

Use upstream deps #1388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,10 @@
"author": "snyk.io",
"license": "Apache-2.0",
"dependencies": {
"@snyk/cli-interface": "2.9.0",
"@snyk/dep-graph": "1.19.3",
"@snyk/cli-interface": "2.9.2",
"@snyk/dep-graph": "1.19.4",
"@snyk/gemfile": "1.2.0",
"@snyk/graphlib": "2.1.9-patch",
"@snyk/inquirer": "6.2.2-patch",
"@snyk/lodash": "^4.17.15-patch",
"@snyk/ruby-semver": "2.2.0",
"@snyk/snyk-cocoapods-plugin": "2.5.0",
"@snyk/snyk-cocoapods-plugin": "2.5.1",
"abbrev": "^1.1.1",
"ansi-escapes": "3.2.0",
"chalk": "^2.4.2",
Expand All @@ -69,22 +65,25 @@
"debug": "^4.1.1",
"diff": "^4.0.1",
"glob": "^7.1.3",
"graphlib": "^2.1.8",
"inquirer": "^7.3.3",
"lodash": "^4.17.20",
"needle": "2.5.0",
"open": "^7.0.3",
"os-name": "^3.0.0",
"proxy-agent": "^3.1.1",
"proxy-from-env": "^1.0.0",
"semver": "^6.0.0",
"snyk-config": "3.1.0",
"snyk-config": "3.1.1",
"snyk-cpp-plugin": "1.4.3",
"snyk-docker-plugin": "3.20.0",
"snyk-go-plugin": "1.16.0",
"snyk-gradle-plugin": "3.6.2",
"snyk-go-plugin": "1.16.2",
"snyk-gradle-plugin": "3.6.3",
"snyk-module": "3.1.0",
"snyk-mvn-plugin": "2.19.3",
"snyk-nodejs-lockfile-parser": "1.28.0",
"snyk-nuget-plugin": "1.18.1",
"snyk-php-plugin": "1.9.0",
"snyk-mvn-plugin": "2.19.4",
"snyk-nodejs-lockfile-parser": "1.28.1",
"snyk-nuget-plugin": "1.19.3",
"snyk-php-plugin": "1.9.2",
"snyk-policy": "1.14.1",
"snyk-python-plugin": "1.17.1",
"snyk-resolve": "1.0.1",
Expand All @@ -102,7 +101,9 @@
"devDependencies": {
"@types/agent-base": "^4.2.1",
"@types/diff": "^3.5.2",
"@types/graphlib": "^2.1.7",
"@types/jest": "^25.2.3",
"@types/lodash": "^4.14.161",
"@types/needle": "^2.0.4",
"@types/node": "8.10.59",
"@types/restify": "^8.4.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import chalk from 'chalk';
import * as url from 'url';

Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/protect/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export {
startOver,
};

import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as semver from 'semver';
import { format as fmt } from 'util';
import * as debugModule from 'debug';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/protect/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export = answersToTasks;

import * as debugModule from 'debug';
const debug = debugModule('snyk');
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';

function answersToTasks(answers) {
const tasks = {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/protect/wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import * as debugModule from 'debug';
const debug = debugModule('snyk');

import * as path from 'path';
import * as inquirer from '@snyk/inquirer';
import * as inquirer from 'inquirer';
import * as fs from 'fs';
import * as tryRequire from 'snyk-try-require';
import chalk from 'chalk';
import * as url from 'url';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { exec } from 'child_process';
import { apiTokenExists } from '../../../lib/api-token';
import * as auth from '../auth/is-authed';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import chalk from 'chalk';

export function createDockerBinaryHeading(pkgInfo): string {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { createDockerBinaryHeading } from './format-docker-binary-heading';
import { Options, TestOptions } from '../../../../../lib/types';
import { formatIssues } from '../legacy-format-issue';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/test/formatters/legacy-format-issue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import chalk from 'chalk';
import * as config from '../../../../lib/config';
import { Options, TestOptions, ShowVulnPaths } from '../../../../lib/types';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/test/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export = test;

import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import chalk from 'chalk';
import * as snyk from '../../../lib';
import * as config from '../../../lib/config';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/detect.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'fs';
import * as pathLib from 'path';
import * as debugLib from 'debug';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { NoSupportedManifestsFoundError } from './errors';
import { SupportedPackageManagers } from './package-managers';
import { validateK8sFile } from './iac/iac-parser';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/find-files.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from 'fs';
import * as pathLib from 'path';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { detectPackageManagerFromFile } from './detect';
import * as debugModule from 'debug';
const debug = debugModule('snyk:find-files');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/module-info/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as Debug from 'debug';
import { legacyPlugin as pluginApi } from '@snyk/cli-interface';

Expand Down
9 changes: 6 additions & 3 deletions src/lib/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { apiTokenExists } from '../api-token';
import request = require('../request');
import * as config from '../config';
import * as os from 'os';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { isCI } from '../is-ci';
import * as analytics from '../analytics';
import {
Expand Down Expand Up @@ -221,7 +221,10 @@ async function monitorDepTree(
depTree = dropEmptyDeps(depTree);

let callGraphPayload;
if (options.reachableVulns && scannedProject.callGraph?.innerError) {
if (
options.reachableVulns &&
(scannedProject.callGraph as CallGraphError)?.innerError
) {
const err = scannedProject.callGraph as CallGraphError;
analytics.add(
'callGraphError',
Expand All @@ -239,7 +242,7 @@ async function monitorDepTree(
]);
} else if (scannedProject.callGraph) {
const { callGraph, nodeCount, edgeCount } = serializeCallGraphWithMetrics(
scannedProject.callGraph,
scannedProject.callGraph as CallGraph,
);
debug(
`Adding call graph to payload, node count: ${nodeCount}, edge count: ${edgeCount}`,
Expand Down
5 changes: 3 additions & 2 deletions src/lib/plugins/convert-single-splugin-res-to-multi-custom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { legacyPlugin as pluginApi } from '@snyk/cli-interface';
import { MultiProjectResultCustom } from './get-multi-plugin-result';
import { SupportedPackageManagers } from '../package-managers';
import { CallGraph } from '@snyk/cli-interface/legacy/common';

export function convertSingleResultToMultiCustom(
inspectRes: pluginApi.SinglePackageResult,
Expand Down Expand Up @@ -28,7 +29,7 @@ function convertDepGraphResult(
{
plugin: plugin as any,
depGraph,
callGraph,
callGraph: callGraph as CallGraph,
meta,
targetFile: plugin.targetFile,
packageManager,
Expand Down Expand Up @@ -63,7 +64,7 @@ function convertDepTreeResult(
{
plugin: plugin as any,
depTree,
callGraph,
callGraph: callGraph as CallGraph,
meta,
targetFile: plugin.targetFile,
packageManager,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/plugins/get-multi-plugin-result.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as path from 'path';
import * as cliInterface from '@snyk/cli-interface';
import chalk from 'chalk';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/plugins/nodejs-plugin/npm-modules-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'path';
import * as fs from 'fs';
import * as resolveNodeDeps from 'snyk-resolve-deps';
import * as baseDebug from 'debug';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';

import * as spinner from '../../spinner';
import * as analytics from '../../analytics';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/plugins/nodejs-plugin/yarn-workspaces-parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as baseDebug from 'debug';
import * as pathUtil from 'path';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';

const debug = baseDebug('snyk:yarn-workspaces');
import * as lockFileParser from 'snyk-nodejs-lockfile-parser';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/plugins/rubygems/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { inspectors, Spec } from './inspectors';
import { MissingTargetFileError } from '../../errors/missing-targetfile-error';
import gemfileLockToDependencies = require('./gemfile-lock-to-dependencies');
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { MultiProjectResult } from '@snyk/cli-interface/legacy/plugin';

export async function inspect(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/policy/pluck-policies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { PackageExpanded } from 'snyk-resolve-deps';

export function pluckPolicies(pkg: PackageExpanded): string[] | string {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/protect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const protect = (module.exports = {
});

const debug = require('debug')('snyk');
const _ = require('@snyk/lodash');
const _ = require('lodash');

function generatePolicy(policy, tasks, live, packageManager) {
const promises = ['ignore', 'update', 'patch']
Expand Down
2 changes: 1 addition & 1 deletion src/lib/protect/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const glob = require('glob');
const tempfile = require('tempfile');
const fs = require('fs');
const path = require('path');
const _ = require('@snyk/lodash');
const _ = require('lodash');
const applyPatch = require('./apply-patch');
const stripVersions = require('./strip-versions');
const getVulnSource = require('./get-vuln-source');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/protect/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports.installDev = installDev;

const debug = require('debug')('snyk');
const chalk = require('chalk');
const _ = require('@snyk/lodash');
const _ = require('lodash');
const { parsePackageString: moduleToObject } = require('snyk-module');
const semver = require('semver');
const errors = require('../errors/legacy-errors');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/reachable-vulns.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as graphlib from '@snyk/graphlib';
import * as graphlib from 'graphlib';
import { CallGraph } from '@snyk/cli-interface/legacy/common';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/snyk-test/legacy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as depGraphLib from '@snyk/dep-graph';
import { SupportedPackageManagers } from '../package-managers';
import { SupportedProjectTypes } from '../types';
Expand Down
13 changes: 9 additions & 4 deletions src/lib/snyk-test/run-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as path from 'path';
import * as debugModule from 'debug';
import chalk from 'chalk';
Expand Down Expand Up @@ -57,7 +57,7 @@ import { validateOptions } from '../options-validator';
import { findAndLoadPolicy } from '../policy';
import { assembleIacLocalPayloads, parseIacTestResult } from './run-iac-test';
import { Payload, PayloadBody, DepTreeFromResolveDeps } from './types';
import { CallGraphError } from '@snyk/cli-interface/legacy/common';
import { CallGraphError, CallGraph } from '@snyk/cli-interface/legacy/common';
import * as alerts from '../alerts';
import { abridgeErrorMessage } from '../error-format';
import { getDockerToken } from '../api-token';
Expand Down Expand Up @@ -533,7 +533,10 @@ async function assembleLocalPayloads(
body.depGraph = depGraph;
}

if (options.reachableVulns && scannedProject.callGraph?.message) {
if (
options.reachableVulns &&
(scannedProject.callGraph as CallGraphError)?.message
) {
const err = scannedProject.callGraph as CallGraphError;
const analyticsError = err.innerError || err;
analytics.add('callGraphError', {
Expand All @@ -555,7 +558,9 @@ async function assembleLocalPayloads(
callGraph,
nodeCount,
edgeCount,
} = serializeCallGraphWithMetrics(scannedProject.callGraph);
} = serializeCallGraphWithMetrics(
scannedProject.callGraph as CallGraph,
);
debug(
`Adding call graph to payload, node count: ${nodeCount}, edge count: ${edgeCount}`,
);
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/cli-monitor/cli-monitor.acceptance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as subProcess from '../../../src/lib/sub-process';
import { getVersion } from '../../../src/lib/version';
import { config as userConfig } from '../../../src/lib/user-config';
import { chdirWorkspaces, getWorkspaceJSON } from '../workspace-helper';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';

// ensure this is required *after* the demo server, since this will
// configure our fake configuration too
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as sinon from 'sinon';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as path from 'path';
import * as depGraphLib from '@snyk/dep-graph';

Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/cli-test/cli-test.iac-k8s.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import {
iacTest,
iacTestJson,
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/cli-test/cli-test.iac-k8s.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import {
mapIacTestResult,
AnnotatedIacIssue,
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/cli-test/cli-test.ruby.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { AcceptanceTests } from './cli-test.acceptance.test';
import { getWorkspaceJSON } from '../workspace-helper';
import { CommandResult } from '../../../src/cli/commands/types';
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/cli-test/cli-test.sbt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as sinon from 'sinon';
import { AcceptanceTests } from './cli-test.acceptance.test';

import * as _ from '@snyk/lodash';
import * as _ from 'lodash';

export const SbtTests: AcceptanceTests = {
language: 'SBT',
Expand Down
2 changes: 1 addition & 1 deletion test/monitor-target.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, afterEach, afterAll } from 'tap';
import * as requestLib from 'needle';
import * as path from 'path';

import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as sinon from 'sinon';

import * as cli from '../src/cli/commands';
Expand Down
4 changes: 2 additions & 2 deletions test/prompts.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as fs from 'fs';
import { test } from 'tap';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import * as path from 'path';
import * as sinon from 'sinon';
import * as inquirer from '@snyk/inquirer';
import * as inquirer from 'inquirer';

import wizard = require('../src/cli/commands/protect/wizard');

Expand Down
2 changes: 1 addition & 1 deletion test/system/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as util from 'util';
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { test } from 'tap';
import * as ciChecker from '../../src/lib/is-ci';
import { makeTmpDirectory, silenceLog } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion test/system/remote-package.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from '@snyk/lodash';
import * as _ from 'lodash';
import { test } from 'tap';
import * as ciChecker from '../../src/lib/is-ci';
import * as sinon from 'sinon';
Expand Down
Loading