[NPMCLI-148] Prototypes for create-light-module Created: 11/Dec/17  Updated: 14/Feb/18  Resolved: 31/Jan/18

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.0

Type: New Feature 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:
dependency
depends upon NPMCLI-86 Add ability to generate additional fi... Closed
is depended upon by NPMCLI-152 Script to migrate prototypes to versi... Closed
is depended upon by NPMCLI-154 Add upgrade notice about incompatible... Closed
is depended upon by NPMCLI-140 create-light-module should create the... Open
Template:
Acceptance criteria:
Empty
Documentation update required:
Yes
Date of First Response:
Epic Link: CLI v3
Sprint: Kromeriz 132
Story Points: 8

 Description   

Prototypes for the

{create-light-module} command should be providable via the same system as the other create commands.
It would be useful to have multiple prototypes, and user-defined prototypes for modules.

With the new flexible prototype system, its straightforward to support multiple prototypes for each create command. The only create command not using the system is the {create-light-module}

command.

Also consider what to do with "lightDevFoldersInModule" section from mgnl-cli.json. Left as is? renamed? Removed?



 Comments   
Comment by Christopher Zimmermann [ 29/Jan/18 ]

Add another prototype that pre-creates all of the directories that one might want:
Maybe call it "comprehensive"?

apps (new)
blocks (new)
decorations
dialogs
messageViews (new)
i18n
includes (new)
restEndpoints (new)
templates
themes (new)
virtualUriMappings (new)
webresources

Leave out the following things which cannot be usefully created with light development alone.

  • fieldTypes
  • renderers
  • workItemHandlers

In the "includes" directory, include this README.txt:

As a best practice, place YAML files here that do not represent full definitions, but are included by the definition files. 
This prevents the problem where Magnolia tries to interpret an include file as a definition and ends up reporting that the file has problems.
Comment by Roman Kovařík [ 31/Jan/18 ]

mgnl create-light-module -p light-modules/LM

ERR! Path /Users/romankovarik/git/npm-cli/light-modules/LM does not exist. Please fix it or create it first

Shouldn't it create the folder automatically?

Comment by Jaroslav Simak [ 31/Jan/18 ]

Afaict it shouldn't, -p is path to the light-modules root folder.

    -p, --path <path>       The path to the light modules root folder. If no path is provided, then the current directory is assumed to be the light modules root folder and the module will be created here.
Comment by Roman Kovařík [ 31/Jan/18 ]

Ok so it expects to create/move to the light module first. Then isn't the parameter -p redundant, since you need to be in the folder anyway?
Maybe I don't get the use case.

Comment by Jaroslav Simak [ 31/Jan/18 ]

Ok so it expects to create/move to the light module first. Then isn't the parameter -p redundant, since you need to be in the folder anyway?

No, you don't have to create light module folder first, just specify the name of light module, for example:
mgnl create-light-module foobar -p /path/to/my/modules/directory/that/is/observed/by/magnolia - this will create new foobar light module in the directory passed in the -p parameter
or
mgnl create-light-module foobar - this will create new foobar light module in the current directory.

Comment by Roman Kovařík [ 31/Jan/18 ]

ok now I get it, thx

Generated at Mon Feb 12 04:46:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.