Skip to content

Fix build errors in Svelte libraries#144

Open
gmjgeek wants to merge 6 commits intosillsdev:mainfrom
gmjgeek:svelte-library-refactor
Open

Fix build errors in Svelte libraries#144
gmjgeek wants to merge 6 commits intosillsdev:mainfrom
gmjgeek:svelte-library-refactor

Conversation

@gmjgeek
Copy link
Contributor

@gmjgeek gmjgeek commented Mar 16, 2026

Fixes packaging errors causing the Svelte language chooser to break in production.


This change is Reviewable


Open with Devin

Garrett Jones and others added 2 commits March 16, 2026 09:42
Convert language-chooser-svelte-daisyui from a Vite app into a proper
Svelte library using @sveltejs/package. This ships preprocessed .svelte
files in dist/ so consumers compile them in their own build pipeline,
fixing packaging and style issues when used in SvelteKit projects.

Add language-chooser-svelte-demo, a new SvelteKit app that consumes the
library and serves as the demo. SSR is enabled; Vite is configured with
ssr.noExternal for workspace packages and CJS transitive dependencies.

Also add .svelte-kit/ and .playwright-cli/ to .gitignore.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Garrett Jones and others added 2 commits March 21, 2026 20:21
Add "publishConfig": {"access": "public"} for consistency with other
publishable scoped packages in the repo, ensuring npm publish works
without needing --access public passed manually.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Override packageRoot to {projectRoot} so the package publishes from the
project root instead of dist/, matching the ./dist/... entry point paths.
Add files field to limit published contents to dist/ only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gmjgeek gmjgeek changed the title Refactor Svelte library for SvelteKit/SSR compatablility Refactor Svelte library for SvelteKit compatibility Mar 22, 2026
@gmjgeek gmjgeek changed the title Refactor Svelte library for SvelteKit compatibility Fix build errors in Svelte libraries Mar 22, 2026
@gmjgeek gmjgeek marked this pull request as ready for review March 22, 2026 05:40
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Choose a reason for hiding this comment

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

🚩 getOwnPropertyDescriptor trap returns raw SvelteField wrapper, not unwrapped value

In asUnwrapped at components/state-management/state-management-svelte/src/transform-view-model.ts:66-74, the getOwnPropertyDescriptor trap returns { value: (svelteFields as any)[prop] }, which is the raw SvelteField wrapper object for Field-backed properties. The get trap at line 38-39 returns the unwrapped .value. This inconsistency means Object.getOwnPropertyDescriptor(proxy, 'age')?.value would return the SvelteField wrapper, while proxy.age returns the inner value. The spread operator ({...proxy}) still works correctly because it uses the get trap, not the descriptor's value. This is pre-existing behavior not changed by this PR, but worth noting as a potential source of confusion.

(Refers to lines 66-74)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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