-
-
Notifications
You must be signed in to change notification settings - Fork 7
Streamline defaults value management #560
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR refactors default value management in OmegaForm by consolidating default value extraction logic and introducing more flexible configuration options.
- Removes the
defaultAST.tsfile and movesdeepMergefunction toOmegaFormStuff.ts - Introduces a new
defaultFromSchemaconfiguration option with three modes: "only", "nope", and "merge" - Replaces the complex
extractSchemaDefaultsfunction with a simplerdefaultsValueFromSchemaimplementation
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vue-components/stories/OmegaForm/Defaults.vue | Adds comprehensive test story demonstrating various default value scenarios and configuration options |
| packages/vue-components/stories/OmegaForm.stories.ts | Registers the new Defaults story component |
| packages/vue-components/src/components/OmegaForm/useOmegaForm.ts | Updates default value logic to use new defaultsValueFromSchema function and implements defaultFromSchema configuration option |
| packages/vue-components/src/components/OmegaForm/defaultAST.ts | Removes entire file containing previous default extraction implementation |
| packages/vue-components/src/components/OmegaForm/OmegaTaggedUnionInternal.vue | Simplifies tagged union handling by removing complex default value extraction logic for union member switching |
| packages/vue-components/src/components/OmegaForm/OmegaFormStuff.ts | Adds new deepMerge and defaultsValueFromSchema functions; refactors metadataFromAst (formerly flattenMeta) to return metadata and default values |
| packages/vue-components/tests/OmegaForm/WithDefaultConstructorPersistency.test.ts | Updates test expectations to match new default value behavior |
| .changeset/slow-regions-sleep.md | Documents the change as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.