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

feat: npm workspaces #21274

Merged
merged 37 commits into from Apr 27, 2023
Merged

Conversation

RahulGautamSingh
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh commented Mar 31, 2023

Changes

  • Added functionality to detect workspaces and root dependencies, divide them and install them separately
  • Current code works like this:
    1. If workspaces present

      • divide them into two categories : workspace and root
      • make sure there are no duplicates in root & filter out deps from workspace that are present in root
      • update workspace deps first using --workspace=<worksapceName> option
      • update the root deps

      This is a test implementation that gets the job done. It still needs some refactoring, dividing into functions and tests and better comments...will add/modify them once we agree on the implementation

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

lib/modules/manager/npm/extract/monorepo.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems ok to move ahead with, assuming it fixes the reproduction repos

@RahulGautamSingh RahulGautamSingh marked this pull request as ready for review April 6, 2023 18:54
@RahulGautamSingh RahulGautamSingh marked this pull request as draft April 6, 2023 19:24
use workspaceDir instead of comparing packgaeFileDir to lockFileDir as lockFileDir will be . when lockFile is in root folder but packageFileDir is an `(empty string)
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
lib/modules/manager/npm/post-update/npm.ts Outdated Show resolved Hide resolved
RahulGautamSingh and others added 2 commits April 14, 2023 16:39
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
RahulGautamSingh and others added 3 commits April 14, 2023 17:51
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞 should be heavily testes on teal repos

@rarkins rarkins enabled auto-merge April 17, 2023 06:16
@rarkins rarkins added this pull request to the merge queue Apr 27, 2023
Merged via the queue into renovatebot:main with commit 012c0ac Apr 27, 2023
11 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 35.63.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

mjunker pushed a commit to mjunker/renovate that referenced this pull request May 17, 2023
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm install should be scoped to workspaces
5 participants