Skip to content

fix(config-lerna-scopes): remove deprecated @lerna/project dependency#4284

Merged
escapedcat merged 1 commit intoconventional-changelog:masterfrom
janbiasi:fix/update-config-lerna-scopes
Mar 5, 2025
Merged

fix(config-lerna-scopes): remove deprecated @lerna/project dependency#4284
escapedcat merged 1 commit intoconventional-changelog:masterfrom
janbiasi:fix/update-config-lerna-scopes

Conversation

@janbiasi
Copy link
Copy Markdown
Contributor

@janbiasi janbiasi commented Feb 16, 2025

Prerequisites

Description

Please see the long explanation in #4262

Motivation and Context

Solves vulnerability issues and removes deprecated peer dependency requirement.

Usage examples

No changes

How Has This Been Tested?

Unit tests within the project

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Feb 16, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@escapedcat
Copy link
Copy Markdown
Member

Is this a breaking change for anyone who is using lerna below v8?

@janbiasi
Copy link
Copy Markdown
Contributor Author

janbiasi commented Feb 18, 2025

Is this a breaking change for anyone who is using lerna below v8?

Yes, it will be a breaking change for lerna < 8.2.0 - I've added the necessary commit body in 22f0930

edit: sadly it's < 8.2.0 as the change within lerna was required

@janbiasi
Copy link
Copy Markdown
Contributor Author

@escapedcat By looking at the current config-pnpm-scopes implementation, I thought that I could copy it's implementation and adapt it to the lerna config schema. This way, we could support all lerna repositories which have the packages defined within lerna.json and wouldn't need to rely on the lerna package itself (= no breaking change). Additionally, we could implement an error if we detect no packages configuration and inform the user to use config-workspace-scopes in that case.

Would this be a better option? Let me know what you think.

@escapedcat
Copy link
Copy Markdown
Member

tbh I don't mind a breaking change. On the other hand it has 26k weekly downloads. So people might still use it with an older lerna version? If that's feasible and not too much work for you.

@janbiasi janbiasi force-pushed the fix/update-config-lerna-scopes branch 3 times, most recently from f412600 to f88e039 Compare February 26, 2025 07:32
Comment thread @commitlint/config-lerna-scopes/index.js
@janbiasi janbiasi marked this pull request as ready for review February 26, 2025 07:50
@janbiasi janbiasi force-pushed the fix/update-config-lerna-scopes branch 3 times, most recently from 2deda6d to f265215 Compare February 28, 2025 01:27
@janbiasi
Copy link
Copy Markdown
Contributor Author

@escapedcat the PR is ready for review and now contains full backwards compatibility with an informational hint that users who are actively using native workspaces should transition to the previously introduced @commitlint/config-workspace-scopes package, but we still resolve the packages via the other config plugin. This means we could drop the support in a later stage 😄

I also updated the documentation to reflect the change and include the hint as well.

@escapedcat
Copy link
Copy Markdown
Member

Thanks @janbiasi ! Amazing work
One more rebase please :)

@janbiasi janbiasi force-pushed the fix/update-config-lerna-scopes branch from f265215 to 7a6902f Compare March 4, 2025 18:47
@janbiasi
Copy link
Copy Markdown
Contributor Author

janbiasi commented Mar 4, 2025

@escapedcat done :)

@escapedcat escapedcat merged commit f2f78f1 into conventional-changelog:master Mar 5, 2025
@escapedcat
Copy link
Copy Markdown
Member

Running into an issue that I think I've seen before when I tried to update lerna.

You got any idea how to solve this?

Using node 18.20.7 locally

