create-typescript-app 1.29.52 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/lib/bin/index.js +5 -4
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/mode.d.ts +1 -1
- package/lib/bin/mode.js.map +1 -1
- package/lib/create/createRerunSuggestion.js +15 -1
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/create/index.js +2 -2
- package/lib/create/index.js.map +1 -1
- package/lib/initialize/index.js +2 -2
- package/lib/initialize/index.js.map +1 -1
- package/lib/migrate/index.js +2 -2
- package/lib/migrate/index.js.map +1 -1
- package/lib/shared/options/args.d.ts +30 -0
- package/lib/shared/options/args.js +10 -0
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.js +30 -0
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/options/detectEmailRedundancy.d.ts +8 -0
- package/lib/shared/options/detectEmailRedundancy.js +16 -0
- package/lib/shared/options/detectEmailRedundancy.js.map +1 -0
- package/lib/shared/options/getPrefillOrPromptedOption.js +1 -2
- package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -1
- package/lib/shared/options/optionsSchema.d.ts +174 -0
- package/lib/shared/options/optionsSchema.js +52 -0
- package/lib/shared/options/optionsSchema.js.map +1 -0
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.d.ts +8 -4
- package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/index.js +15 -10
- package/lib/shared/options/readOptionDefaults/index.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/parsePackageAuthor.js.map +1 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.d.ts +6 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js +16 -0
- package/lib/shared/options/readOptionDefaults/readDefaultsFromReadme.js.map +1 -0
- package/lib/shared/options/readOptions.d.ts +1 -1
- package/lib/shared/options/readOptions.js +47 -45
- package/lib/shared/options/readOptions.js.map +1 -1
- package/lib/shared/types.d.ts +18 -3
- package/lib/steps/finalizeDependencies.js +0 -2
- package/lib/steps/finalizeDependencies.js.map +1 -1
- package/lib/steps/uninstallPackages.js +1 -0
- package/lib/steps/uninstallPackages.js.map +1 -1
- package/lib/steps/updateLocalFiles.js +1 -4
- package/lib/steps/updateLocalFiles.js.map +1 -1
- package/lib/steps/writing/creation/createESLintRC.js +26 -42
- package/lib/steps/writing/creation/createESLintRC.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +2 -2
- package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -1
- package/lib/steps/writing/creation/dotGitHub/workflows.js +31 -32
- package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -1
- package/lib/steps/writing/creation/rootFiles.js +1 -1
- package/lib/steps/writing/creation/rootFiles.js.map +1 -1
- package/lib/steps/writing/creation/writePackageJson.js +1 -2
- package/lib/steps/writing/creation/writePackageJson.js.map +1 -1
- package/package.json +2 -4
- package/lib/shared/options/readGitAndNpmDefaults/index.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +0 -1
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +0 -3
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +0 -8
- package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +0 -1
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.d.ts +0 -0
- /package/lib/shared/options/{readGitAndNpmDefaults → readOptionDefaults}/parsePackageAuthor.js +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const optionsSchemaShape: {
|
|
4
|
+
author: z.ZodOptional<z.ZodString>;
|
|
5
|
+
base: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"common">, z.ZodLiteral<"everything">, z.ZodLiteral<"minimum">, z.ZodLiteral<"prompt">]>>;
|
|
6
|
+
createRepository: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
email: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
github: z.ZodString;
|
|
10
|
+
npm: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
github: string;
|
|
13
|
+
npm: string;
|
|
14
|
+
}, {
|
|
15
|
+
github: string;
|
|
16
|
+
npm: string;
|
|
17
|
+
}>>;
|
|
18
|
+
excludeCompliance: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
excludeContributors: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
excludeLintDeprecation: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
excludeLintESLint: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
excludeLintJSDoc: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
excludeLintJson: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
excludeLintKnip: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
excludeLintMd: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
excludeLintPackageJson: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
excludeLintPackages: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
excludeLintPerfectionist: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
excludeLintRegex: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
excludeLintSpelling: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
excludeLintStrict: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
excludeLintStylistic: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
excludeLintYml: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
excludeReleases: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
excludeRenovate: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
excludeTests: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
funding: z.ZodOptional<z.ZodString>;
|
|
38
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
39
|
+
logoAlt: z.ZodOptional<z.ZodString>;
|
|
40
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
41
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
42
|
+
skipGitHubApi: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
skipInstall: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
skipRemoval: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
skipRestore: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
title: z.ZodOptional<z.ZodString>;
|
|
48
|
+
};
|
|
49
|
+
declare const optionsSchema: z.ZodObject<{
|
|
50
|
+
author: z.ZodOptional<z.ZodString>;
|
|
51
|
+
base: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"common">, z.ZodLiteral<"everything">, z.ZodLiteral<"minimum">, z.ZodLiteral<"prompt">]>>;
|
|
52
|
+
createRepository: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
description: z.ZodOptional<z.ZodString>;
|
|
54
|
+
email: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
github: z.ZodString;
|
|
56
|
+
npm: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
github: string;
|
|
59
|
+
npm: string;
|
|
60
|
+
}, {
|
|
61
|
+
github: string;
|
|
62
|
+
npm: string;
|
|
63
|
+
}>>;
|
|
64
|
+
excludeCompliance: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
excludeContributors: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
excludeLintDeprecation: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
excludeLintESLint: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
excludeLintJSDoc: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
excludeLintJson: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
excludeLintKnip: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
excludeLintMd: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
excludeLintPackageJson: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
excludeLintPackages: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
excludeLintPerfectionist: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
excludeLintRegex: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
excludeLintSpelling: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
excludeLintStrict: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
excludeLintStylistic: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
excludeLintYml: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
excludeReleases: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
excludeRenovate: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
excludeTests: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
funding: z.ZodOptional<z.ZodString>;
|
|
84
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
85
|
+
logoAlt: z.ZodOptional<z.ZodString>;
|
|
86
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
87
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
88
|
+
skipGitHubApi: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
skipInstall: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
skipRemoval: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
skipRestore: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
skipUninstall: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
title: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
author?: string | undefined;
|
|
96
|
+
base?: "common" | "everything" | "minimum" | "prompt" | undefined;
|
|
97
|
+
createRepository?: boolean | undefined;
|
|
98
|
+
description?: string | undefined;
|
|
99
|
+
email?: {
|
|
100
|
+
github: string;
|
|
101
|
+
npm: string;
|
|
102
|
+
} | undefined;
|
|
103
|
+
excludeCompliance?: boolean | undefined;
|
|
104
|
+
excludeContributors?: boolean | undefined;
|
|
105
|
+
excludeLintDeprecation?: boolean | undefined;
|
|
106
|
+
excludeLintESLint?: boolean | undefined;
|
|
107
|
+
excludeLintJSDoc?: boolean | undefined;
|
|
108
|
+
excludeLintJson?: boolean | undefined;
|
|
109
|
+
excludeLintKnip?: boolean | undefined;
|
|
110
|
+
excludeLintMd?: boolean | undefined;
|
|
111
|
+
excludeLintPackageJson?: boolean | undefined;
|
|
112
|
+
excludeLintPackages?: boolean | undefined;
|
|
113
|
+
excludeLintPerfectionist?: boolean | undefined;
|
|
114
|
+
excludeLintRegex?: boolean | undefined;
|
|
115
|
+
excludeLintSpelling?: boolean | undefined;
|
|
116
|
+
excludeLintStrict?: boolean | undefined;
|
|
117
|
+
excludeLintStylistic?: boolean | undefined;
|
|
118
|
+
excludeLintYml?: boolean | undefined;
|
|
119
|
+
excludeReleases?: boolean | undefined;
|
|
120
|
+
excludeRenovate?: boolean | undefined;
|
|
121
|
+
excludeTests?: boolean | undefined;
|
|
122
|
+
funding?: string | undefined;
|
|
123
|
+
logo?: string | undefined;
|
|
124
|
+
logoAlt?: string | undefined;
|
|
125
|
+
owner?: string | undefined;
|
|
126
|
+
repository?: string | undefined;
|
|
127
|
+
skipGitHubApi?: boolean | undefined;
|
|
128
|
+
skipInstall?: boolean | undefined;
|
|
129
|
+
skipRemoval?: boolean | undefined;
|
|
130
|
+
skipRestore?: boolean | undefined;
|
|
131
|
+
skipUninstall?: boolean | undefined;
|
|
132
|
+
title?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
author?: string | undefined;
|
|
135
|
+
base?: "common" | "everything" | "minimum" | "prompt" | undefined;
|
|
136
|
+
createRepository?: boolean | undefined;
|
|
137
|
+
description?: string | undefined;
|
|
138
|
+
email?: {
|
|
139
|
+
github: string;
|
|
140
|
+
npm: string;
|
|
141
|
+
} | undefined;
|
|
142
|
+
excludeCompliance?: boolean | undefined;
|
|
143
|
+
excludeContributors?: boolean | undefined;
|
|
144
|
+
excludeLintDeprecation?: boolean | undefined;
|
|
145
|
+
excludeLintESLint?: boolean | undefined;
|
|
146
|
+
excludeLintJSDoc?: boolean | undefined;
|
|
147
|
+
excludeLintJson?: boolean | undefined;
|
|
148
|
+
excludeLintKnip?: boolean | undefined;
|
|
149
|
+
excludeLintMd?: boolean | undefined;
|
|
150
|
+
excludeLintPackageJson?: boolean | undefined;
|
|
151
|
+
excludeLintPackages?: boolean | undefined;
|
|
152
|
+
excludeLintPerfectionist?: boolean | undefined;
|
|
153
|
+
excludeLintRegex?: boolean | undefined;
|
|
154
|
+
excludeLintSpelling?: boolean | undefined;
|
|
155
|
+
excludeLintStrict?: boolean | undefined;
|
|
156
|
+
excludeLintStylistic?: boolean | undefined;
|
|
157
|
+
excludeLintYml?: boolean | undefined;
|
|
158
|
+
excludeReleases?: boolean | undefined;
|
|
159
|
+
excludeRenovate?: boolean | undefined;
|
|
160
|
+
excludeTests?: boolean | undefined;
|
|
161
|
+
funding?: string | undefined;
|
|
162
|
+
logo?: string | undefined;
|
|
163
|
+
logoAlt?: string | undefined;
|
|
164
|
+
owner?: string | undefined;
|
|
165
|
+
repository?: string | undefined;
|
|
166
|
+
skipGitHubApi?: boolean | undefined;
|
|
167
|
+
skipInstall?: boolean | undefined;
|
|
168
|
+
skipRemoval?: boolean | undefined;
|
|
169
|
+
skipRestore?: boolean | undefined;
|
|
170
|
+
skipUninstall?: boolean | undefined;
|
|
171
|
+
title?: string | undefined;
|
|
172
|
+
}>;
|
|
173
|
+
|
|
174
|
+
export { optionsSchema, optionsSchemaShape };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const optionsSchemaShape = {
|
|
3
|
+
author: z.string().optional(),
|
|
4
|
+
base: z.union([
|
|
5
|
+
z.literal("common"),
|
|
6
|
+
z.literal("everything"),
|
|
7
|
+
z.literal("minimum"),
|
|
8
|
+
z.literal("prompt")
|
|
9
|
+
]).optional(),
|
|
10
|
+
createRepository: z.boolean().optional(),
|
|
11
|
+
description: z.string().optional(),
|
|
12
|
+
email: z.object({
|
|
13
|
+
github: z.string().email(),
|
|
14
|
+
npm: z.string().email()
|
|
15
|
+
}).optional(),
|
|
16
|
+
excludeCompliance: z.boolean().optional(),
|
|
17
|
+
excludeContributors: z.boolean().optional(),
|
|
18
|
+
excludeLintDeprecation: z.boolean().optional(),
|
|
19
|
+
excludeLintESLint: z.boolean().optional(),
|
|
20
|
+
excludeLintJSDoc: z.boolean().optional(),
|
|
21
|
+
excludeLintJson: z.boolean().optional(),
|
|
22
|
+
excludeLintKnip: z.boolean().optional(),
|
|
23
|
+
excludeLintMd: z.boolean().optional(),
|
|
24
|
+
excludeLintPackageJson: z.boolean().optional(),
|
|
25
|
+
excludeLintPackages: z.boolean().optional(),
|
|
26
|
+
excludeLintPerfectionist: z.boolean().optional(),
|
|
27
|
+
excludeLintRegex: z.boolean().optional(),
|
|
28
|
+
excludeLintSpelling: z.boolean().optional(),
|
|
29
|
+
excludeLintStrict: z.boolean().optional(),
|
|
30
|
+
excludeLintStylistic: z.boolean().optional(),
|
|
31
|
+
excludeLintYml: z.boolean().optional(),
|
|
32
|
+
excludeReleases: z.boolean().optional(),
|
|
33
|
+
excludeRenovate: z.boolean().optional(),
|
|
34
|
+
excludeTests: z.boolean().optional(),
|
|
35
|
+
funding: z.string().optional(),
|
|
36
|
+
logo: z.string().optional(),
|
|
37
|
+
logoAlt: z.string().optional(),
|
|
38
|
+
owner: z.string().optional(),
|
|
39
|
+
repository: z.string().optional(),
|
|
40
|
+
skipGitHubApi: z.boolean().optional(),
|
|
41
|
+
skipInstall: z.boolean().optional(),
|
|
42
|
+
skipRemoval: z.boolean().optional(),
|
|
43
|
+
skipRestore: z.boolean().optional(),
|
|
44
|
+
skipUninstall: z.boolean().optional(),
|
|
45
|
+
title: z.string().optional()
|
|
46
|
+
};
|
|
47
|
+
const optionsSchema = z.object(optionsSchemaShape);
|
|
48
|
+
export {
|
|
49
|
+
optionsSchema,
|
|
50
|
+
optionsSchemaShape
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=optionsSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/optionsSchema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const optionsSchemaShape = {\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tcreateRepository: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\temail: z\n\t\t.object({\n\t\t\tgithub: z.string().email(),\n\t\t\tnpm: z.string().email(),\n\t\t})\n\t\t.optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeContributors: z.boolean().optional(),\n\texcludeLintDeprecation: z.boolean().optional(),\n\texcludeLintESLint: z.boolean().optional(),\n\texcludeLintJSDoc: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintRegex: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintStrict: z.boolean().optional(),\n\texcludeLintStylistic: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\tlogo: z.string().optional(),\n\tlogoAlt: z.string().optional(),\n\towner: z.string().optional(),\n\trepository: z.string().optional(),\n\tskipGitHubApi: z.boolean().optional(),\n\tskipInstall: z.boolean().optional(),\n\tskipRemoval: z.boolean().optional(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean().optional(),\n\ttitle: z.string().optional(),\n};\n\nexport const optionsSchema = z.object(optionsSchemaShape);\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,qBAAqB;AAAA,EACjC,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EACJ,MAAM;AAAA,IACN,EAAE,QAAQ,QAAQ;AAAA,IAClB,EAAE,QAAQ,YAAY;AAAA,IACtB,EAAE,QAAQ,SAAS;AAAA,IACnB,EAAE,QAAQ,QAAQ;AAAA,EACnB,CAAC,EACA,SAAS;AAAA,EACX,kBAAkB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACvC,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,OAAO,EACL,OAAO;AAAA,IACP,QAAQ,EAAE,OAAO,EAAE,MAAM;AAAA,IACzB,KAAK,EAAE,OAAO,EAAE,MAAM;AAAA,EACvB,CAAC,EACA,SAAS;AAAA,EACX,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,qBAAqB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,kBAAkB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACvC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,wBAAwB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7C,qBAAqB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,0BAA0B,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC/C,kBAAkB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACvC,qBAAqB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,mBAAmB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,sBAAsB,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC3C,gBAAgB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACrC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,iBAAiB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACtC,cAAc,EAAE,QAAQ,EAAE,SAAS;AAAA,EACnC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B;AAEO,MAAM,gBAAgB,EAAE,OAAO,kBAAkB;","names":[]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
declare function
|
|
1
|
+
declare function readOptionDefaults(): {
|
|
2
|
+
logo: () => Promise<string | undefined>;
|
|
3
|
+
title: () => Promise<string | undefined>;
|
|
2
4
|
author: () => Promise<string>;
|
|
3
5
|
description: () => Promise<string | undefined>;
|
|
4
|
-
email: () => Promise<
|
|
6
|
+
email: () => Promise<{
|
|
7
|
+
github: string;
|
|
8
|
+
npm: string;
|
|
9
|
+
} | undefined>;
|
|
5
10
|
funding: () => Promise<string | undefined>;
|
|
6
11
|
owner: () => Promise<string | undefined>;
|
|
7
12
|
repository: () => Promise<string | undefined>;
|
|
8
|
-
title: () => Promise<string | undefined>;
|
|
9
13
|
};
|
|
10
14
|
|
|
11
|
-
export {
|
|
15
|
+
export { readOptionDefaults };
|
|
@@ -8,14 +8,15 @@ import { readPackageData } from "../../packages.js";
|
|
|
8
8
|
import { tryCatchAsync } from "../../tryCatchAsync.js";
|
|
9
9
|
import { tryCatchLazyValueAsync } from "../../tryCatchLazyValueAsync.js";
|
|
10
10
|
import { parsePackageAuthor } from "./parsePackageAuthor.js";
|
|
11
|
-
import {
|
|
12
|
-
function
|
|
11
|
+
import { readDefaultsFromReadme } from "./readDefaultsFromReadme.js";
|
|
12
|
+
function readOptionDefaults() {
|
|
13
13
|
const gitDefaults = tryCatchLazyValueAsync(
|
|
14
14
|
async () => gitUrlParse(await gitRemoteOriginUrl())
|
|
15
15
|
);
|
|
16
|
-
const npmDefaults = tryCatchLazyValueAsync(
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const npmDefaults = tryCatchLazyValueAsync(async () => {
|
|
17
|
+
const whoami = (await $`npm whoami`).stdout;
|
|
18
|
+
return whoami ? await npmUser(whoami) : void 0;
|
|
19
|
+
});
|
|
19
20
|
const packageData = lazyValue(readPackageData);
|
|
20
21
|
const packageAuthor = lazyValue(
|
|
21
22
|
async () => parsePackageAuthor(await packageData())
|
|
@@ -23,18 +24,22 @@ function getGitAndNpmDefaults() {
|
|
|
23
24
|
return {
|
|
24
25
|
author: async () => (await packageAuthor()).author ?? npmDefaults.name,
|
|
25
26
|
description: async () => (await packageData()).description,
|
|
26
|
-
email: async () =>
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
email: async () => {
|
|
28
|
+
const gitEmail = await tryCatchAsync(
|
|
29
|
+
async () => (await $`git config --get user.email`).stdout
|
|
30
|
+
);
|
|
31
|
+
const npmEmail = (await npmDefaults())?.email ?? (await packageAuthor()).email;
|
|
32
|
+
return gitEmail || npmEmail ? { github: gitEmail || npmEmail, npm: npmEmail || gitEmail } : void 0;
|
|
33
|
+
},
|
|
29
34
|
funding: async () => await tryCatchAsync(
|
|
30
35
|
async () => (await fs.readFile(".github/FUNDING.yml")).toString().split(":")[1]?.trim()
|
|
31
36
|
),
|
|
32
37
|
owner: async () => (await gitDefaults())?.organization ?? (await packageAuthor()).author,
|
|
33
38
|
repository: async () => (await gitDefaults())?.name ?? (await packageData()).name,
|
|
34
|
-
|
|
39
|
+
...readDefaultsFromReadme()
|
|
35
40
|
};
|
|
36
41
|
}
|
|
37
42
|
export {
|
|
38
|
-
|
|
43
|
+
readOptionDefaults
|
|
39
44
|
};
|
|
40
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/index.ts"],"sourcesContent":["import { $ } from \"execa\";\nimport gitRemoteOriginUrl from \"git-remote-origin-url\";\nimport gitUrlParse from \"git-url-parse\";\nimport lazyValue from \"lazy-value\";\nimport fs from \"node:fs/promises\";\nimport npmUser from \"npm-user\";\n\nimport { readPackageData } from \"../../packages.js\";\nimport { tryCatchAsync } from \"../../tryCatchAsync.js\";\nimport { tryCatchLazyValueAsync } from \"../../tryCatchLazyValueAsync.js\";\nimport { parsePackageAuthor } from \"./parsePackageAuthor.js\";\nimport { readDefaultsFromReadme } from \"./readDefaultsFromReadme.js\";\n\nexport function readOptionDefaults() {\n\tconst gitDefaults = tryCatchLazyValueAsync(async () =>\n\t\tgitUrlParse(await gitRemoteOriginUrl()),\n\t);\n\n\tconst npmDefaults = tryCatchLazyValueAsync(async () => {\n\t\tconst whoami = (await $`npm whoami`).stdout;\n\t\treturn whoami ? await npmUser(whoami) : undefined;\n\t});\n\n\tconst packageData = lazyValue(readPackageData);\n\tconst packageAuthor = lazyValue(async () =>\n\t\tparsePackageAuthor(await packageData()),\n\t);\n\n\treturn {\n\t\tauthor: async () => (await packageAuthor()).author ?? npmDefaults.name,\n\t\tdescription: async () => (await packageData()).description,\n\t\temail: async () => {\n\t\t\tconst gitEmail = await tryCatchAsync(\n\t\t\t\tasync () => (await $`git config --get user.email`).stdout,\n\t\t\t);\n\t\t\tconst npmEmail =\n\t\t\t\t(await npmDefaults())?.email ?? (await packageAuthor()).email;\n\n\t\t\t/* eslint-disable @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-non-null-assertion */\n\t\t\treturn gitEmail || npmEmail\n\t\t\t\t? { github: (gitEmail || npmEmail)!, npm: (npmEmail || gitEmail)! }\n\t\t\t\t: undefined;\n\t\t\t/* eslint-enable @typescript-eslint/prefer-nullish-coalescing, @typescript-eslint/no-non-null-assertion */\n\t\t},\n\t\tfunding: async () =>\n\t\t\tawait tryCatchAsync(\n\t\t\t\tasync () =>\n\t\t\t\t\t(await fs.readFile(\".github/FUNDING.yml\"))\n\t\t\t\t\t\t.toString()\n\t\t\t\t\t\t.split(\":\")[1]\n\t\t\t\t\t\t?.trim(),\n\t\t\t),\n\t\towner: async () =>\n\t\t\t(await gitDefaults())?.organization ?? (await packageAuthor()).author,\n\t\trepository: async () =>\n\t\t\t(await gitDefaults())?.name ?? (await packageData()).name,\n\t\t...readDefaultsFromReadme(),\n\t};\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAClB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,OAAO,QAAQ;AACf,OAAO,aAAa;AAEpB,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEhC,SAAS,qBAAqB;AACpC,QAAM,cAAc;AAAA,IAAuB,YAC1C,YAAY,MAAM,mBAAmB,CAAC;AAAA,EACvC;AAEA,QAAM,cAAc,uBAAuB,YAAY;AACtD,UAAM,UAAU,MAAM,eAAe;AACrC,WAAO,SAAS,MAAM,QAAQ,MAAM,IAAI;AAAA,EACzC,CAAC;AAED,QAAM,cAAc,UAAU,eAAe;AAC7C,QAAM,gBAAgB;AAAA,IAAU,YAC/B,mBAAmB,MAAM,YAAY,CAAC;AAAA,EACvC;AAEA,SAAO;AAAA,IACN,QAAQ,aAAa,MAAM,cAAc,GAAG,UAAU,YAAY;AAAA,IAClE,aAAa,aAAa,MAAM,YAAY,GAAG;AAAA,IAC/C,OAAO,YAAY;AAClB,YAAM,WAAW,MAAM;AAAA,QACtB,aAAa,MAAM,gCAAgC;AAAA,MACpD;AACA,YAAM,YACJ,MAAM,YAAY,IAAI,UAAU,MAAM,cAAc,GAAG;AAGzD,aAAO,YAAY,WAChB,EAAE,QAAS,YAAY,UAAY,KAAM,YAAY,SAAW,IAChE;AAAA,IAEJ;AAAA,IACA,SAAS,YACR,MAAM;AAAA,MACL,aACE,MAAM,GAAG,SAAS,qBAAqB,GACtC,SAAS,EACT,MAAM,GAAG,EAAE,CAAC,GACX,KAAK;AAAA,IACV;AAAA,IACD,OAAO,aACL,MAAM,YAAY,IAAI,iBAAiB,MAAM,cAAc,GAAG;AAAA,IAChE,YAAY,aACV,MAAM,YAAY,IAAI,SAAS,MAAM,YAAY,GAAG;AAAA,IACtD,GAAG,uBAAuB;AAAA,EAC3B;AACD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/parsePackageAuthor.ts"],"sourcesContent":["import { PartialPackageData } from \"../../types.js\";\n\nexport function parsePackageAuthor(packageData: PartialPackageData) {\n\tconst [packageAuthor, packageEmail] =\n\t\ttypeof packageData.author === \"string\"\n\t\t\t? [\n\t\t\t\t\tpackageData.author.split(\"<\")[0].trim(),\n\t\t\t\t\tpackageData.author.split(/<|>/)[1]?.trim(),\n\t\t\t ]\n\t\t\t: [packageData.author?.name, packageData.author?.email];\n\n\treturn {\n\t\tauthor: packageAuthor,\n\t\temail: packageEmail,\n\t};\n}\n"],"mappings":"AAEO,SAAS,mBAAmB,aAAiC;AACnE,QAAM,CAAC,eAAe,YAAY,IACjC,OAAO,YAAY,WAAW,WAC3B;AAAA,IACA,YAAY,OAAO,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK;AAAA,IACtC,YAAY,OAAO,MAAM,KAAK,EAAE,CAAC,GAAG,KAAK;AAAA,EACzC,IACA,CAAC,YAAY,QAAQ,MAAM,YAAY,QAAQ,KAAK;AAExD,SAAO;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,EACR;AACD;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import lazyValue from "lazy-value";
|
|
2
|
+
import { readFileSafe } from "../../readFileSafe.js";
|
|
3
|
+
function readDefaultsFromReadme() {
|
|
4
|
+
const readme = lazyValue(async () => await readFileSafe("README.md", ""));
|
|
5
|
+
const imageTag = lazyValue(
|
|
6
|
+
async () => (await readme()).match(/<img.+src.+\/>/)?.[0]
|
|
7
|
+
);
|
|
8
|
+
return {
|
|
9
|
+
logo: async () => (await imageTag())?.match(/src\s*=(.+)?\/>/)?.[1]?.replaceAll(/^['"]|['"]$/g, ""),
|
|
10
|
+
title: async () => (await readme()).match(/^(?:# |<h1\s+align="center">)(.*?)(?:<\/h1>)?$/i)?.[1]?.trim()?.replace(/<[^>]+(?:>|$)/g, "")
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
readDefaultsFromReadme
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=readDefaultsFromReadme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/shared/options/readOptionDefaults/readDefaultsFromReadme.ts"],"sourcesContent":["import lazyValue from \"lazy-value\";\n\nimport { readFileSafe } from \"../../readFileSafe.js\";\n\nexport function readDefaultsFromReadme() {\n\tconst readme = lazyValue(async () => await readFileSafe(\"README.md\", \"\"));\n\n\tconst imageTag = lazyValue(\n\t\tasync () => (await readme()).match(/<img.+src.+\\/>/)?.[0],\n\t);\n\n\treturn {\n\t\tlogo: async () =>\n\t\t\t(await imageTag())\n\t\t\t\t?.match(/src\\s*=(.+)?\\/>/)?.[1]\n\t\t\t\t?.replaceAll(/^['\"]|['\"]$/g, \"\"),\n\t\ttitle: async () =>\n\t\t\t(await readme())\n\t\t\t\t.match(/^(?:# |<h1\\s+align=\"center\">)(.*?)(?:<\\/h1>)?$/i)?.[1]\n\t\t\t\t?.trim()\n\t\t\t\t?.replace(/<[^>]+(?:>|$)/g, \"\"),\n\t};\n}\n"],"mappings":"AAAA,OAAO,eAAe;AAEtB,SAAS,oBAAoB;AAEtB,SAAS,yBAAyB;AACxC,QAAM,SAAS,UAAU,YAAY,MAAM,aAAa,aAAa,EAAE,CAAC;AAExE,QAAM,WAAW;AAAA,IAChB,aAAa,MAAM,OAAO,GAAG,MAAM,gBAAgB,IAAI,CAAC;AAAA,EACzD;AAEA,SAAO;AAAA,IACN,MAAM,aACJ,MAAM,SAAS,IACb,MAAM,iBAAiB,IAAI,CAAC,GAC5B,WAAW,gBAAgB,EAAE;AAAA,IACjC,OAAO,aACL,MAAM,OAAO,GACZ,MAAM,iDAAiD,IAAI,CAAC,GAC3D,KAAK,GACL,QAAQ,kBAAkB,EAAE;AAAA,EACjC;AACD;","names":[]}
|
|
@@ -9,8 +9,8 @@ interface GitHubAndOptions {
|
|
|
9
9
|
}
|
|
10
10
|
interface OptionsParseCancelled {
|
|
11
11
|
cancelled: true;
|
|
12
|
+
error?: string | z.ZodError<object>;
|
|
12
13
|
options: object;
|
|
13
|
-
zodError?: z.ZodError<object>;
|
|
14
14
|
}
|
|
15
15
|
interface OptionsParseSuccess extends GitHubAndOptions {
|
|
16
16
|
cancelled: false;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { titleCase } from "title-case";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
import { withSpinner } from "../cli/spinners.js";
|
|
5
4
|
import { allArgOptions } from "./args.js";
|
|
6
5
|
import { augmentOptionsWithExcludes } from "./augmentOptionsWithExcludes.js";
|
|
6
|
+
import { detectEmailRedundancy } from "./detectEmailRedundancy.js";
|
|
7
7
|
import { ensureRepositoryExists } from "./ensureRepositoryExists.js";
|
|
8
8
|
import { getGitHub } from "./getGitHub.js";
|
|
9
9
|
import { getPrefillOrPromptedOption } from "./getPrefillOrPromptedOption.js";
|
|
10
|
-
import {
|
|
10
|
+
import { optionsSchema } from "./optionsSchema.js";
|
|
11
|
+
import { readOptionDefaults } from "./readOptionDefaults/index.js";
|
|
11
12
|
async function readOptions(args) {
|
|
12
|
-
const defaults =
|
|
13
|
+
const defaults = readOptionDefaults();
|
|
13
14
|
const { values } = parseArgs({
|
|
14
15
|
args,
|
|
15
16
|
options: allArgOptions,
|
|
@@ -21,16 +22,24 @@ async function readOptions(args) {
|
|
|
21
22
|
base: values.base,
|
|
22
23
|
createRepository: values["create-repository"],
|
|
23
24
|
description: values.description,
|
|
24
|
-
email: values.email
|
|
25
|
+
email: values.email ?? values["email-github"] ?? values["email-npm"] ? {
|
|
26
|
+
github: values.email ?? values["email-github"],
|
|
27
|
+
npm: values.email ?? values["email-npm"]
|
|
28
|
+
} : void 0,
|
|
25
29
|
excludeCompliance: values["exclude-compliance"],
|
|
26
30
|
excludeContributors: values["exclude-contributors"],
|
|
31
|
+
excludeLintDeprecation: values["exclude-lint-deprecation"],
|
|
32
|
+
excludeLintESLint: values["exclude-lint-eslint"],
|
|
33
|
+
excludeLintJSDoc: values["exclude-lint-jsdoc"],
|
|
27
34
|
excludeLintJson: values["exclude-lint-json"],
|
|
28
35
|
excludeLintKnip: values["exclude-lint-knip"],
|
|
29
36
|
excludeLintMd: values["exclude-lint-md"],
|
|
30
37
|
excludeLintPackageJson: values["exclude-lint-package-json"],
|
|
31
38
|
excludeLintPackages: values["exclude-lint-packages"],
|
|
32
39
|
excludeLintPerfectionist: values["exclude-lint-perfectionist"],
|
|
40
|
+
excludeLintRegex: values["exclude-lint-regex"],
|
|
33
41
|
excludeLintSpelling: values["exclude-lint-spelling"],
|
|
42
|
+
excludeLintStrict: values["exclude-lint-strict"],
|
|
34
43
|
excludeLintYml: values["exclude-lint-yml"],
|
|
35
44
|
excludeReleases: values["exclude-releases"],
|
|
36
45
|
excludeRenovate: values["exclude-renovate"],
|
|
@@ -38,19 +47,27 @@ async function readOptions(args) {
|
|
|
38
47
|
funding: values.funding,
|
|
39
48
|
owner: values.owner,
|
|
40
49
|
repository: values.repository,
|
|
41
|
-
skipGitHubApi:
|
|
42
|
-
skipInstall:
|
|
43
|
-
skipRemoval:
|
|
50
|
+
skipGitHubApi: values["skip-github-api"],
|
|
51
|
+
skipInstall: values["skip-install"],
|
|
52
|
+
skipRemoval: values["skip-removal"],
|
|
44
53
|
skipRestore: values["skip-restore"],
|
|
45
|
-
skipUninstall:
|
|
54
|
+
skipUninstall: values["skip-uninstall"],
|
|
46
55
|
title: values.title
|
|
47
56
|
};
|
|
57
|
+
const emailError = detectEmailRedundancy(values);
|
|
58
|
+
if (emailError) {
|
|
59
|
+
return {
|
|
60
|
+
cancelled: true,
|
|
61
|
+
error: emailError,
|
|
62
|
+
options: mappedOptions
|
|
63
|
+
};
|
|
64
|
+
}
|
|
48
65
|
const optionsParseResult = optionsSchema.safeParse(mappedOptions);
|
|
49
66
|
if (!optionsParseResult.success) {
|
|
50
67
|
return {
|
|
51
68
|
cancelled: true,
|
|
52
|
-
|
|
53
|
-
|
|
69
|
+
error: optionsParseResult.error,
|
|
70
|
+
options: mappedOptions
|
|
54
71
|
};
|
|
55
72
|
}
|
|
56
73
|
const options = optionsParseResult.data;
|
|
@@ -103,12 +120,31 @@ async function readOptions(args) {
|
|
|
103
120
|
if (!options.title) {
|
|
104
121
|
return { cancelled: true, options };
|
|
105
122
|
}
|
|
123
|
+
let logo;
|
|
124
|
+
if (options.logo) {
|
|
125
|
+
const alt = await getPrefillOrPromptedOption(
|
|
126
|
+
options.logoAlt,
|
|
127
|
+
"What is the alt text (non-visual description) of the logo?"
|
|
128
|
+
);
|
|
129
|
+
if (!alt) {
|
|
130
|
+
return { cancelled: true, options };
|
|
131
|
+
}
|
|
132
|
+
logo = { alt, src: options.logo };
|
|
133
|
+
}
|
|
134
|
+
const email = options.email ?? await defaults.email() ?? await getPrefillOrPromptedOption(
|
|
135
|
+
void 0,
|
|
136
|
+
"What email should be used in package.json and .md files?"
|
|
137
|
+
);
|
|
138
|
+
if (!email) {
|
|
139
|
+
return { cancelled: true, options };
|
|
140
|
+
}
|
|
106
141
|
const augmentedOptions = await augmentOptionsWithExcludes({
|
|
107
142
|
...options,
|
|
108
143
|
author: options.author ?? await defaults.owner(),
|
|
109
144
|
description: options.description,
|
|
110
|
-
email:
|
|
145
|
+
email: typeof email === "string" ? { github: email, npm: email } : email,
|
|
111
146
|
funding: options.funding ?? await defaults.funding(),
|
|
147
|
+
logo,
|
|
112
148
|
owner: options.owner,
|
|
113
149
|
repository,
|
|
114
150
|
title: options.title
|
|
@@ -125,40 +161,6 @@ async function readOptions(args) {
|
|
|
125
161
|
options: augmentedOptions
|
|
126
162
|
};
|
|
127
163
|
}
|
|
128
|
-
const optionsSchema = z.object({
|
|
129
|
-
author: z.string().optional(),
|
|
130
|
-
base: z.union([
|
|
131
|
-
z.literal("common"),
|
|
132
|
-
z.literal("everything"),
|
|
133
|
-
z.literal("minimum"),
|
|
134
|
-
z.literal("prompt")
|
|
135
|
-
]).optional(),
|
|
136
|
-
createRepository: z.boolean().optional(),
|
|
137
|
-
description: z.string().optional(),
|
|
138
|
-
email: z.string().email().optional(),
|
|
139
|
-
excludeCompliance: z.boolean().optional(),
|
|
140
|
-
excludeContributors: z.boolean().optional(),
|
|
141
|
-
excludeLintJson: z.boolean().optional(),
|
|
142
|
-
excludeLintKnip: z.boolean().optional(),
|
|
143
|
-
excludeLintMd: z.boolean().optional(),
|
|
144
|
-
excludeLintPackageJson: z.boolean().optional(),
|
|
145
|
-
excludeLintPackages: z.boolean().optional(),
|
|
146
|
-
excludeLintPerfectionist: z.boolean().optional(),
|
|
147
|
-
excludeLintSpelling: z.boolean().optional(),
|
|
148
|
-
excludeLintYml: z.boolean().optional(),
|
|
149
|
-
excludeReleases: z.boolean().optional(),
|
|
150
|
-
excludeRenovate: z.boolean().optional(),
|
|
151
|
-
excludeTests: z.boolean().optional(),
|
|
152
|
-
funding: z.string().optional(),
|
|
153
|
-
owner: z.string().optional(),
|
|
154
|
-
repository: z.string().optional(),
|
|
155
|
-
skipGitHubApi: z.boolean(),
|
|
156
|
-
skipInstall: z.boolean(),
|
|
157
|
-
skipRemoval: z.boolean(),
|
|
158
|
-
skipRestore: z.boolean().optional(),
|
|
159
|
-
skipUninstall: z.boolean(),
|
|
160
|
-
title: z.string().optional()
|
|
161
|
-
});
|
|
162
164
|
export {
|
|
163
165
|
readOptions
|
|
164
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Options } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { getGitAndNpmDefaults } from \"./readGitAndNpmDefaults/index.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\toptions: object;\n\tzodError?: z.ZodError<object>;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(args: string[]): Promise<OptionsParseResult> {\n\tconst defaults = getGitAndNpmDefaults();\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tconst mappedOptions = {\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tcreateRepository: values[\"create-repository\"],\n\t\tdescription: values.description,\n\t\temail: values.email,\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeContributors: values[\"exclude-contributors\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\towner: values.owner,\n\t\trepository: values.repository,\n\t\tskipGitHubApi: !!values[\"skip-github-api\"],\n\t\tskipInstall: !!values[\"skip-install\"],\n\t\tskipRemoval: !!values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: !!values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions: mappedOptions,\n\t\t\tzodError: optionsParseResult.error,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\toptions.owner,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\toptions.repository,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\tvalues[\"skip-github-api\"]\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tcreateRepository: options.createRepository,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\toptions.description,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\toptions.title,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\temail: options.email ?? (await defaults.email()),\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n\nconst optionsSchema = z.object({\n\tauthor: z.string().optional(),\n\tbase: z\n\t\t.union([\n\t\t\tz.literal(\"common\"),\n\t\t\tz.literal(\"everything\"),\n\t\t\tz.literal(\"minimum\"),\n\t\t\tz.literal(\"prompt\"),\n\t\t])\n\t\t.optional(),\n\tcreateRepository: z.boolean().optional(),\n\tdescription: z.string().optional(),\n\temail: z.string().email().optional(),\n\texcludeCompliance: z.boolean().optional(),\n\texcludeContributors: z.boolean().optional(),\n\texcludeLintJson: z.boolean().optional(),\n\texcludeLintKnip: z.boolean().optional(),\n\texcludeLintMd: z.boolean().optional(),\n\texcludeLintPackageJson: z.boolean().optional(),\n\texcludeLintPackages: z.boolean().optional(),\n\texcludeLintPerfectionist: z.boolean().optional(),\n\texcludeLintSpelling: z.boolean().optional(),\n\texcludeLintYml: z.boolean().optional(),\n\texcludeReleases: z.boolean().optional(),\n\texcludeRenovate: z.boolean().optional(),\n\texcludeTests: z.boolean().optional(),\n\tfunding: z.string().optional(),\n\towner: z.string().optional(),\n\trepository: z.string().optional(),\n\tskipGitHubApi: z.boolean(),\n\tskipInstall: z.boolean(),\n\tskipRemoval: z.boolean(),\n\tskipRestore: z.boolean().optional(),\n\tskipUninstall: z.boolean(),\n\ttitle: z.string().optional(),\n});\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,8BAA8B;AACvC,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AAmBrC,eAAsB,YAAY,MAA6C;AAC9E,QAAM,WAAW,qBAAqB;AACtC,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,gBAAgB;AAAA,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C3B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,eAAe,EAAE,QAAQ;AAAA,EACzB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ;AAAA,EACvB,aAAa,EAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ;AAAA,EACzB,OAAO,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/options/readOptions.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport { titleCase } from \"title-case\";\nimport { z } from \"zod\";\n\nimport { withSpinner } from \"../cli/spinners.js\";\nimport { Options, OptionsLogo } from \"../types.js\";\nimport { allArgOptions } from \"./args.js\";\nimport { augmentOptionsWithExcludes } from \"./augmentOptionsWithExcludes.js\";\nimport { detectEmailRedundancy } from \"./detectEmailRedundancy.js\";\nimport { ensureRepositoryExists } from \"./ensureRepositoryExists.js\";\nimport { GitHub, getGitHub } from \"./getGitHub.js\";\nimport { getPrefillOrPromptedOption } from \"./getPrefillOrPromptedOption.js\";\nimport { optionsSchema } from \"./optionsSchema.js\";\nimport { readOptionDefaults } from \"./readOptionDefaults/index.js\";\n\nexport interface GitHubAndOptions {\n\tgithub: GitHub | undefined;\n\toptions: Options;\n}\n\nexport interface OptionsParseCancelled {\n\tcancelled: true;\n\terror?: string | z.ZodError<object>;\n\toptions: object;\n}\n\nexport interface OptionsParseSuccess extends GitHubAndOptions {\n\tcancelled: false;\n}\n\nexport type OptionsParseResult = OptionsParseCancelled | OptionsParseSuccess;\n\nexport async function readOptions(args: string[]): Promise<OptionsParseResult> {\n\tconst defaults = readOptionDefaults();\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: allArgOptions,\n\t\tstrict: false,\n\t\ttokens: true,\n\t});\n\n\tconst mappedOptions = {\n\t\tauthor: values.author,\n\t\tbase: values.base,\n\t\tcreateRepository: values[\"create-repository\"],\n\t\tdescription: values.description,\n\t\temail:\n\t\t\tvalues.email ?? values[\"email-github\"] ?? values[\"email-npm\"]\n\t\t\t\t? {\n\t\t\t\t\t\tgithub: values.email ?? values[\"email-github\"],\n\t\t\t\t\t\tnpm: values.email ?? values[\"email-npm\"],\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\texcludeCompliance: values[\"exclude-compliance\"],\n\t\texcludeContributors: values[\"exclude-contributors\"],\n\t\texcludeLintDeprecation: values[\"exclude-lint-deprecation\"],\n\t\texcludeLintESLint: values[\"exclude-lint-eslint\"],\n\t\texcludeLintJSDoc: values[\"exclude-lint-jsdoc\"],\n\t\texcludeLintJson: values[\"exclude-lint-json\"],\n\t\texcludeLintKnip: values[\"exclude-lint-knip\"],\n\t\texcludeLintMd: values[\"exclude-lint-md\"],\n\t\texcludeLintPackageJson: values[\"exclude-lint-package-json\"],\n\t\texcludeLintPackages: values[\"exclude-lint-packages\"],\n\t\texcludeLintPerfectionist: values[\"exclude-lint-perfectionist\"],\n\t\texcludeLintRegex: values[\"exclude-lint-regex\"],\n\t\texcludeLintSpelling: values[\"exclude-lint-spelling\"],\n\t\texcludeLintStrict: values[\"exclude-lint-strict\"],\n\t\texcludeLintYml: values[\"exclude-lint-yml\"],\n\t\texcludeReleases: values[\"exclude-releases\"],\n\t\texcludeRenovate: values[\"exclude-renovate\"],\n\t\texcludeTests: values[\"unit-tests\"],\n\t\tfunding: values.funding,\n\t\towner: values.owner,\n\t\trepository: values.repository,\n\t\tskipGitHubApi: values[\"skip-github-api\"],\n\t\tskipInstall: values[\"skip-install\"],\n\t\tskipRemoval: values[\"skip-removal\"],\n\t\tskipRestore: values[\"skip-restore\"],\n\t\tskipUninstall: values[\"skip-uninstall\"],\n\t\ttitle: values.title,\n\t};\n\n\tconst emailError = detectEmailRedundancy(values);\n\tif (emailError) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: emailError,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst optionsParseResult = optionsSchema.safeParse(mappedOptions);\n\n\tif (!optionsParseResult.success) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\terror: optionsParseResult.error,\n\t\t\toptions: mappedOptions,\n\t\t};\n\t}\n\n\tconst options = optionsParseResult.data;\n\n\toptions.owner ??= await getPrefillOrPromptedOption(\n\t\toptions.owner,\n\t\t\"What organization or user will the repository be under?\",\n\t\tdefaults.owner,\n\t);\n\tif (!options.owner) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\toptions.repository ??= await getPrefillOrPromptedOption(\n\t\toptions.repository,\n\t\t\"What will the kebab-case name of the repository be?\",\n\t\tdefaults.repository,\n\t);\n\tif (!options.repository) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\tconst { github, repository } = await ensureRepositoryExists(\n\t\tvalues[\"skip-github-api\"]\n\t\t\t? undefined\n\t\t\t: await withSpinner(\"Checking GitHub authentication\", getGitHub),\n\t\t{\n\t\t\tcreateRepository: options.createRepository,\n\t\t\towner: options.owner,\n\t\t\trepository: options.repository,\n\t\t},\n\t);\n\tif (!repository) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.description ??= await getPrefillOrPromptedOption(\n\t\toptions.description,\n\t\t\"How would you describe the new package?\",\n\t\tasync () =>\n\t\t\t(await defaults.description()) ?? \"A very lovely package. Hooray!\",\n\t);\n\tif (!options.description) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\toptions.title ??= await getPrefillOrPromptedOption(\n\t\toptions.title,\n\t\t\"What will the Title Case title of the repository be?\",\n\t\tasync () =>\n\t\t\t(await defaults.title()) ?? titleCase(repository).replaceAll(\"-\", \" \"),\n\t);\n\tif (!options.title) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tlet logo: OptionsLogo | undefined;\n\n\tif (options.logo) {\n\t\tconst alt = await getPrefillOrPromptedOption(\n\t\t\toptions.logoAlt,\n\t\t\t\"What is the alt text (non-visual description) of the logo?\",\n\t\t);\n\t\tif (!alt) {\n\t\t\treturn { cancelled: true, options };\n\t\t}\n\n\t\tlogo = { alt, src: options.logo };\n\t}\n\n\tconst email =\n\t\toptions.email ??\n\t\t(await defaults.email()) ??\n\t\t(await getPrefillOrPromptedOption(\n\t\t\tundefined,\n\t\t\t\"What email should be used in package.json and .md files?\",\n\t\t));\n\tif (!email) {\n\t\treturn { cancelled: true, options };\n\t}\n\n\tconst augmentedOptions = await augmentOptionsWithExcludes({\n\t\t...options,\n\t\tauthor: options.author ?? (await defaults.owner()),\n\t\tdescription: options.description,\n\t\temail: typeof email === \"string\" ? { github: email, npm: email } : email,\n\t\tfunding: options.funding ?? (await defaults.funding()),\n\t\tlogo,\n\t\towner: options.owner,\n\t\trepository,\n\t\ttitle: options.title,\n\t});\n\n\tif (!augmentedOptions) {\n\t\treturn {\n\t\t\tcancelled: true,\n\t\t\toptions,\n\t\t};\n\t}\n\n\treturn {\n\t\tcancelled: false,\n\t\tgithub,\n\t\toptions: augmentedOptions,\n\t};\n}\n"],"mappings":"AAAA,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAG1B,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AACvC,SAAiB,iBAAiB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAmBnC,eAAsB,YAAY,MAA6C;AAC9E,QAAM,WAAW,mBAAmB;AACpC,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,gBAAgB;AAAA,IACrB,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,kBAAkB,OAAO,mBAAmB;AAAA,IAC5C,aAAa,OAAO;AAAA,IACpB,OACC,OAAO,SAAS,OAAO,cAAc,KAAK,OAAO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ACjB,QAAQ;AAAA,MACR;AAAA,IACD;AACA,QAAI,CAAC,KAAK;AACT,aAAO,EAAE,WAAW,MAAM,QAAQ;AAAA,IACnC;AAEA,WAAO,EAAE,KAAK,KAAK,QAAQ,KAAK;AAAA,EACjC;AAEA,QAAM,QACL,QAAQ,SACP,MAAM,SAAS,MAAM,KACrB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD,MAAI,CAAC,OAAO;AACX,WAAO,EAAE,WAAW,MAAM,QAAQ;AAAA,EACnC;AAEA,QAAM,mBAAmB,MAAM,2BAA2B;AAAA,IACzD,GAAG;AAAA,IACH,QAAQ,QAAQ,UAAW,MAAM,SAAS,MAAM;AAAA,IAChD,aAAa,QAAQ;AAAA,IACrB,OAAO,OAAO,UAAU,WAAW,EAAE,QAAQ,OAAO,KAAK,MAAM,IAAI;AAAA,IACnE,SAAS,QAAQ,WAAY,MAAM,SAAS,QAAQ;AAAA,IACpD;AAAA,IACA,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,OAAO,QAAQ;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,kBAAkB;AACtB,WAAO;AAAA,MACN,WAAW;AAAA,MACX;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EACV;AACD;","names":[]}
|
package/lib/shared/types.d.ts
CHANGED
|
@@ -21,29 +21,44 @@ interface PartialPackageData {
|
|
|
21
21
|
} | string;
|
|
22
22
|
}
|
|
23
23
|
type InputBase = "common" | "everything" | "minimum" | "prompt";
|
|
24
|
+
interface OptionsLogo {
|
|
25
|
+
alt: string;
|
|
26
|
+
src: string;
|
|
27
|
+
}
|
|
28
|
+
interface OptionsEmail {
|
|
29
|
+
github: string;
|
|
30
|
+
npm: string;
|
|
31
|
+
}
|
|
24
32
|
interface Options {
|
|
25
33
|
author?: string;
|
|
26
34
|
base?: InputBase;
|
|
27
35
|
createRepository?: boolean;
|
|
28
36
|
description: string;
|
|
29
|
-
email
|
|
37
|
+
email: OptionsEmail;
|
|
30
38
|
excludeCompliance?: boolean;
|
|
31
39
|
excludeContributors?: boolean;
|
|
40
|
+
excludeLintDeprecation?: boolean;
|
|
41
|
+
excludeLintESLint?: boolean;
|
|
42
|
+
excludeLintJSDoc?: boolean;
|
|
32
43
|
excludeLintJson?: boolean;
|
|
33
44
|
excludeLintKnip?: boolean;
|
|
34
45
|
excludeLintMd?: boolean;
|
|
35
46
|
excludeLintPackageJson?: boolean;
|
|
36
47
|
excludeLintPackages?: boolean;
|
|
37
48
|
excludeLintPerfectionist?: boolean;
|
|
49
|
+
excludeLintRegex?: boolean;
|
|
38
50
|
excludeLintSpelling?: boolean;
|
|
51
|
+
excludeLintStrict?: boolean;
|
|
52
|
+
excludeLintStylistic?: boolean;
|
|
39
53
|
excludeLintYml?: boolean;
|
|
40
54
|
excludeReleases?: boolean;
|
|
41
55
|
excludeRenovate?: boolean;
|
|
42
56
|
excludeTests?: boolean;
|
|
43
57
|
funding?: string;
|
|
58
|
+
logo: OptionsLogo | undefined;
|
|
44
59
|
owner: string;
|
|
45
60
|
repository: string;
|
|
46
|
-
skipGitHubApi
|
|
61
|
+
skipGitHubApi?: boolean;
|
|
47
62
|
skipInstall?: boolean;
|
|
48
63
|
skipRemoval?: boolean;
|
|
49
64
|
skipRestore?: boolean;
|
|
@@ -51,4 +66,4 @@ interface Options {
|
|
|
51
66
|
title: string;
|
|
52
67
|
}
|
|
53
68
|
|
|
54
|
-
export { AllContributorContributor, AllContributorsData, InputBase, Options, PartialPackageData };
|
|
69
|
+
export { AllContributorContributor, AllContributorsData, InputBase, Options, OptionsEmail, OptionsLogo, PartialPackageData };
|
|
@@ -6,10 +6,8 @@ async function finalizeDependencies(options) {
|
|
|
6
6
|
"@typescript-eslint/eslint-plugin",
|
|
7
7
|
"@typescript-eslint/parser",
|
|
8
8
|
"eslint",
|
|
9
|
-
"eslint-config-prettier",
|
|
10
9
|
"eslint-plugin-deprecation",
|
|
11
10
|
"eslint-plugin-eslint-comments",
|
|
12
|
-
"eslint-plugin-import",
|
|
13
11
|
"eslint-plugin-jsdoc",
|
|
14
12
|
"eslint-plugin-n",
|
|
15
13
|
"eslint-plugin-regexp",
|