From c599fa20ed0a37d1981ba474f0b16bc59c370142 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 4 Mar 2024 10:24:31 -0500 Subject: [PATCH] Changing yarn to pnpm (#298) --- src/administration/from_scratch.md | 20 ++++++++++---------- src/contributors/02-local-development.md | 20 ++++++++++++-------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/administration/from_scratch.md b/src/administration/from_scratch.md index d8d5664..e5f515c 100644 --- a/src/administration/from_scratch.md +++ b/src/administration/from_scratch.md @@ -222,13 +222,9 @@ If you did everything right, the Lemmy logs from `sudo journalctl -u lemmy` shou #### Install dependencies -Nodejs and yarn in Ubuntu 20.04 / Ubuntu 22.04 repos are too old, so let's install Node 20. +Nodejs in Ubuntu 20.04 / Ubuntu 22.04 repos are too old, so let's install Node 20. ``` -# yarn -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - # nodejs sudo apt install -y ca-certificates curl gnupg sudo mkdir -p /etc/apt/keyrings @@ -236,7 +232,11 @@ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list sudo apt update -sudo apt install nodejs yarn +sudo apt install nodejs + +# pnpm +npm i -g pnpm + ``` #### Build the front-end @@ -250,8 +250,8 @@ sudo -u lemmy bash git clone https://github.com/LemmyNet/lemmy-ui.git --recursive cd lemmy-ui git checkout 0.18.5 # replace with the version you want to install -yarn install --pure-lockfile -yarn build:prod +pnpm i +pnpm build:prod exit ``` @@ -454,8 +454,8 @@ git checkout main git pull --tags git checkout 0.18.5 # replace with the version you are updating to git submodule update -yarn install --pure-lockfile -yarn build:prod +pnpm install +pnpm build:prod exit sudo systemctl restart lemmy-ui ``` diff --git a/src/contributors/02-local-development.md b/src/contributors/02-local-development.md index a5b6d39..7ce3c86 100644 --- a/src/contributors/02-local-development.md +++ b/src/contributors/02-local-development.md @@ -8,24 +8,28 @@ Debian-based distro: ```bash sudo apt install git cargo libssl-dev pkg-config libpq-dev curl -# install yarn -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt update && sudo apt install yarn ``` Arch-based distro: ```bash -sudo pacman -S git cargo openssl pkg-config postgresql-libs curl yarn +sudo pacman -S git cargo openssl pkg-config postgresql-libs curl ``` macOS: -Install [Homebrew](https://brew.sh/) if you don't already have it installed. Then install Node and Yarn. +Install [Homebrew](https://brew.sh/) if you don't already have it installed. Then install Node and pnpm. ```bash -brew install node yarn +brew install node +``` + +### Install pnpm + +The install instructions are [here](https://pnpm.io/installation), or you can run + +```bash +npm install -g pnpm ``` ### Setup PostgreSQL database @@ -82,7 +86,7 @@ After making changes, you need to format the code with `cargo +nightly fmt --all ### Frontend development -Install dependencies by running `yarn`. Then run `yarn dev` to launch lemmy-ui locally. It automatically connects to the Lemmy backend on `localhost:8536`. Open [localhost:1234](http://localhost:1234) in your browser. The project is rebuilt automatically when you change any files. +Install dependencies by running `pnpm i`. Then run `pnpm dev` to launch lemmy-ui locally. It automatically connects to the Lemmy backend on `localhost:8536`. Open [localhost:1234](http://localhost:1234) in your browser. The project is rebuilt automatically when you change any files. Note that this setup doesn't support image uploads. If you want to test those, you need to use the [Docker development](03-docker-development.md).