mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-20 18:08:55 +00:00
Create @sp/shared-schema package with pure TypeScript migration functions that work in both Angular frontend and Node.js backend environments. Package contents: - schema-version.ts: Version constants (CURRENT=1, MAX_SKIP=3) - migration.types.ts: OperationLike, SchemaMigration interfaces - migrate.ts: Pure functions (migrateState, migrateOperation, etc.) - migrations/index.ts: Empty migrations array (ready for first migration) - 22 unit tests covering all migration scenarios Backend changes: - Add snapshot_schema_version column to user_sync_state table - Migrate snapshots during generateSnapshot if outdated - Migrate operations during replayOpsToState if outdated - Drop operations that return null from migration (removed features) Frontend changes: - Refactor SchemaMigrationService to use @sp/shared-schema - Re-export constants for backwards compatibility - All 20 existing tests pass This enables coordinated schema migrations across client and server, ensuring old snapshots and operations can be upgraded when the state structure changes. Rollout strategy: Deploy backend first, then frontend.
2 lines
20 B
Text
2 lines
20 B
Text
dist/
|
|
node_modules/
|