jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.56k stars 4.02k forks source link

Generating an application with only client is missing common files and commit node_modules #8544

Closed murdos closed 6 years ago

murdos commented 6 years ago
Overview of the issue

When generating an application with --skip-server, a few important files are missing: .gitignore, .gitattributes, .editorconfig and README.

Motivation for or Use Case

The issues are:

Reproduce the error

jhipster --skip-server --auth jwt --db postgresql

Related issues

I've not found any.

Suggest a Fix

Move common files, needed by both client and server into a new subgenerator named 'base' or 'common'.

JHipster Version(s)

5.4.2

JHipster configuration

{ "generator-jhipster": { "promptValues": { "nativeLanguage": "en" }, "jhipsterVersion": "5.4.2", "applicationType": "monolith", "baseName": "portal", "clientFramework": "angularX", "useSass": true, "clientPackageManager": "npm", "authenticationType": "jwt", "cacheProvider": "no", "databaseType": "sql", "devDatabaseType": "postgresql", "prodDatabaseType": "postgresql", "testFrameworks": [ "protractor" ], "jhiPrefix": "jhi", "enableTranslation": true, "nativeLanguage": "en", "languages": [ "en", "fr", "de" ], "skipServer": true } }

Browsers and Operating System

Windows 10

pascalgrimaud commented 6 years ago

Indeed, --skip-server is for very advanced users, that's why it's not well tested.

PR is welcome to fix it.

murdos commented 6 years ago

I'm ok for working on the PR, once we agree on a solution :)

pascalgrimaud commented 6 years ago

Yes, let's wait some feedback from @deepu105

murdos commented 6 years ago

@deepu105 : what do you think of my proposal to create a new subgenerator that would hold the commons files between server and client?

deepu105 commented 6 years ago

@murdos I don't want another sub generator, what I would like though is to move common templates to a shared folder and reuse them

deepu105 commented 6 years ago

Another solution that I would also prefer is to move all common templates to the app generator itself and support -skip-client and --skip-server only from app generator, and fail direct usage of client/server sub generator. @murdos would you like to do that?

murdos commented 6 years ago

My concern is that the app generator can't be overridden in blueprint, thus moving common templates there might not be optimal. I'm not sure how the shared folder would work with blueprint in mind, but that's seems to my mind a bit more convoluted than a simple new subgenerator that could grow over time (I'm thinking e.g. to shared prettier config, once prettier-java is usable, shared husky configuration, ...).

deepu105 commented 6 years ago

@murdos ya you are right, ok let's do a sub gen named common and make sure the sub gen cannot be used directly

murdos commented 6 years ago

Ok, I'm glad that we agreed :-) I'll do that.