@cmflow/cli 3.2.1 → 3.4.0-alpha.1

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 (221) hide show
  1. package/{.prettierrc → .oxfmtrc.json} +2 -1
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
  4. package/.yarnrc.yml +8 -1
  5. package/README.md +66 -72
  6. package/bin/cm-checkfeatures.ts +10 -0
  7. package/bin/cm-clean.ts +10 -0
  8. package/bin/cm-config.ts +10 -0
  9. package/bin/cm-deploy.ts +10 -0
  10. package/bin/cm-expedit.ts +19 -0
  11. package/bin/cm-fetch.ts +10 -0
  12. package/bin/cm-finish.ts +10 -0
  13. package/bin/cm-jira-releases.ts +10 -0
  14. package/bin/cm-merge.ts +10 -0
  15. package/bin/cm-publish.ts +10 -0
  16. package/bin/cm-pull.ts +8 -0
  17. package/bin/cm-push.ts +10 -0
  18. package/bin/cm-rebase.ts +10 -0
  19. package/bin/{cmrelease.js → cm-release.ts} +0 -0
  20. package/bin/cm-republish.ts +10 -0
  21. package/bin/cm-start.ts +10 -0
  22. package/bin/cm.ts +40 -0
  23. package/dist/bin/cm.mjs +74985 -0
  24. package/dist/bin/cmrelease.mjs +72397 -0
  25. package/dist/cli-truncate-BmHD4ngn.mjs +152 -0
  26. package/dist/cli-truncate-CXNquMRK.mjs +152 -0
  27. package/dist/cli-truncate-DbOyuy2e.mjs +2 -0
  28. package/dist/cli-truncate-DbOyuy2e.mjs.map +1 -0
  29. package/dist/common-CwPbT3So.mjs +66 -0
  30. package/dist/common-CwPbT3So.mjs.map +1 -0
  31. package/dist/docker-clean-tags-Cd-E8IqJ.mjs +2 -0
  32. package/dist/docker-clean-tags-Cd-E8IqJ.mjs.map +1 -0
  33. package/dist/docker-publish-B0E0qYYB.mjs +2 -0
  34. package/dist/docker-publish-B0E0qYYB.mjs.map +1 -0
  35. package/dist/get-config-DoOyLztI.mjs +41 -0
  36. package/dist/get-config-DoOyLztI.mjs.map +1 -0
  37. package/dist/get-east-asian-width-Tfn8qoqd.mjs +2 -0
  38. package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +1 -0
  39. package/dist/get-east-asian-width-eFfEkHwo.mjs +682 -0
  40. package/dist/log-update-B2GqeeDd.mjs +497 -0
  41. package/dist/log-update-BldA9lkm.mjs +497 -0
  42. package/dist/log-update-By8Z-mak.mjs +6 -0
  43. package/dist/log-update-By8Z-mak.mjs.map +1 -0
  44. package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
  45. package/dist/semver-D8gwMSFO.mjs +2 -0
  46. package/dist/semver-D8gwMSFO.mjs.map +1 -0
  47. package/dist/src/index.mjs +18 -0
  48. package/dist/src/index.mjs.map +1 -0
  49. package/dist/src/semantic/core/analyze-commits.mjs +2 -0
  50. package/dist/src/semantic/core/analyze-commits.mjs.map +1 -0
  51. package/dist/src/semantic/core/conditional.mjs +2 -0
  52. package/dist/src/semantic/core/conditional.mjs.map +1 -0
  53. package/dist/src/semantic/core/exit.mjs +2 -0
  54. package/dist/src/semantic/core/exit.mjs.map +1 -0
  55. package/dist/src/semantic/core/prepare/bump-version.mjs +48 -0
  56. package/dist/src/semantic/core/prepare/bump-version.mjs.map +1 -0
  57. package/dist/src/semantic/core/prepare/commit.mjs +2 -0
  58. package/dist/src/semantic/core/prepare/commit.mjs.map +1 -0
  59. package/dist/src/semantic/core/prepare/release-info.mjs +2 -0
  60. package/dist/src/semantic/core/prepare/release-info.mjs.map +1 -0
  61. package/dist/src/semantic/core/run.mjs +2 -0
  62. package/dist/src/semantic/core/run.mjs.map +1 -0
  63. package/dist/src/semantic/core/sync-repository.mjs +2 -0
  64. package/dist/src/semantic/core/sync-repository.mjs.map +1 -0
  65. package/dist/src/semantic/core/verify-conditions.mjs +2 -0
  66. package/dist/src/semantic/core/verify-conditions.mjs.map +1 -0
  67. package/dist/src/semantic/core/verify-release.mjs +2 -0
  68. package/dist/src/semantic/core/verify-release.mjs.map +1 -0
  69. package/dist/src/semantic/docker/publish.mjs +2 -0
  70. package/dist/src/semantic/docker/publish.mjs.map +1 -0
  71. package/dist/src/semantic/docker/success.mjs +2 -0
  72. package/dist/src/semantic/docker/success.mjs.map +1 -0
  73. package/dist/strip-ansi-Aeu5cmZe.mjs +174 -0
  74. package/dist/strip-ansi-Cl0pRo-s.mjs +2 -0
  75. package/dist/strip-ansi-Cl0pRo-s.mjs.map +1 -0
  76. package/dist/wrap-ansi-BeIjar2W.mjs +2 -0
  77. package/dist/wrap-ansi-CWIezXNl.mjs +330 -0
  78. package/dist/wrap-ansi-DsMb4WnZ.mjs +9 -0
  79. package/dist/wrap-ansi-DsMb4WnZ.mjs.map +1 -0
  80. package/dist/wrap-ansi-T0rz0Urp.mjs +330 -0
  81. package/mise.toml +2 -0
  82. package/oxlint.json +25 -0
  83. package/package.json +65 -62
  84. package/release.config.mjs +6 -6
  85. package/src/commands/checkfeatures.ts +39 -0
  86. package/src/commands/clean.ts +36 -0
  87. package/src/commands/config.ts +31 -0
  88. package/src/commands/deploy.ts +39 -0
  89. package/src/commands/fetch.ts +30 -0
  90. package/src/commands/finish.ts +50 -0
  91. package/src/commands/{index.js → index.ts} +3 -0
  92. package/src/commands/jira-releases.ts +97 -0
  93. package/src/commands/merge.ts +58 -0
  94. package/src/commands/prompts/{branches.js → branches.ts} +13 -5
  95. package/src/commands/pull.ts +44 -0
  96. package/src/commands/push.ts +48 -0
  97. package/src/commands/rebase.ts +56 -0
  98. package/src/commands/republish.ts +34 -0
  99. package/src/commands/start.ts +123 -0
  100. package/src/commands/tasks/{merge-branch.js → merge-branch.ts} +18 -3
  101. package/src/commands/tasks/push-branch.ts +19 -0
  102. package/src/commands/tasks/{rebase-all-branches.js → rebase-all-branches.ts} +10 -2
  103. package/src/commands/tasks/{refresh-repository.js → refresh-repository.ts} +8 -4
  104. package/src/commands/tasks/run-test.ts +28 -0
  105. package/src/commands/tasks/{update-branch.js → update-branch.ts} +15 -9
  106. package/src/commands/tasks/{update-dependencies.js → update-dependencies.ts} +4 -3
  107. package/src/common/back/directus/{directus-flow.test.js → directus-flow.test.ts} +1 -0
  108. package/src/common/back/directus/{directus-flow.js → directus-flow.ts} +10 -2
  109. package/src/common/back/http/{http-proxy.js → http-proxy.ts} +7 -1
  110. package/src/common/back/http/{http-request.spec.js → http-request.spec.ts} +8 -7
  111. package/src/common/back/http/{http-request.js → http-request.ts} +16 -19
  112. package/src/common/back/jira/{get-sorted-releases.js → get-sorted-releases.ts} +2 -2
  113. package/src/common/back/jira/interfaces/JiraIIssue.d.ts +3 -3
  114. package/src/common/back/jira/{jira-releases.js → jira-releases.ts} +14 -3
  115. package/src/common/back/jira/{jira-request.js → jira-request.ts} +9 -1
  116. package/src/common/back/jira/{jira-search.js → jira-search.ts} +2 -2
  117. package/src/common/cli/{bun.test.js → bun.test.ts} +17 -10
  118. package/src/common/cli/{bun.js → bun.ts} +4 -4
  119. package/src/common/cli/cli.ts +127 -0
  120. package/src/common/cli/{docker.test.js → docker.test.ts} +22 -14
  121. package/src/common/cli/{docker.js → docker.ts} +6 -6
  122. package/src/common/cli/{git.test.js → git.test.ts} +19 -11
  123. package/src/common/cli/{git.js → git.ts} +24 -24
  124. package/src/common/cli/{lerna.test.js → lerna.test.ts} +18 -11
  125. package/src/common/cli/{lerna.js → lerna.ts} +4 -4
  126. package/src/common/cli/{npm.test.js → npm.test.ts} +17 -10
  127. package/src/common/cli/{npm.js → npm.ts} +4 -4
  128. package/src/common/cli/{pnpm.test.js → pnpm.test.ts} +17 -10
  129. package/src/common/cli/{pnpm.js → pnpm.ts} +4 -4
  130. package/src/common/cli/{yarn.test.js → yarn.test.ts} +17 -12
  131. package/src/common/cli/{yarn.js → yarn.ts} +4 -4
  132. package/src/common/configure-git-workspace.ts +39 -0
  133. package/src/common/{get-config.js → get-config.ts} +3 -1
  134. package/src/common/{get-package-json.js → get-package-json.ts} +1 -0
  135. package/src/common/{get-package-manager.js → get-package-manager.ts} +1 -0
  136. package/src/common/{get-release-config.js → get-release-config.ts} +1 -0
  137. package/src/common/{index.js → index.ts} +1 -0
  138. package/src/common/{run-command.test.js → run-command.test.ts} +1 -0
  139. package/src/common/run-command.ts +67 -0
  140. package/src/common/types.ts +26 -0
  141. package/src/common/vendor.d.ts +4 -0
  142. package/src/{index.js → index.ts} +5 -1
  143. package/src/semantic/core/{analyze-commits.js → analyze-commits.ts} +7 -3
  144. package/src/semantic/core/{conditional.js → conditional.ts} +16 -9
  145. package/src/semantic/core/{exit.js → exit.ts} +3 -2
  146. package/src/semantic/core/prepare/{bump-version.js → bump-version.ts} +11 -8
  147. package/src/semantic/core/prepare/{commit.js → commit.ts} +3 -2
  148. package/src/semantic/core/prepare/release-info.ts +6 -0
  149. package/src/semantic/core/{run.js → run.ts} +3 -2
  150. package/src/semantic/core/sync-repository.ts +55 -0
  151. package/src/semantic/core/{verify-conditions.js → verify-conditions.ts} +4 -3
  152. package/src/semantic/core/{verify-release.js → verify-release.ts} +2 -1
  153. package/src/semantic/docker/publish.ts +6 -0
  154. package/src/semantic/docker/{success.js → success.ts} +2 -1
  155. package/src/semantic/utils/__mock__/test1/package.json +7 -1
  156. package/src/semantic/utils/__mock__/test1/packages/a/package.json +9 -1
  157. package/src/semantic/utils/__mock__/test1/packages/b/package.json +7 -1
  158. package/src/semantic/utils/{bump-packages-version.test.js → bump-packages-version.test.ts} +1 -0
  159. package/src/semantic/utils/{bump-packages-version.js → bump-packages-version.ts} +12 -11
  160. package/src/semantic/utils/{calculate-snapshot-version.test.js → calculate-snapshot-version.test.ts} +10 -8
  161. package/src/semantic/utils/calculate-snapshot-version.ts +17 -0
  162. package/src/semantic/utils/display-package-info.ts +12 -0
  163. package/src/semantic/utils/display-release-info.ts +13 -0
  164. package/src/semantic/utils/{docker-clean-tags.test.js → docker-clean-tags.test.ts} +1 -0
  165. package/src/semantic/utils/{docker-clean-tags.js → docker-clean-tags.ts} +11 -4
  166. package/src/semantic/utils/{docker-publish.test.js → docker-publish.test.ts} +1 -0
  167. package/src/semantic/utils/{docker-publish.js → docker-publish.ts} +4 -3
  168. package/src/semantic/utils/{log-section.js → log-section.ts} +5 -1
  169. package/src/semantic/utils/{transform-writer.js → transform-writer.ts} +37 -13
  170. package/tsconfig.build.json +29 -0
  171. package/tsconfig.json +8 -32
  172. package/tsdown.config.ts +63 -0
  173. package/vitest.config.mts +4 -5
  174. package/.prettierignore +0 -5
  175. package/.yarn/releases/yarn-4.7.0.cjs +0 -935
  176. package/bin/checkfeatures.sh +0 -5
  177. package/bin/cm-clean.js +0 -8
  178. package/bin/cm-config.js +0 -15
  179. package/bin/cm-deploy.js +0 -8
  180. package/bin/cm-fetch.js +0 -12
  181. package/bin/cm-finish.js +0 -14
  182. package/bin/cm-jira-releases.js +0 -16
  183. package/bin/cm-merge.js +0 -12
  184. package/bin/cm-publish.js +0 -15
  185. package/bin/cm-push.js +0 -15
  186. package/bin/cm-rebase.js +0 -15
  187. package/bin/cm-republish.js +0 -12
  188. package/bin/cm-start.js +0 -21
  189. package/bin/cm.js +0 -27
  190. package/bin/cmexpedit.sh +0 -9
  191. package/bin/cmpull.sh +0 -7
  192. package/eslint.config.mjs +0 -67
  193. package/src/commands/clean.js +0 -29
  194. package/src/commands/config.js +0 -23
  195. package/src/commands/deploy.js +0 -34
  196. package/src/commands/fetch.js +0 -18
  197. package/src/commands/finish.js +0 -43
  198. package/src/commands/jira-releases.js +0 -62
  199. package/src/commands/merge.js +0 -41
  200. package/src/commands/push.js +0 -23
  201. package/src/commands/rebase.js +0 -35
  202. package/src/commands/republish.js +0 -21
  203. package/src/commands/start.js +0 -109
  204. package/src/commands/tasks/push-branch.js +0 -10
  205. package/src/commands/tasks/run-test.js +0 -21
  206. package/src/common/cli/cli.js +0 -110
  207. package/src/common/configure-git-workspace.js +0 -26
  208. package/src/common/run-command.js +0 -64
  209. package/src/semantic/core/prepare/release-info.js +0 -5
  210. package/src/semantic/core/sync-repository.js +0 -52
  211. package/src/semantic/docker/publish.js +0 -5
  212. package/src/semantic/utils/calculate-snapshot-version.js +0 -15
  213. package/src/semantic/utils/display-package-info.js +0 -11
  214. package/src/semantic/utils/display-release-info.js +0 -12
  215. /package/src/commands/{release.js → release.ts} +0 -0
  216. /package/src/commands/utils/{check-install.js → check-install.ts} +0 -0
  217. /package/src/common/back/jira/{jira-request.spec.js → jira-request.spec.ts} +0 -0
  218. /package/src/common/back/jira/{jira-search.spec.js → jira-search.spec.ts} +0 -0
  219. /package/src/semantic/{define-config.js → define-config.ts} +0 -0
  220. /package/src/semantic/utils/{release-rules.js → release-rules.ts} +0 -0
  221. /package/src/workflow/{index.js → index.ts} +0 -0
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- git fetch --all --prune --tags
5
- for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr %an" $branch | head -n 1` \\t$branch; done | sort -r
package/bin/cm-clean.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander.usage("cmclean <action> options]").alias("cm clean").parse(process.argv);
7
-
8
- runCommand(commands.Clean, commander);
package/bin/cm-config.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, release, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmconfig")
8
- .alias("cm config")
9
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
- .parse(process.argv);
11
-
12
- runCommand(commands.Config, {
13
- verbose: commander.verbose
14
- });
15
- release();
package/bin/cm-deploy.js DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander.usage("cmdeploy [options]").alias("cm deploy").option("-t, --target <target>", "Deploy on docker hub").parse(process.argv);
7
-
8
- runCommand(commands.Deploy, commander);
package/bin/cm-fetch.js DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmfetch [options]")
8
- .alias("cm fetch")
9
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
- .parse(process.argv);
11
-
12
- runCommand(commands.Fetch, commander);
package/bin/cm-finish.js DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmfinish [options]")
8
- .alias("cm finish")
9
- .option("-t, --unit-test", "Run unit test", (v, t) => t + 1, 0)
10
- .option("-c, --cucumber", "Run cucumber", (v, t) => t + 1, 0)
11
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
12
- .parse(process.argv);
13
-
14
- runCommand(commands.Finish, commander);
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cm jira-releases [options]")
8
- .alias("cm jira-releases")
9
- .option("-c, --component <compoent>", "Jira component filter")
10
- .option("-c, --project-id <projectId>", "Jira projectId filter")
11
- .option("-u, --update", "Update jira releases status if it's necessary", (v, t) => t + 1, 0)
12
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
13
- .option("-t, --tag <tag>", "The tag version you want to check or/and update")
14
- .parse(process.argv);
15
-
16
- runCommand(commands.JiraReleases, commander);
package/bin/cm-merge.js DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmmerge")
8
- .alias("cm merge")
9
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
- .parse(process.argv);
11
-
12
- runCommand(commands.Merge, commander);
package/bin/cm-publish.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmpublish [options]")
8
- .alias("cm publish")
9
- .option("-t, --unit-test", "Run unit test", (v, t) => t + 1, 0)
10
- .option("-c, --cucumber", "Run cucumber", (v, t) => t + 1, 0)
11
- .option("-f, --force", "Force push", (v, t) => t + 1, 0)
12
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
13
- .parse(process.argv);
14
-
15
- runCommand(commands.Push, commander);
package/bin/cm-push.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmpush [options]")
8
- .alias("cm push")
9
- .option("-t, --unit-test", "Run unit test", (v, t) => t + 1, 0)
10
- .option("-c, --cucumber", "Run cucumber", (v, t) => t + 1, 0)
11
- .option("-f, --force", "Force push", (v, t) => t + 1, 0)
12
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
13
- .parse(process.argv);
14
-
15
- runCommand(commands.Push, commander);
package/bin/cm-rebase.js DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmrebase [options]")
8
- .alias("cm rebase")
9
- .option("-t, --unit-test", "Run unit test", (v, t) => t + 1, 0)
10
- .option("-c, --cucumber", "Run cucumber", (v, t) => t + 1, 0)
11
- .option("-f, --force", "Force push", (v, t) => t + 1, 0)
12
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
13
- .parse(process.argv);
14
-
15
- runCommand(commands.Rebase, commander);
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- commander
7
- .usage("cmrepublish [options]")
8
- .alias("cm republish")
9
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
- .parse(process.argv);
11
-
12
- runCommand(commands.Republish, commander);
package/bin/cm-start.js DELETED
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import commander from "commander";
3
-
4
- import { commands, runCommand } from "../src/index.js";
5
-
6
- const options = {};
7
-
8
- commander
9
- .usage("cmstart [jiraId] [branchName]")
10
- .arguments("[jiraId] [branchName]")
11
- .alias("cm start")
12
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
13
- .action((branchName) => {
14
- options.branchName = branchName;
15
- })
16
- .parse(process.argv);
17
-
18
- runCommand(commands.Start, {
19
- ...options,
20
- verbose: commander.verbose
21
- });
package/bin/cm.js DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import commander from "commander";
4
- import fs from "fs-extra";
5
- import path from "path";
6
- import url from "url";
7
-
8
- const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
9
- const cliPkg = fs.readJsonSync(path.join(__dirname, "../package.json"));
10
-
11
- commander
12
- .version(cliPkg.version)
13
- .command("finish", "Rebase the branch, add [MEP] tag on latest commit and push it")
14
- .command("changelog", "Update changelog file for the project")
15
- .command("start", "Create a new branch from the latest commit of production branch")
16
- .command("push", "Rebase the current branch from production and push all commit")
17
- .command("publish", "Rebase the current branch from production and push all commit (alias of cm push)")
18
- .command("republish", "Rebase all branches from production")
19
- .command("publish-pages", "Publish github pages")
20
- .command("deploy", "Deploy app on docker hub/Heroku")
21
- .command("rebase", "Rebase the current branch from production")
22
- .command("merge", "Merge current branch into PRODUCTION_BRANCH")
23
- .command("fetch", "Download objects and refs from repository (--all and --prune)")
24
- .command("jira-releases", "Check jira releases status from given status (and update releases statuses if --update is set)")
25
- .command("clean", "Clean deployed docker image on Docker hub")
26
- .command("config", "Configure git workspace with expected information")
27
- .parse(process.argv);
package/bin/cmexpedit.sh DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
- git fetch --all --prune --tags
4
- FEATURE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
5
- npm version patch
6
- git push -u -f origin "${FEATURE_BRANCH}"
7
- echo "${FEATURE_BRANCH}" ' PUBLISH DONE'
8
- echo 'End publishfeat'
9
- exit 0
package/bin/cmpull.sh DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- git fetch --all --prune --tags
5
- git branch -D $1 | echo 'existing locale branch' $1 'deleted'
6
- git checkout origin/$1 --track
7
- echo 'BRANCH ' $1 ' RETRIEVE DONE'
package/eslint.config.mjs DELETED
@@ -1,67 +0,0 @@
1
- import stylistic from "@stylistic/eslint-plugin";
2
- import typescriptEslint from "@typescript-eslint/eslint-plugin";
3
- import typescriptParser from "@typescript-eslint/parser";
4
- import pluginPrettierRecommended from "eslint-plugin-prettier/recommended";
5
- import pluginSimpleImportSort from "eslint-plugin-simple-import-sort";
6
- import vitest from "eslint-plugin-vitest";
7
- import globals from "globals";
8
-
9
- export default [
10
- {
11
- ignores: [
12
- "node_modules",
13
- "dist",
14
- "**/public",
15
- "reports",
16
- "**/coverage",
17
- "**/reports",
18
- "**/dist",
19
- "**/node_modules",
20
- ".yarn",
21
- "**/__generated__/**"
22
- ]
23
- },
24
- {
25
- languageOptions: {
26
- sourceType: "module",
27
- parser: typescriptParser,
28
- parserOptions: {
29
- ecmaVersion: "latest",
30
- sourceType: "module"
31
- },
32
- globals: {
33
- ...globals.node
34
- }
35
- },
36
- plugins: {
37
- ...stylistic.configs.recommended.plugins,
38
- "@typescript-eslint": typescriptEslint,
39
- "simple-import-sort": pluginSimpleImportSort
40
- },
41
- rules: {
42
- ...stylistic.configs.recommended.rules,
43
- "@stylistic/lines-between-class-members": ["error", "always", { exceptAfterOverload: true }],
44
- "@typescript-eslint/no-unused-vars": "error",
45
- "simple-import-sort/imports": "error",
46
- "simple-import-sort/exports": "error"
47
- }
48
- },
49
- {
50
- files: ["*/*.spec.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}", "*/*.test.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], // or any other pattern
51
- plugins: {
52
- vitest
53
- },
54
- rules: {
55
- ...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules
56
- "vitest/consistent-test-it": [
57
- "error",
58
- {
59
- fn: "it",
60
- withinDescribe: "it"
61
- }
62
- ],
63
- "vitest/no-alias-methods": "error"
64
- }
65
- },
66
- pluginPrettierRecommended
67
- ];
@@ -1,29 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { dockerCleanTags } from "../semantic/utils/docker-clean-tags.js";
5
-
6
- export class Clean {
7
- mapContext(commander, context) {
8
- return {
9
- ...context
10
- };
11
- }
12
-
13
- prompt() {
14
- return [];
15
- }
16
-
17
- getTasks(context) {
18
- return [
19
- {
20
- title: "Clean docker tags",
21
- task: () => dockerCleanTags(context)
22
- }
23
- ];
24
- }
25
-
26
- success() {
27
- console.log(chalk.green(figures.tick), "Docker tags cleaned");
28
- }
29
- }
@@ -1,23 +0,0 @@
1
- import { configureGitWorkspace, getConfig } from "../common/index.js";
2
-
3
- export class Config {
4
- mapContext(commander, context) {
5
- return {
6
- ...context,
7
- config: getConfig()
8
- };
9
- }
10
-
11
- prompt() {
12
- return [];
13
- }
14
-
15
- getTasks(context) {
16
- return [
17
- {
18
- title: "Configure workspace",
19
- task: () => configureGitWorkspace(context)
20
- }
21
- ];
22
- }
23
- }
@@ -1,34 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { getConfig } from "../common/index.js";
5
- import { dockerPublish } from "../semantic/utils/docker-publish.js";
6
-
7
- export class Deploy {
8
- mapContext(commander, context) {
9
- return {
10
- ...context,
11
- target: commander.target,
12
- config: getConfig()
13
- };
14
- }
15
-
16
- prompt() {
17
- return [];
18
- }
19
-
20
- getTasks(context) {
21
- return [
22
- {
23
- title: "Deploy on docker",
24
- task: () => {
25
- return dockerPublish(context);
26
- }
27
- }
28
- ];
29
- }
30
-
31
- success() {
32
- console.log(chalk.green(figures.tick), "Docker image deployed");
33
- }
34
- }
@@ -1,18 +0,0 @@
1
- import { refreshRepository } from "./tasks/refresh-repository.js";
2
-
3
- export class Fetch {
4
- mapContext(commander, context) {
5
- return {
6
- ...context,
7
- output: []
8
- };
9
- }
10
-
11
- getTasks(context) {
12
- return [refreshRepository(context)];
13
- }
14
-
15
- success(context) {
16
- console.log(context.output.filter((l) => !l.match("Fetching")).join("\n"));
17
- }
18
- }
@@ -1,43 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { git } from "../common/cli/git.js";
5
- import { Rebase } from "./rebase.js";
6
- import { pushBranch } from "./tasks/push-branch.js";
7
-
8
- export class Finish extends Rebase {
9
- mapContext(commander, context) {
10
- return {
11
- ...super.mapContext(commander, context),
12
- checkStatus: true,
13
- force: true
14
- };
15
- }
16
-
17
- verifyConditions(context) {
18
- // Can't finish a production branch
19
- if (context.featureBranch === context.fromBranch) {
20
- console.error(chalk.red(`${figures.cross} ${context.fromBranch} cannot be finished`));
21
- process.exit(1);
22
- }
23
- }
24
-
25
- getTasks(context) {
26
- return [
27
- ...super.getTasks(context),
28
- {
29
- title: `Add ${context.RELEASE_CANDIDATE_TAG} on last commit`,
30
- task() {
31
- const message = `${git.getLastCommitMsg()} ${context.RELEASE_CANDIDATE_TAG}`;
32
-
33
- return git.commit("--amend", "-m", message).toObservable();
34
- }
35
- },
36
- pushBranch(context)
37
- ];
38
- }
39
-
40
- success(context) {
41
- console.log(chalk.green(figures.tick), "Branch", chalk.green(context.featureBranch), "is finished");
42
- }
43
- }
@@ -1,62 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
- import moment from "moment";
4
-
5
- import { triggerDirectusFlow } from "../common/back/directus/directus-flow.js";
6
- import { getSortedReleases } from "../common/back/jira/get-sorted-releases.js";
7
- import { updateJiraRelease } from "../common/back/jira/jira-releases.js";
8
- import { getConfig } from "../common/index.js";
9
-
10
- export class JiraReleases {
11
- mapContext(commander, context) {
12
- return {
13
- ...context,
14
- projectId: commander.projectId,
15
- update: commander.update,
16
- component: commander.component,
17
- tag: commander.tag.replace(/^version-/, "").replace(/^v/, "")
18
- };
19
- }
20
-
21
- getTasks(context) {
22
- if (!context.tag) {
23
- console.log(chalk.red(figures.cross), "Missing tag version. Skipping release notes generation");
24
- return [];
25
- }
26
-
27
- return [
28
- {
29
- title: `List all releases under ${context.tag} for ${context.component} component and ${context.projectId} project`,
30
- task: async () => {
31
- context.releases = (await getSortedReleases(context.projectId, context.component, context.tag))
32
- .filter(Boolean)
33
- .filter((release) => release.released === false);
34
- }
35
- },
36
- {
37
- title: `Update ${context.tag} on ${context.component} component`,
38
- skip: () => !context.update || context.releases.length === 0,
39
- task: async () => {
40
- for (const release of context.releases) {
41
- release.released = true;
42
- release.releaseDate = moment().format("YYYY-MM-DD");
43
-
44
- await updateJiraRelease(release);
45
- }
46
- }
47
- },
48
- {
49
- title: `Trigger CMS API Workflow`,
50
- skip: () => !getConfig().CAN_TRIGGER_WORKFLOW || context.releases.length === 0,
51
- task: () => {
52
- return triggerDirectusFlow(
53
- context.projectId,
54
- context.releases.map(({ version }) => {
55
- return version;
56
- })
57
- );
58
- }
59
- }
60
- ];
61
- }
62
- }
@@ -1,41 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { git } from "../common/cli/git.js";
5
- import { mergeBranch } from "./tasks/merge-branch.js";
6
-
7
- export class Merge {
8
- getTasks(context) {
9
- const { RELEASE_CANDIDATE_TAG } = context;
10
- this.lastCommitMessage = git.getLastCommitMsg();
11
- if (this.lastCommitMessage.includes(RELEASE_CANDIDATE_TAG)) {
12
- return [mergeBranch(context)];
13
- }
14
- return [];
15
- }
16
-
17
- success(context) {
18
- const { RELEASE_CANDIDATE_TAG } = context;
19
- if (this.lastCommitMessage.includes(RELEASE_CANDIDATE_TAG)) {
20
- context.logger.info(
21
- chalk.green(figures.tick),
22
- "Branch",
23
- chalk.green(context.BRANCH_NAME),
24
- `merged into ${context.PRODUCTION_BRANCH}`
25
- );
26
- } else {
27
- context.logger.info(
28
- chalk.green(figures.tick),
29
- "Merge branch",
30
- chalk.green(context.BRANCH_NAME),
31
- `into ${context.PRODUCTION_BRANCH} not required`
32
- );
33
- context.logger.info(
34
- chalk.green(figures.tick),
35
- "Last commit message : ",
36
- chalk.green(this.lastCommitMessage),
37
- `does not contains ${RELEASE_CANDIDATE_TAG}`
38
- );
39
- }
40
- }
41
- }
@@ -1,23 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { Rebase } from "./rebase.js";
5
- import { pushBranch } from "./tasks/push-branch.js";
6
-
7
- export class Push extends Rebase {
8
- mapContext(commander, context) {
9
- return {
10
- ...super.mapContext(commander, context),
11
- force: !!commander.force,
12
- checkStatus: true
13
- };
14
- }
15
-
16
- getTasks(context) {
17
- return [...super.getTasks(context), pushBranch(context)];
18
- }
19
-
20
- success(context) {
21
- console.log(chalk.green(figures.tick), "Branch", chalk.green(context.featureBranch), "rebased and pushed.");
22
- }
23
- }
@@ -1,35 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { git } from "../common/cli/git.js";
5
- import { Fetch } from "./fetch.js";
6
- import { runTest } from "./tasks/run-test.js";
7
- import { updateBranch } from "./tasks/update-branch.js";
8
- import { updateDependencies } from "./tasks/update-dependencies.js";
9
-
10
- export class Rebase extends Fetch {
11
- mapContext(commander, context) {
12
- return {
13
- ...context,
14
- origin: context.ORIGIN,
15
- featureBranch: git.getBranchName(),
16
- fromBranch: context.PRODUCTION_BRANCH,
17
- checkStatus: commander.force === undefined ? true : !!commander.force,
18
- rebase: true,
19
- skipTest: !commander.cucumber && !commander.unitTest,
20
- skipUnit: !commander.unitTest,
21
- skipE2E: context.HAS_E2E ? !commander.cucumber : true
22
- };
23
- }
24
-
25
- getTasks(context) {
26
- return [...super.getTasks(context), updateBranch(context), updateDependencies(context), ...runTest(context)];
27
- }
28
-
29
- success(context) {
30
- console.log(
31
- chalk.green(figures.tick),
32
- `Branch ${chalk.green(context.featureBranch)} rebased from ${chalk.green(context.fromBranch)} HEAD`
33
- );
34
- }
35
- }
@@ -1,21 +0,0 @@
1
- import chalk from "chalk";
2
- import figures from "figures";
3
-
4
- import { Fetch } from "./fetch.js";
5
- import { rebaseAllBranches } from "./tasks/rebase-all-branches.js";
6
-
7
- export class Republish extends Fetch {
8
- mapContext(commander, context) {
9
- return {
10
- ...super.mapContext(commander, context)
11
- };
12
- }
13
-
14
- getTasks(context) {
15
- return [...super.getTasks(context), rebaseAllBranches(context)];
16
- }
17
-
18
- success() {
19
- console.log(chalk.green(figures.tick), "All branches rebased and pushed.");
20
- }
21
- }