Split @bearbones/vite into @klinking/panda-markers + @klinking/panda-shorthand#11
Merged
Conversation
Splits the monolithic @bearbones/vite package into two independent Panda plugins so consumers can install only the feature they want, and aligns the npm names with the @Klinking scope. - packages/panda-utils (renamed from @bearbones/utils, expanded private workspace): now hosts the shared codegen-patch contributor API, the AST anchor locator, transform-skeleton helpers, and the inline-templates Vite plugin (separate ./build entry). Inlined into both plugins via deps.alwaysBundle. - packages/panda-shorthand (renamed from @bearbones/vite, marker code stripped): owns the css() utility-string lowering only. Exports shorthandPreset(), shorthandPlugin() (definePlugin), shorthandHooks() (raw hooks bundle), and shorthandVitePlugin(). - packages/panda-markers (new): owns marker() declarations + relational- chain key lowering (StyleX-style .is.<relation>). Same four-shape API. Folds in the _dark/_light conditions from the now-deleted @bearbones/preset. The shared codegen-patch is now contributor-style: each plugin emits CssDtsPatch[] / CssMjsPatch[] and the shared appliers compose them via magic-string. The two plugins commute on disjoint AST nodes — markers replaces computed keys + the marker() RHS, shorthand replaces string- literal arg values — so order between the two doesn't change output. apps/website migrated to the new API. The current Vite-plugin architecture is preserved; #10 tracks the follow-up that would eliminate both Vite plugins via a runtime css() shim in the patched css.mjs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI was failing because the root package.json check script still used `--filter '@bearbones/*'` after the package rename. Also cleaned up stale @bearbones comment references in marker-registry and template. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Splits the monolithic
@bearbones/vitepackage into two independent Panda plugins under the@klinkingscope so consumers can install only the feature they want.@klinking/panda-utils(renamed from@bearbones/utils, expanded private workspace) — hosts the shared codegen-patch contributor API, AST anchor locator, transform-skeleton helpers, and the inline-templates Vite plugin (on a separate./buildentry). Inlined into both plugin packages viadeps.alwaysBundle.@klinking/panda-shorthand(renamed from@bearbones/vite, marker code stripped) — ownscss()utility-string lowering only.@klinking/panda-markers(new package) — ownsmarker()declarations + relational-chain key lowering. Folds in the_dark/_lightconditions from the now-deleted@bearbones/preset.Each plugin exports four shapes per the Panda hook-sharing pattern (https://panda-css.com/docs/concepts/hooks#sharing-hooks):
*Preset()—definePreset()for theme/conditions.*Plugin()—definePlugin()named plugin bundling hooks.*Hooks()— raw hooks object for hand-wired configs.*VitePlugin()— dev-server transform.Architecture
The shared codegen-patch is contributor-style: each plugin builds its own
CssDtsPatch[]/CssMjsPatch[]and the shared appliers in@klinking/panda-utilscompose them viamagic-string. The two plugins commute on disjoint AST node types — markers replaces computed property keys and themarker()RHS, shorthand replaces string-literal arg values — so install order doesn't matter.apps/websitemigrated to the new API:Root
vite.config.tstask DAG updated for the new package names.Follow-up
#10 tracks eliminating both Vite plugins by patching
css.mjswith a runtimecss()shim (utility-string lowering at runtime) — would make these packages bundler-agnostic, working anywhere Panda works without per-bundler integrations. Out of scope for this PR; current Vite-plugin architecture is preserved.Test plan
vp run -r buildsucceeds across all 5 workspacesvp run -r test— all 88 unit tests pass (49 markers + 22 shorthand + 17 utils)vp checkclean (formatting + lint + types)apps/websitepanda codegenemits acss.d.tswith both feature splices (17Bearbones*references) andcss.mjswith the marker stubtscpasses (type-tests still match against the patchedcss.d.ts)vp buildproduces a clean bundlevp devend-to-end in a browser🤖 Generated with Claude Code