Skip to content

Fix TypeScript error: make LoggerConfig.name optional#405

Merged
hotlong merged 2 commits into
mainfrom
copilot/update-action-run-steps
Jan 30, 2026
Merged

Fix TypeScript error: make LoggerConfig.name optional#405
hotlong merged 2 commits into
mainfrom
copilot/update-action-run-steps

Conversation

Copilot AI commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

CI failing with Property 'name' is missing but required in packages/core/src/logger.ts. The LoggerConfigSchema defines name as optional, but the type constraint Required<Omit<LoggerConfig, 'file' | 'rotation'>> excluded only file/rotation, making name required.

Changes

  • Type definition: Added 'name' to the Omit list to keep it optional
  • Config initialization: Preserve name field if provided
  • Pino integration: Pass name to Pino logger options when set
// Before
private config: Required<Omit<LoggerConfig, 'file' | 'rotation'>> & { ... };

// After  
private config: Required<Omit<LoggerConfig, 'file' | 'rotation' | 'name'>> & { 
  file?: string; 
  rotation?: { maxSize: string; maxFiles: number }; 
  name?: string 
};

The pattern now correctly handles all optional fields in LoggerConfigSchema.

Original prompt

引用: https://github.com/objectstack-ai/spec/actions/runs/21521817544/job/62014822275#step:8:1


💡 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.

@vercel

vercel Bot commented Jan 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jan 30, 2026 5:14pm

Request Review

…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
Copilot AI requested a review from hotlong January 30, 2026 16:57
@hotlong
hotlong marked this pull request as ready for review January 30, 2026 17:16
Copilot AI review requested due to automatic review settings January 30, 2026 17:16
@hotlong
hotlong merged commit 3c910c1 into main Jan 30, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 name field preservation in config initialization
  • Added conditional logic to pass name to Pino logger options when provided

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.

3 participants