@magnolia/cli-template-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-preview.1 • Public • Published

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<void>

    • Starts the plugin execution with the given options.
  • init(winstonLogger: Logger): Promise<void>

    • Initializes the plugin with a Winston logger.
  • stop(): void

    • Stops the plugin, logging a stop message.
  • validateAndResolveArgs(options: PluginOptions): Promise<CreateComponentArgs>

    • 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<void>

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

Readme

Keywords

none

Package Sidebar

Install

npm i @magnolia/cli-template-helper

Weekly Downloads

52

Version

1.0.0-preview.1

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

30.4 kB

Total Files

17

Last publish

Collaborators

  • magnolia