-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathtypes.ts
110 lines (96 loc) · 2.49 KB
/
types.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import { z } from "zod";
import { StatusCode } from "./codes.js";
export interface AllContributorContributor {
contributions: string[];
login: string;
}
export interface AllContributorsData {
contributors: AllContributorContributor[];
}
export interface PartialPackageData {
author?: { email: string; name: string } | string;
dependencies?: Record<string, string>;
description?: string;
devDependencies?: Record<string, string>;
email?: string;
name?: string;
repository?: { type: string; url: string } | string;
}
export type OptionsAccess = "public" | "restricted";
export type OptionsBase = "common" | "everything" | "minimum" | "prompt";
export interface OptionsEmail {
github: string;
npm: string;
}
export interface OptionsLogo {
alt: string;
src: string;
}
/**
* All runtime options that may (or must) be specified for setup.
*/
export interface Options {
access: OptionsAccess;
author?: string;
base?: OptionsBase;
description: string;
directory: string;
email: OptionsEmail;
excludeAllContributors?: boolean;
excludeCompliance?: boolean;
excludeLintDeprecation?: boolean;
excludeLintESLint?: boolean;
excludeLintJSDoc?: boolean;
excludeLintJson?: boolean;
excludeLintKnip?: boolean;
excludeLintMd?: boolean;
excludeLintPackageJson?: boolean;
excludeLintPackages?: boolean;
excludeLintPerfectionist?: boolean;
excludeLintRegex?: boolean;
excludeLintSpelling?: boolean;
excludeLintStrict?: boolean;
excludeLintStylistic?: boolean;
excludeLintYml?: boolean;
excludeReleases?: boolean;
excludeRenovate?: boolean;
excludeTests?: boolean;
funding?: string;
keywords?: string[];
logo: OptionsLogo | undefined;
mode: Mode;
offline?: boolean;
owner: string;
preserveGeneratedFrom?: boolean;
repository: string;
skipAllContributorsApi?: boolean;
skipGitHubApi?: boolean;
skipInstall?: boolean;
skipRemoval?: boolean;
skipRestore?: boolean;
skipUninstall?: boolean;
title: string;
}
/**
* Options that might be suggested by how the user is running setup.
*/
export interface PromptedOptions {
/**
* Directory for the repository, if it may differ from the repository name.
*/
directory?: string;
/**
* Repository name, if it may differ from the current directory.
*/
repository?: string;
}
export interface ModeResult {
code: StatusCode;
error?: string | z.ZodError<object>;
options: Partial<Options>;
}
export type ModeRunner = (
args: string[],
promptedOptions?: PromptedOptions,
) => Promise<ModeResult>;
export type Mode = "create" | "initialize" | "migrate";