mirror of
https://github.com/LemmyNet/joinlemmy-site.git
synced 2024-11-22 04:11:15 +00:00
Moving from yarn to pnpm.
This commit is contained in:
parent
2918ea6638
commit
b890e2071f
7 changed files with 5875 additions and 8996 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn lint-staged
|
pnpm lint-staged
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
# recursive: true
|
# recursive: true
|
||||||
# submodule_update_remote: true
|
# submodule_update_remote: true
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- &install_pnpm "corepack enable pnpm"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
prepare_repo:
|
prepare_repo:
|
||||||
image: alpine:3
|
image: alpine:3
|
||||||
|
@ -18,27 +21,31 @@ steps:
|
||||||
commands:
|
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"
|
- 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
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
- yarn
|
- *install_pnpm
|
||||||
|
- pnpm i
|
||||||
|
|
||||||
yarn_lint:
|
lint:
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
- yarn lint
|
- *install_pnpm
|
||||||
|
- pnpm lint
|
||||||
|
|
||||||
yarn_build_dev:
|
build_dev:
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
- yarn build:dev
|
- *install_pnpm
|
||||||
|
- pnpm prebuild:dev
|
||||||
|
- pnpm build:dev
|
||||||
|
|
||||||
nightly_instance_crawl:
|
nightly_instance_crawl:
|
||||||
image: node:alpine
|
image: node:alpine
|
||||||
commands:
|
commands:
|
||||||
# libpq and openssl can probably be removed after lemmy dep is upgraded to 0.16.4+
|
# 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
|
- apk add cargo pkgconfig openssl openssl-dev libpq libpq-dev
|
||||||
- yarn crawl
|
- pnpm crawl
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- cron
|
- cron
|
||||||
|
@ -62,7 +69,7 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
# libpq and openssl can probably be removed after lemmy dep is upgraded to 0.16.4+
|
# 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
|
- apk add cargo pkgconfig openssl openssl-dev libpq libpq-dev
|
||||||
- yarn crawl
|
- pnpm crawl
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -19,19 +19,21 @@ FROM node:alpine as api
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY lemmy-js-client lemmy-js-client
|
COPY lemmy-js-client lemmy-js-client
|
||||||
WORKDIR /app/lemmy-js-client
|
WORKDIR /app/lemmy-js-client
|
||||||
RUN yarn
|
RUN corepack enable pnpm
|
||||||
RUN yarn docs
|
RUN pnpm i
|
||||||
|
RUN pnpm run docs
|
||||||
|
|
||||||
# Build the isomorphic app
|
# Build the isomorphic app
|
||||||
FROM node:alpine as builder
|
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 curl -sf https://gobinaries.com/tj/node-prune | sh
|
||||||
|
RUN corepack enable pnpm
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Cache deps
|
# Cache deps
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN yarn --production --prefer-offline --pure-lockfile
|
RUN pnpm i
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
COPY tsconfig.json \
|
COPY tsconfig.json \
|
||||||
|
@ -50,8 +52,9 @@ COPY src src
|
||||||
COPY --from=docs /app/docs ./src/assets/docs
|
COPY --from=docs /app/docs ./src/assets/docs
|
||||||
COPY --from=api /app/lemmy-js-client/docs ./src/assets/api
|
COPY --from=api /app/lemmy-js-client/docs ./src/assets/api
|
||||||
|
|
||||||
RUN yarn --production --prefer-offline
|
RUN pnpm i
|
||||||
RUN yarn build:prod
|
RUN pnpm prebuild:prod
|
||||||
|
RUN pnpm build:prod
|
||||||
|
|
||||||
# Prune the image
|
# Prune the image
|
||||||
RUN node-prune ./node_modules
|
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/typescript
|
||||||
RUN rm -rf ./node_modules/npm
|
RUN rm -rf ./node_modules/npm
|
||||||
|
|
||||||
RUN du -sh ./node_modules/* | sort -nr | grep '\dM.*'
|
|
||||||
|
|
||||||
FROM node:alpine as runner
|
FROM node:alpine as runner
|
||||||
COPY --from=builder /app/dist /app/dist
|
COPY --from=builder /app/dist /app/dist
|
||||||
COPY --from=builder /app/node_modules /app/node_modules
|
COPY --from=builder /app/node_modules /app/node_modules
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
# Update all the submodules and translations
|
# Update all the submodules and translations
|
||||||
./update_submodules.sh
|
./update_submodules.sh
|
||||||
|
|
||||||
yarn crawl
|
pnpm crawl
|
||||||
yarn update-donations
|
pnpm update-donations
|
||||||
git add "src/shared/instance_stats.ts"
|
git add "src/shared/instance_stats.ts"
|
||||||
git add "src/shared/donation_stats.ts"
|
git add "src/shared/donation_stats.ts"
|
||||||
git commit -m "Crawl and donation instance statistics"
|
git commit -m "Crawl and donation instance statistics"
|
||||||
|
|
|
@ -6,16 +6,16 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:dev": "webpack --mode=development",
|
"build:dev": "webpack --mode=development",
|
||||||
"build:prod": "webpack --mode=production",
|
"build:prod": "webpack --mode=production",
|
||||||
"clean": "yarn run rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"crawl": "node crawl.mjs",
|
"crawl": "node crawl.mjs",
|
||||||
"update-donations": "node update_donations.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}\"",
|
"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:dev": "pnpm clean && node generate_translations.mjs && pnpm tailwind && pnpm generate_rss_feed",
|
||||||
"prebuild:prod": "yarn clean && node generate_translations.mjs && yarn tailwind && yarn 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",
|
"generate_rss_feed": "node generate_rss_feed.mjs",
|
||||||
"tailwind": "tailwindcss -i ./src/style.css -o ./dist/styles/styles.css --minify",
|
"tailwind": "tailwindcss -i ./src/style.css -o ./dist/styles/styles.css --minify",
|
||||||
"prepare": "husky install",
|
"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",
|
"repository": "https://github.com/LemmyNet/joinlemmy-site",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -68,6 +68,7 @@
|
||||||
"eslint-plugin-prettier": "^5.0.1",
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"lint-staged": "^15.0.2",
|
"lint-staged": "^15.0.2",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
|
|
5842
pnpm-lock.yaml
Normal file
5842
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue