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

Zod schema validation #77

Merged
merged 12 commits into from
Dec 19, 2024
Merged

Zod schema validation #77

merged 12 commits into from
Dec 19, 2024

Conversation

PierreBeucher
Copy link
Owner

No description provided.

Profound change in how state is defined and persisted on disk to better clarify each component role,
how to implement components per provider and implement saner and easier to test components.
Each component now have clearly identified side effects so it's easier to mock with unit tests.
Mocha was incredibly slow. This issue recommands transpile-only: TypeStrong/ts-node#754 (comment)
for better testability and control over data and side effects
Big InstanceManager class with generic was a pain to manage and caused Zod implementation to be painful. Rather, use a factory pattern with a generic InstanceManager. Depending on State and provider in state, implement the InstanceManager with expected sub-Managers for specific provider.

This also provide  a better separation of concern between high-level InstanceManager (not knowing concrete state type or provider) and provider-specific implementation.

Also started a bit of Zod implementation. No major impact yet.
…d other tasks along with cleaning-up legacy state

added a few tests to make sure
Will provide more safety when loading and saving file to disk, otherwie we may load data not matching Typescript typing and breaking things in unexpected manners.
introduced by recent commits on this branch, not a fix
introduced a tiny bug and forgot a commen
@PierreBeucher PierreBeucher merged commit 4c9dc3f into master Dec 19, 2024
7 checks passed
@PierreBeucher PierreBeucher deleted the zod-schema branch December 29, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant