@magnolia/cli-create-light-module-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

CreateLightModulePlugin

A plugin for Magnolia CLI to create a new light module

Installation

Using add-plugin

  1. Run the following command in the project's root directory:

    npm run mgnl -- add-plugin @magnolia/cli-create-light-module-plugin

    The command will install the plugin, and automatically register the plugin in mgnl.config.js file:

    import CreateLightModulePlugin from "@magnolia/cli-create-light-module-plugin";
    
    export default {
      plugins: [
        new CreateLightModulePlugin()
      ]
    };
  2. To confirm that the plugin has been successfully installed, run:

    npm run mgnl -- create-light-module --help

Manually

  1. Run the following command in the project's root directory:
    npm install @magnolia/cli-create-light-module-plugin
  2. Manually add CreateLightModulePlugin to mgnl.config.js file:
    import CreateLightModulePlugin from "@magnolia/cli-create-light-module-plugin";
    
    export default {
      plugins: [
        new CreateLightModulePlugin()
      ]
    };
  3. To confirm that the plugin has been successfully installed, run:
    npm run mgnl -- create-light-module --help

Usage

Options

Short Long Description
-d [directories...] --directories [directories...] create specific directories within the light-module; example usage: "-d A D" will generate "apps" and "decorations" folders; available mappings: "A: apps, B: blocks, C: contentTypes, D: decorations, DIA: dialogs, I: i18n, INC: includes, M: messageViews, R: restEndpoints, T: templates, THM: themes, V: virtualUriMappings, W: webresources"
-md <version> --module-descriptor <version> specify the module version of the light module; defaults to 1.0.0
-lmp [path] --light-modules-path [path] set the directory path for the new light module; defaults to the directory specified in mgnl.config.js file
-pd <path> --prototype-dir <path> use the specified path to the custom prototype templates directory as the prototype source for light module creation
-p [name] --prototype [name] select a prototype for light-module creation
-v --version output the version number
-h --help display help for command

Examples

Create light module

npm run mgnl -- create-light-module "my-lm"

This commands creates a new light-module folder called "my-lm" based on "_default" prototype. If no lightModulesPath property exists in mgnl.config.js, the plugin will prompt you to choose one.

Create light module with specific directories

npm run mgnl -- create-light-module "my-lm" --directories A D

This commands creates a new light-module folder called "my-lm" with "apps" and "decorations" folders. If no lightModulesPath property exists in mgnl.config.js, the plugin will prompt you to choose one.

Create light module with specific directories

npm run mgnl -- create-light-module "my-lm" --directories A D --light-modules-path "./magnolia/light-modules"

This commands creates a new light-module folder called "my-lm" with "apps" and "decorations" folders. Instead of using lightModulesPath property from mgnl.config.js the "my-lm" is created in "./magnolia/light-modules" and lightModulesPath property in mgnl.config.js is changed.

Plugin Documentation

For detailed documentation of the plugin, please refer to Plugin Documentation

Magnolia CMS

This plugin is created to work with Magnolia CMS. For more information, please refer to Magnolia CMS Documentation

Readme

Keywords

none

Package Sidebar

Install

npm i @magnolia/cli-create-light-module-plugin

Weekly Downloads

121

Version

1.0.2

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

31 kB

Total Files

41

Last publish

Collaborators

  • magnolia