-
-
Notifications
You must be signed in to change notification settings - Fork 197
feat(extensions): Allow generation of help content for extension commands #3365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
public getInstalledExtensionsData(): IExtensionData[] { | ||
const installedExtensions = this.getInstalledExtensions(); | ||
return _.keys(installedExtensions).map(installedExtension => { | ||
return this.getInstalledExtensionData(installedExtension); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use short syntax here
@@ -35,7 +35,16 @@ export class ExtensibilityService implements IExtensibilityService { | |||
const installResultInfo = await this.$npm.install(packageName, this.pathToExtensions, npmOpts); | |||
this.$logger.trace(`Finished installation of extension '${extensionName}'. Trying to load it now.`); | |||
|
|||
return { extensionName: installResultInfo.name }; | |||
const packageJsonData = this.getExtensionPackageJsonData(installResultInfo.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just return getInstalledExtensionData
here
d6c7676
to
ea061aa
Compare
Ping @Mitko-Kerezov - comments are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
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.