ID:WORK-098Status:readyPriority:lowComplexity:trivialMilestone:v1.0.0
Vite plugin — behavior init helper export
Export a thin initBehaviors() wrapper from @refrakt-md/vite/behaviors that frameworks can call after navigation to re-initialize interactive rune behaviors (accordion, tabs, datatable, etc.).
Acceptance Criteria
@refrakt-md/vite/behaviorsexport path works (package.jsonexportsfield)initBehaviors(root?: Element)wrapsinitRuneBehaviors()from@refrakt-md/behaviors- Works in SPA re-navigation (SvelteKit
afterNavigate, VueonMounted/watch) - MPA frameworks (Astro) don't need it — behaviors self-init on page load
@refrakt-md/behaviorsis a dependency of@refrakt-md/vite- TypeScript types exported for the helper
Approach
- Add
src/behaviors.ts— thin wrapper aroundinitRuneBehaviors() - Add
./behaviorssubpath export inpackage.jsonexportsfield - Document usage patterns for SvelteKit, Vue/Nuxt, and Astro in JSDoc
Dependencies
- WORK-094 — package must exist first
References
- SPEC-031 (Behaviors section)
packages/behaviors/— source ofinitRuneBehaviors()