Skip to content

fix: compile the standalone styles.css export instead of shipping raw Tailwind source - #52

Open
darrenapfel wants to merge 2 commits into
deepgram:mainfrom
darrenapfel:dx-reboot/wp23-triage
Open

fix: compile the standalone styles.css export instead of shipping raw Tailwind source#52
darrenapfel wants to merge 2 commits into
deepgram:mainfrom
darrenapfel:dx-reboot/wp23-triage

Conversation

@darrenapfel

Copy link
Copy Markdown

What this fixes. The published @deepgram/ui/styles.css export contains raw Tailwind version 4 source — @import "tailwindcss/..." and @plugin directives — because the build copies src/styles.css to dist/ verbatim (the copy-styles plugin in packages/ui/vite.config.ts). Any consumer who follows the README's import "@deepgram/ui/styles.css" instruction hits one of two failures: under current Vite (version 8, which minifies CSS with lightningcss), the build fails outright on the un-expanded @media prefix(dg) block; under older bundlers, the file passes through as CSS that browsers cannot interpret, so the import silently applies no styles.

The change. A second Vite pass (packages/ui/vite.styles.config.ts) compiles src/styles.css through the repository's existing @tailwindcss/vite plugin and writes the compiled output to dist/styles.css. The build script runs it after the main build. No new dependencies. The copy-styles plugin is removed from the main config. Two documentation fixes ride along: the root README's quick-start referenced an undefined conversation variable and could not compile — it now uses the useAgentConversation hook in a child component, matching the package README — and both READMEs gain a Status section stating the package's pre-1.0, experimental stage and naming @deepgram/sdk as the supported production path for the Voice Agent API.

Validation. npm run build passes (type check, main build, styles pass); dist/styles.css is now compiled CSS beginning with the Tailwind compiler banner. A clean-room Vite 8 application that installs the packed tarball and follows the corrected quick-start, including the styles.css import, builds cleanly and emits a 54.6-kilobyte compiled CSS asset; the identical application against the published 0.1.4 fails to build. The bun-based unit tests were not run locally (bun was unavailable on the build machine); please rely on this repository's continuous integration for them.

Provenance. This change was written by an artificial-intelligence coding agent operating on a local clone, at the direction of Darren Apfel, and was validated as described above. A human has reviewed the description; please review the diff with the usual scrutiny.

🤖 Generated with Claude Code

… raw Tailwind source

The build previously copied src/styles.css verbatim to dist/styles.css, so
the published @deepgram/ui/styles.css export contained Tailwind v4 source
directives (@import "tailwindcss/...", @plugin) rather than compiled CSS.
Any consumer following the README's 'import "@deepgram/ui/styles.css"'
failed to build under current Vite (lightningcss rejects the un-expanded
'@media prefix(dg)' block) and got no styles from the file under older
bundlers.

A second Vite pass (vite.styles.config.ts) now compiles the stylesheet
through the existing @tailwindcss/vite plugin; no new dependencies. Also:
- README quick start fixed: the example referenced an undefined
  'conversation' variable; it now uses the useAgentConversation hook in a
  child component, matching packages/ui/README.md.
- Status sections added to both READMEs stating the pre-1.0 nature of the
  package and naming @deepgram/sdk as the supported production path.

Validated: 'npm run build' passes (tsc, vite build, styles pass); a
clean-room Vite 8 app importing the packed tarball and styles.css builds
with a 54.6 kB compiled CSS asset, where 0.1.4 fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Deepgram Team on Vercel.

A member of the Team first needs to authorize it.

Removes the positioning claims from the Status sections (the
experimental label where it editorializes, and the steering of
production integrations to @deepgram/sdk) while keeping the factual
parts: pre-1.0, interfaces may change, release cadence, and the
sibling-package map. Staged as a variant for the wording-alignment
conversation Corey Weathers asked for; not pushed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@darrenapfel

Copy link
Copy Markdown
Author

Per review: the positioning sentences ("experimental" and the production-path steering toward @deepgram/sdk) are replaced with neutral factual status wording (pre-1.0, interfaces may change) pending the wording-alignment conversation — the full before/after set is documented, and either version can land once the positioning call is made.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant