Moving from yarn to pnpm.

This commit is contained in:
Dessalines 2024-01-28 13:25:26 -05:00
parent 2918ea6638
commit b890e2071f
7 changed files with 5875 additions and 8996 deletions

View file

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged
pnpm lint-staged

View file

@ -5,6 +5,9 @@
# recursive: true
# submodule_update_remote: true
variables:
- &install_pnpm "corepack enable pnpm"
steps:
prepare_repo:
image: alpine:3
@ -18,27 +21,31 @@ steps:
commands:
- prettier -c . "!dist" "!lemmy-docs" "!lemmy-translations" "!joinlemmy-translations" "!lemmy-js-client" "!lemmy-stats-crawler" "!src/shared/instance_stats.ts" "!src/shared/donation_stats.ts"
yarn:
install:
image: node:alpine
commands:
- yarn
- *install_pnpm
- pnpm i
yarn_lint:
lint:
image: node:alpine
commands:
- yarn lint
- *install_pnpm
- pnpm lint
yarn_build_dev:
build_dev:
image: node:alpine
commands:
- yarn build:dev
- *install_pnpm
- pnpm prebuild:dev
- pnpm build:dev
nightly_instance_crawl:
image: node:alpine
commands:
# libpq and openssl can probably be removed after lemmy dep is upgraded to 0.16.4+
- apk add cargo pkgconfig openssl openssl-dev libpq libpq-dev
- yarn crawl
- pnpm crawl
when:
event:
- cron
@ -62,7 +69,7 @@ steps:
commands:
# libpq and openssl can probably be removed after lemmy dep is upgraded to 0.16.4+
- apk add cargo pkgconfig openssl openssl-dev libpq libpq-dev
- yarn crawl
- pnpm crawl
when:
event: tag

View file

@ -19,19 +19,21 @@ FROM node:alpine as api
WORKDIR /app
COPY lemmy-js-client lemmy-js-client
WORKDIR /app/lemmy-js-client
RUN yarn
RUN yarn docs
RUN corepack enable pnpm
RUN pnpm i
RUN pnpm run docs
# Build the isomorphic app
FROM node:alpine as builder
RUN apk update && apk add yarn python3 build-base gcc wget git curl --no-cache
RUN apk update && apk add python3 build-base gcc wget git curl --no-cache
RUN curl -sf https://gobinaries.com/tj/node-prune | sh
RUN corepack enable pnpm
WORKDIR /app
# Cache deps
COPY package.json yarn.lock ./
RUN yarn --production --prefer-offline --pure-lockfile
COPY package.json pnpm-lock.yaml ./
RUN pnpm i
# Build
COPY tsconfig.json \
@ -50,8 +52,9 @@ COPY src src
COPY --from=docs /app/docs ./src/assets/docs
COPY --from=api /app/lemmy-js-client/docs ./src/assets/api
RUN yarn --production --prefer-offline
RUN yarn build:prod
RUN pnpm i
RUN pnpm prebuild:prod
RUN pnpm build:prod
# Prune the image
RUN node-prune ./node_modules
@ -60,8 +63,6 @@ RUN rm -rf ./node_modules/import-sort-parser-typescript
RUN rm -rf ./node_modules/typescript
RUN rm -rf ./node_modules/npm
RUN du -sh ./node_modules/* | sort -nr | grep '\dM.*'
FROM node:alpine as runner
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/node_modules /app/node_modules

View file

@ -3,8 +3,8 @@
# Update all the submodules and translations
./update_submodules.sh
yarn crawl
yarn update-donations
pnpm crawl
pnpm update-donations
git add "src/shared/instance_stats.ts"
git add "src/shared/donation_stats.ts"
git commit -m "Crawl and donation instance statistics"

View file

@ -6,16 +6,16 @@
"scripts": {
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"clean": "yarn run rimraf dist",
"clean": "rimraf dist",
"crawl": "node crawl.mjs",
"update-donations": "node update_donations.mjs",
"lint": "node generate_translations.mjs && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
"prebuild:dev": "yarn clean && node generate_translations.mjs && yarn tailwind && yarn generate_rss_feed",
"prebuild:prod": "yarn clean && node generate_translations.mjs && yarn tailwind && yarn generate_rss_feed",
"prebuild:dev": "pnpm clean && node generate_translations.mjs && pnpm tailwind && pnpm generate_rss_feed",
"prebuild:prod": "pnpm clean && node generate_translations.mjs && pnpm tailwind && pnpm generate_rss_feed",
"generate_rss_feed": "node generate_rss_feed.mjs",
"tailwind": "tailwindcss -i ./src/style.css -o ./dist/styles/styles.css --minify",
"prepare": "husky install",
"start": "yarn build:dev --watch & yarn tailwind --watch"
"start": "pnpm build:dev --watch & tailwind --watch"
},
"repository": "https://github.com/LemmyNet/joinlemmy-site",
"dependencies": {
@ -68,6 +68,7 @@
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"lodash": "^4.17.21",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"sass": "^1.69.5",

5842
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

8972
yarn.lock

File diff suppressed because it is too large Load diff