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

add-availability can be confusing

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None

    Description

      I am building my component right now. At some point I wanted to make it available to a page.

      We spent a good amount of time figuring out how it should work.

      My setup:

      (13:54:07) [robert@tequila-new] ~/magnolia/light-modules $ tree
      .
      ├── mgnl-bobby
      │   ├── LICENSE
      │   ├── README.md
      │   ├── decorations
      │   ├── dialogs
      │   │   ├── components
      │   │   │   └── react-playground.yaml
      │   │   └── pages
      │   ├── i18n
      │   │   └── react-playground-messages_en.properties
      │   ├── package.json
      │   ├── templates
      │   │   ├── components
      │   │   │   ├── react-playground.ftl
      │   │   │   └── react-playground.yaml
      │   │   └── pages
      │   ├── test
      │   └── webresources
      │       ├── css
      │       └── js
      └── parking-lot
          ├── README.md
          ├── decorations
          ├── dialogs
          │   ├── components
          │   └── pages
          │       └── rocko.yaml
          ├── i18n
          │   └── parking-lot-messages_en.properties
          ├── templates
          │   ├── components
          │   └── pages
          │       ├── rocko.ftl
          │       └── rocko.yaml
          └── webresources
              ├── css
              ├── js
              └── prototype.html
      
      25 directories, 13 files
      

      The issue I ran into was:

      Usage: mgnl add-availability <[module-id:]path-to-component>  <path-to-page[@area]> [options]
      
      $ mgnl add-availability mgnl-bobby parking-lot
      INFO: No target area specified, will default to 'main'
      ERR! ERROR: Sorry, path '/Users/robert/magnolia/light-modules' does not seem to point at a valid existing light module folder.
      Path option should point at a valid light module (e.g. one created with mgnl create-light-module). Please, ensure your light module complies with the expected structure.
      See https://documentation.magnolia-cms.com/display/DOCS/Magnolia+CLI#MagnoliaCLI-Lightmoduleminimalfolderstructure
      
      $ mgnl add-availability mgnl-bobby parking-lot -p parking-lot/
      INFO: No target area specified, will default to 'main'
      ERR! parking-lot/templates/pages/parking-lot.yaml page definition doesn't exist
      

      The right command was in the end:

      mgnl add-availability mgnl-bobby:react-playground rocko -p ./parking-lot/
      

      Let's make it easier for users, e.g. by providing a nice example or even a list of available pages.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              rkowalski Robert Kowalski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Task DoD