-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlicense-manager.config.js
More file actions
85 lines (82 loc) · 2.13 KB
/
license-manager.config.js
File metadata and controls
85 lines (82 loc) · 2.13 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const { isMatchName, createConfig } = require("@cybozu/license-manager");
const config = createConfig({
packageManager: "pnpm",
analyze: {
allowLicenses: [
"MIT",
"MIT-0",
"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: [
// https://github.com/npm/cli/blob/latest/LICENSE
"npm",
"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",
},
"undici-types": {
licensePageUrl:
"https://raw.githubusercontent.com/nodejs/undici/main/LICENSE",
},
"@inquirer/ansi": {
licensePageUrl:
"https://raw.githubusercontent.com/SBoudrias/Inquirer.js/main/LICENSE",
},
eastasianwidth: {
licensePageUrl:
"https://raw.githubusercontent.com/komagata/eastasianwidth/master/MIT-LICENSE.txt",
},
};
module.exports = config;