Skip to main content

Use Swarmion generators

Generate new packages respecting the monorepo code structure in one command.

Installation

# using pnpm
pnpm add --save-dev @swarmion/nx-plugin

# using yarn
yarn add --save-dev @swarmion/nx-plugin

# using npm
npm install --save-dev @swarmion/nx-plugin

Generate new Services

At the root of your project, run:

pnpm nx generate @swarmion/nx-plugin:service my-service

This will create a simple service in the repository's structure respecting our guidelines.

By default, new services will be placed in the services directory. You can customize this with the --directory option. For example:

pnpm nx generate @swarmion/nx-plugin:service service --directory=path/to/services

Generate new Libraries

At the root of the project, run:

pnpm nx generate @swarmion/nx-plugin:library my-library

This will create a simple internal library in the repository's structure respecting our guidelines.

By default, new libraries will be placed in the packages directory. You can customize this with the --directory option. For example:

pnpm nx generate @swarmion/nx-plugin:library my-library --directory=path/to/packages