Skip to content

🚀 release: v2.3.0#29

Merged
warengonzaga merged 6 commits intomainfrom
dev
Feb 12, 2026
Merged

🚀 release: v2.3.0#29
warengonzaga merged 6 commits intomainfrom
dev

Conversation

@warengonzaga
Copy link
Member

@warengonzaga warengonzaga commented Feb 12, 2026

Waiting for the other PR to finish...

Summary by CodeRabbit

  • New Features

    • Context-aware emoji support for log output with configurable mappings, fallbacks, and a toggle to include/exclude emoji; public API to configure and reuse emoji behavior.
  • Documentation

    • README updated with emoji guidance and streamlined marketing; Contributing updated to include bundle size check in validation.
  • Tests

    • New comprehensive unit and integration tests for emoji features and the bundle size checker.
  • Chores

    • Added bundle size check script, CI workflow, and wired size check into validation; package version bumped.

* Initial plan

* 📦 new: add bundle size checker with tests and workflow

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: add bundle size checker to documentation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🧪 test: fix inverted logic in size checker test

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: add permissions block to size-check workflow

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* ⚙️ setup: fix linting issues in size-checker test

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: address PR review feedback

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: improve error handling and validation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: fix shell injection and improve error visibility

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: fix non-literal require in tests

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
@warengonzaga warengonzaga marked this pull request as draft February 12, 2026 03:39
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/formatter/emoji-selector.ts 81.25% 8 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@warengonzaga has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

A bundle-size CI check and a context-aware emoji logging system were added: new GitHub Actions workflow, size-check script and tests, emoji mappings/selector, formatter/logger integrations, type and API additions, ESLint security plugin registration, and documentation/scripts updates.

Changes

Cohort / File(s) Summary
Continuous Integration
​.github/workflows/size-check.yml
Adds "Bundle Size Check" workflow that sets up Node 20, prepares pnpm, installs, builds, runs pnpm run size:check, and reports dist sizes on push/PR to main/dev.
Bundle size tooling
package.json, scripts/check-size.js
Bumps package version to 2.3.0, adds size:check script and scripts/check-size.js which enforces thresholds (dist ≤1024 KB, esm ≤512 KB, cjs ≤512 KB), prints report, and exits non‑zero on failure; validate now includes size:check.
Documentation & Contribution
README.md, CONTRIBUTING.md
Updates README with emoji-focused messaging, feature list, and examples; CONTRIBUTING updated to include size check in validation commands.
Tests — size checker
src/__tests__/size-checker.test.ts
New tests for the size checker: ensures build/dist presence, script executable, expected report sections, PASS statuses, and package.json script wiring.
Tests — emoji & formatting
src/__tests__/emoji.test.ts, src/__tests__/emoji-integration.test.ts, src/__tests__/format-customization.test.ts, src/__tests__/formatter.test.ts
Adds/updates unit and integration tests covering EmojiSelector behavior, includeEmoji option, formatter placement, fallbacks, timestamp interactions, and Logger integration.
Emoji data & selector
src/formatter/emoji-data.ts, src/formatter/emoji-selector.ts
New exports EMOJI_MAPPINGS, FALLBACK_EMOJI, and EmojiSelector: context-aware mappings, safe regex compilation, configuration API, selection and reset logic.
Formatter integration
src/formatter/message-formatter.ts, src/formatter/index.ts
MessageFormatter now supports includeEmoji (default true) and injects selected emoji into formatted output; formatter index re-exports emoji modules.
Public API & types
src/index.ts, src/types/index.ts
Adds new exported types and config: EmojiMapping, EmojiConfig, LogFormatConfig.includeEmoji?, LogFormatConfig.emoji?; re-exports EmojiSelector/emoji constants.
Logger configuration
src/logger/core.ts
Logger.configure() now configures or resets EmojiSelector according to format config to preserve compiled regex cache.
Linting config
eslint.config.js
Registers eslint-plugin-security in plugins and sets many security/detect-* rules to off (noting they run via a separate lint:security task).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • 🚀 release: v1.3.0 #10 — Overlapping formatter/logger surface changes; both PRs modify formatter exports and Logger interactions, likely related to emoji/format API adjustments.

Suggested labels

release

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '🚀 release: v2.3.0' directly reflects the changeset's primary objective—releasing version 2.3.0 with substantial feature additions including emoji support, bundle size checking, and documentation updates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

* Initial plan

