From 5ae0f49eeb6f6df13dde2afdcb715ed553d58061 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 11 Aug 2026 14:46:43 +0200 Subject: [PATCH] chore: cache the vp openapi and test tasks (#32733) --- package.json | 3 --- vite.config.ts | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 57e3209ba..7a867133c 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,12 @@ "description": "evcc UI", "author": "evcc-io", "scripts": { - "build": "vp build", - "test": "cross-env TZ=Europe/Berlin NODE_OPTIONS=--no-experimental-webstorage vp test", "lint": "vp run lint:format && vp run lint:lint && vp run lint:tsc && vp run lint:i18n", "lint:format": "vp fmt assets tests i18n --write && vp fmt '**/*.{yaml,sh}' --write", "lint:lint": "vp lint --fix --max-warnings=0", "lint:tsc": "vue-tsc --noEmit", "lint:i18n": "tsx i18n/check.ts", "dev": "vp dev", - "openapi": "tsx scripts/state-schema/index.ts", "playwright": "playwright install && playwright test --ui", "playwright:ci": "cross-env CI=true playwright test", "simulator": "vp dev tests/simulator", diff --git a/vite.config.ts b/vite.config.ts index 122e25eed..1f27df5b5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,6 +14,24 @@ export default defineConfig({ cache: { scripts: true, }, + tasks: { + build: { + command: "vp build", + // node_modules layout differs between jobs that ran vitest and those that did not + input: [{ auto: true }, "!**/node_modules/**"], + }, + openapi: { + command: "tsx scripts/state-schema/index.ts", + // generated schema is an output, not an input + input: [{ auto: true }, "!server/openapi.state.yaml"], + }, + test: { + command: + "cross-env TZ=Europe/Berlin NODE_OPTIONS=--no-experimental-webstorage vp test", + // vitest keeps its own result cache below node_modules + input: [{ auto: true }, "!**/node_modules/.vite/**"], + }, + }, }, staged: { "*": "vp check --fix",