Debug config validate#238
Conversation
Generated
|
|
I think it's important we don't build that as part of the library. |
…debug_config_validate
…debug_config_validate
| }, | ||
| sourcemap: true, | ||
| rollupOptions: { | ||
| external: ['zod', '@wix/interact'], |
There was a problem hiding this comment.
Is it correct to have Zod as external? So it's not bundled with the validate package?
| { | ||
| "name": "@wix/interact-validate", | ||
| "version": "1.0.0", | ||
| "description": "Schema + referential + semantic validation for @wix/interact's InteractConfig, powered by zod.", |
There was a problem hiding this comment.
I think we can drop the "powered by zod" part
| 'viewProgress', | ||
| 'pointerMove', | ||
| 'animationEnd', | ||
| 'pageVisible', |
There was a problem hiding this comment.
This is currently Wix-only. Should we keep it here?
| trigger: z.enum(['viewEnter', 'pageVisible']), | ||
| params: ViewEnterParams.optional(), |
There was a problem hiding this comment.
pageVisible, besides being Wix-only, is a wrapper above viewEnter + triggerType: 'state', which is now on the effect. It's becoming somewhat problematic to keep.
| const DOCS_LINK_TITLES = new Map([ | ||
| ['full-lean.md', 'Full Reference'], | ||
| ['integration.md', 'Integration Guide'], | ||
| ['validate.md', 'Validation Guide'], |
There was a problem hiding this comment.
Do we really need this doc concatenated inside the llms.txt?
| INVALID_MEDIA_QUERY: 'VALID_MEDIA_QUERIES', | ||
| }; | ||
|
|
||
| function finalize(errors: ValidationError[], options: ValidateOptions = {}): ValidationResult { |
There was a problem hiding this comment.
nit: maybe move all this code into a separate file and have the index just import/export?
| result.sort((a, b) => { | ||
| const pa = a.path.join('\0'); | ||
| const pb = b.path.join('\0'); | ||
| return pa < pb ? -1 : pa > pb ? 1 : 0; |
There was a problem hiding this comment.
What are we comparing here? Length of string? Or do these strings represent numbers?
|
|
||
| Rules for using `@wix/interact-validate` — validate an `InteractConfig` before it reaches the runtime. | ||
|
|
||
| `@wix/interact-validate` is a standalone, zod-powered validator for the `@wix/interact` `InteractConfig` shape. It runs **statically** (no DOM, no browser, no runtime), so it is safe in build tools, CI, and server-side code. It is a separate package from `@wix/interact` and declares `@wix/interact` as a peer dependency (`^2.4.0`) — its config types come from there, so the two never drift. |
There was a problem hiding this comment.
Not sure it's safe to have a version inside the doc:
| `@wix/interact-validate` is a standalone, zod-powered validator for the `@wix/interact` `InteractConfig` shape. It runs **statically** (no DOM, no browser, no runtime), so it is safe in build tools, CI, and server-side code. It is a separate package from `@wix/interact` and declares `@wix/interact` as a peer dependency (`^2.4.0`) — its config types come from there, so the two never drift. | |
| `@wix/interact-validate` is a standalone, zod-powered validator for the `@wix/interact` `InteractConfig` shape. It runs **statically** (no DOM, no browser, no runtime), so it is safe in build tools, CI, and server-side code. |
| npm install @wix/interact-validate | ||
| ``` | ||
|
|
||
| `@wix/interact` is a **peer dependency** (`^2.4.0`) — the config types come from there, so the validator never drifts from the runtime shape. `zod` (`^4`) is a regular dependency. |
There was a problem hiding this comment.
Let's remove the version from the doc, it's already part of same repo, they should be progressing together anyhow.
Description
Related Issue
Checklist
Screenshots / Demos
Additional Notes