* 📦 new (emoji): add emoji selector and context-aware logic

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: add comprehensive emoji feature documentation

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix linting issues in emoji feature

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): address code review feedback

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: enable emoji by default and move toggle to format.includeEmoji

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 📖 docs: update README for new emoji configuration pattern

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix trailing spaces in tests

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): address code review feedback on performance and state management

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update (emoji): move config to Logger.configure() to preserve regex cache

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔧 update: fix eslint errors by removing invalid security rule comments

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* 🔒 security: add eslint-disable comments for safe code patterns

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

* � test: improve patch coverage for emoji feature

- Remove deprecated dead-code methods (getMappings, matchesKeywords) from EmojiSelector
- Add tests for unknown log level edge case in EmojiSelector
- Add tests for Logger.configure emoji configuration path
- Add tests for numeric and boolean data edge cases

* 🧪 test: improve patch coverage for emoji feature

- Remove deprecated dead-code methods (getMappings, matchesKeywords) from EmojiSelector
- Add tests for unknown log level edge case in EmojiSelector
- Add tests for Logger.configure emoji configuration path
- Add tests for numeric and boolean data edge cases

* 🗑️ remove: delete outdated Snyk security instructions

* 🔧 update: address code review feedback on performance and safety

Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Co-authored-by: Waren Gonzaga <opensource@warengonzaga.com>
@warengonzaga warengonzaga marked this pull request as ready for review February 12, 2026 07:54
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

1137-1137: ⚠️ Potential issue | 🟡 Minor

Version string appears outdated, sir.

The README references v2.1.0 at Line 1137, yet this pull request is preparing the v2.3.0 release. Might I suggest updating this to reflect the current version?

