opencode-github-release 0.3.1 → 0.4.0

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 (2) hide show
  1. package/dist/index.js +20 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -41,7 +41,10 @@ var plugin = async ({ $ }) => {
41
41
  const latestTag = tagResult.trim();
42
42
  const logText = await $`git log ${latestTag}..HEAD --oneline 2>/dev/null || true`.text();
43
43
  if (!logText) {
44
- return `No new commits since ${latestTag}. No release needed.`;
44
+ return {
45
+ title: "No new commits",
46
+ output: `No new commits since ${latestTag}. No release needed.`
47
+ };
45
48
  }
46
49
  const lines = logText.split("\n");
47
50
  const entries = lines.map((line) => {
@@ -64,14 +67,17 @@ var plugin = async ({ $ }) => {
64
67
  const tag = e.breaking ? "[BREAKING]" : e.type === "feat" ? "[feat]" : e.type === "fix" ? "[fix]" : " ";
65
68
  return ` ${tag} ${e.hash} ${e.subject}`;
66
69
  }).join("\n");
67
- return [
68
- `Latest tag: ${latestTag}`,
69
- `Commits: ${entries.length}`,
70
- "",
71
- output,
72
- "",
73
- `Suggested bump: ${suggestedBump} -> ${bumpVersion(latestTag, suggestedBump)}`
74
- ].join("\n");
70
+ return {
71
+ title: "Bump suggestion",
72
+ output: [
73
+ `Latest tag: ${latestTag}`,
74
+ `Commits: ${entries.length}`,
75
+ "",
76
+ output,
77
+ "",
78
+ `Suggested bump: ${suggestedBump} -> ${bumpVersion(latestTag, suggestedBump)}`
79
+ ].join("\n")
80
+ };
75
81
  }
76
82
  }),
77
83
  create_release: tool({
@@ -90,7 +96,10 @@ var plugin = async ({ $ }) => {
90
96
  const status = (await $`git status --porcelain`.text()).trim();
91
97
  if (status && !force) {
92
98
  const count = status.split("\n").length;
93
- return `${count} uncommitted file(s) detected. Call create_release with force: true to proceed anyway, or commit/stash first.`;
99
+ return {
100
+ title: "Uncommitted files",
101
+ output: `${count} uncommitted file(s) detected. Call create_release with force: true to proceed anyway, or commit/stash first.`
102
+ };
94
103
  }
95
104
  await $`git fetch --tags --force 2>/dev/null || true`.quiet();
96
105
  const tagResult = await $`git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"`.text();
@@ -125,7 +134,7 @@ var plugin = async ({ $ }) => {
125
134
  let result = `Created and published ${newTag} (bumped from ${latestTag})`;
126
135
  if (unpushedInfo) result += `
127
136
  ${unpushedInfo}`;
128
- return result;
137
+ return { title: newTag, output: result };
129
138
  }
130
139
  })
131
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-github-release",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "OpenCode plugin to create git tags and publish GitHub releases with semantic versioning.",
5
5
  "repository": {
6
6
  "type": "git",