[NPMCLI-119] Multiple prototypes for creating pages and components Created: 17/Mar/17 Updated: 14/Feb/18 Resolved: 29/Nov/17 |
|
| Status: | Closed |
| Project: | Magnolia CLI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.0.0 |
| Type: | Story | Priority: | Neutral |
| Reporter: | Christopher Zimmermann | Assignee: | Jaroslav Simak |
| Resolution: | Fixed | 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)
|
||||||||
| Documentation update required: |
Yes
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | CLI v3 | ||||||||
| Sprint: | Kromeriz 123, Kromeriz 124 | ||||||||
| Story Points: | 5 | ||||||||
| Description |
|
Option to define multiple 'prototypes' (currently there is one for page and one for component) and then be able to create new page or component from (optionally) given template. still use default one if there is no attribute. Current default component template with 5-6 most used fields is super useful, but sometimes I am missing option to create empty component without dialog. simply just component definition and empty ftl... maybe command like: mgnl create-component something --prototype empty To specify: Note - eventually it would also be nice to have a prototype for light-modules, but that can come later. Implemented as: Structure becomes: – mgnl-cli-prototypes +--- components +----- _default +------- definition.yaml +------- dialog.yaml +------- template.ftl +----- empty +------- definition.yaml +------- dialog.yaml +------- template.ftl +--- pages ... |
| Comments |
| Comment by Robert Kowalski [ 20/Mar/17 ] |
|
i think `--prototype $path-to-folder-with-prototype` is a good modifier to specify a custom prototype |
| Comment by Christopher Zimmermann [ 21/Mar/17 ] |
|
Prototypes live in the mgnl-cli-prototypes directory. I dont have to specify a path to there right? I am assuming that each prototype is just a directory in that mgnl-cli-prototypes directory. So i expect that I just give the name of the prototype. |
| Comment by Christopher Zimmermann [ 21/Mar/17 ] |
|
Also would be nice to have an alias. "-pr"? "-pro" |
| Comment by Christopher Zimmermann [ 21/Mar/17 ] |
|
By default (- or maybe configurabel in the cli config file?) the "page" and "component" prototypes are used. |
| Comment by Christopher Zimmermann [ 22/Mar/17 ] |
|
What will the mgnl-cli-prototypes directory look like once there are a few of these? Also I can imagine that eventually we would have more types of them - maybe even a prototype for light-modules. |
| Comment by Tomáš Gregovský [ 23/Mar/17 ] |
|
– mgnl-cli-prototypes or – mgnl-cli-prototypes in case of prototype for light module, I would go for 'light-module' folder as a sibling of component and page |
| Comment by Christopher Zimmermann [ 26/Jun/17 ] |
|
Reopening because the prototypes directory could get cluttered if people dont name things correctly. And if they do name things correctly - then they have to enter a long name to specify their prototype. create-component myComp -P component-empty To change:
This is a breaking change which will require a major version and a helpful warning message if people have modified the prototypes. (ie if they have the old prototype structure in their project) Structure becomes: – mgnl-cli-prototypes |
| Comment by Christopher Zimmermann [ 21/Nov/17 ] |
|
setting fix vesion to 3 because this will be a breaking change - any prototypes that users had created will no longer be valid - user will need to migrate them. |