ORM-agnostic entity management system with adapters for different state managers, organized as a monorepo for better modularity and performance.
The project is organized in separate packages to enable targeted usage and optimal tree-shaking:
entity-store/
├── packages/
│ ├── core/ # Pure business logic, 0 dependencies
│ ├── types/ # Shared types
│ ├── pinia-adapter/ # Pinia adapter
│ └── main/ # Main package with conditional exports
Agnostic package containing entity management business logic.
npm install @entity-store/coreFeatures:
createState(): Initial state creationcreateActions(): CRUD actions for entitiescreateGetters(): Getters for retrieving and filtering data
Pinia adapter with all core functionality.
npm install @entity-store/pinia-adapter piniaFeatures:
- Complete Pinia store with entity management
- Customizable extensions (state, getters, actions)
- Native integration with Vue ecosystem
Main package that exports everything, for simple usage.
npm install entity-storeimport { createPinia } from 'pinia'
import { entityStorePlugin } from '@entity-store/pinia-adapter'
const pinia = createPinia().use(entityStorePlugin)
app.use(pinia)
// In a Vue component
const userStore = useUserStore()
userStore.createOne({ id: 1, name: 'John', email: 'john@example.com' })import { createState, createActions, createGetters } from '@entity-store/core'
import type { WithId } from '@entity-store/types'
interface User extends WithId {
name: string
email: string
}
const state = createState<User>()
const actions = createActions<User>(state)
const getters = createGetters<User>(state)
// Usage
actions.createOne({ id: 1, name: 'John', email: 'john@example.com' })
const user = getters.getOne()(1)- Import only what you need
- Minimal bundle size for production
- Each package manages its own dependencies
- No conflicts between state managers
- Easy addition of new adapters
- Simplified maintenance per package
- Use core alone for an agnostic solution
- Or a specific adapter for native integration
pnpm installpnpm buildpnpm testpnpm dev- Zustand Adapter
- Redux Toolkit Adapter
- Jotai Adapter
- Valtio Adapter
- Pinia Plugin
- Migration tools
- Integration examples
Contributions are welcome! Each package can be developed and tested independently.
MIT