@kingironman2011/license-checker 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +90 -0
  2. package/dist/cli/options.d.ts +60 -4
  3. package/dist/cli/options.js +234 -44
  4. package/dist/cli/preflight.d.ts +8 -0
  5. package/dist/cli/preflight.js +32 -0
  6. package/dist/cli/usage.d.ts +1 -0
  7. package/dist/cli/usage.js +39 -0
  8. package/dist/cli.js +17 -33
  9. package/dist/dependencies/direct-dependencies.d.ts +10 -0
  10. package/dist/dependencies/direct-dependencies.js +28 -0
  11. package/dist/dependencies/read-installed-packages.d.ts +9 -2
  12. package/dist/dependencies/read-installed-packages.js +174 -52
  13. package/dist/dependencies/walk-dependency-tree.d.ts +19 -0
  14. package/dist/dependencies/walk-dependency-tree.js +38 -0
  15. package/dist/files/read-json.d.ts +1 -0
  16. package/dist/files/read-json.js +8 -0
  17. package/dist/index.d.ts +88 -3
  18. package/dist/index.js +272 -24
  19. package/dist/licenses/clarifications.d.ts +3 -0
  20. package/dist/licenses/clarifications.js +33 -0
  21. package/dist/licenses/collect-license-results.d.ts +26 -2
  22. package/dist/licenses/collect-license-results.js +321 -12
  23. package/dist/licenses/copyright.d.ts +1 -0
  24. package/dist/licenses/copyright.js +13 -0
  25. package/dist/licenses/detect-license-title.d.ts +1 -0
  26. package/dist/licenses/detect-license-title.js +145 -0
  27. package/dist/licenses/find-license-files.d.ts +1 -0
  28. package/dist/licenses/find-license-files.js +26 -0
  29. package/dist/licenses/package-metadata.d.ts +20 -0
  30. package/dist/licenses/package-metadata.js +41 -0
  31. package/dist/licenses/spdx-data.d.ts +4 -0
  32. package/dist/licenses/spdx-data.js +922 -0
  33. package/dist/licenses/spdx.d.ts +17 -0
  34. package/dist/licenses/spdx.js +394 -0
  35. package/dist/output/ansi.d.ts +4 -0
  36. package/dist/output/ansi.js +94 -0
  37. package/dist/output/csv.d.ts +4 -0
  38. package/dist/output/csv.js +50 -0
  39. package/dist/output/filter-attributes.d.ts +2 -0
  40. package/dist/output/filter-attributes.js +10 -0
  41. package/dist/output/format-output.d.ts +4 -0
  42. package/dist/output/format-output.js +81 -0
  43. package/dist/output/renderers.d.ts +15 -0
  44. package/dist/output/renderers.js +112 -0
  45. package/dist/output/write-output.d.ts +3 -2
  46. package/dist/output/write-output.js +18 -10
  47. package/dist/policies/license-policy.d.ts +20 -0
  48. package/dist/policies/license-policy.js +112 -0
  49. package/dist/policies/package-filters.d.ts +6 -0
  50. package/dist/policies/package-filters.js +56 -0
  51. package/dist/shared/debug.d.ts +1 -0
  52. package/dist/shared/debug.js +25 -0
  53. package/dist/shared/first-defined.d.ts +1 -0
  54. package/dist/shared/first-defined.js +7 -0
  55. package/dist/shared/semver.d.ts +1 -0
  56. package/dist/shared/semver.js +269 -0
  57. package/dist/types.d.ts +132 -20
  58. package/package.json +1 -1
