BotBuilder-Samples
BotBuilder-Samples copied to clipboard
Allow remote templates and schemas for dialog generation
Currently $requires looks for a schema in the template directories and the template directories are all local folders. The proposal has two parts:
- Add $templateDirectory to schema. If not specified we use the current mechanism where we assume the directory containing the schema is an added template directory. We would allow $templateDirectory to be a github reference and would automatically download it. This would allow us to have a professional-chit-chat.schema as part of the CLI that would if used download the remote template.
- $requires currently just has a plain schema name. We would extend it to allow a github URL as well. This would allow referring to a remote schema directly. When resources are remote we would have to figure out how to download the parent directory.
Alternatives for downloading from git:
- This website seems to do what we want and the code looks simple. https://downgit.github.io/#/home
- The github v4 graphql doesn't seem to support getting access to the repo code. The explorer lets you play with this and if we need to use it, octokit provides the npm package. https://developer.github.com/v4/explorer/
- There are npm packages that rely on having the git cli available. We might have to clone the whole repo.
- It might be possible to do git archive, but I saw one very old reference that github doesn't support that.
It would also be a good idea to look at how we could use schemas from npm/nuget components.
Ben Brown did a package we could likely use for a lot of this. https://github.com/microsoft/BotFramework-Composer/blob/benbrown/importfromweb/Composer/packages/server/src/controllers/import.ts#L85 [enhancement]