adobe-rnd / aem-boilerplate-xwalk

Use this repository template for new AEM XWalk projects.
https://main--aem-boilerplate-xwalk--adobe-rnd.aem.page
Apache License 2.0
20 stars 25 forks source link

feat: simplify and split models/definition/filters files #30

Closed buuhuu closed 3 weeks ago

buuhuu commented 2 months ago

Each block now has a _component.json partial with a json object that contains definitions, models and filters. Each of them is an array as a block may expose 0..n of either of them. The default content model partials are now stored in models/ as well as the partials for component-models.json, component-definition.json and component-filters.json. The file name format with the leading _ was inspired by sass partials (files that are meant to be imported into other files).

Besides that this commit adds husky pre-commit hook support, with a simple hook that merges the models/definition/filters files if any of the partials changed.

aem-code-sync[bot] commented 2 months ago

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed. In case there are problems, just click a checkbox below to rerun the respective action.

Commits * [de608bd](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/de608bda65338a2783d997c7295aac37f5965c55) :white_check_mark: (latest) * [6e991dd](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/6e991dd3e8a723354fe05ca2be965568e607d8eb) :white_check_mark: * [42f585a](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/42f585a8831f53a9f49c94b0e7919aed7d282d43) :white_check_mark: * [9a8c5b2](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/9a8c5b277daa2da926b5f6a9d29fc0c26f5380cc) :white_check_mark: * [17aa961](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/17aa9613a9432438a08c9239568f638587d9eaab) :white_check_mark: * [285ed1b](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/285ed1b1a7ccd93c5f841854347d2b468abbaabd) :white_check_mark: * [c06150e](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/c06150ee82a92521375aae5c7c7c469ec5bd00d9) :white_check_mark: * [55b574a](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/55b574ab506eff35871c7dfa89e77a0fade5e8d4) :white_check_mark: * [0add6d5](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/0add6d522a6c1e37ead90fe1cacb2431523a6565) :white_check_mark: * [39b2f42](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/39b2f426323c3c6d861215c3c65d8b0d29041051) :white_check_mark: * [fc58d5d](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/fc58d5d4ba4590b8188bdf09382590c75eb62485) :white_check_mark: * [3b13fa6](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/3b13fa66a872edcf61a0b3200adddfd5a6bf0566) :white_check_mark: * [62f8e31](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/62f8e31f06c0d9095efce8694fba544de9b08071) :white_check_mark: * [dc170f1](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/dc170f10910b4e6d11cb64e9f68bc09a2e25452e) :white_check_mark: * [a9b2b01](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/a9b2b01c6bced51a12dac2418518fb011a6d9726) :white_check_mark: * [b3e48fa](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/b3e48faa1516ab05fb1eadb7908bdfbedf6e0e2a) :white_check_mark: * [959230e](https://github.com/adobe-rnd/aem-boilerplate-xwalk/commit/959230eb1782e81042c066006844e091ae62bb03) :white_check_mark:
jckautzmann commented 1 month ago

A few suggestions:

buuhuu commented 1 month ago

@jckautzmann

I’d rename blocks/cards/_component.json to blocks/cards/_cards.json to be consistent with models/_button.json

Very good suggestion as this allows

I’d rename component-definition.json and _component-definition.json that would be a breaking change which I would not want to do now. I agree though.

clementepereyra commented 1 month ago

Hi all, Any ETA when this will be merged? I'm about to migrate a project and would like to know if I should wait a little bit, or just move forward with the current approach. Thanks.

buuhuu commented 1 month ago

This will be merged after the next AEM Cloud Services release scheduled for this / next week.

The majority of changes can be used. Unfortunately I made some changes to the default content models (button, title, image) and rename the fields according to our naming conventions so that they can be used in container blocks without any changes. This change is the only thing that requires the AEM CS release. Spitting/merging the files works today.