Skip to content

Commit 43e6f95

Browse files
authored
feat(FR-1877): add automated alpha version bump command (#4955)
1 parent b2bf41f commit 43e6f95

7 files changed

Lines changed: 185 additions & 6 deletions
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
description: Bump version to next alpha and update dependencies after release.
3+
argument-hint: [26.1.0-alpha.0]
4+
model: claude-sonnet-4-5
5+
---
6+
7+
# Bump to Alpha Version and Update Dependencies
8+
9+
After a release, this command updates the project to the next alpha version and updates all dependencies within semver-compatible ranges.
10+
11+
## Arguments
12+
13+
`$ARGUMENTS` specifies the new alpha version (e.g., `26.1.0-alpha.0`).
14+
15+
### If Arguments Not Provided
16+
17+
If no version is specified, automatically determine the next version options:
18+
19+
1. **Read current version** from root `package.json`
20+
2. **Parse the version**: Extract `MAJOR.MINOR.PATCH` (ignore any existing prerelease suffix)
21+
3. **Generate three options** for the user to choose from:
22+
- **Patch bump**: `MAJOR.MINOR.(PATCH+1)-alpha.0` (e.g., `26.1.1-alpha.0`)
23+
- **Minor bump**: `MAJOR.(MINOR+1).0-alpha.0` (e.g., `26.2.0-alpha.0`)
24+
- **Major bump**: `(MAJOR+1).1.0-alpha.0` (e.g., `27.1.0-alpha.0`)
25+
26+
4. **Use `AskUserQuestion`** to let the user select:
27+
28+
```
29+
AskUserQuestion({
30+
questions: [{
31+
question: "Which version bump do you want for the next alpha release?",
32+
header: "Version",
33+
multiSelect: false,
34+
options: [
35+
{
36+
label: "26.1.1-alpha.0 (Patch)",
37+
description: "Patch version bump - for small fixes and updates"
38+
},
39+
{
40+
label: "26.2.0-alpha.0 (Minor)",
41+
description: "Minor version bump - for new features (Recommended)"
42+
},
43+
{
44+
label: "27.1.0-alpha.0 (Major)",
45+
description: "Major version bump - for breaking changes"
46+
}
47+
]
48+
}]
49+
})
50+
```
51+
52+
**Note**: If the current version already has `-alpha.N` suffix, strip it before calculating the next versions.
53+
54+
## Process
55+
56+
### 1. Validate Version Format
57+
58+
- Ensure the version follows semver format with alpha suffix: `X.Y.Z-alpha.N`
59+
- Example valid formats: `26.1.0-alpha.0`, `26.2.0-alpha.1`
60+
61+
### 2. Update Root package.json Version
62+
63+
- Update the `version` field in the root `/package.json` to the new alpha version
64+
65+
### 3. Run `make versiontag`
66+
67+
- This command propagates the version to all related files:
68+
- `version.json`
69+
- `index.html`
70+
- `manifest.json`
71+
- `react/package.json`
72+
- `packages/backend.ai-ui/package.json`
73+
- `electron-app/package.json`
74+
75+
### 4. Update Dependencies
76+
77+
Update dependencies in the following package.json files within semver-compatible ranges:
78+
79+
- `/packages/backend.ai-ui/package.json`
80+
- `/react/package.json`
81+
82+
**Important Rules:**
83+
84+
- **Read `pnpm-workspace.yaml`** first to check the following settings:
85+
- `minimumReleaseAge`: Minimum age in minutes for package versions (e.g., 10080 = 7 days)
86+
- `minimumReleaseAgeExclude`: List of packages exempt from the minimum age rule
87+
- Respect these settings when updating dependencies
88+
- Use `pnpm update` with appropriate flags for semver-compatible updates
89+
90+
### 5. Install Updated Dependencies
91+
92+
Run `pnpm install` to update the lockfile with new dependency versions.
93+
94+
### 6. Verify Changes and Fix TypeScript Errors
95+
96+
After updating dependencies, verify everything works correctly:
97+
98+
1. **Run `pnpm install`** to ensure no errors in dependency resolution
99+
2. **Check all package.json files** have the correct version
100+
3. **Note any peer dependency warnings**
101+
4. **Run TypeScript type checking** to detect any type errors caused by updated packages:
102+
103+
```bash
104+
# Check TypeScript errors in react package
105+
pnpm --prefix ./react run typecheck
106+
107+
# Check TypeScript errors in backend.ai-ui package
108+
pnpm --prefix ./packages/backend.ai-ui run typecheck
109+
110+
# Or run tsc directly if typecheck script is not available
111+
pnpm --prefix ./react exec tsc --noEmit
112+
pnpm --prefix ./packages/backend.ai-ui exec tsc --noEmit
113+
```
114+
115+
5. **If TypeScript errors occur**, fix them before proceeding:
116+
- Review the error messages to identify which updated packages caused the issue
117+
- Common fixes include:
118+
- Updating type definitions (`@types/*` packages)
119+
- Adjusting code to match new API signatures
120+
- Adding type assertions where needed
121+
- Fix all errors before completing the version bump
122+
123+
6. **Run build to ensure everything compiles**:
124+
125+
```bash
126+
pnpm run build
127+
```
128+
129+
## Commands Reference
130+
131+
```bash
132+
# Update root package.json version (use Edit tool)
133+
134+
# Propagate version to all files
135+
make versiontag
136+
137+
# Update dependencies in workspace packages
138+
pnpm update --recursive --latest --workspace
139+
140+
# Or update specific packages
141+
cd react && pnpm update
142+
cd packages/backend.ai-ui && pnpm update
143+
144+
# If engine constraints block:
145+
pnpm update --ignore-engines
146+
147+
# Install to update lockfile
148+
pnpm install
149+
```
150+
151+
## Output Summary
152+
153+
After completion, provide a summary including:
154+
155+
1. **Version Update**: Old version -> New version
156+
2. **Files Updated**: List of files modified by `make versiontag`
157+
3. **Dependencies Updated**: Summary of updated packages with version changes
158+
4. **Peer Dependency Warnings**: Any warnings encountered
159+
5. **Next Steps**: Suggest committing changes if everything looks good
160+
161+
## Example Workflow
162+
163+
```
164+
User: /bump-alpha-version 26.1.0-alpha.0
165+
166+
Claude:
167+
1. Updates package.json version to 26.1.0-alpha.0
168+
2. Runs make versiontag
169+
3. Updates dependencies in react/ and packages/backend.ai-ui/
170+
4. Runs pnpm install
171+
5. Provides summary of all changes
172+
```
173+
174+
## Notes
175+
176+
- Always verify the current version before updating
177+
- Check git status before running to ensure a clean working directory
178+
- This command does NOT create a commit - let the user decide when to commit
179+
- If there are uncommitted changes, warn the user first

.claude/commands/create-jira-issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Create a Jira issue for Git changes
33
argument-hint: [stage, pr, branch, commit]
4-
model: claude-sonnet-4-20250514
4+
model: claude-sonnet-4-5
55
---
66

77
# Create a Jira issue for Git Changes

.claude/commands/create-pr-stack-for-stage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Create a PR Stack and link to Jira issue.
33
argument-hint: [FR-1234, https://lablup.atlassian.net/browse/FR-1234]
4-
model: claude-sonnet-4-20250514
4+
model: claude-sonnet-4-5
55
---
66

77
# Create a PR Stack for Staged Changes

.claude/commands/enhance-component-docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
model: claude-sonnet-4-20250514
2+
model: claude-sonnet-4-5
33
---
44

55
# Enhance Component Documentation

.claude/commands/fill-out-i18n.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
model: claude-sonnet-4-20250514
2+
model: claude-sonnet-4-5
33
---
44

55
# Fill Out i18n Translations

.claude/commands/improve-release-note.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
model: claude-sonnet-4-20250514
2+
model: claude-sonnet-4-5
33
---
44

55
# Improve Release Note

.claude/commands/update-storybook-autodoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
model: claude-sonnet-4-20250514
2+
model: claude-sonnet-4-5
33
---
44

55
# Update Storybook with Autodoc

0 commit comments

Comments
 (0)