@cmflow/cli 2.0.0-alpha.5 → 2.0.0-alpha.6
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/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/README.md
CHANGED
|
@@ -50,7 +50,15 @@ export default defineConfig({
|
|
|
50
50
|
verifyConditions: ['@cmflow/cli/semantic/verify-conditions'],
|
|
51
51
|
analyzeCommits: ['@cmflow/cli/semantic/analyze-commits'],
|
|
52
52
|
verifyRelease: ['@cmflow/cli/semantic/verify-release'],
|
|
53
|
-
generateNotes: [
|
|
53
|
+
generateNotes: [
|
|
54
|
+
[
|
|
55
|
+
"@cmflow/cli/semantic/conditional", // add this task to trigger build npm task
|
|
56
|
+
{
|
|
57
|
+
// when: (context) => context.branch.type === "release" // default condition to run the task
|
|
58
|
+
run: ["@semantic-release/release-notes-generator"]
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
],
|
|
54
62
|
prepare: [
|
|
55
63
|
'@cmflow/cli/semantic/prepare/bump-version',
|
|
56
64
|
[
|
package/package.json
CHANGED
package/release.config.mjs
CHANGED
|
@@ -22,7 +22,14 @@ export default defineConfig({
|
|
|
22
22
|
verifyConditions: ["./src/semantic/core/verify-conditions.js"],
|
|
23
23
|
analyzeCommits: ["@semantic-release/commit-analyzer"],
|
|
24
24
|
verifyRelease: ["./src/semantic/core/verify-release.js"],
|
|
25
|
-
generateNotes: [
|
|
25
|
+
generateNotes: [
|
|
26
|
+
[
|
|
27
|
+
"./src/semantic/core/conditional",
|
|
28
|
+
{
|
|
29
|
+
run: ["@semantic-release/release-notes-generator"]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
],
|
|
26
33
|
prepare: ["./src/semantic/core/prepare/bump-version.js", "./src/semantic/core/prepare/commit.js"],
|
|
27
34
|
publish: ["./src/semantic/core/publish/sync-repository.js", "@semantic-release/github"],
|
|
28
35
|
success: ["@semantic-release/github"],
|
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
import { getConfig } from "../../common/index.js";
|
|
2
2
|
|
|
3
3
|
export function prepare(pluginConfig, context) {
|
|
4
|
-
return runAll(pluginConfig, context, context.branch?.type === "release");
|
|
4
|
+
return runAll("prepare", pluginConfig, context, context.branch?.type === "release");
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export function success(pluginConfig, context) {
|
|
8
|
-
return runAll(pluginConfig, context, context.branch?.type === "release");
|
|
8
|
+
return runAll("success", pluginConfig, context, context.branch?.type === "release");
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function publish(pluginConfig, context) {
|
|
12
|
-
return runAll(pluginConfig, context, context.branch?.type === "release");
|
|
12
|
+
return runAll("publish", pluginConfig, context, context.branch?.type === "release");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function generateNotes(pluginConfig, context) {
|
|
16
|
+
return runAll("generateNotes", pluginConfig, context, context.branch?.type === "release");
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export function fail(pluginConfig, context) {
|
|
16
|
-
return runAll(pluginConfig, context, context.branch?.type === "release");
|
|
20
|
+
return runAll("fail", pluginConfig, context, context.branch?.type === "release");
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
async function runAll(pluginConfig, context, defaultCondition) {
|
|
23
|
+
async function runAll(step, pluginConfig, context, defaultCondition) {
|
|
20
24
|
context.config = getConfig();
|
|
21
25
|
|
|
22
26
|
const condition = pluginConfig.when !== undefined ? pluginConfig.if(context) : defaultCondition;
|
|
23
27
|
|
|
24
28
|
if (condition && pluginConfig.run) {
|
|
25
29
|
const tasks = [].concat(pluginConfig.run);
|
|
30
|
+
|
|
26
31
|
for (const task of tasks) {
|
|
27
|
-
|
|
32
|
+
if (typeof task === "string") {
|
|
33
|
+
const mod = await import(task);
|
|
34
|
+
const taskFunction = mod[step];
|
|
35
|
+
|
|
36
|
+
if (taskFunction) {
|
|
37
|
+
await taskFunction(pluginConfig, context);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
}
|
|
29
41
|
}
|
|
30
42
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as releaseNotesPlugins from "@semantic-release/release-notes-generator";
|
|
2
|
-
|
|
3
|
-
import { getConfig } from "../../common/index.js";
|
|
4
|
-
|
|
5
|
-
export async function generateNotes(pluginConfig, context) {
|
|
6
|
-
context.config = getConfig();
|
|
7
|
-
|
|
8
|
-
if (context.branch.type === "release") {
|
|
9
|
-
return releaseNotesPlugins.generateNotes(pluginConfig, context);
|
|
10
|
-
}
|
|
11
|
-
}
|