WORK-098
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
changeset-release/main View source

Criteria completion

No incremental history — criteria tracking started on Apr 19.

Branches 2
changeset-release/main current ready
claude/file-naming-convention-LJdwR readymain ready
History 4
  1. f2b3512
    Content editedby Claude
    Add {ID}-{slug}.md filename convention + migrate filenames subcommand
  2. 59ded4a
    Content editedby Claude
    Implement SPEC-037 plan package hardening: all 7 work items
  3. f262d7b
    Content editedby Claude
    Backfill source attributes on all 123 work items
  4. 027eaee
    Created (ready)by Claude
    Add SPEC-031 work items for @refrakt-md/vite plugin (WORK-094 through WO

Acceptance Criteria

  • @refrakt-md/vite/behaviors export path works (package.json exports field)
  • initBehaviors(root?: Element) wraps initRuneBehaviors() from @refrakt-md/behaviors
  • Works in SPA re-navigation (SvelteKit afterNavigate, Vue onMounted/watch)
  • MPA frameworks (Astro) don't need it — behaviors self-init on page load
  • @refrakt-md/behaviors is a dependency of @refrakt-md/vite
  • TypeScript types exported for the helper

Approach

  1. Add src/behaviors.ts — thin wrapper around initRuneBehaviors()
  2. Add ./behaviors subpath export in package.json exports field
  3. 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 of initRuneBehaviors()