@gluhar/cli 3.0.1 → 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 -85
  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 -8
  418. package/src/utils/common.d.ts.map +0 -1
  419. package/src/utils/common.js +0 -21
  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
@@ -0,0 +1,26 @@
1
+ import { execSync } from 'child_process';
2
+ import { log } from './log';
3
+ import type { Args } from './types';
4
+ import { parseArgs } from './parseArgs';
5
+
6
+ /**
7
+ * A function that runs a bash script from a string and returns the output.
8
+ * Mainly used in js logic if you want the output of a bash script.
9
+ * @param cmd A one-line string of a bash command: 'npm install'.
10
+ * @param args Option flags to pass to the script: { m: 'Message', msg: 'asdf' }.
11
+ * @returns The output of the command as a string.
12
+ */
13
+ export const getCmdOutput = (cmd: string, args?: Args) => {
14
+ const cmdArgs = [cmd];
15
+ if (args) {
16
+ cmdArgs.push(...parseArgs(args));
17
+ }
18
+
19
+ const fullCmd = cmdArgs.join(' ');
20
+ log.verbose('getCmdOutput:', fullCmd);
21
+ return execSync(fullCmd).toString().trim();
22
+ };
23
+
24
+ // TODO make an async option
25
+ // TODO get output from a script file?
26
+ // TODO maybe utilise the other two function instead of execSync?
@@ -1,8 +1,10 @@
1
- export * from './executeBash';
2
- export * from './executeCmd';
3
- export * from './getCmdOutput';
4
- export * from './getBashOutput';
5
- export declare const cmd: {
6
- cd: (path: string) => void;
7
- };
8
- //# sourceMappingURL=index.d.ts.map
1
+ import { cd } from './cd';
2
+
3
+ export * from './executeBash';
4
+ export * from './executeCmd';
5
+ export * from './getCmdOutput';
6
+ export * from './getBashOutput';
7
+
8
+ export const cmd = {
9
+ cd,
10
+ };
@@ -0,0 +1,3 @@
1
+ import { logger } from 'src/utils';
2
+
3
+ export const log = logger('cmd');
@@ -0,0 +1,44 @@
1
+ import humps from "humps";
2
+ import type { Args, NotNullableProps, ParsedArg } from "./types";
3
+
4
+ const hyphenize = (s: string) => humps.decamelize(s, { separator: "-" });
5
+
6
+ const hasValue = (arg: ParsedArg): arg is NotNullableProps<ParsedArg> => {
7
+ return arg.value !== undefined;
8
+ };
9
+
10
+ export const parseArgs = (args: Args): string[] => {
11
+ return Object.entries(args)
12
+ .map(
13
+ ([name, value]): ParsedArg => ({
14
+ name,
15
+ parsedName: hyphenize(name),
16
+ value,
17
+ parsedValue: JSON.stringify(value),
18
+ })
19
+ )
20
+ .filter(hasValue)
21
+ .reduce((result, { name, parsedName, value, parsedValue }) => {
22
+ if (name.length > 1) {
23
+ result.push(`--${parsedName}`);
24
+ } else {
25
+ result.push(`-${parsedName}`);
26
+ }
27
+ value.toString();
28
+
29
+ if (value !== true) {
30
+ let v = parsedValue;
31
+ if (
32
+ v.length > 2 &&
33
+ v[0] === '"' &&
34
+ v[v.length - 1] === '"' &&
35
+ !v.includes(" ")
36
+ )
37
+ v = v.slice(1, -1);
38
+
39
+ result.push(v);
40
+ }
41
+
42
+ return result;
43
+ }, [] as string[]);
44
+ };
@@ -0,0 +1,21 @@
1
+ import { log } from './log';
2
+ import type { Args } from './types';
3
+ import { parseArgs } from './parseArgs';
4
+
5
+ export const parseBashArgs = (
6
+ path: string,
7
+ args?: Args,
8
+ absolute?: boolean,
9
+ ) => {
10
+ const filePath = path.endsWith('.sh') ? path : `${path}.sh`;
11
+ const absolutePath = !absolute ? `${__dirname}/../${filePath}` : filePath;
12
+ const flags = [absolutePath];
13
+
14
+ if (args) {
15
+ flags.push(...parseArgs(args));
16
+ }
17
+
18
+ log.verbose('executeBash:', flags.join(' '));
19
+
20
+ return flags;
21
+ };
@@ -0,0 +1,13 @@
1
+ export type ArgValue = string | number | boolean;
2
+ export type Args = Record<string, ArgValue | undefined> | {};
3
+
4
+ export interface ParsedArg {
5
+ name: string;
6
+ parsedName: string;
7
+ value: ArgValue | undefined;
8
+ parsedValue: string | undefined;
9
+ }
10
+
11
+ export type NotNullableProps<T> = {
12
+ [K in keyof T]: NonNullable<T[K]>;
13
+ };
@@ -0,0 +1,29 @@
1
+ import { join, relative } from "path";
2
+ import { copyFiles, FileInfoUpdate } from "./copyFiles";
3
+ import { log } from "./log";
4
+
5
+ /**
6
+ * Function that copies all files recursively from one dir to another allowing to update their content in the process.
7
+ * @param sourcePath Directory of files to copy recursively.
8
+ * @param destinationPath Destination directory to place files.
9
+ * @param updateContent Optional function that updates the contents of each file.
10
+ */
11
+ export const copyDir = (
12
+ sourcePath: string,
13
+ destinationPath: string,
14
+ updateFile?: FileInfoUpdate
15
+ ) => {
16
+ log.verbose("copyDir", { sourcePath, destinationPath });
17
+ const glob = join(sourcePath, "**", "*.*");
18
+
19
+ return copyFiles([glob], (file) => {
20
+ const newDir = join(destinationPath, relative(sourcePath, file.dir));
21
+ log.verbose("copyDir file from", file.dir, "to", newDir);
22
+ const f = updateFile ? updateFile(file) : file;
23
+
24
+ return {
25
+ ...f,
26
+ dir: newDir,
27
+ };
28
+ });
29
+ };
@@ -0,0 +1,75 @@
1
+ import { mkdir, readFile, writeFile } from "fs/promises";
2
+ import { glob } from "glob";
3
+ import { type ParsedPath, parse, resolve, format } from "path";
4
+ import { exists } from "fs-extra";
5
+ import { log } from "./log";
6
+
7
+ export interface FileInfo extends Omit<ParsedPath, "root"> {
8
+ name: string;
9
+ content: string;
10
+ encoding: BufferEncoding;
11
+ }
12
+
13
+ export type FileInfoUpdate = (fileInfo: FileInfo) => Partial<FileInfo>;
14
+
15
+ export const loadFiles = async (globs: string[]): Promise<FileInfo[]> => {
16
+ const { isText } = await import("istextorbinary");
17
+
18
+ log.verbose("Globs:", globs);
19
+ const filePaths = await glob(globs, {
20
+ nodir: true,
21
+ dot: true,
22
+ nocase: true,
23
+ });
24
+ log.verbose("Loaded files:", filePaths.length);
25
+
26
+ const files = filePaths.map(async (path): Promise<FileInfo> => {
27
+ const encoding = isText(path) ? "utf-8" : "binary";
28
+
29
+ return {
30
+ ...parse(path),
31
+ content: await readFile(path, encoding),
32
+ encoding,
33
+ };
34
+ });
35
+
36
+ return Promise.all(files);
37
+ };
38
+
39
+ export const updateFiles = (
40
+ files: FileInfo[],
41
+ update: FileInfoUpdate
42
+ ): FileInfo[] => {
43
+ return files.map((original): FileInfo => {
44
+ log.verbose("Updating file", original.dir, original.base);
45
+ const updated = update(original);
46
+ return {
47
+ ...original,
48
+ ...updated,
49
+ };
50
+ });
51
+ };
52
+
53
+ const getPath = (relative: string) => resolve(process.cwd(), relative);
54
+
55
+ const write = async (files: FileInfo[]) => {
56
+ const writes = files.map(async (file) => {
57
+ const dirPath = getPath(file.dir);
58
+ const dirExists = await exists(dirPath);
59
+ if (!dirExists) {
60
+ await mkdir(dirPath, { recursive: true });
61
+ }
62
+
63
+ const filePath = getPath(format(file));
64
+ log.verbose("Writing file", filePath);
65
+ await writeFile(filePath, file.content, file.encoding);
66
+ });
67
+
68
+ await Promise.all(writes);
69
+ };
70
+
71
+ export const copyFiles = async (globs: string[], update: FileInfoUpdate) => {
72
+ const files = await loadFiles(globs);
73
+ const updatedFiles = updateFiles(files, update);
74
+ await write(updatedFiles);
75
+ };
@@ -0,0 +1,29 @@
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
+ };
@@ -0,0 +1,15 @@
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
+ };
@@ -0,0 +1,17 @@
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
+ };
@@ -0,0 +1,3 @@
1
+ import { logger } from 'src/utils';
2
+
3
+ export const log = logger('filesystem');
@@ -0,0 +1,21 @@
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, '');
@@ -0,0 +1,32 @@
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
+ };
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1,19 @@
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
+ };
@@ -0,0 +1,37 @@
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
+ };
@@ -0,0 +1,20 @@
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
+ };
File without changes
@@ -0,0 +1,11 @@
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
+ };
@@ -0,0 +1,44 @@
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";
@@ -0,0 +1,3 @@
1
+ import { logger } from 'src/utils';
2
+
3
+ export const log = logger('git');
@@ -0,0 +1,21 @@
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
+ };
@@ -0,0 +1,28 @@
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
+ };
@@ -0,0 +1,28 @@
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
+ };
@@ -0,0 +1,11 @@
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
+ };
@@ -0,0 +1,6 @@
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());
@@ -0,0 +1,6 @@
1
+ import { executeCmd } from 'src/scripts/cmd';
2
+
3
+ export const pushAllTags = (remote = 'origin') =>
4
+ executeCmd(`git push ${remote}`, {
5
+ tags: true,
6
+ });
@@ -0,0 +1,12 @@
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
+ };
@@ -0,0 +1,11 @@
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
+ };
@@ -0,0 +1,6 @@
1
+ export const lernaJson = "lerna.json";
2
+
3
+ export const INDEPENDENT_VERSION = "independent";
4
+
5
+ export const packagesDir = "packages";
6
+ export const packagesPrefix = "@pezak/";