@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.
- package/.prettierignore +5 -0
- package/.prettierrc +10 -0
- package/README.md +130 -32
- package/bin/cm-changelog.js +20 -12
- package/bin/cm-clean.js +4 -7
- package/bin/cm-config.js +8 -8
- package/bin/cm-deploy.js +4 -8
- package/bin/cm-fetch.js +7 -7
- package/bin/cm-finish.js +9 -9
- package/bin/cm-merge.js +7 -7
- package/bin/cm-publish.js +10 -10
- package/bin/cm-push.js +10 -10
- package/bin/cm-rebase.js +10 -10
- package/bin/cm-republish.js +7 -7
- package/bin/cm-start.js +10 -10
- package/bin/cm.js +20 -20
- package/bin/cmrelease.js +2 -2
- package/eslint.config.mjs +67 -0
- package/package.json +27 -21
- package/release.config.mjs +36 -19
- package/src/commands/changelog.js +23 -23
- package/src/commands/clean.js +13 -13
- package/src/commands/config.js +8 -8
- package/src/commands/deploy.js +15 -20
- package/src/commands/fetch.js +7 -10
- package/src/commands/finish.js +18 -19
- package/src/commands/index.js +10 -11
- package/src/commands/merge.js +30 -14
- package/src/commands/prompts/branches.js +20 -20
- package/src/commands/push.js +11 -14
- package/src/commands/rebase.js +17 -19
- package/src/commands/release.js +10 -11
- package/src/commands/republish.js +11 -14
- package/src/commands/start.js +52 -48
- package/src/commands/tasks/merge-branch.js +41 -37
- package/src/commands/tasks/push-branch.js +5 -11
- package/src/commands/tasks/rebase-all-branches.js +19 -24
- package/src/commands/tasks/refresh-repository.js +26 -24
- package/src/commands/tasks/run-test.js +11 -17
- package/src/commands/tasks/update-branch.js +33 -30
- package/src/commands/tasks/update-dependencies.js +38 -32
- package/src/commands/utils/check-install.js +16 -15
- package/src/common/cli/cli.js +55 -57
- package/src/common/cli/docker.js +31 -28
- package/src/common/cli/docker.test.js +94 -96
- package/src/common/cli/git.js +59 -68
- package/src/common/cli/git.test.js +187 -189
- package/src/common/cli/lerna.js +12 -12
- package/src/common/cli/lerna.test.js +38 -40
- package/src/common/cli/npm.js +17 -17
- package/src/common/cli/npm.test.js +38 -40
- package/src/common/cli/yarn.js +17 -17
- package/src/common/cli/yarn.test.js +40 -40
- package/src/common/configure-git-workspace.js +11 -17
- package/src/common/get-config.js +63 -119
- package/src/common/get-package-json.js +4 -4
- package/src/common/get-release-config.js +4 -5
- package/src/common/index.js +10 -10
- package/src/common/run-command.js +26 -28
- package/src/common/run-command.test.js +35 -39
- package/src/index.js +10 -1
- package/src/semantic/core/analyze-commits.js +17 -0
- package/src/semantic/core/conditional.js +25 -0
- package/src/semantic/core/fail.js +21 -0
- package/src/semantic/core/generate-notes.js +11 -0
- package/src/semantic/core/prepare/bump-version.js +38 -0
- package/src/semantic/core/prepare/post.js +38 -0
- package/src/semantic/core/prepare/run.js +22 -0
- package/src/semantic/core/success.js +33 -0
- package/src/semantic/core/verify-conditions.js +32 -0
- package/src/semantic/core/verify-release.js +9 -0
- package/src/semantic/define-config.js +68 -0
- package/src/semantic/docker/publish.js +5 -0
- package/src/semantic/docker/success.js +9 -0
- package/src/semantic/utils/bump-packages-version.js +52 -0
- package/src/semantic/utils/bump-packages-version.test.js +75 -0
- package/src/semantic/utils/calculate-snapshot-version.js +15 -0
- package/src/semantic/utils/calculate-snapshot-version.test.js +67 -0
- package/src/semantic/utils/display-package-info.js +11 -0
- package/src/semantic/utils/display-release-info.js +12 -0
- package/src/semantic/utils/docker-clean-tags.js +51 -0
- package/src/semantic/utils/docker-clean-tags.test.js +61 -0
- package/src/semantic/utils/docker-publish.js +23 -0
- package/src/semantic/utils/docker-publish.test.js +44 -0
- package/src/semantic/utils/log-section.js +5 -0
- package/src/semantic/utils/release-rules.js +15 -0
- package/src/semantic/utils/transform-writer.js +75 -0
- package/src/workflow/index.js +22 -22
- package/tsconfig.json +54 -0
- package/vitest.config.mts +10 -0
- package/bin/cm-publish-pages.js +0 -12
- package/semantic.js +0 -1
- package/src/commands/publish-pages.js +0 -29
- package/src/common/cli/heroku.js +0 -21
- package/src/common/cli/heroku.test.js +0 -62
- package/src/main.js +0 -10
- package/src/semantic-release/actions/analyze-commits.js +0 -14
- package/src/semantic-release/actions/fail.js +0 -16
- package/src/semantic-release/actions/generate-notes.js +0 -12
- package/src/semantic-release/actions/index.js +0 -8
- package/src/semantic-release/actions/prepare.js +0 -114
- package/src/semantic-release/actions/publish.js +0 -17
- package/src/semantic-release/actions/success.js +0 -32
- package/src/semantic-release/actions/verify-conditions.js +0 -30
- package/src/semantic-release/actions/verify-release.js +0 -9
- package/src/semantic-release/get-semantic-config.js +0 -115
- package/src/semantic-release/utils/bump-packages-version.js +0 -51
- package/src/semantic-release/utils/bump-packages-version.test.js +0 -78
- package/src/semantic-release/utils/calculate-snapshot-version.js +0 -10
- package/src/semantic-release/utils/calculate-snapshot-version.test.js +0 -69
- package/src/semantic-release/utils/display-package-info.js +0 -11
- package/src/semantic-release/utils/display-release-info.js +0 -12
- package/src/semantic-release/utils/docker-clean-tags.js +0 -45
- package/src/semantic-release/utils/docker-clean-tags.test.js +0 -63
- package/src/semantic-release/utils/docker-publish.js +0 -47
- package/src/semantic-release/utils/docker-publish.test.js +0 -67
- package/src/semantic-release/utils/ghpages-publish.js +0 -16
- package/src/semantic-release/utils/log-section.js +0 -5
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/a/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/b/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/a/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/b/package.json +0 -0
package/.prettierignore
ADDED
package/.prettierrc
ADDED
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
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
|
-
###
|
|
152
|
+
### Deploy on Docker Hub
|
|
74
153
|
|
|
75
|
-
|
|
154
|
+
Add the following configuration to your `release.config.js`:
|
|
76
155
|
|
|
77
|
-
|
|
156
|
+
```js
|
|
157
|
+
import { defineConfig } from '@cmflow/cli'
|
|
78
158
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
94
|
-
|
|
95
|
-
| PROJECT_NAME
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
| DOCKER_HUB_ID
|
|
101
|
-
| DOCKER_HUB_PWD
|
|
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
|
|
package/bin/cm-changelog.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import commander from
|
|
3
|
+
import commander from "commander";
|
|
4
4
|
|
|
5
|
-
import { commands, runCommand } from
|
|
5
|
+
import { commands, runCommand } from "../src/index.js";
|
|
6
6
|
|
|
7
7
|
commander
|
|
8
|
-
.usage(
|
|
9
|
-
.alias(
|
|
10
|
-
.option(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { commands, release, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
10
|
-
.option(
|
|
11
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
10
|
-
.option(
|
|
11
|
-
.option(
|
|
12
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
10
|
-
.option(
|
|
11
|
-
.option(
|
|
12
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
10
|
-
.option(
|
|
11
|
-
.option(
|
|
12
|
-
.option(
|
|
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);
|
package/bin/cm-republish.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
6
|
commander
|
|
7
|
-
.usage(
|
|
8
|
-
.alias(
|
|
9
|
-
.option(
|
|
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
|
|
2
|
+
import commander from "commander";
|
|
3
3
|
|
|
4
|
-
import { commands, runCommand } from
|
|
4
|
+
import { commands, runCommand } from "../src/index.js";
|
|
5
5
|
|
|
6
|
-
const options = {}
|
|
6
|
+
const options = {};
|
|
7
7
|
|
|
8
8
|
commander
|
|
9
|
-
.usage(
|
|
10
|
-
.arguments(
|
|
11
|
-
.alias(
|
|
12
|
-
.option(
|
|
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
|
|
4
|
-
import fs from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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(
|
|
9
|
-
const cliPkg = fs.readJsonSync(path.join(__dirname,
|
|
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(
|
|
14
|
-
.command(
|
|
15
|
-
.command(
|
|
16
|
-
.command(
|
|
17
|
-
.command(
|
|
18
|
-
.command(
|
|
19
|
-
.command(
|
|
20
|
-
.command(
|
|
21
|
-
.command(
|
|
22
|
-
.command(
|
|
23
|
-
.command(
|
|
24
|
-
.command(
|
|
25
|
-
.command(
|
|
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