Page/area: Capgo marketing website. Role: Website copy sentence. Seen in: component doc/SignupCta.astro, component Hero.astro. Message key `hero_subtitle_v2` (Hero Subtitle V2).
复制一个设置提示,包含安装步骤和此插件的完整Markdown指南。
准备粘贴
包含安装、同步和源Markdown指南。
示例场景假设您有:
- 应用程序版本 1.2.3(旧版本)- 使用生产频道
- 应用程序版本 2.0.0(新版本,包含重大更改)- 使用 v2 频道
- Live update 1.2.4(兼容 1.2.3)
- Live update 2.0.1(兼容 2.0.0)
策略:始终使用 defaultChannel 为主要版本
标题:策略:始终使用 defaultChannel 为主要版本推荐方法: 设置 defaultChannel 复制到剪贴板
// Version 1.x releasesdefaultChannel: 'v1'
// Version 2.x releasesdefaultChannel: 'v2'
// Version 3.x releases (future)defaultChannel: 'v3'1. 为新版本创建频道
标题:1. 为新版本创建频道# Create channel for version 2.xnpx @capgo/cli channel add v22. 更新 Capacitor 配置为版本 2.0.0
2. 更新 Capacitor 配置为版本 2.0.0在发布 2.0.0 版本到应用商店之前,请更新您的 Capacitor 配置:
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { appId: 'com.example.app', appName: 'Example App', plugins: { CapacitorUpdater: { // ... other options defaultChannel: 'v2' // All 2.0.0 users will use v2 channel } }};
export default config;3.独立管理Code分支
标题:3.独立管理Code分支为应用程序版本之间保持兼容性而创建独立的Git分支:
# Create and maintain a branch for version 1.x updatesgit checkout -b v1-maintenancegit push origin v1-maintenance
# Your main branch continues with version 2.x developmentgit checkout mainCritical: Never push JavaScript bundles to older apps that expect native code/APIs they don’t have。Always build updates from the appropriate branch.
- 永远不要将JavaScript包推送到期望的本机__CAPGO_KEEP_0__/APIs但没有的旧应用程序。始终从适当的分支构建更新:v1-maintenance branch
- :对于1.x应用程序的更新(生产频道): 对于 2.x 应用程序(v2 频道)的更新
4. 将包裹上传到各个频道
Section titled “4. 将包裹上传到各个频道”# For 1.x updates: Build from v1-maintenance branchgit checkout v1-maintenance# Make your 1.x compatible changes herenpx @capgo/cli bundle upload --channel production
# For 2.x updates: Build from main branchgit checkout main# Make your 2.x changes herenpx @capgo/cli bundle upload --channel v2context: Capgo营销网站. 角色: UI标签. 见于: 页面代理/[slug].astro. 消息键 `agents_page_copy_label` (代理页面复制标签).
5. 启用自我分配# Allow apps to self-assign to v2 channelnpx @capgo/cli channel set v2 --self-assignSection titled “5. 启用自我分配”
6. 部署到应用商店Section titled “6. 部署到应用商店”
适应未来的版本
适应未来的版本当您发布3.0.0版本时,包含更多的破坏性更改时:
# Create channel for version 3.xnpx @capgo/cli channel add v3// capacitor.config.ts for version 3.0.0const config: CapacitorConfig = { // ... plugins: { CapacitorUpdater: { defaultChannel: 'v3' // Version 3.x users } }};现在您可以推送任何版本的更新:
productionchannel → 1.x 版本用户v2channel → 2.x 版本用户v3channel → 3.x 版本用户
7. 清理(迁移后)
标题:7. 清理(迁移后)所有用户迁移到 2.x 版本后(约 3-4 个月):
- 移除
defaultChannel从您的 Capacitor 配置中 - 删除 v2 频道:
npx @capgo/cli channel delete v2- 删除 v1-maintenance Branch:
git branch -d v1-maintenancegit push origin --delete v1-maintenance在每个渠道中都要彻底测试更新之前部署
维护版本1.x更新
标题:维护版本1.x更新要发送与版本1.x兼容的更新:
- 切换到 v1-maintenance branch:
git checkout v1-maintenance- 在此处进行更改并提交:
# Make 1.x compatible changesgit add .git commit -m "Fix for v1.x"git push origin v1-maintenance- 构建并上传到生产频道:
npx @capgo/cli bundle upload --channel production继续从 Breaking Changes
标题:继续从 Breaking Changes如果您正在使用 重大变更 来规划频道路由和分阶段发布,连接它到 频道 频道 频道 频道 频道 频道 为频道的实现细节, 为 Beta Testing Solution 的产品工作流程, 和 版本目标解决方案 为 Version Targeting Solution 的产品工作流程