[ci] Add caching support to format and knip commands (#5107)

- Enable caching for prettier and knip commands to improve CI performance
- Add no-cache variants for consistency with existing lint scripts
- Exclude generated type files from prettier formatting
- Add .prettiercache to .gitignore for proper cache management

Follows the same optimization pattern as ESLint caching from PR #4926.
This commit is contained in:
Christian Byrne
2025-08-19 12:33:55 -07:00
committed by GitHub
parent 28d74be363
commit 694817297d
3 changed files with 10 additions and 4 deletions

3
.gitignore vendored
View File

@@ -13,8 +13,9 @@ bun.lockb
pnpm-lock.yaml
yarn.lock
# ESLint cache
# Cache files
.eslintcache
.prettiercache
node_modules
dist

2
.prettierignore Normal file
View File

@@ -0,0 +1,2 @@
src/types/comfyRegistryTypes.ts
src/types/generatedManagerTypes.ts

View File

@@ -14,8 +14,10 @@
"build:types": "vite build --config vite.types.config.mts && node scripts/prepare-types.js",
"zipdist": "node scripts/zipdist.js",
"typecheck": "vue-tsc --noEmit",
"format": "prettier --write './**/*.{js,ts,tsx,vue,mts}'",
"format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
"format": "prettier --write './**/*.{js,ts,tsx,vue,mts}' --cache",
"format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}' --cache",
"format:no-cache": "prettier --write './**/*.{js,ts,tsx,vue,mts}'",
"format:check:no-cache": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
"test:browser": "npx playwright test",
"test:unit": "vitest run tests-ui/tests",
"test:component": "vitest run src/components/",
@@ -25,7 +27,8 @@
"lint:fix": "eslint src --cache --fix",
"lint:no-cache": "eslint src",
"lint:fix:no-cache": "eslint src --fix",
"knip": "knip",
"knip": "knip --cache",
"knip:no-cache": "knip",
"locale": "lobe-i18n locale",
"collect-i18n": "playwright test --config=playwright.i18n.config.ts",
"json-schema": "tsx scripts/generate-json-schema.ts",