The monorepo
The mochinori repository is a pnpm workspace modeled on the Lexical monorepo's tooling.
packages/
mochinori-images/ @mochinori/images, a published library
mochinori-website/ this site (Docusaurus)
mochinori-website-worker/ the Void app that serves this site
mochinori-eslint-plugin-internal/ lint rules for the repo itself
scripts/ repo scripts and their tests
Commands
| Command | What it does |
|---|---|
pnpm install | Install everything |
pnpm run build | Build the published libraries into dist/ |
pnpm run start:website | Run this site locally with live reload |
pnpm run dev:website | Build this site and run it with its API routes and Durable Objects |
pnpm run test-unit | Run unit tests (Vitest) |
pnpm run lint / lint:fix | ESLint |
pnpm run prettier / prettier:fix | Prettier |
pnpm run ci-check | TypeScript, Prettier and ESLint, as CI runs them |
Adding a library
- Create
packages/mochinori-<name>/with apackage.jsonnamed@mochinori/<name>. Copypackages/mochinori-imagesfor the layout. - Export the TypeScript entry point under the
mochinori-sourcecondition and the built file underdefault. Tests, the typechecker and this site all resolvemochinori-source, so nothing needs building during development. - List
lexicaland@lexical/*inpeerDependencies, and indevDependenciesascatalog:so the whole repo shares one version.scripts/__tests__/unit/packages.test.tsenforces this. - Write relative imports with the file's real extension
(
./ImageNode.tsx);tscrewrites them to.jswhen it builds.