[NPMCLI-10] Refactor initial code Created: 14/Apr/16 Updated: 22/Aug/16 Resolved: 13/May/16 |
|
| Status: | Closed |
| Project: | Magnolia CLI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.1 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Jan Haderka | Assignee: | Federico Grilli |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | mh5371, npm | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 6d 3h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||
| Sprint: | Basel 43 | ||||||||||||||||||||||||
| Story Points: | 13 | ||||||||||||||||||||||||
| Description |
|
Refactor code originally contributed by Tomáš Gregovský. Based on the comments below and in attached concept page:
This way internals of the cli will stay hidden by default, but can be still exposed via setup for those who need to have multiple different types of prototypes and other configuration for multiple different projects. If in doubt, check the concept page or consult w/ reporter. |
| Comments |
| Comment by Tomáš Gregovský [ 18/Apr/16 ] |
|
After discussion with Jan, we suggest to try to do global installation of cli and then have a command like setup-project etc.. which will always in selected <workingDirectory> create files needed for CLItoolign (package.json, _prototype, readme.md ,...). |
| Comment by Tomáš Gregovský [ 20/Apr/16 ] |
In case of global installation of cli, they will be updated (if user run update / new installation of cli). to rest of had's comment/question I completely agree having prototypes and (part) of package json removed from "global" one and placed into project folder, to be able to have modifications specific for each project. so, using some kind of setup. I believe it is doable form current status, and will be really nice to have it working this way. Thanks! |
| Comment by Tomáš Gregovský [ 20/Apr/16 ] |
but then you don't even see what's are defaults... (mostly for configuration in package.json) |
| Comment by Jan Haderka [ 20/Apr/16 ] |
|
| Comment by Federico Grilli [ 20/Apr/16 ] |
|
tgregovsky Well, that would be self-documented by the subcommand itself (besides possibly being in our doc website). For instance, you run mgnl setup -h and you get something like
Usage: mgnl setup [options]
This command does this and that...
Options:
-h, --help output usage information
-V, --version output the version number
-f, --fancy--option ...
|
| Comment by Christopher Zimmermann [ 10/May/16 ] |
|
The self-documentation is great. Just details, but I would change: jumpstart to "Download and prepare Magnolia for light development" Usage instructions should not include "mgnl-jumpstart", but "mgnl". |
| Comment by Christopher Zimmermann [ 10/May/16 ] |
|
When i run "setup" command, I dont get the original package.json, I get the npm processed one, which is hard to read. Is that intended? I would have expected the original one. |
| Comment by Federico Grilli [ 11/May/16 ] |
Unfortunately that is provided by commander package and cannot be changed easily. What I can do is making the descriptions of our commands consistent with this one by making first letter lowercase, e.g. "download and prepare Magnolia for light development"
Again that comes from the commander package and cannot be changed.
Weird, I get a non processed one. Maybe depends on how you installed the cli tools? I created the tgz file with npm pack and then did sudo npm install magnolia-cli-0.0.1-snapshot.tgz -g |
| Comment by Christopher Zimmermann [ 11/May/16 ] |
|
I think that the package.json is getting processed like that in another step. Maybe it's not avoidable. |