Skip to content

Commit c97b7a0

Browse files
fix: breaking changes with elysia v1.1.x (#32)
* renamed onResponse to onAfterResponse * updated elysia to v1.1.1 * possible fix to elysia v1.1.3 * added a compatibility matrix to readme
1 parent 65fc163 commit c97b7a0

File tree

10 files changed

+22
-8
lines changed

10 files changed

+22
-8
lines changed

.github/workflows/create-release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
create-release:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113

1214
steps:
1315
- uses: actions/checkout@v2

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# CHANGELOG
2+
3+
## Unreleased
4+
### Added
5+
- GitHub Actions to automate the release workflow. ([#29](https://github.com/cybercoder-naj/logestic/pull/29))
6+
27
## [1.2.0] - 27-05-2024
38
### Added
49
- New preset `commontz`, which is similar to `common` but logs the time in server's timezone. ([#28](https://github.com/cybercoder-naj/logestic/pull/28))

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ Add the package to your Elysia Project via [bun](https://bun.sh).
2424
```bash
2525
bun add logestic
2626
```
27-
**Note**: You must have `[email protected]` installed in your project.
27+
28+
## Compatibility Matrix
29+
30+
| Logestic Version | Elysia Version | Compatible? |
31+
| :--------------: | :------------: | :---------: |
32+
| <= v1.2.0 | v1.0.9 | ✅ |
33+
| v1.2.0 | v1.1.0 | ❌ |
34+
| v1.2.1 | v1.1.3 | ✅ |
2835
2936
## Usage
3037

bun.lockb

-1.58 KB
Binary file not shown.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
},
3131
"peerDependencies": {
3232
"typescript": "^5.0.0",
33-
"elysia": "^1.0.9"
33+
"elysia": "^1.1.3"
3434
},
3535
"devDependencies": {
3636
"@elysiajs/eden": "1.0.7",
3737
"bun-types": "latest",
38-
"elysia": "^1.0.9",
38+
"elysia": "^1.1.3",
3939
"rimraf": "^5.0.5",
4040
"typescript": "^5.4.3"
4141
},

preview/bun.lockb

-426 Bytes
Binary file not shown.

preview/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"homepage": "https://github.com/cybercoder-naj/logestic#readme",
1919
"dependencies": {
20-
"elysia": "^1.0.0",
20+
"elysia": "^1.1.3",
2121
"logestic": "file:.."
2222
}
2323
}

preview/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ const app = new Elysia()
1616
return 'Server crashed';
1717
})
1818
.listen(3000, () => {
19-
// console.log('Server is running on port 3000');
19+
console.log('Server is running on port 3000');
2020
});

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export class Logestic<K extends keyof Attribute = keyof Attribute> {
140140
this.log(msg);
141141
}
142142
})
143-
.onResponse({ as: 'global' }, ctx => {
143+
.onAfterResponse({ as: 'global' }, ctx => {
144144
if (!this.httpLogging) {
145145
return;
146146
}

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
8686
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
8787
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88-
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89-
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
88+
"noUnusedLocals": false, /* Enable error reporting when local variables aren't read. */
89+
"noUnusedParameters": false, /* Raise an error when a function parameter isn't read. */
9090
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
9191
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
9292
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */

0 commit comments

Comments
 (0)