From f70b4f74b160cdbd596ddf7bcac5fcb31bab23e8 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 8 Feb 2024 05:23:48 +0100 Subject: [PATCH] Add watch script to rebuild on changes --- docs/contributing.md | 3 +++ package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index 44582f4a..eb5b82d1 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -81,6 +81,9 @@ Note that to use `clusterioctl` you will have to create a control config first: Once you've set up the cluster you can use `node packages/controller run` to run the controller and `node packages/host run` to run the host which connects to the controller. +When editing TypeScript files runned on Node.js you need run `pnpm build` in order to compile the files to JavaScript before restarting the controller/host/ctl for changes take effect. +To have TypeScript watch for changes and rebuild immediadly you may run `pnpm watch` instead. + For web development on the controller there are also the following flags: `--dev` - Recompile the `web_ui` package on the fly providing live reloading of it. diff --git a/package.json b/package.json index fbf50444..a5f4a506 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "scripts": { "build": "tsc --build", + "watch": "tsc --build --watch", "test": "pnpm run build && mocha --check-leaks -R spec --recursive test \"plugins/*/test/**\"", "fast-test": "FAST_TEST=y pnpm test", "cover": "nyc pnpm test",