@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
@@ -1,44 +0,0 @@
1
- import { docker } from "../../common/cli/docker.js";
2
- import { getConfig } from "../../common/get-config.js";
3
- import { dockerPublish } from "./docker-publish.js";
4
-
5
- vi.mock("../../common/cli/docker.js", () => {
6
- return {
7
- docker: {
8
- login: vi.fn(),
9
- tag: vi.fn(),
10
- push: vi.fn()
11
- }
12
- };
13
- });
14
-
15
- vi.mock("../../common/get-config.js", () => {
16
- return {
17
- getConfig: vi.fn()
18
- };
19
- });
20
-
21
- describe("dockerPublish", () => {
22
- it("should publish docker image", async () => {
23
- getConfig.mockReturnValue({
24
- PRODUCTION_BRANCH: "production",
25
- DOCKER_REPOSITORY: "owner",
26
- DOCKER_HUB_ID: "login",
27
- DOCKER_HUB_PWD: "password"
28
- });
29
- const context = {
30
- logger: {
31
- info: vi.fn(),
32
- warn: vi.fn()
33
- },
34
- branch: {
35
- name: "branch-name"
36
- }
37
- };
38
- await dockerPublish(context);
39
-
40
- expect(docker.login).toHaveBeenCalledWith("-u", "login", "-p", "password");
41
- expect(docker.tag).toHaveBeenCalledWith("owner:latest", "owner:branch-name");
42
- expect(docker.push).toHaveBeenCalledWith("owner:branch-name");
43
- });
44
- });
@@ -1,5 +0,0 @@
1
- export function logSection(title, context) {
2
- context.logger.info("-----------------------------------");
3
- context.logger.info(`--- ${title}`);
4
- context.logger.info("-----------------------------------");
5
- }
@@ -1,15 +0,0 @@
1
- import omit from "lodash/omit.js";
2
-
3
- import { WORKFLOW_CONFIGURATION } from "../../workflow/index.js";
4
-
5
- export const releaseRules = [
6
- {
7
- breaking: true,
8
- release: "major"
9
- },
10
- {
11
- revert: true,
12
- release: "patch"
13
- },
14
- ...WORKFLOW_CONFIGURATION.map((props) => omit(props, ["label"]))
15
- ];
@@ -1,77 +0,0 @@
1
- import { WORKFLOW_CONFIGURATION } from "../../workflow/index.js";
2
-
3
- const commitTypeMapping = WORKFLOW_CONFIGURATION.reduce((obj, { type, label }) => {
4
- return {
5
- ...obj,
6
- [type]: label
7
- };
8
- }, {});
9
-
10
- const transformCommitType = (commit) => {
11
- if (commitTypeMapping[commit.type]) {
12
- return commitTypeMapping[commit.type];
13
- }
14
-
15
- return commitTypeMapping.default;
16
- };
17
-
18
- export function transformWriter(commit, context) {
19
- commit = { ...commit };
20
-
21
- const issues = [];
22
-
23
- commit.notes.forEach((note) => {
24
- note.title = "BREAKING CHANGES";
25
- });
26
-
27
- commit.type = transformCommitType(commit);
28
-
29
- if (commit.message && commit.message.match(/^[\w-]+$/i)) {
30
- return;
31
- }
32
-
33
- if (commit.subject) {
34
- commit.subject = commit.subject.replace("[MEP]", "");
35
- }
36
-
37
- if (commit.scope === "*") {
38
- commit.scope = "";
39
- }
40
-
41
- if (typeof commit.hash === "string") {
42
- commit.shortHash = commit.hash.substring(0, 7);
43
- }
44
-
45
- if (typeof commit.subject === "string") {
46
- let url = context.repository ? `${context.host}/${context.owner}/${context.repository}` : context.repoUrl;
47
- if (url) {
48
- url = `${url}/issues/`;
49
- // Issue URLs.
50
- commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
51
- issues.push(issue);
52
- return `[#${issue}](${url}${issue})`;
53
- });
54
- }
55
- if (context.host) {
56
- // User URLs.
57
- commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
58
- if (username.includes("/")) {
59
- return `@${username}`;
60
- }
61
-
62
- return `[@${username}](${context.host}/${username})`;
63
- });
64
- }
65
- }
66
-
67
- // remove references that already appear in the subject
68
- commit.references = commit.references.filter((reference) => {
69
- if (issues.indexOf(reference.issue) === -1) {
70
- return true;
71
- }
72
-
73
- return false;
74
- });
75
-
76
- return commit;
77
- }
@@ -1,42 +0,0 @@
1
- export const WORKFLOW_CONFIGURATION = [
2
- {
3
- type: "feat",
4
- label: "Features",
5
- release: "minor"
6
- },
7
- {
8
- type: "fix",
9
- label: "Bug Fixes",
10
- release: "patch"
11
- },
12
- {
13
- type: "chore",
14
- label: "Chores",
15
- release: false
16
- },
17
- {
18
- type: "ci",
19
- label: "CI",
20
- release: false
21
- },
22
- {
23
- type: "docs",
24
- label: "Documentation",
25
- release: "patch"
26
- },
27
- {
28
- type: "tech",
29
- label: "Technical Improvements",
30
- release: "patch"
31
- },
32
- {
33
- type: "refactor",
34
- label: "Technical Improvements",
35
- release: "patch"
36
- },
37
- {
38
- type: "default",
39
- label: "Miscellaneous",
40
- release: false
41
- }
42
- ];
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "target": "esnext",
5
- "module": "NodeNext",
6
- "moduleResolution": "NodeNext",
7
- "sourceMap": true,
8
- "declaration": false,
9
- "experimentalDecorators": true,
10
- "emitDecoratorMetadata": true,
11
- "skipLibCheck": true,
12
- "skipDefaultLibCheck": true,
13
- "isolatedModules": false,
14
- "allowJs": true,
15
- "suppressImplicitAnyIndexErrors": false,
16
- "noImplicitAny": true,
17
- "strictNullChecks": true,
18
- "strictPropertyInitialization": false,
19
- "noUnusedLocals": false,
20
- "noUnusedParameters": false,
21
- "allowSyntheticDefaultImports": true,
22
- "importHelpers": true,
23
- "newLine": "LF",
24
- "noEmit": true,
25
- "esModuleInterop": true,
26
- "resolveJsonModule": true,
27
- "useDefineForClassFields": false,
28
- "lib": ["ESNext", "dom", "ESNext.AsyncIterable"],
29
- "noResolve": false,
30
- "preserveConstEnums": true,
31
- "verbatimModuleSyntax": true,
32
- "outDir": "./dist",
33
- "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node", "vitest"]
34
- },
35
- "include": ["vite.config.mts", "./src/**", "./src/**/*.spec.js", "./src/**/*.test.js"],
36
- "exclude": ["node_modules"]
37
- }
package/vitest.config.mts DELETED
@@ -1,10 +0,0 @@
1
- // eslint-disable-next-line import/no-unresolved
2
- import { defineConfig } from "vitest/config";
3
-
4
- export default defineConfig({
5
- test: {
6
- globals: true,
7
- environment: "node"
8
- // ... Specify options here.
9
- }
10
- });