@gluhar/cli 3.0.0 → 3.0.2

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 (427) hide show
  1. package/CHANGELOG.md +628 -0
  2. package/README.md +11 -0
  3. package/package.json +46 -46
  4. package/src/GlobalOptions.ts +8 -0
  5. package/src/commands/blank/BlankOptions.ts +3 -0
  6. package/src/commands/blank/blank.ts +6 -0
  7. package/src/commands/blank/index.ts +8 -0
  8. package/src/commands/blank/log.ts +3 -0
  9. package/src/commands/build/BuildOptions.ts +3 -0
  10. package/src/commands/build/build.ts +24 -0
  11. package/src/commands/build/index.ts +8 -0
  12. package/src/commands/build/log.ts +3 -0
  13. package/src/commands/deinstall/DeinstallOptions.ts +3 -0
  14. package/src/commands/deinstall/deinstall.ts +19 -0
  15. package/src/commands/deinstall/index.ts +11 -0
  16. package/src/commands/deinstall/log.ts +3 -0
  17. package/src/commands/deploy/DeployOptions.ts +6 -0
  18. package/src/commands/deploy/deploy.ts +39 -0
  19. package/src/commands/deploy/deployIos.ts +48 -0
  20. package/src/commands/deploy/index.ts +20 -0
  21. package/src/commands/deploy/log.ts +3 -0
  22. package/src/commands/deploy/setSsr.ts +25 -0
  23. package/src/commands/dev/DevOptions.ts +4 -0
  24. package/src/commands/dev/dev.ts +15 -0
  25. package/src/commands/dev/devIos.ts +23 -0
  26. package/src/commands/dev/index.ts +12 -0
  27. package/src/commands/dev/log.ts +3 -0
  28. package/src/commands/generate/GenerateOptions.ts +9 -0
  29. package/src/commands/generate/generate.ts +29 -0
  30. package/src/commands/generate/generateCommand.ts +46 -0
  31. package/src/commands/generate/generateProject.ts +115 -0
  32. package/src/commands/generate/index.ts +19 -0
  33. package/src/commands/generate/log.ts +3 -0
  34. package/src/commands/index.ts +21 -0
  35. package/src/commands/reinstall/ReinstallOptions.ts +3 -0
  36. package/src/commands/reinstall/index.ts +11 -0
  37. package/src/commands/reinstall/log.ts +3 -0
  38. package/src/commands/reinstall/reinstall.ts +13 -0
  39. package/src/commands/release/ReleaseOptions.ts +8 -0
  40. package/src/commands/release/index.ts +40 -0
  41. package/src/commands/release/log.ts +3 -0
  42. package/src/commands/release/publish.ts +18 -0
  43. package/src/commands/release/release.ts +24 -0
  44. package/src/commands/release/tag.ts +119 -0
  45. package/src/commands/upgrade/UpgradeOptions.ts +3 -0
  46. package/src/commands/upgrade/index.ts +10 -0
  47. package/src/commands/upgrade/log.ts +3 -0
  48. package/src/commands/upgrade/upgrade.ts +10 -0
  49. package/src/commands/version/VersionOptions.ts +7 -0
  50. package/src/commands/version/getPreid.ts +7 -0
  51. package/src/commands/version/index.ts +18 -0
  52. package/src/commands/version/log.ts +3 -0
  53. package/src/commands/version/pimpChangelogs.ts +43 -0
  54. package/src/commands/version/version.ts +33 -0
  55. package/src/constants.ts +5 -0
  56. package/src/index.ts +24 -0
  57. package/src/preAction.ts +93 -0
  58. package/src/scripts/cmd/cd.ts +9 -0
  59. package/src/scripts/cmd/{executeBash.d.ts → executeBash.ts} +20 -10
  60. package/src/scripts/cmd/executeCmd.ts +23 -0
  61. package/src/scripts/cmd/{getBashOutput.d.ts → getBashOutput.ts} +23 -10
  62. package/src/scripts/cmd/getCmdOutput.ts +26 -0
  63. package/src/scripts/cmd/{index.d.ts → index.ts} +10 -8
  64. package/src/scripts/cmd/log.ts +3 -0
  65. package/src/scripts/cmd/parseArgs.ts +44 -0
  66. package/src/scripts/cmd/parseBashArgs.ts +21 -0
  67. package/src/scripts/cmd/types.ts +13 -0
  68. package/src/scripts/filesystem/copyDir.ts +29 -0
  69. package/src/scripts/filesystem/copyFiles.ts +75 -0
  70. package/src/scripts/filesystem/findFile.ts +29 -0
  71. package/src/scripts/filesystem/index.ts +15 -0
  72. package/src/scripts/filesystem/loadJsonFile.ts +17 -0
  73. package/src/scripts/filesystem/log.ts +3 -0
  74. package/src/scripts/filesystem/readDirRecursive.ts +21 -0
  75. package/src/scripts/git/branch/branchDelete.ts +32 -0
  76. package/src/scripts/git/branch/branchExists.ts +14 -0
  77. package/src/scripts/git/branch/checkout.ts +19 -0
  78. package/src/scripts/git/branch/getCurrentBranch.ts +37 -0
  79. package/src/scripts/git/clone.ts +20 -0
  80. package/src/scripts/git/commit.sh +0 -0
  81. package/src/scripts/git/getRepo.ts +11 -0
  82. package/src/scripts/git/index.ts +44 -0
  83. package/src/scripts/git/log.ts +3 -0
  84. package/src/scripts/git/openPr.ts +21 -0
  85. package/src/scripts/git/remoteStatus.ts +28 -0
  86. package/src/scripts/git/tag/createTag.ts +28 -0
  87. package/src/scripts/git/tag/deleteTag.ts +11 -0
  88. package/src/scripts/git/tag/getTags.ts +6 -0
  89. package/src/scripts/git/tag/pushAllTags.ts +6 -0
  90. package/src/scripts/git/tag/renameTag.ts +12 -0
  91. package/src/scripts/lerna/changed.ts +11 -0
  92. package/src/scripts/lerna/constants.ts +6 -0
  93. package/src/scripts/lerna/filterByDependency.ts +21 -0
  94. package/src/scripts/lerna/getConfig.ts +12 -0
  95. package/src/scripts/lerna/getDependencies.ts +25 -0
  96. package/src/scripts/lerna/getDetails.ts +44 -0
  97. package/src/scripts/lerna/index.ts +18 -0
  98. package/src/scripts/lerna/log.ts +3 -0
  99. package/src/scripts/lerna/publish.sh +0 -0
  100. package/src/scripts/lerna/types.ts +64 -0
  101. package/src/scripts/lerna/version.sh +1 -1
  102. package/src/utils/chalk.ts +4 -0
  103. package/src/utils/common.ts +16 -0
  104. package/src/utils/{index.d.ts → index.ts} +3 -4
  105. package/src/utils/inquirer.ts +20 -0
  106. package/src/utils/logger.ts +51 -0
  107. package/tsconfig.json +28 -0
  108. package/src/GlobalOptions.d.ts +0 -8
  109. package/src/GlobalOptions.d.ts.map +0 -1
  110. package/src/GlobalOptions.js +0 -2
  111. package/src/commands/blank/BlankOptions.d.ts +0 -4
  112. package/src/commands/blank/BlankOptions.d.ts.map +0 -1
  113. package/src/commands/blank/BlankOptions.js +0 -2
  114. package/src/commands/blank/blank.d.ts +0 -3
  115. package/src/commands/blank/blank.d.ts.map +0 -1
  116. package/src/commands/blank/blank.js +0 -8
  117. package/src/commands/blank/index.d.ts +0 -4
  118. package/src/commands/blank/index.d.ts.map +0 -1
  119. package/src/commands/blank/index.js +0 -9
  120. package/src/commands/blank/log.d.ts +0 -2
  121. package/src/commands/blank/log.d.ts.map +0 -1
  122. package/src/commands/blank/log.js +0 -5
  123. package/src/commands/build/BuildOptions.d.ts +0 -4
  124. package/src/commands/build/BuildOptions.d.ts.map +0 -1
  125. package/src/commands/build/BuildOptions.js +0 -2
  126. package/src/commands/build/build.d.ts +0 -3
  127. package/src/commands/build/build.d.ts.map +0 -1
  128. package/src/commands/build/build.js +0 -22
  129. package/src/commands/build/index.d.ts +0 -4
  130. package/src/commands/build/index.d.ts.map +0 -1
  131. package/src/commands/build/index.js +0 -9
  132. package/src/commands/build/log.d.ts +0 -2
  133. package/src/commands/build/log.d.ts.map +0 -1
  134. package/src/commands/build/log.js +0 -5
  135. package/src/commands/danka/DankaOptions.d.ts +0 -4
  136. package/src/commands/danka/DankaOptions.d.ts.map +0 -1
  137. package/src/commands/danka/DankaOptions.js +0 -2
  138. package/src/commands/danka/danka.d.ts +0 -3
  139. package/src/commands/danka/danka.d.ts.map +0 -1
  140. package/src/commands/danka/danka.js +0 -8
  141. package/src/commands/danka/index.d.ts +0 -4
  142. package/src/commands/danka/index.d.ts.map +0 -1
  143. package/src/commands/danka/index.js +0 -9
  144. package/src/commands/danka/log.d.ts +0 -2
  145. package/src/commands/danka/log.d.ts.map +0 -1
  146. package/src/commands/danka/log.js +0 -5
  147. package/src/commands/deinstall/DeinstallOptions.d.ts +0 -4
  148. package/src/commands/deinstall/DeinstallOptions.d.ts.map +0 -1
  149. package/src/commands/deinstall/DeinstallOptions.js +0 -2
  150. package/src/commands/deinstall/deinstall.d.ts +0 -3
  151. package/src/commands/deinstall/deinstall.d.ts.map +0 -1
  152. package/src/commands/deinstall/deinstall.js +0 -21
  153. package/src/commands/deinstall/index.d.ts +0 -4
  154. package/src/commands/deinstall/index.d.ts.map +0 -1
  155. package/src/commands/deinstall/index.js +0 -9
  156. package/src/commands/deinstall/log.d.ts +0 -2
  157. package/src/commands/deinstall/log.d.ts.map +0 -1
  158. package/src/commands/deinstall/log.js +0 -5
  159. package/src/commands/deploy/DeployOptions.d.ts +0 -7
  160. package/src/commands/deploy/DeployOptions.d.ts.map +0 -1
  161. package/src/commands/deploy/DeployOptions.js +0 -2
  162. package/src/commands/deploy/deploy.d.ts +0 -3
  163. package/src/commands/deploy/deploy.d.ts.map +0 -1
  164. package/src/commands/deploy/deploy.js +0 -33
  165. package/src/commands/deploy/deployIos.d.ts +0 -2
  166. package/src/commands/deploy/deployIos.d.ts.map +0 -1
  167. package/src/commands/deploy/deployIos.js +0 -44
  168. package/src/commands/deploy/index.d.ts +0 -4
  169. package/src/commands/deploy/index.d.ts.map +0 -1
  170. package/src/commands/deploy/index.js +0 -12
  171. package/src/commands/deploy/log.d.ts +0 -2
  172. package/src/commands/deploy/log.d.ts.map +0 -1
  173. package/src/commands/deploy/log.js +0 -5
  174. package/src/commands/deploy/setSsr.d.ts +0 -2
  175. package/src/commands/deploy/setSsr.d.ts.map +0 -1
  176. package/src/commands/deploy/setSsr.js +0 -25
  177. package/src/commands/dev/DevOptions.d.ts +0 -5
  178. package/src/commands/dev/DevOptions.d.ts.map +0 -1
  179. package/src/commands/dev/DevOptions.js +0 -2
  180. package/src/commands/dev/dev.d.ts +0 -3
  181. package/src/commands/dev/dev.d.ts.map +0 -1
  182. package/src/commands/dev/dev.js +0 -16
  183. package/src/commands/dev/devIos.d.ts +0 -3
  184. package/src/commands/dev/devIos.d.ts.map +0 -1
  185. package/src/commands/dev/devIos.js +0 -26
  186. package/src/commands/dev/index.d.ts +0 -4
  187. package/src/commands/dev/index.d.ts.map +0 -1
  188. package/src/commands/dev/index.js +0 -10
  189. package/src/commands/dev/log.d.ts +0 -2
  190. package/src/commands/dev/log.d.ts.map +0 -1
  191. package/src/commands/dev/log.js +0 -5
  192. package/src/commands/generate/GenerateOptions.d.ts +0 -9
  193. package/src/commands/generate/GenerateOptions.d.ts.map +0 -1
  194. package/src/commands/generate/GenerateOptions.js +0 -4
  195. package/src/commands/generate/generate.d.ts +0 -3
  196. package/src/commands/generate/generate.d.ts.map +0 -1
  197. package/src/commands/generate/generate.js +0 -22
  198. package/src/commands/generate/generateCommand.d.ts +0 -2
  199. package/src/commands/generate/generateCommand.d.ts.map +0 -1
  200. package/src/commands/generate/generateCommand.js +0 -36
  201. package/src/commands/generate/generateProject.d.ts +0 -3
  202. package/src/commands/generate/generateProject.d.ts.map +0 -1
  203. package/src/commands/generate/generateProject.js +0 -83
  204. package/src/commands/generate/index.d.ts +0 -4
  205. package/src/commands/generate/index.d.ts.map +0 -1
  206. package/src/commands/generate/index.js +0 -14
  207. package/src/commands/generate/log.d.ts +0 -2
  208. package/src/commands/generate/log.d.ts.map +0 -1
  209. package/src/commands/generate/log.js +0 -5
  210. package/src/commands/index.d.ts +0 -3
  211. package/src/commands/index.d.ts.map +0 -1
  212. package/src/commands/index.js +0 -25
  213. package/src/commands/kiss/KissOptions.d.ts +0 -4
  214. package/src/commands/kiss/KissOptions.d.ts.map +0 -1
  215. package/src/commands/kiss/KissOptions.js +0 -2
  216. package/src/commands/kiss/index.d.ts +0 -4
  217. package/src/commands/kiss/index.d.ts.map +0 -1
  218. package/src/commands/kiss/index.js +0 -9
  219. package/src/commands/kiss/kiss.d.ts +0 -3
  220. package/src/commands/kiss/kiss.d.ts.map +0 -1
  221. package/src/commands/kiss/kiss.js +0 -8
  222. package/src/commands/kiss/log.d.ts +0 -2
  223. package/src/commands/kiss/log.d.ts.map +0 -1
  224. package/src/commands/kiss/log.js +0 -5
  225. package/src/commands/reinstall/ReinstallOptions.d.ts +0 -4
  226. package/src/commands/reinstall/ReinstallOptions.d.ts.map +0 -1
  227. package/src/commands/reinstall/ReinstallOptions.js +0 -2
  228. package/src/commands/reinstall/index.d.ts +0 -4
  229. package/src/commands/reinstall/index.d.ts.map +0 -1
  230. package/src/commands/reinstall/index.js +0 -9
  231. package/src/commands/reinstall/log.d.ts +0 -2
  232. package/src/commands/reinstall/log.d.ts.map +0 -1
  233. package/src/commands/reinstall/log.js +0 -5
  234. package/src/commands/reinstall/reinstall.d.ts +0 -3
  235. package/src/commands/reinstall/reinstall.d.ts.map +0 -1
  236. package/src/commands/reinstall/reinstall.js +0 -14
  237. package/src/commands/release/ReleaseOptions.d.ts +0 -9
  238. package/src/commands/release/ReleaseOptions.d.ts.map +0 -1
  239. package/src/commands/release/ReleaseOptions.js +0 -2
  240. package/src/commands/release/index.d.ts +0 -4
  241. package/src/commands/release/index.d.ts.map +0 -1
  242. package/src/commands/release/index.js +0 -22
  243. package/src/commands/release/log.d.ts +0 -2
  244. package/src/commands/release/log.d.ts.map +0 -1
  245. package/src/commands/release/log.js +0 -5
  246. package/src/commands/release/publish.d.ts +0 -3
  247. package/src/commands/release/publish.d.ts.map +0 -1
  248. package/src/commands/release/publish.js +0 -18
  249. package/src/commands/release/release.d.ts +0 -3
  250. package/src/commands/release/release.d.ts.map +0 -1
  251. package/src/commands/release/release.js +0 -24
  252. package/src/commands/release/tag.d.ts +0 -23
  253. package/src/commands/release/tag.d.ts.map +0 -1
  254. package/src/commands/release/tag.js +0 -90
  255. package/src/commands/upgrade/UpgradeOptions.d.ts +0 -4
  256. package/src/commands/upgrade/UpgradeOptions.d.ts.map +0 -1
  257. package/src/commands/upgrade/UpgradeOptions.js +0 -2
  258. package/src/commands/upgrade/index.d.ts +0 -4
  259. package/src/commands/upgrade/index.d.ts.map +0 -1
  260. package/src/commands/upgrade/index.js +0 -9
  261. package/src/commands/upgrade/log.d.ts +0 -2
  262. package/src/commands/upgrade/log.d.ts.map +0 -1
  263. package/src/commands/upgrade/log.js +0 -5
  264. package/src/commands/upgrade/upgrade.d.ts +0 -3
  265. package/src/commands/upgrade/upgrade.d.ts.map +0 -1
  266. package/src/commands/upgrade/upgrade.js +0 -11
  267. package/src/commands/version/VersionOptions.d.ts +0 -8
  268. package/src/commands/version/VersionOptions.d.ts.map +0 -1
  269. package/src/commands/version/VersionOptions.js +0 -2
  270. package/src/commands/version/getPreid.d.ts +0 -2
  271. package/src/commands/version/getPreid.d.ts.map +0 -1
  272. package/src/commands/version/getPreid.js +0 -10
  273. package/src/commands/version/index.d.ts +0 -4
  274. package/src/commands/version/index.d.ts.map +0 -1
  275. package/src/commands/version/index.js +0 -12
  276. package/src/commands/version/log.d.ts +0 -2
  277. package/src/commands/version/log.d.ts.map +0 -1
  278. package/src/commands/version/log.js +0 -5
  279. package/src/commands/version/pimpChangelogs.d.ts +0 -2
  280. package/src/commands/version/pimpChangelogs.d.ts.map +0 -1
  281. package/src/commands/version/pimpChangelogs.js +0 -37
  282. package/src/commands/version/version.d.ts +0 -3
  283. package/src/commands/version/version.d.ts.map +0 -1
  284. package/src/commands/version/version.js +0 -33
  285. package/src/constants.d.ts +0 -4
  286. package/src/constants.d.ts.map +0 -1
  287. package/src/constants.js +0 -7
  288. package/src/index.d.ts +0 -3
  289. package/src/index.d.ts.map +0 -1
  290. package/src/index.js +0 -24
  291. package/src/preAction.d.ts +0 -3
  292. package/src/preAction.d.ts.map +0 -1
  293. package/src/preAction.js +0 -76
  294. package/src/scripts/cmd/cd.d.ts +0 -2
  295. package/src/scripts/cmd/cd.d.ts.map +0 -1
  296. package/src/scripts/cmd/cd.js +0 -15
  297. package/src/scripts/cmd/executeBash.d.ts.map +0 -1
  298. package/src/scripts/cmd/executeBash.js +0 -21
  299. package/src/scripts/cmd/executeCmd.d.ts +0 -9
  300. package/src/scripts/cmd/executeCmd.d.ts.map +0 -1
  301. package/src/scripts/cmd/executeCmd.js +0 -23
  302. package/src/scripts/cmd/getBashOutput.d.ts.map +0 -1
  303. package/src/scripts/cmd/getBashOutput.js +0 -19
  304. package/src/scripts/cmd/getCmdOutput.d.ts +0 -10
  305. package/src/scripts/cmd/getCmdOutput.d.ts.map +0 -1
  306. package/src/scripts/cmd/getCmdOutput.js +0 -26
  307. package/src/scripts/cmd/index.d.ts.map +0 -1
  308. package/src/scripts/cmd/index.js +0 -25
  309. package/src/scripts/cmd/log.d.ts +0 -2
  310. package/src/scripts/cmd/log.d.ts.map +0 -1
  311. package/src/scripts/cmd/log.js +0 -5
  312. package/src/scripts/cmd/parseArgs.d.ts +0 -3
  313. package/src/scripts/cmd/parseArgs.d.ts.map +0 -1
  314. package/src/scripts/cmd/parseArgs.js +0 -41
  315. package/src/scripts/cmd/parseBashArgs.d.ts +0 -3
  316. package/src/scripts/cmd/parseBashArgs.d.ts.map +0 -1
  317. package/src/scripts/cmd/parseBashArgs.js +0 -16
  318. package/src/scripts/cmd/types.d.ts +0 -12
  319. package/src/scripts/cmd/types.d.ts.map +0 -1
  320. package/src/scripts/cmd/types.js +0 -2
  321. package/src/scripts/filesystem/copyDir.d.ts +0 -9
  322. package/src/scripts/filesystem/copyDir.d.ts.map +0 -1
  323. package/src/scripts/filesystem/copyDir.js +0 -26
  324. package/src/scripts/filesystem/copyFiles.d.ts +0 -11
  325. package/src/scripts/filesystem/copyFiles.d.ts.map +0 -1
  326. package/src/scripts/filesystem/copyFiles.js +0 -59
  327. package/src/scripts/filesystem/findFile.d.ts +0 -2
  328. package/src/scripts/filesystem/findFile.d.ts.map +0 -1
  329. package/src/scripts/filesystem/findFile.js +0 -24
  330. package/src/scripts/filesystem/index.d.ts +0 -10
  331. package/src/scripts/filesystem/index.d.ts.map +0 -1
  332. package/src/scripts/filesystem/index.js +0 -17
  333. package/src/scripts/filesystem/loadJsonFile.d.ts +0 -2
  334. package/src/scripts/filesystem/loadJsonFile.d.ts.map +0 -1
  335. package/src/scripts/filesystem/loadJsonFile.js +0 -18
  336. package/src/scripts/filesystem/log.d.ts +0 -2
  337. package/src/scripts/filesystem/log.d.ts.map +0 -1
  338. package/src/scripts/filesystem/log.js +0 -5
  339. package/src/scripts/filesystem/readDirRecursive.d.ts +0 -2
  340. package/src/scripts/filesystem/readDirRecursive.d.ts.map +0 -1
  341. package/src/scripts/filesystem/readDirRecursive.js +0 -16
  342. package/src/scripts/git/branch/branchDelete.d.ts +0 -6
  343. package/src/scripts/git/branch/branchDelete.d.ts.map +0 -1
  344. package/src/scripts/git/branch/branchDelete.js +0 -24
  345. package/src/scripts/git/branch/branchExists.d.ts +0 -5
  346. package/src/scripts/git/branch/branchExists.d.ts.map +0 -1
  347. package/src/scripts/git/branch/branchExists.js +0 -15
  348. package/src/scripts/git/branch/checkout.d.ts +0 -5
  349. package/src/scripts/git/branch/checkout.d.ts.map +0 -1
  350. package/src/scripts/git/branch/checkout.js +0 -15
  351. package/src/scripts/git/branch/getCurrentBranch.d.ts +0 -11
  352. package/src/scripts/git/branch/getCurrentBranch.d.ts.map +0 -1
  353. package/src/scripts/git/branch/getCurrentBranch.js +0 -28
  354. package/src/scripts/git/clone.d.ts +0 -10
  355. package/src/scripts/git/clone.d.ts.map +0 -1
  356. package/src/scripts/git/clone.js +0 -14
  357. package/src/scripts/git/getRepo.d.ts +0 -2
  358. package/src/scripts/git/getRepo.d.ts.map +0 -1
  359. package/src/scripts/git/getRepo.js +0 -13
  360. package/src/scripts/git/index.d.ts +0 -29
  361. package/src/scripts/git/index.d.ts.map +0 -1
  362. package/src/scripts/git/index.js +0 -40
  363. package/src/scripts/git/log.d.ts +0 -2
  364. package/src/scripts/git/log.d.ts.map +0 -1
  365. package/src/scripts/git/log.js +0 -5
  366. package/src/scripts/git/openPr.d.ts +0 -2
  367. package/src/scripts/git/openPr.d.ts.map +0 -1
  368. package/src/scripts/git/openPr.js +0 -20
  369. package/src/scripts/git/remoteStatus.d.ts +0 -3
  370. package/src/scripts/git/remoteStatus.d.ts.map +0 -1
  371. package/src/scripts/git/remoteStatus.js +0 -22
  372. package/src/scripts/git/tag/createTag.d.ts +0 -18
  373. package/src/scripts/git/tag/createTag.d.ts.map +0 -1
  374. package/src/scripts/git/tag/createTag.js +0 -18
  375. package/src/scripts/git/tag/deleteTag.d.ts +0 -2
  376. package/src/scripts/git/tag/deleteTag.d.ts.map +0 -1
  377. package/src/scripts/git/tag/deleteTag.js +0 -13
  378. package/src/scripts/git/tag/getTags.d.ts +0 -2
  379. package/src/scripts/git/tag/getTags.d.ts.map +0 -1
  380. package/src/scripts/git/tag/getTags.js +0 -8
  381. package/src/scripts/git/tag/pushAllTags.d.ts +0 -2
  382. package/src/scripts/git/tag/pushAllTags.d.ts.map +0 -1
  383. package/src/scripts/git/tag/pushAllTags.js +0 -8
  384. package/src/scripts/git/tag/renameTag.d.ts +0 -2
  385. package/src/scripts/git/tag/renameTag.d.ts.map +0 -1
  386. package/src/scripts/git/tag/renameTag.js +0 -14
  387. package/src/scripts/lerna/changed.d.ts +0 -3
  388. package/src/scripts/lerna/changed.d.ts.map +0 -1
  389. package/src/scripts/lerna/changed.js +0 -13
  390. package/src/scripts/lerna/constants.d.ts +0 -5
  391. package/src/scripts/lerna/constants.d.ts.map +0 -1
  392. package/src/scripts/lerna/constants.js +0 -7
  393. package/src/scripts/lerna/filterByDependency.d.ts +0 -7
  394. package/src/scripts/lerna/filterByDependency.d.ts.map +0 -1
  395. package/src/scripts/lerna/filterByDependency.js +0 -18
  396. package/src/scripts/lerna/getConfig.d.ts +0 -3
  397. package/src/scripts/lerna/getConfig.d.ts.map +0 -1
  398. package/src/scripts/lerna/getConfig.js +0 -13
  399. package/src/scripts/lerna/getDependencies.d.ts +0 -9
  400. package/src/scripts/lerna/getDependencies.d.ts.map +0 -1
  401. package/src/scripts/lerna/getDependencies.js +0 -23
  402. package/src/scripts/lerna/getDetails.d.ts +0 -3
  403. package/src/scripts/lerna/getDetails.d.ts.map +0 -1
  404. package/src/scripts/lerna/getDetails.js +0 -38
  405. package/src/scripts/lerna/index.d.ts +0 -14
  406. package/src/scripts/lerna/index.d.ts.map +0 -1
  407. package/src/scripts/lerna/index.js +0 -19
  408. package/src/scripts/lerna/log.d.ts +0 -2
  409. package/src/scripts/lerna/log.d.ts.map +0 -1
  410. package/src/scripts/lerna/log.js +0 -5
  411. package/src/scripts/lerna/types.d.ts +0 -62
  412. package/src/scripts/lerna/types.d.ts.map +0 -1
  413. package/src/scripts/lerna/types.js +0 -2
  414. package/src/utils/chalk.d.ts +0 -4
  415. package/src/utils/chalk.d.ts.map +0 -1
  416. package/src/utils/chalk.js +0 -9
  417. package/src/utils/common.d.ts +0 -2
  418. package/src/utils/common.d.ts.map +0 -1
  419. package/src/utils/common.js +0 -5
  420. package/src/utils/index.d.ts.map +0 -1
  421. package/src/utils/index.js +0 -19
  422. package/src/utils/inquirer.d.ts +0 -5
  423. package/src/utils/inquirer.d.ts.map +0 -1
  424. package/src/utils/inquirer.js +0 -21
  425. package/src/utils/logger.d.ts +0 -9
  426. package/src/utils/logger.d.ts.map +0 -1
  427. package/src/utils/logger.js +0 -36
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "name": "@gluhar/cli",
3
- "version": "3.0.0",
4
- "description": "Gluhar cli commands and scripts",
5
- "exports": {
6
- ".": "./src/index.ts",
7
- "./*": "./src/*/index.ts"
8
- },
9
- "main": "./src/index.js",
10
- "bin": {
11
- "gluhar": "./src/index.js"
12
- },
13
- "scripts": {
14
- "clean": "rm -rf dist",
15
- "copy:files": "copyfiles \"src/**/*.sh\" dist",
16
- "build": "tsc && tsc-alias && npm run copy:files",
17
- "prepack": "npm run build",
18
- "dev": "npm run build && node ./dist/src/index.js"
19
- },
20
- "dependencies": {
21
- "chalk": "^4.1.2",
22
- "commander": "^12.1.0",
23
- "fs-extra": "^11.2.0",
24
- "glob": "^11.0.0",
25
- "humps": "^2.0.1",
26
- "inquirer": "^8.2.6",
27
- "istextorbinary": "^9.5.0",
28
- "npmlog": "^7.0.1",
29
- "shelljs": "^0.8.5",
30
- "ts-morph": "^25.0.0"
31
- },
32
- "devDependencies": {
33
- "@nuxt/eslint-config": "^0.5.6",
34
- "@nuxt/schema": "^3.13.1",
35
- "@types/fs-extra": "^11.0.4",
36
- "@types/humps": "^2.0.6",
37
- "@types/inquirer": "^8.2.10",
38
- "@types/istextorbinary": "^2.3.4",
39
- "@types/node": "^20.16.5",
40
- "@types/npmlog": "^7.0.0",
41
- "@types/shelljs": "^0.8.15",
42
- "eslint": "^9.10.0",
43
- "tsc-alias": "^1.8.10",
44
- "tsconfig-paths": "^4.2.0",
45
- "typescript": "^5.5.4"
46
- },
47
- "gitHead": "2436c442afd73078fc82efdaee9553110b3b790e"
2
+ "name": "@gluhar/cli",
3
+ "version": "3.0.2",
4
+ "description": "Gluhar cli commands and scripts",
5
+ "exports": {
6
+ ".": "./src/index.ts",
7
+ "./*": "./src/*/index.ts"
8
+ },
9
+ "main": "./src/index.js",
10
+ "bin": {
11
+ "gluhar": "./src/index.js"
12
+ },
13
+ "scripts": {
14
+ "clean": "rm -rf dist",
15
+ "copy:files": "copyfiles \"src/**/*.sh\" dist",
16
+ "build": "tsc && tsc-alias && npm run copy:files",
17
+ "prepack": "npm run build",
18
+ "dev": "npm run build && node ./dist/src/index.js"
19
+ },
20
+ "dependencies": {
21
+ "chalk": "^4.1.2",
22
+ "commander": "^12.1.0",
23
+ "fs-extra": "^11.2.0",
24
+ "glob": "^11.0.0",
25
+ "humps": "^2.0.1",
26
+ "inquirer": "^8.2.6",
27
+ "istextorbinary": "^9.5.0",
28
+ "npmlog": "^7.0.1",
29
+ "shelljs": "^0.8.5",
30
+ "ts-morph": "^25.0.0"
31
+ },
32
+ "devDependencies": {
33
+ "@nuxt/eslint-config": "^0.5.6",
34
+ "@nuxt/schema": "^3.13.1",
35
+ "@types/fs-extra": "^11.0.4",
36
+ "@types/humps": "^2.0.6",
37
+ "@types/inquirer": "^8.2.10",
38
+ "@types/istextorbinary": "^2.3.4",
39
+ "@types/node": "^20.16.5",
40
+ "@types/npmlog": "^7.0.0",
41
+ "@types/shelljs": "^0.8.15",
42
+ "eslint": "^9.10.0",
43
+ "tsc-alias": "^1.8.10",
44
+ "tsconfig-paths": "^4.2.0",
45
+ "typescript": "^5.5.4"
46
+ },
47
+ "gitHead": "37c79c38049ee2d91e649523539808c2fdbffd88"
48
48
  }
