import {ProjectConfigurationFileGenerator} from 'projext/src/services/cli/generators/projectConfigurationFile.js'
ProjectConfigurationFileGenerator
Extends:
This is a CLI generator that allows the user to create a configuration file with all the default settings and all the information projext assumes about the project.
Constructor Summary
Public Constructor | ||
public |
constructor(appLogger: Logger, appPrompt: Prompt, pathUtils: PathUtils, projectConfiguration: ProjectConfigurationSettings, utils: Utils) 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 |
All the project settings. |
|
public |
A local reference for the |
Method Summary
Public Methods | ||
public |
This method first prompts the user for the name of configuration file, it needs to be one supported by projext, after that, if the file already exists it asks for confirmation, and then it finally writes it. |
Protected Methods | ||
protected |
Formats a settings dictionary in order to write it as a JS object on an specific file. |
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, pathUtils: PathUtils, projectConfiguration: ProjectConfigurationSettings, utils: Utils) 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 the path to the file. |
|
pathUtils | PathUtils | To build the absolute path for the file. |
|
projectConfiguration | ProjectConfigurationSettings | To get all the settings that are going to go on the file. |
|
utils | Utils | To format some of the options into human readable descriptions. |
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(options: Object): Promise<undefined, Error> source
This method first prompts the user for the name of configuration file, it needs to be one supported by projext, after that, if the file already exists it asks for confirmation, and then it finally writes it.
Override:
CLISubCommand#handleParams:
Name | Type | Attribute | Description |
options | Object | A dictionary with the received options for the generator. |
|
options.all | boolean | Whether to save all the settings or just the targets. |
|
options.include | string |
|
A list of directory-like paths for specific settings to save. |
options.exclude | string |
|
A list of directory-like paths for specific settings to ignore. |