From 3f06b0551b9c97de8b9ae07902a3596697714ccb Mon Sep 17 00:00:00 2001 From: Yan Zhang Date: Tue, 30 Jan 2024 13:42:51 +0800 Subject: [PATCH 1/2] Add all-in-one pack script --- scripts/build-and-pack.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/build-and-pack.sh diff --git a/scripts/build-and-pack.sh b/scripts/build-and-pack.sh new file mode 100644 index 00000000..55f22c9a --- /dev/null +++ b/scripts/build-and-pack.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Stop on error. +set -e + +# Echo commands. +set -x + +# Get the directory of the script. +SCRIPT_DIR=$(dirname $(readlink -f $0)) + +# Get the directory of the project. +PROJECT_BASE_DIR=$(dirname $SCRIPT_DIR) + +# Change to the project directory. +cd $PROJECT_BASE_DIR + +# Install dependencies, build, and test. +npm ci +npm run build +npm run test + +# Create a tarball. +npm pack From c176593f13721608f7d20185dbf00a151d64f915 Mon Sep 17 00:00:00 2001 From: Yan Zhang Date: Tue, 30 Jan 2024 14:22:35 +0800 Subject: [PATCH 2/2] turn off debug mode, explicitly echo command instead --- scripts/build-and-pack.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/build-and-pack.sh b/scripts/build-and-pack.sh index 55f22c9a..dba0204c 100644 --- a/scripts/build-and-pack.sh +++ b/scripts/build-and-pack.sh @@ -3,9 +3,6 @@ # Stop on error. set -e -# Echo commands. -set -x - # Get the directory of the script. SCRIPT_DIR=$(dirname $(readlink -f $0)) @@ -16,9 +13,15 @@ PROJECT_BASE_DIR=$(dirname $SCRIPT_DIR) cd $PROJECT_BASE_DIR # Install dependencies, build, and test. +echo "npm clean install" npm ci + +echo "npm run build" npm run build + +echo "npm run test" npm run test # Create a tarball. +echo "npm pack" npm pack