@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.
- package/{.prettierrc → .oxfmtrc.json} +2 -1
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.18.0.cjs +1000 -0
- package/.yarnrc.yml +8 -1
- package/README.md +66 -72
- package/bin/cm-checkfeatures.ts +10 -0
- package/bin/cm-clean.ts +10 -0
- package/bin/cm-config.ts +10 -0
- package/bin/cm-deploy.ts +10 -0
- package/bin/cm-expedit.ts +19 -0
- package/bin/cm-fetch.ts +10 -0
- package/bin/cm-finish.ts +10 -0
- package/bin/cm-jira-releases.ts +10 -0
- package/bin/cm-merge.ts +10 -0
- package/bin/cm-publish.ts +10 -0
- package/bin/cm-pull.ts +8 -0
- package/bin/cm-push.ts +10 -0
- package/bin/cm-rebase.ts +10 -0
- package/bin/{cmrelease.js → cm-release.ts} +0 -0
- package/bin/cm-republish.ts +10 -0
- package/bin/cm-start.ts +10 -0
- package/bin/cm.ts +40 -0
- package/dist/bin/cm.mjs +74985 -0
- package/dist/bin/cmrelease.mjs +72397 -0
- package/dist/cli-truncate-BmHD4ngn.mjs +152 -0
- package/dist/cli-truncate-CXNquMRK.mjs +152 -0
- package/dist/cli-truncate-DbOyuy2e.mjs +2 -0
- package/dist/cli-truncate-DbOyuy2e.mjs.map +1 -0
- package/dist/common-CwPbT3So.mjs +66 -0
- package/dist/common-CwPbT3So.mjs.map +1 -0
- package/dist/docker-clean-tags-Cd-E8IqJ.mjs +2 -0
- package/dist/docker-clean-tags-Cd-E8IqJ.mjs.map +1 -0
- package/dist/docker-publish-B0E0qYYB.mjs +2 -0
- package/dist/docker-publish-B0E0qYYB.mjs.map +1 -0
- package/dist/get-config-DoOyLztI.mjs +41 -0
- package/dist/get-config-DoOyLztI.mjs.map +1 -0
- package/dist/get-east-asian-width-Tfn8qoqd.mjs +2 -0
- package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +1 -0
- package/dist/get-east-asian-width-eFfEkHwo.mjs +682 -0
- package/dist/log-update-B2GqeeDd.mjs +497 -0
- package/dist/log-update-BldA9lkm.mjs +497 -0
- package/dist/log-update-By8Z-mak.mjs +6 -0
- package/dist/log-update-By8Z-mak.mjs.map +1 -0
- package/dist/rolldown-runtime-B4iAMlE-.mjs +35 -0
- package/dist/semver-D8gwMSFO.mjs +2 -0
- package/dist/semver-D8gwMSFO.mjs.map +1 -0
- package/dist/src/index.mjs +18 -0
- package/dist/src/index.mjs.map +1 -0
- package/dist/src/semantic/core/analyze-commits.mjs +2 -0
- package/dist/src/semantic/core/analyze-commits.mjs.map +1 -0
- package/dist/src/semantic/core/conditional.mjs +2 -0
- package/dist/src/semantic/core/conditional.mjs.map +1 -0
- package/dist/src/semantic/core/exit.mjs +2 -0
- package/dist/src/semantic/core/exit.mjs.map +1 -0
- package/dist/src/semantic/core/prepare/bump-version.mjs +48 -0
- package/dist/src/semantic/core/prepare/bump-version.mjs.map +1 -0
- package/dist/src/semantic/core/prepare/commit.mjs +2 -0
- package/dist/src/semantic/core/prepare/commit.mjs.map +1 -0
- package/dist/src/semantic/core/prepare/release-info.mjs +2 -0
- package/dist/src/semantic/core/prepare/release-info.mjs.map +1 -0
- package/dist/src/semantic/core/run.mjs +2 -0
- package/dist/src/semantic/core/run.mjs.map +1 -0
- package/dist/src/semantic/core/sync-repository.mjs +2 -0
- package/dist/src/semantic/core/sync-repository.mjs.map +1 -0
- package/dist/src/semantic/core/verify-conditions.mjs +2 -0
- package/dist/src/semantic/core/verify-conditions.mjs.map +1 -0
- package/dist/src/semantic/core/verify-release.mjs +2 -0
- package/dist/src/semantic/core/verify-release.mjs.map +1 -0
- package/dist/src/semantic/docker/publish.mjs +2 -0
- package/dist/src/semantic/docker/publish.mjs.map +1 -0
- package/dist/src/semantic/docker/success.mjs +2 -0
- package/dist/src/semantic/docker/success.mjs.map +1 -0
- package/dist/strip-ansi-Aeu5cmZe.mjs +174 -0
- package/dist/strip-ansi-Cl0pRo-s.mjs +2 -0
- package/dist/strip-ansi-Cl0pRo-s.mjs.map +1 -0
- package/dist/wrap-ansi-BeIjar2W.mjs +2 -0
- package/dist/wrap-ansi-CWIezXNl.mjs +330 -0
- package/dist/wrap-ansi-DsMb4WnZ.mjs +9 -0
- package/dist/wrap-ansi-DsMb4WnZ.mjs.map +1 -0
- package/dist/wrap-ansi-T0rz0Urp.mjs +330 -0
- package/mise.toml +2 -0
- package/oxlint.json +25 -0
- package/package.json +65 -62
- package/release.config.mjs +6 -6
- package/src/commands/checkfeatures.ts +39 -0
- package/src/commands/clean.ts +36 -0
- package/src/commands/config.ts +31 -0
- package/src/commands/deploy.ts +39 -0
- package/src/commands/fetch.ts +30 -0
- package/src/commands/finish.ts +50 -0
- package/src/commands/{index.js → index.ts} +3 -0
- package/src/commands/jira-releases.ts +97 -0
- package/src/commands/merge.ts +58 -0
- package/src/commands/prompts/{branches.js → branches.ts} +13 -5
- package/src/commands/pull.ts +44 -0
- package/src/commands/push.ts +48 -0
- package/src/commands/rebase.ts +56 -0
- package/src/commands/republish.ts +34 -0
- package/src/commands/start.ts +123 -0
- package/src/commands/tasks/{merge-branch.js → merge-branch.ts} +18 -3
- package/src/commands/tasks/push-branch.ts +19 -0
- package/src/commands/tasks/{rebase-all-branches.js → rebase-all-branches.ts} +10 -2
- package/src/commands/tasks/{refresh-repository.js → refresh-repository.ts} +8 -4
- package/src/commands/tasks/run-test.ts +28 -0
- package/src/commands/tasks/{update-branch.js → update-branch.ts} +15 -9
- package/src/commands/tasks/{update-dependencies.js → update-dependencies.ts} +4 -3
- package/src/common/back/directus/{directus-flow.test.js → directus-flow.test.ts} +1 -0
- package/src/common/back/directus/{directus-flow.js → directus-flow.ts} +10 -2
- package/src/common/back/http/{http-proxy.js → http-proxy.ts} +7 -1
- package/src/common/back/http/{http-request.spec.js → http-request.spec.ts} +8 -7
- package/src/common/back/http/{http-request.js → http-request.ts} +16 -19
- package/src/common/back/jira/{get-sorted-releases.js → get-sorted-releases.ts} +2 -2
- package/src/common/back/jira/interfaces/JiraIIssue.d.ts +3 -3
- package/src/common/back/jira/{jira-releases.js → jira-releases.ts} +14 -3
- package/src/common/back/jira/{jira-request.js → jira-request.ts} +9 -1
- package/src/common/back/jira/{jira-search.js → jira-search.ts} +2 -2
- package/src/common/cli/{bun.test.js → bun.test.ts} +17 -10
- package/src/common/cli/{bun.js → bun.ts} +4 -4
- package/src/common/cli/cli.ts +127 -0
- package/src/common/cli/{docker.test.js → docker.test.ts} +22 -14
- package/src/common/cli/{docker.js → docker.ts} +6 -6
- package/src/common/cli/{git.test.js → git.test.ts} +19 -11
- package/src/common/cli/{git.js → git.ts} +24 -24
- package/src/common/cli/{lerna.test.js → lerna.test.ts} +18 -11
- package/src/common/cli/{lerna.js → lerna.ts} +4 -4
- package/src/common/cli/{npm.test.js → npm.test.ts} +17 -10
- package/src/common/cli/{npm.js → npm.ts} +4 -4
- package/src/common/cli/{pnpm.test.js → pnpm.test.ts} +17 -10
- package/src/common/cli/{pnpm.js → pnpm.ts} +4 -4
- package/src/common/cli/{yarn.test.js → yarn.test.ts} +17 -12
- package/src/common/cli/{yarn.js → yarn.ts} +4 -4
- package/src/common/configure-git-workspace.ts +39 -0
- package/src/common/{get-config.js → get-config.ts} +3 -1
- package/src/common/{get-package-json.js → get-package-json.ts} +1 -0
- package/src/common/{get-package-manager.js → get-package-manager.ts} +1 -0
- package/src/common/{get-release-config.js → get-release-config.ts} +1 -0
- package/src/common/{index.js → index.ts} +1 -0
- package/src/common/{run-command.test.js → run-command.test.ts} +1 -0
- package/src/common/run-command.ts +67 -0
- package/src/common/types.ts +26 -0
- package/src/common/vendor.d.ts +4 -0
- package/src/{index.js → index.ts} +5 -1
- package/src/semantic/core/{analyze-commits.js → analyze-commits.ts} +7 -3
- package/src/semantic/core/{conditional.js → conditional.ts} +16 -9
- package/src/semantic/core/{exit.js → exit.ts} +3 -2
- package/src/semantic/core/prepare/{bump-version.js → bump-version.ts} +11 -8
- package/src/semantic/core/prepare/{commit.js → commit.ts} +3 -2
- package/src/semantic/core/prepare/release-info.ts +6 -0
- package/src/semantic/core/{run.js → run.ts} +3 -2
- package/src/semantic/core/sync-repository.ts +55 -0
- package/src/semantic/core/{verify-conditions.js → verify-conditions.ts} +4 -3
- package/src/semantic/core/{verify-release.js → verify-release.ts} +2 -1
- package/src/semantic/docker/publish.ts +6 -0
- package/src/semantic/docker/{success.js → success.ts} +2 -1
- package/src/semantic/utils/__mock__/test1/package.json +7 -1
- package/src/semantic/utils/__mock__/test1/packages/a/package.json +9 -1
- package/src/semantic/utils/__mock__/test1/packages/b/package.json +7 -1
- package/src/semantic/utils/{bump-packages-version.test.js → bump-packages-version.test.ts} +1 -0
- package/src/semantic/utils/{bump-packages-version.js → bump-packages-version.ts} +12 -11
- package/src/semantic/utils/{calculate-snapshot-version.test.js → calculate-snapshot-version.test.ts} +10 -8
- package/src/semantic/utils/calculate-snapshot-version.ts +17 -0
- package/src/semantic/utils/display-package-info.ts +12 -0
- package/src/semantic/utils/display-release-info.ts +13 -0
- package/src/semantic/utils/{docker-clean-tags.test.js → docker-clean-tags.test.ts} +1 -0
- package/src/semantic/utils/{docker-clean-tags.js → docker-clean-tags.ts} +11 -4
- package/src/semantic/utils/{docker-publish.test.js → docker-publish.test.ts} +1 -0
- package/src/semantic/utils/{docker-publish.js → docker-publish.ts} +4 -3
- package/src/semantic/utils/{log-section.js → log-section.ts} +5 -1
- package/src/semantic/utils/{transform-writer.js → transform-writer.ts} +37 -13
- package/tsconfig.build.json +29 -0
- package/tsconfig.json +8 -32
- package/tsdown.config.ts +63 -0
- package/vitest.config.mts +4 -5
- package/.prettierignore +0 -5
- package/.yarn/releases/yarn-4.7.0.cjs +0 -935
- package/bin/checkfeatures.sh +0 -5
- package/bin/cm-clean.js +0 -8
- package/bin/cm-config.js +0 -15
- package/bin/cm-deploy.js +0 -8
- package/bin/cm-fetch.js +0 -12
- package/bin/cm-finish.js +0 -14
- package/bin/cm-jira-releases.js +0 -16
- package/bin/cm-merge.js +0 -12
- package/bin/cm-publish.js +0 -15
- package/bin/cm-push.js +0 -15
- package/bin/cm-rebase.js +0 -15
- package/bin/cm-republish.js +0 -12
- package/bin/cm-start.js +0 -21
- package/bin/cm.js +0 -27
- package/bin/cmexpedit.sh +0 -9
- package/bin/cmpull.sh +0 -7
- package/eslint.config.mjs +0 -67
- package/src/commands/clean.js +0 -29
- package/src/commands/config.js +0 -23
- package/src/commands/deploy.js +0 -34
- package/src/commands/fetch.js +0 -18
- package/src/commands/finish.js +0 -43
- package/src/commands/jira-releases.js +0 -62
- package/src/commands/merge.js +0 -41
- package/src/commands/push.js +0 -23
- package/src/commands/rebase.js +0 -35
- package/src/commands/republish.js +0 -21
- package/src/commands/start.js +0 -109
- package/src/commands/tasks/push-branch.js +0 -10
- package/src/commands/tasks/run-test.js +0 -21
- package/src/common/cli/cli.js +0 -110
- package/src/common/configure-git-workspace.js +0 -26
- package/src/common/run-command.js +0 -64
- package/src/semantic/core/prepare/release-info.js +0 -5
- package/src/semantic/core/sync-repository.js +0 -52
- package/src/semantic/docker/publish.js +0 -5
- package/src/semantic/utils/calculate-snapshot-version.js +0 -15
- package/src/semantic/utils/display-package-info.js +0 -11
- package/src/semantic/utils/display-release-info.js +0 -12
- /package/src/commands/{release.js → release.ts} +0 -0
- /package/src/commands/utils/{check-install.js → check-install.ts} +0 -0
- /package/src/common/back/jira/{jira-request.spec.js → jira-request.spec.ts} +0 -0
- /package/src/common/back/jira/{jira-search.spec.js → jira-search.spec.ts} +0 -0
- /package/src/semantic/{define-config.js → define-config.ts} +0 -0
- /package/src/semantic/utils/{release-rules.js → release-rules.ts} +0 -0
- /package/src/workflow/{index.js → index.ts} +0 -0
package/bin/checkfeatures.sh
DELETED
package/bin/cm-clean.js
DELETED
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);
|
package/bin/cm-jira-releases.js
DELETED
|
@@ -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);
|
package/bin/cm-republish.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("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
package/bin/cmpull.sh
DELETED
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
|
-
];
|
package/src/commands/clean.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/config.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/deploy.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/fetch.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/finish.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/merge.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/push.js
DELETED
|
@@ -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
|
-
}
|
package/src/commands/rebase.js
DELETED
|
@@ -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
|
-
}
|