Skip to content

Commit bd2f0a1

Browse files
segunadebayoclaude
andauthored
fix(ci): run codegen/build explicitly for vercel deploys under pnpm 11 (#3548)
* fix(builder): prevent re-polyfilling of user's layer order declaration when polyfill is enabled * fix(ci): run codegen/build explicitly for vercel deploys under pnpm 11 pnpm 11 no longer fires the install-time root `prepare` (build-fast) on Vercel, so each deploy hit a missing artifact. Move the build prerequisites into explicit `pre<script>` hooks instead of relying on the lifecycle: - website: prebuild now runs `panda codegen` (generates styled-system) - playground: add prebuild to build packages + db:generate + css:codegen - studio: add predeploy-studio to build packages so cli/dist exists before `node ../cli/bin.js codegen` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b08bb83 commit bd2f0a1

5 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@pandacss/node': patch
3+
---
4+
5+
Fix `polyfill: true` leaving the user's `@layer reset, base, tokens, recipes, utilities;` order declaration in the
6+
PostCSS plugin output.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"release-dev": "changeset version --snapshot dev && changeset publish --tag dev",
2828
"prepare-studio": "pnpm --filter=./packages/studio codegen",
2929
"build-studio": "pnpm --filter=./sandbox/vite-ts exec pnpm panda studio --build",
30+
"predeploy-studio": "pnpm build-fast",
3031
"deploy-studio": "pnpm prepare-studio && pnpm build-studio",
3132
"serve-studio": "npx serve ./sandbox/vite-ts/styled-system-studio",
3233
"website": "pnpm --filter=./website",

packages/node/src/builder.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ export class Builder {
196196
ctx.appendBaselineCss(sheet)
197197
const css = ctx.getCss(sheet)
198198

199+
// Panda's emitted CSS is already polyfilled, so the user's bare layer
200+
// order declaration would force downstream tools to re-polyfill.
201+
if (ctx.config.polyfill) {
202+
root.walkAtRules('layer', (rule) => {
203+
if (!rule.nodes && ctx.isValidLayerParams(rule.params)) rule.remove()
204+
})
205+
}
206+
199207
root.append(css)
200208
}
201209

playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"css:codegen": "pnpm panda codegen --silent",
77
"types:codegen": "tsx scripts/bundle-types.mts",
88
"prepare": "pnpm db:generate && pnpm css:codegen",
9+
"prebuild": "pnpm --filter=../packages/** build && pnpm db:generate && pnpm css:codegen",
910
"build": "pnpm types:codegen && next build",
1011
"start": "next start",
1112
"lint": "eslint .",

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build:content": "velite --clean",
1212
"build:next": "next build",
1313
"build": "run-s build:*",
14-
"prebuild": "pnpm --filter=../packages/** build",
14+
"prebuild": "pnpm --filter=../packages/** build && panda codegen",
1515
"lint": "eslint . --max-warnings 0",
1616
"start": "next start"
1717
},

0 commit comments

Comments
 (0)