Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current state of @commitlint/config-lerna-scopes #4262

Open
janbiasi opened this issue Jan 29, 2025 · 3 comments
Open

Current state of @commitlint/config-lerna-scopes #4262

janbiasi opened this issue Jan 29, 2025 · 3 comments

Comments

@janbiasi
Copy link
Contributor

janbiasi commented Jan 29, 2025

Hey!

Currently, the @commitlint/config-lerna-scopes depends on the deprecated @lerna/project which is not maintained, nor does it exist anymore. I'd be willing to contribute to the package to make the deprecated dependency an optional peer dependency, however a few thoughts crossed my mind which I'd want to discuss before investing time;

  • Wouldn't it be a good idea to split the config-workspace-scopes into a separate package - with no dependencies - for the users who only need support for workspaces in package.json?
  • What is your policy regarding backwards compatibility? I saw that the current implementation even implements support for v3 and lower which correlate to Node.js v6.x & v8.x (support ended on 31st of December 2019, also no commercial support available).
  • With Lerna v5 they set the default mode for package resolution to the package.json workspaces field, so most of the users transitioned to them
  • After the takeover from nrwl the project got into a pretty messy phase without really stable APIs as they proxied most of the internal work to nx and I wasn't able to find a reliable way in each version on how to retrieve them safely
  • With v7.1.0 they re-introduced a detectProjects method which allows to programmatically retrieve the project graph, this is also still present in v8. However most of the users already have transitioned to nx because of the state of the project.

My summary as well as proposal would be:

  • Create a config-workspace-scopes for those who are only using yarn or npm workspaces with the existing logic part from the lerna config
  • Drop support for lerna < 7.1.0, get rid of the deprecated @lerna/project and use their "new" API to retrieve the packages

I'm looking forward to your feedback and thoughts on this topic!

*edited to fix misspelled words

@escapedcat
Copy link
Member

Hey @janbiasi , thanks for opening this up and your write up and proposal! ❤

The current lerna state isn't intended and kinda unwanted. We got stuck here because I'm lacking time and motivation to update commitlint itself to a new/updated monorepo setup.

I'm more than happy if you want to try out your proposal.

@janbiasi
Copy link
Contributor Author

janbiasi commented Feb 3, 2025

Hey @escapedcat 👋🏽 thanks for your fast response! I'll start with my work today and keep this issue updated regarding my progress. Below are links to the PRs as soon as they're drafted:

@janbiasi
Copy link
Contributor Author

janbiasi commented Feb 15, 2025

Update: I'm currently blocked by lerna not allowing to specify a custom cwd within detectProjects (see code). I've opened a PR to allow passing a custom cwd which should allow me to finalize the PR for config-lerna-scopes:

@escapedcat The PR for the workspace scopes is already ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants