@magnolia/cli-create-light-module-plugin
v1.0.0
Published
A plugin for Magnolia CLI to create a new light module
Downloads
140
Readme
CreateLightModulePlugin
A plugin for Magnolia CLI to create a new light module
Installation
Using add-plugin
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() ] };
To confirm that the plugin has been successfully installed, run:
npm run mgnl -- create-light-module --help
Manually
- Run the following command in the project's root directory:
npm install @magnolia/cli-create-light-module-plugin
- Manually add CreateLightModulePlugin to mgnl.config.js file:
import CreateLightModulePlugin from "@magnolia/cli-create-light-module-plugin"; export default { plugins: [ new CreateLightModulePlugin() ] };
- 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" |
| -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