Using generators
To make the process of adding new components we have prepared several generators using Turborepo code generation features.
You can launch these generators by running
npm run generate
at the root level of the project, after which you will be asked which generator you want to use.
Block
You can create a new block within the api-harmonization
app by using block
generator. It will:
- Create a new package in the
packages/blocks
directory. - Inside this new folder, it will create all the necessary files that compose a block:
- API Harmonization part with
- module,
- controller,
- service,
- mapper,
- model and request.
- Frontend app part with
- server component,
- client component,
- renderer,
- typings,
- API methods,
- SDK part.
- API Harmonization part with
UI
To create a new container within the ui
package, you can choose the ui-component
generator. It will:
- Create a new file in the
packages/ui/src/components
directory.
Integrations
You can also create a whole new integration by using the integration
generator, which will:
- Ask you which modules you want included in the integration.
- Create a new folder in the
packages/integrations
directory. - Initialize a new project for this new integration, with all the necessary files (like
package.json
, linter and prettier configs, and so on). - For each module you chose, it will create appropriate folder within the
packages/api/integrations/src/module
directory. - Inside those folders it will create the necessary files that compose a module:
- controller,
- service,
- mapper.