-
Notifications
You must be signed in to change notification settings - Fork 7
/
license-manager.config.js
66 lines (63 loc) · 1.66 KB
/
license-manager.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const { isMatchName, createConfig } = require("@cybozu/license-manager");
const config = createConfig({
packageManager: "pnpm",
analyze: {
allowLicenses: [
"MIT",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"0BSD",
"Python-2.0",
"MPL-2.0",
"CC0-1.0",
"CC-BY-3.0",
"CC-BY-4.0",
"(MIT OR CC0-1.0)",
"(MIT OR WTFPL)",
"(WTFPL OR MIT)",
"BlueOak-1.0.0",
"(BSD-2-Clause OR MIT OR Apache-2.0)",
"Unlicense",
],
allowPackages: ["map-stream", "pause-stream", "node-forge"],
},
extract: {
output: "./NOTICE",
},
overrideLicense: (dep) => {
// https://github.com/felixge/node-require-like/blob/master/License
if (dep.name === "require-like") {
return "MIT";
}
return undefined;
},
overrideLicenseText: (dep) => {
for (const packageName of Object.keys(OVERRIDE_LICENSES_TEXT)) {
if (isMatchName(dep, packageName)) {
return OVERRIDE_LICENSES_TEXT[packageName];
}
}
return undefined;
},
});
const OVERRIDE_LICENSES_TEXT = {
"https-proxy-agent": {
licensePageUrl:
"https://raw.githubusercontent.com/TooTallNate/proxy-agents/main/packages/https-proxy-agent/LICENSE",
},
"agent-base": {
licensePageUrl:
"https://raw.githubusercontent.com/TooTallNate/proxy-agents/main/packages/agent-base/LICENSE",
},
through: {
licensePageUrl:
"https://raw.githubusercontent.com/dominictarr/through/master/LICENSE.MIT",
},
"node-rsa": {
// License text is written in README.md
licenseText: "See https://github.com/rzcoder/node-rsa#license",
},
};
module.exports = config;