Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate blueprint configuration can be confusing and cause unexpected errors. #10663

Closed
mshima opened this issue Oct 21, 2019 · 0 comments · Fixed by #10664
Closed

Duplicate blueprint configuration can be confusing and cause unexpected errors. #10663

mshima opened this issue Oct 21, 2019 · 0 comments · Fixed by #10664

Comments

@mshima
Copy link
Contributor

@mshima mshima commented Oct 21, 2019

Overview of the issue

Currently when setting a configuration from a blueprint generator, it will create a namespaced configuration duplicating all configurations.

{
"generator-jhipster-myblueprint": {
"promptValues": {
"packageName": "com.mycompany.myapp"
},
"applicationType": "monolith",

  • If a generator is not overridden by the blueprint, it will load the generator-jhipster namespace.

  • If a generator is overridden by the blueprint, it will load the generator-jhipster-(blueprint) namespace.

To workaround this problem, there is getAllJhipsterConfig (ea50578) that will load every configuration and merge them, but the order is based on the blueprint load order.

function getAllJhipsterConfig(generator, force, basePath = '') {

Changing the .yo-rc.json in one place can not cause the expected result.

Motivation for or Use Case

Make the configuration cleaner and not confusing.

Reproduce the error
Related issues

PR #7802

Suggest a Fix

Remove the duplicate configuration by:

  1. Upgrade to yeoman-generator 4.1.0
  2. Moving the blueprint configuration from generator.config to generator.blueprintConfig
  3. Recreating generator.config with 'generator-jhipster' namespace.
  4. Move the duplicate configurations from blueprintConfig to config.
JHipster Version(s)

master

JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
mshima added a commit to mshima/generator-jhipster that referenced this issue Oct 21, 2019
@mshima mshima mentioned this issue Oct 21, 2019
0 of 4 tasks complete
mshima added a commit to mshima/generator-jhipster that referenced this issue Oct 22, 2019
mshima added a commit to mshima/generator-jhipster that referenced this issue Oct 22, 2019
@mshima mshima mentioned this issue Nov 6, 2019
1 of 1 task complete
mshima added a commit to mshima/generator-jhipster that referenced this issue Nov 8, 2019
mshima added a commit to mshima/generator-jhipster that referenced this issue Dec 29, 2019
mshima added a commit to mshima/generator-jhipster that referenced this issue Dec 29, 2019
mshima added a commit to mshima/generator-jhipster that referenced this issue Dec 30, 2019
Create blueprintConfig for blueprint specific configurations.
Fixes jhipster#10663
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.