Skip to content

Commit a075057

Browse files
authored
chore: rename SUPPORTED to EOL_UPCOMING (#263)
1 parent 0af875a commit a075057

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ Scan a given sbom for EOL data
145145

146146
```
147147
USAGE
148-
$ hd scan eol [--json] [-f <value>] [-p <value>] [-d <value>] [-s] [-a] [-t]
148+
$ hd scan eol [--json] [-f <value>] [-p <value>] [-d <value>] [-s]
149149
150150
FLAGS
151-
-a, --all Show all components (default is EOL and SUPPORTED only)
152151
-d, --dir=<value> The directory to scan in order to create a cyclonedx sbom
153152
-f, --file=<value> The file path of an existing cyclonedx sbom to scan for EOL
154153
-p, --purls=<value> The file path of a list of purls to scan for EOL
@@ -166,8 +165,6 @@ EXAMPLES
166165
$ hd scan eol --file=path/to/sbom.json
167166
168167
$ hd scan eol --purls=path/to/purls.json
169-
170-
$ hd scan eol -a --dir=./my-project
171168
```
172169

173170
_See code: [src/commands/scan/eol.ts](https://github.com/herodevs/cli/blob/v2.0.0-beta.3/src/commands/scan/eol.ts)_

src/api/types/nes.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ export interface ScanWarning {
6161
}
6262

6363
export type ComponentStatus = (typeof VALID_STATUSES)[number];
64-
export const VALID_STATUSES = ['UNKNOWN', 'OK', 'EOL', 'SUPPORTED'] as const;
64+
export const VALID_STATUSES = ['UNKNOWN', 'OK', 'EOL', 'EOL_UPCOMING'] as const;

src/commands/scan/eol.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ export default class ScanEol extends Command {
9292
this.log(ux.colorize('bold', '-'.repeat(40)));
9393
const id = scanId.split(SCAN_ID_KEY)[1];
9494
const reportCardUrl = config.eolReportUrl;
95-
const url = ux.colorize('blue', terminalLink(new URL(reportCardUrl).hostname, `${reportCardUrl}/${id}`));
95+
const url = ux.colorize(
96+
'blue',
97+
terminalLink(new URL(reportCardUrl).hostname, `${reportCardUrl}/${id}`, { fallback: (url) => url }),
98+
);
9699
this.log(`🌐 View your full EOL report at: ${url}\n`);
97100
}
98101

@@ -136,9 +139,9 @@ export default class ScanEol extends Command {
136139
}
137140

138141
private displayResults(components: InsightsEolScanComponent[]) {
139-
const { UNKNOWN, OK, SUPPORTED, EOL, NES_AVAILABLE } = countComponentsByStatus(components);
142+
const { UNKNOWN, OK, EOL_UPCOMING, EOL, NES_AVAILABLE } = countComponentsByStatus(components);
140143

141-
if (!UNKNOWN && !OK && !SUPPORTED && !EOL) {
144+
if (!UNKNOWN && !OK && !EOL_UPCOMING && !EOL) {
142145
this.log(ux.colorize('yellow', 'No components found in scan.'));
143146
return;
144147
}
@@ -149,8 +152,8 @@ export default class ScanEol extends Command {
149152
this.log(ux.colorize(STATUS_COLORS.EOL, `${INDICATORS.EOL} ${EOL.toLocaleString().padEnd(5)} End-of-Life (EOL)`));
150153
this.log(
151154
ux.colorize(
152-
STATUS_COLORS.SUPPORTED,
153-
`${INDICATORS.SUPPORTED}${SUPPORTED.toLocaleString().padEnd(5)} Scheduled EOL`,
155+
STATUS_COLORS.EOL_UPCOMING,
156+
`${INDICATORS.EOL_UPCOMING}${EOL_UPCOMING.toLocaleString().padEnd(5)} EOL Upcoming`,
154157
),
155158
);
156159
this.log(ux.colorize(STATUS_COLORS.OK, `${INDICATORS.OK} ${OK.toLocaleString().padEnd(5)} OK`));
@@ -172,7 +175,7 @@ export function countComponentsByStatus(
172175
const grouped: Record<ComponentStatus | 'NES_AVAILABLE', number> = {
173176
UNKNOWN: 0,
174177
OK: 0,
175-
SUPPORTED: 0,
178+
EOL_UPCOMING: 0,
176179
EOL: 0,
177180
NES_AVAILABLE: 0,
178181
};

src/ui/shared.ui.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export const STATUS_COLORS: Record<ComponentStatus, string> = {
55
EOL: 'red',
66
UNKNOWN: 'default',
77
OK: 'green',
8-
SUPPORTED: 'yellow',
8+
EOL_UPCOMING: 'yellow',
99
};
1010

1111
export const INDICATORS: Record<ComponentStatus, string> = {
1212
EOL: ux.colorize(STATUS_COLORS.EOL, '✗'),
1313
UNKNOWN: ux.colorize(STATUS_COLORS.UNKNOWN, '•'),
1414
OK: ux.colorize(STATUS_COLORS.OK, '✔'),
15-
SUPPORTED: ux.colorize(STATUS_COLORS.SUPPORTED, '⚡'),
15+
EOL_UPCOMING: ux.colorize(STATUS_COLORS.EOL_UPCOMING, '⚡'),
1616
};
1717

1818
export const SCAN_ID_KEY = 'eol-scan-v1-';

0 commit comments

Comments
 (0)