@cmflow/cli 1.1.0 → 2.0.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 (124) hide show
  1. package/.prettierignore +5 -0
  2. package/.prettierrc +10 -0
  3. package/README.md +130 -32
  4. package/bin/cm-changelog.js +20 -12
  5. package/bin/cm-clean.js +4 -7
  6. package/bin/cm-config.js +8 -8
  7. package/bin/cm-deploy.js +4 -8
  8. package/bin/cm-fetch.js +7 -7
  9. package/bin/cm-finish.js +9 -9
  10. package/bin/cm-merge.js +7 -7
  11. package/bin/cm-publish.js +10 -10
  12. package/bin/cm-push.js +10 -10
  13. package/bin/cm-rebase.js +10 -10
  14. package/bin/cm-republish.js +7 -7
  15. package/bin/cm-start.js +10 -10
  16. package/bin/cm.js +20 -20
  17. package/bin/cmrelease.js +2 -2
  18. package/eslint.config.mjs +67 -0
  19. package/package.json +27 -21
  20. package/release.config.mjs +36 -19
  21. package/src/commands/changelog.js +23 -23
  22. package/src/commands/clean.js +13 -13
  23. package/src/commands/config.js +8 -8
  24. package/src/commands/deploy.js +15 -20
  25. package/src/commands/fetch.js +7 -10
  26. package/src/commands/finish.js +18 -19
  27. package/src/commands/index.js +10 -11
  28. package/src/commands/merge.js +30 -14
  29. package/src/commands/prompts/branches.js +20 -20
  30. package/src/commands/push.js +11 -14
  31. package/src/commands/rebase.js +17 -19
  32. package/src/commands/release.js +10 -11
  33. package/src/commands/republish.js +11 -14
  34. package/src/commands/start.js +52 -48
  35. package/src/commands/tasks/merge-branch.js +41 -37
  36. package/src/commands/tasks/push-branch.js +5 -11
  37. package/src/commands/tasks/rebase-all-branches.js +19 -24
  38. package/src/commands/tasks/refresh-repository.js +26 -24
  39. package/src/commands/tasks/run-test.js +11 -17
  40. package/src/commands/tasks/update-branch.js +33 -30
  41. package/src/commands/tasks/update-dependencies.js +38 -32
  42. package/src/commands/utils/check-install.js +16 -15
  43. package/src/common/cli/cli.js +55 -57
  44. package/src/common/cli/docker.js +31 -28
  45. package/src/common/cli/docker.test.js +94 -96
  46. package/src/common/cli/git.js +59 -68
  47. package/src/common/cli/git.test.js +187 -189
  48. package/src/common/cli/lerna.js +12 -12
  49. package/src/common/cli/lerna.test.js +38 -40
  50. package/src/common/cli/npm.js +17 -17
  51. package/src/common/cli/npm.test.js +38 -40
  52. package/src/common/cli/yarn.js +17 -17
  53. package/src/common/cli/yarn.test.js +40 -40
  54. package/src/common/configure-git-workspace.js +11 -17
  55. package/src/common/get-config.js +63 -119
  56. package/src/common/get-package-json.js +4 -4
  57. package/src/common/get-release-config.js +4 -5
  58. package/src/common/index.js +10 -10
  59. package/src/common/run-command.js +26 -28
  60. package/src/common/run-command.test.js +35 -39
  61. package/src/index.js +10 -1
  62. package/src/semantic/core/analyze-commits.js +17 -0
  63. package/src/semantic/core/conditional.js +25 -0
  64. package/src/semantic/core/fail.js +21 -0
  65. package/src/semantic/core/generate-notes.js +11 -0
  66. package/src/semantic/core/prepare/bump-version.js +38 -0
  67. package/src/semantic/core/prepare/post.js +38 -0
  68. package/src/semantic/core/prepare/run.js +22 -0
  69. package/src/semantic/core/success.js +33 -0
  70. package/src/semantic/core/verify-conditions.js +32 -0
  71. package/src/semantic/core/verify-release.js +9 -0
  72. package/src/semantic/define-config.js +68 -0
  73. package/src/semantic/docker/publish.js +5 -0
  74. package/src/semantic/docker/success.js +9 -0
  75. package/src/semantic/utils/bump-packages-version.js +52 -0
  76. package/src/semantic/utils/bump-packages-version.test.js +75 -0
  77. package/src/semantic/utils/calculate-snapshot-version.js +15 -0
  78. package/src/semantic/utils/calculate-snapshot-version.test.js +67 -0
  79. package/src/semantic/utils/display-package-info.js +11 -0
  80. package/src/semantic/utils/display-release-info.js +12 -0
  81. package/src/semantic/utils/docker-clean-tags.js +51 -0
  82. package/src/semantic/utils/docker-clean-tags.test.js +61 -0
  83. package/src/semantic/utils/docker-publish.js +23 -0
  84. package/src/semantic/utils/docker-publish.test.js +44 -0
  85. package/src/semantic/utils/log-section.js +5 -0
  86. package/src/semantic/utils/release-rules.js +15 -0
  87. package/src/semantic/utils/transform-writer.js +75 -0
  88. package/src/workflow/index.js +22 -22
  89. package/tsconfig.json +54 -0
  90. package/vitest.config.mts +10 -0
  91. package/bin/cm-publish-pages.js +0 -12
  92. package/semantic.js +0 -1
  93. package/src/commands/publish-pages.js +0 -29
  94. package/src/common/cli/heroku.js +0 -21
  95. package/src/common/cli/heroku.test.js +0 -62
  96. package/src/main.js +0 -10
  97. package/src/semantic-release/actions/analyze-commits.js +0 -14
  98. package/src/semantic-release/actions/fail.js +0 -16
  99. package/src/semantic-release/actions/generate-notes.js +0 -12
  100. package/src/semantic-release/actions/index.js +0 -8
  101. package/src/semantic-release/actions/prepare.js +0 -114
  102. package/src/semantic-release/actions/publish.js +0 -17
  103. package/src/semantic-release/actions/success.js +0 -32
  104. package/src/semantic-release/actions/verify-conditions.js +0 -30
  105. package/src/semantic-release/actions/verify-release.js +0 -9
  106. package/src/semantic-release/get-semantic-config.js +0 -115
  107. package/src/semantic-release/utils/bump-packages-version.js +0 -51
  108. package/src/semantic-release/utils/bump-packages-version.test.js +0 -78
  109. package/src/semantic-release/utils/calculate-snapshot-version.js +0 -10
  110. package/src/semantic-release/utils/calculate-snapshot-version.test.js +0 -69
  111. package/src/semantic-release/utils/display-package-info.js +0 -11
  112. package/src/semantic-release/utils/display-release-info.js +0 -12
  113. package/src/semantic-release/utils/docker-clean-tags.js +0 -45
  114. package/src/semantic-release/utils/docker-clean-tags.test.js +0 -63
  115. package/src/semantic-release/utils/docker-publish.js +0 -47
  116. package/src/semantic-release/utils/docker-publish.test.js +0 -67
  117. package/src/semantic-release/utils/ghpages-publish.js +0 -16
  118. package/src/semantic-release/utils/log-section.js +0 -5
  119. /package/src/{semantic-release → semantic}/utils/__mock__/test1/package.json +0 -0
  120. /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/a/package.json +0 -0
  121. /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/b/package.json +0 -0
  122. /package/src/{semantic-release → semantic}/utils/__mock__/test2/package.json +0 -0
  123. /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/a/package.json +0 -0
  124. /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/b/package.json +0 -0
