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

@wocha/upgrade

v0.1.0

Published

Automated codemods for upgrading @wocha SDK packages

Readme

@wocha/upgrade

Automated codemods for upgrading @wocha/* SDK packages. Detects installed versions, applies AST-level transforms for breaking changes, and updates package.json dependency ranges.

Usage

npx @wocha/upgrade

From the monorepo during development:

pnpm --filter @wocha/upgrade build
node tools/upgrade/dist/index.js

Example output

  @wocha/upgrade v0.1.0

  Detected packages:
    @wocha/react    0.1.0 → 0.2.0
    @wocha/nextjs   0.1.0 → 0.2.0

  Codemods to apply:
    ✓ rename-provider (affects 3 files)
    ✓ update-hook-return (affects 5 files)
    ✓ middleware-config (affects 1 file)

  ? Apply changes? (Y/n)

  Applied 3 codemods across 9 files.
  Updated package.json versions.

  Run `pnpm install` to complete the upgrade.

Flags

| Flag | Description | |------|-------------| | --dry-run | Preview codemod changes without writing files or updating package.json | | --package <name> | Upgrade a single package, e.g. @wocha/react | | --from <version> | Override the detected current version | | --to <version> | Target version (default: latest from npm registry) | | --cwd <path> | Project directory to upgrade (default: current directory) | | --yes, -y | Apply changes without prompting | | --help, -h | Show help |

How it works

  1. Detect — Reads package.json and finds all @wocha/* dependencies.
  2. Compare — Queries the npm registry for the latest version of each package.
  3. Plan — Selects codemods whose version falls between your current and target versions.
  4. Preview — Runs each transform in dry mode to count affected files.
  5. Apply — Runs jscodeshift transforms on matching TypeScript/JSX files and bumps dependency versions.

Writing custom codemods

Codemods live in src/codemods/<version>/ and export a default jscodeshift transform:

import type { API, FileInfo, Options } from "jscodeshift";

export default function myTransform(file: FileInfo, api: API, _options: Options) {
  const j = api.jscodeshift.withParser("tsx");
  const root = j(file.source);
  let changed = false;

  // ... AST mutations ...

  return changed ? root.toSource() : null;
}

Register the codemod in src/registry.ts:

{
  id: "my-codemod",
  version: "0.3.0",
  package: "@wocha/react",
  description: "Short description of the breaking change",
  transform: "codemods/v0.3/my-codemod.js",
}

The version field is the SDK release that introduces the breaking change. Codemods run when upgrading from a version below version to a version at or above it.

Add the file to tsup.config.ts entry array so it is compiled to dist/.

Contributing new codemods

  1. Create a transform under src/codemods/v<release>/.

  2. Add an entry to src/registry.ts with the target package and release version.

  3. Add the file path to tsup.config.ts entries.

  4. Test against a sample project:

    pnpm build
    node dist/index.js --dry-run --from 0.1.0 --to 0.2.0 --cwd ../../examples/react-quickstart
  5. Document the breaking change in the SDK CHANGELOG.

Included example codemods (v0.1 → v0.2)

| ID | Package | Change | |----|---------|--------| | rename-provider | @wocha/react, @wocha/nextjs | WochaProviderWochaAuthProvider | | update-hook-return | @wocha/react, @wocha/nextjs | useSession().sessionuseSession().data | | middleware-config | @wocha/nextjs | withWochaAuth({ publicPaths }){ publicRoutes } |

These represent hypothetical breaking changes for demonstration purposes.

License

Apache-2.0