Skip to content

Debug config validate#238

Open
ameerf-wix wants to merge 38 commits into
masterfrom
debug_config_validate
Open

Debug config validate#238
ameerf-wix wants to merge 38 commits into
masterfrom
debug_config_validate

Conversation

@ameerf-wix

Copy link
Copy Markdown
Contributor

Description

Related Issue

Checklist

  • I have read the Contributing Guide
  • I have added/updated tests for my changes (if applicable)
  • I have updated documentation/rules/skills (if applicable)

Screenshots / Demos

Additional Notes

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Generated llms.txt preview

llms.txt
# @wix/interact

> Declarative, configuration-driven interaction library — web-native, AI-ready, and framework-agnostic.

- Install: `npm install @wix/interact @wix/motion-presets`
- Three entry points: vanilla JS (`@wix/interact`), React (`@wix/interact/react`), Web Components (`@wix/interact/web`)
- Five trigger types: hover, click, viewEnter, viewProgress, pointerMove
- Effects via named presets (`@wix/motion-presets`), keyframes, CSS transitions, or custom JS callbacks
- Configs are JSON-serializable -- designed for LLM generation

## Docs

- [Full Reference](https://wix.github.io/interact/rules/full-lean.md): Declarative configuration-driven interaction library. Binds animations to triggers via JSON config. (700 lines)
- [Integration Guide](https://wix.github.io/interact/rules/integration.md): Rules for integrating `@wix/interact` into a webpage — binding animations and effects to user-driven triggers via declarative configuration. (334 lines)
- [Validation Guide](https://wix.github.io/interact/rules/validate.md): Rules for using `@wix/interact-validate` — validate an `InteractConfig` before it reaches the runtime. (271 lines)

## Optional

- [Click Trigger Rules for @wix/interact](https://wix.github.io/interact/rules/click.md): This document contains rules for generating click-triggered interactions in `@wix/interact`. (189 lines)
- [Hover Trigger Rules for @wix/interact](https://wix.github.io/interact/rules/hover.md): This document contains rules for generating hover-triggered interactions in `@wix/interact`. (191 lines)
- [PointerMove Trigger Rules for @wix/interact](https://wix.github.io/interact/rules/pointermove.md): These rules help generate pointer-driven interactions using `@wix/interact`. (279 lines)
- [ViewEnter Trigger Rules for @wix/interact](https://wix.github.io/interact/rules/viewenter.md): This document contains rules for generating interactions that respond to elements entering the viewport using the `@wix/interact`. (226 lines)
- [ViewProgress Trigger Rules for @wix/interact](https://wix.github.io/interact/rules/viewprogress.md): These rules help generate scroll-driven interactions using `@wix/interact`. (196 lines)
- [All rules in one file](https://wix.github.io/interact/llms-full.txt): Complete concatenation (2386 lines)
llms-full.txt header
# @wix/interact v2.4.0 -- AI Rules Reference
# https://wix.github.io/interact/llms.txt
# 8 files, 2386 lines

Download full files from workflow artifacts, or run node scripts/generate-llms.mjs locally.

@ydaniv

ydaniv commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

I think it's important we don't build that as part of the library.
It adds dependencies, and it will add bloat. We can't count on users just picking what they need and tree-shake it.
Usually users will import from CDN, or just import the library as-is.
And also tools that check the build size will show a much larger size which reflects bad visually.

@ameerf-wix ameerf-wix marked this pull request as ready for review June 18, 2026 12:52
},
sourcemap: true,
rollupOptions: {
external: ['zod', '@wix/interact'],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can drop the "powered by zod" part

'viewProgress',
'pointerMove',
'animationEnd',
'pageVisible',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently Wix-only. Should we keep it here?

Comment on lines +85 to +86
trigger: z.enum(['viewEnter', 'pageVisible']),
params: ViewEnterParams.optional(),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/generate-llms.mjs
const DOCS_LINK_TITLES = new Map([
['full-lean.md', 'Full Reference'],
['integration.md', 'Integration Guide'],
['validate.md', 'Validation Guide'],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this doc concatenated inside the llms.txt?

INVALID_MEDIA_QUERY: 'VALID_MEDIA_QUERIES',
};

function finalize(errors: ValidationError[], options: ValidateOptions = {}): ValidationResult {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's safe to have a version inside the doc:

Suggested change
`@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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the version from the doc, it's already part of same repo, they should be progressing together anyhow.

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.

2 participants