@cmflow/cli 1.0.16 → 1.1.1-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 +106 -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 +49 -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 +66 -38
- 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/fail.js +29 -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/publish.js +9 -0
- package/src/semantic/core/success.js +37 -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 +5 -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,75 @@ 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/publish',
|
|
73
|
+
{
|
|
74
|
+
runAfter: "@semantic-release/github" // only run if the conditional rule is true
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
],
|
|
78
|
+
success: [
|
|
79
|
+
[
|
|
80
|
+
'@cmflow/cli/semantic/publish',
|
|
81
|
+
{
|
|
82
|
+
runAfter: "@semantic-release/github" // only run if the conditional rule is true
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
],
|
|
86
|
+
fail: [
|
|
87
|
+
[
|
|
88
|
+
'@cmflow/cli/semantic/fail',
|
|
89
|
+
{
|
|
90
|
+
runAfter: "@semantic-release/github" // only run if the conditional rule is true
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
],
|
|
39
94
|
npmPublish: false
|
|
40
|
-
}
|
|
95
|
+
})
|
|
41
96
|
```
|
|
42
97
|
|
|
43
98
|
Then edit your `package.json` add the following tasks on script property:
|
|
@@ -55,7 +110,7 @@ Now, CmFlow and semantic release are correctly installed on your project.
|
|
|
55
110
|
|
|
56
111
|
### Build and E2E Test
|
|
57
112
|
|
|
58
|
-
CmFlow release are able to run `build` and `test_e2e` task during the
|
|
113
|
+
CmFlow release are able to run `build` and `test_e2e` task during the prepare step. It's useful when you want to
|
|
59
114
|
deploy a docker image on docker hub with the right revision number in the `package.json`. The only requirement, is to
|
|
60
115
|
have a `build` and `test_e2e` tasks in you npm scripts.
|
|
61
116
|
|
|
@@ -70,19 +125,42 @@ Example:
|
|
|
70
125
|
}
|
|
71
126
|
```
|
|
72
127
|
|
|
73
|
-
###
|
|
128
|
+
### Deploy on Docker Hub
|
|
74
129
|
|
|
75
|
-
|
|
130
|
+
Add the following configuration to your `release.config.js`:
|
|
76
131
|
|
|
77
|
-
|
|
132
|
+
```js
|
|
133
|
+
import { defineConfig } from '@cmflow/cli'
|
|
78
134
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
135
|
+
export default defineConfig({
|
|
136
|
+
publish: [
|
|
137
|
+
[
|
|
138
|
+
'@cmflow/cli/semantic/publish',
|
|
139
|
+
{
|
|
140
|
+
runAfter: '@semantic-release/github' // only run if the conditional rule is true
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
'@cmflow/cli/semantic/docker/publish'
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Clean docker tags
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
import { defineConfig } from '@cmflow/cli'
|
|
152
|
+
|
|
153
|
+
export default defineConfig({
|
|
154
|
+
success: [
|
|
155
|
+
[
|
|
156
|
+
'@cmflow/cli/semantic/success',
|
|
157
|
+
{
|
|
158
|
+
runAfter: '@semantic-release/github' // only run if the conditional rule is true
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
'@cmflow/cli/semantic/docker/publish'
|
|
162
|
+
]
|
|
163
|
+
});
|
|
86
164
|
```
|
|
87
165
|
|
|
88
166
|
### Configure CI
|
|
@@ -90,17 +168,13 @@ Example:
|
|
|
90
168
|
CmFlow release can be used with Travis CI, Circle CI and GitLab. You have to create these environments variables to
|
|
91
169
|
allow git release note deployment, commit push and docker image deployment.
|
|
92
170
|
|
|
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. |
|
|
171
|
+
| Variable | Description |
|
|
172
|
+
|------------------------|---------------------------------------------------------------------------------------------------------------------------------|
|
|
173
|
+
| PROJECT_NAME | The project to publish artifact on docker |
|
|
174
|
+
| SCM_TOKEN | A SCM Token (GH_TOKEN or GITLAB_TOKEN) |
|
|
175
|
+
| GH_TOKEN (deprecated) | A GitHub token [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line). |
|
|
176
|
+
| GIT_USER_EMAIL | User mail to sign the commit produced by CmFlow release |
|
|
177
|
+
| GIT_USER_NAME | User name to sign the commit produced by CmFlow release |
|
|
178
|
+
| DOCKER_HUB_ID | The docker hub id |
|
|
179
|
+
| DOCKER_HUB_PWD | The docker password account |
|
|
106
180
|
|
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
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
];
|