Uploaded image for project: 'Magnolia CLI'
  1. Magnolia CLI
  2. NPMCLI-260

mgnl create-app command must create files complying with naming best practice

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • None

      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)

        Acceptance criteria

              Unassigned Unassigned
              mdrapela Martin Drápela
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:

                  Task DoR