mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Frontend: Ensure that ESLint is installed and works as intended #3168
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -14,7 +14,9 @@ notice:
|
|||||||
install-npm:
|
install-npm:
|
||||||
sudo npm install --unsafe-perm=true --allow-root -g npm@latest npm-check-updates@latest license-report@latest
|
sudo npm install --unsafe-perm=true --allow-root -g npm@latest npm-check-updates@latest license-report@latest
|
||||||
install-testcafe:
|
install-testcafe:
|
||||||
sudo npm install --unsafe-perm=true --allow-root -g testcafe@3.6.2
|
npm install -g testcafe@latest
|
||||||
|
install-eslint:
|
||||||
|
npm install -g eslint@8 eslint-config-prettier eslint-config-standard eslint-formatter-pretty eslint-plugin-html eslint-plugin-import eslint-plugin-node eslint-plugin-prettier eslint-plugin-promise eslint-plugin-vue eslint-webpack-plugin vue-eslint-parser prettier
|
||||||
install:
|
install:
|
||||||
npm install --no-update-notifier --no-audit
|
npm install --no-update-notifier --no-audit
|
||||||
update:
|
update:
|
||||||
|
|||||||
53
scripts/dist/install-nodejs.sh
vendored
53
scripts/dist/install-nodejs.sh
vendored
@@ -5,12 +5,6 @@
|
|||||||
|
|
||||||
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH"
|
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH"
|
||||||
|
|
||||||
# Abort if not executed as root.
|
|
||||||
if [[ $(id -u) != "0" ]]; then
|
|
||||||
echo "Usage: run ${0##*/} as root" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
@@ -18,19 +12,46 @@ set -e
|
|||||||
# NodeJS version to be installed.
|
# NodeJS version to be installed.
|
||||||
NODE_MAJOR=22
|
NODE_MAJOR=22
|
||||||
|
|
||||||
# Download the signature key to "/etc/apt/keyrings/nodesource.gpg".
|
# Check if NodeJS is installed.
|
||||||
mkdir -p /etc/apt/keyrings
|
if which node > /dev/null
|
||||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
then
|
||||||
|
echo "NodeJS is already installed."
|
||||||
|
else
|
||||||
|
echo "Installing NodeJS and NPM from deb.nodesource.com..."
|
||||||
|
|
||||||
# Add node repository source to "/etc/apt/sources.list.d/nodesource.list".
|
# Download the signature key to "/etc/apt/keyrings/nodesource.gpg".
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
sudo mkdir -p /etc/apt/keyrings
|
||||||
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||||
|
|
||||||
echo "Installing NodeJS and NPM from deb.nodesource.com..."
|
# Add node repository source to "/etc/apt/sources.list.d/nodesource.list".
|
||||||
apt-get update && apt-get -qq install nodejs
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
|
||||||
|
|
||||||
|
sudo apt-get update && sudo apt-get -qq install nodejs
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if NPM is installed.
|
||||||
|
if which npm > /dev/null
|
||||||
|
then
|
||||||
|
echo "NPM is already installed."
|
||||||
|
else
|
||||||
|
echo "NPM is required to install these packages".
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Upgrade NPM and install development dependencies.
|
# Upgrade NPM and install development dependencies.
|
||||||
|
echo "Configuring NPM..."
|
||||||
|
sudo npm config set cache ~/.cache/npm
|
||||||
echo "Installing TestCafe..."
|
echo "Installing TestCafe..."
|
||||||
npm config set cache ~/.cache/npm
|
sudo npm install --unsafe-perm=true --allow-root -g \
|
||||||
npm install --unsafe-perm=true --allow-root -g npm@latest npm-check-updates@latest license-report@latest n@latest testcafe@3.6.2
|
npm@latest npm-check-updates@latest license-report@latest n@latest testcafe@3.7.1
|
||||||
|
echo "Installing ESLint..."
|
||||||
|
sudo npm install --unsafe-perm=true --allow-root -g \
|
||||||
|
eslint@8 eslint-config-prettier eslint-config-standard eslint-formatter-pretty \
|
||||||
|
eslint-plugin-html eslint-plugin-import eslint-plugin-node eslint-plugin-prettier \
|
||||||
|
eslint-plugin-promise eslint-plugin-vue eslint-webpack-plugin prettier
|
||||||
|
echo "Installing Vue Language Tools..."
|
||||||
|
sudo npm install --unsafe-perm=true --allow-root -g \
|
||||||
|
@vue/language-server @vue/typescript-plugin
|
||||||
|
echo "Updating NPM dependencies..."
|
||||||
|
sudo npm update --unsafe-perm=true --allow-root -g
|
||||||
echo "Done."
|
echo "Done."
|
||||||
Reference in New Issue
Block a user