-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
nopeer
option for ignoring peerDependencies. Add typings
- Loading branch information
1 parent
b34fca8
commit 27b301f
Showing
4 changed files
with
178 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
/** | ||
* Options struct for the init() function | ||
*/ | ||
export interface InitOpts { | ||
/** | ||
* Path to start checking dependencies from | ||
*/ | ||
start: string; | ||
/** | ||
* Only show production dependencies | ||
*/ | ||
production?: boolean | undefined; | ||
/** | ||
* Only show development dependencies | ||
*/ | ||
development?: boolean | undefined; | ||
/** | ||
* Report guessed licenses as unknown licenses | ||
*/ | ||
unknown?: boolean | undefined; | ||
/** | ||
* Only list packages with unknown or guessed licenses | ||
*/ | ||
onlyunknown?: boolean | undefined; | ||
/** | ||
* Output in json format | ||
*/ | ||
json?: boolean | undefined; | ||
/** | ||
* Output in csv format | ||
*/ | ||
csv?: boolean | undefined; | ||
/** | ||
* Prefix column for component in csv format. | ||
*/ | ||
csvComponentPrefix?: string | undefined; | ||
/** | ||
* Write the data to a specific file. | ||
*/ | ||
out?: string | undefined; | ||
/** | ||
* To add a custom Format file in JSON | ||
*/ | ||
customPath?: string | ModuleInfo | undefined; | ||
/** | ||
* Exclude modules which licenses are in the comma-separated list from the output | ||
*/ | ||
exclude?: string[] | undefined; | ||
/** | ||
* Output the location of the license files as relative paths | ||
*/ | ||
relativeLicensePath?: boolean | undefined; | ||
/** | ||
* Output a summary of the license usage | ||
*/ | ||
summary?: boolean | undefined; | ||
/** | ||
* Fail (exit with code 1) on the first occurrence of the licenses of the semicolon-separated list | ||
*/ | ||
failOn?: string | undefined; | ||
/** | ||
* Fail (exit with code 1) on the first occurrence of the licenses not in the semicolon-separated list | ||
*/ | ||
onlyAllow?: string | undefined; | ||
/** | ||
* Restrict output to the packages (package@version) in the semicolon-separated list | ||
*/ | ||
packages?: string | undefined; | ||
/** | ||
* Restrict output to the packages (package@version) not in the semicolon-separated list | ||
*/ | ||
excludePackages?: string | undefined; | ||
/** | ||
* Restrict output to not include any package marked as private | ||
*/ | ||
excludePrivatePackages?: boolean | undefined; | ||
/** | ||
* Look for direct dependencies only | ||
*/ | ||
direct?: boolean | undefined; | ||
/** | ||
* Colorize output | ||
*/ | ||
color?: boolean | undefined; | ||
/** | ||
* Specify the columns for CSV format | ||
* or add the specified items for JSON format | ||
*/ | ||
customFormat?: Record<string, any> | undefined; | ||
/** | ||
* Ignore peerDependencies | ||
*/ | ||
nopeer?: boolean; | ||
} | ||
|
||
/** | ||
* Information about one dependency | ||
*/ | ||
export interface ModuleInfo { | ||
/** | ||
* Module name | ||
*/ | ||
name?: string | undefined; | ||
/** | ||
* Module version | ||
*/ | ||
version?: string | undefined; | ||
/** | ||
* Module description | ||
*/ | ||
description?: string | undefined; | ||
/** | ||
* Repository URL | ||
*/ | ||
repository?: string | undefined; | ||
/** | ||
* Publisher name | ||
*/ | ||
publisher?: string | undefined; | ||
/** | ||
* Publisher e-mail | ||
*/ | ||
email?: string | undefined; | ||
/** | ||
* Publisher URL | ||
*/ | ||
url?: string | undefined; | ||
/** | ||
* Array of licenses | ||
*/ | ||
licenses?: string | string[] | undefined; | ||
/** | ||
* Path to license file, if available | ||
*/ | ||
licenseFile?: string | undefined; | ||
/** | ||
* Contents of the license | ||
*/ | ||
licenseText?: string | undefined; | ||
/** | ||
* Whether the license is modified | ||
*/ | ||
licenseModified?: string | undefined; | ||
/** | ||
* Private module | ||
*/ | ||
private?: boolean | undefined; | ||
/** | ||
* Path to module | ||
*/ | ||
path?: string | undefined; | ||
/** | ||
* Copyright statements | ||
*/ | ||
copyright?: string | undefined; | ||
/** | ||
* Path of NOTICE file | ||
*/ | ||
noticeFile?: string | undefined; | ||
} | ||
|
||
export interface ModuleInfos { | ||
[packageName: string]: ModuleInfo; | ||
} | ||
|
||
/** | ||
* Run the license check | ||
* @param opts specifies the path to the module to check dependencies of | ||
*/ | ||
export function init( | ||
opts: InitOpts, | ||
callback: (err: Error, ret: ModuleInfos) => void | ||
): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters