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

@wtf/project-vitest

v3.0.1

Published

The shared Vitest configs for a pnpm workspace: tests from source or, with TEST_FROM=dist, from the build, with coverage for either (./config); the environment for a process a test starts (./process); the configs for browser tests (./browser); and the con

Readme

@wtf/project-vitest

The shared Vitest configs for a pnpm workspace. They run every package's tests from the root, from source with nothing built first, or from the build (TEST_FROM=dist), with coverage for either. Vitest ^5.0.5 is a peer dependency. @vitest/coverage-v8 and @vitest/browser-playwright, at the same version, and playwright are optional peers, for coverage and for browser tests. A repo names each at its root by the one exact version, 5.0.5, since the configs run in the Vitest that runs them. Vite comes from @wtf/project-vite, a dependency.

| Subpath | What you get | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | ./config | rootConfig(), packageConfig(), integrationConfig(), integration, fromDist(env), GUARD_TIMEOUT, the type VitestPlatform | | ./process | childEnv(env): the environment for a process a test starts, without the resolve hook | | ./browser | browserConfig() and browserRootConfig(): browser tests, in Chromium | | ./storybook | storybookConfig(): for a package whose stories are its tests, each in Chromium | | ./schema | vitestSchema: the Standard Schema of the options of rootConfig(), which gives their JSON Schema |

// vitest.config.ts, at the root
import { nodeStorage } from '@wtf/platform-fs-node/storage'
import { nodePlatform } from '@wtf/platform-node/platform'
import { rootConfig } from '@wtf/project-vitest/config'

const platform = nodePlatform({ fetch, storage: nodeStorage() })
export default rootConfig({ platform })
// packages/core/vitest.config.ts
import { nodeStorage } from '@wtf/platform-fs-node/storage'
import { nodePlatform } from '@wtf/platform-node/platform'
import { packageConfig } from '@wtf/project-vitest/config'

export default packageConfig({ platform: nodePlatform({ fetch, storage: nodeStorage() }) })

Each config file is the entry point: it builds Node's platform and gives it to the config, which reads nothing of the process itself. The config reads CI and TEST_FROM of the platform's env, the workspace of its dirs.cwd, by its navigator.storage and path; the root's reads the arguments of the process of its argv too, whose --project filters its coverage reads.

packageConfig({ platform, ...test }, config) takes the platform and the test options, and a Vite config to merge, such as { resolve: { dedupe: ['react'] } }.

The guards, in the root's root project, get 30 seconds per test, GUARD_TIMEOUT, the same as a package's tests, instead of Vitest's 5. Pass another with rootConfig({ platform, testTimeout: 60_000 }).

When tests run from source, Vite resolves each workspace package through an alias from each export to its @wtf/source, and each test worker registers @wtf/project-resolve's resolve hook, in Node's environment or in jsdom's. See the tests guide.

A package whose stories are its tests runs them with storybookConfig({ platform, storybook }) from ./storybook. It is a browserConfig() named storybook, whose tests are the stories that @storybook/addon-vitest's plugin, storybookTest(), finds in the package's .storybook. The repo installs the addon at its Storybook's version; nothing here depends on Storybook.

From the wtf configuration

The configs read no file of their own. Keep the options of rootConfig() in the vitest section of the repo's wtf configuration, load it with @wtf/project-config, and spread the section in, checked by vitestSchema; what you write in code after it wins:

// vitest.config.ts, at the root
import { nodeStorage } from '@wtf/platform-fs-node/storage'
import { nodePlatform } from '@wtf/platform-node/platform'
import { loadConfig } from '@wtf/project-config/load'
import { sectionOf } from '@wtf/project-config/section'
import { rootConfig } from '@wtf/project-vitest/config'
import { vitestSchema } from '@wtf/project-vitest/schema'

const platform = nodePlatform({ fetch, storage: nodeStorage() })
const config = await loadConfig({ platform })
export default rootConfig({
  platform,
  ...(await sectionOf(config, 'vitest', vitestSchema))
})
{ "vitest": { "skip": ["packages/site"], "testTimeout": 60000 } }

A key that starts with // is a comment, as "//": "why": vitestSchema takes it, in the section and in an object of options in it, and leaves it out of the options it gives.

integrationConfig() and browserRootConfig() take the same options but testTimeout.