Skip to content

Commit e6c4d8f

Browse files
thaisguigonWeiko
authored andcommitted
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.
1 parent 004f93e commit e6c4d8f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

nx.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,14 @@
218218
"executor": "nx:run-commands",
219219
"options": {
220220
"cwd": "{projectRoot}",
221-
"command": "cross-var chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --build-script-name={args.targetPackageJsonScript} {args.ci}",
222-
"targetPackageJsonScript": "storybook:build:chromatic"
221+
"commands": [
222+
{
223+
"command": "nx storybook:build {projectName} --configuration=test",
224+
"forwardAllArgs": false
225+
},
226+
"cross-var chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --storybook-build-dir=storybook-static {args.ci}"
227+
],
228+
"parallel": false
223229
},
224230
"configurations": {
225231
"ci": {

packages/twenty-front/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"build": "npx vite build && sh ./scripts/inject-runtime-env.sh",
88
"build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=4096 npx nx build",
9-
"storybook:build:chromatic": "nx storybook:build --configuration=test",
109
"start:prod": "NODE_ENV=production npx vite --host",
1110
"tsup": "npx tsup"
1211
},

0 commit comments

Comments
 (0)