-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: add getCurrentPackageManager #9505
Conversation
|
Thanks for your reply.
you can find that the parcel will install dependencies with yarn. The |
👍
export default function getCurrentPackageManager(
userAgent: ?string = process.env.npm_config_user_agent,
): ?{|name: string, version: string|} {
if (userAgent == null) {
return;
}
|
Thanks for your reply. |
There are some eslint errors in packages/core/package-manager/test/getCurrentPackageManager.test.js |
Thanks for remind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* upstream/v2: (22 commits) Add source map support to the inline-require optimizer (#9511) [Web Extension] Add content script world property to manifest schema validation (#9510) feat: add getCurrentPackageManager (#9505) Default Bundler Contributor Notes (#9488) rename parentAsset to root for msb config and remove unstable (#9486) Macro errors -> v2 (#9501) Statically evaluate constants referenced by macros (#9487) Multiple css bundles in Entry bundle groups issue (#9023) Fix macro issues (#9485) Bump follow-redirects from 1.14.7 to 1.15.4 (#9475) Revert more CI changes to centos job (#9472) Use lightningcss to implement CSS packager (#8492) Fixup CI again (#9471) Clippy and use napi's Either3 (#9047) Upgrade to eslint 8 (#8580) Add support for JS macros (#9299) Fixup REPL CI (#9467) Drop per-pipeline transformation cache (#9459) Upgrade some CI actions (#9466) REPL (#9365) ...
↪️ Pull Request
💻 Examples
my repo is monorepo by pnpm-workspace protocal and is installed with pnpm.
It will create pnpm-lock yaml in root directory.
When I run parcel build with types in subpackage, it will auto install @parcel/transformer-typescript-types with yarn.
I check the source code and find the result is that the library of package manager will detect current package manager by lockfile.
If the current work directory has no lockfile, it will run in ['yarn', 'pnpm', 'npm'] order.
It is not my expect. I want to it works for pnpm.
So I want to add a function named getCurrentPackageManager, it will detect the current package manager with
process.env.npm_config_user_agent
.🚨 Test instructions
✔️ PR Todo