wrap-cli
wrap-cli copied to clipboard
Feat: Client validate method
disclaimer: even tho this PR is "done" it's the first iteration and i am looking for feedback, I don't like the validate/wrapper-* folder but thought it was easier to implement, if someone has any improvement suggestions i am more than open :)
This PR aims to add the validate function to the client, being able to guarantee that the client can communicate with the given wrapper URI ahead-of-time
The interface is the following:
interface ValidateOptions {
recursive: boolean
abi: boolean
}
validate(uri: Uri | string, options: ValidateOptions) -> boolean
- If
abiis true, make sure the ABI from 1st level dependencies are available (the ones fromimportedModuleType) - If
recursiveis true, it will check all uris and make sure it can resolve them
Also, a compare function has been implemented in js/manifests/wrap to compare two array of method definitions, this function allow us to make sure that dependencies are equal and wont fail in runtime