Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
[Unreleased]
Added
- Marketing-style
README.mddocumenting the full public API:Userbase class,UserEventsListener,setCurrentUser/getCurrentUser,UserInterface,UserInfo,UserCacheDriverInterface. - AI-agent skill cards under
skills/covering the user manager, cache drivers, events, permissions, the current-user pointer, and end-to-end recipes. llms.txtandllms-full.txtfor LLM-facing documentation discovery.- Vitest suite under
src/__tests__/covering login/logout transitions, access-token handling, dot-notation get/set, cache driver hydration onboot(), permissions checks, and event triggers. vitest.config.ts(Node environment) with monorepo-aware sibling resolution.- GitHub Actions CI workflow at
.github/workflows/test.ymlrunning the matrix Node 18 / 20 / 22 on Ubuntu plus Node 20 on Windows. package.json:sideEffects: false,scripts.test/scripts.test:watch,description, expandedkeywords, anddevDependenciesforvitestandtypescript.
Fixed
UserEventsListener.onBoot()now subscribes to theboottopic (previously subscribed tologout, so callbacks registered viaonBootnever fired from a real boot). (src/user-events-listener.ts:16)UserEventsListener.onKeyChange()now subscribes to thekeyChangetopic (previously subscribed tologout). (src/user-events-listener.ts:53)User.update()now emits the correct previous value asoldValuetokeyChangelisteners. Previouslythis.userDatawas reassigned before the per-key loop ran, sothis.get(key)inside the loop returned the new value, makingoldValueidentical tonewValue. The previous data is now captured before the assignment and indexed inside the loop. (src/user-manager.ts:170-174)User.update()no longer mutates the caller’suserDataargument. The input is now cloned at the top of the method, so writing the preserved access token back is done on the clone rather than the caller’s object. (src/user-manager.ts:163)
Changed (type-only break, runtime unchanged)
getCurrentUser()now returnsUser | undefinedinstead ofUser. The runtime always returnedundefinedbeforesetCurrentUserwas called; the type now reflects that. Consumers must handle the undefined case (e.g.getCurrentUser()?.isLoggedIn()or anif (user)guard). (src/current-user.ts:3,19)
Notes
- Public method signatures on
UserManagerare unchanged. Public function signatures ofonBoot/onKeyChange/ etc. are unchanged. The only signature change is the return type ofgetCurrentUser, documented above. - No runtime dependencies were added.