-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
Checks licenses of node dependencies against a list of allowed licenses. | ||
Fails with exit code != 0 and an error message if a disallowed license is encountered. | ||
The script should be executed from the project root directory after dependencies have been installed: | ||
$ ./node/node ./src/support/js/check-licenses.js | ||
To run checks yourself (e.g. to update the allow list or to get details), install | ||
license-checker yourself and run it from the project root directory: | ||
$ npm install -g license-checker | ||
$ license-checker --summary # outputs list of used licenses | ||
$ license-checker --json # outputs details | ||
See also https://www.npmjs.com/package/license-checker | ||
*/ | ||
|
||
const checker = require("license-checker"); | ||
const process = require("process"); | ||
|
||
// Licenses known to be OK. | ||
const ACCEPTED_LICENSES = [ | ||
"MIT", | ||
"ISC", | ||
"Apache-2.0", | ||
"Apache 2.0", | ||
"BSD-2-Clause", | ||
"BSD-3-Clause", | ||
"BSD", | ||
"CC0-1.0", | ||
"CC-BY-3.0", | ||
"CC-BY-4.0", | ||
"Python-2.0", | ||
"Unlicense" // Note: not unlicenseD (https://opensource.org/licenses/unlicense) | ||
]; | ||
|
||
// Packages with licenses that are not recognized properly by license-checker. | ||
// These must be checked manually. | ||
const SKIP_PACKAGES = [ | ||
"event-stream@3.0.20", // MIT License not recognized | ||
"taffydb@2.6.2" // BSD-1-Clause License in source code | ||
]; | ||
|
||
checker.init( | ||
{ | ||
start: process.cwd(), | ||
onlyAllow: ACCEPTED_LICENSES.join(";"), | ||
excludePackages: SKIP_PACKAGES.join(";") | ||
}, | ||
(error, packages) => { | ||
if (error) { | ||
console.error("Error: ", error); | ||
process.exit(1); | ||
} | ||
process.exit(0); | ||
} | ||
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
/* | ||
* Copyright (C) 2023 con terra GmbH (info@conterra.de) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
if (require.packs["@vue/test-utils"]) { | ||
require.packs["@vue/test-utils"].main = "dist/vue-test-utils.umd"; | ||
} | ||
if (require.packs["chai"]) { | ||
require.packs["chai"].main = "chai"; | ||
} |