ID:WORK-098Status:ready
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.).
Priority:lowComplexity:trivialMilestone:v1.0.0Source:SPEC-031
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
- Create @refrakt-md/vite plugin — Level 1 static transform — package must exist first
References
- Vite Plugin — Framework-Agnostic Rune Integration (Behaviors section)
packages/behaviors/— source ofinitRuneBehaviors()