From 1f4bd8d1c7e57d0c78ef4a83a5ff2a36117dae5c Mon Sep 17 00:00:00 2001 From: ghe Date: Tue, 28 Sep 2021 08:42:24 +0100 Subject: [PATCH] fix: use the smaller @snyk/protect instead of snyk for patches --- .gitignore | 1 + package.json | 10 +++++++--- src/cmds/snyk:test.ts | 2 +- src/lib/get-input-data.ts | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 02392b5..838f287 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ dist package-lock.json yarn.lock .eslintcache +.dccache diff --git a/package.json b/package.json index 82a8f43..e536a86 100644 --- a/package.json +++ b/package.json @@ -37,26 +37,30 @@ ], "homepage": "https://github.com/snyk-tech-services/snyk2spdx#readme", "dependencies": { - "debug": "^4.1.1", + "@snyk/protect": "1.724.0", + "debug": "4.3.2", "lodash": "^4.17.15", - "snyk": "^1.606.0", "source-map-support": "^0.5.16", "tslib": "^1.10.0", "uuid": "8.3.2", "yargs": "16.2.0" }, "devDependencies": { + "@semantic-release/exec": "5.0.0", + "@types/debug": "4.1.7", "@types/jest": "26.0.23", "@types/lodash": "^4.14.149", "@types/node": "14.17.1", + "@types/uuid": "8.3.1", "@typescript-eslint/eslint-plugin": "^2.18.0", "@typescript-eslint/parser": "^2.18.0", "eslint": "7.27.0", "eslint-config-prettier": "8.3.0", + "i": "0.3.7", "jest": "^27.0.1", "node-notifier": "9.0.1", + "npm": "7.24.1", "prettier": "2.3.0", - "@semantic-release/exec": "5.0.0", "semantic-release": "17.4.3", "ts-jest": "27.0.0", "ts-node": "8.6.2", diff --git a/src/cmds/snyk:test.ts b/src/cmds/snyk:test.ts index cb0d558..cbfa56c 100644 --- a/src/cmds/snyk:test.ts +++ b/src/cmds/snyk:test.ts @@ -39,7 +39,7 @@ export async function handler(argv: { } else { console.log(spdxOutputStringified); } - } catch (e) { + } catch (e: any) { debug('Failed to generate data.\n' + e.message); console.error( `ERROR! Failed to convert to SPDX. Try running with \`DEBUG=snyk* for more info\`.\nERROR: ${e}`, diff --git a/src/lib/get-input-data.ts b/src/lib/get-input-data.ts index 35371d9..39bd7ac 100644 --- a/src/lib/get-input-data.ts +++ b/src/lib/get-input-data.ts @@ -17,7 +17,7 @@ export async function getInputData(): Promise { try { const inputData = await readInputFromStdin(); return JSON.parse(inputData); - } catch (e) { + } catch (e: any) { throw new Error(`Failed to parse input. ERROR: ${e.message}`); } }