diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml index 18e75b6a5c..8455024130 100644 --- a/.github/workflows/ci-frontend.yml +++ b/.github/workflows/ci-frontend.yml @@ -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: | diff --git a/.gitignore b/.gitignore index 60b3986cb2..233a60f797 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/frontend/package.json b/frontend/package.json index 454745cd0a..922f7e0614 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e9e9d55b59..645af4e2e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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)