@cmflow/cli 3.3.0 → 3.4.0-alpha.3

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 (165) hide show
  1. package/README.md +102 -298
  2. package/dist/bin/cm.mjs +83622 -0
  3. package/dist/bin/cmrelease.mjs +75079 -0
  4. package/dist/cli-truncate-Bi2MjGwF.mjs +323 -0
  5. package/dist/cli-truncate-DMcpM5Q7.mjs +2 -0
  6. package/dist/cli-truncate-DMcpM5Q7.mjs.map +1 -0
  7. package/dist/cli-truncate-DsW0mgI_.mjs +323 -0
  8. package/dist/common-BdfXquG0.mjs +61 -0
  9. package/dist/common-BdfXquG0.mjs.map +1 -0
  10. package/dist/compile-packages-BB08_q2B.mjs +2 -0
  11. package/dist/compile-packages-BB08_q2B.mjs.map +1 -0
  12. package/dist/docker-Cc30aRzl.mjs +34 -0
  13. package/dist/docker-Cc30aRzl.mjs.map +1 -0
  14. package/dist/docker-clean-tags-EvFdWykP.mjs +2 -0
  15. package/dist/docker-clean-tags-EvFdWykP.mjs.map +1 -0
  16. package/dist/docker-publish-CG0aN9se.mjs +2 -0
  17. package/dist/docker-publish-CG0aN9se.mjs.map +1 -0
  18. package/dist/find-packages-611B-66T.mjs +42 -0
  19. package/dist/find-packages-611B-66T.mjs.map +1 -0
  20. package/dist/get-config-8ivgd1KC.mjs +9 -0
  21. package/dist/get-config-8ivgd1KC.mjs.map +1 -0
  22. package/dist/get-east-asian-width-Tfn8qoqd.mjs +2 -0
  23. package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +1 -0
  24. package/dist/get-east-asian-width-wiVWCFXf.mjs +682 -0
  25. package/dist/log-update-CLbF3iV6.mjs +6 -0
  26. package/dist/log-update-CLbF3iV6.mjs.map +1 -0
  27. package/dist/log-update-CTXRtajW.mjs +668 -0
  28. package/dist/log-update-Dy1vPMGY.mjs +668 -0
  29. package/dist/npm-VM_GgazT.mjs +2 -0
  30. package/dist/npm-VM_GgazT.mjs.map +1 -0
  31. package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
  32. package/dist/semver-DFjVbN1S.mjs +2 -0
  33. package/dist/semver-DFjVbN1S.mjs.map +1 -0
  34. package/dist/source-CwLcYLzI.mjs +7 -0
  35. package/dist/source-CwLcYLzI.mjs.map +1 -0
  36. package/dist/wrap-ansi-9ugahFCy.mjs +9 -0
  37. package/dist/wrap-ansi-9ugahFCy.mjs.map +1 -0
  38. package/dist/wrap-ansi-BRr0GA6g.mjs +330 -0
  39. package/dist/wrap-ansi-Cupoo4Yg.mjs +330 -0
  40. package/dist/wrap-ansi-dwgEjNWf.mjs +2 -0
  41. package/dist/write-package-cxki9d3K.mjs +8 -0
  42. package/dist/write-package-cxki9d3K.mjs.map +1 -0
  43. package/dist/write-packages-CxCAl_AG.mjs +10 -0
  44. package/dist/write-packages-CxCAl_AG.mjs.map +1 -0
  45. package/package.json +40 -63
  46. package/tsdown.config.ts +54 -0
  47. package/.oxfmtrc.json +0 -11
  48. package/.yarn/install-state.gz +0 -0
  49. package/.yarn/releases/yarn-4.7.0.cjs +0 -935
  50. package/.yarnrc.yml +0 -3
  51. package/bin/checkfeatures.js +0 -13
  52. package/bin/cm-clean.js +0 -8
  53. package/bin/cm-config.js +0 -15
  54. package/bin/cm-deploy.js +0 -8
  55. package/bin/cm-expedit.js +0 -19
  56. package/bin/cm-fetch.js +0 -12
  57. package/bin/cm-finish.js +0 -14
  58. package/bin/cm-jira-releases.js +0 -16
  59. package/bin/cm-merge.js +0 -12
  60. package/bin/cm-publish.js +0 -15
  61. package/bin/cm-push.js +0 -15
  62. package/bin/cm-rebase.js +0 -15
  63. package/bin/cm-republish.js +0 -12
  64. package/bin/cm-start.js +0 -21
  65. package/bin/cm.js +0 -27
  66. package/bin/cmpull.js +0 -22
  67. package/bin/cmrelease.js +0 -5
  68. package/mise.toml +0 -2
  69. package/oxlint.json +0 -25
  70. package/release.config.mjs +0 -39
  71. package/src/commands/checkfeatures.js +0 -20
  72. package/src/commands/clean.js +0 -29
  73. package/src/commands/config.js +0 -23
  74. package/src/commands/deploy.js +0 -34
  75. package/src/commands/fetch.js +0 -18
  76. package/src/commands/finish.js +0 -43
  77. package/src/commands/index.js +0 -12
  78. package/src/commands/jira-releases.js +0 -62
  79. package/src/commands/merge.js +0 -41
  80. package/src/commands/prompts/branches.js +0 -38
  81. package/src/commands/pull.js +0 -30
  82. package/src/commands/push.js +0 -23
  83. package/src/commands/rebase.js +0 -35
  84. package/src/commands/release.js +0 -21
  85. package/src/commands/republish.js +0 -21
  86. package/src/commands/start.js +0 -109
  87. package/src/commands/tasks/merge-branch.js +0 -65
  88. package/src/commands/tasks/push-branch.js +0 -10
  89. package/src/commands/tasks/rebase-all-branches.js +0 -29
  90. package/src/commands/tasks/refresh-repository.js +0 -34
  91. package/src/commands/tasks/run-test.js +0 -21
  92. package/src/commands/tasks/update-branch.js +0 -43
  93. package/src/commands/tasks/update-dependencies.js +0 -42
  94. package/src/commands/utils/check-install.js +0 -31
  95. package/src/common/back/directus/directus-flow.js +0 -40
  96. package/src/common/back/directus/directus-flow.test.js +0 -62
  97. package/src/common/back/http/http-proxy.js +0 -15
  98. package/src/common/back/http/http-request.js +0 -77
  99. package/src/common/back/http/http-request.spec.js +0 -49
  100. package/src/common/back/jira/get-sorted-releases.js +0 -40
  101. package/src/common/back/jira/interfaces/JiraIIssue.d.ts +0 -100
  102. package/src/common/back/jira/jira-releases.js +0 -36
  103. package/src/common/back/jira/jira-request.js +0 -21
  104. package/src/common/back/jira/jira-request.spec.js +0 -59
  105. package/src/common/back/jira/jira-search.js +0 -17
  106. package/src/common/back/jira/jira-search.spec.js +0 -44
  107. package/src/common/cli/bun.js +0 -33
  108. package/src/common/cli/bun.test.js +0 -51
  109. package/src/common/cli/cli.js +0 -110
  110. package/src/common/cli/docker.js +0 -66
  111. package/src/common/cli/docker.test.js +0 -133
  112. package/src/common/cli/git.js +0 -121
  113. package/src/common/cli/git.test.js +0 -207
  114. package/src/common/cli/lerna.js +0 -25
  115. package/src/common/cli/lerna.test.js +0 -51
  116. package/src/common/cli/npm.js +0 -33
  117. package/src/common/cli/npm.test.js +0 -51
  118. package/src/common/cli/pnpm.js +0 -34
  119. package/src/common/cli/pnpm.test.js +0 -51
  120. package/src/common/cli/yarn.js +0 -33
  121. package/src/common/cli/yarn.test.js +0 -53
  122. package/src/common/configure-git-workspace.js +0 -26
  123. package/src/common/get-config.js +0 -157
  124. package/src/common/get-package-json.js +0 -14
  125. package/src/common/get-package-manager.js +0 -12
  126. package/src/common/get-release-config.js +0 -8
  127. package/src/common/index.js +0 -13
  128. package/src/common/run-command.js +0 -64
  129. package/src/common/run-command.test.js +0 -65
  130. package/src/index.js +0 -10
  131. package/src/semantic/core/analyze-commits.js +0 -17
  132. package/src/semantic/core/conditional.js +0 -55
  133. package/src/semantic/core/exit.js +0 -14
  134. package/src/semantic/core/prepare/bump-version.js +0 -38
  135. package/src/semantic/core/prepare/commit.js +0 -29
  136. package/src/semantic/core/prepare/release-info.js +0 -5
  137. package/src/semantic/core/run.js +0 -22
  138. package/src/semantic/core/sync-repository.js +0 -52
  139. package/src/semantic/core/verify-conditions.js +0 -40
  140. package/src/semantic/core/verify-release.js +0 -9
  141. package/src/semantic/define-config.js +0 -42
  142. package/src/semantic/docker/publish.js +0 -5
  143. package/src/semantic/docker/success.js +0 -9
  144. package/src/semantic/utils/__mock__/test1/package.json +0 -7
  145. package/src/semantic/utils/__mock__/test1/packages/a/package.json +0 -9
  146. package/src/semantic/utils/__mock__/test1/packages/b/package.json +0 -7
  147. package/src/semantic/utils/__mock__/test2/package.json +0 -4
  148. package/src/semantic/utils/__mock__/test2/packages/a/package.json +0 -7
  149. package/src/semantic/utils/__mock__/test2/packages/b/package.json +0 -5
  150. package/src/semantic/utils/bump-packages-version.js +0 -52
  151. package/src/semantic/utils/bump-packages-version.test.js +0 -75
  152. package/src/semantic/utils/calculate-snapshot-version.js +0 -15
  153. package/src/semantic/utils/calculate-snapshot-version.test.js +0 -67
  154. package/src/semantic/utils/display-package-info.js +0 -11
  155. package/src/semantic/utils/display-release-info.js +0 -12
  156. package/src/semantic/utils/docker-clean-tags.js +0 -51
  157. package/src/semantic/utils/docker-clean-tags.test.js +0 -61
  158. package/src/semantic/utils/docker-publish.js +0 -23
  159. package/src/semantic/utils/docker-publish.test.js +0 -44
  160. package/src/semantic/utils/log-section.js +0 -5
  161. package/src/semantic/utils/release-rules.js +0 -15
  162. package/src/semantic/utils/transform-writer.js +0 -77
  163. package/src/workflow/index.js +0 -42
  164. package/tsconfig.json +0 -37
  165. package/vitest.config.mts +0 -10
