mongosh icon indicating copy to clipboard operation
mongosh copied to clipboard

feat(shell-api): Generate shell-api metadata from source

Open gribnoysup opened this issue 4 years ago • 0 comments

Here's my 🦨 exploration. This PR adds a script that generates metadata from shell-api collecting type info and documentation of all exposed classes and class members in one place. For the PoC I added only very basic error validation for shell method calls to have some kind of example of how we can use it:

image

I think if we decide to keep it, we can polish error messages and also move help logic to be based on this metadata which can provide a better visual based on shell environment. Also VSCode can consume it instead of i18n data for better intellisense suggestions (e.g., deprecated data is available in the metadata)

I excluded the metadata from source as it's a generated file, so if you want to see how the file looks you'll need to pull the branch and run npm run metadata in shell-api package

gribnoysup avatar Apr 15 '21 16:04 gribnoysup