nickel-lang / json-schema-to-nickel

Convert JSON schemas into Nickel contracts
Apache License 2.0
29 stars 0 forks source link

Add --library-path argument #80

Closed yannham closed 3 months ago

yannham commented 3 months ago

Depends on #79.

By default, the internal js2n predicate library is inlined in each generated contract to ensure that this is a standalone Nickel file that can be imported and moved around freely. However, this eats quite a lot of space, especially when a lot of contracts are generated and distributed together.

This commits add a CLI argument, --library-path, to provide a path from which the generated contract should import the library, instead of inlining it, so that the library can be shared by many contracts. The drawback is that the user makes ensure that the library must be available at said path when the contract is eventually used, which is why the default behavior (inlining) stays the same.