Skip to content

Commit bce7e73

Browse files
authored
Update outdated dependencies (#211)
* fix: adding test fixture * feat: adding support for display of suppressed (ignored) vulnerabilities with Snyk Code Co-Authored-By: Ian Zink <[email protected]> # Conflicts: # test/fixtures/test-code-consistent-ignores.json * fix: removing things that does not seem to be needed * fix: upgrading 'safe' packages * fix: upgraded marked, removed the ids which marked has dropped * fix: upgraded commander * fix: upgraded chalk
1 parent cbd8ed9 commit bce7e73

File tree

7 files changed

+246
-244
lines changed

7 files changed

+246
-244
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'",
99
"format:check": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'",
1010
"test": "jest --coverage --runInBand --detectOpenHandles",
11+
"test:update": "jest --coverage --runInBand --detectOpenHandles --updateSnapshot",
1112
"test:vrt": "playwright test",
1213
"test:vrt:update": "playwright test --update-snapshots",
1314
"lint": "eslint --color --cache 'src/**/*.?s' 'test/**/*.?s' && npm run format:check",
@@ -24,15 +25,13 @@
2425
"author": "Snyk Ltd",
2526
"license": "Apache-2.0",
2627
"dependencies": {
27-
"chalk": "^2.4.2",
28-
"commander": "^4.1.1",
29-
"debug": "^4.1.1",
30-
"handlebars": "^4.7.7",
28+
"chalk": "4.1.2",
29+
"commander": "^14.0.0",
30+
"debug": "^4.4.1",
31+
"handlebars": "^4.7.8",
3132
"lodash.isempty": "^4.4.0",
3233
"lodash.orderby": "^4.6.0",
33-
"marked": "^4.0.12",
34-
"source-map-support": "^0.5.16",
35-
"uglify-js": "^3.15.1"
34+
"marked": "^15.0.12"
3635
},
3736
"bin": {
3837
"snyk-to-html": "dist/index.js"
@@ -43,20 +42,21 @@
4342
"devDependencies": {
4443
"@eslint/eslintrc": "^3.3.1",
4544
"@eslint/js": "^9.29.0",
46-
"@playwright/test": "^1.53.0",
45+
"@playwright/test": "^1.53.1",
46+
"@types/commander": "^2.12.5",
4747
"@types/node": "^24.0.3",
4848
"@typescript-eslint/eslint-plugin": "8.34.1",
4949
"@typescript-eslint/parser": "8.34.1",
5050
"eslint": "9.29.0",
5151
"eslint-config-prettier": "10.1.5",
5252
"eslint-plugin-prettier": "^5.5.0",
5353
"globals": "^16.2.0",
54-
"jest": "^29.7.0",
54+
"jest": "^30.0.0",
5555
"prettier": "3.5.3",
56-
"ts-jest": "^29.3.1",
56+
"ts-jest": "^29.4.0",
5757
"ts-node": "^10.9.2",
58-
"tslint": "^5.20.0",
59-
"typescript": "^5.8.2"
58+
"tslint": "^6.1.3",
59+
"typescript": "^5.8.3"
6060
},
6161
"repository": {
6262
"type": "git",

src/index.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env node
22

3-
import * as program from 'commander';
3+
import { Command } from 'commander';
44
import * as debugModule from 'debug';
55
import * as fs from 'node:fs';
66
import * as path from 'node:path';
77
import { SnykToHtml } from './lib/snyk-to-html';
88

9+
const program = new Command();
10+
911
program
1012
.option(
1113
'-t, --template <path>',
@@ -27,46 +29,46 @@ program
2729
.option(
2830
'-a, --actionable-remediation',
2931
'Display actionable remediation info if available',
30-
)
31-
.parse(process.argv);
32+
);
33+
34+
program.parse(process.argv);
35+
36+
const options = program.opts();
3237

3338
let template;
3439
let source;
3540
let output;
3641

37-
if (program.template) {
38-
// template
39-
template = program.template; // grab the next item
42+
if (options.template) {
43+
template = options.template;
4044
if (typeof template === 'boolean') {
41-
if (program.actionableRemediation) {
45+
if (options.actionableRemediation) {
4246
template = path.join(__dirname, '../template/remediation-report.hbs');
4347
} else {
4448
template = path.join(__dirname, '../template/test-report.hbs');
4549
}
4650
}
4751
} else {
48-
if (program.actionableRemediation) {
52+
if (options.actionableRemediation) {
4953
template = path.join(__dirname, '../template/remediation-report.hbs');
5054
} else {
5155
template = path.join(__dirname, '../template/test-report.hbs');
5256
}
5357
}
54-
if (program.input) {
55-
// input source
56-
source = program.input; // grab the next item
58+
if (options.input) {
59+
source = options.input;
5760
if (typeof source === 'boolean') {
5861
source = undefined;
5962
}
6063
}
61-
if (program.output) {
62-
// output destination
63-
output = program.output; // grab the next item
64+
if (options.output) {
65+
output = options.output;
6466
if (typeof output === 'boolean') {
6567
output = undefined;
6668
}
6769
}
6870

69-
if (program.debug) {
71+
if (options.debug) {
7072
const nameSpace = 'snyk-to-html';
7173
process.env.DEBUG = nameSpace;
7274

@@ -75,9 +77,9 @@ if (program.debug) {
7577

7678
SnykToHtml.run(
7779
source,
78-
!!program.actionableRemediation,
80+
!!options.actionableRemediation,
7981
template,
80-
!!program.summary,
82+
!!options.summary,
8183
onReportOutput,
8284
);
8385

src/lib/snyk-to-html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as isEmpty from 'lodash.isempty';
44
import * as orderBy from 'lodash.orderby';
5-
import chalk from 'chalk';
5+
import * as chalk from 'chalk';
66
import * as debugModule from 'debug';
77
import * as fs from 'node:fs';
88
import * as Handlebars from 'handlebars';

0 commit comments

Comments
 (0)