create-typescript-app 0.1.1 → 1.29.14

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.
Files changed (272) hide show
  1. package/LICENSE.md +17 -5
  2. package/README.md +118 -0
  3. package/bin/index.js +4 -0
  4. package/lib/bin/index.d.ts +3 -0
  5. package/lib/bin/index.js +52 -0
  6. package/lib/bin/index.js.map +1 -0
  7. package/lib/bin/mode.d.ts +4 -0
  8. package/lib/bin/mode.js +43 -0
  9. package/lib/bin/mode.js.map +1 -0
  10. package/lib/create/createRerunSuggestion.d.ts +6 -0
  11. package/lib/create/createRerunSuggestion.js +17 -0
  12. package/lib/create/createRerunSuggestion.js.map +1 -0
  13. package/lib/create/createWithOptions.d.ts +9 -0
  14. package/lib/create/createWithOptions.js +62 -0
  15. package/lib/create/createWithOptions.js.map +1 -0
  16. package/lib/create/index.d.ts +3 -0
  17. package/lib/create/index.js +64 -0
  18. package/lib/create/index.js.map +1 -0
  19. package/lib/greet.d.ts +5 -0
  20. package/lib/greet.js +14 -0
  21. package/lib/greet.js.map +1 -0
  22. package/lib/index.d.ts +2 -0
  23. package/lib/index.js +3 -0
  24. package/lib/index.js.map +1 -0
  25. package/lib/initialize/index.d.ts +3 -0
  26. package/lib/initialize/index.js +32 -0
  27. package/lib/initialize/index.js.map +1 -0
  28. package/lib/initialize/initializeWithOptions.d.ts +7 -0
  29. package/lib/initialize/initializeWithOptions.js +60 -0
  30. package/lib/initialize/initializeWithOptions.js.map +1 -0
  31. package/lib/migrate/index.d.ts +3 -0
  32. package/lib/migrate/index.js +29 -0
  33. package/lib/migrate/index.js.map +1 -0
  34. package/lib/migrate/migrateWithOptions.d.ts +7 -0
  35. package/lib/migrate/migrateWithOptions.js +67 -0
  36. package/lib/migrate/migrateWithOptions.js.map +1 -0
  37. package/lib/shared/cli/lines.d.ts +5 -0
  38. package/lib/shared/cli/lines.js +17 -0
  39. package/lib/shared/cli/lines.js.map +1 -0
  40. package/lib/shared/cli/lowerFirst.d.ts +3 -0
  41. package/lib/shared/cli/lowerFirst.js +7 -0
  42. package/lib/shared/cli/lowerFirst.js.map +1 -0
  43. package/lib/shared/cli/outro.d.ts +7 -0
  44. package/lib/shared/cli/outro.js +21 -0
  45. package/lib/shared/cli/outro.js.map +1 -0
  46. package/lib/shared/cli/spinners.d.ts +6 -0
  47. package/lib/shared/cli/spinners.js +49 -0
  48. package/lib/shared/cli/spinners.js.map +1 -0
  49. package/lib/shared/cli/startLineWithDots.d.ts +3 -0
  50. package/lib/shared/cli/startLineWithDots.js +31 -0
  51. package/lib/shared/cli/startLineWithDots.js.map +1 -0
  52. package/lib/shared/doesRepositoryExist.d.ts +9 -0
  53. package/lib/shared/doesRepositoryExist.js +18 -0
  54. package/lib/shared/doesRepositoryExist.js.map +1 -0
  55. package/lib/shared/ensureGitRepository.d.ts +3 -0
  56. package/lib/shared/ensureGitRepository.js +12 -0
  57. package/lib/shared/ensureGitRepository.js.map +1 -0
  58. package/lib/shared/getGitHubUserAsAllContributor.d.ts +3 -0
  59. package/lib/shared/getGitHubUserAsAllContributor.js +31 -0
  60. package/lib/shared/getGitHubUserAsAllContributor.js.map +1 -0
  61. package/lib/shared/options/args.d.ts +85 -0
  62. package/lib/shared/options/args.js +33 -0
  63. package/lib/shared/options/args.js.map +1 -0
  64. package/lib/shared/options/augmentOptionsWithExcludes.d.ts +5 -0
  65. package/lib/shared/options/augmentOptionsWithExcludes.js +126 -0
  66. package/lib/shared/options/augmentOptionsWithExcludes.js.map +1 -0
  67. package/lib/shared/options/ensureRepositoryExists.d.ts +11 -0
  68. package/lib/shared/options/ensureRepositoryExists.js +58 -0
  69. package/lib/shared/options/ensureRepositoryExists.js.map +1 -0
  70. package/lib/shared/options/getOctokit.d.ts +5 -0
  71. package/lib/shared/options/getOctokit.js +17 -0
  72. package/lib/shared/options/getOctokit.js.map +1 -0
  73. package/lib/shared/options/getPrefillOrPromptedOption.d.ts +3 -0
  74. package/lib/shared/options/getPrefillOrPromptedOption.js +23 -0
  75. package/lib/shared/options/getPrefillOrPromptedOption.js.map +1 -0
  76. package/lib/shared/options/optionalDefault.d.ts +3 -0
  77. package/lib/shared/options/optionalDefault.js +13 -0
  78. package/lib/shared/options/optionalDefault.js.map +1 -0
  79. package/lib/shared/options/readGitAndNpmDefaults/index.d.ts +11 -0
  80. package/lib/shared/options/readGitAndNpmDefaults/index.js +36 -0
  81. package/lib/shared/options/readGitAndNpmDefaults/index.js.map +1 -0
  82. package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.d.ts +8 -0
  83. package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js +14 -0
  84. package/lib/shared/options/readGitAndNpmDefaults/parsePackageAuthor.js.map +1 -0
  85. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.d.ts +3 -0
  86. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js +8 -0
  87. package/lib/shared/options/readGitAndNpmDefaults/readTitleFromReadme.js.map +1 -0
  88. package/lib/shared/options/readOptions.d.ts +10 -0
  89. package/lib/shared/options/readOptions.js +83 -0
  90. package/lib/shared/options/readOptions.js.map +1 -0
  91. package/lib/shared/packages.d.ts +6 -0
  92. package/lib/shared/packages.js +20 -0
  93. package/lib/shared/packages.js.map +1 -0
  94. package/lib/shared/prompts.d.ts +4 -0
  95. package/lib/shared/prompts.js +16 -0
  96. package/lib/shared/prompts.js.map +1 -0
  97. package/lib/shared/readFileAsJson.d.ts +3 -0
  98. package/lib/shared/readFileAsJson.js +15 -0
  99. package/lib/shared/readFileAsJson.js.map +1 -0
  100. package/lib/shared/readFileSafe.d.ts +3 -0
  101. package/lib/shared/readFileSafe.js +12 -0
  102. package/lib/shared/readFileSafe.js.map +1 -0
  103. package/lib/shared/readFileSafeAsJson.d.ts +3 -0
  104. package/lib/shared/readFileSafeAsJson.js +8 -0
  105. package/lib/shared/readFileSafeAsJson.js.map +1 -0
  106. package/lib/shared/runOrRestore.d.ts +7 -0
  107. package/lib/shared/runOrRestore.js +41 -0
  108. package/lib/shared/runOrRestore.js.map +1 -0
  109. package/lib/shared/tryCatchAsync.d.ts +3 -0
  110. package/lib/shared/tryCatchAsync.js +11 -0
  111. package/lib/shared/tryCatchAsync.js.map +1 -0
  112. package/lib/shared/types.d.ts +54 -0
  113. package/lib/shared/types.js +1 -0
  114. package/lib/shared/types.js.map +1 -0
  115. package/lib/steps/addOwnerAsAllContributor.d.ts +3 -0
  116. package/lib/steps/addOwnerAsAllContributor.js +41 -0
  117. package/lib/steps/addOwnerAsAllContributor.js.map +1 -0
  118. package/lib/steps/addToolAllContributors.d.ts +3 -0
  119. package/lib/steps/addToolAllContributors.js +12 -0
  120. package/lib/steps/addToolAllContributors.js.map +1 -0
  121. package/lib/steps/clearChangelog.d.ts +3 -0
  122. package/lib/steps/clearChangelog.js +12 -0
  123. package/lib/steps/clearChangelog.js.map +1 -0
  124. package/lib/steps/clearUnnecessaryFiles.d.ts +3 -0
  125. package/lib/steps/clearUnnecessaryFiles.js +33 -0
  126. package/lib/steps/clearUnnecessaryFiles.js.map +1 -0
  127. package/lib/steps/detectExistingContributors.d.ts +3 -0
  128. package/lib/steps/detectExistingContributors.js +16 -0
  129. package/lib/steps/detectExistingContributors.js.map +1 -0
  130. package/lib/steps/finalizeDependencies.d.ts +5 -0
  131. package/lib/steps/finalizeDependencies.js +59 -0
  132. package/lib/steps/finalizeDependencies.js.map +1 -0
  133. package/lib/steps/initializeGitHubRepository/index.d.ts +6 -0
  134. package/lib/steps/initializeGitHubRepository/index.js +14 -0
  135. package/lib/steps/initializeGitHubRepository/index.js.map +1 -0
  136. package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.d.ts +6 -0
  137. package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js +46 -0
  138. package/lib/steps/initializeGitHubRepository/initializeBranchProtectionSettings.js.map +1 -0
  139. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.d.ts +3 -0
  140. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js +14 -0
  141. package/lib/steps/initializeGitHubRepository/labels/getExistingEquivalentLabel.js.map +1 -0
  142. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.d.ts +3 -0
  143. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js +31 -0
  144. package/lib/steps/initializeGitHubRepository/labels/initializeRepositoryLabels.js.map +1 -0
  145. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.d.ts +7 -0
  146. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js +86 -0
  147. package/lib/steps/initializeGitHubRepository/labels/outcomeLabels.js.map +1 -0
  148. package/lib/steps/initializeGitRemote.d.ts +6 -0
  149. package/lib/steps/initializeGitRemote.js +15 -0
  150. package/lib/steps/initializeGitRemote.js.map +1 -0
  151. package/lib/steps/initializeRepositorySettings.d.ts +7 -0
  152. package/lib/steps/initializeRepositorySettings.js +27 -0
  153. package/lib/steps/initializeRepositorySettings.js.map +1 -0
  154. package/lib/steps/removeSetupScripts.d.ts +3 -0
  155. package/lib/steps/removeSetupScripts.js +23 -0
  156. package/lib/steps/removeSetupScripts.js.map +1 -0
  157. package/lib/steps/resetGitTags.d.ts +3 -0
  158. package/lib/steps/resetGitTags.js +12 -0
  159. package/lib/steps/resetGitTags.js.map +1 -0
  160. package/lib/steps/runCommands.d.ts +3 -0
  161. package/lib/steps/runCommands.js +33 -0
  162. package/lib/steps/runCommands.js.map +1 -0
  163. package/lib/steps/uninstallPackages.d.ts +3 -0
  164. package/lib/steps/uninstallPackages.js +41 -0
  165. package/lib/steps/uninstallPackages.js.map +1 -0
  166. package/lib/steps/updateAllContributorsTable.d.ts +5 -0
  167. package/lib/steps/updateAllContributorsTable.js +27 -0
  168. package/lib/steps/updateAllContributorsTable.js.map +1 -0
  169. package/lib/steps/updateLocalFiles.d.ts +5 -0
  170. package/lib/steps/updateLocalFiles.js +58 -0
  171. package/lib/steps/updateLocalFiles.js.map +1 -0
  172. package/lib/steps/updateReadme.d.ts +4 -0
  173. package/lib/steps/updateReadme.js +17 -0
  174. package/lib/steps/updateReadme.js.map +1 -0
  175. package/lib/steps/writeReadme.d.ts +5 -0
  176. package/lib/steps/writeReadme.js +87 -0
  177. package/lib/steps/writeReadme.js.map +1 -0
  178. package/lib/steps/writing/creation/createESLintRC.d.ts +5 -0
  179. package/lib/steps/writing/creation/createESLintRC.js +163 -0
  180. package/lib/steps/writing/creation/createESLintRC.js.map +1 -0
  181. package/lib/steps/writing/creation/dotGitHub/actions.d.ts +7 -0
  182. package/lib/steps/writing/creation/dotGitHub/actions.js +29 -0
  183. package/lib/steps/writing/creation/dotGitHub/actions.js.map +1 -0
  184. package/lib/steps/writing/creation/dotGitHub/createDevelopment.d.ts +5 -0
  185. package/lib/steps/writing/creation/dotGitHub/createDevelopment.js +96 -0
  186. package/lib/steps/writing/creation/dotGitHub/createDevelopment.js.map +1 -0
  187. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.d.ts +14 -0
  188. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js +282 -0
  189. package/lib/steps/writing/creation/dotGitHub/createDotGitHubFiles.js.map +1 -0
  190. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.d.ts +49 -0
  191. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js +34 -0
  192. package/lib/steps/writing/creation/dotGitHub/createWorkflowFile.js.map +1 -0
  193. package/lib/steps/writing/creation/dotGitHub/index.d.ts +41 -0
  194. package/lib/steps/writing/creation/dotGitHub/index.js +16 -0
  195. package/lib/steps/writing/creation/dotGitHub/index.js.map +1 -0
  196. package/lib/steps/writing/creation/dotGitHub/issueTemplate.d.ts +10 -0
  197. package/lib/steps/writing/creation/dotGitHub/issueTemplate.js +202 -0
  198. package/lib/steps/writing/creation/dotGitHub/issueTemplate.js.map +1 -0
  199. package/lib/steps/writing/creation/dotGitHub/workflows.d.ts +20 -0
  200. package/lib/steps/writing/creation/dotGitHub/workflows.js +280 -0
  201. package/lib/steps/writing/creation/dotGitHub/workflows.js.map +1 -0
  202. package/lib/steps/writing/creation/dotHusky.d.ts +6 -0
  203. package/lib/steps/writing/creation/dotHusky.js +15 -0
  204. package/lib/steps/writing/creation/dotHusky.js.map +1 -0
  205. package/lib/steps/writing/creation/dotVSCode.d.ts +9 -0
  206. package/lib/steps/writing/creation/dotVSCode.js +55 -0
  207. package/lib/steps/writing/creation/dotVSCode.js.map +1 -0
  208. package/lib/steps/writing/creation/formatters/formatIgnoreFile.d.ts +3 -0
  209. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js +7 -0
  210. package/lib/steps/writing/creation/formatters/formatIgnoreFile.js.map +1 -0
  211. package/lib/steps/writing/creation/formatters/formatJson.d.ts +3 -0
  212. package/lib/steps/writing/creation/formatters/formatJson.js +17 -0
  213. package/lib/steps/writing/creation/formatters/formatJson.js.map +1 -0
  214. package/lib/steps/writing/creation/formatters/formatTypeScript.d.ts +3 -0
  215. package/lib/steps/writing/creation/formatters/formatTypeScript.js +8 -0
  216. package/lib/steps/writing/creation/formatters/formatTypeScript.js.map +1 -0
  217. package/lib/steps/writing/creation/formatters/formatYaml.d.ts +3 -0
  218. package/lib/steps/writing/creation/formatters/formatYaml.js +23 -0
  219. package/lib/steps/writing/creation/formatters/formatYaml.js.map +1 -0
  220. package/lib/steps/writing/creation/index.d.ts +6 -0
  221. package/lib/steps/writing/creation/index.js +18 -0
  222. package/lib/steps/writing/creation/index.js.map +1 -0
  223. package/lib/steps/writing/creation/rootFiles.d.ts +25 -0
  224. package/lib/steps/writing/creation/rootFiles.js +202 -0
  225. package/lib/steps/writing/creation/rootFiles.js.map +1 -0
  226. package/lib/steps/writing/creation/src.d.ts +10 -0
  227. package/lib/steps/writing/creation/src.js +90 -0
  228. package/lib/steps/writing/creation/src.js.map +1 -0
  229. package/lib/steps/writing/creation/writeAllContributorsRC.d.ts +5 -0
  230. package/lib/steps/writing/creation/writeAllContributorsRC.js +25 -0
  231. package/lib/steps/writing/creation/writeAllContributorsRC.js.map +1 -0
  232. package/lib/steps/writing/creation/writePackageJson.d.ts +5 -0
  233. package/lib/steps/writing/creation/writePackageJson.js +98 -0
  234. package/lib/steps/writing/creation/writePackageJson.js.map +1 -0
  235. package/lib/steps/writing/types.d.ts +5 -0
  236. package/lib/steps/writing/types.js +1 -0
  237. package/lib/steps/writing/types.js.map +1 -0
  238. package/lib/steps/writing/writeStructure.d.ts +5 -0
  239. package/lib/steps/writing/writeStructure.js +11 -0
  240. package/lib/steps/writing/writeStructure.js.map +1 -0
  241. package/lib/steps/writing/writeStructureWorker.d.ts +5 -0
  242. package/lib/steps/writing/writeStructureWorker.js +47 -0
  243. package/lib/steps/writing/writeStructureWorker.js.map +1 -0
  244. package/lib/types.d.ts +7 -0
  245. package/lib/types.js +1 -0
  246. package/lib/types.js.map +1 -0
  247. package/package.json +112 -23
  248. package/.vscode/settings.json +0 -3
  249. package/dist/src/cli.d.ts +0 -0
  250. package/dist/src/cli.js +0 -2
  251. package/dist/src/cli.js.map +0 -1
  252. package/dist/src/index.d.ts +0 -1
  253. package/dist/src/index.js +0 -53
  254. package/dist/src/index.js.map +0 -1
  255. package/dist/template/src/cli.d.ts +0 -0
  256. package/dist/template/src/cli.js +0 -2
  257. package/dist/template/src/cli.js.map +0 -1
  258. package/dist/template/src/index.d.ts +0 -0
  259. package/dist/template/src/index.js +0 -2
  260. package/dist/template/src/index.js.map +0 -1
  261. package/src/cli.ts +0 -0
  262. package/src/index.ts +0 -56
  263. package/src/types.d.ts +0 -10
  264. package/template/.vscode/settings.json +0 -3
  265. package/template/README.md +0 -28
  266. package/template/package.json +0 -34
  267. package/template/src/cli.ts +0 -0
  268. package/template/src/index.ts +0 -0
  269. package/template/tsconfig.json +0 -15
  270. package/template/tslint.json +0 -48
  271. package/tsconfig.json +0 -15
  272. package/tslint.json +0 -48
