-
Notifications
You must be signed in to change notification settings - Fork 196
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
feat(cli): use abi types in store config #507
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4412aab
feat(cli): use abi types in store config
dk1a d0f2c71
refactor(cli): standardize generic in store config
dk1a f319d00
chore: cleanup
dk1a 4c5f70d
refactor(recs): use new config format in defineStoreComponents
dk1a 282163c
refactor(cli): flatten userTypes and require them when used in tables
dk1a aef0586
fix(cli): improve validation for columns and keys
dk1a d7fb8a3
refactor(cli): shorten config function names
dk1a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { describe, expectTypeOf } from "vitest"; | ||
import { z } from "zod"; | ||
import { StoreConfig, StoreUserConfig, UserTypesConfig } from "./parseStoreConfig.js"; | ||
import { StoreConfig, StoreUserConfig } from "./parseStoreConfig.js"; | ||
|
||
describe("StoreUserConfig", () => { | ||
// Typecheck manual interfaces against zod | ||
expectTypeOf<StoreUserConfig>().toEqualTypeOf<z.input<typeof StoreConfig>>(); | ||
// type equality isn't deep for optionals | ||
expectTypeOf<StoreUserConfig["tables"][string]>().toEqualTypeOf<z.input<typeof StoreConfig>["tables"][string]>(); | ||
expectTypeOf<NonNullable<UserTypesConfig["enums"]>[string]>().toEqualTypeOf< | ||
NonNullable<NonNullable<UserTypesConfig>["enums"]>[string] | ||
expectTypeOf<NonNullable<StoreUserConfig["enums"]>[string]>().toEqualTypeOf< | ||
NonNullable<NonNullable<z.input<typeof StoreConfig>>["enums"]>[string] | ||
>(); | ||
// TODO If more nested schemas are added, provide separate tests for them | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not part of this PR, but I think we should remove
aka ECS component
. Having a single value is not the distinguishing factor for an ECS component, since components can have multiple (related) values (eg.PositionComponent = {x: int32, y: int32 }
). The distinguishing factor for ECS components vs regular tables would rather be having a single key vs a composite key.