liferay / liferay-theme-tasks

A set of tasks for building and deploying Liferay Portal themes.
18 stars 24 forks source link

Extend a local theme using gulp extend #38

Closed GianBe closed 7 years ago

GianBe commented 7 years ago

At the moment is not possible to use the task gulp extend to search for a theme installed in the node_modules folder of my theme directory (and defined in the package.json).

Using gulp extend with the options: Base Theme -> Search globally installed npm modules (development purposes only)

you search for the node_modules folder inside every path defined by splitting the current path: path.join(process.cwd(), '..').split(path.sep)

You can find the code I'm referring at this line

that code stop at the parent of the current directory, for example with this path: C:\liferay\workspace\themes\my-custom-theme

you search for: C:\liferay\workspace\themes\node_modules C:\liferay\workspace\node_modules C:\liferay\node_modules C:\node_modules

and never for: C:\liferay\workspace\themes\my-custom-theme\node_modules

that is the only folder that we know exists. Is there a reason for this behaviour?

robframpton commented 7 years ago

Hi @GianBe

This is actually intended functionality. The extend task will actually add the theme to your package.json in a few places and then install it in the theme's node_modules folder. It's assumed that if you have a theme in your node_modules that it's already a dependency and doesn't need to be added.

I should also note that dependencies that are installed in a theme's node_modules are not considered global dependencies, so it would be confusing to list them while searching globally.

Hope that helps!