chore(devex): cache typegen in CI (#34030)

This commit is contained in:
Marius Andra
2025-06-23 13:12:08 +02:00
committed by GitHub
parent 21e084a201
commit 462c61f939
4 changed files with 17 additions and 8 deletions

View File

@@ -130,6 +130,14 @@ jobs:
key: ${{ runner.os }}-pnpm-cypress-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-cypress-
- name: Cache .typegen
if: needs.changes.outputs.frontend == 'true'
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: .typegen
key: ${{ runner.os }}-typegen-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-typegen-
- name: Install package.json dependencies with pnpm
if: needs.changes.outputs.frontend == 'true'
run: |

1
.gitignore vendored
View File

@@ -63,6 +63,7 @@ frontend/public/Matter*.woff* # Paid font
frontend/tmp
frontend/types/
frontend/src/products.tsx
.typegen
# ANTLR-generated temp files when "npm run grammar:build" crashes
gen/
max-test-venv/

View File

@@ -29,10 +29,10 @@
"start-no-typegen": "concurrently -n ESBUILD,TAILWIND -c yellow,green,blue \"pnpm start-http\" \"pnpm watch:tailwind\"",
"start-http": "pnpm clean && pnpm copy-scripts && pnpm build:esbuild --dev",
"start-docker": "pnpm start-http --host 0.0.0.0",
"typegen:write": "cd .. && NODE_OPTIONS=\"--max-old-space-size=16384\" kea-typegen write --delete --show-ts-errors",
"typegen:check": "cd .. && NODE_OPTIONS=\"--max-old-space-size=16384\" kea-typegen check",
"typegen:watch": "cd .. && NODE_OPTIONS=\"--max-old-space-size=16384\" kea-typegen watch --delete --show-ts-errors",
"typegen:clean": "cd .. && find frontend/src products common -type f -name '*Type.ts' -delete",
"typegen:watch": "cd .. && NODE_OPTIONS=\"--max-old-space-size=16384\" kea-typegen watch --delete --show-ts-errors --use-cache",
"typegen:write": "cd .. && NODE_OPTIONS=\"--max-old-space-size=16384\" kea-typegen write --delete --show-ts-errors --use-cache",
"schema:build:json": "ts-node ./bin/build-schema-json.mjs && prettier --write ./src/queries/schema.json",
"test": "SHARD_IDX=${SHARD_INDEX:-1}; SHARD_TOTAL=${SHARD_COUNT:-1}; echo $SHARD_IDX/$SHARD_TOTAL; pnpm build:products && jest --testPathPattern='(frontend/|products/|common/)' --runInBand --forceExit --shard=$SHARD_IDX/$SHARD_TOTAL",
"jest": "pnpm build:products && jest",
@@ -268,7 +268,7 @@
"jest-canvas-mock": "^2.4.0",
"jest-environment-jsdom": "^29.3.1",
"jest-image-snapshot": "^6.1.0",
"kea-typegen": "3.4.3",
"kea-typegen": "3.4.7",
"less": "^3.12.2",
"lint-staged": "~15.4.3",
"mockdate": "^3.0.5",

10
pnpm-lock.yaml generated
View File

@@ -1125,8 +1125,8 @@ importers:
specifier: ^6.1.0
version: 6.4.0(jest@29.7.0(@types/node@18.18.4)(ts-node@10.9.1(@swc/core@1.11.4(@swc/helpers@0.5.15))(@types/node@18.18.4)(typescript@5.2.2)))
kea-typegen:
specifier: 3.4.3
version: 3.4.3(typescript@5.2.2)
specifier: 3.4.7
version: 3.4.7(typescript@5.2.2)
less:
specifier: ^3.12.2
version: 3.13.1
@@ -12099,8 +12099,8 @@ packages:
peerDependencies:
kea: '>= 3'
kea-typegen@3.4.3:
resolution: {integrity: sha512-n4bMRsGKCbFlH7FL2BCKjhiYUaJ9cLChwqNly+Ypq7+lMaNZagoeprupyxxccUnT/z1Sc3f/m9qX/KpGOK34Dw==}
kea-typegen@3.4.7:
resolution: {integrity: sha512-/9yF0fqFHvNsM+ZB0k7ykAJcIfUhtXWNR6tzojivVmBlS9QYpoSIb6+UmFoXO77gHcT+HkhtzteS+kzCVtCxCg==}
hasBin: true
peerDependencies:
typescript: 5.2.2
@@ -30383,7 +30383,7 @@ snapshots:
kea: 3.1.5(react@18.2.0)
kea-waitfor: 0.2.1(kea@3.1.5(react@18.2.0))
kea-typegen@3.4.3(typescript@5.2.2):
kea-typegen@3.4.7(typescript@5.2.2):
dependencies:
'@babel/core': 7.26.0
'@babel/preset-env': 7.23.5(@babel/core@7.26.0)