Skip to content

Upgrade Ansis to 4.3.1#276

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/ansis-4.x
Open

Upgrade Ansis to 4.3.1#276
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/ansis-4.x

Conversation

@renovate

@renovate renovate Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
ansis 4.2.04.3.1 age adoption passing confidence

Release Notes

webdiscus/ansis (ansis)

v4.3.1

Compare Source

  • fix: remove closing reset ANSI sequence

    reset is now treated as a single SGR command, not as a paired style.
    This means ansis.reset(value) prepends \x1b[0m and does not append a closing reset sequence.

    Before:

    ansis.reset('foo');
    // "\x1b[0mfoo\x1b[0m"

    Now:

    ansis.reset('foo');
    // "\x1b[0mfoo"

    If a trailing reset is needed, add it explicitly:

    ansis.reset`foo ${ansis.red('bar')} baz` + ansis.reset();
    // "\x1b[0mfoo \x1b[31mbar\x1b[39m baz\x1b[0m"

    The fix removes extra reset sequences in chained, nested, template literal, and multiline style compositions
    where treating reset as a paired style gave wrong output.

  • fix: strip() now removes OSC 8 hyperlink sequences generated by link()
    ansis.strip(ansis.link(url, text)) now returns plain text

  • fix: prevent silent style leakage between Ansis instances created with different color levels

  • fix: .extend() on one Ansis instance no longer overrides styles created on other instances with different color levels

  • refactor: micro-optimisations to reduce code size

v4.3.0

Compare Source

  • feat: add support for OSC 8 hyperlink: link(url, text)
  • feat: add constructor overload to pass a mock globalThis object for controlled color auto-detection
    import { Ansis } from 'ansis';
    
    const color = new Ansis({
      process: {
        env: { FORCE_COLOR: '1' },
        argv: ['node', 'app.js'],
        stdout: { isTTY: false },
        platform: 'linux',
      },
    });
    
    console.log(color.level); // 1
  • fix(color-support): correctly handle edge cases using ENV variables and CLI flags
Fixed edge case Old behavior (bug) New behavior (correct)
FORCE_COLOR=1, NO_COLOR=1 disable color enable color (FORCE_COLOR takes precedence over NO_COLOR)
NO_COLOR=1, --color disable color enable color (CLI color flags take precedence over NO_COLOR)
FORCE_COLOR=1, --no-color disable color enable color (FORCE_COLOR has the highest priority)
--no-color --color disable color enable color (last flag wins)
--color with no detected colors truecolor 16 colors (auto-detect fallback uses the minimum color level, not truecolor)

Configuration

📅 Schedule: (in timezone Europe/Copenhagen)

  • Branch creation
    • At 12:00 AM through 06:59 AM and 05:00 PM through 11:59 PM, Monday through Friday (* 0-6,17-23 * * mon-fri)
    • Only on Saturday and Sunday (* * * * sat,sun)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies Upgrades third-party dependencies. label May 18, 2026
@renovate renovate Bot force-pushed the renovate/ansis-4.x branch 2 times, most recently from 9fbcb73 to 584fed7 Compare May 28, 2026 19:43
@renovate renovate Bot force-pushed the renovate/ansis-4.x branch from 584fed7 to 811b2ca Compare June 1, 2026 21:29
@renovate renovate Bot force-pushed the renovate/ansis-4.x branch from 811b2ca to 44920e9 Compare June 7, 2026 17:09
@renovate renovate Bot changed the title Upgrade Ansis to 4.3.0 Upgrade Ansis to 4.3.1 Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Upgrades third-party dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants