Skip to content

feat: Autodetect npm.packageManager #102050#102494

Merged
alexr00 merged 9 commits intomicrosoft:masterfrom
shivangg:shivangg/feat-npm-auto
Oct 9, 2020
Merged

feat: Autodetect npm.packageManager #102050#102494
alexr00 merged 9 commits intomicrosoft:masterfrom
shivangg:shivangg/feat-npm-auto

Conversation

@shivangg
Copy link
Contributor

@shivangg shivangg commented Jul 14, 2020

This PR fixes #102050

  • npm.packageManager should have auto option and default to it.
  • When auto, check lock file to find preferred package manager.
  • Warn if auto set and multiple lock files found.

@ghost
Copy link

ghost commented Jul 14, 2020

CLA assistant check
All CLA requirements met.

@alexr00 alexr00 self-assigned this Jul 14, 2020
@shivangg shivangg force-pushed the shivangg/feat-npm-auto branch 2 times, most recently from 4370595 to beae5d1 Compare July 19, 2020 22:08
@alexr00 alexr00 self-requested a review July 22, 2020 09:40
@shivangg shivangg marked this pull request as ready for review July 25, 2020 18:04
@shivangg
Copy link
Contributor Author

Hey @alexr00 One of the check is waiting to be reported. Can you help me understand the reason for that.

Also, is this blocking the PR review?

@shivangg shivangg force-pushed the shivangg/feat-npm-auto branch from 3bc8341 to fdbafbe Compare August 16, 2020 14:20
@shivangg
Copy link
Contributor Author

@alexr00 Could you please advise an update on this PR?

@nickserv
Copy link

Looks like there's a merge conflict in tasks.ts

Using default import for minimatch to resolve
`esModuleInterop` conflict
Detects the preferred  package manager
and if multiple are present, warns and uses
in priority order: npm => yarn => pnpm
@shivangg shivangg force-pushed the shivangg/feat-npm-auto branch from fdbafbe to 8a3a76b Compare August 30, 2020 19:42
@shivangg
Copy link
Contributor Author

@nickmccurdy @alexr00 Resolved the merge conflict.

@alexr00 alexr00 added this to the September 2020 milestone Aug 31, 2020
@shivangg
Copy link
Contributor Author

@alexr00 Is something pending on this PR? I'd love to resolve it.

@alexr00
Copy link
Member

alexr00 commented Sep 24, 2020

@shivangg thanks for your patience! I made a some changes to be consistent with the rest of the codebase and for some cleanup. I also have two changes requested from you.

@alexr00 alexr00 modified the milestones: September 2020, October 2020 Sep 25, 2020
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

I addressed the last changes I wanted so that this can be merged.

@alexr00 alexr00 merged commit f8c0e3b into microsoft:master Oct 9, 2020
@shivangg shivangg deleted the shivangg/feat-npm-auto branch October 9, 2020 12:10
@connor4312
Copy link
Member

@alexr00 with this do you think it's reasonable to expose a command for extensions to get the package manager? Previously in js-debug I was using the value of the setting, but this no longer works and the 'auto' resolution is not trivial enough I would want to copy-paste it into js-debug.

image

@alexr00
Copy link
Member

alexr00 commented Oct 21, 2020

@connor4312 exposing a command to get the package manager seems perfectly reasonable. #109071

alexr00 added a commit that referenced this pull request Oct 27, 2020
@alexr00 alexr00 removed this from the October 2020 milestone Oct 27, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 27, 2020

Reverted, we decided not to take on the additional dependencies.

@nickserv
Copy link

Will this feature still be implemented or are you looking for another implementation with less dependencies?

@alexr00
Copy link
Member

alexr00 commented Oct 27, 2020

We have no plans to implement it in any specific time frame, but since it's on the backlog we still want to implement it eventually. You can see our roadmap for the kinds of things we're planning on working on.

@nickserv
Copy link

nickserv commented Oct 27, 2020

In that case, would it be helpful if I recreated this pull request with fewer/no dependencies? I wanted to try it earlier but I'm new to VSCode development, though I think having this as a reference would help me.

@alexr00 alexr00 added this to the November 2020 milestone Nov 2, 2020
alexr00 added a commit that referenced this pull request Nov 2, 2020
Detects the preferred  package manager
and if multiple are present, warns and uses
in priority order: npm => yarn => pnpm
Fixes #102050
Co-authored-by: Alex Ross <[email protected]>
@alexr00
Copy link
Member

alexr00 commented Nov 2, 2020

I have re-merged this PR with bea7673

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
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.

Automatically detect package manager (npm.packageManager)

4 participants