create-typescript-app 0.1.2 → 1.29.15

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 +164 -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 -54
  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 -58
  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
@@ -0,0 +1,60 @@
1
+ import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
2
+ import { addOwnerAsAllContributor } from "../steps/addOwnerAsAllContributor.js";
3
+ import { clearChangelog } from "../steps/clearChangelog.js";
4
+ import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
5
+ import { removeSetupScripts } from "../steps/removeSetupScripts.js";
6
+ import { resetGitTags } from "../steps/resetGitTags.js";
7
+ import { runCommands } from "../steps/runCommands.js";
8
+ import { uninstallPackages } from "../steps/uninstallPackages.js";
9
+ import { updateAllContributorsTable } from "../steps/updateAllContributorsTable.js";
10
+ import { updateLocalFiles } from "../steps/updateLocalFiles.js";
11
+ import { updateReadme } from "../steps/updateReadme.js";
12
+ async function initializeWithOptions({
13
+ octokit,
14
+ options
15
+ }) {
16
+ await withSpinners("Initializing local files", [
17
+ [
18
+ "Updating local files",
19
+ async () => {
20
+ await updateLocalFiles(options);
21
+ }
22
+ ],
23
+ ["Updating README.md", updateReadme],
24
+ ["Clearing changelog", clearChangelog],
25
+ [
26
+ "Updating all-contributors table",
27
+ async () => {
28
+ await updateAllContributorsTable(options);
29
+ }
30
+ ],
31
+ ["Resetting Git tags", resetGitTags]
32
+ ]);
33
+ if (!options.excludeContributors) {
34
+ await withSpinner("Updating existing contributor details", async () => {
35
+ await addOwnerAsAllContributor(options.owner);
36
+ });
37
+ }
38
+ if (octokit) {
39
+ await withSpinner("Initializing GitHub repository", async () => {
40
+ await initializeGitHubRepository(octokit, options);
41
+ });
42
+ }
43
+ if (!options.skipRemoval) {
44
+ await withSpinner("Removing setup scripts", removeSetupScripts);
45
+ }
46
+ if (!options.skipUninstall) {
47
+ await withSpinner(
48
+ "Uninstalling initialization-only packages",
49
+ uninstallPackages
50
+ );
51
+ }
52
+ await runCommands("Cleaning up files", [
53
+ "pnpm lint --fix",
54
+ "pnpm format --write"
55
+ ]);
56
+ }
57
+ export {
58
+ initializeWithOptions
59
+ };
60
+ //# sourceMappingURL=initializeWithOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/initialize/initializeWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { addOwnerAsAllContributor } from \"../steps/addOwnerAsAllContributor.js\";\nimport { clearChangelog } from \"../steps/clearChangelog.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { removeSetupScripts } from \"../steps/removeSetupScripts.js\";\nimport { resetGitTags } from \"../steps/resetGitTags.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { uninstallPackages } from \"../steps/uninstallPackages.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { updateReadme } from \"../steps/updateReadme.js\";\n\nexport async function initializeWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Initializing local files\", [\n\t\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\"Updating README.md\", updateReadme],\n\t\t[\"Clearing changelog\", clearChangelog],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t\t[\"Resetting Git tags\", resetGitTags],\n\t]);\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\"Updating existing contributor details\", async () => {\n\t\t\tawait addOwnerAsAllContributor(options.owner);\n\t\t});\n\t}\n\n\tif (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\tif (!options.skipRemoval) {\n\t\tawait withSpinner(\"Removing setup scripts\", removeSetupScripts);\n\t}\n\n\tif (!options.skipUninstall) {\n\t\tawait withSpinner(\n\t\t\t\"Uninstalling initialization-only packages\",\n\t\t\tuninstallPackages,\n\t\t);\n\t}\n\n\tawait runCommands(\"Cleaning up files\", [\n\t\t\"pnpm lint --fix\",\n\t\t\"pnpm format --write\",\n\t]);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,kCAAkC;AAC3C,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAE7B,eAAsB,sBAAsB;AAAA,EAC3C;AAAA,EACA;AACD,GAAsB;AACrB,QAAM,aAAa,4BAA4B;AAAA,IAC9C;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA,CAAC,sBAAsB,YAAY;AAAA,IACnC,CAAC,sBAAsB,cAAc;AAAA,IACrC;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,IACA,CAAC,sBAAsB,YAAY;AAAA,EACpC,CAAC;AAED,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM,YAAY,yCAAyC,YAAY;AACtE,YAAM,yBAAyB,QAAQ,KAAK;AAAA,IAC7C,CAAC;AAAA,EACF;AAEA,MAAI,SAAS;AACZ,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,aAAa;AACzB,UAAM,YAAY,0BAA0B,kBAAkB;AAAA,EAC/D;AAEA,MAAI,CAAC,QAAQ,eAAe;AAC3B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,QAAM,YAAY,qBAAqB;AAAA,IACtC;AAAA,IACA;AAAA,EACD,CAAC;AACF;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function migrate(args: string[]): Promise<1 | 0>;
2
+
3
+ export { migrate };
@@ -0,0 +1,29 @@
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 { migrateWithOptions } from "./migrateWithOptions.js";
6
+ async function migrate(args) {
7
+ const inputs = await readOptions(args);
8
+ await ensureGitRepository();
9
+ return await runOrRestore({
10
+ run: async () => {
11
+ await migrateWithOptions(inputs);
12
+ outro([
13
+ {
14
+ label: "You may consider committing these changes:",
15
+ lines: [
16
+ `git add -A`,
17
+ `git commit -m "migrated repo to create-typescript-app \u2728`,
18
+ `git push`
19
+ ]
20
+ }
21
+ ]);
22
+ },
23
+ skipRestore: inputs.options.skipRestore
24
+ });
25
+ }
26
+ export {
27
+ migrate
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/migrate/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 { migrateWithOptions } from \"./migrateWithOptions.js\";\n\nexport async function migrate(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 migrateWithOptions(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 \"migrated repo to create-typescript-app ✨`,\n\t\t\t\t\t\t`git push`,\n\t\t\t\t\t],\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,0BAA0B;AAEnC,eAAsB,QAAQ,MAAgB;AAC7C,QAAM,SAAS,MAAM,YAAY,IAAI;AAErC,QAAM,oBAAoB;AAE1B,SAAO,MAAM,aAAa;AAAA,IACzB,KAAK,YAAY;AAChB,YAAM,mBAAmB,MAAM;AAE/B,YAAM;AAAA,QACL;AAAA,UACC,OAAO;AAAA,UACP,OAAO;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,UACD;AAAA,QACD;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 migrateWithOptions({ octokit, options, }: OctokitAndOptions): Promise<void>;
6
+
7
+ export { migrateWithOptions };
@@ -0,0 +1,67 @@
1
+ import { withSpinner, withSpinners } from "../shared/cli/spinners.js";
2
+ import { clearUnnecessaryFiles } from "../steps/clearUnnecessaryFiles.js";
3
+ import { detectExistingContributors } from "../steps/detectExistingContributors.js";
4
+ import { finalizeDependencies } from "../steps/finalizeDependencies.js";
5
+ import { initializeGitHubRepository } from "../steps/initializeGitHubRepository/index.js";
6
+ import { runCommands } from "../steps/runCommands.js";
7
+ import { updateAllContributorsTable } from "../steps/updateAllContributorsTable.js";
8
+ import { updateLocalFiles } from "../steps/updateLocalFiles.js";
9
+ import { writeReadme } from "../steps/writeReadme.js";
10
+ import { writeStructure } from "../steps/writing/writeStructure.js";
11
+ async function migrateWithOptions({
12
+ octokit,
13
+ options
14
+ }) {
15
+ await withSpinners("Migrating repository structure", [
16
+ ["Clearing unnecessary files", clearUnnecessaryFiles],
17
+ [
18
+ "Writing structure",
19
+ async () => {
20
+ await writeStructure(options);
21
+ }
22
+ ],
23
+ [
24
+ "Writing README.md",
25
+ async () => {
26
+ await writeReadme(options);
27
+ }
28
+ ],
29
+ [
30
+ "Updating local files",
31
+ async () => {
32
+ await updateLocalFiles(options);
33
+ }
34
+ ],
35
+ [
36
+ "Updating all-contributors table",
37
+ async () => {
38
+ await updateAllContributorsTable(options);
39
+ }
40
+ ]
41
+ ]);
42
+ if (octokit) {
43
+ await withSpinner("Initializing GitHub repository", async () => {
44
+ await initializeGitHubRepository(octokit, options);
45
+ });
46
+ }
47
+ if (!options.excludeContributors) {
48
+ await withSpinner(
49
+ "Detecting existing contributors",
50
+ detectExistingContributors
51
+ );
52
+ }
53
+ if (!options.skipInstall) {
54
+ await withSpinner(
55
+ "Installing packages",
56
+ async () => finalizeDependencies(options)
57
+ );
58
+ }
59
+ await runCommands("Cleaning up files", [
60
+ "pnpm lint --fix",
61
+ "pnpm format --write"
62
+ ]);
63
+ }
64
+ export {
65
+ migrateWithOptions
66
+ };
67
+ //# sourceMappingURL=migrateWithOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/migrate/migrateWithOptions.ts"],"sourcesContent":["import { withSpinner, withSpinners } from \"../shared/cli/spinners.js\";\nimport { OctokitAndOptions } from \"../shared/options/readOptions.js\";\nimport { clearUnnecessaryFiles } from \"../steps/clearUnnecessaryFiles.js\";\nimport { detectExistingContributors } from \"../steps/detectExistingContributors.js\";\nimport { finalizeDependencies } from \"../steps/finalizeDependencies.js\";\nimport { initializeGitHubRepository } from \"../steps/initializeGitHubRepository/index.js\";\nimport { runCommands } from \"../steps/runCommands.js\";\nimport { updateAllContributorsTable } from \"../steps/updateAllContributorsTable.js\";\nimport { updateLocalFiles } from \"../steps/updateLocalFiles.js\";\nimport { writeReadme } from \"../steps/writeReadme.js\";\nimport { writeStructure } from \"../steps/writing/writeStructure.js\";\n\nexport async function migrateWithOptions({\n\toctokit,\n\toptions,\n}: OctokitAndOptions) {\n\tawait withSpinners(\"Migrating repository structure\", [\n\t\t[\"Clearing unnecessary files\", clearUnnecessaryFiles],\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\t[\n\t\t\t\"Updating local files\",\n\t\t\tasync () => {\n\t\t\t\tawait updateLocalFiles(options);\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\t\"Updating all-contributors table\",\n\t\t\tasync () => {\n\t\t\t\tawait updateAllContributorsTable(options);\n\t\t\t},\n\t\t],\n\t]);\n\n\tif (octokit) {\n\t\tawait withSpinner(\"Initializing GitHub repository\", async () => {\n\t\t\tawait initializeGitHubRepository(octokit, options);\n\t\t});\n\t}\n\n\tif (!options.excludeContributors) {\n\t\tawait withSpinner(\n\t\t\t\"Detecting existing contributors\",\n\t\t\tdetectExistingContributors,\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 lint --fix\",\n\t\t\"pnpm format --write\",\n\t]);\n}\n"],"mappings":"AAAA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,kCAAkC;AAC3C,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,eAAsB,mBAAmB;AAAA,EACxC;AAAA,EACA;AACD,GAAsB;AACrB,QAAM,aAAa,kCAAkC;AAAA,IACpD,CAAC,8BAA8B,qBAAqB;AAAA,IACpD;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,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,iBAAiB,OAAO;AAAA,MAC/B;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA,YAAY;AACX,cAAM,2BAA2B,OAAO;AAAA,MACzC;AAAA,IACD;AAAA,EACD,CAAC;AAED,MAAI,SAAS;AACZ,UAAM,YAAY,kCAAkC,YAAY;AAC/D,YAAM,2BAA2B,SAAS,OAAO;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,MAAI,CAAC,QAAQ,qBAAqB;AACjC,UAAM;AAAA,MACL;AAAA,MACA;AAAA,IACD;AAAA,EACD;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,EACD,CAAC;AACF;","names":[]}
@@ -0,0 +1,5 @@
1
+ declare function logLine(line?: string): void;
2
+ declare function logNewSection(line: string): void;
3
+ declare function makeLine(line: string | undefined): string;
4
+
5
+ export { logLine, logNewSection, makeLine };
@@ -0,0 +1,17 @@
1
+ import chalk from "chalk";
2
+ function logLine(line) {
3
+ console.log(makeLine(line));
4
+ }
5
+ function logNewSection(line) {
6
+ logLine();
7
+ console.log(`\u25C7 ${line}`);
8
+ }
9
+ function makeLine(line) {
10
+ return [chalk.gray("\u2502"), line].filter(Boolean).join(" ");
11
+ }
12
+ export {
13
+ logLine,
14
+ logNewSection,
15
+ makeLine
16
+ };
17
+ //# sourceMappingURL=lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/cli/lines.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nexport function logLine(line?: string) {\n\tconsole.log(makeLine(line));\n}\n\nexport function logNewSection(line: string) {\n\tlogLine();\n\tconsole.log(`◇ ${line}`);\n}\n\nexport function makeLine(line: string | undefined) {\n\treturn [chalk.gray(\"│\"), line].filter(Boolean).join(\" \");\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAEX,SAAS,QAAQ,MAAe;AACtC,UAAQ,IAAI,SAAS,IAAI,CAAC;AAC3B;AAEO,SAAS,cAAc,MAAc;AAC3C,UAAQ;AACR,UAAQ,IAAI,WAAM,IAAI,EAAE;AACzB;AAEO,SAAS,SAAS,MAA0B;AAClD,SAAO,CAAC,MAAM,KAAK,QAAG,GAAG,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AACzD;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function lowerFirst(text: string): string;
2
+
3
+ export { lowerFirst };
@@ -0,0 +1,7 @@
1
+ function lowerFirst(text) {
2
+ return text[0].toLowerCase() + text.slice(1);
3
+ }
4
+ export {
5
+ lowerFirst
6
+ };
7
+ //# sourceMappingURL=lowerFirst.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/cli/lowerFirst.ts"],"sourcesContent":["export function lowerFirst(text: string) {\n\treturn text[0].toLowerCase() + text.slice(1);\n}\n"],"mappings":"AAAO,SAAS,WAAW,MAAc;AACxC,SAAO,KAAK,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AAC5C;","names":[]}
@@ -0,0 +1,7 @@
1
+ interface outroGroup {
2
+ label: string;
3
+ lines?: string[];
4
+ }
5
+ declare function outro(groups: outroGroup[]): void;
6
+
7
+ export { outro, outroGroup };
@@ -0,0 +1,21 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ function outro(groups) {
4
+ prompts.outro(chalk.blue(`Great, looks like the script finished! \u{1F389}`));
5
+ for (const { label, lines } of groups) {
6
+ console.log(chalk.blue(label));
7
+ console.log();
8
+ if (lines) {
9
+ for (const line of lines) {
10
+ console.log(chalk.gray(line));
11
+ }
12
+ console.log();
13
+ }
14
+ }
15
+ console.log(chalk.greenBright(`See ya! \u{1F44B}`));
16
+ console.log();
17
+ }
18
+ export {
19
+ outro
20
+ };
21
+ //# sourceMappingURL=outro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/cli/outro.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\n\nexport interface outroGroup {\n\tlabel: string;\n\tlines?: string[];\n}\n\nexport function outro(groups: outroGroup[]) {\n\tprompts.outro(chalk.blue(`Great, looks like the script finished! 🎉`));\n\n\tfor (const { label, lines } of groups) {\n\t\tconsole.log(chalk.blue(label));\n\t\tconsole.log();\n\n\t\tif (lines) {\n\t\t\tfor (const line of lines) {\n\t\t\t\tconsole.log(chalk.gray(line));\n\t\t\t}\n\n\t\t\tconsole.log();\n\t\t}\n\t}\n\n\tconsole.log(chalk.greenBright(`See ya! 👋`));\n\tconsole.log();\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAOX,SAAS,MAAM,QAAsB;AAC3C,UAAQ,MAAM,MAAM,KAAK,kDAA2C,CAAC;AAErE,aAAW,EAAE,OAAO,MAAM,KAAK,QAAQ;AACtC,YAAQ,IAAI,MAAM,KAAK,KAAK,CAAC;AAC7B,YAAQ,IAAI;AAEZ,QAAI,OAAO;AACV,iBAAW,QAAQ,OAAO;AACzB,gBAAQ,IAAI,MAAM,KAAK,IAAI,CAAC;AAAA,MAC7B;AAEA,cAAQ,IAAI;AAAA,IACb;AAAA,EACD;AAEA,UAAQ,IAAI,MAAM,YAAY,mBAAY,CAAC;AAC3C,UAAQ,IAAI;AACb;","names":[]}
@@ -0,0 +1,6 @@
1
+ type SpinnerTask<Return> = () => Promise<Return>;
2
+ type LabeledSpinnerTask<Return> = [string, SpinnerTask<Return>];
3
+ declare function withSpinner<Return>(label: string, task: SpinnerTask<Return>): Promise<Return>;
4
+ declare function withSpinners(label: string, tasks: LabeledSpinnerTask<void>[]): Promise<void>;
5
+
6
+ export { LabeledSpinnerTask, SpinnerTask, withSpinner, withSpinners };
@@ -0,0 +1,49 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import chalk from "chalk";
3
+ import readline from "readline";
4
+ import { logLine, logNewSection, makeLine } from "./lines.js";
5
+ import { lowerFirst } from "./lowerFirst.js";
6
+ import { startLineWithDots } from "./startLineWithDots.js";
7
+ const s = prompts.spinner();
8
+ async function withSpinner(label, task) {
9
+ s.start(`${label}...`);
10
+ try {
11
+ const result = await task();
12
+ s.stop(chalk.green(`\u2705 Passed ${lowerFirst(label)}.`));
13
+ return result;
14
+ } catch (error) {
15
+ s.stop(chalk.red(`\u274C Error ${lowerFirst(label)}.`));
16
+ throw new Error(`Failed ${lowerFirst(label)}`, { cause: error });
17
+ }
18
+ }
19
+ async function withSpinners(label, tasks) {
20
+ logNewSection(`${label}...`);
21
+ let currentLabel;
22
+ let lastLogged;
23
+ try {
24
+ for (const [label2, run] of tasks) {
25
+ currentLabel = label2;
26
+ const line = makeLine(chalk.gray(` - ${label2}`));
27
+ const stopWriting = startLineWithDots(line);
28
+ await run();
29
+ const lineLength = stopWriting();
30
+ lastLogged = chalk.gray(`${line} \u2714\uFE0F
31
+ `);
32
+ readline.clearLine(process.stdout, -1);
33
+ readline.moveCursor(process.stdout, -lineLength, 0);
34
+ process.stdout.write(lastLogged);
35
+ }
36
+ readline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);
37
+ readline.clearScreenDown(process.stdout);
38
+ logNewSection(chalk.green(`\u2705 Passed ${lowerFirst(label)}.`));
39
+ } catch (error) {
40
+ const descriptor = `${lowerFirst(label)} > ${lowerFirst(currentLabel)}`;
41
+ logLine(chalk.red(`\u274C Error ${descriptor}.`));
42
+ throw new Error(`Failed ${descriptor}`, { cause: error });
43
+ }
44
+ }
45
+ export {
46
+ withSpinner,
47
+ withSpinners
48
+ };
49
+ //# sourceMappingURL=spinners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/cli/spinners.ts"],"sourcesContent":["import * as prompts from \"@clack/prompts\";\nimport chalk from \"chalk\";\nimport readline from \"readline\";\n\nimport { logLine, logNewSection, makeLine } from \"./lines.js\";\nimport { lowerFirst } from \"./lowerFirst.js\";\nimport { startLineWithDots } from \"./startLineWithDots.js\";\n\nconst s = prompts.spinner();\n\nexport type SpinnerTask<Return> = () => Promise<Return>;\n\nexport type LabeledSpinnerTask<Return> = [string, SpinnerTask<Return>];\n\nexport async function withSpinner<Return>(\n\tlabel: string,\n\ttask: SpinnerTask<Return>,\n) {\n\ts.start(`${label}...`);\n\n\ttry {\n\t\tconst result = await task();\n\n\t\ts.stop(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n\n\t\treturn result;\n\t} catch (error) {\n\t\ts.stop(chalk.red(`❌ Error ${lowerFirst(label)}.`));\n\n\t\tthrow new Error(`Failed ${lowerFirst(label)}`, { cause: error });\n\t}\n}\n\nexport async function withSpinners(\n\tlabel: string,\n\ttasks: LabeledSpinnerTask<void>[],\n) {\n\tlogNewSection(`${label}...`);\n\n\tlet currentLabel!: string;\n\tlet lastLogged!: string;\n\n\ttry {\n\t\tfor (const [label, run] of tasks) {\n\t\t\tcurrentLabel = label;\n\n\t\t\tconst line = makeLine(chalk.gray(` - ${label}`));\n\t\t\tconst stopWriting = startLineWithDots(line);\n\n\t\t\tawait run();\n\n\t\t\tconst lineLength = stopWriting();\n\t\t\tlastLogged = chalk.gray(`${line} ✔️\\n`);\n\n\t\t\treadline.clearLine(process.stdout, -1);\n\t\t\treadline.moveCursor(process.stdout, -lineLength, 0);\n\t\t\tprocess.stdout.write(lastLogged);\n\t\t}\n\n\t\treadline.moveCursor(process.stdout, -lastLogged.length, -tasks.length - 2);\n\t\treadline.clearScreenDown(process.stdout);\n\n\t\tlogNewSection(chalk.green(`✅ Passed ${lowerFirst(label)}.`));\n\t} catch (error) {\n\t\tconst descriptor = `${lowerFirst(label)} > ${lowerFirst(currentLabel)}`;\n\n\t\tlogLine(chalk.red(`❌ Error ${descriptor}.`));\n\n\t\tthrow new Error(`Failed ${descriptor}`, { cause: error });\n\t}\n}\n"],"mappings":"AAAA,YAAY,aAAa;AACzB,OAAO,WAAW;AAClB,OAAO,cAAc;AAErB,SAAS,SAAS,eAAe,gBAAgB;AACjD,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAElC,MAAM,IAAI,QAAQ,QAAQ;AAM1B,eAAsB,YACrB,OACA,MACC;AACD,IAAE,MAAM,GAAG,KAAK,KAAK;AAErB,MAAI;AACH,UAAM,SAAS,MAAM,KAAK;AAE1B,MAAE,KAAK,MAAM,MAAM,iBAAY,WAAW,KAAK,CAAC,GAAG,CAAC;AAEpD,WAAO;AAAA,EACR,SAAS,OAAO;AACf,MAAE,KAAK,MAAM,IAAI,gBAAW,WAAW,KAAK,CAAC,GAAG,CAAC;AAEjD,UAAM,IAAI,MAAM,UAAU,WAAW,KAAK,CAAC,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EAChE;AACD;AAEA,eAAsB,aACrB,OACA,OACC;AACD,gBAAc,GAAG,KAAK,KAAK;AAE3B,MAAI;AACJ,MAAI;AAEJ,MAAI;AACH,eAAW,CAACA,QAAO,GAAG,KAAK,OAAO;AACjC,qBAAeA;AAEf,YAAM,OAAO,SAAS,MAAM,KAAK,MAAMA,MAAK,EAAE,CAAC;AAC/C,YAAM,cAAc,kBAAkB,IAAI;AAE1C,YAAM,IAAI;AAEV,YAAM,aAAa,YAAY;AAC/B,mBAAa,MAAM,KAAK,GAAG,IAAI;AAAA,CAAO;AAEtC,eAAS,UAAU,QAAQ,QAAQ,EAAE;AACrC,eAAS,WAAW,QAAQ,QAAQ,CAAC,YAAY,CAAC;AAClD,cAAQ,OAAO,MAAM,UAAU;AAAA,IAChC;AAEA,aAAS,WAAW,QAAQ,QAAQ,CAAC,WAAW,QAAQ,CAAC,MAAM,SAAS,CAAC;AACzE,aAAS,gBAAgB,QAAQ,MAAM;AAEvC,kBAAc,MAAM,MAAM,iBAAY,WAAW,KAAK,CAAC,GAAG,CAAC;AAAA,EAC5D,SAAS,OAAO;AACf,UAAM,aAAa,GAAG,WAAW,KAAK,CAAC,MAAM,WAAW,YAAY,CAAC;AAErE,YAAQ,MAAM,IAAI,gBAAW,UAAU,GAAG,CAAC;AAE3C,UAAM,IAAI,MAAM,UAAU,UAAU,IAAI,EAAE,OAAO,MAAM,CAAC;AAAA,EACzD;AACD;","names":["label"]}
@@ -0,0 +1,3 @@
1
+ declare function startLineWithDots(line: string): () => number;
2
+
3
+ export { startLineWithDots };
@@ -0,0 +1,31 @@
1
+ import readline from "readline";
2
+ function startLineWithDots(line) {
3
+ let dots = 0;
4
+ let lastLogged;
5
+ function clearLine() {
6
+ readline.clearLine(process.stdout, -1);
7
+ readline.moveCursor(process.stdout, -lastLogged.length, 0);
8
+ }
9
+ function writeLine() {
10
+ dots = (dots + 1) % 4;
11
+ const toLog = `${line}${".".repeat(dots)}`;
12
+ process.stdout.write(toLog);
13
+ lastLogged = toLog;
14
+ return toLog;
15
+ }
16
+ writeLine();
17
+ const timer = setInterval(() => {
18
+ clearLine();
19
+ writeLine();
20
+ dots += 1;
21
+ }, 500);
22
+ return () => {
23
+ clearLine();
24
+ clearInterval(timer);
25
+ return lastLogged.length;
26
+ };
27
+ }
28
+ export {
29
+ startLineWithDots
30
+ };
31
+ //# sourceMappingURL=startLineWithDots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/cli/startLineWithDots.ts"],"sourcesContent":["import readline from \"readline\";\n\nexport function startLineWithDots(line: string) {\n\tlet dots = 0;\n\tlet lastLogged!: string;\n\n\tfunction clearLine() {\n\t\treadline.clearLine(process.stdout, -1);\n\t\treadline.moveCursor(process.stdout, -lastLogged.length, 0);\n\t}\n\n\tfunction writeLine() {\n\t\tdots = (dots + 1) % 4;\n\n\t\tconst toLog = `${line}${\".\".repeat(dots)}`;\n\n\t\tprocess.stdout.write(toLog);\n\n\t\tlastLogged = toLog;\n\n\t\treturn toLog;\n\t}\n\n\twriteLine();\n\n\tconst timer = setInterval(() => {\n\t\tclearLine();\n\t\twriteLine();\n\t\tdots += 1;\n\t}, 500);\n\n\treturn () => {\n\t\tclearLine();\n\t\tclearInterval(timer);\n\t\treturn lastLogged.length;\n\t};\n}\n"],"mappings":"AAAA,OAAO,cAAc;AAEd,SAAS,kBAAkB,MAAc;AAC/C,MAAI,OAAO;AACX,MAAI;AAEJ,WAAS,YAAY;AACpB,aAAS,UAAU,QAAQ,QAAQ,EAAE;AACrC,aAAS,WAAW,QAAQ,QAAQ,CAAC,WAAW,QAAQ,CAAC;AAAA,EAC1D;AAEA,WAAS,YAAY;AACpB,YAAQ,OAAO,KAAK;AAEpB,UAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,OAAO,IAAI,CAAC;AAExC,YAAQ,OAAO,MAAM,KAAK;AAE1B,iBAAa;AAEb,WAAO;AAAA,EACR;AAEA,YAAU;AAEV,QAAM,QAAQ,YAAY,MAAM;AAC/B,cAAU;AACV,cAAU;AACV,YAAQ;AAAA,EACT,GAAG,GAAG;AAEN,SAAO,MAAM;AACZ,cAAU;AACV,kBAAc,KAAK;AACnB,WAAO,WAAW;AAAA,EACnB;AACD;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { Octokit } from 'octokit';
2
+
3
+ interface DoesRepositoryExistOptions {
4
+ owner: string;
5
+ repository: string;
6
+ }
7
+ declare function doesRepositoryExist(octokit: Octokit, options: DoesRepositoryExistOptions): Promise<boolean>;
8
+
9
+ export { DoesRepositoryExistOptions, doesRepositoryExist };
@@ -0,0 +1,18 @@
1
+ async function doesRepositoryExist(octokit, options) {
2
+ try {
3
+ await octokit.rest.repos.get({
4
+ owner: options.owner,
5
+ repo: options.repository
6
+ });
7
+ return true;
8
+ } catch (error) {
9
+ if (error.status !== 404) {
10
+ throw error;
11
+ }
12
+ return false;
13
+ }
14
+ }
15
+ export {
16
+ doesRepositoryExist
17
+ };
18
+ //# sourceMappingURL=doesRepositoryExist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/shared/doesRepositoryExist.ts"],"sourcesContent":["import { Octokit, RequestError } from \"octokit\";\n\nexport interface DoesRepositoryExistOptions {\n\towner: string;\n\trepository: string;\n}\n\nexport async function doesRepositoryExist(\n\toctokit: Octokit,\n\toptions: DoesRepositoryExistOptions,\n) {\n\t// Because the Octokit SDK throws on 404s (😡),\n\t// we try/catch to check whether the repo exists.\n\ttry {\n\t\tawait octokit.rest.repos.get({\n\t\t\towner: options.owner,\n\t\t\trepo: options.repository,\n\t\t});\n\t\treturn true;\n\t} catch (error) {\n\t\tif ((error as RequestError).status !== 404) {\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n"],"mappings":"AAOA,eAAsB,oBACrB,SACA,SACC;AAGD,MAAI;AACH,UAAM,QAAQ,KAAK,MAAM,IAAI;AAAA,MAC5B,OAAO,QAAQ;AAAA,MACf,MAAM,QAAQ;AAAA,IACf,CAAC;AACD,WAAO;AAAA,EACR,SAAS,OAAO;AACf,QAAK,MAAuB,WAAW,KAAK;AAC3C,YAAM;AAAA,IACP;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function ensureGitRepository(): Promise<void>;
2
+
3
+ export { ensureGitRepository };
@@ -0,0 +1,12 @@
1
+ import { $ } from "execa";
2
+ async function ensureGitRepository() {
3
+ try {
4
+ await $`git status`;
5
+ } catch {
6
+ await $`git init`;
7
+ }
8
+ }
9
+ export {
10
+ ensureGitRepository
11
+ };
12
+ //# sourceMappingURL=ensureGitRepository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/shared/ensureGitRepository.ts"],"sourcesContent":["import { $ } from \"execa\";\n\nexport async function ensureGitRepository() {\n\ttry {\n\t\tawait $`git status`;\n\t} catch {\n\t\tawait $`git init`;\n\t}\n}\n"],"mappings":"AAAA,SAAS,SAAS;AAElB,eAAsB,sBAAsB;AAC3C,MAAI;AACH,UAAM;AAAA,EACP,QAAQ;AACP,UAAM;AAAA,EACP;AACD;","names":[]}
@@ -0,0 +1,3 @@
1
+ declare function getGitHubUserAsAllContributor(owner: string): Promise<string>;
2
+
3
+ export { getGitHubUserAsAllContributor };
@@ -0,0 +1,31 @@
1
+ import chalk from "chalk";
2
+ import { $ } from "execa";
3
+ async function getGitHubUserAsAllContributor(owner) {
4
+ let user;
5
+ try {
6
+ user = JSON.parse((await $`gh api user`).stdout).login;
7
+ } catch {
8
+ console.warn(
9
+ chalk.gray(
10
+ `Couldn't authenticate GitHub user, falling back to the provided owner name '${owner}'.`
11
+ )
12
+ );
13
+ user = owner;
14
+ }
15
+ const contributions = [
16
+ "code",
17
+ "content",
18
+ "doc",
19
+ "ideas",
20
+ "infra",
21
+ "maintenance",
22
+ "projectManagement",
23
+ "tool"
24
+ ].join(",");
25
+ await $`npx -y all-contributors-cli@6.25 add ${user} ${contributions}`;
26
+ return user;
27
+ }
28
+ export {
29
+ getGitHubUserAsAllContributor
30
+ };
31
+ //# sourceMappingURL=getGitHubUserAsAllContributor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/shared/getGitHubUserAsAllContributor.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { $ } from \"execa\";\n\ninterface GhUserOutput {\n\tlogin: string;\n}\n\nexport async function getGitHubUserAsAllContributor(owner: string) {\n\tlet user: string;\n\ttry {\n\t\tuser = (JSON.parse((await $`gh api user`).stdout) as GhUserOutput).login;\n\t} catch {\n\t\tconsole.warn(\n\t\t\tchalk.gray(\n\t\t\t\t`Couldn't authenticate GitHub user, falling back to the provided owner name '${owner}'.`,\n\t\t\t),\n\t\t);\n\t\tuser = owner;\n\t}\n\n\tconst contributions = [\n\t\t\"code\",\n\t\t\"content\",\n\t\t\"doc\",\n\t\t\"ideas\",\n\t\t\"infra\",\n\t\t\"maintenance\",\n\t\t\"projectManagement\",\n\t\t\"tool\",\n\t].join(\",\");\n\tawait $`npx -y all-contributors-cli@6.25 add ${user} ${contributions}`;\n\n\treturn user;\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,SAAS;AAMlB,eAAsB,8BAA8B,OAAe;AAClE,MAAI;AACJ,MAAI;AACH,WAAQ,KAAK,OAAO,MAAM,gBAAgB,MAAM,EAAmB;AAAA,EACpE,QAAQ;AACP,YAAQ;AAAA,MACP,MAAM;AAAA,QACL,+EAA+E,KAAK;AAAA,MACrF;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAEA,QAAM,gBAAgB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EAAE,KAAK,GAAG;AACV,QAAM,yCAAyC,IAAI,IAAI,aAAa;AAEpE,SAAO;AACR;","names":[]}
@@ -0,0 +1,85 @@
1
+ declare const allArgOptions: {
2
+ readonly author: {
3
+ readonly type: "string";
4
+ };
5
+ readonly base: {
6
+ readonly type: "string";
7
+ };
8
+ readonly "create-repository": {
9
+ readonly type: "boolean";
10
+ };
11
+ readonly description: {
12
+ readonly type: "string";
13
+ };
14
+ readonly email: {
15
+ readonly type: "string";
16
+ };
17
+ readonly "exclude-compliance": {
18
+ readonly type: "boolean";
19
+ };
20
+ readonly "exclude-contributors": {
21
+ readonly type: "boolean";
22
+ };
23
+ readonly "exclude-lint-json": {
24
+ readonly type: "boolean";
25
+ };
26
+ readonly "exclude-lint-knip": {
27
+ readonly type: "boolean";
28
+ };
29
+ readonly "exclude-lint-md": {
30
+ readonly type: "boolean";
31
+ };
32
+ readonly "exclude-lint-package-json": {
33
+ readonly type: "boolean";
34
+ };
35
+ readonly "exclude-lint-packages": {
36
+ readonly type: "boolean";
37
+ };
38
+ readonly "exclude-lint-perfectionist": {
39
+ readonly type: "boolean";
40
+ };
41
+ readonly "exclude-lint-spelling": {
42
+ readonly type: "boolean";
43
+ };
44
+ readonly "exclude-lint-yml": {
45
+ readonly type: "boolean";
46
+ };
47
+ readonly "exclude-releases": {
48
+ readonly type: "boolean";
49
+ };
50
+ readonly "exclude-renovate": {
51
+ readonly type: "boolean";
52
+ };
53
+ readonly "exclude-tests": {
54
+ readonly type: "boolean";
55
+ };
56
+ readonly funding: {
57
+ readonly type: "string";
58
+ };
59
+ readonly owner: {
60
+ readonly type: "string";
61
+ };
62
+ readonly repository: {
63
+ readonly type: "string";
64
+ };
65
+ readonly "skip-github-api": {
66
+ readonly type: "boolean";
67
+ };
68
+ readonly "skip-install": {
69
+ readonly type: "boolean";
70
+ };
71
+ readonly "skip-removal": {
72
+ readonly type: "boolean";
73
+ };
74
+ readonly "skip-restore": {
75
+ readonly type: "boolean";
76
+ };
77
+ readonly "skip-uninstall": {
78
+ readonly type: "boolean";
79
+ };
80
+ readonly title: {
81
+ readonly type: "string";
82
+ };
83
+ };
84
+
85
+ export { allArgOptions };
@@ -0,0 +1,33 @@
1
+ const allArgOptions = {
2
+ author: { type: "string" },
3
+ base: { type: "string" },
4
+ "create-repository": { type: "boolean" },
5
+ description: { type: "string" },
6
+ email: { type: "string" },
7
+ "exclude-compliance": { type: "boolean" },
8
+ "exclude-contributors": { type: "boolean" },
9
+ "exclude-lint-json": { type: "boolean" },
10
+ "exclude-lint-knip": { type: "boolean" },
11
+ "exclude-lint-md": { type: "boolean" },
12
+ "exclude-lint-package-json": { type: "boolean" },
13
+ "exclude-lint-packages": { type: "boolean" },
14
+ "exclude-lint-perfectionist": { type: "boolean" },
15
+ "exclude-lint-spelling": { type: "boolean" },
16
+ "exclude-lint-yml": { type: "boolean" },
17
+ "exclude-releases": { type: "boolean" },
18
+ "exclude-renovate": { type: "boolean" },
19
+ "exclude-tests": { type: "boolean" },
20
+ funding: { type: "string" },
21
+ owner: { type: "string" },
22
+ repository: { type: "string" },
23
+ "skip-github-api": { type: "boolean" },
24
+ "skip-install": { type: "boolean" },
25
+ "skip-removal": { type: "boolean" },
26
+ "skip-restore": { type: "boolean" },
27
+ "skip-uninstall": { type: "boolean" },
28
+ title: { type: "string" }
29
+ };
30
+ export {
31
+ allArgOptions
32
+ };
33
+ //# sourceMappingURL=args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/shared/options/args.ts"],"sourcesContent":["export const allArgOptions = {\n\tauthor: { type: \"string\" },\n\tbase: { type: \"string\" },\n\t\"create-repository\": { type: \"boolean\" },\n\tdescription: { type: \"string\" },\n\temail: { type: \"string\" },\n\t\"exclude-compliance\": { type: \"boolean\" },\n\t\"exclude-contributors\": { type: \"boolean\" },\n\t\"exclude-lint-json\": { type: \"boolean\" },\n\t\"exclude-lint-knip\": { type: \"boolean\" },\n\t\"exclude-lint-md\": { type: \"boolean\" },\n\t\"exclude-lint-package-json\": { type: \"boolean\" },\n\t\"exclude-lint-packages\": { type: \"boolean\" },\n\t\"exclude-lint-perfectionist\": { type: \"boolean\" },\n\t\"exclude-lint-spelling\": { type: \"boolean\" },\n\t\"exclude-lint-yml\": { type: \"boolean\" },\n\t\"exclude-releases\": { type: \"boolean\" },\n\t\"exclude-renovate\": { type: \"boolean\" },\n\t\"exclude-tests\": { type: \"boolean\" },\n\tfunding: { type: \"string\" },\n\towner: { type: \"string\" },\n\trepository: { type: \"string\" },\n\t\"skip-github-api\": { type: \"boolean\" },\n\t\"skip-install\": { type: \"boolean\" },\n\t\"skip-removal\": { type: \"boolean\" },\n\t\"skip-restore\": { type: \"boolean\" },\n\t\"skip-uninstall\": { type: \"boolean\" },\n\ttitle: { type: \"string\" },\n} as const;\n"],"mappings":"AAAO,MAAM,gBAAgB;AAAA,EAC5B,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,EACvB,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,aAAa,EAAE,MAAM,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,sBAAsB,EAAE,MAAM,UAAU;AAAA,EACxC,wBAAwB,EAAE,MAAM,UAAU;AAAA,EAC1C,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,qBAAqB,EAAE,MAAM,UAAU;AAAA,EACvC,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,6BAA6B,EAAE,MAAM,UAAU;AAAA,EAC/C,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,8BAA8B,EAAE,MAAM,UAAU;AAAA,EAChD,yBAAyB,EAAE,MAAM,UAAU;AAAA,EAC3C,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,oBAAoB,EAAE,MAAM,UAAU;AAAA,EACtC,iBAAiB,EAAE,MAAM,UAAU;AAAA,EACnC,SAAS,EAAE,MAAM,SAAS;AAAA,EAC1B,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,YAAY,EAAE,MAAM,SAAS;AAAA,EAC7B,mBAAmB,EAAE,MAAM,UAAU;AAAA,EACrC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,gBAAgB,EAAE,MAAM,UAAU;AAAA,EAClC,kBAAkB,EAAE,MAAM,UAAU;AAAA,EACpC,OAAO,EAAE,MAAM,SAAS;AACzB;","names":[]}
@@ -0,0 +1,5 @@
1
+ import { Options } from '../types.js';
2
+
3
+ declare function augmentOptionsWithExcludes(options: Options): Promise<Options>;
4
+
5
+ export { augmentOptionsWithExcludes };