[NPMCLI-84] Add "light-module"-placeholder to component/page mgnl-cli-prototypes Created: 27/Jan/17  Updated: 03/Apr/17  Resolved: 09/Mar/17

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

Type: Improvement Priority: Minor
Reporter: Matthias Müller Assignee: Robert Kowalski
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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 86
Story Points: 2

 Description   

Currently create-component and create-page copy the (optionally customized) prototype and replace the containing "__name__" placeholder with the passed name argument. When using customized mgnl-cli-prototypes, a placeholder for the name of the corresponding light module could be useful as well. E.g. for having light-module-relative import paths or adding prefixes/suffixes with the name of the light-module.

The logic for this should currently be in "@magnolia/cli/lib/createComponent.js#65", where only the "_name" placeholder is passed to the _createFromPrototype.create() function.

edit: To avoid ambiguity, it might be a good idea to rename "mgn-cli-prototypes" to "blueprints". I just realized this, when writing this ticket, as "prototype" in magnolia now has two different meanings.



 Comments   
Comment by Christopher Zimmermann [ 09/Feb/17 ]

Recommend something like: light_module_name. (With whatever __ or _ underscore conventions are already used.)

Comment by Robert Kowalski [ 06/Mar/17 ]

the prototypes for "create-page" already use `_lightDevModuleFolder_`

if no one objects i'll reuse it to keep backwards compability and consistency.

Comment by Robert Kowalski [ 06/Mar/17 ]

mmueller what do you think of https://git.magnolia-cms.com/projects/BUILD/repos/npm-cli/commits/8f8a8569244ad9b76586ddc2a471a0f8d82c3f3d ?

Comment by Matthias Müller [ 07/Mar/17 ]

Looks good to me. Other placeholders like templateScript are camelCase as well.

Comment by Robert Kowalski [ 03/Apr/17 ]
 __lightDevModuleFolder__ 

is now rendered in all other templates as well.

added templates:

/page/dialog.yaml
/page/definition.yaml
/component/definition.yaml
/component/template.ftl
/component/dialog.yaml

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