Yeoman generator for creating and maintaining Liferay Fragment projects
First, install Yeoman and generator-liferay-fragments using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-liferay-fragments
Then generate your new project:
yo liferay-fragments
This command will guide you through a project creation and will ask you some simple questions. Then you can just cd to this new project and start working.
cd my-new-fragments-project
Once you've created your project, there is a bunch of npm scripts that will allow you perform many actions with your existing fragments. Fragments are organized inside collections, and keep an extremely simple structure:
src/
collection-a/
collection.json
fragment-1/
fragment.json
index.html
styles.css
main.js
fragment-2/
...
collection-b/
...
Each collection's and fragment's information is stored inside JSON
files,
and you can change them manually, there is no magic in here. But we provide
some extra scripts to do these modifications easily.
add-collection
add-fragment
export
compress
import
import:watch