package/LICENSE.md CHANGED
@@ -1,8 +1,20 @@
1
- The MIT License (MIT)
2
- Copyright (c) 2018 Boris Cherny <boris@performancejs.com>
1
+ # MIT License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
5
10
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
7
13
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -0,0 +1,118 @@
1
+ <h1 align="center">Create TypeScript App</h1>
2
+
3
+ <p align="center">A quickstart-friendly TypeScript template with comprehensive formatting, linting, releases, testing, and other great tooling built-in. ✨</p>
4
+
5
+ <p align="center">
6
+ <a href="#contributors" target="_blank">
7
+ <!-- prettier-ignore-start -->
8
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9
+ <img alt="All Contributors: 22 🤝" src="https://img.shields.io/badge/all_contributors-22_🤝-21bb42.svg" />
10
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
11
+ <!-- prettier-ignore-end -->
12
+ </a>
13
+ <a href="https://codecov.io/gh/JoshuaKGoldberg/create-typescript-app" target="_blank">
14
+ <img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/create-typescript-app/branch/main/graph/badge.svg"/>
15
+ </a>
16
+ <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank">
17
+ <img alt="Code of Conduct: Enforced 🤝" src="https://img.shields.io/badge/code_of_conduct-enforced_🤝-21bb42" />
18
+ </a>
19
+ <a href="https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/LICENSE.md" target="_blank">
20
+ <img alt="License: MIT 📝" src="https://img.shields.io/badge/license-MIT_📝-21bb42.svg">
21
+ </a>
22
+ <a href="https://github.com/sponsors/JoshuaKGoldberg" target="_blank">
23
+ <img alt="Sponsor: On GitHub 💸" src="https://img.shields.io/badge/sponsor-on_github_💸-21bb42.svg" />
24
+ </a>
25
+ <img alt="Style: Prettier 🧹" src="https://img.shields.io/badge/style-prettier_🧹-21bb42.svg" />
26
+ <img alt="TypeScript: Strict 💪" src="https://img.shields.io/badge/typescript-strict_💪-21bb42.svg" />
27
+ </p>
28
+
29
+ Note that this template is early stage, opinionated, and not endorsed by the TypeScript team.
30
+ It sets up a _lot_ of tooling out of the box.
31
+ Each of the included tools exists for a good reason and provides real value.
32
+
33
+ If you don't want to use any particular tool, you can always remove it manually.
34
+
35
+ ## Getting Started
36
+
37
+ First make sure you have the following installed:
38
+
39
+ - [GitHub CLI](https://cli.github.com) _(you'll need to be logged in)_
40
+ - [Node.js](https://nodejs.org)
41
+ - [pnpm](https://pnpm.io)
42
+
43
+ This repository comes with three script forms to set up an existing or new repository with tooling.
44
+ Use the corresponding docs page to get started:
45
+
46
+ - [Creating from the terminal](./docs/Creation.md): creating a new repository locally on the command-line _(recommended)_
47
+ - [Initializing from the template](./docs/Initialization.md): creating a new repository with the [_Use this template_](https://github.com/JoshuaKGoldberg/create-typescript-app/generate) button on GitHub
48
+ - [Migrating an existing repository](./docs/Migrate.md): adding this template's tooling on top of an existing repository
49
+
50
+ ## Explainer
51
+
52
+ This template is available for anybody who wants to set up a Node application using TypeScript.
53
+ It sets up the following tooling for you:
54
+
55
+ - [**All Contributors**](https://allcontributors.org): Tracks various kinds of contributions and displays them in a nicely formatted table in the README.md.
56
+ - [**ESLint**](https://eslint.org): Static analysis for JavaScript code, configured with [typescript-eslint](https://typescript-eslint.io) for TypeScript code and other general-use plugins.
57
+ - [**Knip**](https://github.com/webpro/knip): Detects unused files, dependencies, and code exports.
58
+ - [**Markdownlint**](https://github.com/DavidAnson/markdownlint): Static analysis for Markdown code.
59
+ - [**pnpm**](https://pnpm.io): Disk-efficient package manager alternative.
60
+ - [**PR Compliance Action**](https://github.com/mtfoley/pr-compliance-action): Checks PRs for compliance such as addressing a linked issue and proper title formatting.
61
+ - [**Prettier**](https://prettier.io): Opinionated formatting for code, run on file save and as a Git commit hook via [husky](https://typicode.github.io/husky) and [lint-staged](https://github.com/okonet/lint-staged).
62
+ - [**release-it**](https://github.com/release-it/release-it): Generates changelogs, bumps the package version, and publishes to GitHub and npm based on [conventional commits](https://www.conventionalcommits.org).
63
+ - [**Renovate**](https://docs.renovatebot.com): Keeps dependencies up-to-date with PRs, configured to wait a few days after each update for safety.
64
+ - [**tsup**](https://tsup.egoist.dev): Builds output definitions and JavaScript files using [esbuild](https://esbuild.github.io).
65
+ - [**TypeScript**](https://typescriptlang.org): A typed superset of JavaScript, configured with strict compiler options.
66
+ - [**Vitest**](https://vitest.dev): Fast unit tests, configured with coverage tracking and [console-fail-test](https://github.com/JoshuaKGoldberg/console-fail-test).
67
+
68
+ ## Development
69
+
70
+ See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md), then [`.github/DEVELOPMENT.md`](./.github/DEVELOPMENT.md).
71
+ Thanks! 💖
72
+
73
+ ## Contributors
74
+
75
+ <!-- spellchecker: disable -->
76
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
77
+ <!-- prettier-ignore-start -->
78
+ <!-- markdownlint-disable -->
79
+ <table>
80
+ <tbody>
81
+ <tr>
82
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/garuna-m6"><img src="https://avatars.githubusercontent.com/u/23234342?v=4?s=100" width="100px;" alt="Anurag"/><br /><sub><b>Anurag</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=garuna-m6" title="Code">💻</a></td>
83
+ <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>
84
+ <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>
85
+ <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>
86
+ <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>
87
+ <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>
88
+ <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></td>
89
+ </tr>
90
+ <tr>
91
+ <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>
92
+ <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>
93
+ <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>
94
+ <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>
95
+ <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>
96
+ <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>
97
+ <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>
98
+ </tr>
99
+ <tr>
100
+ <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>
101
+ <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>
102
+ <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>
103
+ <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>
104
+ <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>
105
+ <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>
106
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/tungbq"><img src="https://avatars.githubusercontent.com/u/85242618?v=4?s=100" width="100px;" alt="Tung Bui (Leo)"/><br /><sub><b>Tung Bui (Leo)</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=tungbq" title="Code">💻</a></td>
107
+ </tr>
108
+ <tr>
109
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/TAKANOME-DEV"><img src="https://avatars.githubusercontent.com/u/79809121?v=4?s=100" width="100px;" alt="takanomedev"/><br /><sub><b>takanomedev</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/create-typescript-app/commits?author=TAKANOME-DEV" title="Code">💻</a></td>
110
+ </tr>
111
+ </tbody>
112
+ </table>
113
+
114
+ <!-- markdownlint-restore -->
115
+ <!-- prettier-ignore-end -->
116
+
117
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
118
+ <!-- spellchecker: enable -->
package/bin/index.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { bin } from "../lib/bin/index.js";
3
+
4
+ process.exitCode = await bin(process.argv.slice(2));
@@ -0,0 +1,3 @@
1
+ declare function bin(args: string[]): Promise<1 | 0 | undefined>;
2
+
3
+ export { bin };
@@ -0,0 +1,52 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ import { parseArgs } from "node:util";
4
+ import { create } from "../create/index.js";
5
+ import { initialize } from "../initialize/index.js";
6
+ import { migrate } from "../migrate/index.js";
7
+ import { logLine } from "../shared/cli/lines.js";
8
+ import { promptForMode } from "./mode.js";
9
+ async function bin(args) {
10
+ console.clear();
11
+ prompts.intro(
12
+ [
13
+ chalk.greenBright(`Welcome to`),
14
+ chalk.bgGreenBright.black(`create-typescript-app`),
15
+ chalk.greenBright(`! \u{1F389}`)
16
+ ].join(" ")
17
+ );
18
+ logLine();
19
+ logLine(
20
+ chalk.yellow(
21
+ "\u26A0\uFE0F This template is early stage, opinionated, and not endorsed by the TypeScript team. \u26A0\uFE0F"
22
+ )
23
+ );
24
+ logLine(
25
+ chalk.yellow(
26
+ "\u26A0\uFE0F If any tooling it sets displeases you, you can always remove that portion manually. \u26A0\uFE0F"
27
+ )
28
+ );
29
+ const { values } = parseArgs({
30
+ args,
31
+ options: {
32
+ mode: { type: "string" }
33
+ },
34
+ strict: false
35
+ });
36
+ const mode = await promptForMode(values.mode);
37
+ if (mode instanceof Error) {
38
+ prompts.outro(chalk.red(mode.message));
39
+ return 1;
40
+ }
41
+ logLine();
42
+ logLine(
43
+ chalk.blue(
44
+ "Let's collect some information to fill out repository details..."
45
+ )
46
+ );
47
+ return await { create, initialize, migrate }[mode](args);
48
+ }
49
+ export {
50
+ bin
51
+ };
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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\";\n\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 { promptForMode } from \"./mode.js\";\n\nexport async function bin(args: string[]) {\n\tconsole.clear();\n\n\tprompts.intro(\n\t\t[\n\t\t\tchalk.greenBright(`Welcome to`),\n\t\t\tchalk.bgGreenBright.black(`create-typescript-app`),\n\t\t\tchalk.greenBright(`! 🎉`),\n\t\t].join(\" \"),\n\t);\n\n\tlogLine();\n\tlogLine(\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);\n\tlogLine(\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\tmode: { type: \"string\" },\n\t\t},\n\t\tstrict: false,\n\t});\n\n\tconst mode = await promptForMode(values.mode);\n\tif (mode instanceof Error) {\n\t\tprompts.outro(chalk.red(mode.message));\n\t\treturn 1;\n\t}\n\n\tlogLine();\n\tlogLine(\n\t\tchalk.blue(\n\t\t\t\"Let's collect some information to fill out repository details...\",\n\t\t),\n\t);\n\n\treturn await { create, initialize, migrate }[mode](args);\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAE1B,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAE9B,eAAsB,IAAI,MAAgB;AACzC,UAAQ,MAAM;AAEd,UAAQ;AAAA,IACP;AAAA,MACC,MAAM,YAAY,YAAY;AAAA,MAC9B,MAAM,cAAc,MAAM,uBAAuB;AAAA,MACjD,MAAM,YAAY,aAAM;AAAA,IACzB,EAAE,KAAK,GAAG;AAAA,EACX;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AACA;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,OAAO,IAAI,UAAU;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACR,MAAM,EAAE,MAAM,SAAS;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,EACT,CAAC;AAED,QAAM,OAAO,MAAM,cAAc,OAAO,IAAI;AAC5C,MAAI,gBAAgB,OAAO;AAC1B,YAAQ,MAAM,MAAM,IAAI,KAAK,OAAO,CAAC;AACrC,WAAO;AAAA,EACR;AAEA,UAAQ;AACR;AAAA,IACC,MAAM;AAAA,MACL;AAAA,IACD;AAAA,EACD;AAEA,SAAO,MAAM,EAAE,QAAQ,YAAY,QAAQ,EAAE,IAAI,EAAE,IAAI;AACxD;","names":[]}
@@ -0,0 +1,4 @@
1
+ type Mode = "create" | "initialize" | "migrate";
2
+ declare function promptForMode(input: boolean | string | undefined): Promise<Error | Mode>;
3
+
4
+ export { Mode, promptForMode };
@@ -0,0 +1,43 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ import { handlePromptCancel } from "../shared/prompts.js";
4
+ const allowedModes = ["create", "initialize", "migrate"];
5
+ function isMode(input) {
6
+ return allowedModes.includes(input);
7
+ }
8
+ async function promptForMode(input) {
9
+ if (input) {
10
+ if (!isMode(input)) {
11
+ return new Error(
12
+ `Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(
13
+ ", "
14
+ )}.`
15
+ );
16
+ }
17
+ return input;
18
+ }
19
+ const selection = handlePromptCancel(
20
+ await prompts.select({
21
+ message: chalk.blue("How would you like to use the template?"),
22
+ options: [
23
+ {
24
+ label: "--create a new repository in a child directory",
25
+ value: "create"
26
+ },
27
+ {
28
+ label: "--initialize a freshly repository in the current directory",
29
+ value: "initialize"
30
+ },
31
+ {
32
+ label: "--migrate an existing repository in the current directory",
33
+ value: "migrate"
34
+ }
35
+ ]
36
+ })
37
+ );
38
+ return selection;
39
+ }
40
+ export {
41
+ promptForMode
42
+ };
43
+ //# sourceMappingURL=mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/bin/mode.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nimport { handlePromptCancel } from \"../shared/prompts.js\";\n\nexport type Mode = \"create\" | \"initialize\" | \"migrate\";\n\nconst allowedModes = [\"create\", \"initialize\", \"migrate\"] satisfies Mode[];\n\nfunction isMode(input: boolean | string): input is Mode {\n\treturn allowedModes.includes(input as Mode);\n}\n\nexport async function promptForMode(\n\tinput: boolean | string | undefined,\n): Promise<Error | Mode> {\n\tif (input) {\n\t\tif (!isMode(input)) {\n\t\t\treturn new Error(\n\t\t\t\t`Unknown --mode: ${input}. Allowed modes are: ${allowedModes.join(\n\t\t\t\t\t\", \",\n\t\t\t\t)}.`,\n\t\t\t);\n\t\t}\n\n\t\treturn input;\n\t}\n\n\tconst selection = handlePromptCancel(\n\t\t(await prompts.select({\n\t\t\tmessage: chalk.blue(\"How would you like to use the template?\"),\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"--create a new repository in a child directory\",\n\t\t\t\t\tvalue: \"create\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"--initialize a freshly repository in the current directory\",\n\t\t\t\t\tvalue: \"initialize\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: \"--migrate an existing repository in the current directory\",\n\t\t\t\t\tvalue: \"migrate\",\n\t\t\t\t},\n\t\t\t],\n\t\t})) as Mode | symbol,\n\t);\n\n\treturn selection;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAElB,SAAS,0BAA0B;AAInC,MAAM,eAAe,CAAC,UAAU,cAAc,SAAS;AAEvD,SAAS,OAAO,OAAwC;AACvD,SAAO,aAAa,SAAS,KAAa;AAC3C;AAEA,eAAsB,cACrB,OACwB;AACxB,MAAI,OAAO;AACV,QAAI,CAAC,OAAO,KAAK,GAAG;AACnB,aAAO,IAAI;AAAA,QACV,mBAAmB,KAAK,wBAAwB,aAAa;AAAA,UAC5D;AAAA,QACD,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,EACR;AAEA,QAAM,YAAY;AAAA,IAChB,MAAM,QAAQ,OAAO;AAAA,MACrB,SAAS,MAAM,KAAK,yCAAyC;AAAA,MAC7D,SAAS;AAAA,QACR;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAEA,SAAO;AACR;","names":[]}
@@ -0,0 +1,6 @@
1
+ import { Mode } from '../bin/mode.js';
2
+ import { Options } from '../shared/types.js';
3
+
4
+ declare function createRerunSuggestion(mode: Mode, options: Options): string;
5
+
6
+ export { createRerunSuggestion };
@@ -0,0 +1,17 @@
1
+ import { allArgOptions } from "../shared/options/args.js";
2
+ function getFirstMatchingArg(key) {
3
+ return Object.keys(allArgOptions).find(
4
+ (arg) => arg.replaceAll("-", "") === key.toLowerCase()
5
+ );
6
+ }
7
+ function createRerunSuggestion(mode, options) {
8
+ const args = Object.entries(options).filter(([, value]) => !!value).map(([key, value]) => {
9
+ const valueStringified = `${value}`;
10
+ return `--${getFirstMatchingArg(key)} ${valueStringified.includes(" ") ? `"${value}"` : value}`;
11
+ }).join(" ");
12
+ return `npx create-typescript-app --mode ${mode} ${args}`;
13
+ }
14
+ export {
15
+ createRerunSuggestion
16
+ };
17
+ //# sourceMappingURL=createRerunSuggestion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/create/createRerunSuggestion.ts"],"sourcesContent":["import { Mode } from \"../bin/mode.js\";\nimport { 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(mode: Mode, options: Options): string {\n\tconst args = Object.entries(options)\n\t\t.filter(([, value]) => !!value)\n\t\t.map(([key, value]) => {\n\t\t\tconst valueStringified = `${value}`;\n\t\t\treturn `--${getFirstMatchingArg(key)} ${\n\t\t\t\tvalueStringified.includes(\" \") ? `\"${value}\"` : value\n\t\t\t}`;\n\t\t})\n\t\t.join(\" \");\n\n\treturn `npx create-typescript-app --mode ${mode} ${args}`;\n}\n"],"mappings":"AACA,SAAS,qBAAqB;AAG9B,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,MAAY,SAA0B;AAC3E,QAAM,OAAO,OAAO,QAAQ,OAAO,EACjC,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC,KAAK,EAC7B,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AACtB,UAAM,mBAAmB,GAAG,KAAK;AACjC,WAAO,KAAK,oBAAoB,GAAG,CAAC,IACnC,iBAAiB,SAAS,GAAG,IAAI,IAAI,KAAK,MAAM,KACjD;AAAA,EACD,CAAC,EACA,KAAK,GAAG;AAEV,SAAO,oCAAoC,IAAI,IAAI,IAAI;AACxD;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { OctokitAndOptions } from '../shared/options/readOptions.js';
2
+ import 'octokit';
3
+ import '../shared/types.js';
4
+
5
+ declare function createWithOptions({ octokit, options, }: OctokitAndOptions): Promise<{
6
+ sentToGitHub: boolean | undefined;
7
+ }>;
8
+
9
+ export { createWithOptions };
@@ -0,0 +1,62 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import { $ } from "execa";
3
+ import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
4
+ import { doesRepositoryExist } from "../shared/doesRepositoryExist.js";
5
+ import { addToolAllContributors } from "../steps/addToolAllContributors.js";
6
+ import { finalizeDependencies } from "../steps/finalizeDependencies.js";
7
+ import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
8
+ import { runCommands } from "../steps/runCommands.js";
9
+ import { writeReadme } from "../steps/writeReadme.js";
10
+ import { writeStructure } from "../steps/writing/writeStructure.js";
11
+ async function createWithOptions({
12
+ octokit,
13
+ options
14
+ }) {
15
+ await withSpinners("Creating repository structure", [
16
+ [
17
+ "Writing structure",
18
+ async () => {
19
+ await writeStructure(options);
20
+ }
21
+ ],
22
+ [
23
+ "Writing README.md",
24
+ async () => {
25
+ await writeReadme(options);
26
+ }
27
+ ]
28
+ ]);
29
+ if (!options.excludeContributors) {
30
+ await withSpinner("Adding contributors to table", async () => {
31
+ await addToolAllContributors(options.owner);
32
+ });
33
+ }
34
+ if (!options.skipInstall) {
35
+ await withSpinner(
36
+ "Installing packages",
37
+ async () => finalizeDependencies(options)
38
+ );
39
+ }
40
+ await runCommands("Cleaning up files", [
41
+ "pnpm dedupe",
42
+ "pnpm format --write",
43
+ "pnpm lint --fix"
44
+ ]);
45
+ const sendToGitHub = octokit && await doesRepositoryExist(octokit, options) && (options.createRepository ?? await prompts.confirm({
46
+ message: "Would you like to push the template's tooling up to the repository on GitHub?"
47
+ }) === true);
48
+ if (sendToGitHub) {
49
+ await withSpinner("Initializing GitHub repository", async () => {
50
+ await $`git remote add origin https://github.com/${options.owner}/${options.repository}`;
51
+ await $`git add -A`;
52
+ await $`git commit --message ${"feat: initialized repo \u2728"}`;
53
+ await $`git push -u origin main --force`;
54
+ await initializeGitHubRepository(octokit, options);
55
+ });
56
+ }
57
+ return { sentToGitHub: sendToGitHub };
58
+ }
59
+ export {
60
+ createWithOptions
61
+ };
62
+ //# sourceMappingURL=createWithOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/create/createWithOptions.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport { $ } from \"execa\";\n\nimport { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { doesRepositoryExist } from \"../shared/doesRepositoryExist.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { addToolAllContributors } from \"../steps/addToolAllContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function createWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Creating repository structure\", [\n\t\t[\n\t\t\t\"Writing structure\",\n\t\t\tasync () => {\n\t\t\t\tawait writeStructure(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Writing README.md\",\n\t\t\tasync () => {\n\t\t\t\tawait writeReadme(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Adding contributors to table\", async () => {\n\t\t\tawait addToolAllContributors(options.owner);\n\t\t});\n\t}\n\n\tif (!options.skipInstall) {\n\t\tawait withSpinner(\"Installing packages\", async () =>\n\t\t\tfinalizeDependencies(options),\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm dedupe\",\n\t\t\"pnpm format --write\",\n\t\t\"pnpm lint --fix\",\n\t]);\n\n\tconst sendToGitHub =\n\t\toctokit &&\n\t\t(await doesRepositoryExist(octokit, options)) &&\n\t\t(options.createRepository ??\n\t\t\t(await prompts.confirm({\n\t\t\t\tmessage:\n\t\t\t\t\t\"Would you like to push the template's tooling up to the repository on GitHub?\",\n\t\t\t})) === true);\n\n\tif (sendToGitHub) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait $`git remote add origin https://github.com/${options.owner}/${options.repository}`;\n\t\t\tawait $`git add -A`;\n\t\t\tawait $`git commit --message ${\"feat: initialized repo ✨\"}`;\n\t\t\tawait $`git push -u origin main --force`;\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\treturn { sentToGitHub: sendToGitHub };\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,SAAS,SAAS;AAElB,SAAS,aAAa,oBAAoB;AAC1C,SAAS,2BAA2B;AAEpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,kBAAkB;AAAA,EACvC;AAAA,EACA;AACD,GAAsB;AACrB,QAAM,aAAa,iCAAiC;AAAA,IACnD;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,eAAe,OAAO;AAAA,MAC7B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,YAAY,OAAO;AAAA,MAC1B;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM,YAAY,gCAAgC,YAAY;AAC7D,YAAM,uBAAuB,QAAQ,KAAK;AAAA,IAC3C,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM;AAAA,MAAY;AAAA,MAAuB,YACxC,qBAAqB,OAAO;AAAA,IAC7B;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AAED,QAAM,eACL,WACC,MAAM,oBAAoB,SAAS,OAAO,MAC1C,QAAQ,oBACP,MAAM,QAAQ,QAAQ;AAAA,IACtB,SACC;AAAA,EACF,CAAC,MAAO;AAEV,MAAI,cAAc;AACjB,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,6CAA6C,QAAQ,KAAK,IAAI,QAAQ,UAAU;AACtF,YAAM;AACN,YAAM,yBAAyB,+BAA0B;AACzD,YAAM;AACN,YAAM,2BAA2B,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,aAAa;AACrC;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function create(args: string[]): Promise<1 | 0 | undefined>;
2
+
3
+ export { create };
@@ -0,0 +1,64 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ import { $ } from "execa";
4
+ import fs from "node:fs/promises";
5
+ import { outro } from "../shared/cli/outro.js";
6
+ import { readOptions } from "../shared/options/readOptions.js";
7
+ import { runOrRestore } from "../shared/runOrRestore.js";
8
+ import { createRerunSuggestion } from "./createRerunSuggestion.js";
9
+ import { createWithOptions } from "./createWithOptions.js";
10
+ async function create(args) {
11
+ const inputs = await readOptions(args);
12
+ if (!await createAndEnterRepository(inputs.options.repository)) {
13
+ prompts.outro(
14
+ chalk.red(
15
+ `The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`
16
+ )
17
+ );
18
+ return;
19
+ }
20
+ return await runOrRestore({
21
+ run: async () => {
22
+ const { sentToGitHub } = await createWithOptions(inputs);
23
+ outro(
24
+ sentToGitHub ? [
25
+ {
26
+ label: "Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps."
27
+ }
28
+ ] : [
29
+ {
30
+ label: "Consider creating a GitHub repository from the new directory:",
31
+ lines: [
32
+ `cd ${inputs.options.repository}`,
33
+ createRerunSuggestion("initialize", {
34
+ ...inputs.options,
35
+ skipGitHubApi: false,
36
+ skipInstall: false
37
+ }),
38
+ `git add -A`,
39
+ `git commit -m "feat: initial commit \u2728"`,
40
+ `git push -u origin main`
41
+ ]
42
+ },
43
+ {
44
+ label: "If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps."
45
+ }
46
+ ]
47
+ );
48
+ },
49
+ skipRestore: inputs.options.skipRestore
50
+ });
51
+ }
52
+ async function createAndEnterRepository(repository) {
53
+ if ((await fs.readdir(".")).includes(repository)) {
54
+ return false;
55
+ }
56
+ await fs.mkdir(repository);
57
+ process.chdir(repository);
58
+ await $`git init`;
59
+ return true;
60
+ }
61
+ export {
62
+ create
63
+ };
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/create/index.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport { $ } from \"execa\";\nimport fs from \"node:fs/promises\";\n\nimport { outro } from \"../shared/cli/outro.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { createRerunSuggestion } from \"./createRerunSuggestion.js\";\nimport { createWithOptions } from \"./createWithOptions.js\";\n\nexport async function create(args: string[]) {\n\tconst inputs = await readOptions(args);\n\n\tif (!(await createAndEnterRepository(inputs.options.repository))) {\n\t\tprompts.outro(\n\t\t\tchalk.red(\n\t\t\t\t`The ${inputs.options.repository} directory already exists. Please remove the directory or try a different name.`,\n\t\t\t),\n\t\t);\n\t\treturn;\n\t}\n\n\treturn await runOrRestore({\n\t\trun: async () => {\n\t\t\tconst { sentToGitHub } = await createWithOptions(inputs);\n\n\t\t\toutro(\n\t\t\t\tsentToGitHub\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\"Now all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\"Consider creating a GitHub repository from the new directory:\",\n\t\t\t\t\t\t\t\tlines: [\n\t\t\t\t\t\t\t\t\t`cd ${inputs.options.repository}`,\n\t\t\t\t\t\t\t\t\tcreateRerunSuggestion(\"initialize\", {\n\t\t\t\t\t\t\t\t\t\t...inputs.options,\n\t\t\t\t\t\t\t\t\t\tskipGitHubApi: false,\n\t\t\t\t\t\t\t\t\t\tskipInstall: false,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t\t\t\t`git commit -m \"feat: initial commit ✨\"`,\n\t\t\t\t\t\t\t\t\t`git push -u origin main`,\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel:\n\t\t\t\t\t\t\t\t\t\"If you do, be sure to populate its ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ],\n\t\t\t);\n\t\t},\n\t\tskipRestore: inputs.options.skipRestore,\n\t});\n}\n\nasync function createAndEnterRepository(repository: string) {\n\tif ((await fs.readdir(\".\")).includes(repository)) {\n\t\treturn false;\n\t}\n\n\tawait fs.mkdir(repository);\n\tprocess.chdir(repository);\n\tawait $`git init`;\n\n\treturn true;\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,SAAS,SAAS;AAClB,OAAO,QAAQ;AAEf,SAAS,aAAa;AACtB,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AAElC,eAAsB,OAAO,MAAgB;AAC5C,QAAM,SAAS,MAAM,YAAY,IAAI;AAErC,MAAI,CAAE,MAAM,yBAAyB,OAAO,QAAQ,UAAU,GAAI;AACjE,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,OAAO,OAAO,QAAQ,UAAU;AAAA,MACjC;AAAA,IACD;AACA;AAAA,EACD;AAEA,SAAO,MAAM,aAAa;AAAA,IACzB,KAAK,YAAY;AAChB,YAAM,EAAE,aAAa,IAAI,MAAM,kBAAkB,MAAM;AAEvD;AAAA,QACC,eACG;AAAA,UACA;AAAA,YACC,OACC;AAAA,UACF;AAAA,QACA,IACA;AAAA,UACA;AAAA,YACC,OACC;AAAA,YACD,OAAO;AAAA,cACN,MAAM,OAAO,QAAQ,UAAU;AAAA,cAC/B,sBAAsB,cAAc;AAAA,gBACnC,GAAG,OAAO;AAAA,gBACV,eAAe;AAAA,gBACf,aAAa;AAAA,cACd,CAAC;AAAA,cACD;AAAA,cACA;AAAA,cACA;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,YACC,OACC;AAAA,UACF;AAAA,QACA;AAAA,MACJ;AAAA,IACD;AAAA,IACA,aAAa,OAAO,QAAQ;AAAA,EAC7B,CAAC;AACF;AAEA,eAAe,yBAAyB,YAAoB;AAC3D,OAAK,MAAM,GAAG,QAAQ,GAAG,GAAG,SAAS,UAAU,GAAG;AACjD,WAAO;AAAA,EACR;AAEA,QAAM,GAAG,MAAM,UAAU;AACzB,UAAQ,MAAM,UAAU;AACxB,QAAM;AAEN,SAAO;AACR;","names":[]}
package/lib/greet.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { GreetOptions } from './types.js';
2
+
3
+ declare function greet(options: GreetOptions | string): void;
4
+
5
+ export { greet };
package/lib/greet.js ADDED
@@ -0,0 +1,14 @@
1
+ function greet(options) {
2
+ const {
3
+ logger = console.log.bind(console),
4
+ message,
5
+ times = 1
6
+ } = typeof options === "string" ? { message: options } : options;
7
+ for (let i = 0; i < times; i += 1) {
8
+ logger(message);
9
+ }
10
+ }
11
+ export {
12
+ greet
13
+ };
14
+ //# sourceMappingURL=greet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/greet.ts"],"sourcesContent":["import { GreetOptions } from \"./types.js\";\n\nexport function greet(options: GreetOptions | string) {\n\tconst {\n\t\tlogger = console.log.bind(console),\n\t\tmessage,\n\t\ttimes = 1,\n\t} = typeof options === \"string\" ? { message: options } : options;\n\n\tfor (let i = 0; i < times; i += 1) {\n\t\tlogger(message);\n\t}\n}\n"],"mappings":"AAEO,SAAS,MAAM,SAAgC;AACrD,QAAM;AAAA,IACL,SAAS,QAAQ,IAAI,KAAK,OAAO;AAAA,IACjC;AAAA,IACA,QAAQ;AAAA,EACT,IAAI,OAAO,YAAY,WAAW,EAAE,SAAS,QAAQ,IAAI;AAEzD,WAAS,IAAI,GAAG,IAAI,OAAO,KAAK,GAAG;AAClC,WAAO,OAAO;AAAA,EACf;AACD;","names":[]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { greet } from './greet.js';
2
+ export { GreetOptions } from './types.js';
package/lib/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./greet.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./greet.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function initialize(args: string[]): Promise<1 | 0>;
2
+
3
+ export { initialize };
@@ -0,0 +1,32 @@
1
+ import { outro } from "../shared/cli/outro.js";
2
+ import { ensureGitRepository } from "../shared/ensureGitRepository.js";
3
+ import { readOptions } from "../shared/options/readOptions.js";
4
+ import { runOrRestore } from "../shared/runOrRestore.js";
5
+ import { initializeWithOptions } from "./initializeWithOptions.js";
6
+ async function initialize(args) {
7
+ const inputs = await readOptions(args);
8
+ await ensureGitRepository();
9
+ return await runOrRestore({
10
+ run: async () => {
11
+ await initializeWithOptions(inputs);
12
+ outro([
13
+ {
14
+ label: "You may consider committing these changes:",
15
+ lines: [
16
+ `git add -A`,
17
+ `git commit -m "feat: initialized repo \u2728`,
18
+ `git push`
19
+ ]
20
+ },
21
+ {
22
+ label: "Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps."
23
+ }
24
+ ]);
25
+ },
26
+ skipRestore: inputs.options.skipRestore
27
+ });
28
+ }
29
+ export {
30
+ initialize
31
+ };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/initialize/index.ts"],"sourcesContent":["import { outro } from \"../shared/cli/outro.js\";\nimport { ensureGitRepository } from \"../shared/ensureGitRepository.js\";\nimport { readOptions } from \"../shared/options/readOptions.js\";\nimport { runOrRestore } from \"../shared/runOrRestore.js\";\nimport { initializeWithOptions } from \"./initializeWithOptions.js\";\n\nexport async function initialize(args: string[]) {\n\tconst inputs = await readOptions(args);\n\n\tawait ensureGitRepository();\n\n\treturn await runOrRestore({\n\t\trun: async () => {\n\t\t\tawait initializeWithOptions(inputs);\n\n\t\t\toutro([\n\t\t\t\t{\n\t\t\t\t\tlabel: \"You may consider committing these changes:\",\n\t\t\t\t\tlines: [\n\t\t\t\t\t\t`git add -A`,\n\t\t\t\t\t\t`git commit -m \"feat: initialized repo ✨`,\n\t\t\t\t\t\t`git push`,\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t\"Otherwise, all you have to do is populate the repository's ACCESS_TOKEN and NPM_TOKEN secrets, and enable the Codecov and Renovate GitHub apps.\",\n\t\t\t\t},\n\t\t\t]);\n\t\t},\n\t\tskipRestore: inputs.options.skipRestore,\n\t});\n}\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAEtC,eAAsB,WAAW,MAAgB;AAChD,QAAM,SAAS,MAAM,YAAY,IAAI;AAErC,QAAM,oBAAoB;AAE1B,SAAO,MAAM,aAAa;AAAA,IACzB,KAAK,YAAY;AAChB,YAAM,sBAAsB,MAAM;AAElC,YAAM;AAAA,QACL;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,UACD;AAAA,QACD;AAAA,QACA;AAAA,UACC,OACC;AAAA,QACF;AAAA,MACD,CAAC;AAAA,IACF;AAAA,IACA,aAAa,OAAO,QAAQ;AAAA,EAC7B,CAAC;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { OctokitAndOptions } from '../shared/options/readOptions.js';
2
+ import 'octokit';
3
+ import '../shared/types.js';
4
+
5
+ declare function initializeWithOptions({ octokit, options, }: OctokitAndOptions): Promise<void>;
6
+
7
+ export { initializeWithOptions };