yarn run publish
yarn run v1.22.22
$ lerna publish --conventional-commits
lerna notice cli v8.2.1
lerna ERR!     MultipleProjectsWithSameNameError: The following projects are defined in multiple locations:
lerna ERR!   - a:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/basic/nx/a
lerna ERR!     - nx/a
lerna ERR!   - b:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/basic/nx/b
lerna ERR!     - nx/b
lerna ERR!   - c:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx14/nx/c
lerna ERR!     - nx/c
lerna ERR!   - d:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx14/nx/d
lerna ERR!     - nx/d
lerna ERR!   - e:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx15/nx/e
lerna ERR!     - nx/e
lerna ERR!   - f:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx15/nx/f
lerna ERR!     - nx/f
lerna ERR!   - g:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx17/nx/g
lerna ERR!     - nx/g
lerna ERR!   - h:
lerna ERR!     - @commitlint/config-nx-scopes/fixtures/nx17/nx/h
lerna ERR!     - nx/h
lerna ERR!
lerna ERR!   To fix this, set a unique name for each project in a project.json inside the project's root. If the project does not currently have a project.json, you can create one that contains only a name.
lerna ERR!       at validateAndNormalizeProjectRootMap (/Users/user/data/src/commitlint/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:455:15)
lerna ERR!       at mergeCreateNodesResults (/Users/user/data/src/commitlint/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:341:9)
lerna ERR!       at /Users/user/data/src/commitlint/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:285:85
lerna ERR!       at async buildProjectGraphAndSourceMapsWithoutDaemon (/Users/user/data/src/commitlint/node_modules/nx/src/project-graph/project-graph.js:87:31)
lerna ERR!       at async createProjectGraphAndSourceMapsAsync (/Users/user/data/src/commitlint/node_modules/nx/src/project-graph/project-graph.js:271:25)
lerna ERR!       at async createProjectGraphAsync (/Users/user/data/src/commitlint/node_modules/nx/src/project-graph/project-graph.js:219:39)
lerna ERR!       at async detectProjects (/Users/user/data/src/commitlint/node_modules/lerna/dist/index.js:3000:25)
lerna ERR! lerna Failed to process project graph.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@janbiasi
Copy link
Copy Markdown
Contributor Author

janbiasi commented Mar 5, 2025

@escapedcat I'm not too familiar with NX, but it seems like that the fixtures are duplicated packages in terms of how NX resolves or identifies packages (via nx config file and package.json).

You could try to disable nx usage within the lerna.json, but the better way would be to ignore any fixtures packages in the root repository. I'll also take a look at this issue later this week.

@escapedcat
Copy link
Copy Markdown
Member

No worries, not in a rush here. Could also tag the nx related person in here.
Would be nice if you can a look if you find time.

@janbiasi
Copy link
Copy Markdown
Contributor Author

janbiasi commented Mar 7, 2025

@escapedcat I think I found a solution, but I'm not 100% sure if it doesn't brick something else; if we add an .nxignore file in the project root it can exclude the fixtures, like this:

