Merge remote-tracking branch 'origin/demodesk-client-v3' into v3

This commit is contained in:
Miroslav Šedivý
2024-06-23 17:57:19 +02:00
161 changed files with 26015 additions and 17 deletions

20
client/dev/api-gen Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
OPENAPI_URL="https://raw.githubusercontent.com/demodesk/neko/master/openapi.yaml"
rm -rf "${PWD}/../src/component/api"
mkdir "${PWD}/../src/component/api"
docker run --rm \
--user "$(id -u):$(id -g)" \
-v "${PWD}/../src/component/api:/local/out" \
openapitools/openapi-generator-cli generate \
-i "$OPENAPI_URL" \
-g typescript-axios \
-o /local/out \
--additional-properties=enumPropertyNaming=original,modelPropertyNaming=original,withSeparateModelsAndApi=true,modelPackage=models,apiPackage=api
# Remove not needed git_push.sh
rm -f "${PWD}/../src/component/api/git_push.sh"
# Fix lint errors
./npm run lint -- --fix src/component/api

12
client/dev/build Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"
APP_PATH="$(realpath ../)"
# start component watch
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="$APP_PATH" \
node:18-buster-slim run build

12
client/dev/exec Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"
APP_PATH="$(realpath ../)"
# start component watch
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="/bin/bash" \
--workdir="$APP_PATH" \
node:18-buster-slim

12
client/dev/npm Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
cd "$(dirname "$0")"
APP_PATH="$(realpath ../)"
# npm
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="$APP_PATH" \
node:18-buster-slim "$@"

40
client/dev/serve Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh
cd "$(dirname "$0")"
if [ -z $NEKO_PORT ]; then
NEKO_PORT="3000"
fi
if [ -z $NEKO_HOST ]; then
for i in $(ifconfig -l 2>/dev/null); do
NEKO_HOST=$(ipconfig getifaddr $i)
if [ ! -z $NEKO_HOST ]; then
break
fi
done
if [ -z $NEKO_HOST ]; then
NEKO_HOST=$(hostname -I 2>/dev/null | awk '{print $1}')
fi
if [ -z $NEKO_HOST ]; then
NEKO_HOST=$(hostname -i 2>/dev/null)
fi
fi
echo "Using app port: ${NEKO_PORT}"
echo "Using IP address: ${NEKO_HOST}"
APP_PATH="$(realpath ../)"
# npm run serve
docker run --rm -it \
-p 3001:3001 \
-e "NEKO_HOST=$NEKO_HOST" \
-e "NEKO_PORT=$NEKO_PORT" \
-e "VUE_APP_LOG_COLOR=true" \
--user "$(id -u):$(id -g)" \
--volume "$APP_PATH:$APP_PATH" \
--entrypoint="npm" \
--workdir="$APP_PATH" \
node:18-buster-slim run dev -- --port 3001 --host

23
client/dev/version Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
cd "$(dirname "$0")"
if ! git diff-index --quiet HEAD
then
echo "Please clean git before publishing."
exit
fi
# bump npm version
VERSION=$(./npm version "${1-patch}" --no-git-tag-version)
if [ $? -ne 0 ]; then
echo "Npm version bump failed."
exit
fi
VERSION=$(echo "$VERSION" | head -1 | cut -c 2- | tr -d '\r')
echo "New version is: $VERSION"
git add ../package*
git commit -m "version ${VERSION}"
git tag -a "v${VERSION}" -m "version ${VERSION}"
git push origin "v${VERSION}"