Commit 7acbaa1
## Summary
Mirrors [twist-cli #214](Doist/twist-cli#214).
cli-core 0.9.0 owns the registry fetch, package-manager detection,
install spawn, channel switch, and `--json`/`--ndjson` envelopes.
outline provides the package name, version, config path, changelog hint,
and spinner runner.
PR 3 of a 3-PR stack — **stacked on #67**:
1. ✅ #66 — cli-core wiring (errors, config, spinner, output, markdown)
2. ✅ #67 — global-args + ViewOptions + empty-output test helper
3. **This PR** — delegate `ol update` to cli-core/commands
## Changes
- `src/commands/update/index.ts` now forwards to cli-core's
`registerUpdateCommand` with `{ packageName, currentVersion, configPath,
changelogCommandName: 'ol changelog', withSpinner }`.
- Delete `src/commands/update/action.ts` (203 lines) and
`src/commands/update/switch.ts` (37 lines) — cli-core owns both.
- Delete `src/lib/update-config.ts` (12 lines) — cli-core reads/writes
`update_channel` directly via the config path we hand it.
- `src/__tests__/update.test.ts` slims to a wrapper test (option
forwarding). ~400 lines of behaviour tests removed — covered upstream by
cli-core's update suite.
- `src/lib/skills/content.ts` documents the new `--json` flag on `ol
update --check`; `skills/outline-cli/SKILL.md` regenerated.
Net: **37 insertions / 710 deletions across 7 files.**
## Behaviour changes (mirroring twist-cli #214)
- Invalid `update_channel` on disk surfaces as `INVALID_UPDATE_CHANNEL`
from `ol update` (was silently coerced to stable).
- Errors emit canonical cli-core codes (`INVALID_FLAGS`,
`UPDATE_CHECK_FAILED`, `UPDATE_INSTALL_FAILED`).
- Both subcommands accept `--json` / `--ndjson` envelopes.
## Test plan
- [x] `npm run type-check`
- [x] `npm run lint:check` — 0 warnings, 0 errors
- [x] `npm test` — 103 tests pass
- [x] `npm run build && npm run sync:skill && npm run check:skill-sync`
— SKILL.md in sync
- [ ] Smoke `ol update --channel` — reports `stable`
- [ ] Smoke `ol update --check` — reports current vs latest with channel
line
- [ ] Smoke `ol update --check --json` — single-record JSON envelope
- [ ] Manual `ol update switch --pre-release` then `ol update switch
--stable` — flips on-disk `update_channel`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d1cf0b1 commit 7acbaa1
8 files changed
Lines changed: 82 additions & 710 deletions
File tree
- skills/outline-cli
- src
- __tests__
- commands/update
- lib
- skills
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments