@magnolia/cli-create-app-plugin
v1.0.0
Published
A plugin for Magnolia CLI to create an app in a light module
Downloads
57
Readme
CreateAppPlugin
A plugin for Magnolia CLI to create an app in a light module
Installation
Using add-plugin
Run the following command in the project's root directory:
npm run mgnl -- add-plugin @magnolia/cli-create-app-plugin
The command will install the plugin, and automatically register the plugin in
mgnl.config.js
file:import CreateAppPlugin from "@magnolia/cli-create-app-plugin"; export default { plugins: [ new CreateAppPlugin() ] };
To confirm that the plugin has been successfully installed, run:
npm run mgnl -- create-app --help
Manually
- Run the following command in the project's root directory:
npm install @magnolia/cli-create-app-plugin
- Manually add CreateAppPlugin to mgnl.config.js file:
import CreateAppPlugin from "@magnolia/cli-create-app-plugin"; export default { plugins: [ new CreateAppPlugin() ] };
- To confirm that the plugin has been successfully installed, run:
npm run mgnl -- create-app --help
Usage
Options
| Short | Long | Description |
|--------------|--------------------------|-------------------------------------------------------------------------------------------------------------|
| -ct <name>
| --content-type <name>
| configure the content type by creating a new type or choosing an existing one (recommended singular) |
| -lm [name]
| --light-module [name]
| set the light module for the app; 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 app creation |
| -p [name]
| --prototype [name]
| select a prototype for app creation |
| -v
| --version
| output the version number |
| -h
| --help
| display help for command |
Examples
Create app
npm run mgnl -- create-app "myFooApp"
This command will prompt you to select a content-type for the app and then generate the necessary files based on the "_default" prototype. If neither the lightModulesPath nor the lightModule property exists in mgnl.config.js, the plugin will prompt you to choose each.
Create app and content-type
npm run mgnl -- create-app "myFooApp" --content-type "myFooContentType"
This commands creates a new app called "myFooApp" and a new conent-type called "myFooContentType" based on "_default" prototype. If neither the lightModulesPath nor the lightModule property exists in mgnl.config.js, the plugin will prompt you to choose each.
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