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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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..."