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

@ferridriver/ct-core

v0.1.0

Published

Ferridriver component testing core -- Vite build, mount fixture, import transform, browser runtime

Readme

@ferridriver/ct-core

Core infrastructure for JavaScript framework component testing. Handles the pipeline from test file scanning to component mounting in a real browser.

Architecture

Test files          Vite build          Browser
----------          ----------          -------
import Counter  --> importTransform     ImportRegistry
  from './C'        rewrites to           resolves lazy
                    importRef             import() calls
                         |                     |
                    vitePlugin              unwrapObject
                    injects registry        resolves refs
                    + runtime                  |
                         |               __ferriMount()
                    Vite bundle          (framework-specific)
                         |                     |
                    dev server  <------  page.evaluate()

Pipeline

  1. Import transform -- Scans test files, rewrites component imports to importRef descriptors
  2. Vite plugin -- Injects browser runtime + framework registerSource + lazy import() for each component
  3. Dev server -- Vite serves the bundle at http://localhost:3100
  4. mount() -- Serializes JSX tree (replacing functions with ordinal refs), sends to browser via page.evaluate()
  5. Browser runtime -- ImportRegistry resolves component refs, unwrapObject resolves function refs, framework's __ferriMount() renders

Import Transform

// BEFORE (test file):
import Counter from './Counter';
import { Button } from '../components/Button';

// AFTER (transformed):
const Counter = { __pw_type: 'importRef', id: '_src_Counter' };
const Button = { __pw_type: 'importRef', id: '_components_Button', property: 'Button' };

The registry maps each ID to a lazy import():

const _src_Counter = () => import('/abs/path/Counter').then(mod => mod.default);

Browser Runtime (injected/index.js)

Installed as globals on window:

| Global | Purpose | |---|---| | __ferriRegistry | ImportRegistry -- maps component IDs to lazy imports | | __ferriUnwrapObject | Recursively resolves importRef and function refs | | __ferriMount | Set by framework registerSource (e.g., ct-react) | | __ferriUpdate | Re-render with new props | | __ferriUnmount | Tear down mounted component | | __ferriDispatchFunction | Callback bridge for event handlers |

mount.mjs API

import { mount, unmount, update, wrapObject, createComponent } from '@ferridriver/ct-core';

// Mount a component (called from test fixtures)
const locator = await mount(page, componentRef, { props: { count: 5 } }, boundCallbacks);
// Returns a Locator pointing at #root

// Update props
await update(page, { props: { count: 10 } }, boundCallbacks);

// Unmount
await unmount(page);

wrapObject replaces JS functions with { __pw_type: 'function', ordinal: N } for serialization across the Node-to-browser boundary.

Vite Plugin

import { ferridriverCtPlugin } from '@ferridriver/ct-core';

// componentRegistry: Map<string, { importSource, remoteName }>
const plugin = ferridriverCtPlugin(componentRegistry, registerSourcePath);

The plugin transforms the .ferridriver-ct/index.ts entry file to inject:

  • The browser runtime (ImportRegistry, unwrapObject)
  • The framework registerSource
  • Lazy import() for every component in the registry
  • window.__ferriRegistry.initialize({ ... })

createCtRunner

import { createCtRunner } from '@ferridriver/ct-core';

const runner = await createCtRunner({
  projectDir: process.cwd(),
  testFiles: ['/abs/path/to/test.ct.tsx'],
  registerSourcePath: '/path/to/ct-react/registerSource.mjs',
  frameworkPlugin: () => import('@vitejs/plugin-react').then(m => m.default()),
  port: 3100,
});

console.log(runner.baseUrl);  // http://127.0.0.1:3100/__ferri_ct_index.html
await runner.stop();

Exports

export { mount, unmount, update, wrapObject, createComponent } from './mount.mjs';
export { createCtRunner } from './runner.mjs';
export { ferridriverCtPlugin } from './vitePlugin.mjs';
export { transformTestFile, scanTestFiles } from './importTransform.mjs';