[DevEx]: Consolidate ./types
and ./utils
#1004
Labels
dev experience
Improvements to the code base that make it easier/better/more enjoyable to contribute to Cuttle
version-patch
An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)
Improvement Summary
The types and utils files have overlap -- they should be reorganized for clairty.
Detailed Description
./types
should be used for constants and type definitions./utils
should be used for utility functionsWith this in mind, we should move the following files out of
./utils
into./types
:DeckIds.json
GamePhase.json
GameStatus.json
All of these are constants used as enums and therefore belong in
./types
.In addition, the existing
./types/SocketEvent
has enormous overlap with./utils/MoveType
and is a superset of the latter. We should definetypes/SocketEvent
to importMoveType
and extend it using the spread operator, so that the two stay in sync automatically. ThenSocketEvent
can explicitly add only the properties that do not already exist inMoveType
The text was updated successfully, but these errors were encountered: