[NPMCLI-25] Local mgnl cli configuration should be used automatically Created: 14/Jul/16 Updated: 22/Aug/16 Resolved: 27/Jul/16 |
|
| Status: | Closed |
| Project: | Magnolia CLI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.1 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Christopher Zimmermann | Assignee: | Federico Grilli |
| Resolution: | Outdated | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| 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: | |||||||||||||||||
| Story Points: | 8 | ||||||||||||||||
| Description |
|
When running the mgnl command, use the mgnl cli config file (i.e., mgnl-config.json) in the current directory or any of its parents. If none exists, then fall back to the global one defined by the MGNLCLI_HOME, or eventually to the global one delivered during the global npm install. Reason: A few possible problematic scenarios:
Some of these are partially mitigated by the helpful INFO message that the CLI gives INFO: MGNLCLI_HOME env variable is set. Using prototypes at /Users/czimmermann/Documents/a-projects/lightdev-lab/mgnl-cli/test4 A description based on this ticket and linked The mgnl CLI is installed globally which means you can now access it in the terminal from any location simply by typing "mgnl". While the CLI is ready to go with sensible defaults, you have the option to customize it to match your needs more closely. For example you can configure what a new component or page contains, which directories are in a new light module, or even which magnolia.properties are set on a new magnolia install. You can easily create the cli configuration files in the current directory with the "mgnl setup" command. This creates the mgnl-config.json file and a directory mgnl-config-prototypes which contains prototypes for the component and page files. Just edit these files to customize how the mgnl cli works. Whenever you run the mgnl cli, it will use the configuration found in the current directory, or any of its parents. For example, you can run "mgnl setup" in the directory that contains your main "light-modules" directory to create the configuration files there - and then whenever you run the cli in any of your modules, your configuration will be used. This also gives you the flexibility to configure the CLI differently for different projects if you need to. |
| Comments |
| Comment by Tomáš Gregovský [ 19/Jul/16 ] |
|
I agree and like solution: "When running the mgnl command, search up the directory tree for the existance of an mgnl cli config file. If none exists, then use the global one. Perhaps an optional simple text file could point to an mgnl cli config to use." |
| Comment by Christopher Zimmermann [ 25/Jul/16 ] |
|
Just noticed that bower CLI has a similiar mechanism of looking for config files up the tree. Maybe its helpful to see their implementation. Also Also |
| Comment by Federico Grilli [ 27/Jul/16 ] |
|
All solved by |