Home Manual Reference Source
import {TargetHTMLGenerator} from 'projext/src/services/cli/generators/targetHTML.js'
public class | source

TargetHTMLGenerator

Extends:

CLISubCommand → TargetHTMLGenerator

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 appLogger service.

public

A local reference for the appPrompt service.

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 targets service.

public

A local reference for the targetsHTML service.

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

addOption(name: string, instruction: string, description: string, defaultValue: string)

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#constructor

Params:

NameTypeAttributeDescription
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 appLogger: Logger source

A local reference for the appLogger service.

public appPrompt: Prompt source

A local reference for the appPrompt service.

public description: string source

A short description of what the generator does.

Override:

CLISubCommand#description

public name: string source

The resource type the user will have to select on the CLI command that manages the generator.

Override:

CLISubCommand#name

public targets: Targets source

A local reference for the targets service.

public targetsHTML: TargetsHTML source

A local reference for the targetsHTML service.

Public 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.

Override:

CLISubCommand#handle

Return:

Promise<undefined, Error>