Installation
@basmilius/common ships as ESM and expects to live next to a Vue 3 application. It declares Vue, Vue Router and Pinia as peer dependencies, so you install them alongside the package itself.
shell
bun add @basmilius/common vue vue-router piniashell
npm install @basmilius/common vue vue-router piniashell
pnpm add @basmilius/common vue vue-router piniashell
yarn add @basmilius/common vue vue-router piniaPeer dependencies
The package will not install Vue, Vue Router or Pinia for you — they are listed as peers so the host application stays in control of the exact versions.
vue(3.x) — every composable depends on Vue's reactivity APIsvue-router(4.x) — required for everything in/common/router/pinia(3.x) — required fordefineStore
Optional: @basmilius/http-client
A few composables are tightly coupled to @basmilius/http-client. Add it when you plan to use them.
useDataTable— paginated data tables backed by aBaseResponse<Paginated<T>>useDtoForm— DTO-aware form refs that clone and mark cleanuseService— service-class proxy that wraps every method withguarded
shell
bun add @basmilius/http-clientImporting
All exports are named exports from the package root. The package is fully tree-shakeable, so unused composables and utilities are dropped from your bundle.
ts
import { useClickOutside, persistentRef } from '@basmilius/common';Requirements
- Node.js 20+ or Bun 1.x
- A bundler with native ESM support (Vite, Rollup, esbuild, ...)
- A browser environment for any composable that touches the DOM, such as
useClickOutside,useMutationObserver,useResizeObserveranduseLocalFile