mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-23 04:37:14 +02:00
tools.func: centralize Node.js corepack and npm handling in setup_nodejs() (#15268)
This commit is contained in:
committed by
GitHub
parent
c98d2da1bd
commit
b5c31d58f4
+3
-2
@@ -30,6 +30,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "bookorbit" "bookorbit/bookorbit"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop bookorbit
|
||||
@@ -42,7 +44,7 @@ function update_script() {
|
||||
msg_info "Rebuilding Application"
|
||||
cd /opt/bookorbit
|
||||
PNPM_VERSION=$(jq -r '.packageManager | ltrimstr("pnpm@")' /opt/bookorbit/package.json)
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare "pnpm@${PNPM_VERSION}" --activate
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm --filter client run build-only
|
||||
@@ -59,7 +61,6 @@ function update_script() {
|
||||
$STD uv pip install --python /opt/bookorbit-python/bin/python -r /opt/bookorbit/server/requirements/kobo-cloudscraper.txt
|
||||
msg_ok "Updated Kobo Python Runtime"
|
||||
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start bookorbit
|
||||
msg_ok "Started Service"
|
||||
|
||||
+3
-1
@@ -30,6 +30,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "databasus" "databasus/databasus"; then
|
||||
msg_info "Stopping Databasus"
|
||||
$STD systemctl stop databasus
|
||||
@@ -70,7 +72,7 @@ function update_script() {
|
||||
msg_info "Updating Databasus"
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
cd /opt/databasus/frontend
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare pnpm@latest --activate
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm run build
|
||||
|
||||
+3
-1
@@ -30,6 +30,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "feishin" "jeffvli/feishin"; then
|
||||
create_backup /opt/feishin/.env
|
||||
|
||||
@@ -38,7 +40,7 @@ function update_script() {
|
||||
msg_info "Rebuilding Feishin Web"
|
||||
cd /opt/feishin
|
||||
#PNPM_VERSION=$(jq -r '.packageManager | ltrimstr("pnpm@")' /opt/feishin/package.json)
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare "pnpm@10" --activate
|
||||
$STD pnpm install
|
||||
$STD pnpm run build:web
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ function update_script() {
|
||||
fi
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
NODE_VERSION="22" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "gramps-web-api" "gramps-project/gramps-web-api"; then
|
||||
msg_info "Stopping Service"
|
||||
@@ -84,7 +84,7 @@ function update_script() {
|
||||
msg_info "Updating Gramps Web Frontend"
|
||||
cd /opt/gramps-web/frontend
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable
|
||||
|
||||
$STD npm install
|
||||
$STD npm run build
|
||||
msg_ok "Updated Gramps Web Frontend"
|
||||
|
||||
+1
-2
@@ -168,13 +168,12 @@ EOF
|
||||
setup_uv
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Immich" "immich-app/immich" "tarball" "${RELEASE}" "$SRC_DIR"
|
||||
PNPM_VERSION="$(jq -r '.packageManager | split("@")[1] | split("+")[0]' ${SRC_DIR}/package.json)"
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack,pnpm@${PNPM_VERSION}" setup_nodejs
|
||||
|
||||
msg_info "Updating Immich web and microservices"
|
||||
cd "$SRC_DIR"/server
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
export CI=1
|
||||
corepack enable
|
||||
|
||||
# server build
|
||||
export SHARP_IGNORE_GLOBAL_LIBVIPS=true
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ function update_script() {
|
||||
cd /opt/invoiceshelf
|
||||
$STD composer install --no-dev --optimize-autoloader
|
||||
if command -v corepack >/dev/null 2>&1; then
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack yarn install
|
||||
$STD corepack yarn build
|
||||
else
|
||||
|
||||
+2
-2
@@ -89,11 +89,11 @@ EOF
|
||||
fi
|
||||
sed -i "s/^SERVER_VERSION=.*$/SERVER_VERSION=${CHECK_UPDATE_RELEASE#v}/" /etc/karakeep/karakeep.env
|
||||
MODULE_VERSION="$(jq -r '.packageManager | split("@")[1]' /opt/karakeep/package.json)"
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm@${MODULE_VERSION}" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack,pnpm@${MODULE_VERSION}" setup_nodejs
|
||||
setup_meilisearch
|
||||
|
||||
msg_info "Updating Karakeep"
|
||||
corepack enable
|
||||
|
||||
export PUPPETEER_SKIP_DOWNLOAD="true"
|
||||
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD="true"
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
if check_for_gh_release "linkwarden" "linkwarden/linkwarden"; then
|
||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
||||
NODE_VERSION="22" NODE_MODULE="corepack,yarn@latest" setup_nodejs
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop linkwarden
|
||||
msg_ok "Stopped Service"
|
||||
@@ -54,7 +54,7 @@ function update_script() {
|
||||
fi
|
||||
fi
|
||||
if command -v corepack >/dev/null 2>&1; then
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare "yarn@${yarn_ver}" --activate || true
|
||||
fi
|
||||
$STD yarn
|
||||
|
||||
+1
-3
@@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack,yarn" setup_nodejs
|
||||
ensure_dependencies f3d
|
||||
|
||||
if check_for_gh_release "manyfold" "manyfold3d/manyfold"; then
|
||||
@@ -65,8 +65,6 @@ function update_script() {
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Installing Manyfold"
|
||||
$STD npm install --global corepack
|
||||
$STD corepack enable yarn
|
||||
|
||||
sudo -u manyfold bash -c '
|
||||
source /opt/manyfold/.env
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ function update_script() {
|
||||
fi
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack,pnpm" setup_nodejs
|
||||
|
||||
if check_for_gh_release "metube" "alexta69/metube"; then
|
||||
msg_info "Stopping Service"
|
||||
@@ -60,7 +60,7 @@ function update_script() {
|
||||
msg_info "Building Frontend"
|
||||
cd /opt/metube/ui
|
||||
if command -v corepack >/dev/null 2>&1; then
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare pnpm --activate || true
|
||||
fi
|
||||
echo 'onlyBuiltDependencies=*' >> .npmrc
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "outline" "outline/outline"; then
|
||||
msg_info "Stopping Services"
|
||||
@@ -48,7 +48,7 @@ function update_script() {
|
||||
export NODE_ENV=development
|
||||
export NODE_OPTIONS="--max-old-space-size=3584"
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable
|
||||
|
||||
$STD yarn install --immutable
|
||||
export NODE_ENV=production
|
||||
$STD yarn build
|
||||
|
||||
+3
-1
@@ -30,6 +30,8 @@ function update_script() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "plane" "makeplane/plane"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop plane-api plane-worker plane-beat plane-live plane-space
|
||||
@@ -49,7 +51,7 @@ function update_script() {
|
||||
cd /opt/plane
|
||||
export NODE_OPTIONS="--max-old-space-size=4096"
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable pnpm
|
||||
|
||||
$STD pnpm install --frozen-lockfile
|
||||
$STD pnpm turbo run build --filter=web --filter=admin --filter=space --filter=live
|
||||
msg_ok "Rebuilt Frontend"
|
||||
|
||||
@@ -37,13 +37,13 @@ function update_script() {
|
||||
ensure_dependencies git
|
||||
|
||||
cp /opt/reactive-resume/.env /opt/reactive-resume.env.bak
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "reactive-resume" "amruthpillai/reactive-resume" "tarball" "latest" "/opt/reactive-resume"
|
||||
|
||||
msg_info "Updating Reactive Resume (Patience)"
|
||||
cd /opt/reactive-resume
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
corepack enable
|
||||
|
||||
corepack prepare --activate
|
||||
export CI="true"
|
||||
export NODE_ENV="production"
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ function update_script() {
|
||||
msg_info "Rebuilding Storyteller"
|
||||
cd /opt/storyteller
|
||||
export NODE_OPTIONS="--max-old-space-size=4096"
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack yarn install --network-timeout 600000
|
||||
$STD gcc -g -fPIC -rdynamic -shared web/sqlite/uuid.c -o web/sqlite/uuid.c.so
|
||||
export CI=1
|
||||
|
||||
+3
-1
@@ -31,6 +31,8 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
|
||||
|
||||
if check_for_gh_release "twenty" "twentyhq/twenty"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop twenty-worker twenty-server
|
||||
@@ -47,7 +49,7 @@ function update_script() {
|
||||
msg_info "Building Application"
|
||||
cd /opt/twenty
|
||||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||||
$STD corepack enable
|
||||
|
||||
$STD corepack prepare yarn@4.9.2 --activate
|
||||
export NODE_OPTIONS="--max-old-space-size=3072"
|
||||
$STD yarn install --immutable || $STD yarn install
|
||||
|
||||
Reference in New Issue
Block a user