Documentation • Contributing • Code of Conduct
Micra's monorepo
pnpm check
pnpm format
pnpm test
pnpm dependencies:update
Whenever a change is made to one of the packages, a changeset should be created. This can be done by running:
pnpm version:bump
To generate the reference documentation, run:
pnpm docs:generate
This monorepo is setup with scaffolding capabilities. To scaffold, run:
pnpm generate {generator}
pnpm generate spec
pnpm generate library
In the library folder you can generate the following files:
To add a new class file to a library, run:
pnpm generate class
This will create a new file in the ./packages/[library]/src/classes
folder.
To add a new constants file to a library, run:
pnpm generate constants
This will create a new file in the ./packages/[library]/src/constants
folder.
To add a new guard file to a library, run:
pnpm generate guard
This will create a new file in the ./packages/[library]/src/guards
folder.
To add a new submodule to the library, run:
pnpm generate submodule
This will create a new file in the ./packages/[library]/src/[name].ts
and update the package.json
, vite.config.ts
and the main src/index.ts
files to include the new submodule.
To add a new types file to a library, run:
pnpm generate types
This will create a new file in the ./packages/[library]/src/types
folder.
To add a new utility file to a library, run:
pnpm generate utility
This will create a new file in the ./packages/[library]/src/utilities
folder.
To create a custom generator, edit the ./turbo/generators/config.ts
file and add a new generator via the plop.setGenerator
method. Under the hood, we use Turborepo's gen package which uses Plop to generate files. Take a look at their documentation to learn more about how to create custom generators. To write your code, make sure to check out the ./turbo/generators/utilities
folder for helper functions.