Repository navigation
Conversation
Allow published design systems to bundle configuration helpers without retaining a runtime dependency on @pandacss/dev.
🦋 Changeset detectedLatest commit: 72f15ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@castrog is attempting to deploy a commit to the Chakra UI Team on Vercel. A member of the Team first needs to authorize it. |
Exercise the built ESM and CommonJS package exports so source aliases cannot hide a missing or misconfigured distribution artifact.
Generate the package export fixture in a temporary directory so the test cannot depend on missing or stale dist output.
|
Thanks for this, and for doing the v2 version in #3811. That's where we'd like this to live. v1 is mostly getting fixes at this point, and this one has a workaround there: import the types only and use import type { PatternConfig } from '@pandacss/dev'
export const stack = { ... } satisfies PatternConfigWhen you move to v2, |
Summary
@pandacss/dev/defineentry point for configuration helpers.@pandacss/devimports through root re-exports.defineTokens.colors().Why
I use Panda’s definition helpers in a published design-system package. When the library build externalizes
@pandacss/dev, calls such asdefinePattern(...)remain in the emitted JavaScript. Production SSR then requires a package that was only installed for development and fails withERR_MODULE_NOT_FOUNDwhen it is absent.Bundlers externalize modules rather than individual exports. The dedicated entry point allows a library to bundle these small helpers while continuing to externalize the rest of
@pandacss/dev:definePartsremains on the root entry point because it depends onPandaError. Including it would add an@pandacss/sharedruntime dependency to the new entry point. Existing root imports and behavior remain unchanged.If this API direction works for the project, I can follow with the equivalent v2 change so design systems can use the same import path while migrating.
Verification
pnpm --filter @pandacss/dev... build-fastpnpm --filter @pandacss/dev buildpnpm test packages/cligit diff --checknoExternal: ['@pandacss/dev/define']; the output contained only the imported helper, retained no Panda imports, and ran successfully.The implementation appears safe to merge, with a non-blocking test coverage gap around the generated package entry point.
Fix with agent prompt
Summary
src/define.ts, leavingdefinePartson the root entry point.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR Library[Published design-system source] -->|imports helpers| Define["@pandacss/dev/define"] Define --> Helpers["Dependency-free define helpers"] Library -->|tsup noExternal| Bundle[Bundled library output] Helpers --> Bundle Root["@pandacss/dev root entry"] -->|re-exports| Helpers Root --> Parts["defineParts and PandaError dependency"]Reviews (1) · Last reviewed commit: "feat(dev): add a bundleable define entry..."