Elysia 2 Plugin Scope Model
A working Elysia 2.0 auth plugin that encodes the four renames stale code trips over: route arguments are now (path, hook, handler) rather than (path, handler, hook), every lifecycle method dropped its on prefix (onAfterResponse became afterResponse, onStart became setup, onStop became cleanup), resolve and mapResolve were removed in favour of derive and mapDerive, and the third scope is 'plugin' with the type renamed from LifeCycleType to EventScope. Shows local, plugin, and global scope side by side, as('global') promotion on an ambient timing plugin, a v2 macro using the renamed derive key, and the derive-phase ordering rule that stops a macro derive from reading a mounted plugin's context.
npx shadcn@latest add https://ui.aryank.space/r/elysia-plugin-scope-model.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
An Elysia 2.0 auth plugin encodes the four renames stale code trips over, so scope and lifecycle hooks resolve under the new argument order. The 'plugin' scope reaches the app that opted in without infecting sibling instances.