From 486f0eeeb8e9fddf65b4e0d1cb8fc25ae41a33ea Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Fri, 8 Nov 2024 10:55:37 +1100 Subject: [PATCH] Improve watch command --- packages/alpine/package.json | 2 +- packages/core/package.json | 2 +- packages/core/src/validator.ts | 2 ++ packages/react-inertia/package.json | 2 +- packages/react/package.json | 2 +- packages/vue-inertia/package.json | 2 +- packages/vue/package.json | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/alpine/package.json b/packages/alpine/package.json index 9b647ab..7ecc33a 100644 --- a/packages/alpine/package.json +++ b/packages/alpine/package.json @@ -20,7 +20,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build", diff --git a/packages/core/package.json b/packages/core/package.json index 1c8b30d..d20d819 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -20,7 +20,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build", diff --git a/packages/core/src/validator.ts b/packages/core/src/validator.ts index 58a74be..cf2c5cd 100644 --- a/packages/core/src/validator.ts +++ b/packages/core/src/validator.ts @@ -294,6 +294,8 @@ export const createValidator = (callback: ValidationCallback, initialData: Recor */ const validate = (name?: string | NamedInputEvent, value?: unknown, config?: ValidationConfig): void => { if (typeof name === 'undefined') { + // validator.cancel() + validator(config ?? {}) return diff --git a/packages/react-inertia/package.json b/packages/react-inertia/package.json index 4835c31..b95b40d 100644 --- a/packages/react-inertia/package.json +++ b/packages/react-inertia/package.json @@ -21,7 +21,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build", diff --git a/packages/react/package.json b/packages/react/package.json index c5a0338..abf4fee 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -20,7 +20,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build", diff --git a/packages/vue-inertia/package.json b/packages/vue-inertia/package.json index a99a84f..076d6b3 100644 --- a/packages/vue-inertia/package.json +++ b/packages/vue-inertia/package.json @@ -21,7 +21,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build", diff --git a/packages/vue/package.json b/packages/vue/package.json index 1153755..a35a895 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -20,7 +20,7 @@ "/dist" ], "scripts": { - "watch": "rm -rf dist && tsc --watch", + "watch": "rm -rf dist && tsc --watch --preserveWatchOutput", "build": "rm -rf dist && tsc", "typeCheck": "tsc --noEmit", "prepublishOnly": "npm run build",