Skip to content

Conversation

aarontravass
Copy link
Member

As stated in #2 , this configuration will output logs to a file.


export class FileLogger {
private readonly filename: string
private readonly dirname: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use private property methods instead, aka #dirname


private _stat() {
//check if file exists
if (existsSync(this.filename)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existsSync is deprecated, you should use fs.access API with a special code, I think it's F_OK

@socket-security
Copy link

socket-security bot commented May 27, 2023

No dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

⚠️ Please accept the latest app permissions to ensure bot commands work properly. Accept the new permissions here.

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

@aarontravass
Copy link
Member Author

I was getting this error during build

> @tinyhttp/logger@1.3.4 build C:\Users\aaron\Documents\projects\logger
> rollup -c

(node:33272) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

src/index.ts  dist...
(!) Plugin typescript: @rollup/plugin-typescript TS2354: This syntax requires an imported helper but module 'tslib' cannot be found.
src/filelogger.ts: (9:5)

9     this.#dirname = directoryname(filename)
      ~~~~~~~~~~~~~

(!) Plugin typescript: @rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
(!) Plugin typescript: @rollup/plugin-typescript: outputToFilesystem option is defaulting to true.
(!) Unresolved dependencies
https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
fs (imported by "src/filelogger.ts")
path (imported by "src/filelogger.ts")
created dist in 2.3s

hence I added tslib

package.json Outdated
"eslint-plugin-prettier": "^4.2.1",
"expect": "^29.5.0",
"husky": "^8.0.3",
"install": "^0.13.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this dep?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got installed accidentally. weird.

@aarontravass
Copy link
Member Author

coverage is not stopping. hmm

@talentlessguy
Copy link
Member

@aarontravass there's a permission error for reading a file, please check your tests and make sure they don't reference any system files

@aarontravass
Copy link
Member Author

aarontravass commented May 30, 2023

@aarontravass there's a permission error for reading a file, please check your tests and make sure they don't reference any system files

it's a problem even on master https://github.com/tinyhttp/logger/actions/runs/5100346720/jobs/9168579370

@aarontravass
Copy link
Member Author

Let me take a look once again.

@aarontravass
Copy link
Member Author

ci passed :)

@talentlessguy talentlessguy merged commit aff46b8 into tinyhttp:master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants