Open Lusito opened 3 years ago
Nice read: https://medium.com/@askjkrishna/scaffolding-a-project-using-lerna-and-lerna-changelog-cad6156f6f36
It looks as if the requirement to learn lerna can be moved to a select few people, as it works with yarn workspaces in a way, that enables developers to just use yarn when doing changes and creating PRs.
Also, lerna seems to be the de facto standard: https://www.npmtrends.com/release-it-vs-semantic-release-vs-standard-version-vs-lerna-vs-@microsoft/rush
So I'll give this setup a try: yarn + workspaces + lerna + lerna-changelog.
So, publishing with lerna seems to work nicely.
lerna-changelog on the other hand is a lot of work:
I was hoping that lerna would handle that last part, but it doesn't seem to do that. Or maybe I'm not getting how to configure it correctly.
Will take a look at other tools.
After searching about monorepos and workspaces I can tell :
I'm not using any tools for now but I will probably install Lerna to automate some tasks based on what you did here :)
I'm using lerna only for releasing and publishing new versions. It seems a bit overkill for just this "simple" task, but I wasn't able to find any good alternatives yet. Most of these release libraries don't natively support workspaces.
I didn't face any problems with dependencies, but I manage them manually in package.json files. I only run npm install
from the root folder, never in sub folders. It's really feels ok for me to write dependencies manually because VSCode has completion on npm packages and the version is filled with the latest one.
About pnpm sadly the pnpm recursive publish
is still in developments, I thought it was already working. In their issue pnpm#2225 someone link to an interesting project called changesets, you should take a look !
Nice read: medium.com/@askjkrishna/scaffolding-a-project-using-lerna-and-lerna-changelog-cad6156f6f36
It looks as if the requirement to learn lerna can be moved to a select few people, as it works with yarn workspaces in a way, that enables developers to just use yarn when doing changes and creating PRs.
Also, lerna seems to be the de facto standard: npmtrends.com/release-it-vs-semantic-release-vs-standard-version-vs-lerna-vs-@microsoft/rush
So I'll give this setup a try: yarn + workspaces + lerna + lerna-changelog.
TBH yarn workspaces should be enough. Maybe you didn't try yarn workspaces of version 3. It's so simple and so efficient... Lerna has been deprecated for a while but somebody recently took over and continued the maintenance therefore you can still use it with no issue, but still, I think you can remove complexity here :) . Wanna me to try?
Hi, just passing by again :)
I've been using NX to manage multiple libraries and applications in the same workspace and it works perfectly, with convenient commands ! It works with npm, yarn and you can even integrate lerna.
Using this tool has been a real relief to manage a workspace !
I was suggesting removing complexity not adding some. NX is probably great but being minimalist if the project has no special need can be a plus to improve maintainability.
Besides that I apologize, it was not intended to create a debate that is useless to the core of the project.
I've been using nx in some other projects and I was thinking about using it here as well. It makes development a lot easier, as changes from a library can instantly be seen in the testbed rather than having to recompile the library first.
I've seen, that nx developers took over lerna, but I tend towards not using lerna anymore, as the release process can be done with a simple script, at least from linux: https://github.com/Lusito/tsx-dom/blob/master/release.ts
I'll give this a try soon.
What'll still have to be decided is the automatic changelog creation. Maybe this can be done semi-automatic. I've done something similar recently at work.
Goal: It would be nice to have tooling that supports build/release/publish workflows including good changelogs without requiring a steep learning curve, as that prevents people from contributing.
So there are multiple ways to go about this: