stdlib-js / stdlib

✨ Standard library for JavaScript and Node.js. ✨
https://stdlib.io
Apache License 2.0
4.32k stars 436 forks source link

[RFC]: add schema and validation for syntax highlighting themes in the REPL #2340

Open Snehil-Shah opened 3 months ago

Snehil-Shah commented 3 months ago

Description

This RFC proposes adding JSON schema and validation for when a user is providing their own set of themes. Currently, the user can provide any object as a theme without them knowing what's wrong.

Related Issues

Follow up to #2291

Questions

No.

Other

No.

Checklist

kgryte commented 3 months ago

One thing that we'd need to consider is whether to make ajv a production dependency, or whether we should roll our own JSON schema validator. The implementation of ajv does not appear trivial: https://github.com/ajv-validator/ajv/tree/master. In order to be a production dependency, we'd need to ensure it works across our supported environments.

kgryte commented 3 months ago

I'll go ahead and mark this as "blocked" until we figure out the path forward.