-**Latest Version:** v2.1.0 - Enhanced with advanced output handlers, comprehensive security-first logging, complete TypeScript support, and 95%+ test coverage for local development workflows.
+**Latest Version:** v2.3.0 - Enhanced with context-aware emoji support, advanced output handlers, comprehensive security-first logging, complete TypeScript support, and 95%+ test coverage for local development workflows.
🤖 Fix all issues with AI agents
In `@README.md`:
- Line 19: The README has inconsistent counts for the emoji mappings: the "🎨
Context-Aware Emoji (New!)" sentence currently says "37 curated mappings" while
another place says "40+ curated emoji mappings"; update the text so both
occurrences use the same, accurate phrasing (e.g., replace "37 curated mappings"
in the "🎨 Context-Aware Emoji (New!)" sentence with "40+ curated emoji
mappings" or vice versa), ensuring you update every instance of the phrase to
keep the README consistent (search for the strings "🎨 Context-Aware Emoji
(New!)", "37 curated mappings", and "40+ curated emoji mappings" to locate and
fix all occurrences).
- Around line 602-609: Add a language specifier to the two fenced code blocks
that show the logging format and example — change the opening backticks for the
block containing "[ISO_TIMESTAMP][LOCAL_TIME][LEVEL][EMOJI]: message [data]" and
the block containing "[2026-02-11T14:00:00.000Z][2:00PM][ERROR][🗃️]: Database
connection failed" to include a language tag (e.g., use "text") so the fences
become ```text for both occurrences.
🧹 Nitpick comments (6)
eslint.config.js (1)

75-95: Test configuration registers the security plugin but omits the corresponding rule declarations.

In the main configuration (Lines 50–62), security rules are explicitly set to 'off' so that eslint-disable comments referencing them are recognized. The test configuration registers the plugin at Line 77 but does not mirror these 'off' declarations. Should any test file contain an eslint-disable comment for a security rule, it would trigger an "unknown rule" warning.

This is a minor concern — if no test files currently use such comments, it's a non-issue. But for consistency, one might consider aligning the two configurations.

src/__tests__/formatter.test.ts (1)

169-173: Minor observation: this test case does not disable emoji.

At Line 171, LogFormatter.format(LogLevel.INFO, 'Message', 'test string') is called without { includeEmoji: false }. The test still passes because it only asserts toContain('test string'), but the output will include an emoji segment (likely [ℹ️]). This appears intentional — verifying that emoji inclusion doesn't break string data formatting — but if consistency with other tests was the goal, one might add the option here as well.

src/formatter/emoji-data.ts (1)

98-100: The catch-all keywords may be rather... enthusiastic, if I may say so.

The keywords 'new' and 'improve'/'improved' in the catch-all sparkles mapping are quite generic. A log message like "New user session created" or "Improved cache hit ratio" would match ✨ rather than falling through to a level-based fallback, which may not always be the desired behaviour. Worth considering whether these broad terms belong in a catch-all or if they warrant narrower phrasing.

src/formatter/emoji-selector.ts (2)

186-221: The dual switch statements are rather thorough, though perhaps excessively so.

Both the custom fallback lookup (lines 190–204) and the default fallback lookup (lines 208–221) enumerate every level identically. Since levelName is already validated as a known level (the UNKNOWN case returns early at line 183), and FALLBACK_EMOJI is a typed Record, this could be condensed. However, I recognise this was likely a deliberate choice to satisfy the security/detect-object-injection ESLint rule by avoiding bracket notation. Entirely at your discretion.

♻️ Optional: Condensed fallback lookup using a local map
  private static getFallbackEmoji(level: LogLevel): string {
    const levelName = EmojiSelector.getLevelName(level);

    if (levelName === 'UNKNOWN') {
      return '';
    }

    const { customFallbacks = {} } = EmojiSelector.config;

-   // Check custom fallbacks first using safe property access
-   if (Object.prototype.hasOwnProperty.call(customFallbacks, levelName)) {
-     switch (levelName) {
-     case 'DEBUG':
-       return customFallbacks.DEBUG || '';
-     case 'INFO':
-       return customFallbacks.INFO || '';
-     case 'WARN':
-       return customFallbacks.WARN || '';
-     case 'ERROR':
-       return customFallbacks.ERROR || '';
-     case 'LOG':
-       return customFallbacks.LOG || '';
-     default:
-       return '';
-     }
-   }
-
-   // Use default fallback with explicit switch
-   switch (levelName) {
-   case 'DEBUG':
-     return FALLBACK_EMOJI.DEBUG;
-   case 'INFO':
-     return FALLBACK_EMOJI.INFO;
-   case 'WARN':
-     return FALLBACK_EMOJI.WARN;
-   case 'ERROR':
-     return FALLBACK_EMOJI.ERROR;
-   case 'LOG':
-     return FALLBACK_EMOJI.LOG;
-   default:
-     return '';
-   }
+   // Safe: levelName is one of the known literal types after UNKNOWN check
+   const levels = ['DEBUG', 'INFO', 'WARN', 'ERROR', 'LOG'] as const;
+   for (const l of levels) {
+     if (l === levelName) {
+       if (Object.prototype.hasOwnProperty.call(customFallbacks, l)) {
+         return customFallbacks[l] || '';
+       }
+       return FALLBACK_EMOJI[l];
+     }
+   }
+   return '';
  }

88-93: Minor observation: the 'i' flag is redundant with pre-lowercased input.

prepareSearchText (line 145) already lowercases the search text, yet the compiled regexes use the 'i' flag. Not harmful — merely a negligible redundancy. No action needed unless you wish to shave a micro-optimisation.

src/__tests__/emoji-integration.test.ts (1)

73-84: Minor style observation: trailing argument artifacts.

Lines 77–78 have a trailing undefined, with no subsequent argument before the closing parenthesis. This appears in several places (lines 90–92, 103–105, etc.) and suggests a parameter was removed during iteration. Syntactically valid, but a trifle untidy.

       const formatted = LogFormatter.format(
         LogLevel.INFO,
         'Deployed to production',
-        undefined,
-
+        undefined
       );

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

1130-1130: ⚠️ Potential issue | 🟡 Minor

Sir, I've detected a version inconsistency that requires your attention.

The documentation currently indicates "Latest Version: v2.1.0", yet this pull request is titled "🚀 release: v2.3.0". I would recommend updating this line to reflect v2.3.0 to ensure documentation accuracy upon merge.

Proposed correction
-**Latest Version:** v2.1.0 - Enhanced with advanced output handlers, comprehensive security-first logging, complete TypeScript support, and 95%+ test coverage for local development workflows.
+**Latest Version:** v2.3.0 - Enhanced with context-aware emoji support, bundle size monitoring, advanced output handlers, comprehensive security-first logging, complete TypeScript support, and 95%+ test coverage for local development workflows.
🧹 Nitpick comments (1)
README.md (1)

411-611: Sir, I must commend the thoroughness of this new emoji documentation section.

The Context-Aware Emoji Support section is exceptionally well-structured, providing comprehensive examples, configuration options, and practical use cases. The documentation clearly demonstrates both basic and advanced usage patterns, which should prove invaluable to users integrating this feature.

However, I would suggest elevating the compatibility note currently positioned at Line 610 to a more prominent location, perhaps immediately following the Quick Start section around Line 447. Given that emoji are now enabled by default, existing users may benefit from understanding this behavioral change earlier in their reading journey, sir.

@warengonzaga warengonzaga merged commit 170eec4 into main Feb 12, 2026
17 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 14, 2026
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