@@ -0,0 +1,5 @@
1
+ dist
2
+ docs
3
+ node_modules
4
+ *-lock.json
5
+ *.lock
package/.prettierrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "singleQuote": false,
3
+ "jsxSingleQuote": false,
4
+ "semi": true,
5
+ "tabWidth": 2,
6
+ "bracketSpacing": true,
7
+ "arrowParens": "always",
8
+ "printWidth": 140,
9
+ "trailingComma": "none"
10
+ }
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  npm i -g @cmflow/cli
17
17
  ```
18
18
 
19
- ## CmFlow release
19
+ ## CmFlow release using Semantic Release
20
20
  ### Installation
21
21
 
22
22
  CmFlow is compatible with [semantic-release](https://github.com/semantic-release/semantic-release) 📦🚀. You can use
@@ -24,20 +24,80 @@ CmFlow release to deploy your projects based on CmFlow convention.
24
24
 
25
25
  Add the cmflow to your project:
26
26
 
27
- ```
27
+ ```sh
28
28
  npm i --save-dev @cmflow/cli
29
29
  ```
30
30
 
31
+ Edit your `package.json` and add the following configuration:
32
+
33
+ ```json
34
+ {
35
+ "flow": {
36
+ "branch": {
37
+ "develop": "master",
38
+ "production": "master"
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
31
44
  Then create `release.config.js` with this configuration:
32
45
 
33
46
  ```javascript
