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

Constraint checks #2

Merged
merged 9 commits into from
Aug 10, 2023
Merged

Constraint checks #2

merged 9 commits into from
Aug 10, 2023

Conversation

jchavarri
Copy link
Member

This PR adds:

  • some initial checking of installed npm packages versus the constraints found on opam depexts file that include the npm-version variable
  • some basic error handling
  • tests for the above

I think this is enough to release a version to opam, the only remaining thing would be to lift the OCaml compiler constraint so that the opam plugin also works with 5.0.

src/main.ml Outdated Show resolved Hide resolved
test/main.t Outdated Show resolved Hide resolved
src/main.ml Show resolved Hide resolved
@jchavarri
Copy link
Member Author

One remaining thing I'm not that happy about is that the plugin will check for node_modules from the folder where it's called from:

https://github.com/jchavarri/opam-check-npm-deps/blob/cfe4d54f5215fcd8c13807503c2ad028a9cc7bd6/src/main.ml#L113

Maybe this is fine for now, and we can think about smarter ways to find the node_modules folder in the future.

@davesnx
Copy link
Member

davesnx commented Aug 9, 2023

Sounds good for a 0.0.1. Possible ways to improve:

  • Adding a --root flag
  • A mechanism for looking into git folder
  • Recursively going up for a node_modules directory

src/main.ml Outdated Show resolved Hide resolved
src/main.ml Outdated Show resolved Hide resolved
@jchavarri
Copy link
Member Author

@davesnx @anmonteiro thanks for the reviews. I think I tackled all the comments, I will merge, then work on testing OCaml 5, and then cut a first release to submit to opam.

A couple of issues that originated from this PR have been created:

@jchavarri jchavarri merged commit b188e3c into main Aug 10, 2023
@jchavarri jchavarri deleted the constraint-checks branch August 10, 2023 15:34
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.

3 participants