package opam-check-npm-deps
Install
Authors
Maintainers
Sources
sha256=dce793b588d997b299e371847c9a4c85c3e446a55f6c6e56f99d71cfaf31c967
sha512=4cef4b1456d9da7a2539d43344c81aed6f19332125cfc08e183a18b3085bf421eee20e93fcaee4ff6cb7f4add295e343d2def877eb9680fe62a5d9fe23b88bbb
Description
Provides the opam check-npm-deps
command, which given an opam switch, gathers all the depexts belonging to the npm platform and their version constraints, and checks the node_modules
folder to see if the constraints are satisfied.
Published: 23 Aug 2023
README
opam-check-npm-deps
An opam plugin to allow using the depexts
field to define requirements on npm packages.
When running the plugin, it checks the current opam switch to read all depexts
fields that use the npm-version
variable, and then reads the node_modules
folder to see if the constraints are satisfied.
For bindings authors: defining constraints
Constraints are defined by adding an entry to depexts
with the npm package name as the "system package" and and an equality formula that matches the npm-version
variable to a version range. This range can be defined using the same format as package.json
dependencies field.
For example, the reason-react
bindings can define its dependency on the react
npm package like this:
depexts: [
["react"] {npm-version = "^16.0.2"}
["react-dom"] {npm-version = "^16.0.2"}
]
Or, to simplify:
depexts: [
["react" "react-dom"] {npm-version = "^16.0.2"}
]
For bindings users: check
Install:
$ opam pin add opam-check-npm-deps.dev git+https://github.com/jchavarri/opam-check-npm-deps.git#main
Check the dependencies by running the plugin:
$ opam-check-npm-deps
If you don't want to the command to fail when errors are found, use the --dry-run
flag:
$ opam-check-npm-deps --dry-run
Contributing
$ make init
$ make watch
Commands
You can see all available commands by running make help
or just make
. Here are a few of the most useful ones:
make init
: set up opam local switch and download OCaml, Melange and JavaScript dependenciesmake install
: install OCaml dependenciesmake watch
: watch for the filesystem and have Dune rebuild on every change
Dependencies (14)
- ppx_sexp_conv
- ppx_let
- ppx_inline_test
- ppx_expect
- ppx_deriving_yojson
- lwt_ppx
- bos
-
fmt
>= "0.9.0"
-
angstrom
>= "0.15.0"
-
mccs
>= "1.1+14"
-
opam-client
>= "2.1.3" & < "2.2"
-
dune
>= "3.8"
-
reason
>= "3.8.1" & < "4.0.0"
-
ocaml
>= "4.14.0"
Dev Dependencies (1)
-
odoc
with-doc