At the moment we store two kinds of configurations:
.yo-rc.json, which is the standard Yeoman configuration store.jhipster, the configurations from our generated entities - this isn't a standard Yeoman configuration mechanism, but it works the same way (it's just a JSON dump of the configuration object).I would also like to store configuration data from all sub-generators, using the standard Yeoman .yo-rc.json file. Let me explain with an example, using the ci-cd sub-generator (as this is my current issue, but this is good for all sub-generators):
.yo-rc.json using the ci-cd key (use the name of the sub-generator).--regenerate flag, which we already use for regenerating entitiesThis would have the following benefits:
.yo-rc.json using a Web form, like on https://start.jhipster.tech/ , so we could run the sub-generators without any prompts (which are blocking me from running them without a command line).From this, it could be possible to re-create entire apps from config files to be played/replayed (and shared/stored):
.yo-rc.jsonAnd I foresee some more uses for the JDL...
@MathieuAA totally. And if you look at the new https://start.jhipster.tech (which I just published 10 seconds ago), you'll quickly see my goal :-)
@jdubois 10 seconds ago. I'm not that quick =)
update: nice!!
It would be nice to also be able to save configuration of 'external' modules (entity audit, cloud-stream,...) ;)
As far as I know, options are already saved in the .yo-rc.json for example for the docker-compose subgen, it's just that they are only taken into account for pre-selecting previous choices.
Maybe, we can replace those JSON files by JDL files since the JDL will soon support generating apps @MathieuAA.
@PierreBesson my plan:
For now, let's keep the JSON files where they are, and slowly as the plan goes make JDL the primary exported format (the JSON would then be dumped for debug/troubleshooting purposes).
@MathieuAA we do think alike. One of the things I had in mind when coming up with the JDL grammar for application generation is that one day we will use JDL as the configuration file for JHipster. My idea was to replace .yo-rc.json and .jhipster/* files in favor of a single JDL file that declares application options and entity configurations and maybe even sub generator options. This approach has many benefits of course, like,
jhipster to create the app.I like your planned roadmap as well
Yes @MathieuAA , and that also allows us to have something we have planned and designed correctly.
For the record, I never thought we could do a "memory dump" of the configuration to JSON files, that was a contribution (from someone really smarter than me!!). But the result is that the JSON files are just "memory dumps", and are not well designed.
However, there are some good things about them:
Most helpful comment
@MathieuAA we do think alike. One of the things I had in mind when coming up with the JDL grammar for application generation is that one day we will use JDL as the configuration file for JHipster. My idea was to replace
.yo-rc.jsonand.jhipster/*files in favor of a single JDL file that declares application options and entity configurations and maybe even sub generator options. This approach has many benefits of course, like,jhipsterto create the app.I like your planned roadmap as well