mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
CLI: new licences command (#5690)
* new licences command * remove old licences command
This commit is contained in:
31
lib/cli/templates/auditPage.ejs
Normal file
31
lib/cli/templates/auditPage.ejs
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
Title: Audit info, <%= projName %> <%= projVersion %>
|
||||
---
|
||||
|
||||
# Audit information for <%= projName %> <%= projVersion %>
|
||||
|
||||
This page lists the npm audit of the project in the version <%= projVersion %>
|
||||
|
||||
## Risks
|
||||
|
||||
- Critical risk dependencies <%= jsonAudit.metadata.vulnerabilities.critical %>
|
||||
- High risk dependencies <%= jsonAudit.metadata.vulnerabilities.high %>
|
||||
- Moderate risk dependencies <%= jsonAudit.metadata.vulnerabilities.moderate %>
|
||||
- Low risk dependencies <%= jsonAudit.metadata.vulnerabilities.low %>
|
||||
|
||||
Dependencies analyzed <%= jsonAudit.metadata.totalDependencies %>
|
||||
|
||||
## Libraries
|
||||
|
||||
|
||||
| Severity | Vulnerable versions | Module |
|
||||
| --- | --- | --- |
|
||||
<%
|
||||
for(var currentAdvisories in jsonAudit.advisories) {
|
||||
|
||||
severity = jsonAudit.advisories[currentAdvisories].severity;
|
||||
vulnerable_versions = JSON.stringify(jsonAudit.advisories[currentAdvisories].vulnerable_versions);
|
||||
module = jsonAudit.advisories[currentAdvisories].module_name;
|
||||
-%>
|
||||
|<%= severity %> | <%= vulnerable_versions %> | <%= module %> |
|
||||
<% } %>
|
28
lib/cli/templates/licensePage.ejs
Normal file
28
lib/cli/templates/licensePage.ejs
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
Title: License info, <%= projName %> <%= projVersion %>
|
||||
---
|
||||
|
||||
# License information for <%= projName %> <%= projVersion %>
|
||||
|
||||
This page lists all third party libraries the project depends on.
|
||||
|
||||
## Libraries
|
||||
|
||||
| Name | Version | License |
|
||||
| --- | --- | --- |
|
||||
<% for (var packageName in packages) {
|
||||
var lastAtSignPos = packageName.lastIndexOf('@');
|
||||
|
||||
var name = packageName.substring(0, lastAtSignPos);
|
||||
var version = packageName.substring(lastAtSignPos + 1);
|
||||
var pack = packages[packageName];
|
||||
var licenses = pack['licenseExp'] || 'N/A';
|
||||
var repo = pack['repository'];
|
||||
var linkedName = name;
|
||||
|
||||
if (repo) {
|
||||
linkedName = `[${name}](${repo})`
|
||||
}
|
||||
-%>
|
||||
| <%= linkedName %> | <%= version %> | <%= licenses %> |
|
||||
<% } %>
|
Reference in New Issue
Block a user