create-typescript-app 1.42.1 → 1.43.1
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 +6 -5
- package/lib/bin/help.d.ts +3 -0
- package/lib/bin/help.js +117 -0
- package/lib/bin/help.js.map +1 -0
- package/lib/bin/index.js +24 -13
- package/lib/bin/index.js.map +1 -1
- package/lib/bin/packageJson.d.ts +3 -0
- package/lib/bin/packageJson.js +13 -0
- package/lib/bin/packageJson.js.map +1 -0
- package/lib/create/createRerunSuggestion.js +6 -1
- package/lib/create/createRerunSuggestion.js.map +1 -1
- package/lib/shared/options/args.d.ts +94 -4
- package/lib/shared/options/args.js +303 -45
- package/lib/shared/options/args.js.map +1 -1
- package/lib/shared/options/augmentOptionsWithExcludes.d.ts +4 -2
- package/lib/shared/options/augmentOptionsWithExcludes.js +25 -15
- package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -1
- package/lib/shared/readFileSafe.d.ts +1 -1
- package/lib/shared/readFileSafe.js.map +1 -1
- package/lib/shared/readFileSafeAsJson.d.ts +1 -1
- package/lib/shared/readFileSafeAsJson.js.map +1 -1
- package/lib/shared/runOrRestore.d.ts +1 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js +0 -1
- package/lib/steps/writing/creation/dotGitHub/createWorkflows.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<a href="#contributors" target="_blank">
|
|
7
7
|
<!-- prettier-ignore-start -->
|
|
8
8
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
9
|
-
<img alt="All Contributors:
|
|
9
|
+
<img alt="All Contributors: 35 🤝" src="https://img.shields.io/badge/all_contributors-35_🤝-21bb42.svg" />
|
|
10
10
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
11
11
|
<!-- prettier-ignore-end -->
|
|
12
12
|
</a>
|
|
@@ -86,36 +86,37 @@ Thanks! 💖
|
|
|
86
86
|
<td align="center" valign="top" width="14.28%"><a href="https://conormeagher.com/"><img src="https://avatars.githubusercontent.com/u/363781?v=4?s=100" width="100px;" alt="Conor Meagher"/><br /><sub><b>Conor Meagher</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=conrmahr" title="Code">💻</a></td>
|
|
87
87
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DanexQ"><img src="https://avatars.githubusercontent.com/u/72567464?v=4?s=100" width="100px;" alt="Daniel"/><br /><sub><b>Daniel</b></sub></a><br /><a href="#infra-DanexQ" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
88
88
|
<td align="center" valign="top" width="14.28%"><a href="https://roe.dev/"><img src="https://avatars.githubusercontent.com/u/28706372?v=4?s=100" width="100px;" alt="Daniel Roe"/><br /><sub><b>Daniel Roe</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=danielroe" title="Code">💻</a></td>
|
|
89
|
-
<td align="center" valign="top" width="14.28%"><a href="https://
|
|
89
|
+
<td align="center" valign="top" width="14.28%"><a href="https://dominicduffin.uk"><img src="https://avatars.githubusercontent.com/u/26224873?v=4?s=100" width="100px;" alt="Dominic Duffin"/><br /><sub><b>Dominic Duffin</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=dominicduffin1" title="Code">💻</a></td>
|
|
90
90
|
</tr>
|
|
91
91
|
<tr>
|
|
92
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nowyDEV"><img src="https://avatars.githubusercontent.com/u/12304307?v=4?s=100" width="100px;" alt="Dominik Nowik"/><br /><sub><b>Dominik Nowik</b></sub></a><br /><a href="#tool-nowyDEV" title="Tools">🔧</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=nowyDEV" title="Code">💻</a></td>
|
|
92
93
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/emday4prez"><img src="https://avatars.githubusercontent.com/u/35363144?v=4?s=100" width="100px;" alt="Emerson"/><br /><sub><b>Emerson</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=emday4prez" title="Code">💻</a></td>
|
|
93
94
|
<td align="center" valign="top" width="14.28%"><a href="https://gvasquez.dev"><img src="https://avatars.githubusercontent.com/u/7041175?v=4?s=100" width="100px;" alt="Graham Vasquez"/><br /><sub><b>Graham Vasquez</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=gv14982" title="Code">💻</a></td>
|
|
94
95
|
<td align="center" valign="top" width="14.28%"><a href="https://sinchang.me"><img src="https://avatars.githubusercontent.com/u/3297859?v=4?s=100" width="100px;" alt="Jeff Wen"/><br /><sub><b>Jeff Wen</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=sinchang" title="Code">💻</a></td>
|
|
95
96
|
<td align="center" valign="top" width="14.28%"><a href="https://jessicawilkins.dev/"><img src="https://avatars.githubusercontent.com/u/67210629?v=4?s=100" width="100px;" alt="Jessica Wilkins "/><br /><sub><b>Jessica Wilkins </b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=jdwilkin4" title="Code">💻</a></td>
|
|
96
97
|
<td align="center" valign="top" width="14.28%"><a href="https://typescriptcourse.com/tutorials"><img src="https://avatars.githubusercontent.com/u/3806031?v=4?s=100" width="100px;" alt="Joe Previte"/><br /><sub><b>Joe Previte</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Ajsjoeio" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=jsjoeio" title="Code">💻</a></td>
|
|
97
98
|
<td align="center" valign="top" width="14.28%"><a href="https://blog.johnnyreilly.com/"><img src="https://avatars.githubusercontent.com/u/1010525?v=4?s=100" width="100px;" alt="John Reilly"/><br /><sub><b>John Reilly</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=johnnyreilly" title="Code">💻</a> <a href="#ideas-johnnyreilly" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
98
|
-
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg"/><br /><sub><b>Josh Goldberg</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Code">💻</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/pulls?q=is%3Apr+reviewed-by%3AJoshuaKGoldberg" title="Reviewed Pull Requests">👀</a> <a href="#tool-JoshuaKGoldberg" title="Tools">🔧</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Documentation">📖</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Tests">⚠️</a></td>
|
|
99
99
|
</tr>
|
|
100
100
|
<tr>
|
|
101
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg"/><br /><sub><b>Josh Goldberg</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Code">💻</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/pulls?q=is%3Apr+reviewed-by%3AJoshuaKGoldberg" title="Reviewed Pull Requests">👀</a> <a href="#tool-JoshuaKGoldberg" title="Tools">🔧</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Documentation">📖</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=JoshuaKGoldberg" title="Tests">⚠️</a></td>
|
|
101
102
|
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/Jolg42"><img src="https://avatars.githubusercontent.com/u/1328733?v=4?s=100" width="100px;" alt="Joël Galeran"/><br /><sub><b>Joël Galeran</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=jolg42" title="Code">💻</a></td>
|
|
102
103
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jaas666"><img src="https://avatars.githubusercontent.com/u/30204147?v=4?s=100" width="100px;" alt="Juan A."/><br /><sub><b>Juan A.</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=jaas666" title="Code">💻</a></td>
|
|
103
104
|
<td align="center" valign="top" width="14.28%"><a href="https://kristo-baricevic.github.io/"><img src="https://avatars.githubusercontent.com/u/108290619?v=4?s=100" width="100px;" alt="Kristo Baricevic"/><br /><sub><b>Kristo Baricevic</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=kristo-baricevic" title="Code">💻</a></td>
|
|
104
105
|
<td align="center" valign="top" width="14.28%"><a href="https://webpro.nl"><img src="https://avatars.githubusercontent.com/u/456426?v=4?s=100" width="100px;" alt="Lars Kappert"/><br /><sub><b>Lars Kappert</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=webpro" title="Code">💻</a></td>
|
|
105
106
|
<td align="center" valign="top" width="14.28%"><a href="https://navinmoorthy.me/"><img src="https://avatars.githubusercontent.com/u/39694575?v=4?s=100" width="100px;" alt="Navin Moorthy"/><br /><sub><b>Navin Moorthy</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Anavin-moorthy" title="Bug reports">🐛</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=navin-moorthy" title="Code">💻</a></td>
|
|
106
107
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/NazCodeland"><img src="https://avatars.githubusercontent.com/u/113494366?v=4?s=100" width="100px;" alt="NazCodeland"/><br /><sub><b>NazCodeland</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=NazCodeland" title="Code">💻</a></td>
|
|
107
|
-
<td align="center" valign="top" width="14.28%"><a href="https://orta.io"><img src="https://avatars.githubusercontent.com/u/49038?v=4?s=100" width="100px;" alt="Orta Therox"/><br /><sub><b>Orta Therox</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=orta" title="Code">💻</a></td>
|
|
108
108
|
</tr>
|
|
109
109
|
<tr>
|
|
110
|
+
<td align="center" valign="top" width="14.28%"><a href="https://orta.io"><img src="https://avatars.githubusercontent.com/u/49038?v=4?s=100" width="100px;" alt="Orta Therox"/><br /><sub><b>Orta Therox</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=orta" title="Code">💻</a></td>
|
|
110
111
|
<td align="center" valign="top" width="14.28%"><a href="https://paulisaweso.me/"><img src="https://avatars.githubusercontent.com/u/6335792?v=4?s=100" width="100px;" alt="Paul Esch-Laurent"/><br /><sub><b>Paul Esch-Laurent</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=Pinjasaur" title="Code">💻</a></td>
|
|
111
112
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/promise-dash"><img src="https://avatars.githubusercontent.com/u/86062880?v=4?s=100" width="100px;" alt="Promise Dash"/><br /><sub><b>Promise Dash</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=promise-dash" title="Code">💻</a></td>
|
|
112
113
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RebeccaStevens"><img src="https://avatars.githubusercontent.com/u/7224206?v=4?s=100" width="100px;" alt="Rebecca Stevens"/><br /><sub><b>Rebecca Stevens</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RebeccaStevens" title="Code">💻</a> <a href="#infra-RebeccaStevens" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
113
114
|
<td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/ronbraha"><img src="https://avatars.githubusercontent.com/u/45559220?v=4?s=100" width="100px;" alt="Ron Braha"/><br /><sub><b>Ron Braha</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Code">💻</a> <a href="#design-RNR1" title="Design">🎨</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=RNR1" title="Tests">⚠️</a></td>
|
|
114
115
|
<td align="center" valign="top" width="14.28%"><a href="http://ronjeanfrancois.com"><img src="https://avatars.githubusercontent.com/u/105710107?v=4?s=100" width="100px;" alt="Ron Jean-Francois"/><br /><sub><b>Ron Jean-Francois</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ronthetech" title="Code">💻</a> <a href="#infra-ronthetech" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
115
116
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RuthwikReddy09"><img src="https://avatars.githubusercontent.com/u/126862059?v=4?s=100" width="100px;" alt="Ruthwik"/><br /><sub><b>Ruthwik</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ruthwikreddy09" title="Code">💻</a></td>
|
|
116
|
-
<td align="center" valign="top" width="14.28%"><a href="https://ryota-murakami.github.io/"><img src="https://avatars.githubusercontent.com/u/5501268?v=4?s=100" width="100px;" alt="Ryota Murakami"/><br /><sub><b>Ryota Murakami</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ryota-murakami" title="Code">💻</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Aryota-murakami" title="Bug reports">🐛</a></td>
|
|
117
117
|
</tr>
|
|
118
118
|
<tr>
|
|
119
|
+
<td align="center" valign="top" width="14.28%"><a href="https://ryota-murakami.github.io/"><img src="https://avatars.githubusercontent.com/u/5501268?v=4?s=100" width="100px;" alt="Ryota Murakami"/><br /><sub><b>Ryota Murakami</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=ryota-murakami" title="Code">💻</a> <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=author%3Aryota-murakami" title="Bug reports">🐛</a></td>
|
|
119
120
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/the-lazy-learner"><img src="https://avatars.githubusercontent.com/u/13695177?v=4?s=100" width="100px;" alt="Sudhansu"/><br /><sub><b>Sudhansu</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=the-lazy-learner" title="Code">💻</a></td>
|
|
120
121
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mrswastik-robot"><img src="https://avatars.githubusercontent.com/u/107865087?v=4?s=100" width="100px;" alt="Swastik Patel"/><br /><sub><b>Swastik Patel</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=mrswastik-robot" title="Documentation">📖</a></td>
|
|
121
122
|
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/timonjurschitsch/"><img src="https://avatars.githubusercontent.com/u/103483059?v=4?s=100" width="100px;" alt="Timon Jurschitsch"/><br /><sub><b>Timon Jurschitsch</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=dertimonius" title="Code">💻</a></td>
|
package/lib/bin/help.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { allArgOptions } from "../shared/options/args.js";
|
|
3
|
+
function logHelpTextSection(section) {
|
|
4
|
+
console.log(" ");
|
|
5
|
+
console.log(`${chalk.black.bgGreenBright(section.sectionHeading)}`);
|
|
6
|
+
for (const subsection of section.subsections) {
|
|
7
|
+
if (subsection.warning) {
|
|
8
|
+
console.log(chalk.yellow(subsection.warning));
|
|
9
|
+
}
|
|
10
|
+
if (subsection.subheading) {
|
|
11
|
+
console.log(chalk.green(subsection.subheading));
|
|
12
|
+
}
|
|
13
|
+
for (const { description, flag, type } of subsection.flags) {
|
|
14
|
+
console.log(
|
|
15
|
+
chalk.cyan(
|
|
16
|
+
`
|
|
17
|
+
--${flag}${type !== "boolean" ? ` (${chalk.cyanBright(type)})` : ""}: ${description}`
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function createHelpTextSections() {
|
|
24
|
+
const core = {
|
|
25
|
+
sectionHeading: "Core options:",
|
|
26
|
+
subsections: [
|
|
27
|
+
{
|
|
28
|
+
flags: []
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
const optional = {
|
|
33
|
+
sectionHeading: "Optional options:",
|
|
34
|
+
subsections: [
|
|
35
|
+
{
|
|
36
|
+
flags: []
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
const optOut = {
|
|
41
|
+
sectionHeading: "Opt-outs:",
|
|
42
|
+
subsections: [
|
|
43
|
+
{
|
|
44
|
+
flags: [],
|
|
45
|
+
warning: `
|
|
46
|
+
\u26A0\uFE0F Warning: Specifying any --exclude-* flag on the command-line will
|
|
47
|
+
cause the setup script to skip prompting for more excludes. \u26A0\uFE0F`
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
flags: [
|
|
51
|
+
{
|
|
52
|
+
description: `Skips network calls that fetch all-contributors
|
|
53
|
+
data from GitHub`,
|
|
54
|
+
flag: "exclude-contributors",
|
|
55
|
+
type: "boolean"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
subheading: `
|
|
59
|
+
You can prevent the migration script from making some network-based
|
|
60
|
+
changes using any or all of the following CLI flags:`
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
flags: [],
|
|
64
|
+
subheading: `
|
|
65
|
+
You can prevent the migration script from making some changes on disk
|
|
66
|
+
using any or all of the following CLI flags:`
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
const offline = {
|
|
71
|
+
sectionHeading: "Offline Mode:",
|
|
72
|
+
subsections: [
|
|
73
|
+
{
|
|
74
|
+
flags: []
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
const subsections = {
|
|
79
|
+
core: core.subsections[0],
|
|
80
|
+
offline: offline.subsections[0],
|
|
81
|
+
"opt-out": optOut.subsections[0],
|
|
82
|
+
optional: optional.subsections[0],
|
|
83
|
+
"skip-disk": optOut.subsections[2],
|
|
84
|
+
"skip-net": optOut.subsections[1]
|
|
85
|
+
};
|
|
86
|
+
for (const [option, data] of Object.entries(allArgOptions)) {
|
|
87
|
+
subsections[data.docsSection].flags.push({
|
|
88
|
+
description: data.description,
|
|
89
|
+
flag: option,
|
|
90
|
+
type: data.type
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return [core, optional, optOut, offline];
|
|
94
|
+
}
|
|
95
|
+
function logHelpText(introLogs) {
|
|
96
|
+
const helpTextSections = createHelpTextSections();
|
|
97
|
+
for (const log of introLogs) {
|
|
98
|
+
console.log(log);
|
|
99
|
+
console.log(" ");
|
|
100
|
+
}
|
|
101
|
+
console.log(
|
|
102
|
+
chalk.cyan(
|
|
103
|
+
`
|
|
104
|
+
A quickstart-friendly TypeScript template with comprehensive formatting,
|
|
105
|
+
linting, releases, testing, and other great tooling built-in.
|
|
106
|
+
`
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
for (const section of helpTextSections) {
|
|
110
|
+
logHelpTextSection(section);
|
|
111
|
+
console.log();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
logHelpText
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/bin/help.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nimport { allArgOptions } from \"../shared/options/args.js\";\n\ninterface HelpTextSection {\n\tsectionHeading: string;\n\tsubsections: {\n\t\tflags: SubsectionFlag[];\n\t\tsubheading?: string;\n\t\twarning?: string;\n\t}[];\n}\n\ninterface SubsectionFlag {\n\tdescription: string;\n\tflag: string;\n\ttype: string;\n}\n\nfunction logHelpTextSection(section: HelpTextSection): void {\n\tconsole.log(\" \");\n\n\tconsole.log(`${chalk.black.bgGreenBright(section.sectionHeading)}`);\n\n\tfor (const subsection of section.subsections) {\n\t\tif (subsection.warning) {\n\t\t\tconsole.log(chalk.yellow(subsection.warning));\n\t\t}\n\n\t\tif (subsection.subheading) {\n\t\t\tconsole.log(chalk.green(subsection.subheading));\n\t\t}\n\n\t\tfor (const { description, flag, type } of subsection.flags) {\n\t\t\tconsole.log(\n\t\t\t\tchalk.cyan(\n\t\t\t\t\t`\n --${flag}${\n\t\ttype !== \"boolean\" ? ` (${chalk.cyanBright(type)})` : \"\"\n\t}: ${description}`,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction createHelpTextSections(): HelpTextSection[] {\n\tconst core: HelpTextSection = {\n\t\tsectionHeading: \"Core options:\",\n\t\tsubsections: [\n\t\t\t{\n\t\t\t\tflags: [],\n\t\t\t},\n\t\t],\n\t};\n\n\tconst optional: HelpTextSection = {\n\t\tsectionHeading: \"Optional options:\",\n\t\tsubsections: [\n\t\t\t{\n\t\t\t\tflags: [],\n\t\t\t},\n\t\t],\n\t};\n\n\tconst optOut: HelpTextSection = {\n\t\tsectionHeading: \"Opt-outs:\",\n\t\tsubsections: [\n\t\t\t{\n\t\t\t\tflags: [],\n\t\t\t\twarning: `\n ⚠️ Warning: Specifying any --exclude-* flag on the command-line will \n cause the setup script to skip prompting for more excludes. ⚠️`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tflags: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription: `Skips network calls that fetch all-contributors\n data from GitHub`,\n\t\t\t\t\t\tflag: \"exclude-contributors\",\n\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsubheading: `\nYou can prevent the migration script from making some network-based \nchanges using any or all of the following CLI flags:`,\n\t\t\t},\n\t\t\t{\n\t\t\t\tflags: [],\n\t\t\t\tsubheading: `\nYou can prevent the migration script from making some changes on disk \nusing any or all of the following CLI flags:`,\n\t\t\t},\n\t\t],\n\t};\n\n\tconst offline: HelpTextSection = {\n\t\tsectionHeading: \"Offline Mode:\",\n\t\tsubsections: [\n\t\t\t{\n\t\t\t\tflags: [],\n\t\t\t},\n\t\t],\n\t};\n\n\tconst subsections = {\n\t\tcore: core.subsections[0],\n\t\toffline: offline.subsections[0],\n\t\t\"opt-out\": optOut.subsections[0],\n\t\toptional: optional.subsections[0],\n\t\t\"skip-disk\": optOut.subsections[2],\n\t\t\"skip-net\": optOut.subsections[1],\n\t};\n\n\tfor (const [option, data] of Object.entries(allArgOptions)) {\n\t\tsubsections[data.docsSection].flags.push({\n\t\t\tdescription: data.description,\n\t\t\tflag: option,\n\t\t\ttype: data.type,\n\t\t});\n\t}\n\n\treturn [core, optional, optOut, offline];\n}\n\nexport function logHelpText(introLogs: string[]): void {\n\tconst helpTextSections = createHelpTextSections();\n\n\tfor (const log of introLogs) {\n\t\tconsole.log(log);\n\t\tconsole.log(\" \");\n\t}\n\n\tconsole.log(\n\t\tchalk.cyan(\n\t\t\t`\nA quickstart-friendly TypeScript template with comprehensive formatting, \nlinting, releases, testing, and other great tooling built-in.\n `,\n\t\t),\n\t);\n\n\tfor (const section of helpTextSections) {\n\t\tlogHelpTextSection(section);\n\n\t\tconsole.log();\n\t}\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAElB,SAAS,qBAAqB;AAiB9B,SAAS,mBAAmB,SAAgC;AAC3D,UAAQ,IAAI,GAAG;AAEf,UAAQ,IAAI,GAAG,MAAM,MAAM,cAAc,QAAQ,cAAc,CAAC,EAAE;AAElE,aAAW,cAAc,QAAQ,aAAa;AAC7C,QAAI,WAAW,SAAS;AACvB,cAAQ,IAAI,MAAM,OAAO,WAAW,OAAO,CAAC;AAAA,IAC7C;AAEA,QAAI,WAAW,YAAY;AAC1B,cAAQ,IAAI,MAAM,MAAM,WAAW,UAAU,CAAC;AAAA,IAC/C;AAEA,eAAW,EAAE,aAAa,MAAM,KAAK,KAAK,WAAW,OAAO;AAC3D,cAAQ;AAAA,QACP,MAAM;AAAA,UACL;AAAA,MACC,IAAI,GACR,SAAS,YAAY,KAAK,MAAM,WAAW,IAAI,CAAC,MAAM,EACvD,KAAK,WAAW;AAAA,QACb;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,SAAS,yBAA4C;AACpD,QAAM,OAAwB;AAAA,IAC7B,gBAAgB;AAAA,IAChB,aAAa;AAAA,MACZ;AAAA,QACC,OAAO,CAAC;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAEA,QAAM,WAA4B;AAAA,IACjC,gBAAgB;AAAA,IAChB,aAAa;AAAA,MACZ;AAAA,QACC,OAAO,CAAC;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAEA,QAAM,SAA0B;AAAA,IAC/B,gBAAgB;AAAA,IAChB,aAAa;AAAA,MACZ;AAAA,QACC,OAAO,CAAC;AAAA,QACR,SAAS;AAAA;AAAA;AAAA,MAGV;AAAA,MACA;AAAA,QACC,OAAO;AAAA,UACN;AAAA,YACC,aAAa;AAAA;AAAA,YAEb,MAAM;AAAA,YACN,MAAM;AAAA,UACP;AAAA,QACD;AAAA,QACA,YAAY;AAAA;AAAA;AAAA,MAGb;AAAA,MACA;AAAA,QACC,OAAO,CAAC;AAAA,QACR,YAAY;AAAA;AAAA;AAAA,MAGb;AAAA,IACD;AAAA,EACD;AAEA,QAAM,UAA2B;AAAA,IAChC,gBAAgB;AAAA,IAChB,aAAa;AAAA,MACZ;AAAA,QACC,OAAO,CAAC;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAEA,QAAM,cAAc;AAAA,IACnB,MAAM,KAAK,YAAY,CAAC;AAAA,IACxB,SAAS,QAAQ,YAAY,CAAC;AAAA,IAC9B,WAAW,OAAO,YAAY,CAAC;AAAA,IAC/B,UAAU,SAAS,YAAY,CAAC;AAAA,IAChC,aAAa,OAAO,YAAY,CAAC;AAAA,IACjC,YAAY,OAAO,YAAY,CAAC;AAAA,EACjC;AAEA,aAAW,CAAC,QAAQ,IAAI,KAAK,OAAO,QAAQ,aAAa,GAAG;AAC3D,gBAAY,KAAK,WAAW,EAAE,MAAM,KAAK;AAAA,MACxC,aAAa,KAAK;AAAA,MAClB,MAAM;AAAA,MACN,MAAM,KAAK;AAAA,IACZ,CAAC;AAAA,EACF;AAEA,SAAO,CAAC,MAAM,UAAU,QAAQ,OAAO;AACxC;AAEO,SAAS,YAAY,WAA2B;AACtD,QAAM,mBAAmB,uBAAuB;AAEhD,aAAW,OAAO,WAAW;AAC5B,YAAQ,IAAI,GAAG;AACf,YAAQ,IAAI,GAAG;AAAA,EAChB;AAEA,UAAQ;AAAA,IACP,MAAM;AAAA,MACL;AAAA;AAAA;AAAA;AAAA,IAID;AAAA,EACD;AAEA,aAAW,WAAW,kBAAkB;AACvC,uBAAmB,OAAO;AAE1B,YAAQ,IAAI;AAAA,EACb;AACD;","names":[]}
|
package/lib/bin/index.js
CHANGED
|
@@ -8,35 +8,46 @@ import { initialize } from "../initialize/index.js";
|
|
|
8
8
|
import { migrate } from "../migrate/index.js";
|
|
9
9
|
import { logLine } from "../shared/cli/lines.js";
|
|
10
10
|
import { StatusCodes } from "../shared/codes.js";
|
|
11
|
+
import { logHelpText } from "./help.js";
|
|
12
|
+
import { getVersionFromPackageJson } from "./packageJson.js";
|
|
11
13
|
import { promptForMode } from "./promptForMode.js";
|
|
12
14
|
const operationMessage = (verb) => `Operation ${verb}. Exiting - maybe another time? \u{1F44B}`;
|
|
13
15
|
async function bin(args) {
|
|
14
16
|
console.clear();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
logLine();
|
|
23
|
-
logLine(
|
|
17
|
+
const version = await getVersionFromPackageJson();
|
|
18
|
+
const introPrompts = [
|
|
19
|
+
chalk.greenBright(`\u2728 Welcome to`),
|
|
20
|
+
chalk.bgGreenBright.black(`create-typescript-app`),
|
|
21
|
+
chalk.greenBright(`${version}! \u2728`)
|
|
22
|
+
].join(" ");
|
|
23
|
+
const introWarnings = [
|
|
24
24
|
chalk.yellow(
|
|
25
25
|
"\u26A0\uFE0F This template is early stage, opinionated, and not endorsed by the TypeScript team. \u26A0\uFE0F"
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
logLine(
|
|
26
|
+
),
|
|
29
27
|
chalk.yellow(
|
|
30
28
|
"\u26A0\uFE0F If any tooling it sets displeases you, you can always remove that portion manually. \u26A0\uFE0F"
|
|
31
29
|
)
|
|
32
|
-
|
|
30
|
+
];
|
|
33
31
|
const { values } = parseArgs({
|
|
34
32
|
args,
|
|
35
33
|
options: {
|
|
34
|
+
help: {
|
|
35
|
+
short: "h",
|
|
36
|
+
type: "boolean"
|
|
37
|
+
},
|
|
36
38
|
mode: { type: "string" }
|
|
37
39
|
},
|
|
38
40
|
strict: false
|
|
39
41
|
});
|
|
42
|
+
const help = values.help;
|
|
43
|
+
if (help) {
|
|
44
|
+
logHelpText([introPrompts, ...introWarnings]);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
prompts.intro(introPrompts);
|
|
48
|
+
logLine();
|
|
49
|
+
logLine(introWarnings[0]);
|
|
50
|
+
logLine(introWarnings[1]);
|
|
40
51
|
const { mode, options: promptedOptions } = await promptForMode(values.mode);
|
|
41
52
|
if (typeof mode !== "string") {
|
|
42
53
|
prompts.outro(chalk.red(mode?.message ?? operationMessage("cancelled")));
|
package/lib/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? 👋`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\
|
|
1
|
+
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { parseArgs } from \"node:util\";\nimport { fromZodError } from \"zod-validation-error\";\n\nimport { createRerunSuggestion } from \"../create/createRerunSuggestion.js\";\nimport { create } from \"../create/index.js\";\nimport { initialize } from \"../initialize/index.js\";\nimport { migrate } from \"../migrate/index.js\";\nimport { logLine } from \"../shared/cli/lines.js\";\nimport { StatusCodes } from \"../shared/codes.js\";\nimport { logHelpText } from \"./help.js\";\nimport { getVersionFromPackageJson } from \"./packageJson.js\";\nimport { promptForMode } from \"./promptForMode.js\";\n\nconst operationMessage = (verb: string) =>\n\t`Operation ${verb}. Exiting - maybe another time? 👋`;\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tconst version = await getVersionFromPackageJson();\n\n\tconst introPrompts = [\n\t\tchalk.greenBright(`✨ Welcome to`),\n\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\tchalk.greenBright(`${version}! ✨`),\n\t].join(\" \");\n\n\tconst introWarnings = [\n\t\tchalk.yellow(\n\t\t\t\"⚠️ This template is early stage, opinionated, and not endorsed by the TypeScript team. ⚠️\",\n\t\t),\n\t\tchalk.yellow(\n\t\t\t\"⚠️ If any tooling it sets displeases you, you can always remove that portion manually. ⚠️\",\n\t\t),\n\t];\n\n\tconst { values } = parseArgs({\n\t\targs,\n\t\toptions: {\n\t\t\thelp: {\n\t\t\t\tshort: \"h\",\n\t\t\t\ttype: \"boolean\",\n\t\t\t},\n\t\t\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst help = values.help;\n\n\tif (help) {\n\t\tlogHelpText([introPrompts, ...introWarnings]);\n\t\treturn 0;\n\t}\n\n\tprompts.intro(introPrompts);\n\n\tlogLine();\n\tlogLine(introWarnings[0]);\n\tlogLine(introWarnings[1]);\n\n\tconst { mode, options: promptedOptions } = await promptForMode(values.mode);\n\tif (typeof mode !== \"string\") {\n\t\tprompts.outro(chalk.red(mode?.message ?? operationMessage(\"cancelled\")));\n\t\treturn 1;\n\t}\n\n\tconst runners = { create, initialize, migrate };\n\tconst { code, error, options } = await runners[mode](args, promptedOptions);\n\n\tprompts.log.info(\n\t\t[\n\t\t\tchalk.italic(`Tip: to run again with the same input values, use:`),\n\t\t\tchalk.blue(createRerunSuggestion(options)),\n\t\t].join(\" \"),\n\t);\n\n\tif (code) {\n\t\tlogLine();\n\n\t\tif (error) {\n\t\t\tlogLine(\n\t\t\t\tchalk.red(typeof error === \"string\" ? error : fromZodError(error)),\n\t\t\t);\n\t\t\tlogLine();\n\t\t}\n\n\t\tprompts.cancel(\n\t\t\tcode === StatusCodes.Cancelled\n\t\t\t\t? operationMessage(\"cancelled\")\n\t\t\t\t: operationMessage(\"failed\"),\n\t\t);\n\t}\n\n\treturn code;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AACtC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAE9B,MAAM,mBAAmB,CAAC,SACzB,aAAa,IAAI;AAElB,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,QAAM,UAAU,MAAM,0BAA0B;AAEhD,QAAM,eAAe;AAAA,IACpB,MAAM,YAAY,mBAAc;AAAA,IAChC,MAAM,cAAc,MAAM,uBAAuB;AAAA,IACjD,MAAM,YAAY,GAAG,OAAO,UAAK;AAAA,EAClC,EAAE,KAAK,GAAG;AAEV,QAAM,gBAAgB;AAAA,IACrB,MAAM;AAAA,MACL;AAAA,IACD;AAAA,IACA,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACP;AAAA,MACA,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,OAAO;AAEpB,MAAI,MAAM;AACT,gBAAY,CAAC,cAAc,GAAG,aAAa,CAAC;AAC5C,WAAO;AAAA,EACR;AAEA,UAAQ,MAAM,YAAY;AAE1B,UAAQ;AACR,UAAQ,cAAc,CAAC,CAAC;AACxB,UAAQ,cAAc,CAAC,CAAC;AAExB,QAAM,EAAE,MAAM,SAAS,gBAAgB,IAAI,MAAM,cAAc,OAAO,IAAI;AAC1E,MAAI,OAAO,SAAS,UAAU;AAC7B,YAAQ,MAAM,MAAM,IAAI,MAAM,WAAW,iBAAiB,WAAW,CAAC,CAAC;AACvE,WAAO;AAAA,EACR;AAEA,QAAM,UAAU,EAAE,QAAQ,YAAY,QAAQ;AAC9C,QAAM,EAAE,MAAM,OAAO,QAAQ,IAAI,MAAM,QAAQ,IAAI,EAAE,MAAM,eAAe;AAE1E,UAAQ,IAAI;AAAA,IACX;AAAA,MACC,MAAM,OAAO,oDAAoD;AAAA,MACjE,MAAM,KAAK,sBAAsB,OAAO,CAAC;AAAA,IAC1C,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,MAAI,MAAM;AACT,YAAQ;AAER,QAAI,OAAO;AACV;AAAA,QACC,MAAM,IAAI,OAAO,UAAU,WAAW,QAAQ,aAAa,KAAK,CAAC;AAAA,MAClE;AACA,cAAQ;AAAA,IACT;AAEA,YAAQ;AAAA,MACP,SAAS,YAAY,YAClB,iBAAiB,WAAW,IAC5B,iBAAiB,QAAQ;AAAA,IAC7B;AAAA,EACD;AAEA,SAAO;AACR;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readFileSafeAsJson } from "../shared/readFileSafeAsJson.js";
|
|
2
|
+
async function getVersionFromPackageJson() {
|
|
3
|
+
const path = new URL("../../package.json", import.meta.url);
|
|
4
|
+
const data = await readFileSafeAsJson(path);
|
|
5
|
+
if (typeof data === "object" && typeof data.version === "string") {
|
|
6
|
+
return data.version;
|
|
7
|
+
}
|
|
8
|
+
throw new Error("Cannot find version number");
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
getVersionFromPackageJson
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=packageJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/bin/packageJson.ts"],"sourcesContent":["import { readFileSafeAsJson } from \"../shared/readFileSafeAsJson.js\";\n\ninterface PackageWithVersion {\n\tversion?: string;\n}\n\nexport async function getVersionFromPackageJson(): Promise<string> {\n\tconst path = new URL(\"../../package.json\", import.meta.url);\n\tconst data = (await readFileSafeAsJson(path)) as PackageWithVersion;\n\n\tif (typeof data === \"object\" && typeof data.version === \"string\") {\n\t\treturn data.version;\n\t}\n\n\tthrow new Error(\"Cannot find version number\");\n}\n"],"mappings":"AAAA,SAAS,0BAA0B;AAMnC,eAAsB,4BAA6C;AAClE,QAAM,OAAO,IAAI,IAAI,sBAAsB,YAAY,GAAG;AAC1D,QAAM,OAAQ,MAAM,mBAAmB,IAAI;AAE3C,MAAI,OAAO,SAAS,YAAY,OAAO,KAAK,YAAY,UAAU;AACjE,WAAO,KAAK;AAAA,EACb;AAEA,QAAM,IAAI,MAAM,4BAA4B;AAC7C;","names":[]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { allArgOptions } from "../shared/options/args.js";
|
|
2
|
+
import {
|
|
3
|
+
getExclusions
|
|
4
|
+
} from "../shared/options/augmentOptionsWithExcludes.js";
|
|
2
5
|
function getFirstMatchingArg(key) {
|
|
3
6
|
return Object.keys(allArgOptions).find(
|
|
4
7
|
(arg) => arg.replaceAll("-", "") === key.toLowerCase()
|
|
@@ -23,7 +26,9 @@ function createRerunSuggestion(options) {
|
|
|
23
26
|
};
|
|
24
27
|
const args = Object.entries(optionsNormalized).sort(
|
|
25
28
|
([a], [b]) => a === "base" ? -1 : b === "base" ? 1 : a.localeCompare(b)
|
|
26
|
-
).filter(
|
|
29
|
+
).filter(
|
|
30
|
+
([key, value]) => getExclusions(options, optionsNormalized.base)[key] == void 0 && !!value
|
|
31
|
+
).map(([key, value]) => {
|
|
27
32
|
return `--${getFirstMatchingArg(key)} ${stringifyValue(value)}`;
|
|
28
33
|
}).join(" ");
|
|
29
34
|
return `npx create-typescript-app --mode ${options.mode} ${args}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t }\n\t\t\t: { guide: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t.filter(([, value])
|
|
1
|
+
{"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { allArgOptions } from \"../shared/options/args.js\";\nimport {\n\tExclusionKey,\n\tgetExclusions,\n} from \"../shared/options/augmentOptionsWithExcludes.js\";\nimport { Options } from \"../shared/types.js\";\n\nfunction getFirstMatchingArg(key: string) {\n\treturn Object.keys(allArgOptions).find(\n\t\t(arg) => arg.replaceAll(\"-\", \"\") === key.toLowerCase(),\n\t);\n}\n\nexport function createRerunSuggestion(options: Partial<Options>): string {\n\tconst optionsNormalized = {\n\t\t...options,\n\t\temail: undefined,\n\t\t...(options.email && {\n\t\t\temailGitHub: options.email.github,\n\t\t\temailNpm: options.email.npm,\n\t\t}),\n\t\t...(options.guide\n\t\t\t? {\n\t\t\t\t\tguide: options.guide.href,\n\t\t\t\t\tguideTitle: options.guide.title,\n\t\t\t }\n\t\t\t: { guide: undefined }),\n\t\t...(options.logo\n\t\t\t? {\n\t\t\t\t\tlogo: options.logo.src,\n\t\t\t\t\tlogoAlt: options.logo.alt,\n\t\t\t }\n\t\t\t: { logo: undefined }),\n\t};\n\n\tconst args = Object.entries(optionsNormalized)\n\t\t// Sort so the base is first, then the rest are sorted alphabetically\n\t\t.sort(([a], [b]) =>\n\t\t\ta === \"base\" ? -1 : b === \"base\" ? 1 : a.localeCompare(b),\n\t\t)\n\t\t// Filter out all entries that have a key in the excluded object or have a falsy value\n\t\t.filter(\n\t\t\t([key, value]) =>\n\t\t\t\tgetExclusions(options, optionsNormalized.base)[key as ExclusionKey] ==\n\t\t\t\t\tundefined && !!value,\n\t\t)\n\t\t.map(([key, value]) => {\n\t\t\treturn `--${getFirstMatchingArg(key)} ${stringifyValue(value)}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn `npx create-typescript-app --mode ${options.mode} ${args}`;\n}\n\nfunction stringifyValue(\n\tvalue: boolean | string | string[] | undefined,\n): string {\n\tif (Array.isArray(value)) {\n\t\treturn stringifyValue(value.join(\" \"));\n\t}\n\n\tconst valueStringified = `${value}`;\n\n\treturn valueStringified.includes(\" \")\n\t\t? `\"${valueStringified}\"`\n\t\t: valueStringified;\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OACM;AAGP,SAAS,oBAAoB,KAAa;AACzC,SAAO,OAAO,KAAK,aAAa,EAAE;AAAA,IACjC,CAAC,QAAQ,IAAI,WAAW,KAAK,EAAE,MAAM,IAAI,YAAY;AAAA,EACtD;AACD;AAEO,SAAS,sBAAsB,SAAmC;AACxE,QAAM,oBAAoB;AAAA,IACzB,GAAG;AAAA,IACH,OAAO;AAAA,IACP,GAAI,QAAQ,SAAS;AAAA,MACpB,aAAa,QAAQ,MAAM;AAAA,MAC3B,UAAU,QAAQ,MAAM;AAAA,IACzB;AAAA,IACA,GAAI,QAAQ,QACT;AAAA,MACA,OAAO,QAAQ,MAAM;AAAA,MACrB,YAAY,QAAQ,MAAM;AAAA,IAC1B,IACA,EAAE,OAAO,OAAU;AAAA,IACtB,GAAI,QAAQ,OACT;AAAA,MACA,MAAM,QAAQ,KAAK;AAAA,MACnB,SAAS,QAAQ,KAAK;AAAA,IACtB,IACA,EAAE,MAAM,OAAU;AAAA,EACtB;AAEA,QAAM,OAAO,OAAO,QAAQ,iBAAiB,EAE3C;AAAA,IAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MACb,MAAM,SAAS,KAAK,MAAM,SAAS,IAAI,EAAE,cAAc,CAAC;AAAA,EACzD,EAEC;AAAA,IACA,CAAC,CAAC,KAAK,KAAK,MACX,cAAc,SAAS,kBAAkB,IAAI,EAAE,GAAmB,KACjE,UAAa,CAAC,CAAC;AAAA,EAClB,EACC,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,WAAO,KAAK,oBAAoB,GAAG,CAAC,IAAI,eAAe,KAAK,CAAC;AAAA,EAC9D,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,oCAAoC,QAAQ,IAAI,IAAI,IAAI;AAChE;AAEA,SAAS,eACR,OACS;AACT,MAAI,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,eAAe,MAAM,KAAK,GAAG,CAAC;AAAA,EACtC;AAEA,QAAM,mBAAmB,GAAG,KAAK;AAEjC,SAAO,iBAAiB,SAAS,GAAG,IACjC,IAAI,gBAAgB,MACpB;AACJ;","names":[]}
|
|
@@ -1,138 +1,228 @@
|
|
|
1
1
|
declare const allArgOptions: {
|
|
2
2
|
readonly access: {
|
|
3
|
+
readonly description: `(${string}): Which ${string} to \n release npm packages with (by default, "public")`;
|
|
4
|
+
readonly docsSection: "optional";
|
|
3
5
|
readonly type: "string";
|
|
4
6
|
};
|
|
5
7
|
readonly author: {
|
|
8
|
+
readonly description: `Username on npm to publish packages under (by \n default, an existing npm author, or the currently logged in npm user, or \n ${string})`;
|
|
9
|
+
readonly docsSection: "optional";
|
|
6
10
|
readonly type: "string";
|
|
7
11
|
};
|
|
8
12
|
readonly base: {
|
|
13
|
+
readonly description: `Whether to scaffold the repository with:\n \u2022 everything: that comes with the template (${string})\n \u2022 minimum: amounts of tooling, essentially opting out of everything\n \u2022 prompt: for which portions to exclude`;
|
|
14
|
+
readonly docsSection: "core";
|
|
9
15
|
readonly type: "string";
|
|
10
16
|
};
|
|
17
|
+
readonly "create-repository": {
|
|
18
|
+
readonly description: "Whether to create a corresponding repository on github.com \n (if it doesn't yet exist)";
|
|
19
|
+
readonly docsSection: "core";
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
};
|
|
11
22
|
readonly description: {
|
|
23
|
+
readonly description: "Sentence case description of the repository \n (e.g. A quickstart-friendly TypeScript package with lots of great \n repository tooling. ✨)";
|
|
24
|
+
readonly docsSection: "core";
|
|
12
25
|
readonly type: "string";
|
|
13
26
|
};
|
|
14
27
|
readonly directory: {
|
|
28
|
+
readonly description: "Directory to create the repository in (by default, the same \n name as the repository)";
|
|
29
|
+
readonly docsSection: "optional";
|
|
15
30
|
readonly type: "string";
|
|
16
31
|
};
|
|
17
32
|
readonly email: {
|
|
33
|
+
readonly description: "Email address to be listed as the point of contact in docs \n and packages (e.g. example@joshuakgoldberg.com)";
|
|
34
|
+
readonly docsSection: "optional";
|
|
18
35
|
readonly type: "string";
|
|
19
36
|
};
|
|
20
37
|
readonly "email-github": {
|
|
38
|
+
readonly description: `Optionally, may be provided to use different emails in ${string} \n files`;
|
|
39
|
+
readonly docsSection: "optional";
|
|
21
40
|
readonly type: "string";
|
|
22
41
|
};
|
|
23
42
|
readonly "email-npm": {
|
|
43
|
+
readonly description: `Optionally, may be provided to use different emails in \n ${string}`;
|
|
44
|
+
readonly docsSection: "optional";
|
|
24
45
|
readonly type: "string";
|
|
25
46
|
};
|
|
26
47
|
readonly "exclude-all-contributors": {
|
|
48
|
+
readonly description: "Don't add all-contributors to track contributions \n and display them in a README.md table.";
|
|
49
|
+
readonly docsSection: "opt-out";
|
|
27
50
|
readonly type: "boolean";
|
|
28
51
|
};
|
|
29
52
|
readonly "exclude-compliance": {
|
|
53
|
+
readonly description: "Don't add a GitHub Actions workflow to verify that PRs match \n an expected format.";
|
|
54
|
+
readonly docsSection: "opt-out";
|
|
30
55
|
readonly type: "boolean";
|
|
31
56
|
};
|
|
32
57
|
readonly "exclude-lint-deprecation": {
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
readonly "exclude-lint-eslint": {
|
|
58
|
+
readonly description: `Don't use eslint-plugin-deprecation to report on usage \n of code marked as ${string}.`;
|
|
59
|
+
readonly docsSection: "opt-out";
|
|
36
60
|
readonly type: "boolean";
|
|
37
61
|
};
|
|
38
62
|
readonly "exclude-lint-jsdoc": {
|
|
63
|
+
readonly description: "Don't use eslint-plugin-jsdoc to enforce good practices around \n JSDoc comments.";
|
|
64
|
+
readonly docsSection: "opt-out";
|
|
39
65
|
readonly type: "boolean";
|
|
40
66
|
};
|
|
41
67
|
readonly "exclude-lint-json": {
|
|
68
|
+
readonly description: `Don't apply linting and sorting to ${string}, and \n ${string} files.`;
|
|
69
|
+
readonly docsSection: "opt-out";
|
|
42
70
|
readonly type: "boolean";
|
|
43
71
|
};
|
|
44
72
|
readonly "exclude-lint-knip": {
|
|
73
|
+
readonly description: "Don't add Knip to detect unused files, dependencies, and code \n exports.";
|
|
74
|
+
readonly docsSection: "opt-out";
|
|
45
75
|
readonly type: "boolean";
|
|
46
76
|
};
|
|
47
77
|
readonly "exclude-lint-md": {
|
|
78
|
+
readonly description: `Don't apply linting to ${string} files.`;
|
|
79
|
+
readonly docsSection: "opt-out";
|
|
48
80
|
readonly type: "boolean";
|
|
49
81
|
};
|
|
50
82
|
readonly "exclude-lint-package-json": {
|
|
83
|
+
readonly description: "Don't add npm-package-json-lint to lint for \n package.json correctness.";
|
|
84
|
+
readonly docsSection: "opt-out";
|
|
51
85
|
readonly type: "boolean";
|
|
52
86
|
};
|
|
53
87
|
readonly "exclude-lint-packages": {
|
|
88
|
+
readonly description: "Don't add a pnpm dedupe workflow to ensure packages \n aren't duplicated unnecessarily.";
|
|
89
|
+
readonly docsSection: "opt-out";
|
|
54
90
|
readonly type: "boolean";
|
|
55
91
|
};
|
|
56
92
|
readonly "exclude-lint-perfectionist": {
|
|
93
|
+
readonly description: "Don't apply eslint-plugin-perfectionist to ensure \n imports, keys, and so on are in sorted order.";
|
|
94
|
+
readonly docsSection: "opt-out";
|
|
57
95
|
readonly type: "boolean";
|
|
58
96
|
};
|
|
59
97
|
readonly "exclude-lint-regex": {
|
|
98
|
+
readonly description: "Don't add eslint-plugin-regex to enforce good practices around \n regular expressions.";
|
|
99
|
+
readonly docsSection: "opt-out";
|
|
60
100
|
readonly type: "boolean";
|
|
61
101
|
};
|
|
62
102
|
readonly "exclude-lint-spelling": {
|
|
103
|
+
readonly description: "Don't add cspell to spell check against dictionaries \n of known words.";
|
|
104
|
+
readonly docsSection: "opt-out";
|
|
63
105
|
readonly type: "boolean";
|
|
64
106
|
};
|
|
65
107
|
readonly "exclude-lint-strict": {
|
|
108
|
+
readonly description: "Don't augment the recommended logical lint rules with \n typescript-eslint's strict config.";
|
|
109
|
+
readonly docsSection: "opt-out";
|
|
66
110
|
readonly type: "boolean";
|
|
67
111
|
};
|
|
68
112
|
readonly "exclude-lint-stylistic": {
|
|
113
|
+
readonly description: "Don't add stylistic rules such as typescript-eslint's \n stylistic config.";
|
|
114
|
+
readonly docsSection: "opt-out";
|
|
69
115
|
readonly type: "boolean";
|
|
70
116
|
};
|
|
71
117
|
readonly "exclude-lint-yml": {
|
|
118
|
+
readonly description: `Don't apply linting and sorting to ${string} and ${string} files.`;
|
|
119
|
+
readonly docsSection: "opt-out";
|
|
72
120
|
readonly type: "boolean";
|
|
73
121
|
};
|
|
74
122
|
readonly "exclude-releases": {
|
|
123
|
+
readonly description: "Don't add release-it to generate changelogs, package bumps, \n and publishes based on conventional commits.";
|
|
124
|
+
readonly docsSection: "opt-out";
|
|
75
125
|
readonly type: "boolean";
|
|
76
126
|
};
|
|
77
127
|
readonly "exclude-renovate": {
|
|
128
|
+
readonly description: "Don't add a Renovate config to dependencies up-to-date with \n PRs.";
|
|
129
|
+
readonly docsSection: "opt-out";
|
|
78
130
|
readonly type: "boolean";
|
|
79
131
|
};
|
|
80
132
|
readonly "exclude-tests": {
|
|
133
|
+
readonly description: "Don't add Vitest tooling for fast unit tests, configured \n with coverage tracking.";
|
|
134
|
+
readonly docsSection: "opt-out";
|
|
81
135
|
readonly type: "boolean";
|
|
82
136
|
};
|
|
83
137
|
readonly funding: {
|
|
138
|
+
readonly description: `GitHub organization or username to mention in ${string} \n (by default, owner)`;
|
|
139
|
+
readonly docsSection: "optional";
|
|
84
140
|
readonly type: "string";
|
|
85
141
|
};
|
|
86
142
|
readonly guide: {
|
|
143
|
+
readonly description: "Link to a contribution guide to place at the top of the \n development docs";
|
|
144
|
+
readonly docsSection: "optional";
|
|
87
145
|
readonly type: "string";
|
|
88
146
|
};
|
|
89
147
|
readonly "guide-title": {
|
|
148
|
+
readonly description: `If ${string} is provided or detected from an existing \n DEVELOPMENT.md, the text title to place in the guide link`;
|
|
149
|
+
readonly docsSection: "optional";
|
|
90
150
|
readonly type: "string";
|
|
91
151
|
};
|
|
92
152
|
readonly keywords: {
|
|
153
|
+
readonly description: `Any number of keywords to include in ${string} (by default, \n none). This can be specified any number of times, like \n ${string}`;
|
|
154
|
+
readonly docsSection: "optional";
|
|
93
155
|
readonly multiple: true;
|
|
94
156
|
readonly type: "string";
|
|
95
157
|
};
|
|
96
158
|
readonly logo: {
|
|
159
|
+
readonly description: "Local image file in the repository to display near the top of \n the README.md as a logo";
|
|
160
|
+
readonly docsSection: "optional";
|
|
97
161
|
readonly type: "string";
|
|
98
162
|
};
|
|
99
163
|
readonly "logo-alt": {
|
|
164
|
+
readonly description: `If ${string} is provided or detected from an existing README.md, \n alt text that describes the image will be prompted for if not provided`;
|
|
165
|
+
readonly docsSection: "optional";
|
|
100
166
|
readonly type: "string";
|
|
101
167
|
};
|
|
102
168
|
readonly mode: {
|
|
169
|
+
readonly description: "Whether to:\n • create: a new repository in a child directory\n • initialize: a freshly repository in the current directory\n • migrate: an existing repository in the current directory";
|
|
170
|
+
readonly docsSection: "core";
|
|
103
171
|
readonly type: "string";
|
|
104
172
|
};
|
|
105
173
|
readonly offline: {
|
|
174
|
+
readonly description: `You can run ${string} in an "offline" mode. \n Doing so will:\n \u2022 Enable ${string} and ${string}\n \u2022 Skip network calls when setting up contributors\n \u2022 Run pnpm commands with pnpm's ${string} mode`;
|
|
175
|
+
readonly docsSection: "offline";
|
|
106
176
|
readonly type: "boolean";
|
|
107
177
|
};
|
|
108
178
|
readonly owner: {
|
|
179
|
+
readonly description: "GitHub organization or user the repository is underneath \n (e.g. JoshuaKGoldberg)";
|
|
180
|
+
readonly docsSection: "core";
|
|
109
181
|
readonly type: "string";
|
|
110
182
|
};
|
|
111
|
-
readonly "preserve-generated-
|
|
183
|
+
readonly "preserve-generated-form": {
|
|
184
|
+
readonly description: "Whether to keep the GitHub repository generated from \n notice (by default, false)";
|
|
185
|
+
readonly docsSection: "optional";
|
|
112
186
|
readonly type: "boolean";
|
|
113
187
|
};
|
|
114
188
|
readonly repository: {
|
|
189
|
+
readonly description: "The kebab-case name of the repository \n (e.g. create-typescript-app)";
|
|
190
|
+
readonly docsSection: "core";
|
|
115
191
|
readonly type: "string";
|
|
116
192
|
};
|
|
117
193
|
readonly "skip-all-contributors-api": {
|
|
194
|
+
readonly description: `Skips network calls that fetch all-contributors data from\n GitHub. This flag does nothing if ${string} was specified.`;
|
|
195
|
+
readonly docsSection: "skip-net";
|
|
118
196
|
readonly type: "boolean";
|
|
119
197
|
};
|
|
120
198
|
readonly "skip-github-api": {
|
|
199
|
+
readonly description: "Skips calling to GitHub APIs.";
|
|
200
|
+
readonly docsSection: "skip-net";
|
|
121
201
|
readonly type: "boolean";
|
|
122
202
|
};
|
|
123
203
|
readonly "skip-install": {
|
|
204
|
+
readonly description: "Skips installing all the new template packages with pnpm.";
|
|
205
|
+
readonly docsSection: "skip-net";
|
|
124
206
|
readonly type: "boolean";
|
|
125
207
|
};
|
|
126
208
|
readonly "skip-removal": {
|
|
209
|
+
readonly description: `Skips removing setup docs and scripts, including this ${string} \n directory`;
|
|
210
|
+
readonly docsSection: "skip-disk";
|
|
127
211
|
readonly type: "boolean";
|
|
128
212
|
};
|
|
129
213
|
readonly "skip-restore": {
|
|
214
|
+
readonly description: "Skips the prompt offering to restore the repository if an \n error occurs during setup";
|
|
215
|
+
readonly docsSection: "skip-disk";
|
|
130
216
|
readonly type: "boolean";
|
|
131
217
|
};
|
|
132
218
|
readonly "skip-uninstall": {
|
|
219
|
+
readonly description: "Skips uninstalling packages only used for setup scripts";
|
|
220
|
+
readonly docsSection: "skip-disk";
|
|
133
221
|
readonly type: "boolean";
|
|
134
222
|
};
|
|
135
223
|
readonly title: {
|
|
224
|
+
readonly description: "Title Case title for the repository to be used in \n documentation (e.g. Create TypeScript App)";
|
|
225
|
+
readonly docsSection: "core";
|
|
136
226
|
readonly type: "string";
|
|
137
227
|
};
|
|
138
228
|
};
|