Skip to content

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

Merged
hhvrc merged 12 commits into
developfrom
feat/use-svelte-core
Jun 30, 2026
Merged

Consume @openshock/svelte-core in the captive portal#483
hhvrc merged 12 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

OK — 1 valid change file(s) added in this PR.

@stage-review

stage-review Bot commented Jun 26, 2026

Copy link
Copy Markdown

hhvrc and others added 7 commits June 26, 2026 16:17
Mirror the Frontend migration: replace the unpublished
@openshock/svelte-core registry dependency with a Turborepo
workspace git submodule at frontend/packages/svelte-core.

- Add svelte-core submodule (pinned to 94adb47, matching Frontend)
- pnpm workspace now includes packages/*; turbo.json drives build:deps
- package.json: svelte-core -> workspace:*, add core alias and turbo,
  prefix dev/build/check with pnpm build:deps
- Anchor root .gitignore packages -> /packages so it no longer
  ignores frontend/packages
- Ignore .turbo cache
svelte-core could resolve a different svelte patch (5.56.3) than the
captive-portal root, producing two unrelated Snippet types and
svelte-check errors. Add a pnpm override to force a single svelte
version, mirroring the frontend PR's dedupe fix.
The change file had bullet lines directly under the title with no
section header, so the release-tool parser counted 4 lines in the
title area and rejected it (only one title line is allowed above
sections). Move the detail bullets under a ## Release Note section.
@hhvrc hhvrc moved this from Todo to In Review in Roadmap Jun 30, 2026
@hhvrc hhvrc self-assigned this Jun 30, 2026
@hhvrc hhvrc merged commit 1312665 into develop Jun 30, 2026
36 checks passed
@hhvrc hhvrc deleted the feat/use-svelte-core branch June 30, 2026 00:28
@github-project-automation github-project-automation Bot moved this from In Review to Done in Roadmap Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants