CLI Jumpstart Plugin
NOTE: This version of the Jumpstart plugin is still under development. The README will be updated continuosly as we refine the plugin.
The Jumpstart Plugin is a part of the Magnolia CLI's plugin system. This plugin is designed to facilitate the process of starting new projects using predefined templates and bundles. It allows users to choose a template and download associated bundles while performing necessary tasks such as authentication, bundle downloading, extraction, and post-command execution.
Installation
The Jumpstart plugin is by default installed in the MGNL plugin-system and ready to be used.
Usage
The Jumpstart Plugin enhances the Magnolia CLI by providing a streamlined way to start new projects using predefined templates and bundles. Users can select templates, which are collections of bundles, and have the plugin handle the download, extraction, and execution of post-commands.
Jumpstart command:
magnolia-cli jumpstart
This command initiates the jumpstart plugin. When run, the plugin will prompt the user to select a template. It will then proceed to download and extract the required bundles, executing post-commands if specified, install required plugins, initialize package.json project and create mgnl.config.js.
command-line options
You can customize the jumpstart plugin's actions using these command-line options:
-
-t, --template <name>
: Choose template. -
-p, --projectTemplatesPath <path>
: Specify from where the projectTemplates should be loaded.
Template option: With this option, you can specify which template to use:
magnolia-cli jumpstart --template "headless/minimal-headless-spa-demos/dx-core/latest"
Project templates list:
The jumpstart plugin relies on a list of predefined project templates stored in an external repository. You can specify your own project templates list with the --project-templates-path command:
magnolia-cli jumpstart -p "<project-templates-path>"
Light-modules folder:
The Jumpstart Plugin initiates a recursive search throughout the project's directory structure for an existing light-modules
directory. Upon detection, the plugin avoids creating a new one, instead utilizing the existing directory to maintain the pre-configured modules. On the other hand, if a light-modules
directory is not found, the system will generate one.
magnolia.properties file:
The Jumpstart Plugin automatically applies specific modifications to the 'magnolia.properties' files of magnoliaAuthor and magnoliaPublic webapps.
Following properties are modified:
- 'magnolia.resources.dir' is adjusted to reference the
light-modules
directory. - 'magnolia.update.auto' is set to true
Conclusion
The Jumpstart Plugin demonstrates an effective way to streamline the process of setting up new projects by providing template-based automation for downloading, extracting, and handling bundles. With its intuitive command-line interface and detailed documentation, users can quickly get started with the Magnolia CLI's powerful plugin system.