@kingironman2011/license-checker 1.0.2 → 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 +0 -1
  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
package/dist/types.d.ts CHANGED
@@ -1,30 +1,142 @@
1
- export type DependencyScope = "production" | "development" | "both";
2
- export interface DependencyLicense {
3
- name: string;
4
- version: string;
5
- license: string;
6
- scope: DependencyScope;
7
- packagePath: string;
8
- licenseFiles: string[];
9
- }
1
+ export type CustomFormatValue = string | boolean | undefined;
2
+ export type CustomFormat = Record<string, CustomFormatValue>;
10
3
  export interface LicenseCheckOptions {
11
- start?: string;
4
+ start: string;
12
5
  production?: boolean;
13
6
  development?: boolean;
14
- silent?: boolean;
15
- check?: boolean;
7
+ unknown?: boolean;
8
+ onlyunknown?: boolean;
9
+ json?: boolean;
10
+ csv?: boolean;
11
+ csvComponentPrefix?: string;
12
+ out?: string;
13
+ customPath?: string;
14
+ excludeLicenses?: string;
15
+ relativeLicensePath?: boolean;
16
+ relativeModulePath?: boolean;
17
+ summary?: boolean;
18
+ failOn?: string;
19
+ onlyAllow?: string;
20
+ includePackages?: string;
21
+ excludePackages?: string;
22
+ excludePrivatePackages?: boolean;
23
+ excludePackagesStartingWith?: string;
24
+ direct?: boolean | number;
25
+ depth?: number;
26
+ color?: boolean;
27
+ customFormat?: CustomFormat;
28
+ nopeer?: boolean;
29
+ clarificationsFile?: string;
30
+ clarificationsMatchAll?: boolean;
31
+ includeLicenses?: string;
16
32
  files?: string;
33
+ markdown?: boolean;
34
+ plainVertical?: boolean;
35
+ limitAttributes?: string;
36
+ angularCli?: boolean;
37
+ }
38
+ export interface ModuleInfo {
39
+ name?: string;
40
+ version?: string;
41
+ description?: string;
42
+ repository?: string;
43
+ publisher?: string;
44
+ email?: string;
45
+ url?: string;
46
+ licenses?: LicenseValue | LicenseValue[];
47
+ licenseFile?: string;
48
+ licenseText?: string;
49
+ licenseModified?: string;
50
+ private?: boolean;
51
+ path?: string;
52
+ relativeModulePath?: boolean;
53
+ copyright?: string;
54
+ noticeFile?: string;
55
+ [key: string]: unknown;
17
56
  }
18
- export interface PackageJson {
57
+ export type ModuleInfos = Record<string, ModuleInfo>;
58
+ export interface DependencyPackage {
19
59
  name?: string;
20
60
  version?: string;
21
- license?: string | {
22
- type?: string;
61
+ description?: string;
62
+ repository?: string | {
63
+ url?: string;
23
64
  };
24
- licenses?: Array<{
25
- type?: string;
26
- }>;
27
- dependencies?: Record<string, string>;
28
- optionalDependencies?: Record<string, string>;
65
+ author?: string | {
66
+ name?: string;
67
+ email?: string;
68
+ url?: string;
69
+ };
70
+ url?: string | {
71
+ web?: string;
72
+ };
73
+ license?: LicenseValue;
74
+ licenses?: LicenseValue[];
75
+ readme?: string;
76
+ path?: string;
77
+ realPath?: string;
78
+ realName?: string;
79
+ private?: boolean;
80
+ root?: boolean;
81
+ link?: string;
82
+ extraneous?: boolean;
83
+ depth?: number;
84
+ invalid?: boolean;
85
+ peerInvalid?: boolean;
86
+ dependencies?: Record<string, DependencyPackage | string>;
29
87
  devDependencies?: Record<string, string>;
88
+ peerDependencies?: Record<string, string>;
89
+ optionalDependencies?: Record<string, string>;
90
+ _dependencies?: Record<string, string>;
91
+ parent?: DependencyPackage | null;
92
+ target?: DependencyPackage;
93
+ realpath?: string;
94
+ children?: Map<string, DependencyPackage & {
95
+ peer?: boolean;
96
+ }>;
97
+ edgesOut?: Map<string, {
98
+ type: string;
99
+ spec: string;
100
+ to?: DependencyPackage;
101
+ valid: boolean;
102
+ }>;
103
+ [key: string]: unknown;
104
+ }
105
+ export interface Clarification {
106
+ semverRange: string;
107
+ used?: boolean;
108
+ checksum?: string;
109
+ repository?: string;
110
+ url?: string;
111
+ path?: string;
112
+ licenses?: LicenseValue[] | string;
113
+ licenseFile?: string;
114
+ licenseText?: string;
115
+ licenseStart?: string;
116
+ licenseEnd?: string;
117
+ copyright?: string;
118
+ publisher?: string;
119
+ email?: string;
120
+ [key: string]: unknown;
121
+ }
122
+ export type Clarifications = Record<string, Clarification[]>;
123
+ export type LicenseValue = string | {
124
+ type?: string;
125
+ name?: string;
126
+ };
127
+ export type LicenseCollectionOptions = Pick<LicenseCheckOptions, "customFormat" | "development" | "production" | "unknown"> & {
128
+ args?: Pick<LicenseCheckOptions, "csv">;
129
+ basePath?: string | null;
130
+ clarifications: Clarifications;
131
+ };
132
+ export interface ParsedArguments extends Omit<Partial<LicenseCheckOptions>, "direct" | "depth" | "color"> {
133
+ color?: boolean | null;
134
+ depth?: string | number;
135
+ direct?: string | boolean | number | null;
136
+ }
137
+ export interface NormalizedArguments extends LicenseCheckOptions {
138
+ color: boolean;
139
+ direct: number;
140
+ relativeLicensePath: boolean;
141
+ relativeModulePath: boolean;
30
142
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kingironman2011/license-checker",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "A NPM Package to check other packages licenses and extract them.",
5
5
  "keywords": [
6
6
  "checker",