Otter is a framework based on Angular which regroups a set of modules and provides tooling to make them communicate together.
To be considered as an Otter Module, the package need to respect the following guidelines:
ng-add
and ng-update
schematics.[!TIP] The full list of Otter modules is available on this page.
To help developers to create their own Otter compatible module, the Otter framework provides 3 technical modules:
The full list of official modules can be found in the Documentation Home page.
You can simply generate an Otter module within your monorepo by running the following command:
Example :ng generate @o3r/core:module
You can also manually create your own module by following the instructions of the next session.
As indicated in the definition section, an Otter module should expose a ng-add
schematic to allow developers to install the module via the command ng add <package-name>
.
[!TIP] Information relative to the
ng-add
schematics is available here.
As all the Otter modules follow the same requirement, the new module can use provided helpers to trigger the installation of other Otter modules, through the ng-add
schematic of the requested module.
To ensure and facilitate that, the @o3r/core
provides a schematic which will generate the ng add skeleton files. Moreover, the helpers to trigger the installation of other Otter packages dependencies will be included.
Run the following command in the module where the ng add
needs to be included:
ng generate @o3r/core:ng-add-create
[!IMPORTANT] To finish, make sure to run the
build:schematics
script in the process of packaging/publishing the new module.
It could make sense that the developed module would be part of the modules proposed at the beginning of the Otter application.
To provide modules at Otter installation time, you just need to add the keyword otter-module
in your module's package.json file as follows:
{
"name": "@scope/my-module",
"version": "0.0.0-placeholder",
"description": "A description displayed in the console at build time",
"keywords": [
"some-keywords",
"otter-modules"
]
}
[!NOTE] Only the modules published to npmjs.org will be detected.