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

Allow extending JDL application options from a blueprint #9870

Closed
1 task done
PierreBesson opened this issue Jun 7, 2019 · 27 comments
Closed
1 task done

Allow extending JDL application options from a blueprint #9870

PierreBesson opened this issue Jun 7, 2019 · 27 comments

Comments

@PierreBesson
Copy link
Contributor

PierreBesson commented Jun 7, 2019

See jhipster/jhipster-core#344

Overview of the feature request

Currently when using JHipster with a blueprint that extend the available application options, it is not possible to select those options when generating an app using the JDL.

JHipster should expose an API that let blueprint developers edit the available application_options, potentially extending or restricting them. Currently they are declared in jhipster-core (see jhipster-core/lib/core/jhipster/application_options.js) with no way to extend them from a blueprint.

Motivation for or Use Case

An currently failing scenario:
app.jdl

application {
  config {
    baseName vuejsApp,
    clientFramework vuejs
  }
}

When running:

jhipster -b vuejs import-jdl app.jdl

It fails with:

Error: Unknown value 'vuejs' for option 'clientFramework'.
Error while parsing applications and entities from the JDL Error: Unknown value 'vuejs' for 
option 'clientFramework'.

Related issues

#8915 JDL centric configurations

  • Checking this box is mandatory (this is just to show you read everything)
@deepu105
Copy link
Member

deepu105 commented Jun 7, 2019 via email

@ksilz
Copy link

ksilz commented Jun 7, 2019

@PierreBesson Would this request also help in the following scenario:

I want to customize the generated Angular front end through a configurable blueprint. So instead of putting a config file into my jHipster project which the blueprint then reads (can it actually?), I define configuration options (such as "hideDeletion" or "detailLinkColumn") in the JDL instead.

@PierreBesson
Copy link
Contributor Author

@deepu105 Yes I was also considering that the merging of jhipster-core should go first. Maybe we could create a separate issue for it.

@deepu105
Copy link
Member

deepu105 commented Jun 7, 2019

Yes, let's do it. Ping @MathieuAA

@MathieuAA
Copy link
Member

I like this GH issue. I'm gonna create an issue for this.

@MathieuAA
Copy link
Member

Oh and if you guys agree, I'll create a new project to better keep track of the related tasks

@danielpetisme
Copy link
Member

danielpetisme commented Jun 8, 2019 via email

@MathieuAA
Copy link
Member

@danielpetisme thanks :) I'll definitely ping you

@PierreBesson
Copy link
Contributor Author

As a workaround to let users generate vuejs apps with the JDL, I opened a PR to jhipster-core with a workaround: jhipster/jhipster-core#338 (adding vuejs to the list of client-frameworks).

@pascalgrimaud
Copy link
Member

@MathieuAA @mshima @PierreBesson : as it's opened for a while, does one of you start to work on this ? Should we let this ticket opened ?

@MathieuAA
Copy link
Member

It's something that needs doing, but right now, I'm busy with another task.

@mshima
Copy link
Member

mshima commented Jan 28, 2020

I think we should use something like:
clientFramework vuejs:vuejs
vuejs:clientTheme foo

Every key and value with : should be ignored for now.
I am busy removing yo dependency (improving environment lookup to be selective)

@MathieuAA
Copy link
Member

MathieuAA commented Jan 28, 2020

Simpler: we could not validate what the user writes in the JDL file(s) and perform a validation just before the application-generation phase in the generator.
Solution 2: each blueprint can declare a list of values that it uses, this list will be taken into account so that no error is thrown.

@PierreBesson
Copy link
Contributor Author

@MathieuAA maybe add a --skip-jdl-validation flag as a workaround which would implement solution 1, then proceed with solution 2.

@mshima
Copy link
Member

mshima commented Jan 29, 2020

I have a blueprint that implements a custom config. So it would be nice to support it.
I like the idea of namespacing the config to be easy to differentiate from oficial (supported) configurations.

@MathieuAA
Copy link
Member

@PierreBesson I like your idea. As soon as I wrap what I'm on, I can start implementing this. Unless there's someone willing to start it now of course

@mraible
Copy link
Contributor

mraible commented Oct 8, 2020

@MathieuAA You were interested in implementing this in January? Are you still interested? If not, I suggest we close this issue.

@mshima
Copy link
Member

mshima commented Oct 8, 2020

At least we should implement annotations at application.
This issue have taken too long already, there is no way to add a custom config for blueprints.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2020

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@MathieuAA
Copy link
Member

Commenting. @nicolas63's PR should fix it after some changes are done, #12975.

@MathieuAA
Copy link
Member

MathieuAA commented Nov 8, 2020

And BTW, thanks @nicolas63 for proposing a PR for theses issues (which involves this one too).

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2020

This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days

@pascalgrimaud pascalgrimaud added this to the 7.0.0-beta.0 milestone Dec 18, 2020
@pascalgrimaud pascalgrimaud reopened this Jan 11, 2022
@mshima
Copy link
Member

mshima commented May 7, 2022

This is important to have.

@mshima mshima reopened this May 7, 2022
@mshima mshima mentioned this issue Apr 9, 2023
6 tasks
@DanielFran
Copy link
Member

@mshima Can you confirm this can be closed?

@mshima
Copy link
Member

mshima commented Jun 20, 2023

@DanielFran no, I've added support to defining jdl options outside jdl implementation, but loading logic it is still hardcoded.
There is not way to inject the options, and there is no lookup of jdl options.

Lookup should be implemented for options, config and jdl definition related to not finished #21192

@mshima
Copy link
Member

mshima commented Oct 25, 2023

Implemented in #23961

@mshima mshima closed this as completed Oct 25, 2023
@deepu105
Copy link
Member

Is this documented somewhere if not can we please add it to docs. We are having a lot of undocumented changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants