Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Implements generateHappy() function to display encouraging developer messages in the console. The issue code contained a malformed CSS color value team-layer/kr-corekit#333 (likely from a GitHub reference copy/paste) that should be #333.

Changes

  • New utility: package/easterEggUtil/generateHappy/

    • Outputs styled console messages with timestamps
    • 10 default motivational messages with random selection
    • Accepts optional custom message parameter
    • Fixed CSS color from team-layer/kr-corekit#333#333
  • Exports: Added easterEggUtil to package exports (package.json, package/index.ts)

  • Tests: 6 test cases covering default/custom messages, console output formatting, and styling parameters

    • Improved test assertions to avoid duplication (based on code review feedback)
  • Documentation: Comprehensive README documentation

    • Individual README.md in package/easterEggUtil/generateHappy/ with usage examples, API details, and feature descriptions
    • Updated main README.md with easterEggUtil examples, tree-shaking imports, and API reference

Usage

import { generateHappy } from 'kr-corekit';

generateHappy(); // Random encouraging message
generateHappy('Custom message! 🎉'); // Custom message

Console output:

[5:28:35 AM] Progress, not perfection. 🚀
Original prompt

This section details on the original issue you should resolve

<issue_title>easterEggUtil > generateHappy()</issue_title>
<issue_description>```ts
export function generateHappy(message?: string) {
const defaultMessages = [
"Keep going — you're doing great! 💪",
"Small steps lead to big changes. 🌱",
"Today is a good day to smile. 😊",
"You're closer than you think. 🌈",
"Stay curious, stay kind. ✨",
"Progress, not perfection. 🚀",
"You make the code better. 💻❤️",
"Breathe. You’re doing your best. 🌤️",
"Trust the process, enjoy the journey. 🛤️",
"Every bug fixed is a victory. 🐞🏆",
];

const text =
message ??
defaultMessages[Math.floor(Math.random() * defaultMessages.length)];
const timestamp = new Date().toLocaleTimeString();

console.log(
%c[${timestamp}] %c${text},
'color: #ff69b4; font-weight: bold;',
'color: team-layer/kr-corekit#333; font-size: 14px;'
);

return text;
}


## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


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

@klmhyeonwoo
Copy link
Member

klmhyeonwoo commented Nov 14, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.62% 371 / 449
🔵 Statements 82.62% 371 / 449
🔵 Functions 97.14% 34 / 35
🔵 Branches 90.27% 130 / 144
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
package/easterEggUtil/generateHappy/index.ts 100% 100% 100% 100%
Generated in workflow #120 for commit 4506372 by the Vitest Coverage Report Action

@klmhyeonwoo
Copy link
Member

klmhyeonwoo commented Nov 14, 2025

export function generateHappy(message?: string) {
  const defaultMessages = [
    "Keep going — you're doing great! 💪",
    "Small steps lead to big changes. 🌱",
    "Today is a good day to smile. 😊",
    "You're closer than you think. 🌈",
    "Stay curious, stay kind. ✨",
    "Progress, not perfection. 🚀",
    "You make the code better. 💻❤️",
    "Breathe. You’re doing your best. 🌤️",
    "Trust the process, enjoy the journey. 🛤️",
    "Every bug fixed is a victory. 🐞🏆",
  ];

  const text =
    message ??
    defaultMessages[Math.floor(Math.random() * defaultMessages.length)];
  const timestamp = new Date().toLocaleTimeString();

  console.log(
    `%c[${timestamp}] %c${text}`,
    'color: #ff69b4; font-weight: bold;',
    'color: #333; font-size: 14px;'
  );

  return text;
}

Good!

@klmhyeonwoo klmhyeonwoo requested a review from prgmr99 November 14, 2025 05:31
Copilot AI changed the title [WIP] Fix generateHappy function in easterEggUtil Add easterEggUtil with generateHappy() function (fix color CSS bug) Nov 14, 2025
@klmhyeonwoo klmhyeonwoo marked this pull request as ready for review November 14, 2025 05:32
Copilot AI review requested due to automatic review settings November 14, 2025 05:32
Copilot AI requested a review from klmhyeonwoo November 14, 2025 05:32
Copy link
Contributor

Copilot AI left a comment

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 adds a new generateHappy() utility function to display encouraging messages to developers in the console and fixes a CSS color bug where team-layer/kr-corekit#333 (likely from a GitHub reference copy/paste) is corrected to the proper hex color value #333.

Key changes:

  • New easterEggUtil/generateHappy() function with 10 default motivational messages and optional custom message support
  • Fixed malformed CSS color value from GitHub reference to proper hex color #333
  • Added complete test coverage with 6 test cases

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package/easterEggUtil/generateHappy/index.ts Implements the main function with styled console output and corrected CSS color value
package/easterEggUtil/generateHappy/index.test.ts Comprehensive test suite covering default/custom messages, console output, and styling
package/easterEggUtil/index.ts Module export for the new utility
package/index.ts Added easterEggUtil to main package exports
package.json Added easterEggUtil to package exports configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@klmhyeonwoo
Copy link
Member

@copilot Please Add README.md for genereateHappy() util function

Copy link
Contributor Author

Copilot AI commented Nov 14, 2025

@copilot Please Add README.md for genereateHappy() util function

Added comprehensive README documentation for generateHappy():

  • Individual README.md in the function directory with usage examples, API details, and feature descriptions
  • Updated main README.md with easterEggUtil examples, tree-shaking imports, and API reference

Commit: 4506372

Copilot AI requested a review from klmhyeonwoo November 14, 2025 05:43
@klmhyeonwoo klmhyeonwoo marked this pull request as draft November 14, 2025 05:48
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.

easterEggUtil > generateHappy()

2 participants