-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix: DebugLog - print box align, same contents #40 #41
Conversation
WalkthroughThe changes to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DebugLog
participant JsonPrint
participant JsonLog
participant JsonExpect
User->>DebugLog: call debugLog(name)
DebugLog-->>User: log message
User->>JsonPrint: call jsonPrint(obj)
JsonPrint-->>User: print JSON
User->>JsonLog: call jsonLog(name, obj)
JsonLog-->>User: log JSON object
User->>JsonExpect: call jsonExpect(name, obj1, obj2)
JsonExpect-->>User: compare values and log results
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Triggered from #41 by @black7375. Checking if we can fast forward Target branch ( commit 47e2bf3b0a94503ea94b90bb6869c2bcd0f00e8a (HEAD -> main, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 14:24:27 2024 +0900
Docs: Apply suggestions from code review #39 Pull request ( commit 38d40dbb793f65e43c40bf78adcb3d86954f2d83 (pull_request/debug-log-print)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 15:35:48 2024 +0900
Fix: DebugLog - declare type with function overload #40 It is possible to fast forward |
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/debug-log/src/index.ts (2 hunks)
Additional context used
Biome
packages/debug-log/src/index.ts
[error] 37-37: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
Additional comments not posted (6)
packages/debug-log/src/index.ts (6)
23-28
: Improved visual formatting for log outputs.The change from a single integer to an object specifying padding for each side enhances the visual formatting of log outputs.
64-64
: Improved type safety fordebugLog
.The change from
unknown
tostring
improves type safety by ensuring that the function only accepts astring
.
71-82
: Enhanced flexibility and usability forjsonPrint
.The overloads allow the function to accept either a string or a JSON-compatible object, improving its flexibility and usability.
86-97
: Enhanced flexibility and usability forjsonLog
.The overloads allow the function to accept either a string or a JSON-compatible object, improving its flexibility and usability.
102-140
: Enhanced flexibility, usability, and clarity forjsonExpect
.The overloads allow the function to accept either a string or a JSON-compatible object for its first parameter. The logic adjustments handle comparisons more effectively, providing clearer outputs.
Line range hint
147-215
:
Updated test cases to reflect changes in logging functions.The test cases have been updated to ensure that the modified logging functions are working as expected.
38d40db
to
4975f3a
Compare
Triggered from #41 by @black7375. Checking if we can fast forward Target branch ( commit 47e2bf3b0a94503ea94b90bb6869c2bcd0f00e8a (HEAD -> main, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 14:24:27 2024 +0900
Docs: Apply suggestions from code review #39 Pull request ( commit 4975f3afe25ea520e053c25016e5384e2bac63cf (pull_request/debug-log-print)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 15:46:21 2024 +0900
Fix: DebugLog - declare type with function overload #40 It is possible to fast forward |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/debug-log/src/index.ts (2 hunks)
Additional context used
Learnings (1)
packages/debug-log/src/index.ts (1)
Learnt from: black7375 PR: mincho-js/mincho#41 File: packages/debug-log/src/index.ts:37-37 Timestamp: 2024-07-21T06:45:30.199Z Learning: The preferred type definition for `NotAssignableToJson` is `bigint | symbol | ((...args: unknown[]) => unknown)` to enforce stricter type checking.
Additional comments not posted (10)
packages/debug-log/src/index.ts (10)
23-28
: Improved padding configuration.The change to specify padding for each side in the
boxen
function enhances the visual presentation of log outputs.
36-36
: Stricter type checking forNotAssignableToJson
.Using
unknown
instead ofany
enforces stricter type checking, improving code safety.
46-54
: Ensuring JSON compatibility.The
JSONCompatible
type definition ensures that only JSON-compatible objects can be passed to the logging functions, preventing unsupported types and increasing robustness.
63-68
: Enhanced type safety fordebugLog
.Requiring a
string
for thename
parameter improves type safety.
70-82
: Improved flexibility forjsonPrint
.The overloaded signatures allow
jsonPrint
to accept either a string or a JSON-compatible object, enhancing its flexibility and usability.
85-97
: Improved flexibility forjsonLog
.The overloaded signatures allow
jsonLog
to accept either a string or a JSON-compatible object, enhancing its flexibility and usability.
101-139
: Enhanced clarity and effectiveness forjsonExpect
.The overloaded signatures and refined internal logic improve the clarity and effectiveness of the
jsonExpect
function.
Line range hint
148-167
:
Comprehensive test cases fordebugLog
.The test cases cover the expected output of the
debugLog
function with and without a title.
Line range hint
169-198
:
Comprehensive test cases forjsonLog
.The test cases cover the expected output of the
jsonLog
function with and without a title.
Line range hint
200-239
:
Comprehensive test cases forjsonExpect
.The test cases cover the expected output of the
jsonExpect
function with and without a title.
/fast-forward |
Triggered from #41 (comment) by @black7375. Trying to fast forward Target branch ( commit 47e2bf3b0a94503ea94b90bb6869c2bcd0f00e8a (HEAD -> main, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 14:24:27 2024 +0900
Docs: Apply suggestions from code review #39 Pull request ( commit 4975f3afe25ea520e053c25016e5384e2bac63cf (pull_request/debug-log-print)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Sun Jul 21 15:46:21 2024 +0900
Fix: DebugLog - declare type with function overload #40 Fast forwarding $ git push origin 4975f3afe25ea520e053c25016e5384e2bac63cf:main
To https://github.com/mincho-js/mincho.git
47e2bf3..4975f3a 4975f3afe25ea520e053c25016e5384e2bac63cf -> main |
Description
Adjust the type and print of
@mincho/debug-log
pacakge.Related Issue
Summary by CodeRabbit
New Features
debugLog
,jsonPrint
,jsonLog
, andjsonExpect
functions with improved signatures for flexibility.Improvements
jsonExpect
function, improving usability.