forked from JS-DevTools/npm-publish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.ts
83 lines (72 loc) · 1.72 KB
/
options.ts
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
import { URL } from "url";
/**
* Options that determine how/whether the package is published.
*/
export interface Options {
/**
* The NPM access token to use when publishing
*/
token?: string;
/**
* The NPM registry URL to use.
*
* Defaults to "https://registry.npmjs.org/"
*/
registry?: string | URL;
/**
* The absolute or relative path of your package.json file.
*
* Defaults to "./package.json"
*/
package?: string;
/**
* The tag to publish to. This allows people to install the package
* using "npm install <package-name>@<tag>".
*
* Defaults to "latest"
*/
tag?: string;
/**
* Determines whether the published package should be publicly visible,
* or restricted to members of your NPM organization. This only applies
* to scoped packages.
*
* Defaults to "restricted" for scoped packages and "public" for non-scoped packages.
*/
access?: Access;
/**
* If true, run npm publish with the --dry-run flag
* so that the package is not published. Used for
* testing workflows.
*
* Defaults to `false`
*/
dryRun?: boolean;
/**
* Only publish the package if the version number in package.json
* differs from the latest on NPM.
*
* Defaults to `true`
*/
checkVersion?: boolean;
/**
* Suppress console output from NPM and npm-publish.
*
* Defaults to `false`
*/
quiet?: boolean;
/**
* A function to call to log debug messages.
*
* Defaults to a no-op function
*/
debug?: Debug;
}
/**
* The possible access levels for an NPM package
*/
export type Access = "public" | "restricted";
/**
* A function that receives debug messages
*/
export type Debug = (message: string, data?: object) => void;