2.1 KiB
2.1 KiB
Scratchpad — updater package target fix (#382)
- Objective: Fix
mosaic updateso modern installs query@mosaic/mosaicinstead of stale@mosaic/cli. - Scope: updater logic, user-facing update/install hints, tests, package version bump(s).
- Constraints: preserve backward compatibility for older
@mosaic/cliinstalls if practical. - Acceptance:
- fresh installs using
@mosaic/mosaicreport latest correctly - older installs do not regress unnecessarily
- tests cover package lookup behavior
- release version bumped for changed package(s)
- fresh installs using
Decisions
- Prefer
@mosaic/mosaicwhen both modern and legacy packages are installed globally. - For legacy
@mosaic/cliinstalls, query@mosaic/clifirst, then fall back to@mosaic/mosaicif the legacy package is not published. - Share install-target selection from
packages/mosaicso both the consolidated CLI and the legacypackages/clientrypoint 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 installpnpm --filter @mosaic/mosaic test -- __tests__/update-checker.test.tspnpm 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.tspnpm --filter @mosaic/mosaic lint- pre-push hooks:
typecheck,lint,format:check
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.
Risks / Notes
- Direct
pnpm --filter @mosaic/mosaic typecheckandpnpm --filter @mosaic/cli ...checks were not representative in this worktree becausepackages/cliis excluded frompnpm-workspace.yamland the standalone package check lacked the built workspace dependency graph. - The repo's pre-push hooks provided the authoritative validation path here and passed: root
typecheck,lint, andformat:check.