feat(extensions): Allow generation of help content for extension commands #3365
Merged
Conversation
| public getInstalledExtensionsData(): IExtensionData[] { | ||
| const installedExtensions = this.getInstalledExtensions(); | ||
| return _.keys(installedExtensions).map(installedExtension => { | ||
| return this.getInstalledExtensionData(installedExtension); |
Contributor
Author
There was a problem hiding this comment.
use short syntax here
Mitko-Kerezov
suggested changes
Feb 12, 2018
| this.$logger.trace(`Finished installation of extension '${extensionName}'. Trying to load it now.`); | ||
|
|
||
| return { extensionName: installResultInfo.name }; | ||
| const packageJsonData = this.getExtensionPackageJsonData(installResultInfo.name); |
Contributor
There was a problem hiding this comment.
You can just return getInstalledExtensionData here
d6c7676 to
ea061aa
Compare
Contributor
Author
|
Ping @Mitko-Kerezov - comments are fixed. |
ea061aa to
11345e8
Compare
…ands
Each CLI extension may add new commands to CLI. Allow showing command help for these commands in case:
1. Commmand execution fails.
2. Users need more information for command - `tns <command> --help`
3. Users need full html help for command - `tns help <command>`.
Each extension that wants to use this functionality will have to add `nativescript` key in its `package.json` and add `docs` key in it. The `docs` key must point to the directory where the help content (.md files) is located, relative to the root directory of the extension.
When CLI needs to show command line help for extension's command, it will search the docs directories of all extensions.
When CLI needs to show HTML help for the extension's commands, it will generate `html` directory right next to the docs dir in the extension.
Move extensibility.d.ts from {N} to mobile-cli-lib just to ensure correct transpilation.
11345e8 to
e44029f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each CLI extension may add new commands to CLI. Allow showing command help for these commands in case:
Commmand execution fails.
Users need more information for command - tns --help
Users need full html help for command - tns help .
Each extension that wants to use this functionality will have to add nativescript key in its package.json and add docs key in it. The docs key must point to the directory where the help content (.md files) is located, relative to the root directory of the extension.
When CLI needs to show command line help for extension's command, it will search the docs directories of all extensions.
When CLI needs to show HTML help for the extension's commands, it will generate html directory right next to the docs dir in the extension.
Move extensibility.d.ts from {N} to mobile-cli-lib just to ensure correct transpilation.
Add different basic page for extensions html pages
When generating html pages for extensions commands, use a different html
page that has the extension name as header at the top.
Add a placeholder and replace it when generating the html page.