Skip to content

Commit

Permalink
chore(deps): Bump to Elysia 1.0.10
Browse files Browse the repository at this point in the history
Elysia 1.0 introduces a breaking change for life cycle events.

> Starting from Elysia 1.0 RC, all lifecycle events including derive,
> and resolve will accept additional parameters
> { as: 'global' | 'local' } to specify if hook should be local or
> global which default to local

elysiajs/elysia#513

elysia-htmx 1.0.9 does not specify such an option, and so any use of the
plugin results in the `hx` property not being typed as available in the
parent Elysia instance's handlers.

This commit updates dependencies to Elysia 1.0.10 and adds the as:
"global" option to allow the hx parameter to be available in parent
Elysia instances.

This mirrors how the official Bearer token plugin does it:
https://github.com/elysiajs/elysia-bearer/blob/main/src/index.ts#L56

Signed-off-by: Snorre Magnus Davøen <post@snorre.io>
  • Loading branch information
snorremd committed Mar 29, 2024
1 parent d077e33 commit eb5aa9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions index.ts
Expand Up @@ -6,6 +6,7 @@ type Options = {

export const htmx = ({ disableCache }: Options = {}) => {
const app = new Elysia({ name: "htmx", seed: { disableCache } }).derive(
{ as: 'global' },
({ request: { headers }, set }): HtmxContext => {
return {
hx: {
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "elysia-htmx",
"description": "Elysia HTMX Context",
"version": "1.0.9",
"version": "1.0.10",
"homepage": "https://github.com/gtramontina/elysia-htmx.git",
"license": "MIT",
"module": "index.ts",
Expand All @@ -13,10 +13,10 @@
},
"devDependencies": {
"bun-types": "1.0.15",
"elysia": "0.7.30"
"elysia": "1.0.10"
},
"peerDependencies": {
"typescript": "^5.2.2",
"elysia": "^0.7.30"
"elysia": "^1.0.10"
}
}

0 comments on commit eb5aa9f

Please sign in to comment.