Closed dwarakaprasad closed 2 years ago
You should post a repro. I am not sure it's possible to reproduce with current information.
Thankyou @mshima for your response. I was able to get both server & client scripts generated this morning by simply calling the super._postWriting() from the blueprint's server sub-generator (I dint realize that it wasn't being called in the first place and was looking all over).
This is not an issue and I am closing this.
Thank you once again...
Overview of the issue
I am writing a blue print to replace
I have completed the angular part and now in the process of modifying the server side
My current Setup: (highlighting only the important part)
The code generation works fine and I am able to bring the application up and able to access the new front end. The issue is in the generated code, specifically in the package.json file, the script part only contains the client side scripts and none of the server side scripts (built in the server's 'postWriting' phase) are available
What I understood from Jhipster's code: On the server sub-generator, during the 'postWriting' phase, the server's 'scripts' part of the package.json file is built/modified based on the user selected options (db, auth, e2e, etc) and a similar technique is followed on the client sub-generator, at the end the generated package.json file contains both the 'scripts'.
What I am trying to achieve: Combine the blueprints UI scripts with the Jhipster's server scripts and have them in the generated code (package.json). Unfortunately I only see the blueprints client scripts.
My research: Case1: When running Jhipster without the blueprint, the following is the call stack,
Case 2: The following is the call stack with blueprint
In both the cases the server's write priority does not create/write package.json file (because the skipClient is undefined there), but in case 1 the server's write is followed by the client's write which creates the package.json file and is then available to the 'postWriting' of both server and client (I am assuming this is how the servers script are visible to the client).
But in case 2, the server's postWriting (2) doesn't have a package.json file and so what ever was added to the 'scripts' is flushed when the blueprint's client write phase (4) creates a new package.json file which is then available to blueprints 'postwriting' which has no access to the server's 'scripts'. (this is purely my speculation).
Motivation for or Use Case
Need this to have a proper package.json
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s): 7.8.1
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System