package/.yarnrc.yml DELETED
@@ -1,3 +0,0 @@
1
- nodeLinker: node-modules
2
-
3
- yarnPath: .yarn/releases/yarn-4.7.0.cjs
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import commander from "commander";
4
-
5
- import { commands, runCommand } from "../src/index.js";
6
-
7
- commander
8
- .usage("checkfeatures")
9
- .alias("cm checkfeatures")
10
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
11
- .parse(process.argv);
12
-
13
- runCommand(commands.Checkfeatures, commander);
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-expedit.js DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { getConfig, getPackageManager, git } from "../src/index.js";
4
-
5
- async function expedit() {
6
- await git.fetch("--all", "--prune", "--tags");
7
-
8
- const featureBranch = git.getBranchName();
9
- const { PACKAGE_MANAGER } = getConfig();
10
-
11
- getPackageManager(PACKAGE_MANAGER).newVersion("patch");
12
-
13
- await git.push("-u", "-f", "origin", featureBranch);
14
-
15
- console.log(`${featureBranch} PUBLISH DONE`);
16
- console.log("End publishfeat");
17
- }
18
-
19
- expedit();
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/cmpull.js DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import commander from "commander";
4
-
5
- import { commands, runCommand } from "../src/index.js";
6
-
7
- const options = {};
8
-
9
- commander
10
- .usage("cmpull <branch>")
11
- .arguments("<branch>")
12
- .alias("cm pull")
13
- .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
14
- .action((branch) => {
15
- options.branch = branch;
16
- })
17
- .parse(process.argv);
18
-
19
- runCommand(commands.Pull, {
20
- ...options,
21
- verbose: commander.verbose
22
- });
package/bin/cmrelease.js DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { release } from "../src/index.js";
4
-
5
- release();
package/mise.toml DELETED
@@ -1,2 +0,0 @@
1
- [tools]
2
- node = "v24.18.0"
package/oxlint.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "plugins": ["typescript", "vitest"],
4
- "env": {
5
- "node": true
6
- },
7
- "ignorePatterns": ["node_modules", "dist", "public", "reports", "coverage", ".yarn", "__generated__"],
8
- "rules": {
9
- "no-var": "error",
10
- "no-console": "error",
11
- "camelcase": "off",
12
- "func-names": "error",
13
- "no-unused-vars": "off",
14
- "typescript/no-unused-vars": "error"
15
- },
16
- "overrides": [
17
- {
18
- "files": ["**/*.spec.{js,ts}", "**/*.test.{js,ts}"],
19
- "rules": {
20
- "vitest/consistent-test-it": ["error", { "fn": "it", "withinDescribe": "it" }],
21
- "vitest/no-alias-methods": "error"
22
- }
23
- }
24
- ]
25
- }
@@ -1,39 +0,0 @@
1
- import { defineConfig } from "./src/index.js";
2
-
3
- export default defineConfig({
4
- branches: [
5
- "master",
6
- {
7
- name: "alpha",
8
- prerelease: true,
9
- channel: "alpha"
10
- },
11
- {
12
- name: "beta",
13
- prerelease: true,
14
- channel: "beta"
15
- },
16
- {
17
- name: "rc",
18
- prerelease: true,
19
- channel: "rc"
20
- }
21
- ],
22
- verifyConditions: ["./src/semantic/core/verify-conditions.js"],
23
- analyzeCommits: ["@semantic-release/commit-analyzer"],
24
- verifyRelease: ["./src/semantic/core/verify-release.js"],
25
- generateNotes: [
26
- [
27
- "./src/semantic/core/conditional",
28
- {
29
- run: ["@semantic-release/release-notes-generator"]
30
- }
31
- ]
32
- ],
33
- prepare: ["./src/semantic/core/prepare/bump-version.js", "./src/semantic/core/prepare/commit.js"],
34
- publish: ["./src/semantic/core/sync-repository.js", "@semantic-release/github"],
35
- success: ["@semantic-release/github"],
36
- fail: ["@semantic-release/github"],
37
- npmPublish: false,
38
- writerOpts: {}
39
- });
@@ -1,20 +0,0 @@
1
- import { git } from "../common/index.js";
2
- import { refreshRepository } from "./tasks/refresh-repository.js";
3
-
4
- export class Checkfeatures {
5
- mapContext(commander, context) {
6
- return { ...context, output: [] };
7
- }
8
-
9
- getTasks(context) {
10
- return [refreshRepository(context)];
11
- }
12
-
13
- success() {
14
- const branches = git.branchesInfos("-r");
15
-
16
- for (const { branch, date, creation, author } of branches) {
17
- console.log(`${date}\t${creation}\t${author}\t${branch}`);
18
- }
19
- }
20
- }
@@ -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,12 +0,0 @@
1
- export * from "./checkfeatures.js";
2
- export * from "./clean.js";
3
- export * from "./deploy.js";
4
- export * from "./fetch.js";
5
- export * from "./finish.js";
6
- export * from "./jira-releases.js";
7
- export * from "./merge.js";
8
- export * from "./pull.js";
9
- export * from "./push.js";
10
- export * from "./rebase.js";
11
- export * from "./republish.js";
12
- export * from "./start.js";
@@ -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
- }