forked from shashkovdanil/clean-publish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
107 additions
and
99 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
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 |
---|---|---|
@@ -1,69 +1,81 @@ | ||
export type PackageAccess = 'public' | 'restricted' | string; | ||
export type PackageAccess = 'public' | 'restricted' | string | ||
|
||
export type PackageManager = 'npm' | 'pnpm' | 'yarn' | string; | ||
export type PackageManager = 'npm' | 'pnpm' | 'yarn' | string | ||
|
||
export interface Config { | ||
/** | ||
* Keep only main section of `README.md` | ||
* @default false | ||
*/ | ||
cleanDocs?: boolean; | ||
/** | ||
* Keep only main section of `README.md` | ||
* @default false | ||
*/ | ||
cleanDocs?: boolean | ||
|
||
/** | ||
* Clean inline comments from JS files. | ||
* @default false | ||
*/ | ||
cleanComments?: boolean; | ||
/** | ||
* Clean inline comments from JS files. | ||
* @default false | ||
*/ | ||
cleanComments?: boolean | ||
|
||
/** | ||
* List of files that you want to delete before publishing (supports regex and glob patterns). | ||
*/ | ||
files?: Array<string | RegExp>; | ||
/** | ||
* List of files that you want to delete before publishing (supports regex and glob patterns). | ||
*/ | ||
files?: Array<string | RegExp> | ||
|
||
/** | ||
* List of fields in the `package.json` file that you want to delete before publishing. | ||
*/ | ||
fields?: string[]; | ||
/** | ||
* List of fields in the `package.json` file that you want to delete before publishing. | ||
*/ | ||
fields?: string[] | ||
|
||
/** | ||
* Clean project without `npm publish` (tmp directory will not be deleted automatically). | ||
* @default false | ||
*/ | ||
withoutPublish?: boolean; | ||
/** | ||
* Clean project without `npm publish` (tmp directory will not be deleted automatically). | ||
* @default false | ||
*/ | ||
withoutPublish?: boolean | ||
|
||
/** | ||
* Name of package manager to use. | ||
* @default "npm" | ||
*/ | ||
packageManager?: PackageManager; | ||
/** | ||
* Name of package manager to use. | ||
* @default "npm" | ||
*/ | ||
packageManager?: PackageManager | ||
|
||
/** | ||
* Whether the npm registry publishes this package as a public package, or restricted. | ||
*/ | ||
access?: PackageAccess; | ||
/** | ||
* Whether the npm registry publishes this package as a public package, or restricted. | ||
*/ | ||
access?: PackageAccess | ||
|
||
/** | ||
* Create temporary directory with given name. | ||
*/ | ||
tempDir?: string; | ||
/** | ||
* Create temporary directory with given name. | ||
*/ | ||
tempDir?: string | ||
|
||
/** | ||
* Options which are directly passed into package manager during publish. | ||
*/ | ||
packageManagerOptions?: string[]; | ||
/** | ||
* Options which are directly passed into package manager during publish. | ||
*/ | ||
packageManagerOptions?: string[] | ||
|
||
/** | ||
* Reports the details of what would have been published. | ||
*/ | ||
dryRun?: boolean; | ||
/** | ||
* Reports the details of what would have been published. | ||
*/ | ||
dryRun?: boolean | ||
|
||
/** | ||
* Registers the package with the given tag. | ||
*/ | ||
tag?: string; | ||
/** | ||
* Registers the package with the given tag. | ||
*/ | ||
tag?: string | ||
|
||
/** | ||
* Run script on the to-release dir before npm publish. | ||
*/ | ||
beforeScript?: string; | ||
/** | ||
* Run script on the to-release dir before npm publish. | ||
*/ | ||
beforeScript?: string | ||
} | ||
|
||
export interface CleanPublishOptions { | ||
tempDir?: string | ||
files?: string[] | ||
cleanDocs?: boolean | ||
cleanComments?: boolean | ||
fields?: string[] | ||
beforeScript?: string | ||
withoutPublish?: boolean | ||
} | ||
|
||
declare function cleanPublish(options?: CleanPublishOptions): Promise<void> |