create-keystone-app icon indicating copy to clipboard operation
create-keystone-app copied to clipboard

Don't use yarn internally

Open dcousens opened this issue 2 years ago • 2 comments

this issue was transferred from https://github.com/keystonejs/keystone, but GitHub didn't like how I went from discussion(there)->discussion(here)->issue(this)

Originally posted by RodrigoNovais May 4, 2023 I've run npm init keystone-app to setup a new environment and it's dependencies where installed with yarn without my consent.
Would be polite to ask the developers which manager they want to use.
I only have yarn installed in my machine cause I was obligated to use it in previours jobs and would like to avoid it as much as possible.
Since the dependencies where automatically installed via yarn I don't even know if the CLI can initiate a project in a setup with pure npm.

I don't think this is a matter of consent, as this is open source software - but we don't need to be using yarn specifically either, so it's something we could probably add support for if desired.

@RodrigoNovais pull requests are accepted :yellow_heart:

dcousens avatar May 04 '23 00:05 dcousens

@RodrigoNovais the code falls back to npm if yarn isn't installed.

https://github.com/keystonejs/create-keystone-app/blob/780a3c6f787dba1cc5b36ee2893881fd948ffe0f/create-keystone-app/src/index.ts#L50-L67

You could probably write up something that uses the process.env.npm_config_user_agent to determine what package manager is in use.

dcousens avatar May 04 '23 00:05 dcousens

I may not have been able to communicate correctly. I also think I was pretty rude in my first approach.

I think it would be nice if one of the options occurred:

  • To ask the client which package manager they would like to use
  • To handle the project with the same package manager the CLI was called with

I don't think I'm capable of implementing such thing but I'd like to know your opinion about it

RodrigoNovais avatar May 04 '23 05:05 RodrigoNovais