@@ -0,0 +1,8 @@
1
+ import type { LogLevel } from './utils';
2
+
3
+ export interface GlobalOptions {
4
+ logLevel: LogLevel;
5
+ logPrefix?: string[];
6
+ ci: boolean;
7
+ cwd?: string;
8
+ }
@@ -0,0 +1,3 @@
1
+ export interface BlankOptions {
2
+ blank: boolean;
3
+ }
@@ -0,0 +1,6 @@
1
+ import { BlankOptions } from "./BlankOptions";
2
+ import { log } from "./log";
3
+
4
+ export const blank = (options: BlankOptions) => {
5
+ log.info("blank", options);
6
+ };
@@ -0,0 +1,8 @@
1
+ import { Command } from "commander";
2
+ import { blank } from "./blank";
3
+
4
+ export default new Command()
5
+ .name("blank")
6
+ .description("Description of command.")
7
+ .option("-b, --blank", "A boolean option.")
8
+ .action(blank);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("blank");
@@ -0,0 +1,3 @@
1
+ export interface BuildOptions {
2
+ type: "module";
3
+ }
@@ -0,0 +1,24 @@
1
+ import { executeCmd } from "src/scripts/cmd";
2
+ import { BuildOptions } from "./BuildOptions";
3
+ import { log } from "./log";
4
+
5
+ export const build = (options: BuildOptions) => {
6
+ const { type } = options;
7
+
8
+ // INFO Nuxt modules need a structure of [pkg.json, dist/] to function properly where as my release script needs all pkgs to be released from a dist folder
9
+ if (type === "module") {
10
+ log.info("Build nuxt module in dist");
11
+ executeCmd("nuxt-module-build build");
12
+
13
+ log.info("Copy contents of dist on level down");
14
+ executeCmd('copyfiles "dist/**/*" dist');
15
+
16
+ // log.info("Delete the copied files");
17
+ // executeCmd(
18
+ // "find ./dist -mindepth 1 ! -path './dist/dist*' -exec rm -rf {} +"
19
+ // );
20
+
21
+ log.info("Copy pkg.json and mds to dist as well");
22
+ executeCmd("copyfiles package.json README.md CHANGELOG.md dist");
23
+ }
24
+ };
@@ -0,0 +1,8 @@
1
+ import { Command } from "commander";
2
+ import { build } from "./build";
3
+
4
+ export default new Command()
5
+ .name("build")
6
+ .description("Command for building various things.")
7
+ .option("-t, --type [type]", "What kind of thing to build.")
8
+ .action(build);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("build");
@@ -0,0 +1,3 @@
1
+ export interface DeinstallOptions {
2
+ packages?: boolean;
3
+ }
@@ -0,0 +1,19 @@
1
+ import { executeCmd } from "src/scripts/cmd";
2
+ import { DeinstallOptions } from "./DeinstallOptions";
3
+ import { log } from "./log";
4
+
5
+ export const deinstall = (options: DeinstallOptions) => {
6
+ if (options.packages) {
7
+ // Remove node_modules in each folder inside /packages
8
+ log.info("Deleting node_modules from root and packages. (-p)");
9
+ executeCmd("rm -rf node_modules ./packages/**/node_modules");
10
+ } else {
11
+ // Remove node_modules recursively
12
+ log.info("Deleting node_modules.");
13
+ executeCmd("rm -rf node_modules");
14
+ }
15
+
16
+ // Remove package-lock.json
17
+ log.info("Deleting package-lock.");
18
+ executeCmd("rm package-lock.json");
19
+ };
@@ -0,0 +1,11 @@
1
+ import { Command } from "commander";
2
+ import { deinstall } from "./deinstall";
3
+
4
+ export default new Command()
5
+ .name("deinstall")
6
+ .description("Remove node_modules and package-lock.json.")
7
+ .option(
8
+ "-p, --packages",
9
+ "Deinstall dependencies in /packages (intended for module authors)."
10
+ )
11
+ .action(deinstall);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("deinstall");
@@ -0,0 +1,6 @@
1
+ export interface DeployOptions {
2
+ from?: string;
3
+ ios?: boolean;
4
+ android?: boolean;
5
+ ssr?: boolean;
6
+ }
@@ -0,0 +1,39 @@
1
+ import { git } from "src/scripts/git";
2
+ import { DeployOptions } from "./DeployOptions";
3
+ import { log } from "./log";
4
+ import { deployIos } from "./deployIos";
5
+ import { setSsr } from "./setSsr";
6
+ import { confirmQuestion } from "src/utils";
7
+
8
+ export const deploy = async (options: DeployOptions) => {
9
+ log.info("Deploying app...", options);
10
+
11
+ // Deploy app to iOS
12
+ if (options.ios) {
13
+ deployIos();
14
+ return;
15
+ }
16
+
17
+ // Handle ssr
18
+ if (options.ssr !== undefined) {
19
+ log.info(`Setting ssr to ${options.ssr} and committing to git`);
20
+ setSsr(options.ssr);
21
+ git.commit({ m: `chore: Set SSR to ${options.ssr}` });
22
+ }
23
+
24
+ // Default Deploy app to web
25
+ const fromBranch = options.from || "dev";
26
+ const { remote } = git.branch.exists("deploy");
27
+
28
+ git.branch.checkout("deploy", { newBranch: !remote });
29
+ log.info("Checked out to deploy branch");
30
+
31
+ git.merge(fromBranch, true);
32
+ log.info(`Merged with ${fromBranch}`);
33
+
34
+ git.push("deploy");
35
+ log.info("Pushed to deploy");
36
+
37
+ git.branch.checkout(fromBranch);
38
+ log.info(`Checked out back to ${fromBranch}`);
39
+ };
@@ -0,0 +1,48 @@
1
+ import { executeCmd } from "src/scripts/cmd";
2
+ import { log } from "./log";
3
+ import { Project, SyntaxKind } from "ts-morph";
4
+ import { setSsr } from "./setSsr";
5
+
6
+ const project = new Project();
7
+
8
+ export const deployIos = async (url?: string) => {
9
+ log.info("Deploying iOS app.");
10
+
11
+ // Remove server dev url from capacitor config
12
+ const capConfig = project.addSourceFileAtPathIfExists(
13
+ "./capacitor.config.ts"
14
+ );
15
+ if (!capConfig) return;
16
+
17
+ const capConfigObject = capConfig
18
+ ?.getVariableDeclaration("config")
19
+ ?.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);
20
+ if (!capConfigObject) return;
21
+
22
+ const server = capConfigObject.getProperty("server");
23
+
24
+ if (!url) {
25
+ server?.remove();
26
+ } else {
27
+ if (server) {
28
+ server.set({ initializer: `{ url: '${url}' }` });
29
+ } else {
30
+ capConfigObject.addPropertyAssignment({
31
+ name: "server",
32
+ initializer: `{ url: '${url}' }`,
33
+ });
34
+ }
35
+ }
36
+
37
+ capConfig.saveSync();
38
+
39
+ // Disable ssr from nuxt.config
40
+ setSsr(false);
41
+
42
+ // Generate static nuxt app
43
+ executeCmd("nuxi generate");
44
+
45
+ // Sync and open iOS app with Capacitor
46
+ executeCmd("cap sync ios");
47
+ executeCmd("cap open ios");
48
+ };
@@ -0,0 +1,20 @@
1
+ import { Command } from "commander";
2
+ import { deploy } from "./deploy";
3
+
4
+ export default new Command()
5
+ .name("deploy")
6
+ .description(
7
+ "Deploy a Nuxt app. Check out to deploy branch, merge with dev and check out back to dev."
8
+ )
9
+ .option(
10
+ "--from <branch>",
11
+ "From what branch to deploy. Default is 'dev' so this is used in the event we are deploying from a different branch.",
12
+ "dev"
13
+ )
14
+ .option("--ios", "Deploy app to iOS device using Capacitor.")
15
+ .option("--android", "Deploy app to Android device using Capacitor.")
16
+ .option(
17
+ "--ssr",
18
+ "Set SSR before deployment. Default is undefined for no change."
19
+ )
20
+ .action(deploy);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("deploy");
@@ -0,0 +1,25 @@
1
+ import { Project, SyntaxKind } from "ts-morph";
2
+
3
+ const project = new Project();
4
+
5
+ export const setSsr = (ssr: boolean) => {
6
+ const nuxtConfig = project.addSourceFileAtPath("./nuxt.config.ts");
7
+ if (!nuxtConfig) return;
8
+
9
+ const nuxtConfigDefault = nuxtConfig?.getFirstDescendantByKind(
10
+ SyntaxKind.ObjectLiteralExpression
11
+ );
12
+ if (!nuxtConfigDefault) return;
13
+
14
+ const nuxtConfigSsr = nuxtConfigDefault.getProperty("ssr");
15
+ if (nuxtConfigSsr) {
16
+ nuxtConfigSsr.set({ initializer: `${ssr}` });
17
+ } else {
18
+ nuxtConfigDefault.addPropertyAssignment({
19
+ name: "ssr",
20
+ initializer: `${ssr}`,
21
+ });
22
+ }
23
+
24
+ nuxtConfig.saveSync();
25
+ };
@@ -0,0 +1,4 @@
1
+ export interface DevOptions {
2
+ host?: boolean;
3
+ ios?: boolean;
4
+ }
@@ -0,0 +1,15 @@
1
+ import { executeCmd } from "src/scripts/cmd";
2
+ import { DevOptions } from "./DevOptions";
3
+ import { log } from "./log";
4
+ import { devIos } from "./devIos";
5
+
6
+ export const dev = async (options: DevOptions) => {
7
+ log.info("Running dev...", options);
8
+
9
+ if (options.ios) {
10
+ options.host = true;
11
+ await devIos(options);
12
+ }
13
+ // Run nuxt server
14
+ executeCmd("nuxt dev", options.host ? { host: "0.0.0.0" } : undefined);
15
+ };
@@ -0,0 +1,23 @@
1
+ import { deployIos } from "../deploy/deployIos";
2
+ import { DevOptions } from "./DevOptions";
3
+ import os from "os";
4
+
5
+ const getLocalIP = () => {
6
+ const interfaces = os.networkInterfaces();
7
+ for (const iface of Object.values(interfaces)) {
8
+ if (!iface) continue;
9
+
10
+ for (const config of iface) {
11
+ if (config.family === "IPv4" && !config.internal) {
12
+ return config.address;
13
+ }
14
+ }
15
+ }
16
+ };
17
+
18
+ export const devIos = async (options: DevOptions) => {
19
+ const ip = getLocalIP();
20
+ const url = `http://${ip}:3000`; // TODO dynamic ssl and port ?
21
+
22
+ await deployIos(url);
23
+ };
@@ -0,0 +1,12 @@
1
+ import { Command } from "commander";
2
+ import { dev } from "./dev";
3
+
4
+ export default new Command()
5
+ .name("dev")
6
+ .description("Description of command.")
7
+ .option("-h, --host", "Run nuxt dev server exposed to the local network.")
8
+ .option(
9
+ "--ios",
10
+ "Run dev for ios. Runs nuxt dev host and deploys to ios device with server url."
11
+ )
12
+ .action(dev);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("dev");
@@ -0,0 +1,9 @@
1
+ export const generateTypes = ["project", "package", "command"] as const;
2
+ export type GenerateType = (typeof generateTypes)[number];
3
+
4
+ export interface GenerateOptions {
5
+ starter?: string;
6
+ noRepo?: boolean;
7
+ keepHistory?: boolean;
8
+ yes: boolean;
9
+ }
@@ -0,0 +1,29 @@
1
+ import {
2
+ GenerateOptions,
3
+ GenerateType,
4
+ generateTypes,
5
+ } from "./GenerateOptions";
6
+ import { log } from "./log";
7
+ import { generateCommand } from "./generateCommand";
8
+ import { generateProject } from "./generateProject";
9
+
10
+ const cwd = process.cwd();
11
+
12
+ export const generate = async (
13
+ type: GenerateType,
14
+ name: string,
15
+ options: GenerateOptions
16
+ ) => {
17
+ if (!generateTypes.includes(type)) {
18
+ log.error("Invalid type. Nothing to generate.");
19
+ return;
20
+ }
21
+
22
+ log.info("Generating", type, name);
23
+
24
+ if (type === "command") {
25
+ await generateCommand(name, cwd);
26
+ } else if (type === "project") {
27
+ await generateProject(name, cwd, options);
28
+ }
29
+ };
@@ -0,0 +1,46 @@
1
+ import { filesystem } from "src/scripts/filesystem";
2
+ import { log } from "./log";
3
+ import { join } from "path";
4
+ import { capitalize } from "src/utils/common";
5
+
6
+ export const generateCommand = async (name: string, cwd: string) => {
7
+ if (!cwd.includes("packages/cli")) {
8
+ log.error(
9
+ "You must be in the packages/cli directory to generate a command."
10
+ );
11
+ return;
12
+ }
13
+
14
+ filesystem.copyDir(
15
+ join(cwd, "src/commands/blank"),
16
+ join(cwd, `src/commands/${name}`),
17
+ (file) => {
18
+ const content = file.content
19
+ .replaceAll("blank", name)
20
+ .replaceAll("Blank", capitalize(name));
21
+ const base = file.base
22
+ .replaceAll("blank", name)
23
+ .replaceAll("Blank", capitalize(name));
24
+
25
+ return {
26
+ ...file,
27
+ content,
28
+ base,
29
+ };
30
+ }
31
+ );
32
+
33
+ await filesystem.copyFiles([join(cwd, "src/commands/index.ts")], (file) => {
34
+ const content = file.content
35
+ .replace(
36
+ "\n\nexport default",
37
+ `\nimport ${name} from "./${name}";\n\nexport default`
38
+ )
39
+ .replace("];\n", ` ${name},\n];\n`);
40
+
41
+ return {
42
+ ...file,
43
+ content,
44
+ };
45
+ });
46
+ };
@@ -0,0 +1,115 @@
1
+ import { filesystem } from "src/scripts/filesystem";
2
+ import { git } from "src/scripts/git";
3
+ import { log } from "./log";
4
+ import { commandExists } from "src/utils/common";
5
+ import { cmd, executeCmd } from "src/scripts/cmd";
6
+ import { GenerateOptions } from "./GenerateOptions";
7
+ import { confirmQuestion } from "src/utils";
8
+
9
+ export const generateProject = async (
10
+ name: string,
11
+ cwd: string,
12
+ options: GenerateOptions
13
+ ) => {
14
+ const { starter = "base", noRepo, keepHistory, yes } = options;
15
+
16
+ log.verbose("Check if project name is valid");
17
+ if (!name.match(/^[a-z0-9-]+$/)) {
18
+ log.error(
19
+ "Project name must be lowercase, alphanumeric, and contain hyphens only."
20
+ );
21
+ return;
22
+ }
23
+
24
+ if (!noRepo) {
25
+ // Check if gh is installed
26
+ if (executeCmd("gh --version").status !== 0) {
27
+ const installGh = await confirmQuestion(
28
+ "GitHub cli is not installed. Do you want to install it now? (brew install gh)",
29
+ yes
30
+ );
31
+ if (installGh) {
32
+ executeCmd("brew install gh");
33
+ } else {
34
+ log.error(
35
+ "You must have GitHub cli installed to generate a project and create a repo."
36
+ );
37
+ return;
38
+ }
39
+ }
40
+
41
+ // Check if gh user is authenticated
42
+ if (executeCmd("gh auth status").status !== 0) {
43
+ const authenticateGh = await confirmQuestion(
44
+ "GitHub cli is not authenticated. Do you want to authenticate now? (gh auth login)",
45
+ yes
46
+ );
47
+ if (authenticateGh) {
48
+ executeCmd("gh auth login");
49
+ } else {
50
+ log.error(
51
+ "You must authenticate with GitHub cli before generating a project in order to create the repo."
52
+ );
53
+ return;
54
+ }
55
+ }
56
+ } else {
57
+ log.verbose("Skipping gh verification");
58
+ }
59
+
60
+ log.verbose("Cloning gluhar project template");
61
+ git.clone("gluharry/starters", name, { branch: starter });
62
+
63
+ cmd.cd(name);
64
+
65
+ log.verbose("Replacing gluhar-app with project's name");
66
+ await filesystem.copyFiles(
67
+ [
68
+ "./package.json",
69
+ "./README.md",
70
+ "./nuxt.config.ts",
71
+ "./sanity/sanity.config.ts",
72
+ "./sanity/structure.ts",
73
+ ],
74
+ (file) => {
75
+ const content = file.content.replaceAll("gluhar-app", name);
76
+
77
+ return {
78
+ ...file,
79
+ content,
80
+ };
81
+ }
82
+ );
83
+
84
+ if (!keepHistory) {
85
+ log.verbose("Removing git history");
86
+ executeCmd("rm -rf .git");
87
+
88
+ log.verbose("Initializing empty git repo with initial flat commit");
89
+ executeCmd(
90
+ "git init --initial-branch=dev && git add . && git commit -m 'Initial commit'"
91
+ );
92
+ } else {
93
+ log.verbose("Keeping git history and removing remote origin");
94
+ executeCmd("git remote remove origin && git branch -m dev");
95
+ }
96
+
97
+ if (!noRepo) {
98
+ log.verbose("Creating new github remote repo");
99
+ executeCmd(`gh repo create ${name} --private --source=. --push`);
100
+ } else {
101
+ log.verbose(
102
+ "Skipping repo creation and deleting .git. You are on your own."
103
+ );
104
+ executeCmd("rm -rf .git");
105
+ }
106
+
107
+ const openCode = await confirmQuestion(
108
+ `Project '${name}' was created successfully! Do you want to open it in VSCode/Cursor?`,
109
+ yes
110
+ );
111
+ if (openCode) {
112
+ const editorCommand = commandExists("cursor") ? "cursor" : "code";
113
+ executeCmd(`${editorCommand} . -g README.md`);
114
+ }
115
+ };
@@ -0,0 +1,19 @@
1
+ import { Command } from "commander";
2
+ import { generate } from "./generate";
3
+ import { generateTypes } from "./GenerateOptions";
4
+
5
+ export default new Command()
6
+ .name("generate")
7
+ .argument("<type>", "What to generate.")
8
+ .argument("<name>", "Name of generated thing.")
9
+ .description(`Generate a ${generateTypes.join(", ")}.`)
10
+ .option(
11
+ "--starter <branchName>",
12
+ "When generating a project, which starter template to use: base, mobile."
13
+ )
14
+ .option("-nr, --no-repo", "Do not create a github repo automatically.")
15
+ .option(
16
+ "-kh, --keep-history",
17
+ "Keep commit history from the starter template."
18
+ )
19
+ .action(generate);
@@ -0,0 +1,3 @@
1
+ import { logger } from "src/utils";
2
+
3
+ export const log = logger("generate");