From b51d51abd1365735d13f322a4453b889691a2fc9 Mon Sep 17 00:00:00 2001 From: Mihail Vratchanski Date: Mon, 30 Sep 2024 23:25:03 +0300 Subject: [PATCH] chore: touch up README (#362) Co-authored-by: Alex Eagle --- qwik/README.md | 39 +++++++++++++++++++++++---------------- qwik/app/package.json | 3 ++- qwik/lib/package.json | 1 + 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/qwik/README.md b/qwik/README.md index bd77be93..91ee92dc 100644 --- a/qwik/README.md +++ b/qwik/README.md @@ -3,29 +3,36 @@ In this folder you will find a monorepo example of a Qwik app and a Qwik library The app uses the library as an internal dependency. Using Bazel we can build and test both of them in parallel. -And using IBazel we can have a hot reload of the app when the library changes. +## About Bazel -## Commands: +See the [root README](/README.bazel.md) for general information about using Bazel in this monorepo. -### Build the example: -``` -bazel build //qwik/... -``` +## Developer Workflows -### Test the example: -``` +### Run Tests + +Do one of these: + +```shell +# Test the app using typical JS commands +cd qwik/app; npm test +# Test the lib using typical JS commands +cd qwik/lib; npm test +# Use the Bazel CLI directly, testing all apps and libs bazel test //qwik/... ``` -### Start the hot reload app server: -``` -ibazel run //qwik/app:devserver -``` -* On Linux the hot reload works just once (see alternative below) -* On MacOS the hot reload works as expected +### Start the App + +**With hot-reload**: -### For Linux you can use a slower approach like so (>5s for update): +```shell +cd qwik/app; npm run dev ``` -ibazel run //qwik/app:start + +**With vite restarting (>5s for update)**: + +```shell +./tools/ibazel run //qwik/app:start ``` \ No newline at end of file diff --git a/qwik/app/package.json b/qwik/app/package.json index 407730d9..cbc71b69 100644 --- a/qwik/app/package.json +++ b/qwik/app/package.json @@ -15,13 +15,14 @@ "build": "bazel build //qwik/app/...", "build.types": "tsc --incremental --noEmit", "deploy": "echo 'Run \"npm run qwik add\" to install a server adapter'", - "dev": "ibazel run //qwik/app:devserver", + "dev": "../../tools/ibazel run //qwik/app:devserver", "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force", "fmt": "prettier --write .", "fmt.check": "prettier --check .", "lint": "eslint \"src/**/*.ts*\"", "preview": "qwik build preview && vite preview --open", "start": "vite --open --mode ssr", + "test": "npm run test.unit", "test.unit": "bazel test //qwik/app/...", "test.unit.ui": "vitest --ui components", "qwik": "qwik" diff --git a/qwik/lib/package.json b/qwik/lib/package.json index fac1bf27..dd7734c9 100644 --- a/qwik/lib/package.json +++ b/qwik/lib/package.json @@ -31,6 +31,7 @@ "lint": "eslint \"src/**/*.ts*\"", "release": "np", "start": "vite --open --mode ssr", + "test": "npm run test.unit", "test.unit": "bazel test //qwik/lib/...", "test.unit.ui": "vitest --ui components", "qwik": "qwik"