@shiage/core
v0.1.1
Published
Framework-agnostic core for Shiage: CSS→Tailwind mapper, JSX AST editor, WebSocket protocol, diff generation.
Maintainers
Readme
@shiage/core
Framework-agnostic core for Shiage: the version-agnostic CSS→Tailwind mapper, the JSX AST editor, the WebSocket protocol types, the diff generator, and the Node-side dev-server plumbing.
Most users want
@shiage/viteor@shiage/next— those depend on this package and wire it into a real framework dev server. Install@shiage/coredirectly only if you're building a new framework adapter.
What's inside
tailwind/— theThemeSourceabstraction over Tailwind v3 and v4. v4 drives__unstable__loadDesignSystemfrom@tailwindcss/nodeand inverts itscandidatesToCss/getClassListoutput; v3 is shimmed fromjiti+tailwindcss/resolveConfig. Same downstream behavior on both.mapper/—mapChangesToClassEdits(changes, className, lookup, source)— the shorthand-aware mapper that produces the class edits the AST editor applies.ast/—editJsxFile(filePath, line, col, edits)— locates an element by its stampeddata-shiage-locand rewrites itsclassNameviamagic-string(never regenerates JSX, so formatting is preserved).protocol/—ClientMessage,ServerMessage,PROTOCOL_VERSION. Browser-safe; zero Node code. Imported from the runtime via the./protocolsubpath.supported—SUPPORTED_PROPERTIES+SUPPORTED_PROPERTY_LIST. Single source of truth that drivesSUPPORTED_PROPERTIES.md.server/—startWsServer,wireProtocol,startShiageServer— Node-only plumbing reused by the Vite and Next plugins.
@shiage/core has "sideEffects": false so the runtime can tree-shake-import the
browser-safe subpaths into its IIFE without pulling Node code.
License
MIT — © 2026 Horace Choi.
