[NPMCLI-161] "_default" prototypes should not be available via "default" Created: 08/Feb/18 Updated: 16/Apr/20 Resolved: 15/Feb/18 |
|
| Status: | Closed |
| Project: | Magnolia CLI |
| Component/s: | None |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.0.0 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Martin DrĂ¡pela | Assignee: | AntonĂn Juran |
| 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)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Documentation update required: |
Yes
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | CLI v3 | ||||||||
| Sprint: | Kromeriz 134 | ||||||||
| Story Points: | 2 | ||||||||
| Description |
|
The cli treats the "_default" prototypes in a special way, which could lead to confusion or errors. It lists the "_default" prototype directory as "default": Available prototypes are: [default, empty, with-js-model]. It allows the usage without the underscore: > mgnl create-page a3 -P default This is inconsistant to how the other prototuype directories are treated, for no real big benefit. TO change: Available prototypes are: [ _default, empty, with-js-model]. Do not support this usage (user must provide "_default": > mgnl create-page a3 -P default *Original description: * mgnl help create-page (for example) says that: Available prototypes are: [default, empty, with-js-model]. I would expect that the very last mgnl command of the five shown below (together with the output), will produce an error (as does the mgnl create-page a3 -P _empty command) and not build the structure from the _default prototype: > mgnl create-page a1 info Using configuration at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli.json info Using prototypes at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes info No path option provided, page template will be created in the current folder. info Created /home/martin/dev/all-light-modules/clitkt/dialogs/pages/a1.yaml info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a1.ftl info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a1.yaml info Page template created > mgnl create-page a2 -P empty info Using configuration at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli.json info Using prototypes at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes info No path option provided, page template will be created in the current folder. info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a2.ftl info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a2.yaml info Page template created > mgnl create-page a3 -P _empty info Using configuration at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli.json info Using prototypes at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes info No path option provided, page template will be created in the current folder. ERR! /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes/page/_empty doesn't exist. Please ensure that your mgnl-cli-prototypes folder contains prototype with name _empty. > mgnl create-page a4 -P default info Using configuration at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli.json info Using prototypes at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes info No path option provided, page template will be created in the current folder. info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a4.ftl info Created /home/martin/dev/all-light-modules/clitkt/dialogs/pages/a4.yaml info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a4.yaml info Page template created > mgnl create-page a5 -P _default info Using configuration at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli.json info Using prototypes at /home/martin/dev/cli3/npm-cli/lib/config/mgnl-cli-prototypes info No path option provided, page template will be created in the current folder. info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a5.ftl info Created /home/martin/dev/all-light-modules/clitkt/templates/pages/a5.yaml info Created /home/martin/dev/all-light-modules/clitkt/dialogs/pages/a5.yaml info Page template created |
| Comments |
| Comment by Christopher Zimmermann [ 08/Feb/18 ] |
|
I see what you mean. Do you see the current functionality causing problems for developers? |
| Comment by Christopher Zimmermann [ 08/Feb/18 ] |
|
I see it as - the prototype system works based on the directory names. So _default should work since that is the directory name. |