From 35c1f97511977cf9d6179416e5cb52cfe2468473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tha=C3=AFs?= Date: Wed, 22 May 2024 11:18:16 +0200 Subject: [PATCH] perf: use Nx cache for Chromatic script (#5457) Makes sure the `twenty-front:chromatic:ci` task in the CI job `front-chromatic-deployment` reuses the cache of the Storybook built in the CI job `front-sb-build` instead of re-building Storybook so Chromatic is deployed faster in the CI. --- nx.json | 10 ++++++++-- packages/twenty-front/package.json | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/nx.json b/nx.json index 9dabefb84..40a7d1a3d 100644 --- a/nx.json +++ b/nx.json @@ -218,8 +218,14 @@ "executor": "nx:run-commands", "options": { "cwd": "{projectRoot}", - "command": "cross-var chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name={args.targetPackageJsonScript} {args.ci}", - "targetPackageJsonScript": "storybook:build:chromatic" + "commands": [ + { + "command": "nx storybook:build {projectName} --configuration=test", + "forwardAllArgs": false + }, + "cross-var chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --storybook-build-dir=storybook-static {args.ci}" + ], + "parallel": false }, "configurations": { "ci": { diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.json index 7d7e2f2e0..4e0aef8f4 100644 --- a/packages/twenty-front/package.json +++ b/packages/twenty-front/package.json @@ -6,7 +6,6 @@ "scripts": { "build": "npx vite build && sh ./scripts/inject-runtime-env.sh", "build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=4096 npx nx build", - "storybook:build:chromatic": "nx storybook:build --configuration=test", "start:prod": "NODE_ENV=production npx vite --host", "tsup": "npx tsup" },