@gluhar/cli 3.0.2 → 3.1.5

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 (403) hide show
  1. package/package.json +46 -46
  2. package/src/GlobalOptions.d.ts +8 -0
  3. package/src/GlobalOptions.d.ts.map +1 -0
  4. package/src/GlobalOptions.js +2 -0
  5. package/src/commands/blank/BlankOptions.d.ts +4 -0
  6. package/src/commands/blank/BlankOptions.d.ts.map +1 -0
  7. package/src/commands/blank/BlankOptions.js +2 -0
  8. package/src/commands/blank/blank.d.ts +3 -0
  9. package/src/commands/blank/blank.d.ts.map +1 -0
  10. package/src/commands/blank/blank.js +8 -0
  11. package/src/commands/blank/index.d.ts +4 -0
  12. package/src/commands/blank/index.d.ts.map +1 -0
  13. package/src/commands/blank/index.js +9 -0
  14. package/src/commands/blank/log.d.ts +2 -0
  15. package/src/commands/blank/log.d.ts.map +1 -0
  16. package/src/commands/blank/log.js +5 -0
  17. package/src/commands/build/BuildOptions.d.ts +4 -0
  18. package/src/commands/build/BuildOptions.d.ts.map +1 -0
  19. package/src/commands/build/BuildOptions.js +2 -0
  20. package/src/commands/build/build.d.ts +3 -0
  21. package/src/commands/build/build.d.ts.map +1 -0
  22. package/src/commands/build/build.js +22 -0
  23. package/src/commands/build/index.d.ts +4 -0
  24. package/src/commands/build/index.d.ts.map +1 -0
  25. package/src/commands/build/index.js +9 -0
  26. package/src/commands/build/log.d.ts +2 -0
  27. package/src/commands/build/log.d.ts.map +1 -0
  28. package/src/commands/build/log.js +5 -0
  29. package/src/commands/deinstall/DeinstallOptions.d.ts +4 -0
  30. package/src/commands/deinstall/DeinstallOptions.d.ts.map +1 -0
  31. package/src/commands/deinstall/DeinstallOptions.js +2 -0
  32. package/src/commands/deinstall/deinstall.d.ts +3 -0
  33. package/src/commands/deinstall/deinstall.d.ts.map +1 -0
  34. package/src/commands/deinstall/deinstall.js +21 -0
  35. package/src/commands/deinstall/index.d.ts +4 -0
  36. package/src/commands/deinstall/index.d.ts.map +1 -0
  37. package/src/commands/deinstall/index.js +9 -0
  38. package/src/commands/deinstall/log.d.ts +2 -0
  39. package/src/commands/deinstall/log.d.ts.map +1 -0
  40. package/src/commands/deinstall/log.js +5 -0
  41. package/src/commands/deploy/DeployOptions.d.ts +7 -0
  42. package/src/commands/deploy/DeployOptions.d.ts.map +1 -0
  43. package/src/commands/deploy/DeployOptions.js +2 -0
  44. package/src/commands/deploy/deploy.d.ts +3 -0
  45. package/src/commands/deploy/deploy.d.ts.map +1 -0
  46. package/src/commands/deploy/deploy.js +33 -0
  47. package/src/commands/deploy/deployIos.d.ts +2 -0
  48. package/src/commands/deploy/deployIos.d.ts.map +1 -0
  49. package/src/commands/deploy/deployIos.js +44 -0
  50. package/src/commands/deploy/index.d.ts +4 -0
  51. package/src/commands/deploy/index.d.ts.map +1 -0
  52. package/src/commands/deploy/index.js +12 -0
  53. package/src/commands/deploy/log.d.ts +2 -0
  54. package/src/commands/deploy/log.d.ts.map +1 -0
  55. package/src/commands/deploy/log.js +5 -0
  56. package/src/commands/deploy/setSsr.d.ts +2 -0
  57. package/src/commands/deploy/setSsr.d.ts.map +1 -0
  58. package/src/commands/deploy/setSsr.js +25 -0
  59. package/src/commands/dev/DevOptions.d.ts +5 -0
  60. package/src/commands/dev/DevOptions.d.ts.map +1 -0
  61. package/src/commands/dev/DevOptions.js +2 -0
  62. package/src/commands/dev/dev.d.ts +3 -0
  63. package/src/commands/dev/dev.d.ts.map +1 -0
  64. package/src/commands/dev/dev.js +16 -0
  65. package/src/commands/dev/devIos.d.ts +3 -0
  66. package/src/commands/dev/devIos.d.ts.map +1 -0
  67. package/src/commands/dev/devIos.js +26 -0
  68. package/src/commands/dev/index.d.ts +4 -0
  69. package/src/commands/dev/index.d.ts.map +1 -0
  70. package/src/commands/dev/index.js +10 -0
  71. package/src/commands/dev/log.d.ts +2 -0
  72. package/src/commands/dev/log.d.ts.map +1 -0
  73. package/src/commands/dev/log.js +5 -0
  74. package/src/commands/generate/GenerateOptions.d.ts +9 -0
  75. package/src/commands/generate/GenerateOptions.d.ts.map +1 -0
  76. package/src/commands/generate/GenerateOptions.js +4 -0
  77. package/src/commands/generate/generate.d.ts +3 -0
  78. package/src/commands/generate/generate.d.ts.map +1 -0
  79. package/src/commands/generate/generate.js +22 -0
  80. package/src/commands/generate/generateCommand.d.ts +2 -0
  81. package/src/commands/generate/generateCommand.d.ts.map +1 -0
  82. package/src/commands/generate/generateCommand.js +36 -0
  83. package/src/commands/generate/generateProject.d.ts +3 -0
  84. package/src/commands/generate/generateProject.d.ts.map +1 -0
  85. package/src/commands/generate/generateProject.js +85 -0
  86. package/src/commands/generate/index.d.ts +4 -0
  87. package/src/commands/generate/index.d.ts.map +1 -0
  88. package/src/commands/generate/index.js +14 -0
  89. package/src/commands/generate/log.d.ts +2 -0
  90. package/src/commands/generate/log.d.ts.map +1 -0
  91. package/src/commands/generate/log.js +5 -0
  92. package/src/commands/index.d.ts +3 -0
  93. package/src/commands/index.d.ts.map +1 -0
  94. package/src/commands/index.js +25 -0
  95. package/src/commands/reinstall/ReinstallOptions.d.ts +4 -0
  96. package/src/commands/reinstall/ReinstallOptions.d.ts.map +1 -0
  97. package/src/commands/reinstall/ReinstallOptions.js +2 -0
  98. package/src/commands/reinstall/index.d.ts +4 -0
  99. package/src/commands/reinstall/index.d.ts.map +1 -0
  100. package/src/commands/reinstall/index.js +9 -0
  101. package/src/commands/reinstall/log.d.ts +2 -0
  102. package/src/commands/reinstall/log.d.ts.map +1 -0
  103. package/src/commands/reinstall/log.js +5 -0
  104. package/src/commands/reinstall/reinstall.d.ts +3 -0
  105. package/src/commands/reinstall/reinstall.d.ts.map +1 -0
  106. package/src/commands/reinstall/reinstall.js +14 -0
  107. package/src/commands/release/ReleaseOptions.d.ts +9 -0
  108. package/src/commands/release/ReleaseOptions.d.ts.map +1 -0
  109. package/src/commands/release/ReleaseOptions.js +2 -0
  110. package/src/commands/release/index.d.ts +4 -0
  111. package/src/commands/release/index.d.ts.map +1 -0
  112. package/src/commands/release/index.js +22 -0
  113. package/src/commands/release/log.d.ts +2 -0
  114. package/src/commands/release/log.d.ts.map +1 -0
  115. package/src/commands/release/log.js +5 -0
  116. package/src/commands/release/publish.d.ts +3 -0
  117. package/src/commands/release/publish.d.ts.map +1 -0
  118. package/src/commands/release/publish.js +18 -0
  119. package/src/commands/release/release.d.ts +3 -0
  120. package/src/commands/release/release.d.ts.map +1 -0
  121. package/src/commands/release/release.js +24 -0
  122. package/src/commands/release/tag.d.ts +23 -0
  123. package/src/commands/release/tag.d.ts.map +1 -0
  124. package/src/commands/release/tag.js +90 -0
  125. package/src/commands/upgrade/UpgradeOptions.d.ts +4 -0
  126. package/src/commands/upgrade/UpgradeOptions.d.ts.map +1 -0
  127. package/src/commands/upgrade/UpgradeOptions.js +2 -0
  128. package/src/commands/upgrade/index.d.ts +4 -0
  129. package/src/commands/upgrade/index.d.ts.map +1 -0
  130. package/src/commands/upgrade/index.js +9 -0
  131. package/src/commands/upgrade/log.d.ts +2 -0
  132. package/src/commands/upgrade/log.d.ts.map +1 -0
  133. package/src/commands/upgrade/log.js +5 -0
  134. package/src/commands/upgrade/upgrade.d.ts +3 -0
  135. package/src/commands/upgrade/upgrade.d.ts.map +1 -0
  136. package/src/commands/upgrade/upgrade.js +11 -0
  137. package/src/commands/version/VersionOptions.d.ts +8 -0
  138. package/src/commands/version/VersionOptions.d.ts.map +1 -0
  139. package/src/commands/version/VersionOptions.js +2 -0
  140. package/src/commands/version/getPreid.d.ts +2 -0
  141. package/src/commands/version/getPreid.d.ts.map +1 -0
  142. package/src/commands/version/getPreid.js +10 -0
  143. package/src/commands/version/index.d.ts +4 -0
  144. package/src/commands/version/index.d.ts.map +1 -0
  145. package/src/commands/version/index.js +12 -0
  146. package/src/commands/version/log.d.ts +2 -0
  147. package/src/commands/version/log.d.ts.map +1 -0
  148. package/src/commands/version/log.js +5 -0
  149. package/src/commands/version/pimpChangelogs.d.ts +2 -0
  150. package/src/commands/version/pimpChangelogs.d.ts.map +1 -0
  151. package/src/commands/version/pimpChangelogs.js +37 -0
  152. package/src/commands/version/version.d.ts +3 -0
  153. package/src/commands/version/version.d.ts.map +1 -0
  154. package/src/commands/version/version.js +33 -0
  155. package/src/constants.d.ts +4 -0
  156. package/src/constants.d.ts.map +1 -0
  157. package/src/constants.js +7 -0
  158. package/src/index.d.ts +3 -0
  159. package/src/index.d.ts.map +1 -0
  160. package/src/index.js +24 -0
  161. package/src/preAction.d.ts +3 -0
  162. package/src/preAction.d.ts.map +1 -0
  163. package/src/preAction.js +81 -0
  164. package/src/scripts/cmd/cd.d.ts +2 -0
  165. package/src/scripts/cmd/cd.d.ts.map +1 -0
  166. package/src/scripts/cmd/cd.js +15 -0
  167. package/src/scripts/cmd/{executeBash.ts → executeBash.d.ts} +10 -20
  168. package/src/scripts/cmd/executeBash.d.ts.map +1 -0
  169. package/src/scripts/cmd/executeBash.js +21 -0
  170. package/src/scripts/cmd/executeCmd.d.ts +9 -0
  171. package/src/scripts/cmd/executeCmd.d.ts.map +1 -0
  172. package/src/scripts/cmd/executeCmd.js +23 -0
  173. package/src/scripts/cmd/{getBashOutput.ts → getBashOutput.d.ts} +10 -23
  174. package/src/scripts/cmd/getBashOutput.d.ts.map +1 -0
  175. package/src/scripts/cmd/getBashOutput.js +19 -0
  176. package/src/scripts/cmd/getCmdOutput.d.ts +10 -0
  177. package/src/scripts/cmd/getCmdOutput.d.ts.map +1 -0
  178. package/src/scripts/cmd/getCmdOutput.js +26 -0
  179. package/src/scripts/cmd/{index.ts → index.d.ts} +8 -10
  180. package/src/scripts/cmd/index.d.ts.map +1 -0
  181. package/src/scripts/cmd/index.js +25 -0
  182. package/src/scripts/cmd/log.d.ts +2 -0
  183. package/src/scripts/cmd/log.d.ts.map +1 -0
  184. package/src/scripts/cmd/log.js +5 -0
  185. package/src/scripts/cmd/parseArgs.d.ts +3 -0
  186. package/src/scripts/cmd/parseArgs.d.ts.map +1 -0
  187. package/src/scripts/cmd/parseArgs.js +41 -0
  188. package/src/scripts/cmd/parseBashArgs.d.ts +3 -0
  189. package/src/scripts/cmd/parseBashArgs.d.ts.map +1 -0
  190. package/src/scripts/cmd/parseBashArgs.js +16 -0
  191. package/src/scripts/cmd/types.d.ts +12 -0
  192. package/src/scripts/cmd/types.d.ts.map +1 -0
  193. package/src/scripts/cmd/types.js +2 -0
  194. package/src/scripts/filesystem/copyDir.d.ts +9 -0
  195. package/src/scripts/filesystem/copyDir.d.ts.map +1 -0
  196. package/src/scripts/filesystem/copyDir.js +26 -0
  197. package/src/scripts/filesystem/copyFiles.d.ts +11 -0
  198. package/src/scripts/filesystem/copyFiles.d.ts.map +1 -0
  199. package/src/scripts/filesystem/copyFiles.js +59 -0
  200. package/src/scripts/filesystem/findFile.d.ts +2 -0
  201. package/src/scripts/filesystem/findFile.d.ts.map +1 -0
  202. package/src/scripts/filesystem/findFile.js +24 -0
  203. package/src/scripts/filesystem/index.d.ts +10 -0
  204. package/src/scripts/filesystem/index.d.ts.map +1 -0
  205. package/src/scripts/filesystem/index.js +17 -0
  206. package/src/scripts/filesystem/loadJsonFile.d.ts +2 -0
  207. package/src/scripts/filesystem/loadJsonFile.d.ts.map +1 -0
  208. package/src/scripts/filesystem/loadJsonFile.js +18 -0
  209. package/src/scripts/filesystem/log.d.ts +2 -0
  210. package/src/scripts/filesystem/log.d.ts.map +1 -0
  211. package/src/scripts/filesystem/log.js +5 -0
  212. package/src/scripts/filesystem/readDirRecursive.d.ts +2 -0
  213. package/src/scripts/filesystem/readDirRecursive.d.ts.map +1 -0
  214. package/src/scripts/filesystem/readDirRecursive.js +16 -0
  215. package/src/scripts/git/branch/branchDelete.d.ts +6 -0
  216. package/src/scripts/git/branch/branchDelete.d.ts.map +1 -0
  217. package/src/scripts/git/branch/branchDelete.js +24 -0
  218. package/src/scripts/git/branch/branchExists.d.ts +5 -0
  219. package/src/scripts/git/branch/branchExists.d.ts.map +1 -0
  220. package/src/scripts/git/branch/branchExists.js +15 -0
  221. package/src/scripts/git/branch/checkout.d.ts +5 -0
  222. package/src/scripts/git/branch/checkout.d.ts.map +1 -0
  223. package/src/scripts/git/branch/checkout.js +15 -0
  224. package/src/scripts/git/branch/getCurrentBranch.d.ts +11 -0
  225. package/src/scripts/git/branch/getCurrentBranch.d.ts.map +1 -0
  226. package/src/scripts/git/branch/getCurrentBranch.js +28 -0
  227. package/src/scripts/git/clone.d.ts +10 -0
  228. package/src/scripts/git/clone.d.ts.map +1 -0
  229. package/src/scripts/git/clone.js +14 -0
  230. package/src/scripts/git/commit.sh +0 -0
  231. package/src/scripts/git/getRepo.d.ts +2 -0
  232. package/src/scripts/git/getRepo.d.ts.map +1 -0
  233. package/src/scripts/git/getRepo.js +13 -0
  234. package/src/scripts/git/index.d.ts +29 -0
  235. package/src/scripts/git/index.d.ts.map +1 -0
  236. package/src/scripts/git/index.js +40 -0
  237. package/src/scripts/git/log.d.ts +2 -0
  238. package/src/scripts/git/log.d.ts.map +1 -0
  239. package/src/scripts/git/log.js +5 -0
  240. package/src/scripts/git/openPr.d.ts +2 -0
  241. package/src/scripts/git/openPr.d.ts.map +1 -0
  242. package/src/scripts/git/openPr.js +20 -0
  243. package/src/scripts/git/remoteStatus.d.ts +3 -0
  244. package/src/scripts/git/remoteStatus.d.ts.map +1 -0
  245. package/src/scripts/git/remoteStatus.js +22 -0
  246. package/src/scripts/git/tag/createTag.d.ts +18 -0
  247. package/src/scripts/git/tag/createTag.d.ts.map +1 -0
  248. package/src/scripts/git/tag/createTag.js +18 -0
  249. package/src/scripts/git/tag/deleteTag.d.ts +2 -0
  250. package/src/scripts/git/tag/deleteTag.d.ts.map +1 -0
  251. package/src/scripts/git/tag/deleteTag.js +13 -0
  252. package/src/scripts/git/tag/getTags.d.ts +2 -0
  253. package/src/scripts/git/tag/getTags.d.ts.map +1 -0
  254. package/src/scripts/git/tag/getTags.js +8 -0
  255. package/src/scripts/git/tag/pushAllTags.d.ts +2 -0
  256. package/src/scripts/git/tag/pushAllTags.d.ts.map +1 -0
  257. package/src/scripts/git/tag/pushAllTags.js +8 -0
  258. package/src/scripts/git/tag/renameTag.d.ts +2 -0
  259. package/src/scripts/git/tag/renameTag.d.ts.map +1 -0
  260. package/src/scripts/git/tag/renameTag.js +14 -0
  261. package/src/scripts/lerna/changed.d.ts +3 -0
  262. package/src/scripts/lerna/changed.d.ts.map +1 -0
  263. package/src/scripts/lerna/changed.js +13 -0
  264. package/src/scripts/lerna/constants.d.ts +5 -0
  265. package/src/scripts/lerna/constants.d.ts.map +1 -0
  266. package/src/scripts/lerna/constants.js +7 -0
  267. package/src/scripts/lerna/filterByDependency.d.ts +7 -0
  268. package/src/scripts/lerna/filterByDependency.d.ts.map +1 -0
  269. package/src/scripts/lerna/filterByDependency.js +18 -0
  270. package/src/scripts/lerna/getConfig.d.ts +3 -0
  271. package/src/scripts/lerna/getConfig.d.ts.map +1 -0
  272. package/src/scripts/lerna/getConfig.js +13 -0
  273. package/src/scripts/lerna/getDependencies.d.ts +9 -0
  274. package/src/scripts/lerna/getDependencies.d.ts.map +1 -0
  275. package/src/scripts/lerna/getDependencies.js +23 -0
  276. package/src/scripts/lerna/getDetails.d.ts +3 -0
  277. package/src/scripts/lerna/getDetails.d.ts.map +1 -0
  278. package/src/scripts/lerna/getDetails.js +38 -0
  279. package/src/scripts/lerna/index.d.ts +14 -0
  280. package/src/scripts/lerna/index.d.ts.map +1 -0
  281. package/src/scripts/lerna/index.js +19 -0
  282. package/src/scripts/lerna/log.d.ts +2 -0
  283. package/src/scripts/lerna/log.d.ts.map +1 -0
  284. package/src/scripts/lerna/log.js +5 -0
  285. package/src/scripts/lerna/publish.sh +0 -0
  286. package/src/scripts/lerna/types.d.ts +62 -0
  287. package/src/scripts/lerna/types.d.ts.map +1 -0
  288. package/src/scripts/lerna/types.js +2 -0
  289. package/src/scripts/lerna/version.sh +1 -1
  290. package/src/utils/chalk.d.ts +4 -0
  291. package/src/utils/chalk.d.ts.map +1 -0
  292. package/src/utils/chalk.js +9 -0
  293. package/src/utils/common.d.ts +8 -0
  294. package/src/utils/common.d.ts.map +1 -0
  295. package/src/utils/common.js +21 -0
  296. package/src/utils/{index.ts → index.d.ts} +4 -3
  297. package/src/utils/index.d.ts.map +1 -0
  298. package/src/utils/index.js +19 -0
  299. package/src/utils/inquirer.d.ts +5 -0
  300. package/src/utils/inquirer.d.ts.map +1 -0
  301. package/src/utils/inquirer.js +21 -0
  302. package/src/utils/logger.d.ts +9 -0
  303. package/src/utils/logger.d.ts.map +1 -0
  304. package/src/utils/logger.js +36 -0
  305. package/CHANGELOG.md +0 -628
  306. package/README.md +0 -11
  307. package/src/GlobalOptions.ts +0 -8
  308. package/src/commands/blank/BlankOptions.ts +0 -3
  309. package/src/commands/blank/blank.ts +0 -6
  310. package/src/commands/blank/index.ts +0 -8
  311. package/src/commands/blank/log.ts +0 -3
  312. package/src/commands/build/BuildOptions.ts +0 -3
  313. package/src/commands/build/build.ts +0 -24
  314. package/src/commands/build/index.ts +0 -8
  315. package/src/commands/build/log.ts +0 -3
  316. package/src/commands/deinstall/DeinstallOptions.ts +0 -3
  317. package/src/commands/deinstall/deinstall.ts +0 -19
  318. package/src/commands/deinstall/index.ts +0 -11
  319. package/src/commands/deinstall/log.ts +0 -3
  320. package/src/commands/deploy/DeployOptions.ts +0 -6
  321. package/src/commands/deploy/deploy.ts +0 -39
  322. package/src/commands/deploy/deployIos.ts +0 -48
  323. package/src/commands/deploy/index.ts +0 -20
  324. package/src/commands/deploy/log.ts +0 -3
  325. package/src/commands/deploy/setSsr.ts +0 -25
  326. package/src/commands/dev/DevOptions.ts +0 -4
  327. package/src/commands/dev/dev.ts +0 -15
  328. package/src/commands/dev/devIos.ts +0 -23
  329. package/src/commands/dev/index.ts +0 -12
  330. package/src/commands/dev/log.ts +0 -3
  331. package/src/commands/generate/GenerateOptions.ts +0 -9
  332. package/src/commands/generate/generate.ts +0 -29
  333. package/src/commands/generate/generateCommand.ts +0 -46
  334. package/src/commands/generate/generateProject.ts +0 -115
  335. package/src/commands/generate/index.ts +0 -19
  336. package/src/commands/generate/log.ts +0 -3
  337. package/src/commands/index.ts +0 -21
  338. package/src/commands/reinstall/ReinstallOptions.ts +0 -3
  339. package/src/commands/reinstall/index.ts +0 -11
  340. package/src/commands/reinstall/log.ts +0 -3
  341. package/src/commands/reinstall/reinstall.ts +0 -13
  342. package/src/commands/release/ReleaseOptions.ts +0 -8
  343. package/src/commands/release/index.ts +0 -40
  344. package/src/commands/release/log.ts +0 -3
  345. package/src/commands/release/publish.ts +0 -18
  346. package/src/commands/release/release.ts +0 -24
  347. package/src/commands/release/tag.ts +0 -119
  348. package/src/commands/upgrade/UpgradeOptions.ts +0 -3
  349. package/src/commands/upgrade/index.ts +0 -10
  350. package/src/commands/upgrade/log.ts +0 -3
  351. package/src/commands/upgrade/upgrade.ts +0 -10
  352. package/src/commands/version/VersionOptions.ts +0 -7
  353. package/src/commands/version/getPreid.ts +0 -7
  354. package/src/commands/version/index.ts +0 -18
  355. package/src/commands/version/log.ts +0 -3
  356. package/src/commands/version/pimpChangelogs.ts +0 -43
  357. package/src/commands/version/version.ts +0 -33
  358. package/src/constants.ts +0 -5
  359. package/src/index.ts +0 -24
  360. package/src/preAction.ts +0 -93
  361. package/src/scripts/cmd/cd.ts +0 -9
  362. package/src/scripts/cmd/executeCmd.ts +0 -23
  363. package/src/scripts/cmd/getCmdOutput.ts +0 -26
  364. package/src/scripts/cmd/log.ts +0 -3
  365. package/src/scripts/cmd/parseArgs.ts +0 -44
  366. package/src/scripts/cmd/parseBashArgs.ts +0 -21
  367. package/src/scripts/cmd/types.ts +0 -13
  368. package/src/scripts/filesystem/copyDir.ts +0 -29
  369. package/src/scripts/filesystem/copyFiles.ts +0 -75
  370. package/src/scripts/filesystem/findFile.ts +0 -29
  371. package/src/scripts/filesystem/index.ts +0 -15
  372. package/src/scripts/filesystem/loadJsonFile.ts +0 -17
  373. package/src/scripts/filesystem/log.ts +0 -3
  374. package/src/scripts/filesystem/readDirRecursive.ts +0 -21
  375. package/src/scripts/git/branch/branchDelete.ts +0 -32
  376. package/src/scripts/git/branch/branchExists.ts +0 -14
  377. package/src/scripts/git/branch/checkout.ts +0 -19
  378. package/src/scripts/git/branch/getCurrentBranch.ts +0 -37
  379. package/src/scripts/git/clone.ts +0 -20
  380. package/src/scripts/git/getRepo.ts +0 -11
  381. package/src/scripts/git/index.ts +0 -44
  382. package/src/scripts/git/log.ts +0 -3
  383. package/src/scripts/git/openPr.ts +0 -21
  384. package/src/scripts/git/remoteStatus.ts +0 -28
  385. package/src/scripts/git/tag/createTag.ts +0 -28
  386. package/src/scripts/git/tag/deleteTag.ts +0 -11
  387. package/src/scripts/git/tag/getTags.ts +0 -6
  388. package/src/scripts/git/tag/pushAllTags.ts +0 -6
  389. package/src/scripts/git/tag/renameTag.ts +0 -12
  390. package/src/scripts/lerna/changed.ts +0 -11
  391. package/src/scripts/lerna/constants.ts +0 -6
  392. package/src/scripts/lerna/filterByDependency.ts +0 -21
  393. package/src/scripts/lerna/getConfig.ts +0 -12
  394. package/src/scripts/lerna/getDependencies.ts +0 -25
  395. package/src/scripts/lerna/getDetails.ts +0 -44
  396. package/src/scripts/lerna/index.ts +0 -18
  397. package/src/scripts/lerna/log.ts +0 -3
  398. package/src/scripts/lerna/types.ts +0 -64
  399. package/src/utils/chalk.ts +0 -4
  400. package/src/utils/common.ts +0 -16
  401. package/src/utils/inquirer.ts +0 -20
  402. package/src/utils/logger.ts +0 -51
  403. package/tsconfig.json +0 -28
