Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DevEx]: Consolidate ./types and ./utils #1004

Open
itsalaidbacklife opened this issue Aug 28, 2024 · 0 comments · May be fixed by #1076
Open

[DevEx]: Consolidate ./types and ./utils #1004

itsalaidbacklife opened this issue Aug 28, 2024 · 0 comments · May be fixed by #1076
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)

Comments

@itsalaidbacklife
Copy link
Contributor

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 functions

With this in mind, we should move the following files out of ./utils into ./types:

  1. DeckIds.json
  2. GamePhase.json
  3. GameStatus.json
  4. MoveType.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 define types/SocketEvent to import MoveType and extend it using the spread operator, so that the two stay in sync automatically. Then SocketEvent can explicitly add only the properties that do not already exist in MoveType

@itsalaidbacklife itsalaidbacklife added 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) labels Aug 28, 2024
@Mang0codes Mang0codes linked a pull request Oct 4, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant