From 34b4883fa65a3c0b75d019cd1aedda3d42ccfc63 Mon Sep 17 00:00:00 2001 From: Weyoss Date: Mon, 20 Nov 2023 17:52:28 +0100 Subject: [PATCH] chore: add npm scripts --- scripts/benchmark.sh | 16 ++++++++++++++++ scripts/build.sh | 18 ++++++++++++++++++ scripts/test.sh | 20 ++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100755 scripts/benchmark.sh create mode 100755 scripts/build.sh create mode 100755 scripts/test.sh diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh new file mode 100755 index 00000000..bd171234 --- /dev/null +++ b/scripts/benchmark.sh @@ -0,0 +1,16 @@ +# +# Copyright (c) +# Weyoss +# https://github.com/weyoss +# +# This source code is licensed under the MIT license found in the LICENSE file +# in the root directory of this source tree. +# + +set -x +set -e + +[ ! -d "misc/benchmarks" ] && exit 0 +cd misc/benchmarks +sudo docker-compose down --remove-orphans +sudo docker-compose run -e TM=5000 benchmark-runner \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..d4d4d48f --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,18 @@ +# +# Copyright (c) +# Weyoss +# https://github.com/weyoss +# +# This source code is licensed under the MIT license found in the LICENSE file +# in the root directory of this source tree. +# + +set -x +set -e + +npm run type-coverage +npm run lint +npm run format +rm -rf dist +tsc +cp -r src/common/redis-client/lua dist/src/common/redis-client/ \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 00000000..5eb49f1f --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,20 @@ +# +# Copyright (c) +# Weyoss +# https://github.com/weyoss +# +# This source code is licensed under the MIT license found in the LICENSE file +# in the root directory of this source tree. +# + +set -x +set -e + +export NODE_ENV=test +npm run build +cat >dist/package.json <