-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
index.ts
49 lines (44 loc) · 1.22 KB
/
index.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
import fetch from 'npm-registry-fetch';
export interface DistTagOptions extends fetch.FetchOptions {
defaultTag?: string;
dryRun?: boolean;
tag: string;
}
export type KebabCase<S> = S extends `${infer C}${infer T}`
? KebabCase<T> extends infer U
? U extends string
? T extends Uncapitalize<T>
? `${Uncapitalize<C>}${U}`
: `${Uncapitalize<C>}-${U}`
: never
: never
: S;
/** LibNpmPublishOptions - https://github.com/npm/libnpmpublish#opts */
export interface LibNpmPublishOptions extends KebabCase<fetch.FetchOptions> {
access?: 'public' | 'restricted';
defaultTag: string;
dryRun?: boolean;
// libnpmpublish / npm-registry-fetch check strictSSL rather than strict-ssl
strictSSL?: boolean | 'true' | 'false';
/* Passed to libnpmpublish as `opts.defaultTag` to preserve npm v6 back-compat */
tag?: string;
}
export interface PackagePublishConfig {
access?: 'public' | 'restricted';
defaultTag?: string;
registry?: string;
tag?: string;
}
export interface Tarball {
name: string;
version: string;
files: any[];
bundled: any[];
filename: string;
size: number;
unpackedSize: number;
shasum: string;
integrity: boolean;
entryCount: number;
tarFilePath: string;
}