Skip to content
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

Feature request: JSON schema for audit-resolve.json #76

Open
jase88 opened this issue Dec 6, 2023 · 4 comments · May be fixed by naugtur/audit-resolve-core#9
Open

Feature request: JSON schema for audit-resolve.json #76

jase88 opened this issue Dec 6, 2023 · 4 comments · May be fixed by naugtur/audit-resolve-core#9

Comments

@jase88
Copy link

jase88 commented Dec 6, 2023

Would be great to have a JSON schema of the audit-resolve.json that is applied initially.

like

{
  "$schema": "node_modules/npm-audit-resolver/schema.json",
  // ...
}

This would make clearer for devs which optional fields might be filled in (if there are any?) and third party tools could read the format easier.

@naugtur
Copy link
Owner

naugtur commented Dec 6, 2023 via email

@jase88
Copy link
Author

jase88 commented Dec 7, 2023

Hey, thanks.

I realized that there are already two JSON schemas within audit-resolve-core. Currently these are baked into a js files (e.g. auditFile/versions/v1.js).

First thought:

  • move content of js files to schema.json files (for example v0.schema.json)
  • consume them within js files (require or readFileSync - also depending which node version should be supported)

So the changes should probably only happen in audit-resolve-core, right?
There is also the file writing happening, where the $schema needs to be applied as well

@naugtur
Copy link
Owner

naugtur commented Dec 11, 2023 via email

@jase88
Copy link
Author

jase88 commented Dec 13, 2023

Ok great made a first PR containing a schema file

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 a pull request may close this issue.

2 participants