34
- const { getSemanticConfig } = require('@cmflow/cli')
35
-
36
- module.exports = {
37
- ...getSemanticConfig(),
38
- // Additional semantic configuration props
47
+ import { defineConfig } from '@cmflow/cli'
48
+
49
+ export default defineConfig({
50
+ verifyConditions: ['@cmflow/cli/semantic/verify-conditions'],
51
+ analyzeCommits: ['@cmflow/cli/semantic/analyze-commits'],
52
+ verifyRelease: ['@cmflow/cli/semantic/verify-release'],
53
+ generateNotes: ['@cmflow/cli/semantic/generate-notes'],
54
+ prepare: [
55
+ '@cmflow/cli/semantic/prepare/bump-version',
56
+ [
57
+ '@cmflow/cli/semantic/prepare/run', // add this task to trigger build npm task
58
+ {
59
+ command: 'build'
60
+ }
61
+ ],
62
+ [
63
+ '@cmflow/cli/semantic/prepare/run', // add this task to trigger build npm task
64
+ {
65
+ command: 'test_e2e'
66
+ }
67
+ ],
68
+ '@cmflow/cli/semantif/prepare/post'
69
+ ],
70
+ publish: [
71
+ [
72
+ '@cmflow/cli/semantic/conditional',
73
+ {
74
+ // when: (context) => context.branch.type === "release" // default condition to run the task
75
+ run: '@semantic-release/github' // only run if the conditional rule is true
76
+ }
77
+ ]
78
+ ],
79
+ success: [
80
+ '@cmflow/cli/semantic/success',
81
+ [
82
+ '@cmflow/cli/semantic/conditional',
83
+ {
84
+ // when: (context) => context.branch.type === "release" // default condition to run the task
85
+ run: '@semantic-release/github' // only run if the conditional rule is true
86
+ }
87
+ ]
88
+ ],
89
+ fail: [
90
+ '@cmflow/cli/semantic/fail',
91
+ [
92
+ '@cmflow/cli/semantic/conditional',
93
+ {
94
+ // when: (context) => context.branch.type === "release" // default condition to run the task
95
+ run: '@semantic-release/github' // only run if the conditional rule is true
96
+ }
97
+ ]
98
+ ],
39
99
  npmPublish: false
40
- }
100
+ })
41
101
  ```
42
102
 
43
103
  Then edit your `package.json` add the following tasks on script property:
@@ -53,9 +113,28 @@ Then edit your `package.json` add the following tasks on script property:
53
113
 
54
114
  Now, CmFlow and semantic release are correctly installed on your project.
55
115
 
116
+ ### Condition step (publish, success, fail)
117
+
118
+ CMFlow provide a `@cmflow/cli/semantic/conditional` task to run one task or many task only if a condition is true. The condition is a
119
+ function that takes the semantic context as parameter and return a boolean.
120
+
121
+ You can customize the condition to run the task by adding a `when` property to the configuration object.
122
+
123
+ ```javascript
124
+ export default defineConfig({
125
+ publish: [
126
+ '@cmflow/cli/semantic/conditional',
127
+ {
128
+ when: (context) => context.branch.type === 'release', // default condition to run the task
129
+ run: ['@semantic-release/github', '@semantic-release/github'] // only run if the conditional rule is true
130
+ }
131
+ ]
132
+ })
133
+ ```
134
+
56
135
  ### Build and E2E Test
57
136
 
58
- CmFlow release are able to run `build` and `test_e2e` task during the deploy process. It's useful when you want to
137
+ CmFlow release are able to run `build` and `test_e2e` task during the prepare step. It's useful when you want to
59
138
  deploy a docker image on docker hub with the right revision number in the `package.json`. The only requirement, is to
60
139
  have a `build` and `test_e2e` tasks in you npm scripts.
61
140
 
@@ -70,19 +149,42 @@ Example:
70
149
  }
71
150
  ```
72
151
 
73
- ### Generate changelog
152
+ ### Deploy on Docker Hub
74
153
 
75
- CmFlow release call also a npm task `build_changelog` to let you generate the changelog file with your preferred tool.
154
+ Add the following configuration to your `release.config.js`:
76
155
 
