Fix TypeScript error: make LoggerConfig.name optional#405
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ional Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update action run steps for job
Fix TypeScript error: make LoggerConfig.name optional
Jan 30, 2026
hotlong
marked this pull request as ready for review
January 30, 2026 17:16
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TypeScript compilation error where the name field in LoggerConfig was incorrectly required. The LoggerConfigSchema (in @objectstack/spec) defines name as optional, but the type constraint in the logger implementation was making it required by only excluding file and rotation from the Required type.
Changes:
- Updated the private config type to also omit
'name'from the Required constraint, making it properly optional - Added
namefield preservation in config initialization - Added conditional logic to pass
nameto Pino logger options when provided
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CI failing with
Property 'name' is missing but requiredinpackages/core/src/logger.ts. TheLoggerConfigSchemadefinesnameas optional, but the type constraintRequired<Omit<LoggerConfig, 'file' | 'rotation'>>excluded only file/rotation, making name required.Changes
'name'to theOmitlist to keep it optionalnamefield if providednameto Pino logger options when setThe pattern now correctly handles all optional fields in
LoggerConfigSchema.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.