mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
b32c0e4560
- Added a new service for synchronizing state with replicants in `replicant-state-service.ts`. - Refactored commentary store to utilize the new synchronization service. - Created a new graphics settings store that syncs with replicants. - Introduced a packs store for managing installed packs and their states. - Updated players and scoreboard stores to use the new synchronization service. - Created shared services for managing replicated state in graphics components. - Refactored existing components to use the new shared services for replicant state. - Added normalization and default values for commentary, graphics settings, players, and scoreboard. - Improved type safety and organization in shared domain files for better maintainability.
3.8 KiB
3.8 KiB
Phase 2 Summary
Scope
Executed the state and replicants phase only.
This phase focused on isolating state logic, normalizing Pinia stores, encapsulating browser-side replicant access, and moving side effects behind services without changing UX, visual design, overlay CSS, or public NodeCG contracts.
Completed
- Added pure state/domain modules:
src/shared/domain/scoreboardsrc/shared/domain/commentarysrc/shared/domain/graphicssrc/shared/domain/players/state.tssrc/shared/domain/packs/characters.ts
- Moved normalization and pure state transitions out of dashboard stores.
- Replaced direct dashboard replicant imports with
src/dashboard/services/replicant-state-service.ts. - Added
useGraphicsSettingsStoreand moved dashboard graphics skin writes through the store. - Reworked scoreboard, players and commentary stores to use shared domain normalizers and service-based replicant sync.
- Replaced the pack registry singleton composable with a normalized
usePacksStore. - Moved pack replicant listeners and NodeCG pack messages into
src/dashboard/services/pack-service.ts. - Removed Vue reactivity and mutable pack registration from
src/shared/fighting-characters.ts. - Modeled installed pack manifests as explicit store state instead of hidden module state.
- Centralized registry auto-refresh timer in the packs store.
- Routed integration NodeCG messages through
src/dashboard/services/integration-message-service.ts. - Added
src/graphics/shared/services/replicated-state.tsso graphics read replicants through a service layer. - Removed the redundant
src/dashboard/stores/store-sync.ts.
Preserved
- Public replicant names were unchanged.
- Public message names were unchanged.
- Existing dashboard UX was preserved.
- Overlay markup, CSS, positioning and animation logic were not intentionally changed.
- The existing
usePackRegistryimport path remains as a compatibility wrapper over the packs store. - The legacy
src/shared/fighting-characters.tspath remains as a compatibility export, but no longer owns mutable runtime state.
Realtime Flow After This Phase
schemas
-> nodecg/browser
-> dashboard services / graphics services
-> Pinia stores or overlay computed state
-> components
Pack runtime flow:
pack replicants
-> pack service
-> packs store
-> pack registry compatibility composable
-> game / character UI
Verification
pnpm.cmd exec vue-tsc -p tsconfig.browser.json --noEmit: passed.pnpm.cmd exec tsc -b tsconfig.extension.json --pretty false: passed.pnpm.cmd exec eslint: passed with 0 errors and existing Vue formatting warnings.pnpm.cmd run build: passed.- Searched dashboard, graphics and shared for direct NodeCG/message/replicant imports:
- remaining browser NodeCG access is contained in services and
nodecg/browser. - direct component/view replicant imports were removed.
- remaining browser NodeCG access is contained in services and
- Searched for
anyin touched runtime areas:- no new TypeScript
anyusage was added.
- no new TypeScript
Notes and Limits
- This phase did not split large views like
Players.vueorSettings.vue. - This phase did not refactor overlay internals beyond replacing direct replicant imports with a read service.
- This phase did not rewrite extension-side
pack-manager.ts. - This phase did not rename public messages to the future canonical names; compatibility was preserved.
- Existing Vue lint warnings remain formatting-only and were not addressed because they are outside this phase.
Remaining For Later Phases
- Controlled rewrite of
pack-manager.ts. - Full split of
useIntegrationinto provider clients, OAuth client, temporary players and import modules. - Divide
Players.vueandSettings.vue. - Extract overlay view models and visual helpers after visual baseline.
- Add tests for pure normalizers and pack state derivations.