77
- Example:
156
+ ```js
157
+ import { defineConfig } from '@cmflow/cli'
78
158
 
79
- ```json
80
- {
81
- "scripts": {
82
- "build_changelog": "conventional-changelog --preset angular --release-count 0 --outfile ./CHANGELOG.md",
83
- "build_changelog": "cmchangelog"
84
- }
85
- }
159
+ export default defineConfig({
160
+ publish: [
161
+ [
162
+ '@cmflow/cli/semantic/conditional',
163
+ {
164
+ run: '@semantic-release/github'
165
+ }
166
+ ],
167
+ '@cmflow/cli/semantic/docker/publish'
168
+ ]
169
+ });
170
+ ```
171
+
172
+ ### Clean docker tags
173
+
174
+ ```js
175
+ import { defineConfig } from '@cmflow/cli'
176
+
177
+ export default defineConfig({
178
+ success: [
179
+ [
180
+ '@cmflow/cli/semantic/success',
181
+ {
182
+ runAfter: '@semantic-release/github' // only run if the conditional rule is true
183
+ }
184
+ ],
185
+ '@cmflow/cli/semantic/docker/publish'
186
+ ]
187
+ });
86
188
  ```
87
189
 
88
190
  ### Configure CI
@@ -90,17 +192,13 @@ Example:
90
192
  CmFlow release can be used with Travis CI, Circle CI and GitLab. You have to create these environments variables to
91
193
  allow git release note deployment, commit push and docker image deployment.
92
194
 
93
- | Variable | Description |
94
- |---------------------|---------------------------------------------------------------------------------------------------------------------------|
95
- | PROJECT_NAME | The project to publish artifact on docker |
96
- | GH_TOKEN | A GitHub [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line). |
97
- | GIT_USER_EMAIL | User mail to sign the commit produced by CmFlow release |
98
- | GIT_USER_NAME | User name to sign the commit produced by CmFlow release |
99
- | DEPLOY_ON_DOCKER | Set 1 to deploy on docker |
100
- | DOCKER_HUB_ID | The docker hub id |
101
- | DOCKER_HUB_PWD | The docker password account |
102
- | HEROKU_APP | Enable deployment on heroku. Note: You have to configure HEROKU_API_KEY token on your CI |
103
- | SKIP_DEPLOY | Skip all deployment task (docker, heroku). |
104
- | SKIP_GITHUB_PUBLISH | Skip tag and release note publication on Github. |
105
- | GITHUB_PAGES_PATH | Path to the front-end artifact. Enable github pages deployment. |
195
+ | Variable | Description |
196
+ |------------------------|---------------------------------------------------------------------------------------------------------------------------------|
197
+ | PROJECT_NAME | The project to publish artifact on docker |
198
+ | SCM_TOKEN | A SCM Token (GH_TOKEN or GITLAB_TOKEN) |
199
+ | GH_TOKEN (deprecated) | A GitHub token [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line). |
200
+ | GIT_USER_EMAIL | User mail to sign the commit produced by CmFlow release |
201
+ | GIT_USER_NAME | User name to sign the commit produced by CmFlow release |
202
+ | DOCKER_HUB_ID | The docker hub id |
203
+ | DOCKER_HUB_PWD | The docker password account |
106
204
 
@@ -1,18 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import commander from 'commander'
3
+ import commander from "commander";
4
4
 
5
- import { commands, runCommand } from '../src/index.js'
5
+ import { commands, runCommand } from "../src/index.js";
6
6
 
7
7
  commander
8
- .usage('cmchangelog [options]')
9
- .alias('cm changelog')
10
- .option('-p, --preset <preset>', 'Name of the preset you want to use. Must be one of the following:\n' +
11
- 'angular, atom, codemirror, ember, eslint, express, jquery, jscs or jshint', 'angular')
12
- .option('-r, --release-count <count>', 'How many releases to be generated from the latest\n' +
13
- 'If 0, the whole changelog will be regenerated and the outfile will be overwritten\n' +
14
- 'Default: 0', 0)
15
- .option('-t, --tag-prefix <prefix>', 'Tag prefix to consider when reading the tags')
16
- .parse(process.argv)
8
+ .usage("cmchangelog [options]")
9
+ .alias("cm changelog")
10
+ .option(
11
+ "-p, --preset <preset>",
12
+ "Name of the preset you want to use. Must be one of the following:\n" +
13
+ "angular, atom, codemirror, ember, eslint, express, jquery, jscs or jshint",
14
+ "angular"
15
+ )
16
+ .option(
17
+ "-r, --release-count <count>",
18
+ "How many releases to be generated from the latest\n" +
19
+ "If 0, the whole changelog will be regenerated and the outfile will be overwritten\n" +
20
+ "Default: 0",
21
+ 0
22
+ )
23
+ .option("-t, --tag-prefix <prefix>", "Tag prefix to consider when reading the tags")
24
+ .parse(process.argv);
17
25
 
18
- runCommand(commands.Changelog, commander)
26
+ runCommand(commands.Changelog, commander);
package/bin/cm-clean.js CHANGED
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
- commander
7
- .usage('cmclean <action> options]')
8
- .alias('cm clean')
9
- .parse(process.argv)
6
+ commander.usage("cmclean <action> options]").alias("cm clean").parse(process.argv);
10
7
 
11
- runCommand(commands.Clean, commander)
8
+ runCommand(commands.Clean, commander);
package/bin/cm-config.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import { commands, release, runCommand } from '../src/index.js'
2
+ import commander from "commander";
3
3
 
4
- import commander from 'commander'
4
+ import { commands, release, runCommand } from "../src/index.js";
5
5
 
6
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)
7
+ .usage("cmconfig")
8
+ .alias("cm config")
9
+ .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
+ .parse(process.argv);
11
11
 
12
12
  runCommand(commands.Config, {
13
13
  verbose: commander.verbose
14
- })
15
- release()
14
+ });
15
+ release();
package/bin/cm-deploy.js CHANGED
@@ -1,12 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
- commander
7
- .usage('cmdeploy [options]')
8
- .alias('cm deploy')
9
- .option('-t, --target <target>', 'Deploy on docker hub/Heroku (docker, heroku)')
10
- .parse(process.argv)
6
+ commander.usage("cmdeploy [options]").alias("cm deploy").option("-t, --target <target>", "Deploy on docker hub").parse(process.argv);
11
7
 
12
- runCommand(commands.Deploy, commander)
8
+ runCommand(commands.Deploy, commander);
package/bin/cm-fetch.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
11
 
12
- runCommand(commands.Fetch, commander)
12
+ runCommand(commands.Fetch, commander);
package/bin/cm-finish.js CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
13
 
14
- runCommand(commands.Finish, commander)
14
+ runCommand(commands.Finish, commander);
package/bin/cm-merge.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
7
+ .usage("cmmerge")
8
+ .alias("cm merge")
9
+ .option("-v, --verbose", "Enable verbose log", (v, t) => t + 1, 0)
10
+ .parse(process.argv);
11
11
 
12
- runCommand(commands.Merge, commander)
12
+ runCommand(commands.Merge, commander);
package/bin/cm-publish.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import { commands, runCommand } from '../src/index.js'
2
+ import commander from "commander";
3
3
 
4
- import commander from 'commander'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
14
 
15
- runCommand(commands.Push, commander)
15
+ runCommand(commands.Push, commander);
package/bin/cm-push.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
14
 
15
- runCommand(commands.Push, commander)
15
+ runCommand(commands.Push, commander);
package/bin/cm-rebase.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
14
 
15
- runCommand(commands.Rebase, commander)
15
+ runCommand(commands.Rebase, commander);
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { commands, runCommand } from '../src/index.js'
2
+ import commander from "commander";
3
3
 
4
- import commander from 'commander'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
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)
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
11
 
12
- runCommand(commands.Republish, commander)
12
+ runCommand(commands.Republish, commander);
package/bin/cm-start.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
- import commander from 'commander'
2
+ import commander from "commander";
3
3
 
4
- import { commands, runCommand } from '../src/index.js'
4
+ import { commands, runCommand } from "../src/index.js";
5
5
 
6
- const options = {}
6
+ const options = {};
7
7
 
8
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)
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
13
  .action((branchName) => {
14
- options.branchName = branchName
14
+ options.branchName = branchName;
15
15
  })
16
- .parse(process.argv)
16
+ .parse(process.argv);
17
17
 
18
18
  runCommand(commands.Start, {
19
19
  ...options,
20
20
  verbose: commander.verbose
21
- })
21
+ });
package/bin/cm.js CHANGED
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import commander from 'commander'
4
- import fs from 'fs-extra'
5
- import url from 'url'
6
- import path from 'path'
3
+ import commander from "commander";
4
+ import fs from "fs-extra";
5
+ import path from "path";
6
+ import url from "url";
7
7
 
8
- const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
9
- const cliPkg = fs.readJsonSync(path.join(__dirname, '../package.json'))
8
+ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
9
+ const cliPkg = fs.readJsonSync(path.join(__dirname, "../package.json"));
10
10
 
11
11
  commander
12
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('clean', 'Clean deployed docker image on Docker hub')
25
- .command('config', 'Configure git workspace with expected information')
26
- .parse(process.argv)
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("clean", "Clean deployed docker image on Docker hub")
25
+ .command("config", "Configure git workspace with expected information")
26
+ .parse(process.argv);
package/bin/cmrelease.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { release } from '../src/index.js'
3
+ import { release } from "../src/index.js";
4
4
 
5
- release()
5
+ release();