mirror of
https://github.com/LemmyNet/joinlemmy-site.git
synced 2024-11-30 08:11:18 +00:00
Moving from yarn to pnpm. (#297)
* Moving from yarn to pnpm. * Exclude pnp-lock. * Exclude pnp-lock 2. * Forgot 2 more. * Upgrading deps.
This commit is contained in:
parent
7676d816b3
commit
73a9bae2ff
8 changed files with 5893 additions and 9010 deletions
|
@ -1,4 +1 @@
|
||||||
#!/bin/sh
|
pnpm lint-staged
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
|
||||||
|
|
||||||
yarn 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
|
||||||
|
@ -16,29 +19,34 @@ steps:
|
||||||
prettier_markdown_check:
|
prettier_markdown_check:
|
||||||
image: tmknom/prettier:3.0.0
|
image: tmknom/prettier:3.0.0
|
||||||
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" "!pnpm-lock.yaml"
|
||||||
|
|
||||||
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
|
- *install_pnpm
|
||||||
|
- pnpm crawl
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- cron
|
- cron
|
||||||
|
@ -62,7 +70,8 @@ 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
|
- *install_pnpm
|
||||||
|
- 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"
|
||||||
|
|
27
package.json
27
package.json
|
@ -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",
|
||||||
"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": {
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||||
"@babel/plugin-transform-runtime": "^7.23.2",
|
"@babel/plugin-transform-runtime": "^7.23.2",
|
||||||
"@babel/plugin-transform-typescript": "^7.22.15",
|
"@babel/plugin-transform-typescript": "^7.22.15",
|
||||||
"@babel/preset-env": "7.23.2",
|
"@babel/preset-env": "7.23.9",
|
||||||
"@babel/preset-typescript": "^7.23.2",
|
"@babel/preset-typescript": "^7.23.2",
|
||||||
"@babel/runtime": "^7.23.2",
|
"@babel/runtime": "^7.23.2",
|
||||||
"@glidejs/glide": "3.5.2",
|
"@glidejs/glide": "3.5.2",
|
||||||
|
@ -32,9 +32,9 @@
|
||||||
"babel-plugin-inferno": "^6.7.0",
|
"babel-plugin-inferno": "^6.7.0",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
"clean-webpack-plugin": "^4.0.0",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
"countries-list": "^3.0.6",
|
"countries-list": "^3.0.6",
|
||||||
"daisyui": "^3.9.4",
|
"daisyui": "^4.6.0",
|
||||||
"express": "~4.18.2",
|
"express": "~4.18.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"i18next": "^23.6.0",
|
"i18next": "^23.6.0",
|
||||||
|
@ -45,12 +45,12 @@
|
||||||
"inferno-i18next": "github:nimbusec-oss/inferno-i18next#semver:^7.4.2",
|
"inferno-i18next": "github:nimbusec-oss/inferno-i18next#semver:^7.4.2",
|
||||||
"inferno-router": "^8.2.2",
|
"inferno-router": "^8.2.2",
|
||||||
"inferno-server": "^8.2.2",
|
"inferno-server": "^8.2.2",
|
||||||
"markdown-it": "^13.0.2",
|
"markdown-it": "^14.0.0",
|
||||||
"node-fetch": "^3.3.2",
|
"node-fetch": "^3.3.2",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"run-node-webpack-plugin": "^1.3.0",
|
"run-node-webpack-plugin": "^1.3.0",
|
||||||
"tailwindcss": "^3.3.5",
|
"tailwindcss": "^3.3.5",
|
||||||
"webpack": "5.89.0",
|
"webpack": "5.90.0",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-node-externals": "^3.0.0",
|
"webpack-node-externals": "^3.0.0",
|
||||||
"xml2js": "^0.6.2"
|
"xml2js": "^0.6.2"
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.17.20",
|
"@types/express": "^4.17.20",
|
||||||
"@types/glidejs__glide": "^3.6.3",
|
"@types/glidejs__glide": "^3.6.3",
|
||||||
"@types/node": "^20.8.10",
|
"@types/node": "^20.11.10",
|
||||||
"@types/node-fetch": "^2.6.8",
|
"@types/node-fetch": "^2.6.8",
|
||||||
"@types/qrcode": "^1.5.4",
|
"@types/qrcode": "^1.5.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
||||||
|
@ -66,12 +66,13 @@
|
||||||
"css-loader": "^6.8.1",
|
"css-loader": "^6.8.1",
|
||||||
"eslint": "^8.52.0",
|
"eslint": "^8.52.0",
|
||||||
"eslint-plugin-prettier": "^5.0.1",
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^9.0.6",
|
||||||
"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",
|
||||||
"sass-loader": "^13.3.2",
|
"sass-loader": "^14.0.0",
|
||||||
"style-loader": "^3.3.3",
|
"style-loader": "^3.3.3",
|
||||||
"terser": "^5.24.0",
|
"terser": "^5.24.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
5847
pnpm-lock.yaml
Normal file
5847
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@ module.exports = {
|
||||||
themes: [
|
themes: [
|
||||||
{
|
{
|
||||||
halloween: {
|
halloween: {
|
||||||
...require("daisyui/src/theming/themes")["[data-theme=halloween]"],
|
...require("daisyui/src/theming/themes")["halloween"],
|
||||||
primary: "#12D10E",
|
primary: "#12D10E",
|
||||||
secondary: "#06AFC6",
|
secondary: "#06AFC6",
|
||||||
"base-content": "#ffffff",
|
"base-content": "#ffffff",
|
||||||
|
|
Loading…
Reference in a new issue