refactor: delegate ol update to @doist/cli-core/commands#68
Merged
Conversation
doistbot
reviewed
May 11, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
This PR significantly slims down the repository by successfully delegating the ol update command logic, configuration, and formatting to @doist/cli-core. Offloading these responsibilities is a great step that improves maintainability by centralizing the update behavior and error handling. A few minor adjustments are needed to ensure the skill documentation fully reflects the new --ndjson support, and to tighten the test suite by adding integration assertions for the CLI surface and strictly verifying the forwarded configuration values.
scottlovegrove
added a commit
that referenced
this pull request
May 11, 2026
- Add `ol update --check --ndjson` example to skill content (and regen skills/outline-cli/SKILL.md) so the documented surface matches the flags cli-core actually exposes. - Tighten update wrapper test: assert exact `currentVersion` from package.json and exact `withSpinner` reference (instead of `typeof` smoke checks). - Add `update-surface.test.ts` integration test that registers the command against a real `@doist/cli-core/commands` (no mock) and asserts `update` exposes `--check` / `--channel` and `update switch` exposes `--stable` / `--pre-release`, so a cli-core bump can't silently change the local CLI surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors 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.
- `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.
## 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.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add `ol update --check --ndjson` example to skill content (and regen skills/outline-cli/SKILL.md) so the documented surface matches the flags cli-core actually exposes. - Tighten update wrapper test: assert exact `currentVersion` from package.json and exact `withSpinner` reference (instead of `typeof` smoke checks). - Add `update-surface.test.ts` integration test that registers the command against a real `@doist/cli-core/commands` (no mock) and asserts `update` exposes `--check` / `--channel` and `update switch` exposes `--stable` / `--pre-release`, so a cli-core bump can't silently change the local CLI surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e1e4f64 to
7ebe1c8
Compare
Contributor
|
🎉 This PR is included in version 1.5.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors twist-cli #214. cli-core 0.9.0 owns the registry fetch, package-manager detection, install spawn, channel switch, and
--json/--ndjsonenvelopes. outline provides the package name, version, config path, changelog hint, and spinner runner.PR 3 of a 3-PR stack — stacked on #67:
@doist/cli-core#66 — cli-core wiring (errors, config, spinner, output, markdown)@doist/cli-core#67 — global-args + ViewOptions + empty-output test helperol updateto cli-core/commandsChanges
src/commands/update/index.tsnow forwards to cli-core'sregisterUpdateCommandwith{ packageName, currentVersion, configPath, changelogCommandName: 'ol changelog', withSpinner }.src/commands/update/action.ts(203 lines) andsrc/commands/update/switch.ts(37 lines) — cli-core owns both.src/lib/update-config.ts(12 lines) — cli-core reads/writesupdate_channeldirectly via the config path we hand it.src/__tests__/update.test.tsslims to a wrapper test (option forwarding). ~400 lines of behaviour tests removed — covered upstream by cli-core's update suite.src/lib/skills/content.tsdocuments the new--jsonflag onol update --check;skills/outline-cli/SKILL.mdregenerated.Net: 37 insertions / 710 deletions across 7 files.
Behaviour changes (mirroring twist-cli #214)
update_channelon disk surfaces asINVALID_UPDATE_CHANNELfromol update(was silently coerced to stable).INVALID_FLAGS,UPDATE_CHECK_FAILED,UPDATE_INSTALL_FAILED).--json/--ndjsonenvelopes.Test plan
npm run type-checknpm run lint:check— 0 warnings, 0 errorsnpm test— 103 tests passnpm run build && npm run sync:skill && npm run check:skill-sync— SKILL.md in syncol update --channel— reportsstableol update --check— reports current vs latest with channel lineol update --check --json— single-record JSON envelopeol update switch --pre-releasethenol update switch --stable— flips on-diskupdate_channel🤖 Generated with Claude Code