-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow any 3rd party package manager #15622
Comments
I think it will need two new options
|
This is something I've thought a bit about too, but isn't something that we have settled on an api for yet. I think it's more likely something that we would add plugin support for, via something like: export interface NxPlugin {
// ... other existing extension points
providesPackageManagers: () => Record<string, PackageManager>
} |
Would the plugin work for something like Nx init or create-nx-workspace? Using that API would be lovely though |
It would be something you'd have to configure afterwards, I could see an alternative for create nx workspace or nx init that is just --install-command or something |
@AgentEnder Happy to take a look at this if you want, it be nice and I can use Bun as proof of concept in using it |
So thinking about it. This could be done with nx.json adding a packageManager which supports the current three as a string form then provide a common interface for interacting with package mangers. Just like you have with task runner.
The export for the package would be what you have in package-manager.ts
|
@AgentEnder any thoughts on this? Would love to see this supported. |
@meeroslav is there anything or tasks list you can produce to move package manager to nx/js happy to try and help move it along. Think that's a good idea for repository away from JS |
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
Currently NX supports 3 package managers, npm, yarn and pnpm. This is great however, I think we should allow for any package manager but add a warning to the console log saying something like "You are using a unknown / unsupported package manager"
Motivation
I think they some great tools out there and NX should be agnostic as possible and focus on what it does the best. This would allow community to build great community plugins.
I've been looking at bun support and it would allow use to create workspaces with bun install rather than npm first.
Suggested Implementation
Currently you work on a switch statement, If you try and use one you get the following error
Argument: packageManager, Given: "bun", Choices: "npm", "pnpm", "yarn"
I think it should assume the package manager has an install method and attempt to use package name install
Alternate Implementations
Could add another argument like
npx create-nx-workspace@latest --packageManager bun --packageInstaller install --ignoreScripts
The text was updated successfully, but these errors were encountered: