import {TargetHTMLGenerator} from 'projext/src/services/cli/generators/targetHTML.js'
TargetHTMLGenerator
Extends:
This is a CLI generator that allows the user to create an HTML file for a browser target. What it does is to force projext to create the default HTML file it would create if the target didn't have one and then it moves it to the target directory.
Constructor Summary
Public Constructor | ||
public |
constructor(appLogger: Logger, appPrompt: Prompt, targets: Targets, targetsHTML: TargetsHTML) Class constructor. |
Member Summary
Public Members | ||
public |
A local reference for the |
|
public |
A local reference for the |
|
public |
A short description of what the generator does. |
|
public |
The resource type the user will have to select on the CLI command that manages the generator. |
|
public |
A local reference for the |
|
public |
A local reference for the |
Method Summary
Public Methods | ||
public |
This method first prompts the user for information about the target and the file that is going to create, then uses the TargetsHTML to create a "default HTML file", and it finally moves it to the selected path. |
Inherited Summary
From class CLISubCommand | ||
public |
A short description for what the generator does. |
|
public |
The name of the sub command for the help interface. |
|
public |
A list with the name of the options the generator supports. |
|
public |
A dictionary of options settings by their option name. |
|
public |
Add a new option for the command. |
|
public |
Generates a complete description of the sub command and its options in order to be used on the help interface of the CLICommand that implements it. |
|
public abstract |
handle() The method called by the CLICommand that implements the sub command. |
Public Constructors
public constructor(appLogger: Logger, appPrompt: Prompt, targets: Targets, targetsHTML: TargetsHTML) source
Class constructor.
Override:
CLISubCommand#constructorParams:
Name | Type | Attribute | Description |
appLogger | Logger | To inform the user when the file has been generated, or if something went wrong. |
|
appPrompt | Prompt | To ask the user for the arget name and the file path. |
|
targets | Targets | To get the selected target information. |
|
targetsHTML | TargetsHTML | To generate the HTML file. |
Public Members
public description: string source
A short description of what the generator does.
Override:
CLISubCommand#descriptionpublic name: string source
The resource type the user will have to select on the CLI command that manages the generator.
Override:
CLISubCommand#namePublic Methods
public handle(): Promise<undefined, Error> source
This method first prompts the user for information about the target and the file that is going to create, then uses the TargetsHTML to create a "default HTML file", and it finally moves it to the selected path.