Skip to content

fix(smrt-svelte): publish import conditions for svelte exports#1079

Merged
willgriffin merged 1 commit intomainfrom
codex/fix-smrt-svelte-style-packaging
Mar 25, 2026
Merged

fix(smrt-svelte): publish import conditions for svelte exports#1079
willgriffin merged 1 commit intomainfrom
codex/fix-smrt-svelte-style-packaging

Conversation

@willgriffin
Copy link
Copy Markdown
Contributor

Summary

  • add explicit import conditions to @happyvertical/smrt-svelte export entries alongside the existing svelte condition
  • keep the package surface unchanged while making the published metadata match the rest of the SMRT Svelte packages
  • address the consuming Vite/SvelteKit dev runtime failure we hit in anytown.ai

Problem

In anytown.ai after bumping to @happyvertical/smrt-svelte@0.21.16, the dashboard dev server started logging a Vite/PostCSS internal error while loading package styles from @happyvertical/smrt-svelte, for example:

.../dist/components/forms/Select.svelte?svelte&type=style&lang.css: Unknown word Snippet

That symptom came from Vite trying to treat the raw .svelte source as plain CSS instead of honoring the Svelte package entrypoint metadata.

smrt-svelte was the outlier here: its exports only published default for the JS entrypoints, while other SMRT Svelte surfaces publish explicit import conditions.

Testing

  • pnpm -C packages/smrt-svelte check
  • pnpm -C packages/smrt-svelte build
  • re-ran the anytown.ai dashboard route load against this patched package metadata and the earlier smrt-svelte CSS parse error no longer appeared in the Vite server log

Copilot AI review requested due to automatic review settings March 25, 2026 21:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates @happyvertical/smrt-svelte’s published exports metadata to include explicit "import" conditions alongside existing "svelte" conditions, aligning it with the other SMRT Svelte packages and preventing Vite/SvelteKit from mis-resolving Svelte sources as plain CSS.

Changes:

  • Added "import" conditions for the root export and each Svelte component subpath export.
  • Added "import" conditions for ./registry, ./themes, and ./browser-ai entrypoints where applicable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willgriffin willgriffin merged commit 36ce916 into main Mar 25, 2026
16 checks passed
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.

2 participants