hoodoo-digital / acme

The AEM Component Markup Extractor for generating Storybook stories.
Apache License 2.0
21 stars 5 forks source link

two word components get renamed as hyphen separated #54

Open zmanning29 opened 4 years ago

zmanning29 commented 4 years ago

When running npx acme pull command two name components such as "contentfragment" get renamed as a hyphen separated name like "content-fragment".

zmanning29 commented 4 years ago
Screen Shot 2020-06-22 at 11 28 51 AM Screen Shot 2020-06-22 at 11 29 12 AM Screen Shot 2020-06-22 at 11 29 32 AM
davekenison commented 4 years ago

Also check policies: Policy file name: /policies/contentfragment.json

Reference to the policy in content-fragment.stories.js


    aemStyleSystem: {
      policy: '/policies/content-fragment.json'
    }
  }
davekenison commented 4 years ago

The problem in detail.

acme pulls the policies exactly as they are named in AEM.

When creating the stories, in the part that references the component's policy, acme uses the name of story as the policy name (which comes from the name of the page in AEM). In most cases they match: button.stories.js and /policies/button.json

But sometimes they don't--especially when the component/page is two words: experience-fragment.stores.js and /policies/experiencefragment.json

When generating the stories it would be better to get the actual name of the policy as it is saved in the policies directory and use that.