Switched to automatic license attribution generation via oss-attribution-generator
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
#59
This commit is contained in:
parent
ab7110d49f
commit
580a73f9a5
@ -42,7 +42,7 @@ steps:
|
|||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- yarn
|
||||||
- yarn licenses:full
|
- yarn licenses:export
|
||||||
- name: push new licenses file to repo
|
- name: push new licenses file to repo
|
||||||
depends_on: ["run full license export"]
|
depends_on: ["run full license export"]
|
||||||
image: appleboy/drone-git-push
|
image: appleboy/drone-git-push
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -134,3 +134,4 @@ build
|
|||||||
*.sqlite-jurnal
|
*.sqlite-jurnal
|
||||||
/docs
|
/docs
|
||||||
lib
|
lib
|
||||||
|
/oss-attribution
|
8288
LICENSES.txt
Normal file
8288
LICENSES.txt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -59,7 +59,7 @@
|
|||||||
"cp-cli": "^2.0.0",
|
"cp-cli": "^2.0.0",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"nodemon": "^2.0.6",
|
"nodemon": "^2.0.6",
|
||||||
"license-checker": "^25.0.1",
|
"oss-attribution-generator": "^1.7.1",
|
||||||
"rimraf": "^2.7.1",
|
"rimraf": "^2.7.1",
|
||||||
"start-server-and-test": "^1.11.6",
|
"start-server-and-test": "^1.11.6",
|
||||||
"ts-jest": "^26.4.4",
|
"ts-jest": "^26.4.4",
|
||||||
@ -76,8 +76,7 @@
|
|||||||
"test:ci": "start-server-and-test dev http://localhost:4010/api/docs/openapi.json test",
|
"test:ci": "start-server-and-test dev http://localhost:4010/api/docs/openapi.json test",
|
||||||
"seed": "ts-node ./node_modules/typeorm/cli.js schema:sync && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed",
|
"seed": "ts-node ./node_modules/typeorm/cli.js schema:sync && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed",
|
||||||
"openapi:export": "node scripts/openapi_export.js",
|
"openapi:export": "node scripts/openapi_export.js",
|
||||||
"licenses:export": "node scripts/license_exporter.js",
|
"licenses:export": "rimraf ./LICENSES.txt && generate-attribution && cp-cli ./oss-attribution/attribution.txt ./LICENSES.txt && rimraf ./oss-attribution"
|
||||||
"licenses:full": "node scripts/license_exporter.js --full"
|
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
var checker = require('license-checker');
|
|
||||||
var consola = require('consola');
|
|
||||||
var fs = require('fs');
|
|
||||||
|
|
||||||
var args = process.argv.slice(2);
|
|
||||||
|
|
||||||
checker.init({
|
|
||||||
start: './',
|
|
||||||
relativeLicensePath: true,
|
|
||||||
customFormat: {
|
|
||||||
licenseText: "",
|
|
||||||
licenseFile: "",
|
|
||||||
description: "",
|
|
||||||
version: "",
|
|
||||||
}
|
|
||||||
}, function (err, packages) {
|
|
||||||
if (err) {
|
|
||||||
consola.error("Couldn't load the licenses.")
|
|
||||||
} else {
|
|
||||||
let licenses = new Array();
|
|
||||||
if (args.includes("--full")) {
|
|
||||||
Object.keys(packages).forEach(function (key) {
|
|
||||||
licenses.push({
|
|
||||||
"name": packages[key].name,
|
|
||||||
"licenses": packages[key].licenses,
|
|
||||||
"repository": packages[key].repository || null,
|
|
||||||
"publisher": packages[key].publisher || null,
|
|
||||||
"email": packages[key].email || null,
|
|
||||||
"version": packages[key].version || null,
|
|
||||||
"description": packages[key].description || null,
|
|
||||||
"copyright": packages[key].copyright || null,
|
|
||||||
"text": packages[key].licenseText || null,
|
|
||||||
"license_path": packages[key].licenseFile || null,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Object.keys(packages).forEach(function (key) {
|
|
||||||
licenses.push({
|
|
||||||
"name": packages[key].name,
|
|
||||||
"licenses": packages[key].licenses,
|
|
||||||
"repository": packages[key].repository || null,
|
|
||||||
"publisher": packages[key].publisher || null,
|
|
||||||
"email": packages[key].email || null,
|
|
||||||
"version": packages[key].version || null,
|
|
||||||
"description": packages[key].description || null,
|
|
||||||
"copyright": packages[key].copyright || null,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
fs.writeFileSync("./licenses.json", JSON.stringify(licenses), { encoding: "utf-8" });
|
|
||||||
consola.success("Exported licenses to ./licenses.json");
|
|
||||||
} catch (error) {
|
|
||||||
consola.error("Couldn't export the licenses");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
Loading…
x
Reference in New Issue
Block a user