JHipster, Customization of generated code

i'm newbie in JHipster and i'm trying to figure this, when i create a new entity JHipster generates several files, angular, html and java classes, now if i want a common code for all this generated code i must edit each time that i use the yeoman generator? what i want is:

So i need to edit each time for each generated code? and is a good practice this or what i want? for clarify more i want to use a Custom Bootstrap/angular Dashboard template like Minovate, i see how to customize bootstrap in the documentation but not about what i'm asking for, Thanks.

Upvotes: 1

Views: 3170

Answers (2)

lrkwz
lrkwz

Reputation: 6543

I suggest to use some VSC (git, subversion or whatever you like) have a branch dedicated to plain jhipster generated code and another one where you make customization. Eventually regenerate on jhipster branch and merge back on yours.

You should at least reduce manual intervention.

Upvotes: 2

Gaël Marziou
Gaël Marziou

Reputation: 16294

JHipster is just a code generator, once generated the code is yours.

For angular screens I would say do as much as you can in CSS/SASS. But it's very likely that you will need to build some screen mixing several entities and change the structure of entity screens.

So you should rather consider them as a starting point and do your own stuff in another folder so that it does not get overwritten by next re-generations. This way you can still update your entity definitions in .jhipster folder and re-run yo jhispter:entity <entity name> on the entities you modified.

Customising java Entities is usually much simpler and you can easiliy achieve this by merging generated code with git and defining your service classes.

AOP seems overkill here.

Extending a yeoman generator is a lot of work.

Upvotes: 5

Related Questions