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.54k stars 4.02k forks source link

Impossible to commit with GIT a pure JHIPSTER Vanilla application in WINDOWS #11131

Closed gthiabaud closed 4 years ago

gthiabaud commented 4 years ago
Overview of the issue

I generate an application by using jhipster. I try to commit in my github projet. I have the following error message from git client (I try with diffrent client including Jetbrain Java IDE) : husky > pre-commit (node v10.16.3) ‼ lint-staged generated an argument string of 17387 characters, and commands might not run correctly on your platform. It is recommended to use functions as linters and split your command based on the number of staged files. For more info, please visit: https://github.com/okonet/lint-staged#using-js-functions-to-customize-linter-commands Stashing changes... [started]

Thank for your help and this beautifull tool that JHIPSTER is :)

Motivation for or Use Case

Impossible to continue to try to user JHIPSTER if it is not comatible with a Windows Dev environnement. :(

Reproduce the error

Launch JHIPSTER 6.6.0 Configure to build a :

Related issues

10312

Suggest a Fix

NA

JHipster Version(s)

6.6.0 It is a regression in the paste I didn't encounter this issue.

JHipster configuration

INFO! Using JHipster version installed locally in current project's node_modules INFO! Executing jhipster:info INFO! Options: from-cli: true Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
annonces@0.0.1-SNAPSHOT C:\BUSDATA\JHIPSTER\annonces
`-- generator-jhipster@6.6.0
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.gthiabaud.annonces",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.6.0",
    "applicationType": "monolith",
    "baseName": "annonces",
    "packageName": "com.gthiabaud.annonces",
    "packageFolder": "com/gthiabaud/annonces",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mariadb",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": "eureka",
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "jwtSecretKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "embeddableLaunchScript": false,
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "react",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1579102768236,
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en", "fr"],
    "blueprints": []
  }
}

**JDL for the Entity configuration(s) entityName.json files generated in the .jhipster

NA

Environment and Tools

java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

git version 2.20.1.windows.1

node: v10.16.3

npm: 6.13.4

yeoman: 3.1.1

yarn: 1.21.1

Docker version 19.03.5, build 633a0ea

docker-compose version 1.24.1, build 4667896b

INFO! Congratulations, JHipster execution is complete!

----------------------- .yo-rc.json ------------------------------- { "generator-jhipster": { "promptValues": { "packageName": "com.gthiabaud.annonces", "nativeLanguage": "en" }, "jhipsterVersion": "6.6.0", "applicationType": "monolith", "baseName": "annonces", "packageName": "com.gthiabaud.annonces", "packageFolder": "com/gthiabaud/annonces", "serverPort": "8080", "authenticationType": "jwt", "cacheProvider": "ehcache", "enableHibernateCache": true, "websocket": false, "databaseType": "sql", "devDatabaseType": "h2Disk", "prodDatabaseType": "mariadb", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": "eureka", "buildTool": "maven", "enableSwaggerCodegen": false, "jwtSecretKey": "XXXXXXXXXXXXXX=", "embeddableLaunchScript": false, "useSass": true, "clientPackageManager": "npm", "clientFramework": "react", "clientTheme": "none", "clientThemeVariant": "", "creationTimestamp": 1579102768236, "testFrameworks": [], "jhiPrefix": "jhi", "entitySuffix": "", "dtoSuffix": "DTO", "otherModules": [], "enableTranslation": true, "nativeLanguage": "en", "languages": ["en", "fr"], "blueprints": [] } }


NO JDL here

Browsers and Operating System

NA

ruddell commented 4 years ago

As a workaround, you can pass the --no-verify flag to the git commit command, which skips the pre-commit git hook.

vishal423 commented 4 years ago

looks like we upgraded the lint-staged dependency version on react side and that caused the issue. Short term solution should be to change that back to 8.2.1

PierreBesson commented 4 years ago

It looks like a lint-staged bug rather than a jhipster bug.@gthiabaud, can you try the latest version of lint-staged (10.0.2) to see if it fixes your issue. Or maybe try with git bash rather than CMD.exe.

kaidohallik commented 4 years ago

Seems that lint-staged evolved as following:

But if using lint-staged 10 then those who are generating initial version with --skip-git and are committing to Git manually, need to know that they must add --no-verify while doing initial commit to Git.

I tried to test lint-staged version 10 with this modification and basically worked in Windows. But I encountered parallel Git access error after doing git reset and then committing changes (lint-staged is using git stash now and this parallel Git access error is mentioned also in some lint-staged documents).

For me ATM the most reliable solution is to downgrade lint-staged to version 8 also in React (as this is done for Angular).

Alternative is to use version 10, but not sure we don't encounter problems in some situations.

PierreBesson commented 4 years ago

@kaidohallik Thanks for the analysis. Personally I would not be against using lint-staged v10 even with the little problems in some specific cases but I guess its better to use the most "stable" version.