feat(scripts): switch.sh — apes↔upstream 两线对称切换
- 同一 profile 内二选一(双装不可行: 同 cordis entry id 冲突) - 探测当前线 → 移除对手线依赖+bundle → 写目标线 → pnpm install → 校验 bundle - 幂等可重复跑; --status 只读; --dry-run 不写文件; --profile 指定 profile - aps 线用 file: 本地源码, upstream 线用 registry latest/指定版本 - 修复 pnpm spec 双 @ bug (值不含包名, pnpm 从 key 取包名) - 双向真实切换验证通过 (aps→upstream→aps, 临时 profile 副本, EXIT=0) - package.json 加 switch/switch:status/switch:aps/switch:upstream 入口 - switch.sh 加入 files (发布时带上)
This commit is contained in:
+6
-1
@@ -72,6 +72,7 @@
|
||||
"src",
|
||||
"scripts/install.sh",
|
||||
"scripts/install.ps1",
|
||||
"scripts/switch.sh",
|
||||
"cordis.patch.yml",
|
||||
"README.md",
|
||||
"README_EN.md",
|
||||
@@ -88,7 +89,11 @@
|
||||
"test:mount": "bash scripts/e2e-mount.sh",
|
||||
"test:mount:aggregate": "bash scripts/e2e-aggregate-mount.sh",
|
||||
"clean": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\"",
|
||||
"check:consumer-types": "bash scripts/check-consumer-types.sh"
|
||||
"check:consumer-types": "bash scripts/check-consumer-types.sh",
|
||||
"switch": "bash scripts/switch.sh",
|
||||
"switch:status": "bash scripts/switch.sh --status",
|
||||
"switch:aps": "bash scripts/switch.sh aps",
|
||||
"switch:upstream": "bash scripts/switch.sh upstream"
|
||||
},
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user