-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing
license-report-config.json
(#1716)
* Added info to `catalog.json` * Added license-report-config.json with test * Enable auto-suggestions * Removed `additionalItems` for the strict mode * Full schema test case * Typo fixed
- Loading branch information
Showing
4 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"title": "JSON schema for license report tool configuration file", | ||
"properties": { | ||
"output": { | ||
"default": "json", | ||
"description": "license report output format", | ||
"enum": [ | ||
"json", | ||
"table", | ||
"csv", | ||
"html" | ||
], | ||
"type": "string" | ||
}, | ||
"html": { | ||
"type": "object", | ||
"description": "HTML output format", | ||
"properties": { | ||
"cssFile": { | ||
"default": "path.resolve(__dirname, '..', 'defaultHtmlStyle.css')", | ||
"type": "string" | ||
}, | ||
"tableify": { | ||
"description": "passed directly to tableify (see: https://github.com/kessler/node-tableify)", | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"delimiter": { | ||
"default": ",", | ||
"description": "CSV output format", | ||
"type": "string" | ||
}, | ||
"escapeCsvFields": { | ||
"default": "false", | ||
"description": "CSV output format: escape fields containing delimiter character", | ||
"type": "boolean" | ||
}, | ||
"only": { | ||
"default": "null", | ||
"description": "export deps. or deps/dev-/opt-/peer- deps. falsey -> output everything", | ||
"type": "object" | ||
}, | ||
"registry": { | ||
"default": "https://registry.npmjs.org/", | ||
"description": "NPM registry URL", | ||
"type": "string" | ||
}, | ||
"exclude": { | ||
"description": "package names that will be excluded from the report", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"fields": { | ||
"description": "fields participating in the report and their order", | ||
"items": { | ||
"enum": [ | ||
"department", | ||
"relatedTo", | ||
"name", | ||
"licensePeriod", | ||
"material", | ||
"licenseType", | ||
"link", | ||
"remoteVersion", | ||
"installedVersion", | ||
"author" | ||
], | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"comment": { | ||
"description": "export deps. or deps/dev-/opt-/peer- deps. falsey -> output everything", | ||
"properties": { | ||
"label": { | ||
"type": "string", | ||
"default": "comment" | ||
}, | ||
"value": { | ||
"type": "string", | ||
"default": "" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"httpRetryOptions": { | ||
"properties": { | ||
"delay": { | ||
"type": "number", | ||
"default": 1000 | ||
}, | ||
"maxAttempts": { | ||
"type": "number", | ||
"default": 5 | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"package": { | ||
"description": "path to the package.json", | ||
"default": "./package.json", | ||
"type": "string" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/license-report-config/basic-license-report-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"fields": [ | ||
"name", | ||
"installedVersion", | ||
"author", | ||
"licenseType" | ||
], | ||
"output": "json" | ||
} |
28 changes: 28 additions & 0 deletions
28
src/test/license-report-config/full-license-report-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"comment": { | ||
"label": "comment", | ||
"value": "Test comment" | ||
}, | ||
"delimiter": ",", | ||
"fields": [ | ||
"name", | ||
"installedVersion", | ||
"author", | ||
"licenseType" | ||
], | ||
"escapeCsvFields": true, | ||
"exclude": [ | ||
"" | ||
], | ||
"html": { | ||
"cssFile": "path.resolve(__dirname, '..', 'defaultHtmlStyle.css')", | ||
"tableify": {} | ||
}, | ||
"httpRetryOptions": { | ||
"delay": 1000, | ||
"maxAttempts": 5 | ||
}, | ||
"output": "json", | ||
"package": "./package.json", | ||
"registry": "https://registry.npmjs.org/" | ||
} |