Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

ci: cache Next.js build + drop redundant theme transpilation (#1384)

Cindy Zhang98192ac38e49
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3ebe4565c8..dd77837836 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -98,6 +98,16 @@ jobs:
- name: Typecheck template docs
run: yarn workspace @xds/cli typecheck:template-docs
+ - name: Cache Next.js build
+ if: github.event_name == 'pull_request'
+ uses: actions/cache@v4
+ with:
+ path: apps/sandbox/.next/cache
+ key: nextjs-sandbox-${{ hashFiles('yarn.lock') }}-${{ hashFiles('packages/core/dist/**') }}
+ restore-keys: |
+ nextjs-sandbox-${{ hashFiles('yarn.lock') }}-
+ nextjs-sandbox-
+
- name: Build Storybook
run: yarn workspace @xds/storybook build
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 4950e95331..1e375c45c9 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -83,6 +83,15 @@ jobs:
- name: Build Storybook
run: yarn workspace @xds/storybook build
+ - name: Cache Next.js build
+ uses: actions/cache@v4
+ with:
+ path: apps/sandbox/.next/cache
+ key: nextjs-sandbox-${{ hashFiles('yarn.lock') }}-${{ hashFiles('packages/core/dist/**') }}
+ restore-keys: |
+ nextjs-sandbox-${{ hashFiles('yarn.lock') }}-
+ nextjs-sandbox-
+
- name: Build Sandbox
run: yarn workspace @xds/sandbox build
env:
diff --git a/apps/sandbox/next.config.mjs b/apps/sandbox/next.config.mjs
index 92c3c66040..b938bd2a63 100644
--- a/apps/sandbox/next.config.mjs
+++ b/apps/sandbox/next.config.mjs
@@ -26,12 +26,9 @@ const nextConfig = {
},
transpilePackages: [
// Only transpile @xds/core in source mode — in dist mode, it's pre-built.
+ // Theme packages are NOT listed here — their exports already resolve to
+ // pre-compiled dist/ files (ESM + CSS), so re-transpilation is wasted work.
...(useSource ? ['@xds/core'] : []),
- '@xds/theme-default',
- '@xds/theme-neutral',
- '@xds/theme-brutalist',
- '@xds/theme-meta',
- '@xds/theme-daily',
],
images: {
unoptimized: true,