adding dist

This commit is contained in:
Federico Builes
2022-09-26 12:03:34 +02:00
parent 60be833ffd
commit 2a646668d9
2 changed files with 14 additions and 7 deletions
Generated Vendored
+13 -6
View File
@@ -286,13 +286,20 @@ function renderSeverity(severity) {
}[severity]; }[severity];
return `${ansi_styles_1.default.color[color].open}(${severity} severity)${ansi_styles_1.default.color[color].close}`; return `${ansi_styles_1.default.color[color].open}(${severity} severity)${ansi_styles_1.default.color[color].close}`;
} }
function renderChangeType(change_type) { function renderScannedDependency(change) {
const changeType = change.change_type;
if (changeType !== 'added' && changeType !== 'removed') {
throw new Error(`Unexpected change type: ${changeType}`);
}
const color = { const color = {
added: 'green', added: 'green',
modified: 'yellow',
removed: 'red' removed: 'red'
}[change_type]; }[changeType];
return `${ansi_styles_1.default.color[color].open}${change_type}${ansi_styles_1.default.color[color].close}`; const icon = {
added: '+',
removed: '-'
}[changeType];
return `${ansi_styles_1.default.color[color].open}${icon} ${change.manifest}@${change.version}${ansi_styles_1.default.color[color].close}`;
} }
function printLicensesError(changes) { function printLicensesError(changes) {
if (changes.length === 0) { if (changes.length === 0) {
@@ -323,9 +330,9 @@ function printScannedDependencies(changes) {
dependencies[change.manifest].push(change); dependencies[change.manifest].push(change);
} }
for (const [manifestName, manifestChanges] of Object.entries(dependencies)) { for (const [manifestName, manifestChanges] of Object.entries(dependencies)) {
core.info(`${ansi_styles_1.default.bold.open}${manifestName}`); core.info(`File: ${ansi_styles_1.default.bold.open}${manifestName}${ansi_styles_1.default.bold.close}`);
for (const change of manifestChanges) { for (const change of manifestChanges) {
core.info(`${renderChangeType(change.change_type)}\t ${change.name}@${change.version}`); core.info(`${renderScannedDependency(change)}`);
} }
} }
})); }));
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long