ワンクリックで
frontend-miniprogram-release
// Use when releasing a WeChat mini-program from a monorepo, especially when creating release PRs, bumping versions, updating CHANGELOGs, or creating version tags
// Use when releasing a WeChat mini-program from a monorepo, especially when creating release PRs, bumping versions, updating CHANGELOGs, or creating version tags
| name | frontend-miniprogram-release |
| description | Use when releasing a WeChat mini-program from a monorepo, especially when creating release PRs, bumping versions, updating CHANGELOGs, or creating version tags |
Releasing a mini-program frontend in a monorepo requires careful scope isolation and PR-based workflows. One wrong direct-push to main can require force-push gymnastics.
package.json for a mini-programAlways confirm which directory the user wants to release.
# WRONG: Includes all changes from the branch
git diff main..HEAD --stat
# RIGHT: Only check changes in the target directory
git diff main..HEAD -- wechat/
Version bumps and release commits must go through PR, just like feature code.
# WRONG
git commit -m "release: v1.x.x"
git push origin main
# RIGHT
git checkout -b release/wechat-v1.x.x
git commit -m "release(wechat): v1.x.x"
git push -u origin release/wechat-v1.x.x
# Then create PR and merge via GitHub
git revert + PR instead of force-push to bypass branch protectionFollow Keep a Changelog (Chinese version supported):
# Changelog
本文件遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 规范。
## [1.14.0] - YYYY-MM-DD
### Added
- New feature description (#101)
### Fixed
- Bug fix related to the new feature (#102)
## [1.13.1] - YYYY-MM-DD
### Fixed
- Bug fix description (#99)
### Changed
- Refactor or directory migration (#98)
## [1.13.0] - YYYY-MM-DD
[SemVer] version numbers with brackets### Added / Changed / Fixed / Removed categories(#101)Before bumping, determine the new version by analyzing the actual diff, not just commit messages:
# Step 1: List commits since last tag (reference only)
git log <last-tag>..HEAD --oneline -- <target-dir>/
# Step 2: Inspect each commit's actual changes (THIS is what matters)
git show --stat <commit> -- <target-dir>/
# Step 3: Review the aggregate diff
git diff <last-tag>..HEAD -- <target-dir>/
Commit messages are a hint, diff is the truth. A fix: commit might only touch a comment (no version bump needed), while a chore: commit might add a new page (MINOR bump).
Apply SemVer based on behavioral impact:
| What Changed | Version Bump | Example |
|---|---|---|
| New user-facing feature / new page / new API | MINOR | 1.13.0 → 1.14.0 |
| Bug fix with behavior change | PATCH | 1.13.0 → 1.13.1 |
| Pure refactor / comment update / no behavior change | No bump or bundle with other changes | Skip if nothing user-visible changed |
| Breaking change (removed API, changed response format) | MAJOR | 1.13.0 → 2.0.0 |
Decision flow:
Before creating the release PR:
package.json version updatedCHANGELOG.md updated with new section, categorized by change typepnpm-lock.yaml / package-lock.json) updated if dependencies changedrelease(wechat): v1.x.x| Mistake | Why It Happens | Fix |
|---|---|---|
| Direct-pushing release to main | "It's just a version bump" | Treat version bumps like any other code change |
| Including unrelated directory changes | Assuming branch only has relevant changes | Explicitly filter by target directory |
| Force-pushing after accidental push | Trying to "clean up" history | Use git revert + PR instead |
| Wrong CHANGELOG format | Copying old inconsistent format | Use Keep a Changelog standard |
| Auto-merging PR without user consent | Assuming release PRs are safe to auto-merge | Always wait for explicit user confirmation before merging |
| Bumping version based only on commit messages | fix: might be a comment edit; chore: might add a new page | Always inspect git show --stat and git diff to determine actual behavioral impact |
Leaving TODO items as in_progress while waiting | System continuously prompts for continuation | Mark blocking/waiting tasks as completed with a note, or the system will nag |
User: "Release wechat"
|
v
Check git diff main..HEAD -- wechat/
|
v
Analyze commits → determine SemVer bump (patch/minor/major)
|
v
Create release branch from main
|
v
Bump version + update CHANGELOG
|
v
Commit and push release branch
|
v
Create PR
|
v
Merge PR (by user or with explicit permission)
|
v
Pull latest main and create tag: wechat-miniprogram-yansongda/v1.x.x
|
v
Push tag to origin
|
v
Inform user to upload via WeChat DevTools
After the release PR is merged, create a version tag:
# Pull latest main first
git checkout main && git pull origin main
# Create tag
git tag wechat-miniprogram-yansongda/v1.x.x
# Push tag
git push origin wechat-miniprogram-yansongda/v1.x.x
wechat-miniprogram-yansongda/v{semver}git pull is not a fast-forward, resolve conflicts first (rare for release branches)After PR is merged and tag is pushed, the user must manually:
Do not attempt automated upload — platform authentication requires manual login.