-
Notifications
You must be signed in to change notification settings - Fork 1
feat(elysia): add isolated Elysia 2 integration #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,13 +16,23 @@ | |
| "types": "./dist/index.d.cts", | ||
| "default": "./dist/index.cjs" | ||
| } | ||
| }, | ||
| "./next": { | ||
| "import": { | ||
| "types": "./dist/next.d.ts", | ||
| "default": "./dist/next.js" | ||
| }, | ||
| "require": { | ||
| "types": "./dist/next.d.cts", | ||
| "default": "./dist/next.cjs" | ||
| } | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsup", | ||
| "build": "tsup && node scripts/patch-next-declarations.mjs", | ||
| "test": "vitest run", | ||
| "typecheck": "tsc --noEmit", | ||
| "clean": "node -e \"require('fs').rmSync('dist', {recursive: true, force: true})\"" | ||
|
|
@@ -46,13 +56,15 @@ | |
| "@logtide/types": "workspace:*" | ||
| }, | ||
| "peerDependencies": { | ||
| "elysia": ">=1.0.0" | ||
| "elysia": ">=1.4.0 <2.0.0 || >=2.0.0-beta.4 <3.0.0" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Peer range wrong at both ends. It drops elysia 1.0-1.3 users (undocumented breaking change, the v1 plugin needs nothing newer), and npm semver only matches prereleases on the same |
||
| }, | ||
| "devDependencies": { | ||
| "@sinclair/typebox": "^0.34.48", | ||
| "elysia": "^1.2.0", | ||
| "elysia": "npm:elysia@latest", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Floating dist-tags decide what gets built and tested. Once Elysia promotes 2.0.0 to |
||
| "elysia-next": "npm:elysia@next", | ||
| "exact-mirror": "^1.2.4", | ||
| "file-type": "^22.0.0", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.5.4" | ||
| "typescript": "^5.7.0" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { readFile, writeFile } from 'node:fs/promises'; | ||
|
|
||
| await Promise.all( | ||
| ['dist/next.d.ts', 'dist/next.d.cts'].map(async (path) => { | ||
| const declaration = await readFile(path, 'utf8'); | ||
| const patched = declaration.replaceAll('elysia-next', 'elysia'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fragile in both directions. The blind |
||
|
|
||
| if (patched === declaration) { | ||
| throw new Error(`Expected ${path} to reference the elysia-next development alias`); | ||
| } | ||
|
|
||
| await writeFile(path, patched); | ||
| }) | ||
| ); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { logtide, type LogtideElysiaOptions } from './plugin-next'; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The security override no longer guards anything. pnpm's
pkg@rangeselector only matches semver-range specifiers, soelysia@<1.4.27does not apply tonpm:elysia@latest/@next, and the exact1.4.29pin will not pick up a future 1.4.30 fix. Suggest"elysia@<2": ">=1.4.27 <2".