Files
stack/docs/scratchpads/update-checker-package-20260404.md
Jarvis 38c1c68924
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
fix: retarget updater to @mosaic/mosaic
2026-04-04 20:34:58 -05:00

2.0 KiB

Scratchpad — updater package target fix (#382)

  • Objective: Fix mosaic update so modern installs query @mosaic/mosaic instead of stale @mosaic/cli.
  • Scope: updater logic, user-facing update/install hints, tests, package version bump(s).
  • Constraints: preserve backward compatibility for older @mosaic/cli installs if practical.
  • Acceptance:
    • fresh installs using @mosaic/mosaic report latest correctly
    • older installs do not regress unnecessarily
    • tests cover package lookup behavior
    • release version bumped for changed package(s)

Decisions

  • Prefer @mosaic/mosaic when both modern and legacy packages are installed globally.
  • For legacy @mosaic/cli installs, query @mosaic/cli first, then fall back to @mosaic/mosaic if the legacy package is not published.
  • Share install-target selection from packages/mosaic so both the consolidated CLI and the legacy packages/cli entrypoint print/install the same package target.
  • Extend the update cache to persist the resolved target package as well as the version so cached checks preserve the migration target.

Validation

  • pnpm install
  • pnpm --filter @mosaic/mosaic test -- __tests__/update-checker.test.ts
  • pnpm exec eslint --no-warn-ignored packages/mosaic/src/runtime/update-checker.ts packages/mosaic/src/cli.ts packages/mosaic/src/index.ts packages/mosaic/__tests__/update-checker.test.ts packages/cli/src/cli.ts
  • pnpm --filter @mosaic/mosaic lint

Review

  • Manual review of the updater diff caught and fixed a cache regression where fallback results would lose the resolved package target on subsequent cached checks.

Blockers / Risks

  • pnpm --filter @mosaic/mosaic typecheck fails in this worktree on pre-existing unresolved workspace imports such as @mosaic/quality-rails, @mosaic/prdy, and @mosaic/types; this is broader than the updater change.
  • packages/cli is excluded from pnpm-workspace.yaml, so package-script lint/typecheck are not runnable via normal workspace filters in this worktree.