ember-cli icon indicating copy to clipboard operation
ember-cli copied to clipboard

Refactor npm/yarn invocations

Open Turbo87 opened this issue 8 years ago • 4 comments

We currently have at least three areas of code where npm (and yarn) are used to install dependencies:

  • ember install (and ember new, ember addon and ember init) via NpmInstallTask class
  • Blueprint.addPackagesToProject()
  • InstallBlueprintTask class if the blueprint comes from npm (see #6789)

We should try to refactor those code paths to reduce the duplication and use the same code underneath. In the same refactoring the InstallBlueprintTask class needs to be taught about yarn.

see also https://github.com/ember-cli/ember-cli/issues/6784

Turbo87 avatar Feb 20 '17 07:02 Turbo87

Don't forget about our test helper which was intended to abstract away these differences: https://github.com/ember-cli/ember-cli/blob/master/tests/helpers/package-cache.js

rwjblue avatar Feb 20 '17 12:02 rwjblue

is there anyone working on this ?

g13013 avatar May 05 '17 11:05 g13013

I’m looking into this, hopefully I can come up with something šŸ™‹ā€ā™‚ļø

gnclmorais avatar Jan 23 '22 20:01 gnclmorais

Hey team! I started working on it (progress at https://github.com/ember-cli/ember-cli/pull/9789) but got to the point where I would like to know/brainstorm exactly where do we want to take this. What is the ideal outcome of it? How much refactor/DRYness do we want in the code? How much abstraction do we want for install and etc.? Thanks in advance šŸ™‡ā€ā™‚ļø

gnclmorais avatar Feb 18 '22 16:02 gnclmorais