@@ -1,12 +1,321 @@
1
- import { readdir } from "node:fs/promises";
2
- export async function collectLicenseResults(packages) {
3
- for (const item of packages) {
4
- const entries = await readdir(item.packagePath, { withFileTypes: true });
5
- item.licenseFiles = entries
6
- .filter((entry) => entry.isFile() &&
7
- /^(license|licence|copying|notice)(\.|$)/i.test(entry.name))
8
- .map((entry) => entry.name)
9
- .toSorted((a, b) => a.localeCompare(b));
10
- }
11
- return packages.toSorted((a, b) => a.name.localeCompare(b.name) || a.version.localeCompare(b.version));
12
- }
1
+ import { createHash } from "node:crypto";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { walkDependencyTree } from "../dependencies/walk-dependency-tree.js";
5
+ import { firstDefined } from "../shared/first-defined.js";
6
+ import { semverSatisfies } from "../shared/semver.js";
7
+ import { getCopyrightLines } from "./copyright.js";
8
+ import { detectLicenseTitle } from "./detect-license-title.js";
9
+ import { findLicenseFiles } from "./find-license-files.js";
10
+ import { getAuthorDetails, getRepositoryUrl, storeReadmeInPackageJsonIfExists, } from "./package-metadata.js";
11
+ const LICENSE_TITLE_UNKNOWN = "UNKNOWN";
12
+ const INITIAL_MODULE_INFO = { licenses: LICENSE_TITLE_UNKNOWN };
13
+ const getPackageNameAndVersion = (packageJson) => `${packageJson.name}@${packageJson.version}`;
14
+ const findClarification = (clarifications, packageJson) => {
15
+ const packageName = packageJson.name;
16
+ const version = packageJson.version;
17
+ if (!packageName || !version)
18
+ return undefined;
19
+ return clarifications[packageName]?.find((clarification) => version === clarification.semverRange ||
20
+ semverSatisfies(version, clarification.semverRange));
21
+ };
22
+ const shouldSkipPackage = ({ packageJson, data, options, }) => Boolean(data[getPackageNameAndVersion(packageJson)] ||
23
+ (options.production && packageJson.extraneous) ||
24
+ (options.development && !packageJson.extraneous && !packageJson.root));
25
+ const collectPackageLicenseInfo = ({ packageJson: currentExtendedPackageJson, data, options, }) => {
26
+ const moduleInfo = { ...INITIAL_MODULE_INFO };
27
+ const currentPackageNameAndVersion = getPackageNameAndVersion(currentExtendedPackageJson);
28
+ let licenseFilesInCurrentModuleDirectory = [];
29
+ let licenseData;
30
+ let licenseFile;
31
+ let noticeFiles = [];
32
+ const clarification = findClarification(options.clarifications, currentExtendedPackageJson);
33
+ let passedClarificationCheck = !clarification?.checksum;
34
+ if (clarification) {
35
+ clarification.used = true;
36
+ }
37
+ if (shouldSkipPackage({
38
+ packageJson: currentExtendedPackageJson,
39
+ data,
40
+ options,
41
+ })) {
42
+ return false;
43
+ }
44
+ if (currentExtendedPackageJson.private) {
45
+ moduleInfo.private = true;
46
+ }
47
+ data[currentPackageNameAndVersion] = moduleInfo;
48
+ // Include property in output unless custom format has set property explicitly to false:
49
+ const mustInclude = (propertyName = "") => options?.customFormat?.[propertyName] !== false;
50
+ if (mustInclude("repository")) {
51
+ const repositoryUrl = getRepositoryUrl({
52
+ clarificationRepository: clarification?.repository,
53
+ jsonRepository: currentExtendedPackageJson?.repository,
54
+ });
55
+ if (repositoryUrl) {
56
+ moduleInfo.repository = repositoryUrl;
57
+ }
58
+ }
59
+ if (mustInclude("url")) {
60
+ // TODO: Figure out where the check for currentExtendedPackageJson.url.web comes from. It's in the original license-checker,
61
+ // but I can't find any documentation on it.
62
+ const url = firstDefined(clarification?.url, typeof currentExtendedPackageJson?.url === "object"
63
+ ? currentExtendedPackageJson.url.web
64
+ : undefined);
65
+ if (url) {
66
+ moduleInfo.url = url;
67
+ }
68
+ }
69
+ if (typeof currentExtendedPackageJson.author === "object") {
70
+ const { publisher, email, url } = getAuthorDetails({
71
+ clarification,
72
+ author: currentExtendedPackageJson?.author,
73
+ });
74
+ if (mustInclude("publisher") && publisher) {
75
+ moduleInfo.publisher = publisher;
76
+ }
77
+ if (mustInclude("email") && email) {
78
+ moduleInfo.email = email;
79
+ }
80
+ // moduleInfo.url can for some reason already be set to currentExtendedPackageJson.url.web further up in the code,
81
+ // so we only set it if it's not already set.
82
+ if (typeof moduleInfo.url !== "undefined" && mustInclude("url") && url) {
83
+ moduleInfo.url = url;
84
+ }
85
+ }
86
+ if (options.unknown) {
87
+ moduleInfo.dependencyPath = currentExtendedPackageJson.path;
88
+ }
89
+ const modulePath = firstDefined(clarification?.path, currentExtendedPackageJson?.path);
90
+ if (mustInclude("path") && typeof modulePath === "string") {
91
+ moduleInfo.path = modulePath;
92
+ }
93
+ // Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme:
94
+ storeReadmeInPackageJsonIfExists(modulePath, currentExtendedPackageJson);
95
+ // Try to get the license information from the clarification file or from the package.json file:
96
+ licenseData =
97
+ clarification?.licenses ??
98
+ currentExtendedPackageJson.license ??
99
+ currentExtendedPackageJson.licenses;
100
+ if (licenseData) {
101
+ // License information has been collected from either the clarification file or from the package.json file
102
+ if (Array.isArray(licenseData) && licenseData.length > 0) {
103
+ // biome-ignore lint/suspicious/useIterableCallbackReturn: TODO we'll have to check if "licenseData" can contain something that might not be handled inside the map callback
104
+ moduleInfo.licenses = licenseData
105
+ .map((moduleLicense) => {
106
+ const moduleLicenseTypeOrName = typeof moduleLicense === "string"
107
+ ? moduleLicense
108
+ : firstDefined(moduleLicense.type, moduleLicense.name);
109
+ if (typeof moduleLicenseTypeOrName === "string") {
110
+ return moduleLicenseTypeOrName;
111
+ }
112
+ if (typeof moduleLicense === "string") {
113
+ return moduleLicense;
114
+ }
115
+ })
116
+ .filter((license) => typeof license === "string");
117
+ }
118
+ else if (!Array.isArray(licenseData) && typeof licenseData === "object") {
119
+ const licenseTitle = detectLicenseTitle(firstDefined(licenseData.type, licenseData.name));
120
+ if (licenseTitle)
121
+ moduleInfo.licenses = licenseTitle;
122
+ }
123
+ else if (typeof licenseData === "string") {
124
+ const licenseTitle = detectLicenseTitle(licenseData);
125
+ if (licenseTitle)
126
+ moduleInfo.licenses = licenseTitle;
127
+ }
128
+ }
129
+ else if (detectLicenseTitle(currentExtendedPackageJson.readme)) {
130
+ // Try to get the license information from the README file if neither the clarification file nor the package.json
131
+ // file contained any license information:
132
+ const licenseTitle = detectLicenseTitle(currentExtendedPackageJson.readme);
133
+ if (licenseTitle)
134
+ moduleInfo.licenses = licenseTitle;
135
+ }
136
+ if (Array.isArray(moduleInfo.licenses)) {
137
+ if (moduleInfo.licenses.length === 1) {
138
+ moduleInfo.licenses = moduleInfo.licenses[0];
139
+ }
140
+ }
141
+ if (clarification?.licenseFile) {
142
+ licenseFilesInCurrentModuleDirectory = [clarification.licenseFile];
143
+ }
144
+ else if (modulePath && fs.existsSync(modulePath)) {
145
+ const filesInModuleDirectory = fs.readdirSync(modulePath);
146
+ licenseFilesInCurrentModuleDirectory = findLicenseFiles(filesInModuleDirectory);
147
+ noticeFiles = filesInModuleDirectory.filter((filename) => {
148
+ const uppercased = filename.toUpperCase();
149
+ const name = path
150
+ .basename(uppercased)
151
+ .replace(path.extname(uppercased), "");
152
+ return name === "NOTICE";
153
+ });
154
+ }
155
+ licenseFilesInCurrentModuleDirectory.forEach(function findBetterLicenseData(filename, index) {
156
+ if (!modulePath)
157
+ return;
158
+ licenseFile = path.join(modulePath, filename);
159
+ // Checking that the file is in fact a normal file and not a directory for example.
160
+ if (fs.lstatSync(licenseFile).isFile()) {
161
+ let currentLicenceFilesContent;
162
+ if (!moduleInfo.licenses ||
163
+ (Array.isArray(moduleInfo.licenses)
164
+ ? moduleInfo.licenses.some((license) => license === LICENSE_TITLE_UNKNOWN)
165
+ : typeof moduleInfo.licenses === "string" &&
166
+ moduleInfo.licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1)
167
+ // TODO: Should we override a custom license?
168
+ // || moduleInfo.licenses.indexOf('Custom:') === 0
169
+ ) {
170
+ //Only re-check the license if we didn't get it from elsewhere
171
+ currentLicenceFilesContent = fs.readFileSync(licenseFile, {
172
+ encoding: "utf8",
173
+ });
174
+ const licenseTitle = detectLicenseTitle(currentLicenceFilesContent);
175
+ if (licenseTitle)
176
+ moduleInfo.licenses = licenseTitle;
177
+ }
178
+ if (index === 0) {
179
+ // Treat the file with the highest precedence as licenseFile
180
+ if (clarification !== undefined && !passedClarificationCheck) {
181
+ if (!currentLicenceFilesContent) {
182
+ currentLicenceFilesContent = fs.readFileSync(licenseFile, {
183
+ encoding: "utf8",
184
+ });
185
+ }
186
+ const sha256 = createHash("sha256")
187
+ .update(currentLicenceFilesContent)
188
+ .digest("hex");
189
+ if (clarification.checksum !== sha256) {
190
+ throw new Error(`Clarification checksum mismatch for ${currentPackageNameAndVersion} :(\nFile checked: ${licenseFile}`);
191
+ }
192
+ passedClarificationCheck = true;
193
+ }
194
+ if (mustInclude("licenseFile")) {
195
+ moduleInfo.licenseFile = firstDefined(clarification?.licenseFile, options.basePath
196
+ ? path.relative(options.basePath, licenseFile)
197
+ : licenseFile);
198
+ }
199
+ if (mustInclude("licenseText") && options.customFormat) {
200
+ if (clarification?.licenseText) {
201
+ moduleInfo.licenseText = clarification.licenseText;
202
+ }
203
+ else {
204
+ if (!currentLicenceFilesContent) {
205
+ currentLicenceFilesContent = fs.readFileSync(licenseFile, {
206
+ encoding: "utf8",
207
+ });
208
+ }
209
+ if (options.args && !options.args.csv) {
210
+ moduleInfo.licenseText = currentLicenceFilesContent.trim();
211
+ }
212
+ else {
213
+ moduleInfo.licenseText = currentLicenceFilesContent
214
+ .replace(/"/g, "'")
215
+ .replace(/\r?\n|\r/g, " ")
216
+ .trim();
217
+ }
218
+ }
219
+ if (clarification?.licenseStart) {
220
+ const startIndex = moduleInfo.licenseText.indexOf(clarification.licenseStart);
221
+ let endIndex;
222
+ if (clarification?.licenseEnd) {
223
+ endIndex = moduleInfo.licenseText.indexOf(clarification.licenseEnd, startIndex);
224
+ }
225
+ else {
226
+ endIndex = moduleInfo.licenseText.length;
227
+ }
228
+ moduleInfo.licenseText = moduleInfo.licenseText.substring(startIndex, endIndex);
229
+ }
230
+ }
231
+ if (mustInclude("copyright") && options.customFormat) {
232
+ if (clarification?.copyright) {
233
+ moduleInfo.copyright = clarification.copyright;
234
+ }
235
+ else {
236
+ if (!currentLicenceFilesContent) {
237
+ currentLicenceFilesContent = fs.readFileSync(licenseFile, {
238
+ encoding: "utf8",
239
+ });
240
+ }
241
+ const linesWithCopyright = getCopyrightLines(currentLicenceFilesContent);
242
+ if (linesWithCopyright.length > 0) {
243
+ moduleInfo.copyright = linesWithCopyright[0]
244
+ .replace(/\n/g, ". ")
245
+ .trim();
246
+ }
247
+ // Mark files with multiple copyright statements. This might be
248
+ // an indicator to take a closer look at the LICENSE file.
249
+ if (linesWithCopyright.length > 1) {
250
+ moduleInfo.copyright = `${moduleInfo.copyright}*`;
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ });
257
+ if (!passedClarificationCheck) {
258
+ throw new Error("All clarifications must come with a checksum");
259
+ }
260
+ // TODO: How do clarifications interact with notice files?
261
+ noticeFiles.forEach((filename) => {
262
+ const packagePath = currentExtendedPackageJson.path;
263
+ if (!packagePath)
264
+ return;
265
+ const file = path.join(packagePath, filename);
266
+ if (fs.lstatSync(file).isFile()) {
267
+ moduleInfo.noticeFile = options.basePath
268
+ ? path.relative(options.basePath, file)
269
+ : file;
270
+ }
271
+ });
272
+ if (!currentExtendedPackageJson.name || !currentExtendedPackageJson.version) {
273
+ delete data[currentPackageNameAndVersion];
274
+ }
275
+ if (options.customFormat) {
276
+ Object.keys(options.customFormat).forEach((customFormatKey) => {
277
+ if (mustInclude(customFormatKey) &&
278
+ moduleInfo[customFormatKey] === undefined) {
279
+ const value = firstDefined(clarification?.[customFormatKey], typeof currentExtendedPackageJson[customFormatKey] === "string"
280
+ ? currentExtendedPackageJson[customFormatKey]
281
+ : options.customFormat?.[customFormatKey]);
282
+ if (typeof value === "string" || typeof value === "boolean") {
283
+ moduleInfo[customFormatKey] = value;
284
+ }
285
+ }
286
+ });
287
+ }
288
+ return true;
289
+ };
290
+ /**
291
+ * @param {{
292
+ * args?: Record<string, unknown>,
293
+ * basePath?: string | null,
294
+ * clarifications?: Record<string, Array<Record<string, unknown>>>,
295
+ * customFormat?: Record<string, unknown>,
296
+ * development?: boolean,
297
+ * direct?: number | boolean | string | null,
298
+ * production?: boolean,
299
+ * rootPackage: Record<string, unknown>,
300
+ * unknown?: boolean
301
+ * }} options
302
+ * @returns {Record<string, Record<string, unknown>>}
303
+ */
304
+ export const collectLicenseResults = ({ args, basePath, clarifications = {}, customFormat, development, direct, production, rootPackage, unknown, }) => {
305
+ const data = {};
306
+ const options = {
307
+ args: args ? { csv: args.csv } : undefined,
308
+ basePath,
309
+ clarifications,
310
+ customFormat,
311
+ development,
312
+ production,
313
+ unknown,
314
+ };
315
+ walkDependencyTree(rootPackage, {
316
+ maxDepth: direct,
317
+ shouldVisit: (dependency) => !data[getPackageNameAndVersion(dependency)],
318
+ visit: (packageJson) => collectPackageLicenseInfo({ packageJson, data, options }),
319
+ });
320
+ return data;
321
+ };
@@ -0,0 +1 @@
1
+ export declare function getCopyrightLines(fileContents?: string): string[];
@@ -0,0 +1,13 @@
1
+ export function getCopyrightLines(fileContents = "") {
2
+ return fileContents
3
+ .replace(/\r\n/g, "\n")
4
+ .split("\n\n")
5
+ .filter(function selectCopyRightStatements(value) {
6
+ return (value.startsWith("opyright", 1) && // include copyright statements
7
+ !value.startsWith("opyright notice", 1) && // exclude lines from from license text
8
+ !value.startsWith("opyright and related rights", 1));
9
+ })
10
+ .filter(function removeDuplicates(value, index, list) {
11
+ return index === 0 || value !== list[0];
12
+ });
13
+ }
@@ -0,0 +1 @@
1
+ export declare const detectLicenseTitle: (str?: string) => string | null;
@@ -0,0 +1,145 @@
1
+ import { parseSpdxExpression } from "./spdx.js";
2
+ const MIT_LICENSE = /ermission is hereby granted, free of charge, to any/;
3
+ const BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/;
4
+ const BSD_SOURCE_CODE_LICENSE = /edistribution and use of this software in source and binary forms, with or withou/;
5
+ const WTFPL_LICENSE = /DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/;
6
+ const ISC_LICENSE = /The ISC License/;
7
+ const HIPPOCRATIC_LICENSE = /Hippocratic License/;
8
+ const MIT = /\bMIT\b/;
9
+ const BSD = /\bBSD\b/;
10
+ const ISC = /\bISC\b/;
11
+ const GPL = /\bGNU GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i;
12
+ const LGPL = /(?:LESSER|LIBRARY) GENERAL PUBLIC LICENSE\s*Version ([^,]*)/i;
13
+ const APACHE_VERSION = /\bApache License\s*Version ([^,\s]*)/i;
14
+ const APACHE = /\bApache License\b/;
15
+ const APACHE_VERSION_SHORT = /\bApache ([^,\s]*)/i;
16
+ const WTFPL = /\bWTFPL\b/;
17
+ const ZERO_PARITY_LICENSE = /\bParity\b/;
18
+ // https://creativecommons.org/publicdomain/zero/1.0/
19
+ const CC0_1_0 = /The\s+person\s+who\s+associated\s+a\s+work\s+with\s+this\s+deed\s+has\s+dedicated\s+the\s+work\s+to\s+the\s+public\s+domain\s+by\s+waiving\s+all\s+of\s+his\s+or\s+her\s+rights\s+to\s+the\s+work\s+worldwide\s+under\s+copyright\s+law,\s+including\s+all\s+related\s+and\s+neighboring\s+rights,\s+to\s+the\s+extent\s+allowed\s+by\s+law.\s+You\s+can\s+copy,\s+modify,\s+distribute\s+and\s+perform\s+the\s+work,\s+even\s+for\s+commercial\s+purposes,\s+all\s+without\s+asking\s+permission./i; // jshint ignore:line
20
+ const PUBLIC_DOMAIN = /[Pp]ublic[-_ ]*[Dd]omain/;
21
+ const IS_URL = /(https?:\/\/[-a-zA-Z0-9/.]*)/;
22
+ const CONTAINS_URLS_ENDING_WITH = /(.svg|.gif|.png|.jpg|.jpeg)$/i;
23
+ const CONTAINS_LICENSE_TERM = /(license|licence|lizenz)/gi;
24
+ const IS_FILE_REFERENCE = /SEE LICENSE IN (.*)/i;
25
+ const UNLICENSED = /UNLICENSED/i;
26
+ export const detectLicenseTitle = (str = "undefined") => {
27
+ if (typeof str !== "string") {
28
+ throw new Error(`Wrong type for parameter "str" ("${str}"): Must be of type string`);
29
+ }
30
+ let match;
31
+ let version;
32
+ try {
33
+ // Simply check if the string is a valid SPDX expression:
34
+ parseSpdxExpression(str);
35
+ // No need for additional parsing efforts:
36
+ return str;
37
+ }
38
+ catch {
39
+ // Fail silently and continue with additional parsing efforts:
40
+ }
41
+ if (str) {
42
+ // biome-ignore lint/style/noParameterAssign: TODO this whole function is a bit funky, and I'm too lazy to clean this up NOW :D
43
+ str = str.replace("\n", "");
44
+ }
45
+ if (!str || str === "undefined") {
46
+ return "Undefined";
47
+ }
48
+ if (ZERO_PARITY_LICENSE.test(str)) {
49
+ return "Zero Parity*";
50
+ }
51
+ if (ISC_LICENSE.test(str)) {
52
+ return "ISC*";
53
+ }
54
+ if (HIPPOCRATIC_LICENSE.test(str)) {
55
+ return "Hippocratic-2.1*";
56
+ }
57
+ if (MIT_LICENSE.test(str)) {
58
+ return "MIT*";
59
+ }
60
+ if (BSD_LICENSE.test(str)) {
61
+ return "BSD*";
62
+ }
63
+ if (BSD_SOURCE_CODE_LICENSE.test(str)) {
64
+ // https://spdx.org/licenses/BSD-Source-Code.html
65
+ return "BSD-Source-Code*";
66
+ }
67
+ if (WTFPL_LICENSE.test(str)) {
68
+ return "WTFPL*";
69
+ }
70
+ if (ISC.test(str)) {
71
+ return "ISC*";
72
+ }
73
+ if (MIT.test(str)) {
74
+ return "MIT*";
75
+ }
76
+ if (BSD.test(str)) {
77
+ return "BSD*";
78
+ }
79
+ if (WTFPL.test(str)) {
80
+ return "WTFPL*";
81
+ }
82
+ if (APACHE_VERSION.test(str)) {
83
+ match = APACHE_VERSION.exec(str);
84
+ if (!match)
85
+ return null;
86
+ version = match[1] ?? "";
87
+ if (version.length === 1) {
88
+ version = `${version}.0`;
89
+ }
90
+ return `Apache-${version}*`;
91
+ }
92
+ if (APACHE.test(str)) {
93
+ return "Apache*";
94
+ }
95
+ if (APACHE_VERSION_SHORT.test(str)) {
96
+ match = APACHE_VERSION_SHORT.exec(str);
97
+ if (!match)
98
+ return null;
99
+ version = match[1] ?? "";
100
+ if (version.length === 1) {
101
+ version = `${version}.0`;
102
+ }
103
+ return `Apache-${version}*`;
104
+ }
105
+ if (CC0_1_0.test(str)) {
106
+ return "CC0-1.0*";
107
+ }
108
+ if (GPL.test(str)) {
109
+ match = GPL.exec(str);
110
+ if (!match)
111
+ return null;
112
+ version = match[1] ?? "";
113
+ if (version.length === 1) {
114
+ version = `${version}.0`;
115
+ }
116
+ return `GPL-${version}*`;
117
+ }
118
+ if (LGPL.test(str)) {
119
+ match = LGPL.exec(str);
120
+ if (!match)
121
+ return null;
122
+ version = match[1] ?? "";
123
+ if (version.length === 1) {
124
+ version = `${version}.0`;
125
+ }
126
+ return `LGPL-${version}*`;
127
+ }
128
+ if (PUBLIC_DOMAIN.test(str)) {
129
+ return "Public Domain";
130
+ }
131
+ if (UNLICENSED.test(str)) {
132
+ return "UNLICENSED";
133
+ }
134
+ match = IS_URL.exec(str) || IS_FILE_REFERENCE.exec(str);
135
+ if (match) {
136
+ const matchedUrl = match[1];
137
+ CONTAINS_LICENSE_TERM.lastIndex = 0;
138
+ CONTAINS_URLS_ENDING_WITH.lastIndex = 0;
139
+ if (CONTAINS_LICENSE_TERM.test(str) &&
140
+ !CONTAINS_URLS_ENDING_WITH.test(matchedUrl)) {
141
+ return `Custom: ${matchedUrl}`;
142
+ }
143
+ }
144
+ return null;
145
+ };
@@ -0,0 +1 @@
1
+ export declare const findLicenseFiles: (dirFiles: string[]) => string[];
@@ -0,0 +1,26 @@
1
+ import path from "node:path";
2
+ const BASENAMES_PRECEDENCE = [
3
+ /^LICENSE$/,
4
+ /^LICENSE-\w+$/, // e.g. LICENSE-MIT
5
+ /^LICENCE$/,
6
+ /^LICENCE-\w+$/, // e.g. LICENCE-MIT
7
+ /^MIT-LICENSE$/,
8
+ /^COPYING$/,
9
+ /^README$/, // TODO: should we really include README?
10
+ ];
11
+ // Find and list license files in the precedence order
12
+ export const findLicenseFiles = (dirFiles) => {
13
+ const files = [];
14
+ BASENAMES_PRECEDENCE.forEach((basenamePattern) => {
15
+ dirFiles.some((filename) => {
16
+ const basename = getBaseFileName(filename);
17
+ if (basenamePattern.test(basename)) {
18
+ files.push(filename);
19
+ return true;
20
+ }
21
+ return false;
22
+ });
23
+ });
24
+ return files;
25
+ };
26
+ const getBaseFileName = (filename) => path.basename(filename, path.extname(filename)).toUpperCase();
@@ -0,0 +1,20 @@
1
+ import type { Clarification, DependencyPackage } from "../types.js";
2
+ export declare function getRepositoryUrl({ clarificationRepository, jsonRepository, }: {
3
+ clarificationRepository?: string;
4
+ jsonRepository?: string | {
5
+ url?: string;
6
+ };
7
+ }): string | undefined;
8
+ export declare function getAuthorDetails({ clarification, author, }: {
9
+ clarification?: Clarification;
10
+ author?: {
11
+ name?: string;
12
+ email?: string;
13
+ url?: string;
14
+ };
15
+ }): {
16
+ publisher?: string;
17
+ email?: string;
18
+ url?: string;
19
+ };
20
+ export declare const storeReadmeInPackageJsonIfExists: (modulePath: string | undefined, currentExtendedPackageJson: DependencyPackage) => void;
@@ -0,0 +1,41 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { firstDefined } from "../shared/first-defined.js";
4
+ export function getRepositoryUrl({ clarificationRepository, jsonRepository, }) {
5
+ if (clarificationRepository) {
6
+ return clarificationRepository;
7
+ }
8
+ const repositoryUrl = typeof jsonRepository === "object" ? jsonRepository?.url : undefined;
9
+ if (typeof repositoryUrl === "string") {
10
+ return repositoryUrl
11
+ .replace("git+ssh://git@", "git://")
12
+ .replace("git+https://github.com", "https://github.com")
13
+ .replace("git://github.com", "https://github.com")
14
+ .replace("git@github.com:", "https://github.com/")
15
+ .replace(/\.git$/, "");
16
+ }
17
+ }
18
+ export function getAuthorDetails({ clarification, author, }) {
19
+ const publisher = firstDefined(clarification?.publisher, author?.name);
20
+ const email = firstDefined(clarification?.email, author?.email);
21
+ const url = firstDefined(clarification?.url, author?.url);
22
+ return { publisher, email, url };
23
+ }
24
+ // Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme:
25
+ export const storeReadmeInPackageJsonIfExists = (modulePath, currentExtendedPackageJson) => {
26
+ if (typeof modulePath !== "string" ||
27
+ typeof currentExtendedPackageJson !== "object" ||
28
+ modulePath === "" ||
29
+ (typeof currentExtendedPackageJson?.readme === "string" &&
30
+ currentExtendedPackageJson?.readme
31
+ ?.toLowerCase()
32
+ ?.indexOf("no readme data found") === -1)) {
33
+ return;
34
+ }
35
+ const readmeFile = path.join(modulePath, "README.md");
36
+ if (fs.existsSync(readmeFile)) {
37
+ currentExtendedPackageJson.readme = fs
38
+ .readFileSync(readmeFile, "utf8")
39
+ .toString();
40
+ }
41
+ };
@@ -0,0 +1,4 @@
1
+ export declare const SPDX_LICENSE_IDS: readonly ["0BSD", "3D-Slicer-1.0", "AAL", "ADSL", "AFL-1.1", "AFL-1.2", "AFL-2.0", "AFL-2.1", "AFL-3.0", "AGPL-1.0-only", "AGPL-1.0-or-later", "AGPL-3.0-only", "AGPL-3.0-or-later", "ALGLIB-Documentation", "AMD-newlib", "AMDPLPA", "AML", "AML-glslang", "AMPAS", "ANTLR-PD", "ANTLR-PD-fallback", "APAFML", "APL-1.0", "APSL-1.0", "APSL-1.1", "APSL-1.2", "APSL-2.0", "ASWF-Digital-Assets-1.0", "ASWF-Digital-Assets-1.1", "Abstyles", "AdaCore-doc", "Adobe-2006", "Adobe-Display-PostScript", "Adobe-Glyph", "Adobe-Utopia", "Advanced-Cryptics-Dictionary", "Afmparse", "Aladdin", "Apache-1.0", "Apache-1.1", "Apache-2.0", "App-s2p", "Arphic-1999", "Artistic-1.0", "Artistic-1.0-Perl", "Artistic-1.0-cl8", "Artistic-2.0", "Artistic-dist", "Aspell-RU", "BOLA-1.1", "BSD-1-Clause", "BSD-2-Clause", "BSD-2-Clause-Darwin", "BSD-2-Clause-Patent", "BSD-2-Clause-Views", "BSD-2-Clause-first-lines", "BSD-2-Clause-pkgconf-disclaimer", "BSD-2-Clause-pos-unchanged", "BSD-3-Clause", "BSD-3-Clause-Attribution", "BSD-3-Clause-Clear", "BSD-3-Clause-HP", "BSD-3-Clause-LBNL", "BSD-3-Clause-Modification", "BSD-3-Clause-No-Military-License", "BSD-3-Clause-No-Nuclear-License", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause-No-Nuclear-Warranty", "BSD-3-Clause-Open-MPI", "BSD-3-Clause-OpenWebUI", "BSD-3-Clause-Sun", "BSD-3-Clause-Tso", "BSD-3-Clause-acpica", "BSD-3-Clause-flex", "BSD-4-Clause", "BSD-4-Clause-Shortened", "BSD-4-Clause-UC", "BSD-4.3RENO", "BSD-4.3TAHOE", "BSD-Advertising-Acknowledgement", "BSD-Attribution-HPND-disclaimer", "BSD-Inferno-Nettverk", "BSD-Mark-Modifications", "BSD-Protection", "BSD-Source-Code", "BSD-Source-Code-no-disclaimer", "BSD-Source-alt-GPL", "BSD-Source-beginning-file", "BSD-Systemics", "BSD-Systemics-W3Works", "BSD-ask-to-endorse", "BSL-1.0", "BUSL-1.1", "Baekmuk", "Bahyph", "Barr", "Beerware", "BitTorrent-1.0", "BitTorrent-1.1", "Bitstream-Charter", "Bitstream-Vera", "BlueOak-1.0.0", "Boehm-GC", "Boehm-GC-without-fee", "Borceux", "Brian-Gladman-2-Clause", "Brian-Gladman-3-Clause", "Brian-Gladman-3-Clause-no-conversion", "Buddy", "Bugroff", "C-UDA-1.0", "CAL-1.0", "CAL-1.0-Combined-Work-Exception", "CAPEC-tou", "CATOSL-1.1", "CC-BY-1.0", "CC-BY-2.0", "CC-BY-2.5", "CC-BY-2.5-AU", "CC-BY-3.0", "CC-BY-3.0-AT", "CC-BY-3.0-AU", "CC-BY-3.0-DE", "CC-BY-3.0-IGO", "CC-BY-3.0-NL", "CC-BY-3.0-US", "CC-BY-4.0", "CC-BY-NC-1.0", "CC-BY-NC-2.0", "CC-BY-NC-2.5", "CC-BY-NC-3.0", "CC-BY-NC-3.0-DE", "CC-BY-NC-3.0-IGO", "CC-BY-NC-4.0", "CC-BY-NC-ND-1.0", "CC-BY-NC-ND-2.0", "CC-BY-NC-ND-2.5", "CC-BY-NC-ND-3.0", "CC-BY-NC-ND-3.0-DE", "CC-BY-NC-ND-3.0-IGO", "CC-BY-NC-ND-4.0", "CC-BY-NC-SA-1.0", "CC-BY-NC-SA-2.0", "CC-BY-NC-SA-2.0-DE", "CC-BY-NC-SA-2.0-FR", "CC-BY-NC-SA-2.0-UK", "CC-BY-NC-SA-2.5", "CC-BY-NC-SA-3.0", "CC-BY-NC-SA-3.0-DE", "CC-BY-NC-SA-3.0-IGO", "CC-BY-NC-SA-4.0", "CC-BY-ND-1.0", "CC-BY-ND-2.0", "CC-BY-ND-2.5", "CC-BY-ND-3.0", "CC-BY-ND-3.0-DE", "CC-BY-ND-4.0", "CC-BY-SA-1.0", "CC-BY-SA-2.0", "CC-BY-SA-2.0-UK", "CC-BY-SA-2.1-JP", "CC-BY-SA-2.5", "CC-BY-SA-3.0", "CC-BY-SA-3.0-AT", "CC-BY-SA-3.0-DE", "CC-BY-SA-3.0-IGO", "CC-BY-SA-4.0", "CC-PDDC", "CC-PDM-1.0", "CC-SA-1.0", "CC0-1.0", "CDDL-1.0", "CDDL-1.1", "CDL-1.0", "CDLA-Permissive-1.0", "CDLA-Permissive-2.0", "CDLA-Sharing-1.0", "CECILL-1.0", "CECILL-1.1", "CECILL-2.0", "CECILL-2.1", "CECILL-B", "CECILL-C", "CERN-OHL-1.1", "CERN-OHL-1.2", "CERN-OHL-P-2.0", "CERN-OHL-S-2.0", "CERN-OHL-W-2.0", "CFITSIO", "CMU-Mach", "CMU-Mach-nodoc", "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", "COIL-1.0", "CPAL-1.0", "CPL-1.0", "CPOL-1.02", "CUA-OPL-1.0", "Caldera", "Caldera-no-preamble", "Catharon", "ClArtistic", "Clips", "Community-Spec-1.0", "Condor-1.1", "Cornell-Lossless-JPEG", "Cronyx", "Crossword", "CryptoSwift", "CrystalStacker", "Cube", "D-FSL-1.0", "DEC-3-Clause", "DL-DE-BY-2.0", "DL-DE-ZERO-2.0", "DOC", "DRL-1.0", "DRL-1.1", "DSDP", "DocBook-DTD", "DocBook-Schema", "DocBook-Stylesheet", "DocBook-XML", "Dotseqn", "ECL-1.0", "ECL-2.0", "EFL-1.0", "EFL-2.0", "EPICS", "EPL-1.0", "EPL-2.0", "ESA-PL-permissive-2.4", "ESA-PL-strong-copyleft-2.4", "ESA-PL-weak-copyleft-2.4", "EUDatagrid", "EUPL-1.0", "EUPL-1.1", "EUPL-1.2", "Elastic-2.0", "Entessa", "ErlPL-1.1", "Eurosym", "FBM", "FDK-AAC", "FDK-MPEG-H", "FSFAP", "FSFAP-no-warranty-disclaimer", "FSFUL", "FSFULLR", "FSFULLRSD", "FSFULLRWD", "FSL-1.1-ALv2", "FSL-1.1-MIT", "FTL", "Fair", "Ferguson-Twofish", "Frameworx-1.0", "FreeBSD-DOC", "FreeImage", "Furuseth", "GCR-docs", "GD", "GFDL-1.1-invariants-only", "GFDL-1.1-invariants-or-later", "GFDL-1.1-no-invariants-only", "GFDL-1.1-no-invariants-or-later", "GFDL-1.1-only", "GFDL-1.1-or-later", "GFDL-1.2-invariants-only", "GFDL-1.2-invariants-or-later", "GFDL-1.2-no-invariants-only", "GFDL-1.2-no-invariants-or-later", "GFDL-1.2-only", "GFDL-1.2-or-later", "GFDL-1.3-invariants-only", "GFDL-1.3-invariants-or-later", "GFDL-1.3-no-invariants-only", "GFDL-1.3-no-invariants-or-later", "GFDL-1.3-only", "GFDL-1.3-or-later", "GL2PS", "GLWTPL", "GPL-1.0-only", "GPL-1.0-or-later", "GPL-2.0-only", "GPL-2.0-or-later", "GPL-3.0-only", "GPL-3.0-or-later", "Game-Programming-Gems", "Giftware", "Glide", "Glulxe", "Graphics-Gems", "Gutmann", "HDF5", "HIDAPI", "HP-1986", "HP-1989", "HPND", "HPND-DEC", "HPND-Fenneberg-Livingston", "HPND-INRIA-IMAG", "HPND-Intel", "HPND-Kevlin-Henney", "HPND-MIT-disclaimer", "HPND-Markus-Kuhn", "HPND-Netrek", "HPND-Pbmplus", "HPND-SMC", "HPND-UC", "HPND-UC-export-US", "HPND-doc", "HPND-doc-sell", "HPND-export-US", "HPND-export-US-acknowledgement", "HPND-export-US-modify", "HPND-export2-US", "HPND-merchantability-variant", "HPND-sell-MIT-disclaimer-xserver", "HPND-sell-regexpr", "HPND-sell-variant", "HPND-sell-variant-MIT-disclaimer", "HPND-sell-variant-MIT-disclaimer-rev", "HPND-sell-variant-critical-systems", "HTMLTIDY", "HaskellReport", "Hippocratic-2.1", "Hippocratic-3.0-core", "IBM-pibs", "ICU", "IEC-Code-Components-EULA", "IJG", "IJG-short", "IPA", "IPL-1.0", "ISC", "ISC-Veillard", "ISO-permission", "ImageMagick", "Imlib2", "Info-ZIP", "Informatica", "Inner-Net-2.0", "InnoSetup", "Intel", "Intel-ACPI", "Interbase-1.0", "JPL-image", "JPNIC", "JSON", "Jam", "JasPer-2.0", "Kastrup", "Kazlib", "Knuth-CTAN", "LAL-1.2", "LAL-1.3", "LGPL-2.0-only", "LGPL-2.0-or-later", "LGPL-2.1-only", "LGPL-2.1-or-later", "LGPL-3.0-only", "LGPL-3.0-or-later", "LGPLLR", "LOOP", "LPD-document", "LPL-1.0", "LPL-1.02", "LPPL-1.0", "LPPL-1.1", "LPPL-1.2", "LPPL-1.3a", "LPPL-1.3c", "LZMA-SDK-9.11-to-9.20", "LZMA-SDK-9.22", "Latex2e", "Latex2e-translated-notice", "Leptonica", "LiLiQ-P-1.1", "LiLiQ-R-1.1", "LiLiQ-Rplus-1.1", "Libpng", "Linux-OpenIB", "Linux-man-pages-1-para", "Linux-man-pages-copyleft", "Linux-man-pages-copyleft-2-para", "Linux-man-pages-copyleft-var", "Lucida-Bitmap-Fonts", "MIPS", "MIT", "MIT-0", "MIT-CMU", "MIT-Click", "MIT-Festival", "MIT-Khronos-old", "MIT-Modern-Variant", "MIT-STK", "MIT-Wu", "MIT-advertising", "MIT-enna", "MIT-feh", "MIT-open-group", "MIT-testregex", "MITNFA", "MMIXware", "MMPL-1.0.1", "MPEG-SSG", "MPL-1.0", "MPL-1.1", "MPL-2.0", "MPL-2.0-no-copyleft-exception", "MS-LPL", "MS-PL", "MS-RL", "MTLL", "MVT-1.1", "Mackerras-3-Clause", "Mackerras-3-Clause-acknowledgment", "MakeIndex", "Martin-Birgmeier", "McPhee-slideshow", "Minpack", "MirOS", "Motosoto", "MulanPSL-1.0", "MulanPSL-2.0", "Multics", "Mup", "NAIST-2003", "NASA-1.3", "NBPL-1.0", "NCBI-PD", "NCGL-UK-2.0", "NCL", "NCSA", "NGPL", "NICTA-1.0", "NIST-PD", "NIST-PD-TNT", "NIST-PD-fallback", "NIST-Software", "NLOD-1.0", "NLOD-2.0", "NLPL", "NOSL", "NPL-1.0", "NPL-1.1", "NPOSL-3.0", "NRL", "NTIA-PD", "NTP", "NTP-0", "Naumen", "NetCDF", "Newsletr", "Nokia", "Noweb", "O-UDA-1.0", "OAR", "OCCT-PL", "OCLC-2.0", "ODC-By-1.0", "ODbL-1.0", "OFFIS", "OFL-1.0", "OFL-1.0-RFN", "OFL-1.0-no-RFN", "OFL-1.1", "OFL-1.1-RFN", "OFL-1.1-no-RFN", "OGC-1.0", "OGDL-Taiwan-1.0", "OGL-Canada-2.0", "OGL-UK-1.0", "OGL-UK-2.0", "OGL-UK-3.0", "OGTSL", "OLDAP-1.1", "OLDAP-1.2", "OLDAP-1.3", "OLDAP-1.4", "OLDAP-2.0", "OLDAP-2.0.1", "OLDAP-2.1", "OLDAP-2.2", "OLDAP-2.2.1", "OLDAP-2.2.2", "OLDAP-2.3", "OLDAP-2.4", "OLDAP-2.5", "OLDAP-2.6", "OLDAP-2.7", "OLDAP-2.8", "OLFL-1.3", "OML", "OPL-1.0", "OPL-UK-3.0", "OPUBL-1.0", "OSC-1.0", "OSET-PL-2.1", "OSL-1.0", "OSL-1.1", "OSL-2.0", "OSL-2.1", "OSL-3.0", "OSSP", "OpenMDW-1.0", "OpenPBS-2.3", "OpenSSL", "OpenSSL-standalone", "OpenVision", "PADL", "PDDL-1.0", "PHP-3.0", "PHP-3.01", "PPL", "PSF-2.0", "ParaType-Free-Font-1.3", "Parity-6.0.0", "Parity-7.0.0", "Pixar", "Plexus", "PolyForm-Noncommercial-1.0.0", "PolyForm-Small-Business-1.0.0", "PostgreSQL", "Python-2.0", "Python-2.0.1", "QPL-1.0", "QPL-1.0-INRIA-2004", "Qhull", "RHeCos-1.1", "RPL-1.1", "RPL-1.5", "RPSL-1.0", "RSA-MD", "RSCPL", "Rdisc", "Ruby", "Ruby-pty", "SAX-PD", "SAX-PD-2.0", "SCEA", "SGI-B-1.0", "SGI-B-1.1", "SGI-B-2.0", "SGI-OpenGL", "SGMLUG-PM", "SGP4", "SHL-0.5", "SHL-0.51", "SISSL", "SISSL-1.2", "SL", "SMAIL-GPL", "SMLNJ", "SMPPL", "SNIA", "SOFA", "SPL-1.0", "SSH-OpenSSH", "SSH-short", "SSLeay-standalone", "SSPL-1.0", "SUL-1.0", "SWL", "Saxpath", "SchemeReport", "Sendmail", "Sendmail-8.23", "Sendmail-Open-Source-1.1", "SimPL-2.0", "Sleepycat", "Soundex", "Spencer-86", "Spencer-94", "Spencer-99", "SugarCRM-1.1.3", "Sun-PPP", "Sun-PPP-2000", "SunPro", "Symlinks", "TAPR-OHL-1.0", "TCL", "TCP-wrappers", "TGPPL-1.0", "TMate", "TORQUE-1.1", "TOSL", "TPDL", "TPL-1.0", "TTWL", "TTYP0", "TU-Berlin-1.0", "TU-Berlin-2.0", "TekHVC", "TermReadKey", "ThirdEye", "TrustedQSL", "UCAR", "UCL-1.0", "UMich-Merit", "UPL-1.0", "URT-RLE", "Ubuntu-font-1.0", "UnRAR", "Unicode-3.0", "Unicode-DFS-2015", "Unicode-DFS-2016", "Unicode-TOU", "UnixCrypt", "Unlicense", "Unlicense-libtelnet", "Unlicense-libwhirlpool", "VOSTROM", "VSL-1.0", "Vim", "Vixie-Cron", "W3C", "W3C-19980720", "W3C-20150513", "WTFNMFPL", "WTFPL", "Watcom-1.0", "Widget-Workshop", "WordNet", "Wsuipa", "X11", "X11-distribute-modifications-variant", "X11-no-permit-persons", "X11-swapped", "XFree86-1.1", "XSkat", "Xdebug-1.03", "Xerox", "Xfig", "Xnet", "YPL-1.0", "YPL-1.1", "ZPL-1.1", "ZPL-2.0", "ZPL-2.1", "Zed", "Zeeff", "Zend-2.0", "Zimbra-1.3", "Zimbra-1.4", "Zlib", "any-OSI", "any-OSI-perl-modules", "atc-game", "bcrypt-Solar-Designer", "blessing", "bzip2-1.0.6", "check-cvs", "checkmk", "copyleft-next-0.3.0", "copyleft-next-0.3.1", "curl", "cve-tou", "diffmark", "dtoa", "dvipdfm", "eGenix", "etalab-2.0", "fwlw", "gSOAP-1.3b", "generic-xts", "gnuplot", "gtkbook", "hdparm", "hyphen-bulgarian", "iMatix", "jove", "libpng-1.6.35", "libpng-2.0", "libselinux-1.0", "libtiff", "libutil-David-Nugent", "lsof", "magaz", "mailprio", "man2html", "metamail", "mpi-permissive", "mpich2", "mplus", "ngrep", "pkgconf", "pnmstitch", "psfrag", "psutils", "python-ldap", "radvd", "snprintf", "softSurfer", "ssh-keyscan", "swrule", "threeparttable", "ulem", "w3m", "wwl", "xinetd", "xkeyboard-config-Zinoviev", "xlock", "xpp", "xzoom", "zlib-acknowledgement"];
2
+ export declare const SPDX_DEPRECATED_LICENSE_IDS: readonly ["AGPL-1.0", "AGPL-3.0", "BSD-2-Clause-FreeBSD", "BSD-2-Clause-NetBSD", "GFDL-1.1", "GFDL-1.2", "GFDL-1.3", "GPL-1.0", "GPL-2.0", "GPL-2.0-with-GCC-exception", "GPL-2.0-with-autoconf-exception", "GPL-2.0-with-bison-exception", "GPL-2.0-with-classpath-exception", "GPL-2.0-with-font-exception", "GPL-3.0", "GPL-3.0-with-GCC-exception", "GPL-3.0-with-autoconf-exception", "LGPL-2.0", "LGPL-2.1", "LGPL-3.0", "Net-SNMP", "Nunit", "StandardML-NJ", "bzip2-1.0.5", "eCos-2.0", "wxWindows"];
3
+ export declare const SPDX_EXCEPTION_IDS: readonly ["389-exception", "Asterisk-exception", "Autoconf-exception-2.0", "Autoconf-exception-3.0", "Autoconf-exception-generic", "Autoconf-exception-generic-3.0", "Autoconf-exception-macro", "Bison-exception-1.24", "Bison-exception-2.2", "Bootloader-exception", "Classpath-exception-2.0", "CLISP-exception-2.0", "cryptsetup-OpenSSL-exception", "DigiRule-FOSS-exception", "eCos-exception-2.0", "Fawkes-Runtime-exception", "FLTK-exception", "fmt-exception", "Font-exception-2.0", "freertos-exception-2.0", "GCC-exception-2.0", "GCC-exception-2.0-note", "GCC-exception-3.1", "Gmsh-exception", "GNAT-exception", "GNOME-examples-exception", "GNU-compiler-exception", "gnu-javamail-exception", "GPL-3.0-interface-exception", "GPL-3.0-linking-exception", "GPL-3.0-linking-source-exception", "GPL-CC-1.0", "GStreamer-exception-2005", "GStreamer-exception-2008", "i2p-gpl-java-exception", "KiCad-libraries-exception", "LGPL-3.0-linking-exception", "libpri-OpenH323-exception", "Libtool-exception", "Linux-syscall-note", "LLGPL", "LLVM-exception", "LZMA-exception", "mif-exception", "OCaml-LGPL-linking-exception", "OCCT-exception-1.0", "OpenJDK-assembly-exception-1.0", "openvpn-openssl-exception", "PS-or-PDF-font-exception-20170817", "QPL-1.0-INRIA-2004-exception", "Qt-GPL-exception-1.0", "Qt-LGPL-exception-1.1", "Qwt-exception-1.0", "SANE-exception", "SHL-2.0", "SHL-2.1", "stunnel-exception", "SWI-exception", "Swift-exception", "Texinfo-exception", "u-boot-exception-2.0", "UBDL-exception", "Universal-FOSS-exception-1.0", "vsftpd-openssl-exception", "WxWindows-exception-3.1", "x11vnc-openssl-exception"];
4
+ export declare const SPDX_VERSION_RANGES: readonly [readonly ["AFL-1.1", "AFL-1.2", "AFL-2.0", "AFL-2.1", "AFL-3.0"], readonly ["AGPL-1.0", readonly ["AGPL-3.0", "AGPL-3.0-only"]], readonly ["Apache-1.0", "Apache-1.1", "Apache-2.0"], readonly ["APSL-1.0", "APSL-1.1", "APSL-1.2", "APSL-2.0"], readonly ["Artistic-1.0", "Artistic-2.0"], readonly ["BitTorrent-1.0", "BitTorrent-1.1"], readonly ["CC-BY-1.0", "CC-BY-2.0", "CC-BY-2.5", "CC-BY-3.0", "CC-BY-4.0"], readonly ["CC-BY-NC-1.0", "CC-BY-NC-2.0", "CC-BY-NC-2.5", "CC-BY-NC-3.0", "CC-BY-NC-4.0"], readonly ["CC-BY-NC-ND-1.0", "CC-BY-NC-ND-2.0", "CC-BY-NC-ND-2.5", "CC-BY-NC-ND-3.0", "CC-BY-NC-ND-4.0"], readonly ["CC-BY-NC-SA-1.0", "CC-BY-NC-SA-2.0", "CC-BY-NC-SA-2.5", "CC-BY-NC-SA-3.0", "CC-BY-NC-SA-4.0"], readonly ["CC-BY-ND-1.0", "CC-BY-ND-2.0", "CC-BY-ND-2.5", "CC-BY-ND-3.0", "CC-BY-ND-4.0"], readonly ["CC-BY-SA-1.0", "CC-BY-SA-2.0", "CC-BY-SA-2.5", "CC-BY-SA-3.0", "CC-BY-SA-4.0"], readonly ["CDDL-1.0", "CDDL-1.1"], readonly ["CECILL-1.0", "CECILL-1.1", "CECILL-2.0"], readonly ["ECL-1.0", "ECL-2.0"], readonly ["EFL-1.0", "EFL-2.0"], readonly ["EPL-1.0", "EPL-2.0"], readonly ["EUPL-1.0", "EUPL-1.1"], readonly [readonly ["GFDL-1.1", "GFDL-1.1-only"], readonly ["GFDL-1.2", "GFDL-1.2-only"], readonly ["GFDL-1.1-or-later", "GFDL-1.2-or-later", "GFDL-1.3", "GFDL-1.3-only", "GFDL-1.3-or-later"]], readonly [readonly ["GPL-1.0", "GPL-1.0-only"], readonly ["GPL-2.0", "GPL-2.0-only"], readonly ["GPL-1.0-or-later", "GPL-2.0-or-later", "GPL-3.0", "GPL-3.0-only", "GPL-3.0-or-later"]], readonly [readonly ["LGPL-2.0", "LGPL-2.0-only"], readonly ["LGPL-2.1", "LGPL-2.1-only"], readonly ["LGPL-2.0-or-later", "LGPL-2.1-or-later", "LGPL-3.0", "LGPL-3.0-only", "LGPL-3.0-or-later"]], readonly ["LPL-1.0", "LPL-1.02"], readonly ["LPPL-1.0", "LPPL-1.1", "LPPL-1.2", "LPPL-1.3a", "LPPL-1.3c"], readonly ["MPL-1.0", "MPL-1.1", "MPL-2.0"], readonly ["MPL-1.0", "MPL-1.1", "MPL-2.0-no-copyleft-exception"], readonly ["NPL-1.0", "NPL-1.1"], readonly ["OFL-1.0", "OFL-1.1"], readonly ["OLDAP-1.1", "OLDAP-1.2", "OLDAP-1.3", "OLDAP-1.4", "OLDAP-2.0", "OLDAP-2.0.1", "OLDAP-2.1", "OLDAP-2.2", "OLDAP-2.2.1", "OLDAP-2.2.2", "OLDAP-2.3", "OLDAP-2.4", "OLDAP-2.5", "OLDAP-2.6", "OLDAP-2.7", "OLDAP-2.8"], readonly ["OSL-1.0", "OSL-1.1", "OSL-2.0", "OSL-2.1", "OSL-3.0"], readonly ["PHP-3.0", "PHP-3.01"], readonly ["RPL-1.1", "RPL-1.5"], readonly ["SGI-B-1.0", "SGI-B-1.1", "SGI-B-2.0"], readonly ["YPL-1.0", "YPL-1.1"], readonly ["ZPL-1.1", "ZPL-2.0", "ZPL-2.1"], readonly ["Zimbra-1.3", "Zimbra-1.4"], readonly ["bzip2-1.0.5", "bzip2-1.0.6"]];