@cmflow/cli 2.0.0-alpha.12 → 2.0.0-alpha.13

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmflow/cli",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.13",
4
4
  "description": "An awesome Git Flow",
5
5
  "author": "camfou",
6
6
  "license": "MIT",
@@ -25,7 +25,12 @@ async function runAll(step, pluginConfig, context, defaultCondition) {
25
25
 
26
26
  const condition = pluginConfig.when !== undefined ? pluginConfig.when(context) : defaultCondition;
27
27
 
28
- if (condition && pluginConfig.run) {
28
+ if (!condition) {
29
+ context.logger.info(`Skip step "${step}" of plugin(s) "${pluginConfig.run}"`);
30
+ return;
31
+ }
32
+
33
+ if (pluginConfig.run) {
29
34
  const tasks = [].concat(pluginConfig.run);
30
35
 
31
36
  for (const task of tasks) {
@@ -34,7 +39,15 @@ async function runAll(step, pluginConfig, context, defaultCondition) {
34
39
  const taskFunction = mod[step];
35
40
 
36
41
  if (taskFunction) {
37
- await taskFunction(pluginConfig, context);
42
+ context.logger.log(` Start conditional step "${step}" of plugin "${task}"`);
43
+
44
+ try {
45
+ await taskFunction(pluginConfig, context);
46
+ context.logger.success(` Completed conditional step "${step}" of plugin "${task}"`);
47
+ } catch (er) {
48
+ context.logger.fail(` Fail conditional step "${step}" of plugin "${task}"`);
49
+ throw er;
50
+ }
38
51
  }
39
52
  }
40
53
  }
@@ -30,34 +30,8 @@ export function defineConfig(opts = {}) {
30
30
  generateNotes: ["@cmflow/cli/semantic/generate-notes"],
31
31
  prepare: [
32
32
  "@cmflow/cli/semantic/prepare/bump-version",
33
- // '@cmflow/cli/semantic/prepare/build',
34
- // '@cmflow/cli/semantic/prepare/e2e',
35
33
  "@cmflow/cli/semantif/prepare/post" // need to avoid semantic next step
36
34
  ],
37
- publish: [
38
- [
39
- "@cmflow/cli/semantic/publish",
40
- {
41
- runAfter: opts.runAfter
42
- }
43
- ]
44
- ],
45
- success: [
46
- [
47
- "@cmflow/cli/semantic/success",
48
- {
49
- runAfter: opts.runAfter
50
- }
51
- ]
52
- ],
53
- fail: [
54
- [
55
- "@cmflow/cli/semantic/fail",
56
- {
57
- runAfter: opts.runAfter
58
- }
59
- ]
60
- ],
61
35
  releaseRules,
62
36
  parserOpts: {
63
37
  noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES"]