Skip to content

Conversation

@nzinfo
Copy link

@nzinfo nzinfo commented Dec 18, 2025

This PR adds patch-package support to fix compatibility issues with the opal-compiler Logger implementation, enabling proper integration with Asciidoctor's
LoggerManager options.

Changes

  • Added patch-package as dev dependency - Allows patching npm packages after installation
  • Generated patch for opal-logger - Extends Logger constructor to support Asciidoctor's LoggerManager options:
    • :progname - Sets the program name
    • :formatter - Sets custom formatter
    • :level - Sets log level
  • Added postinstall script - Automatically applies patches when npm install runs

Problem Fixed

The original opal-compiler Logger implementation had a rigid constructor that only accepted a pipe parameter. This prevented Asciidoctor from passing custom
LoggerManager options like :progname, :formatter, and :level.

The patch extends the Logger constructor to:

  • Accept keyword arguments alongside positional arguments
  • Support Asciidoctor's LoggerManager initialization options
  • Maintain backward compatibility with existing code

Testing

This change fixes npm run test:types & npm run test:node by ensuring proper Logger level and program name configuration when Asciidoctor initializes the Logger

nzinfo and others added 2 commits December 18, 2025 23:45
- Add patch-package as dev dependency
- Generate patch for opal-logger to support Asciidoctor's LoggerManager options
- Add postinstall script to automatically apply patches on npm install
- Fixes npm run test:types by ensuring proper Logger level and program name

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

1 participant