Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing license-report-config.json #1716

Merged
merged 6 commits into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,14 @@
],
"url": "https://json.schemastore.org/libman.json"
},
{
"name": "license-report-config.json",
"description": "JSON schema for license report tool configuration file",
"fileMatch": [
"license-report-config.json"
],
"url": "https://json.schemastore.org/license-report-config.json"
},
{
"name": "local.settings.json",
"description": "JSON schema for Azure Functions local.settings.json files",
Expand Down
110 changes: 110 additions & 0 deletions src/schemas/json/license-report-config.json
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"
}
}
}
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 src/test/license-report-config/full-license-report-config.json
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/"
}