jhipster-lite icon indicating copy to clipboard operation
jhipster-lite copied to clipboard

Changing the format / indent does not seem to work

Open biergit opened this issue 2 years ago • 15 comments

I am using the UI provided by the Docker container. I only get indent size of two spaces. The log shows:

t.j.l.p.i.s.TraceProjectFormatter : No npm installed, can't format project

biergit avatar Oct 31 '22 20:10 biergit

I guess you are clicking the format button somewhere in the process? We need to update this button activation to be bound to prettier application

DamnClin avatar Oct 31 '22 20:10 DamnClin

Yes I clicked "Apply selected" only then the "Format" button became active and I clicked it. Also I noticed changing the line ending has no effect - I always get "lf".

biergit avatar Oct 31 '22 20:10 biergit

Did you select prettier module?

DamnClin avatar Oct 31 '22 20:10 DamnClin

I didn't but I checked now and nothing changed.

biergit avatar Oct 31 '22 20:10 biergit

Just made some test, forgot the activation updates were already done (here https://github.com/jhipster/jhipster-lite/pull/3545)...

Ok, so looks like we need to add npm in the docker image :D. cc @pascalgrimaud

DamnClin avatar Oct 31 '22 20:10 DamnClin

I used the Docker container. And I see that the TraceProjectFormatter is not trying too hard to even check for NPM :)

biergit avatar Oct 31 '22 20:10 biergit

Yep, this the instance used when no npm installation can be found :D. We need to add npm in the published docker image :)

DamnClin avatar Oct 31 '22 20:10 DamnClin

Indeed, it would be a good enhancement

pascalgrimaud avatar Nov 01 '22 06:11 pascalgrimaud

@pascalgrimaud where is the root image used to publish on docker hub?

DamnClin avatar Nov 07 '22 19:11 DamnClin

@DamnClin : it comes from https://github.com/jhipster/jhipster-lite/blob/main/Dockerfile

pascalgrimaud avatar Nov 07 '22 19:11 pascalgrimaud

Ok, adding npm should be pretty straightforward so, do you consider it a good first issue?

DamnClin avatar Nov 07 '22 19:11 DamnClin

I don't think it's a good first issue :-D Not so easy to find the good solution

pascalgrimaud avatar Nov 07 '22 19:11 pascalgrimaud

Ok, my bad, I though this just needs something like this:

ARG NVM_VERSION=v0.39.2
ARG NODE_VERSION=v18.12.1
ENV NVM_DIR=/root/.nvm

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | bash \
    && . $NVM_DIR/nvm.sh \
    && nvm install $NODE_VERSION \
    && nvm alias default $NODE_VERSION \
    && nvm install-latest-npm \
    && nvm use default
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH

DamnClin avatar Nov 07 '22 19:11 DamnClin

Maybe your solution can work, but it needs to be tested

pascalgrimaud avatar Nov 07 '22 19:11 pascalgrimaud

Of course, just dropped some stuff here

DamnClin avatar Nov 07 '22 19:11 DamnClin