Switch to pnpm (#432)

As `pnpm` is xx times faster than `npm`.

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/432
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
This commit is contained in:
pat-s 2024-06-12 08:44:42 +00:00 committed by Patrick Schratz
parent c7a2a29c7f
commit c12e26e446
3 changed files with 11 additions and 10 deletions

View file

@ -2,7 +2,8 @@ FROM node:12.22.12-stretch-slim
RUN apt-get update && apt-get -y upgrade RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git RUN apt-get install -y git curl
RUN curl -fsSL https://get.pnpm.io/install.sh | sh -
RUN mkdir /opt/documentation && chown node: /opt/documentation RUN mkdir /opt/documentation && chown node: /opt/documentation
@ -10,6 +11,6 @@ USER node
WORKDIR /opt/documentation WORKDIR /opt/documentation
RUN npm install RUN pnpm install
CMD [ "npm", "run", "serve"] CMD [ "pnpm", "run", "serve"]

View file

@ -17,14 +17,14 @@ the easiest way to do so is to fork the documentation repository and develop loc
First, run First, run
`npm install` `pnpm install`
to install all dependencies (they will be installed only for this project, not globally). to install all dependencies (they will be installed only for this project, not globally).
You only have to do this once. You only have to do this once.
Then run Then run
`npm run serve` `pnpm run serve`
to start a development web server that by default is listening at `http://localhost:8080`. to start a development web server that by default is listening at `http://localhost:8080`.
@ -72,17 +72,17 @@ The parameters are:
Like for local development, before building and deploying you first have to install Like for local development, before building and deploying you first have to install
the dependencies (once): the dependencies (once):
`npm install` `pnpm install`
To build the entire website to the `_site` directory run To build the entire website to the `_site` directory run
`npm run build` `pnpm run build`
Instead, to directly publish the page to Codeberg pages, you can also run Instead, to directly publish the page to Codeberg pages, you can also run
`npm run deploy` `pnpm run deploy`
which includes a call to `npm run build`. which includes a call to `pnpm run build`.
### Technical Information ### Technical Information

View file

@ -1,5 +1,5 @@
#!/bin/bash -ex #!/bin/bash -ex
npm run build pnpm run build
DEPLOYMENT_REPO=${1:-git@codeberg.org:Codeberg-Infrastructure/static-deployments} DEPLOYMENT_REPO=${1:-git@codeberg.org:Codeberg-Infrastructure/static-deployments}
DEPLOYMENT_BRANCH=${2:-docs} DEPLOYMENT_BRANCH=${2:-docs}