Documentation • Contributing • Code of Conduct
Micra's monorepo
pnpm checkpnpm formatpnpm testpnpm dependencies:updateWhenever a change is made to one of the packages, a changeset should be created. This can be done by running:
pnpm version:bumpTo generate the reference documentation, run:
pnpm docs:generateThis monorepo is setup with scaffolding capabilities. To scaffold, run:
pnpm generate {generator}pnpm generate specpnpm generate libraryIn the library folder you can generate the following files:
To add a new class file to a library, run:
pnpm generate classThis will create a new file in the ./packages/[library]/src/classes folder.
To add a new constants file to a library, run:
pnpm generate constantsThis will create a new file in the ./packages/[library]/src/constants folder.
To add a new guard file to a library, run:
pnpm generate guardThis will create a new file in the ./packages/[library]/src/guards folder.
To add a new submodule to the library, run:
pnpm generate submoduleThis 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 typesThis will create a new file in the ./packages/[library]/src/types folder.
To add a new utility file to a library, run:
pnpm generate utilityThis 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.