Improve local development script

- Avoid running `npm install` on every execution
- Add a separate `install` task that runs `npm clean-install`
This commit is contained in:
daz 2024-11-14 17:00:58 -07:00
parent f4845d289c
commit 0e27ea7e6c
No known key found for this signature in database
2 changed files with 12 additions and 10 deletions

View file

@ -3,8 +3,9 @@
The `build` script in the project root provides a convenient way to perform many local build tasks: The `build` script in the project root provides a convenient way to perform many local build tasks:
1. `./build` will lint and compile typescript sources 1. `./build` will lint and compile typescript sources
2. `./build all` will lint and compile typescript and run unit tests 2. `./build all` will lint and compile typescript and run unit tests
3. `./build init-scripts` will run the init-script integration tests 3. `./build install` will install npm packages followed by lint and compile
4. `./build act <act-commands>` will run `act` after building local changes (see below) 4. `./build init-scripts` will run the init-script integration tests
5. `./build act <act-commands>` will run `act` after building local changes (see below)
## Using `act` to run integ-test workflows locally ## Using `act` to run integ-test workflows locally

17
build
View file

@ -4,12 +4,10 @@ cd sources
case "$1" in case "$1" in
all) all)
npm clean-install
npm run all npm run all
;; ;;
act) act)
# Build and copy outputs to the dist directory # Build and copy outputs to the dist directory
npm install
npm run build npm run build
cd .. cd ..
cp -r sources/dist . cp -r sources/dist .
@ -18,18 +16,21 @@ case "$1" in
# Revert the changes to the dist directory # Revert the changes to the dist directory
git checkout -- dist git checkout -- dist
;; ;;
init-scripts)
cd test/init-scripts
./gradlew check
;;
dist) dist)
npm install npm clean-install
npm run build npm run build
cd .. cd ..
cp -r sources/dist . cp -r sources/dist .
;; ;;
init-scripts)
cd test/init-scripts
./gradlew check
;;
install)
npm clean-install
npm run build
;;
*) *)
npm install
npm run build npm run build
;; ;;
esac esac