liferay / generator-liferay-fragments

Yeoman generator for creating and maintaining Liferay Fragment projects
https://www.npmjs.com/package/generator-liferay-fragments
MIT License
30 stars 31 forks source link

Fix: Correctly identify fragment composition files #231

Closed yuchi closed 2 years ago

yuchi commented 2 years ago

Sorry if I created a PR before creating an issue. The problem is pretty simple, and so is the solution.

Currently Fragments Compositions are not retrieved since they are searched with the following glob:

<root>/src/<collection>/*/fragment-composition.json

This is not where they are stored since they are grouped inside a fragment-compositions folder.

This PR follows the lead of all other _get* functions in the get-project-content.ts file by using the following glob (please notice the additional ** in the glob):

<root>/src/<collection>/**/*/fragment-composition.json
p2kmgcl commented 2 years ago

Thanks for the PR @yuchi!

Can you squash those commits, please? We are using conventional commits format in this repo (described here https://github.com/liferay/liferay-frontend-guidelines/blob/master/general/commit_messages.md#message-format :smile:).

Also let me check if we can add a new test to cover this use case.

p2kmgcl commented 2 years ago

Ok I think that we can add a new "sample-project-with-nested-fragment-collection" fixture here, and then update the get-project-content tests to ensure that fragment collections are being read too. Do you feel like adding that to the PR? I can give you some help if you need to :smiley:

yuchi commented 2 years ago

Hi @p2kmgcl! Sure! I’ll close this PR and open a new one with the correct commit message and tests.