Home    |    GitHub Page    |    API    |    FAQ

Important: move to Lerna for managing the Joplin mono-repo

Joplin is moving to Lerna

As mentioned in another post, the Joplin mono-repo is now going to be managed by Lerna. Lerna allows splitting a large project into smaller sub-packages and to manage them all using simple commands. The reason for switching to Lerna are mentioned in the pull request but listed below too for information:

  • Allow re-using certain parts of Joplin, such as the core library and renderer outside of the Joplin apps
  • Manage Joplin renderer as a separate package, which previously was not possible due to an electron-builder bug
  • Clean up dependencies between the different modules (most modules had many unnecessary dependencies, only so that they could be built)
  • Make TypeScript config more manageable by having a per-package configuration. Previously all modules shared the same config which caused conflicts between for example React Native and Electron packages, even though they are different apps.
  • Eventually joplin-turndown packages will be moved under the mono-repo as currently it's hard to work with them as they need to be republished and all imports updated when there's a change.

What does it mean in terms of development?

The main difference is that files have been moved to different directories:

Before After
ElectronClient packages/app-desktop
ReactNativeClient packages/app-mobile
CliClient packages/app-cli
Clipper packages/app-clipper
ReactNativeClient/lib packages/lib
ReactNativeClient/lib/joplin-renderer packages/renderer

Other than that, the Lerna integration is meant to be transparent. You just need to run npm install from the root and everything should be installed as before. Then you go to the relevant app directory and run npm start like before.

What does it mean for current pull requests?

The Lerna change is massive in terms of files being moved around, pretty much the whole codebase is affected, and it means current pull requests will have conflicts unfortunately. So if you have an active pull request, your help to fix the conflicts would be most welcome. I expect you simply need to move the changes from where they are to the new location, but if something's not clear please let me know.

1 Like