@@ -1,29 +0,0 @@
1
- import { existsSync } from 'fs';
2
- import { join } from 'path';
3
- import { log } from './log';
4
-
5
- const searchFile = (fileName: string, dir: string): string | null => {
6
- const filePath = join(dir, fileName);
7
-
8
- if (existsSync(filePath)) {
9
- log.verbose('Found file:', filePath);
10
- return filePath;
11
- }
12
-
13
- const parent = join(dir, '..');
14
-
15
- if (parent === dir || !existsSync(parent)) {
16
- log.verbose('File not found:', fileName);
17
- return null;
18
- }
19
-
20
- return searchFile(fileName, parent);
21
- };
22
-
23
- export const findFile = (
24
- fileName: string,
25
- dir: string = process.cwd(),
26
- ): string | null => {
27
- log.verbose('Looking for file:', fileName);
28
- return searchFile(fileName, dir);
29
- };
@@ -1,15 +0,0 @@
1
- import { copyDir } from "./copyDir";
2
- import { readDirRecursive } from "./readDirRecursive";
3
- import { loadJsonFile } from "./loadJsonFile";
4
- import { findFile } from "./findFile";
5
- import { copyFiles, loadFiles, updateFiles } from "./copyFiles";
6
-
7
- export const filesystem = {
8
- copyDir,
9
- copyFiles,
10
- loadFiles,
11
- updateFiles,
12
- readDirRecursive,
13
- loadJsonFile,
14
- findFile,
15
- };
@@ -1,17 +0,0 @@
1
- import { existsSync, readFileSync } from 'fs';
2
- import { log } from './log';
3
-
4
- export const loadJsonFile = <T>(filePath: string): T | null => {
5
- log.verbose('Try to load JSON file:', filePath);
6
- const invalidPath = !filePath || !existsSync(filePath);
7
- if (invalidPath) {
8
- log.verbose('Invalid file path:', filePath);
9
- return null;
10
- }
11
-
12
- const json = readFileSync(filePath).toString();
13
- const result = JSON.parse(json) as T;
14
-
15
- log.verbose('Successfully loaded JSON file:', filePath);
16
- return result;
17
- };
@@ -1,3 +0,0 @@
1
- import { logger } from 'src/utils';
2
-
3
- export const log = logger('filesystem');
@@ -1,21 +0,0 @@
1
- import { readdirSync, statSync } from 'fs-extra';
2
- import { resolve, join } from 'path';
3
-
4
- const readDirStep = (
5
- absoluteDirPath: string,
6
- relativeDirPath: string,
7
- ): string[] =>
8
- readdirSync(absoluteDirPath).reduce((result: string[], current: string) => {
9
- const absPath = resolve(absoluteDirPath, current);
10
- const relPath = join(relativeDirPath, current);
11
- const isDirectory = statSync(absPath).isDirectory();
12
-
13
- if (isDirectory) {
14
- return [...result, ...readDirStep(absPath, relPath)];
15
- }
16
-
17
- return [...result, relPath];
18
- }, []);
19
-
20
- export const readDirRecursive = (dirPath: string): string[] =>
21
- readDirStep(dirPath, '');
@@ -1,32 +0,0 @@
1
- // BRANCH=${npm_config_branch};
2
- // LOCAL=$(git branch --list $BRANCH);
3
- // if [ $LOCAL ];
4
- // then git branch -D $BRANCH; fi;
5
- // REMOTE=$(git ls-remote --heads origin $BRANCH);
6
- // if [ $REMOTE ];
7
- // then git push origin -d $BRANCH; fi
8
-
9
- import { executeCmd } from 'src/scripts/cmd';
10
- import { log } from '../log';
11
-
12
- export interface BranchDeleteOptions {
13
- local?: boolean;
14
- remote?: boolean;
15
- }
16
-
17
- export const branchDelete = (
18
- branch: string,
19
- options: BranchDeleteOptions = {},
20
- ) => {
21
- const { local, remote } = options;
22
-
23
- if (local) {
24
- log.verbose('Delete local branch:', branch);
25
- executeCmd(`git branch -D ${branch}`);
26
- }
27
-
28
- if (remote) {
29
- log.verbose('Delete remote branch:', branch);
30
- executeCmd(`git push origin -d ${branch}`);
31
- }
32
- };
@@ -1,14 +0,0 @@
1
- import { getCmdOutput } from 'src/scripts/cmd';
2
- import { log } from '../log';
3
-
4
- export const branchExists = (branchName: string) => {
5
- const local = !!getCmdOutput(`git branch --list ${branchName}`);
6
- const remote = !!getCmdOutput(`git ls-remote --heads origin ${branchName}`);
7
-
8
- log.verbose('branchExists:', { local, remote });
9
-
10
- return {
11
- local,
12
- remote,
13
- };
14
- };
@@ -1,19 +0,0 @@
1
- import { executeCmd } from 'src/scripts/cmd';
2
-
3
- export interface CheckoutOptions {
4
- newBranch?: boolean;
5
- }
6
-
7
- export const checkout = (branchName: string, opt: CheckoutOptions = {}) => {
8
- const { newBranch = false } = opt;
9
-
10
- const cmd = ['git checkout'];
11
- if (newBranch) {
12
- cmd.push('-b');
13
- }
14
- cmd.push(branchName);
15
-
16
- const fullCmd = cmd.join(' ');
17
-
18
- return executeCmd(fullCmd);
19
- };
@@ -1,37 +0,0 @@
1
- import { getCmdOutput } from 'src/scripts/cmd';
2
- import { log } from '../log';
3
-
4
- export interface BranchInfo {
5
- fullName: string;
6
- type?: 'dev' | 'prep' | 'release' | string;
7
- name: string;
8
- isDev: boolean;
9
- isPrep: boolean;
10
- isRelease: boolean;
11
- isOther: boolean;
12
- }
13
-
14
- export const getCurrentBranch = (): BranchInfo => {
15
- const fullName = getCmdOutput('git rev-parse --abbrev-ref HEAD');
16
- let [type, name]: (string | undefined)[] = fullName.split('/');
17
- if (!name) {
18
- name = type;
19
- type = undefined;
20
- }
21
- const isDev = type === 'dev';
22
- const isPrep = type === 'prep';
23
- const isRelease = type === 'release';
24
- const isOther = !isDev && !isPrep && !isRelease;
25
-
26
- log.verbose('Current branch:', fullName);
27
-
28
- return {
29
- fullName,
30
- type,
31
- name,
32
- isDev,
33
- isPrep,
34
- isRelease,
35
- isOther,
36
- };
37
- };
@@ -1,20 +0,0 @@
1
- import { executeCmd } from "src/scripts/cmd";
2
- import { log } from "./log";
3
-
4
- export interface CloneOptions {
5
- branch?: string;
6
- singleBranch?: boolean;
7
- }
8
-
9
- /**
10
- * Clone a repo.
11
- * @param repo The repo name in the format: 'gluharry/starters'.
12
- */
13
- export const clone = (
14
- repo: string,
15
- dir: string = "",
16
- options: CloneOptions = {}
17
- ) => {
18
- log.verbose("Cloning:", repo, dir, options);
19
- executeCmd(`git clone https://github.com/${repo}.git ${dir}`, options);
20
- };
@@ -1,11 +0,0 @@
1
- import { getCmdOutput } from "../cmd";
2
-
3
- export const getRepo = (): string => {
4
- const url = getCmdOutput("git remote get-url origin");
5
- const urlParts = url.split("/");
6
-
7
- // "dev-tools.git"
8
- const lastPart = urlParts[urlParts.length - 1];
9
- // "dev-tools"
10
- return lastPart.split(".")[0];
11
- };
@@ -1,44 +0,0 @@
1
- import { executeBash, executeCmd } from "src/scripts/cmd";
2
- import { branchDelete } from "./branch/branchDelete";
3
- import { openPr } from "./openPr";
4
- import { remoteStatus } from "./remoteStatus";
5
- import { getCurrentBranch } from "./branch/getCurrentBranch";
6
- import { checkout } from "./branch/checkout";
7
- import { branchExists } from "./branch/branchExists";
8
- import { createTag } from "./tag/createTag";
9
- import type { Args } from "../cmd/types";
10
- import { getRepo } from "./getRepo";
11
- import { getTags } from "./tag/getTags";
12
- import { pushAllTags } from "./tag/pushAllTags";
13
- import { deleteTag } from "./tag/deleteTag";
14
- import { renameTag } from "./tag/renameTag";
15
- import { clone } from "./clone";
16
-
17
- export const git = {
18
- openPr,
19
- getRepo,
20
- remoteStatus,
21
- commit: (args: Args) => executeBash(`git/commit`, args),
22
- push: (branchOrTag: string, remote = "origin") =>
23
- executeCmd(`git push ${remote} ${branchOrTag}`),
24
- pull: (branchName: string, remote = "origin") =>
25
- executeCmd(`git pull ${remote} ${branchName}`),
26
- merge: (branchName: string, y?: boolean) =>
27
- executeCmd(`git merge ${branchName}${y ? " --no-edit" : ""}`),
28
- branch: {
29
- exists: branchExists,
30
- delete: branchDelete,
31
- getCurrent: getCurrentBranch,
32
- checkout,
33
- },
34
- tag: {
35
- getAll: getTags,
36
- create: createTag,
37
- delete: deleteTag,
38
- rename: renameTag,
39
- pushAll: pushAllTags,
40
- },
41
- clone,
42
- };
43
-
44
- export type { BranchInfo } from "./branch/getCurrentBranch";
@@ -1,3 +0,0 @@
1
- import { logger } from 'src/utils';
2
-
3
- export const log = logger('git');
@@ -1,21 +0,0 @@
1
- import shell from "shelljs";
2
- import { log } from "./log";
3
- import { getRepo } from "./getRepo";
4
-
5
- export const openPr = (sourceBranch: string, destinationBranch: string) => {
6
- const repo = getRepo();
7
-
8
- const link = [
9
- "https://bitbucket.org/pezak/",
10
- repo,
11
- "/pull-requests/new?",
12
- `source=${sourceBranch}`,
13
- "&",
14
- `dest=${destinationBranch}`,
15
- ].join("");
16
-
17
- log.verbose("Open PR Link:", link);
18
- log.error("Har: This command does not work for the moment.");
19
-
20
- // shell.open(link);
21
- };
@@ -1,28 +0,0 @@
1
- import { getCmdOutput } from 'src/scripts/cmd';
2
- import { log } from './log';
3
-
4
- export type RemoteStatus =
5
- | 'up-to-date'
6
- | 'need-to-pull'
7
- | 'need-to-push'
8
- | 'diverged';
9
-
10
- export const remoteStatus = (branch = '@', upstream = '@{u}'): RemoteStatus => {
11
- const local = getCmdOutput(`git rev-parse ${branch}`);
12
- const remote = getCmdOutput(`git rev-parse ${upstream}`);
13
- const base = getCmdOutput(`git merge-base ${branch} ${upstream}`);
14
-
15
- log.verbose('remoteStatus:', { local, remote, base });
16
-
17
- if (local === remote) {
18
- return 'up-to-date';
19
- }
20
- if (local === base) {
21
- return 'need-to-pull';
22
- }
23
- if (remote === base) {
24
- return 'need-to-push';
25
- }
26
-
27
- return 'diverged';
28
- };
@@ -1,28 +0,0 @@
1
- import { executeCmd } from '../../cmd';
2
-
3
- export interface TagCreateOptions {
4
- /**
5
- * The object that the new tag will refer to, usually a commit.
6
- * Defaults to HEAD.
7
- */
8
- object?: string;
9
-
10
- /**
11
- * Replace an existing tag with the given name (instead of failing)
12
- */
13
- force?: boolean;
14
- }
15
-
16
- /**
17
- * Create a new annotated tag. Doesn't push it to the remote.
18
- * @param name The name of the tag to create.
19
- * @param object The object that the new tag will refer to, usually a commit. Defaults to HEAD.
20
- */
21
- export const createTag = (name: string, options: TagCreateOptions = {}) => {
22
- const { object = '', force } = options;
23
- executeCmd(`git tag ${name} ${object}`, {
24
- force,
25
- annotate: true,
26
- message: '',
27
- });
28
- };
@@ -1,11 +0,0 @@
1
- import { executeCmd } from 'src/scripts/cmd';
2
- import { log } from '../log';
3
-
4
- export const deleteTag = (name: string) => {
5
- log.verbose('Deleting tag locally and from remote:', name);
6
-
7
- executeCmd('git tag', {
8
- d: name,
9
- });
10
- executeCmd(`git push origin :${name}`);
11
- };
@@ -1,6 +0,0 @@
1
- import { getCmdOutput } from '../../cmd';
2
-
3
- export const getTags = (): string[] =>
4
- getCmdOutput('git tag', { list: true })
5
- .split('\n')
6
- .map((t) => t.trim());
@@ -1,6 +0,0 @@
1
- import { executeCmd } from 'src/scripts/cmd';
2
-
3
- export const pushAllTags = (remote = 'origin') =>
4
- executeCmd(`git push ${remote}`, {
5
- tags: true,
6
- });
@@ -1,12 +0,0 @@
1
- import { log } from '../log';
2
- import { createTag } from './createTag';
3
- import { deleteTag } from './deleteTag';
4
-
5
- export const renameTag = (oldTagName: string, newTagName: string) => {
6
- log.verbose('Renaming tag ', oldTagName, ' -> ', newTagName);
7
-
8
- createTag(newTagName, {
9
- object: `${oldTagName}^{}`,
10
- });
11
- deleteTag(oldTagName);
12
- };
@@ -1,11 +0,0 @@
1
- import { getCmdOutput } from '../cmd';
2
- import type { LernaPackage } from './types';
3
-
4
- export const changed = (): LernaPackage[] => {
5
- const jsonResult = getCmdOutput('npx lerna changed --json');
6
- if (!jsonResult) {
7
- return [];
8
- }
9
- const result = JSON.parse(jsonResult) as LernaPackage[];
10
- return result;
11
- };
@@ -1,6 +0,0 @@
1
- export const lernaJson = "lerna.json";
2
-
3
- export const INDEPENDENT_VERSION = "independent";
4
-
5
- export const packagesDir = "packages";
6
- export const packagesPrefix = "@pezak/";
@@ -1,21 +0,0 @@
1
- import { getDependencies } from './getDependencies';
2
- import { log } from './log';
3
-
4
- /**
5
- * Get packages that have a given dependency.
6
- * @param dependency Name of the dependency.
7
- * @returns List of package names, that have the given dependency.
8
- */
9
- export function filterByDependency(
10
- dependency: string,
11
- excludePrivate = true,
12
- ): string[] {
13
- log.verbose('getConfig', dependency, excludePrivate);
14
-
15
- const allPackages = getDependencies(excludePrivate);
16
-
17
- return Object.keys(allPackages).filter((name) => {
18
- const deps = allPackages[name];
19
- return deps.includes(dependency);
20
- });
21
- }
@@ -1,12 +0,0 @@
1
- import { findFile } from 'src/scripts/filesystem/findFile';
2
- import { loadJsonFile } from 'src/scripts/filesystem/loadJsonFile';
3
- import type { LernaConfig } from './types';
4
- import { lernaJson } from './constants';
5
- import { log } from './log';
6
-
7
- export const getConfig = () => {
8
- const configPath = findFile(lernaJson) ?? '';
9
-
10
- log.verbose('getConfig', configPath);
11
- return loadJsonFile<LernaConfig>(configPath);
12
- };
@@ -1,25 +0,0 @@
1
- import { getBashOutput } from '../cmd';
2
- import { log } from './log';
3
-
4
- /**
5
- * Get list of all packages in this monorepo,
6
- * with all their dependant packages.
7
- *
8
- * Each key of the object is a package from this monorepo.
9
- * The value is array of dependencies for each package.
10
- */
11
- export function getDependencies(
12
- excludePrivate = true,
13
- ): Record<string, string[]> {
14
- log.verbose('getDependencies', excludePrivate);
15
-
16
- const cmdResult = getBashOutput('lerna/list', {
17
- graph: true,
18
- all: !excludePrivate || undefined,
19
- noPrivate: excludePrivate || undefined,
20
- loglevel: 'silent',
21
- });
22
-
23
- const packages = JSON.parse(cmdResult) as Record<string, string[]>;
24
- return packages;
25
- }
@@ -1,44 +0,0 @@
1
- import { sep } from 'path';
2
- import { getBashOutput } from '../cmd';
3
- import type { LernaPackage, PackageDetails } from './types';
4
- import { packagesDir, packagesPrefix } from './constants';
5
- import { log } from './log';
6
-
7
- // TODO might want to move this 2 funcs to a more global cross package util
8
- const removePrefix = (txt: string, prefix: string) =>
9
- txt.startsWith(prefix) ? txt.substring(prefix.length) : txt;
10
-
11
- const toRelativePath = (absolutePath: string, baseDirName: string) => {
12
- const basePath = `${sep}${baseDirName}${sep}`;
13
- return absolutePath.substring(
14
- absolutePath.lastIndexOf(basePath) + basePath.length,
15
- );
16
- };
17
-
18
- export const getDetails = (excludePrivate = true): PackageDetails[] => {
19
- log.verbose('getDetails', excludePrivate);
20
-
21
- const result = getBashOutput('lerna/list', {
22
- json: true,
23
- all: !excludePrivate || undefined,
24
- noPrivate: excludePrivate || undefined,
25
- loglevel: 'silent',
26
- });
27
- const lernaPackages = JSON.parse(result) as LernaPackage[];
28
-
29
- return lernaPackages.map((pkg) => {
30
- const relativePath = toRelativePath(pkg.location, packagesDir);
31
- const displayName = `${relativePath} (${pkg.name})`;
32
- const shortName = removePrefix(pkg.name, packagesPrefix);
33
-
34
- return {
35
- name: pkg.name,
36
- version: pkg.version,
37
- isPrivate: pkg.private,
38
- absolutePath: pkg.location,
39
- relativePath,
40
- displayName,
41
- shortName,
42
- };
43
- });
44
- };
@@ -1,18 +0,0 @@
1
- import { executeBash } from 'src/scripts/cmd';
2
- import { getConfig } from './getConfig';
3
- import { changed } from './changed';
4
- import { getDependencies } from './getDependencies';
5
- import { filterByDependency } from './filterByDependency';
6
- import { getDetails } from './getDetails';
7
- import type { Args } from '../cmd/types';
8
-
9
- export const lerna = {
10
- version: (args?: Args) => executeBash('lerna/version', args),
11
- publish: (args?: Args) => executeBash('lerna/publish', args),
12
- list: (args?: Args) => executeBash('lerna/list', args),
13
- changed,
14
- getConfig,
15
- getDependencies,
16
- filterByDependency,
17
- getDetails,
18
- };
@@ -1,3 +0,0 @@
1
- import { logger } from 'src/utils';
2
-
3
- export const log = logger('lerna');
@@ -1,64 +0,0 @@
1
- export interface LernaConfig extends Record<string, unknown> {
2
- version: string;
3
- }
4
-
5
- export interface LernaPackage {
6
- /**
7
- * Name of the package from `package.json`.
8
- * @example '@gluhar/core'
9
- */
10
- name: string;
11
- /**
12
- * Version of the package from `package.json`.
13
- * @example '1.2.3'
14
- */
15
- version: string;
16
- /**
17
- * Looks for `private` property in the `package.json` file.
18
- */
19
- private: boolean;
20
- /**
21
- * Absolute path to the package folder.
22
- * @example 'Users/someone/Projects/gluhar/packages/core'
23
- */
24
- location: string;
25
- }
26
-
27
- export type ModuleName = "" | "dev" | "ui" | "sn";
28
-
29
- export interface PackageDetails {
30
- /**
31
- * Relative path & package name.
32
- * @example 'ui/app (@gluhar/core)'
33
- */
34
- displayName: string;
35
- /**
36
- * Name of the package from `package.json`.
37
- * @example '@gluhar/core'
38
- */
39
- name: string;
40
- /**
41
- * Name without the `@gluhar/` prefix.
42
- * @example 'core'
43
- */
44
- shortName: string;
45
- /**
46
- * Absolute path to the package folder.
47
- * @example 'Users/someone/Projects/gluhar/packages/core'
48
- */
49
- absolutePath: string;
50
- /**
51
- * Relative path to the package folder, from the `packages` folder.
52
- * @example 'core'
53
- */
54
- relativePath: string;
55
- /**
56
- * Version of the package from `package.json`.
57
- * @example 'v1.2.3'
58
- */
59
- version: string;
60
- /**
61
- * Looks for `private` property in the `package.json` file.
62
- */
63
- isPrivate: boolean;
64
- }
@@ -1,4 +0,0 @@
1
- import chalk from 'chalk';
2
-
3
- export const $branchName = chalk.blue.bold;
4
- export const $cmd = chalk.whiteBright.underline;
@@ -1,16 +0,0 @@
1
- export const capitalize = (s: string) => s[0].toUpperCase() + s.slice(1);
2
-
3
- /**
4
- * Check if a command exists in the system PATH
5
- * @param command The command to check
6
- * @returns true if the command exists, false otherwise
7
- */
8
- export const commandExists = (command: string): boolean => {
9
- try {
10
- const { spawnSync } = require("child_process");
11
- const result = spawnSync("which", [command], { stdio: "ignore" });
12
- return result.status === 0;
13
- } catch {
14
- return false;
15
- }
16
- };
@@ -1,20 +0,0 @@
1
- import inquirer from "inquirer";
2
-
3
- export interface ConfirmAnswer {
4
- confirm: boolean;
5
- }
6
-
7
- export const confirmQuestion = async (message: string, yes?: boolean) => {
8
- if (yes) {
9
- return true;
10
- }
11
-
12
- const answer = await inquirer.prompt<ConfirmAnswer>([
13
- {
14
- name: "confirm",
15
- type: "confirm",
16
- message,
17
- },
18
- ]);
19
- return answer.confirm;
20
- };