[NPMCLI-260] mgnl create-app command must create files complying with naming best practice Created: 28/May/21  Updated: 01/Jun/22

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

Type: Task Priority: Neutral
Reporter: Martin Drápela Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: headless-team-support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MGNLCT-169 DOC: Document that contenttype names ... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: Content Types phase 2
Story Points: 3

 Description   

With MGNLCT-169, we introduce a best practice for content types:

  • Content type name: singular.
  • App name: plural with "-app" suffix.
  • Workspace name: plural.

However, when using e.g. the CLI  mgnl create-app assets-app command, it creates the following:

├── apps
│   └── assets-app.yaml
├── contentTypes
│   └── assets-app.yaml

Task:

Ensure that the above best practices are followed.

Include tips in the help about expected name.

 

If user enters a name detected to be a plural, Either:

  • rror out and give a hint to use a singular.
  • If possible, automatically convert to the singular and do as described below.

If the user executes the

mgnl create-app <name><pluralMarker>-app

command, the CLI library should do some cropping and create

├── apps
│   └── <name><pluralMarker>-app.yaml
├── contentTypes
│   └── <name>.yaml

 

 

 

Technical Note

Consider using existing npm library to achieve pluralization.

(For example this looks popular https://www.npmjs.com/package/pluralize)


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