dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
26 stars 34 forks source link

Eject command - refs #44 #89

Closed jdonaghue closed 7 years ago

jdonaghue commented 7 years ago

Putting this out now for initial review. The basic idea is that each command will optionally implement an eject method. The base cli will call into that eject method with two helpers npm and files which respectively add to the current projects package.json and copies important files over to the current project.

npm is capable of assigning dependencies, devDependencies, and scripts to the current projects package.json. It will run npm install after it has finished assignments but only if there were no collisions.

files takes an array of fully-qualified file paths and copies them into the current project creating the necessary folders to do so, as long as there are no collisions.

Keep in mind this is still a WIP and needs better collision checking/messaging as well as a prompt to ensure the user understands the finality of this commands execution.

It can be run in the following way:

Also, tests are still needed.

codecov-io commented 7 years ago

Codecov Report

Merging #89 into master will increase coverage by 0.21%.

@@            Coverage Diff             @@
##           master      #89      +/-   ##
==========================================
+ Coverage   99.24%   99.45%   +0.21%     
==========================================
  Files          12       15       +3     
  Lines         264      368     +104     
  Branches       23       43      +20     
==========================================
+ Hits          262      366     +104     
  Partials        2        2
Impacted Files Coverage Δ
src/npmInstall.ts 100% <100%> (ø)
src/commands/eject.ts 100% <100%> (ø)
src/bin/dojo.ts 100% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f70f43...eab70b1. Read the comment docs.

jdonaghue commented 7 years ago

@Tomdye thanks for the review! I will make these changes today

agubler commented 7 years ago

@jdonaghue how are these updates coming?

jdonaghue commented 7 years ago

@tomdye I have changed the npm helper to use reduce

agubler commented 7 years ago

@jdonaghue this now has a conflict in src/interfaces.ts, I would imagine as a result of #85 having been merged.

jdonaghue commented 7 years ago

OK @agubler thanks I will resolve the conflict today.