mealie: copy Nuxt generate output and use pnpm when lockfile is present (#16938)

This commit is contained in:
Jamey Huffnagle
2026-09-02 05:59:56 -04:00
committed by GitHub
parent 4b5eed9acf
commit 4f82e6ec5a
2 changed files with 52 additions and 10 deletions
+26 -5
View File
@@ -33,7 +33,6 @@ function update_script() {
fi
if check_for_gh_release "mealie" "mealie-recipes/mealie"; then
PYTHON_VERSION="3.12" setup_uv
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
msg_info "Stopping Service"
systemctl stop mealie
@@ -67,6 +66,14 @@ STARTEOF
$STD uv sync --frozen --extra pgsql
msg_ok "Installed Python Dependencies"
if [[ -f /opt/mealie/frontend/pnpm-lock.yaml ]]; then
FRONTEND_PKG="pnpm"
NODE_MODULE="pnpm@11" NODE_VERSION="24" setup_nodejs
else
FRONTEND_PKG="yarn"
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
fi
msg_info "Building Frontend"
MEALIE_VERSION=$(<$HOME/.mealie)
SITE_SETTINGS=$(find /opt/mealie/frontend -name "site-settings.vue" -path "*/admin/*" | head -1)
@@ -75,14 +82,28 @@ STARTEOF
$STD sed -i "s|value: data.production ? i18n.t(\"about.production\") : i18n.t(\"about.development\"),|value: \"bare-metal\",|g" "$SITE_SETTINGS"
export NUXT_TELEMETRY_DISABLED=1
cd /opt/mealie/frontend
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production=false --network-timeout 1000000
$STD yarn generate
$STD yarn cache clean
if [[ "${FRONTEND_PKG}" == "pnpm" ]]; then
$STD pnpm install --prefer-offline --frozen-lockfile
$STD pnpm generate
$STD pnpm store prune
else
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production=false --network-timeout 1000000
$STD yarn generate
$STD yarn cache clean
fi
msg_ok "Built Frontend"
msg_info "Copying Built Frontend"
if [[ -n "$(ls -A /opt/mealie/frontend/.output/public 2>/dev/null)" ]]; then
FRONTEND_SRC="/opt/mealie/frontend/.output/public"
elif [[ -n "$(ls -A /opt/mealie/frontend/dist 2>/dev/null)" ]]; then
FRONTEND_SRC="/opt/mealie/frontend/dist"
else
msg_error "Frontend build output not found"
exit
fi
mkdir -p /opt/mealie/mealie/frontend
cp -r /opt/mealie/frontend/dist/* /opt/mealie/mealie/frontend/
cp -r "${FRONTEND_SRC}/." /opt/mealie/mealie/frontend/
msg_ok "Copied Frontend"
setup_nltk "averaged_perceptron_tagger_eng" "/nltk_data"
+26 -5
View File
@@ -29,10 +29,17 @@ msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv
PG_VERSION="16" setup_postgresql
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball"
PG_DB_NAME="mealie_db" PG_DB_USER="mealie_user" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
if [[ -f /opt/mealie/frontend/pnpm-lock.yaml ]]; then
FRONTEND_PKG="pnpm"
NODE_MODULE="pnpm@11" NODE_VERSION="24" setup_nodejs
else
FRONTEND_PKG="yarn"
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
fi
msg_info "Installing Python Dependencies with uv"
cd /opt/mealie
$STD uv sync --frozen --extra pgsql
@@ -46,14 +53,28 @@ SITE_SETTINGS=$(find /opt/mealie/frontend -name "site-settings.vue" -path "*/adm
$STD sed -i "s|https://github.com/mealie-recipes/mealie/commit/|https://github.com/mealie-recipes/mealie/releases/tag/|g" "$SITE_SETTINGS"
$STD sed -i "s|value: data.buildId,|value: \"v${MEALIE_VERSION}\",|g" "$SITE_SETTINGS"
$STD sed -i "s|value: data.production ? i18n.t(\"about.production\") : i18n.t(\"about.development\"),|value: \"bare-metal\",|g" "$SITE_SETTINGS"
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production=false --network-timeout 1000000
$STD yarn generate
$STD yarn cache clean
if [[ "${FRONTEND_PKG}" == "pnpm" ]]; then
$STD pnpm install --prefer-offline --frozen-lockfile
$STD pnpm generate
$STD pnpm store prune
else
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production=false --network-timeout 1000000
$STD yarn generate
$STD yarn cache clean
fi
msg_ok "Built Frontend"
msg_info "Copying Built Frontend"
if [[ -n "$(ls -A /opt/mealie/frontend/.output/public 2>/dev/null)" ]]; then
FRONTEND_SRC="/opt/mealie/frontend/.output/public"
elif [[ -n "$(ls -A /opt/mealie/frontend/dist 2>/dev/null)" ]]; then
FRONTEND_SRC="/opt/mealie/frontend/dist"
else
msg_error "Frontend build output not found"
exit
fi
mkdir -p /opt/mealie/mealie/frontend
cp -r /opt/mealie/frontend/dist/* /opt/mealie/mealie/frontend/
cp -r "${FRONTEND_SRC}/." /opt/mealie/mealie/frontend/
msg_ok "Copied Frontend"
setup_nltk "averaged_perceptron_tagger_eng" "/nltk_data"