Automated plugin and library installations for ADF/ACA
For the time being ADF/ACA extension libraries require several steps to get integrated into an application: installing from the NPM, then configuring JSON definition, optionally adding extra dependencies and asset files. The idea is to define some sort of convention for an ADF plugins and its artifacts, and have a command line tool that is able to install the library, configure all assets, and even change the "app.module.ts" file to register extra Angular modules.
Look through the following libs:
It expects the extension to contain a special entry in the package.json
similar to following:
{
"alfresco": {
"extension": "assets/my-extension.json",
"module": "MyExtensionModule",
"namespace": "my-extension"
}
}
- Command-line tool with node.js
- Install packages from NPM
- Install packages from packed tarballs
- Copy extension definition file (.json) to the
src/app/assets/plugins
- Register extension within the
app.extensions.json
- Register extension module in the
src/app/extensions.module.ts
To link the project locally and use as a global tool:
npm link
That will register the adf-ext
command.
Install dependency:
adf-ext i <npm-package>
adf-ext i <targball> <package-name>
Example:
adf-ext i my-lib
Installing local tarball packages
adf-ext i <path-to-tarball>/my-extension-0.0.1.tgz my-extension
Add already installed (manually) dependency from the node_modules
.
adf-ext add <package-name>
Example
adf-ext add my-lib
Note the install
command does that, use add
only if you installed the lib manually.