# Having fixtures with a package.json and project.json leads to a duplicate package resolution issue.
# see https://github.com/nrwl/nx/issues/20959
@commitlint/*/fixtures/**

Tested the change with npx nx show projects, it also seems that all tests are still passing 😸

Relates to nrwl/nx#20959

@escapedcat
Copy link
Copy Markdown
Member

You mean like this?
#4313

@janbiasi
Copy link
Copy Markdown
Contributor Author

janbiasi commented Mar 7, 2025

You mean like this? #4313

@escapedcat Yes, looks good to me :)

@escapedcat
Copy link
Copy Markdown
Member

https://github.com/conventional-changelog/commitlint/releases/tag/v19.8.0

immxmmi pushed a commit to immxmmi/gitea-helm-actions that referenced this pull request Apr 20, 2026
This PR contains the following updates:

| Package | Type | Update | Change | Age | Confidence |
|---|---|---|---|---|---|
| [alpine/helm](https://github.com/alpine-docker/helm) ([changelog](https://github.com/helm/helm)) |  | minor | `3.17.1` -> `3.19.0` | [![age](https://developer.mend.io/api/mc/badges/age/docker/alpine%2fhelm/3.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/alpine%2fhelm/3.17.1/3.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [alpine/helm](https://github.com/alpine-docker/helm) ([changelog](https://github.com/helm/helm)) | container | minor | `3.17.1` -> `3.19.0` | [![age](https://developer.mend.io/api/mc/badges/age/docker/alpine%2fhelm/3.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/alpine%2fhelm/3.17.1/3.19.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | container | minor | `19.7.1` -> `19.9.1` | [![age](https://developer.mend.io/api/mc/badges/age/docker/commitlint%2fcommitlint/19.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/docker/commitlint%2fcommitlint/19.7.1/19.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) | devDependencies | minor | [`^0.44.0` -> `^0.45.0`](https://renovatebot.com/diffs/npm/markdownlint-cli/0.44.0/0.45.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/markdownlint-cli/0.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/markdownlint-cli/0.44.0/0.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>conventional-changelog/commitlint (commitlint/commitlint)</summary>

### [`v19.9.1`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#1991-2025-08-29)

[Compare Source](conventional-changelog/commitlint@v19.9.0...v19.9.1)

##### Bug Fixes

- add TypeScript support and configuration for pnpm scopes ([#&#8203;4544](conventional-changelog/commitlint#4544)) ([ea75778](conventional-changelog/commitlint@ea75778))

### [`v19.9.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#1990-2025-08-26)

[Compare Source](conventional-changelog/commitlint@v19.8.1...v19.9.0)

##### Bug Fixes

- update dependency jest-environment-node to v30 ([#&#8203;4448](conventional-changelog/commitlint#4448)) ([42ca849](conventional-changelog/commitlint@42ca849))
- update dependency jest-environment-node to v30.0.2 ([#&#8203;4469](conventional-changelog/commitlint#4469)) ([4da7e43](conventional-changelog/commitlint@4da7e43))
- update dependency tar-fs to v3.0.10 ([#&#8203;4461](conventional-changelog/commitlint#4461)) ([f02c47c](conventional-changelog/commitlint@f02c47c))
- update dependency tar-fs to v3.0.9 ([#&#8203;4421](conventional-changelog/commitlint#4421)) ([0650e03](conventional-changelog/commitlint@0650e03))
- update dependency tar-fs to v3.1.0 ([#&#8203;4496](conventional-changelog/commitlint#4496)) ([31b4f72](conventional-changelog/commitlint@31b4f72))

##### Features

- **config-pnpm-scopes:** migrate package to TypeScript ([#&#8203;4541](conventional-changelog/commitlint#4541)) ([6ae36ea](conventional-changelog/commitlint@6ae36ea))

##### Reverts

- Revert "chore: update dependency cross-env to v10 ([#&#8203;4528](conventional-changelog/commitlint#4528))" ([#&#8203;4529](conventional-changelog/commitlint#4529)) ([b5bfd12](conventional-changelog/commitlint@b5bfd12)), closes [#&#8203;4528](conventional-changelog/commitlint#4528) [#&#8203;4529](conventional-changelog/commitlint#4529)

#### [19.8.1](conventional-changelog/commitlint@v19.8.0...v19.8.1) (2025-05-08)

##### Bug Fixes

- update dependency tinyexec to v1 ([#&#8203;4332](conventional-changelog/commitlint#4332)) ([e49449f](conventional-changelog/commitlint@e49449f))
- update dependency tinyexec to v1.0.1 ([#&#8203;4347](conventional-changelog/commitlint#4347)) ([c1b26d1](conventional-changelog/commitlint@c1b26d1))

##### Performance Improvements

- **rules:** optimize header-trim ([#&#8203;4363](conventional-changelog/commitlint#4363)) ([b7e404b](conventional-changelog/commitlint@b7e404b))

### [`v19.8.1`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#1981-2025-05-08)

[Compare Source](conventional-changelog/commitlint@v19.8.0...v19.8.1)

##### Bug Fixes

- update dependency tinyexec to v1 ([#&#8203;4332](conventional-changelog/commitlint#4332)) ([e49449f](conventional-changelog/commitlint@e49449f))
- update dependency tinyexec to v1.0.1 ([#&#8203;4347](conventional-changelog/commitlint#4347)) ([c1b26d1](conventional-changelog/commitlint@c1b26d1))

##### Performance Improvements

- **rules:** optimize header-trim ([#&#8203;4363](conventional-changelog/commitlint#4363)) ([b7e404b](conventional-changelog/commitlint@b7e404b))

### [`v19.8.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#1980-2025-03-07)

[Compare Source](conventional-changelog/commitlint@v19.7.1...v19.8.0)

##### Bug Fixes

- **config-lerna-scopes:** remove deprecated [@&#8203;lerna/project](https://github.com/lerna/project) dependency ([#&#8203;4284](conventional-changelog/commitlint#4284)) ([f2f78f1](conventional-changelog/commitlint@f2f78f1))
- update dependency semver to v7.7.1 ([#&#8203;4272](conventional-changelog/commitlint#4272)) ([6148587](conventional-changelog/commitlint@6148587))

##### Features

- **config-workspace-scopes:** add config preset for npm and yarn workspaces ([#&#8203;4269](conventional-changelog/commitlint#4269)) ([67ff9e8](conventional-changelog/commitlint@67ff9e8))

##### Performance Improvements

- use `node:` prefix to bypass require.cache call for builtins ([#&#8203;4302](conventional-changelog/commitlint#4302)) ([0cd8f41](conventional-changelog/commitlint@0cd8f41))

##### Reverts

- Revert "fix: improve security validation regex in is-ignored function ([#&#8203;4258](conventional-changelog/commitlint#4258))" ([#&#8203;4314](conventional-changelog/commitlint#4314)) ([b27024a](conventional-changelog/commitlint@b27024a)), closes [#&#8203;4258](conventional-changelog/commitlint#4258) [#&#8203;4314](conventional-changelog/commitlint#4314)

#### [19.7.1](conventional-changelog/commitlint@v19.7.0...v19.7.1) (2025-02-02)

##### Bug Fixes

- **config-nx-scopes:** fix for projects without explicit targets ([#&#8203;4261](conventional-changelog/commitlint#4261)) ([25bb2cd](conventional-changelog/commitlint@25bb2cd))
- improve security validation regex in is-ignored function ([#&#8203;4258](conventional-changelog/commitlint#4258)) ([7403d63](conventional-changelog/commitlint@7403d63))
- update dependency fast-glob to v3.3.3 ([#&#8203;4235](conventional-changelog/commitlint#4235)) ([c286237](conventional-changelog/commitlint@c286237))
- update dependency fs-extra to v11.3.0 ([#&#8203;4249](conventional-changelog/commitlint#4249)) ([39acfe4](conventional-changelog/commitlint@39acfe4))
- update dependency tar-fs to v3.0.7 ([#&#8203;4243](conventional-changelog/commitlint#4243)) ([708320f](conventional-changelog/commitlint@708320f))
- update dependency tar-fs to v3.0.8 ([#&#8203;4247](conventional-changelog/commitlint#4247)) ([ecb5d3a](conventional-changelog/commitlint@ecb5d3a))

</details>

<details>
<summary>igorshubovych/markdownlint-cli (markdownlint-cli)</summary>

### [`v0.45.0`](https://github.com/igorshubovych/markdownlint-cli/releases/tag/v0.45.0)

[Compare Source](igorshubovych/markdownlint-cli@v0.44.0...v0.45.0)

- Update `markdownlint` dependency to `0.38.0`
  - Add `MD059`/`descriptive-link-text`
  - Improve `MD025`/`MD027`/`MD036`/`MD038`/`MD041`/`MD043`/`MD045`/`MD051`/`MD052`
  - Remove support for end-of-life Node version 18
- Update all dependencies via `Dependabot`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xOC4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsia2luZC9kZXBlbmRlbmN5Il19-->

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/64
Reviewed-by: DaanSelen <daanselen@noreply.gitea.com>
Co-authored-by: Renovate Bot <renovate-bot@gitea.com>
Co-committed-by: Renovate Bot <renovate-bot@gitea.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants