mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-28 18:20:42 +00:00
* refactor(sync): extract framework-agnostic sync types into @sp/sync-core Stand up packages/sync-core/ as the new home for sync types and constants that have no Angular/NgRx coupling. This is the thin first slice of separating sync engine, configuration, and provider concerns into distinct packages. Files moved (sources now live in packages/sync-core/src/): - core/operation.types.ts - core/action-types.enum.ts - core/lww-update-action-types.ts - core/sync-state-corrupted.error.ts - core/types/apply.types.ts - sync-providers/provider.const.ts - util/entity-key.util.ts Original paths in src/app/op-log/ keep working as thin re-export stubs so existing callers don't change. op-log/sync-exports.ts now sources provider.const exports directly from @sp/sync-core. Files with transitive Angular dependencies (encryption, sync-errors, provider.interface, vector-clock util) stay in the app for now — moving them requires introducing a logger port and is part of the next slice. * refactor(sync): keep @sp/sync-core domain-agnostic The first slice landed too much Super Productivity-specific content in @sp/sync-core. The lib should expose generic sync primitives; the host app supplies the SP-specific config. Pulled out of the lib (now app-side only): - ActionType enum (NgRx action strings for SP features) - ENTITY_TYPES / EntityType union (SP domain entities) - SyncImportReason union (SP import flows) - RepairSummary / RepairPayload (SP repair shape) - WrappedFullStatePayload + appDataComplete helpers (SP wire format) - SyncProviderId / SyncStatus / ConflictReason / OAUTH_SYNC_PROVIDERS / REMOTE_FILE_CONTENT_PREFIX / PRIVATE_CFG_PREFIX (SP providers/keys) - The @sp/shared-schema dep (also SP-coupled) Generic-ized in the lib: - Operation.actionType: string and Operation.entityType: string (lib carries opaque strings; host narrows in app code) - Operation.syncImportReason removed; app extends Operation with it - VectorClock now defined locally as Record<string, number> - LWW helpers replaced by createLwwUpdateActionTypeHelpers(entityTypes) factory; the app instantiates it with SP's ENTITY_TYPES - entity-key.util uses string for entityType App stubs now redeclare the SP-narrowed Operation, EntityChange, EntityConflict, ConflictResult, MultiEntityPayload, ApplyOperationsResult on top of the lib generic types via Omit-and-extend, and re-host all the SP-specific helpers (WrappedFullStatePayload, extractFullStateFromPayload, assertValidFullStatePayload, RepairSummary, RepairPayload). Also added @sp/sync-core to src/tsconfig.spec.json paths so the spec build uses the source, not the dist (matching shared-schema). * docs(sync): add @sp/sync-core extraction plan Roadmap for carving the sync engine out of src/app/op-log/ into a reusable, framework-agnostic AND domain-agnostic @sp/sync-core package plus a sibling @sp/sync-providers. Documents: - The three-concern split (engine / config / providers) target - The domain rule: nothing SP-specific lands in the lib (ActionType, ENTITY_TYPES, SyncImportReason, RepairPayload, SyncProviderId, the appDataComplete wire format, @sp/shared-schema all stay app-side) - PR 1 (landed): generic primitives only; app stubs preserve every pre-existing call site via Omit-and-extend - PR 2: SyncLogger port + parameterize entity-registry - PR 3a: pure algorithmic core (vector-clock client wrapper, conflict detection, op validation, encryption, sync-errors) — needs only the SyncLogger port - PR 3b: orchestrators behind ports (OperationStorePort, ActionDispatchPort, ConflictUiPort, SyncConfigPort) — the high-risk step where the app/lib boundary becomes load-bearing - PR 4: lift providers into @sp/sync-providers - PR 5: ESLint boundary rule * refactor(sync): address sync-core extraction review * docs(sync): refine extraction plan follow-ups --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| long-term-plans | ||
| plans | ||
| promotion | ||
| research | ||
| screens | ||
| sync-and-op-log | ||
| wiki | ||
| add-new-integration.md | ||
| build-and-publish-notes.md | ||
| documentation-guide.md | ||
| ENV_SETUP.md | ||
| github-access-token-instructions.md | ||
| gitlab-access-token-instructions.md | ||
| how-to-rate.md | ||
| howto-refresh-snap-credentials.md | ||
| i18n-script-usage.md | ||
| legacy-webview-analysis.md | ||
| mac-app-store-code-signing-guide.md | ||
| performance-project-tag-report.md | ||
| plugin-development.md | ||
| styling-guide.md | ||
| theming-contract.md | ||
| TRANSLATING.md | ||
| unused-translations-analysis.md | ||
| update-android-app.md | ||
| update-mac-certificates.md | ||