npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sovr-patch

v0.2.1

Published

Rule-driven TypeScript migration engine. AST-powered scanning, safe patches, tsc verification.

Downloads

159

Readme

SOVR Patch: Rule Engine v0.2

Stop grepping. Start patching.

sovr-patch is an AST-based code migration engine designed for safe, deterministic, and verifiable TypeScript refactoring.

It is built as the foundation for the AI Mechanical Work Compressor — shifting AI's role from writing unverified code to orchestrating deterministic AST rules.


Architecture

The engine is built around a 4-phase pipeline:

  1. Locate: Find all AST nodes matching a rule's pattern
  2. Classify: Categorize hits into safe, ambiguous, or unsafe based on syntax context
  3. Transform: Generate patches (diffs) only for safe hits
  4. Verify & Apply (safe-apply):
    • Apply patches to a temporary copy of the repository
    • Run the TypeScript compiler (tsc --noEmit) against the patched copy
    • Only if verification passes, write the changes to the real repository

Usage

1. List available rules

npx sovr-patch list-rules

2. Dry-run a rule (Preview)

npx sovr-patch run \
  --rule field-rename \
  --from "config.baseUrl" \
  --to "config.apiBaseUrl" \
  --repo ./my-repo \
  --report

3. Safe-apply a rule (Verify & Write)

npx sovr-patch run \
  --rule field-rename \
  --from "config.baseUrl" \
  --to "config.apiBaseUrl" \
  --repo ./my-repo \
  --apply \
  --report

4. Audit your codebase

npx sovr-patch audit --repo ./my-repo --report

5. CI Gate

npx sovr-patch ci-gate --repo ./my-repo

Rules (v0.2)

| Rule | Priority | Description | |------|----------|-------------| | field-rename | P0 | Safe TypeScript field rename across value refs, property keys, type fields, this. chains, destructuring, and shorthand properties | | nullish-fallback | P0 | Inject ?? fallback for repeated property access targets. Chain-aware, operator-precedence-aware | | design-token | P1 | Replace hardcoded hex color values with CSS custom property references. Supports presets and dual-mode audit | | inline-style | P1 | Convert JSX inline style objects to className strings. Supports presets and dual-mode audit |


The Rule Contract

Every rule in sovr-patch implements a strict interface:

export type RuleDefinition<TConfig> = {
  name: string;
  description: string;

  parseConfig(input: Record<string, unknown>): TConfig;

  locate(context: RuleContext<TConfig>): RuleLocateResult[];

  classify(located: RuleLocateResult, context: RuleContext<TConfig>): RuleScanHit;

  transform(hit: RuleScanHit, context: RuleContext<TConfig>): PatchOp | null;
};

This enforces the separation of concerns: locating nodes is separate from determining if they are safe to modify, which is separate from generating the actual text replacement.


Directory Structure

src/
├── cli/          # Command-line interface and argument parsing
├── commands/     # CLI command implementations (run, audit, ci-gate, list-rules, activate, status)
├── core/         # Core engine, types, report generation, safe-apply, license validation
├── audit/        # Dual-mode audit engine, packs, report generation
├── patch/        # Patch application, overlap detection, diff generation
└── rules/        # Rule implementations
    ├── field-rename/     # Rule: Safe object field renaming
    ├── nullish-fallback/ # Rule: Inject ?? fallback
    ├── design-token/     # Rule: Hardcoded hex → CSS custom properties
    ├── inline-style/     # Rule: JSX inline styles → className
    ├── registry.ts       # Rule registration
    └── types.ts          # Rule contract interface

Tests

npm run ci

Runs the CI gate, which includes:

  • TypeScript build check
  • Unit tests (scan, rewrite, safe-apply)
  • Engine integration tests
  • CLI smoke tests
  • Trial regression tests

Pricing

| Tier | Price | Rules | |------|-------|-------| | Free | $0 | Scan + audit (all rules, read-only) | | Pack A — Safe TS Migration | $99 | field-rename + nullish-fallback | | Pack B — Frontend Refactor | $99 | design-token + inline-style | | Full Engine | $249 | All rules + CI Gate + presets |

Purchase at www.sovrpatch.com


License

Business Source License 1.1

Copyright (c) 2026 SOVR. Contact: [email protected]