Skip to content

Consume @openshock/svelte-core in the captive portal#483

Open
hhvrc wants to merge 6 commits into
developfrom
feat/use-svelte-core
Open

Consume @openshock/svelte-core in the captive portal#483
hhvrc wants to merge 6 commits into
developfrom
feat/use-svelte-core

Conversation

@hhvrc

@hhvrc hhvrc commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

Migrate the captive-portal frontend to consume the shared @openshock/svelte-core library (^0.2.2) instead of vendoring its own copies of the shadcn UI, components, theme, and utilities.

How it consumes the library

  • Imports go through the package name and the library's JS barrels (@openshock/svelte-core/ui/*, /components, /stepper, /typeguards, …) — never raw .svelte file paths or filesystem aliases into dist. Raw .svelte/alias imports make Vite's dep optimizer crawl and pre-bundle the library, which breaks the dependency scan, hydration, and styling.
  • app.css imports @openshock/svelte-core/theme.css (the canonical design tokens + its self-registering Tailwind @source), replacing the inlined theme copy. Only the firmware-specific .kbd/.code helpers are kept. This is what makes Tailwind generate the library's component classes (otherwise components render misaligned/unstyled).
  • LightSwitch and the sonner Toaster are used in their self-contained form; the local ColorSchemeStore is removed in favour of svelte-core's color-scheme state (initializeColorScheme).
  • The $core/$hadcn aliases are removed from vite.config.ts ($lib kept).

Verification

  • svelte-check: 0 errors / 0 warnings
  • production build: clean (single-file portal)
  • dev server: renders correctly, theme/light-switch work

Mirrors the same migration done in the cloud frontend.


Open in Stage

hhvrc added 5 commits June 9, 2026 15:34
Bump @openshock/svelte-core to ^0.2.2 and consume it through package-name
subpaths and JS barrels (components, stepper, typeguards, ui/*) instead of
the $core/$hadcn filesystem aliases and raw .svelte file paths, which made
Vite's optimizer crawl/pre-bundle the library and break styling/hydration.

- LightSwitch and the sonner Toaster are now self-contained; drop the
  prop wiring and adopt svelte-core's color-scheme state
  (initializeColorScheme), removing the local ColorSchemeStore.
- app.css imports @openshock/svelte-core/theme.css (canonical design
  tokens + self-registering Tailwind @source) instead of an inlined copy,
  keeping only the firmware-specific .kbd/.code helpers.
- Remove $core/$hadcn aliases from vite.config.ts (keep $lib).
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Change file check

Invalid format — an added change file failed validation:

invalid change files:
  - frontend-svelte-core.md: only a single title line is allowed above sections, got 4 lines

@stage-review

stage-review Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant