Skip to content

Migrate appdata to ~/.studio/appdata.json with versioned migrations#2836

Draft
bcotrim wants to merge 2 commits intostu-1350-decoupled-config-devfrom
stu-1350-decoupled-config-dev-v3
Draft

Migrate appdata to ~/.studio/appdata.json with versioned migrations#2836
bcotrim wants to merge 2 commits intostu-1350-decoupled-config-devfrom
stu-1350-decoupled-config-dev-v3

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Mar 17, 2026

Related issues

Related to STU-1350

How AI was used in this PR

All code was generated via Claude Code (Opus + Haiku). Changes were reviewed and validated through iterative conversation with the user.

Proposed Changes

  • CLI _migrate command — Hidden command that copies appdata-v1.json from platform-specific Electron path to ~/.studio/appdata.json
  • Desktop bootstrap — Triggers CLI migration on boot before other data operations
  • Updated primary paths — Desktop and CLI both read from ~/.studio/appdata.json with CLI fallback to old platform-specific location
  • Generic migration framework — New ConfigMigrator in tools/common/lib/ that applies versioned migrations based on file version field
  • Wired into config readers — Appdata, CLI config, and shared config all use the migration runner for future extensibility

Testing Instructions

  1. npm run typecheck — Verify no type errors
  2. npm test — All 1314 tests pass (7 new tests for config migrator)
  3. Manual: Launch Desktop with existing appdata-v1.json → Verify ~/.studio/appdata.json is created and Desktop reads from it
  4. Manual: Add/modify a site → Verify ~/.studio/appdata.json is updated
  5. Manual: CLI studio site list → Verify reads from ~/.studio/appdata.json
  6. Manual: Restart Desktop → Verify migration is idempotent (no errors)

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim self-assigned this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant