Skip to content

Commit

Permalink
perf: use Nx cache for Chromatic script (twentyhq#5457)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thaisguigon committed May 22, 2024
1 parent bb6df43 commit 35c1f97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion packages/twenty-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 35c1f97

Please sign in to comment.