Installing and uninstalling components

Each component of a Mantra project should be installed specifically with the command install-component:

$ mantrad install-component mycomponent

When running this, Mantra will look for folder components (indicated in the property "ComponentsLocations" in mantraconfig.json file) with the name "mycomponent".

The component should define a mantra.json file and a Node.js module with the file mycomponent.js name as indicated in Component Definition section.

If the component defines Install property, then the optional method onInstall will be invoked.

Remember: if the component will be part of the project and this on should be installed later one in other environments, then the component is considered a default component, and, in this case, you should include its name in "DefaultComponents" property of mantraconfig.json file.

Uninstalling a component

To uninstall a Mantra component for the current project, you should use uninstall-component command:

$ mantrad uninstall-component mycomponent

As indicated in Component Definition section, if the component defines Install property, then the optional method onUninstall will be invoked.

Reinstalling a component

You can perform the uninstalling and installing actions at once when needed, for example, when you need to install changes in a component model during development.

To do that, you can use resintall-command:

$ mantrad reinstall-component mycomponent