-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add #94 Type support for http-logger added #178
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7b0a71e
WIP(http-logger): partially add type definitions and docs
ThulinaWickramasinghe 8535b0d
Merge branch 'main' into feat/type-support-http-module-logger
ThulinaWickramasinghe 4fbba31
Fix(http-logger): add proper type for loggable function
ThulinaWickramasinghe 262a974
Fix(http-logger): move types field in package.json to it's proper loc…
ThulinaWickramasinghe cf512ec
Fix(http-logger): add express to peer-dependencies
ThulinaWickramasinghe cc3c276
Refactor(http-logger): pass the entire request into loggable without …
ThulinaWickramasinghe 31db152
Fix(http-logger): add proper return type for loggable function
ThulinaWickramasinghe 99194c6
Docs(http-logger): updae docs for picking properties you want to log
ThulinaWickramasinghe 762b821
Fix(lockfile): update lock file
GIHAA 223c25a
Build(package-manager): remove strict pnpm version
ThulinaWickramasinghe a75a6a5
Build(package-manager): remove strict pnpm version
ThulinaWickramasinghe f34257f
Merge remote-tracking branch 'origin/main' into feat/type-support-htt…
Akalanka47000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
"prettier": "3.2.5" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"packageManager": "[email protected]" | ||
"node": ">=14.0.0", | ||
"pnpm": ">=7.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
{ | ||
"name": "@sliit-foss/http-logger", | ||
"version": "1.3.1", | ||
"description": "Http logging middleware for Express.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "bash ../../scripts/test/test.sh" | ||
}, | ||
"dependencies": { | ||
"@sliit-foss/module-logger": "1.3.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md", | ||
"keywords": [ | ||
"logging", | ||
"http-logging", | ||
"middleware" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
} | ||
} | ||
{ | ||
"name": "@sliit-foss/http-logger", | ||
"version": "1.3.1", | ||
"description": "Http logging middleware for Express.js", | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "bash ../../scripts/test/test.sh" | ||
}, | ||
"dependencies": { | ||
"@sliit-foss/module-logger": "1.3.1" | ||
}, | ||
"peerDependencies": { | ||
"express": "*" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md", | ||
"keywords": [ | ||
"logging", | ||
"http-logging", | ||
"middleware" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { RequestHandler, Request } from "express"; | ||
|
||
/** | ||
* @description Options for logging middleware function | ||
*/ | ||
type HttpLoggerOptions = { | ||
whitelists?: string[]; | ||
loggable?: string[] | ((req: Request) => object); | ||
}; | ||
|
||
/** | ||
* @description Creates a HTTP logging middleware for Express.js | ||
* @param {HttpLoggerOptions} options Add options to customize logging | ||
* @returns {RequestHandler} A middleware function which will log http requests | ||
*/ | ||
declare const httpLogger: (options: HttpLoggerOptions) => RequestHandler; | ||
|
||
export default httpLogger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
{ | ||
"name": "@sliit-foss/mongoose-aggregate-paginate-v2", | ||
"version": "1.0.0", | ||
"description": "A cursor based custom aggregate pagination library for Mongoose with customizable labels.", | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/express-http-context", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "if [ \"$CI\" = \"true\" ]; then \n bash ../../scripts/test/test.sh; else \n echo \"Skipping as it is not a CI environemnt\"; fi" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"keywords": [ | ||
"aggregate", | ||
"aggregate-paginate", | ||
"aggregate-pagination", | ||
"mongoose-aggregate", | ||
"mongoose", | ||
"pagination", | ||
"plugin", | ||
"mongodb", | ||
"paginate", | ||
"paging", | ||
"next", | ||
"prev", | ||
"nextpage", | ||
"prevpage", | ||
"total", | ||
"paginator", | ||
"plugin" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/plugins/mongoose-aggregate-paginate-v2#readme", | ||
"peerDependencies": { | ||
"mongoose": ">=7.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
} | ||
"name": "@sliit-foss/mongoose-aggregate-paginate-v2", | ||
"version": "1.0.0", | ||
"description": "A cursor based custom aggregate pagination library for Mongoose with customizable labels.", | ||
"main": "dist/index.js", | ||
"types": "types/index.d.ts", | ||
"scripts": { | ||
"build": "node ../../scripts/esbuild.config.js", | ||
"build:watch": "bash ../../scripts/esbuild.watch.sh", | ||
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/express-http-context", | ||
"lint": "bash ../../scripts/lint.sh", | ||
"release": "bash ../../scripts/release.sh", | ||
"test": "if [ \"$CI\" = \"true\" ]; then \n bash ../../scripts/test/test.sh; else \n echo \"Skipping as it is not a CI environemnt\"; fi" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sliit-foss/npm-catalogue.git" | ||
}, | ||
"keywords": [ | ||
"aggregate", | ||
"aggregate-paginate", | ||
"aggregate-pagination", | ||
"mongoose-aggregate", | ||
"mongoose", | ||
"pagination", | ||
"plugin", | ||
"mongodb", | ||
"paginate", | ||
"paging", | ||
"next", | ||
"prev", | ||
"nextpage", | ||
"prevpage", | ||
"total", | ||
"paginator", | ||
"plugin" | ||
], | ||
"author": "SLIIT FOSS", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sliit-foss/npm-catalogue/issues" | ||
}, | ||
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/plugins/mongoose-aggregate-paginate-v2#readme", | ||
"peerDependencies": { | ||
"mongoose": ">=7.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I searched a bit since I haven't seen pnpm being used here before, I found a few issues saying that this isn't supported, is it possible for you to see if it works right now, maybe try installing an older version of pnpm in a codespace and try pnpm i
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.
Will try.
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.
Seems to be working fine.