Skip to content

refactor(utils): drop ajv dependency#4142

Open
KristjanESPERANTO wants to merge 2 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:ajv
Open

refactor(utils): drop ajv dependency#4142
KristjanESPERANTO wants to merge 2 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO:ajv

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

This PR removes ajv from module position validation in js/utils.js and replaces it with straightforward JavaScript checks. The old schema only covered a few basic structure rules, so using ajv here felt heavier than necessary. The updated validation keeps the same expected behavior for valid configs and unknown-position warnings, but the code path is now easier to read and easier to reason about when something goes wrong.

Outcome: same validation behavior, one less dependency, less lines of production code and better test coverage.

The previous schema only enforced basic structure checks, so ajv added unnecessary complexity for this single validation path.

Replace ajv compile/validate with explicit JavaScript checks while keeping existing behavior for required module entries, position type validation, and unknown-position warnings.

Also removes a fragile ajv error-formatting path and fixes the JSDoc parameter type: data is the full config object, not a string.
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