1.0.0-preview.1 • Published 1 month ago

@magnolia/cli-template-helper v1.0.0-preview.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
1 month ago

TemplateHelper class

This class is designed to be extended by create-component and create-page plugins. Serves as the base class that provides the concrete logic for starting the appropriate development environment for creating a component or page.

Properties:

  • options: Command line options represented as an array of Option objects from commander.
  • context: The execution context of the plugin (pages or components).
  • pluginArgs: A collection of key configuration options for the plugin.

Methods:

  • async start(): Promise\
    • Starts the plugin execution with the given options.
  • init(winstonLogger: Logger): Promise\
    • Initializes the plugin with a Winston logger.
  • stop(): void
    • Stops the plugin, logging a stop message.
  • validateAndResolveArgs(options: PluginOptions): Promise\
    • Validates and resolves the arguments provided to the plugin based on the given options and local configuration. It handles framework selection, path resolutions, and various checks ensuring the provided paths and options are valid.
    • Modifies and sets the missing parameters in the Magnolia configuration (mgnl.config.js).
  • startFramework(args: CreateComponentArgs): Promise\
    • Starts the framework or development environment for creating a component or page. It constructs the command to execute based on the resolved arguments and the development context.