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

@bitakit/next

v0.1.0

Published

Next.js discovery and routing adapter for SaaS Foundation.

Readme

@bitakit/next

Optional Next.js adapter for Foundation. Core owns discovery, actions, services, configuration, and runtime behavior. This package connects those mechanisms to Next.js; it does not implement another scanner.

Responsibilities

  • /config: withFoundation runs Core discovery before Next starts and watches source changes during development.
  • foundation-generate: runs the same generator before standalone builds and type checks.
  • /actions: connects the root ActionProvider to Next Router and Link.
// next.config.ts
import { withFoundation } from '@bitakit/next/config';
export default withFoundation({});
// src/components/providers.tsx
'use client';
import { FoundationProvider } from '@bitakit/next';
import type { ReactNode } from 'react';

export function Providers({ children }: { children: ReactNode }) {
  return <FoundationProvider>{children}</FoundationProvider>;
}

Mount this client boundary in the native root layout. The provider supplies standard UI, default English labels, native Next navigation and the single root ActionProvider. Pass labels for translated copy and ui only to customize the standard mapping. An existing outer ActionProvider is reused, including its navigation options. Load the application's existing central theme and package styles as usual.

No foundation.config.ts, empty contribution folders or generated imports are required. withFoundation connects generated imports through both Next bundlers. It also writes foundation-env.d.ts so TypeScript sees generated Action and public-service types; ignore this generated file and .foundation/ in Git. Custom paths, disabled packages and discovery overrides can still be specified in foundation.config.ts.

Installed direct dependencies may opt into automatic composition through their public package metadata (see Core's README). Factories create plugin definitions per provider; Core continues to construct and dispose services. Installing an arbitrary npm dependency does not activate it. App Preferences automatically contributes discovery and a browser-local default preferences instance. Shell, Better Auth and server persistence remain explicitly configured capabilities. Server authentication, routes, secrets and database setup are never inferred from UI installation.

For configured package plugins, use additionalPlugins: these replace discovered plugins with matching IDs and append new IDs. The lower-level plugins prop retains its existing replacement semantics, including []. Pass an explicit config for isolated environments without the Next build adapter.

The app is a root module under src. An optional src/plugin.config.ts supplies its ID and dependencies. Each immediate directory under src/plugins is discovered as a local plugin, using its folder name as the default ID. Its plugin.config.ts is optional and only needed for overrides. The app does not need a wrapper plugin directory.

Use native src/app/**/page.tsx and layout.tsx for app-owned routes. Do not replace them with root pages.*.tsx Foundation contributions. Independent plugin pages use Discovery and the host catch-all; Next.js reserves src/pages for its Pages Router. Actions, services, configs, interceptors, and views follow the shared Core discovery convention. Dot and folder forms are equivalent; legacy suffixes remain supported.

Generated files live under .foundation and contain static imports and typed maps. Client contribution code is not executed during discovery. Opt-in discovery adapters are trusted Node build code. Disabled packages contribute neither runtime entries nor public-service types. Explicit service requirements are checked at runtime.

Both example apps consume this adapter. Run npm test --workspace @bitakit/next for discovery integration tests. A different router would have its own thin adapter and reuse Core.

Source responsibilities

  • providers/: Next routing/query composition around the shared UI provider.
  • query.ts: public Next App Router nuqs boundary.
  • routing/: Shared native Action navigation bindings.
  • config.mjs, generate.mjs: Next build hooks, generated-module aliases and TypeScript connection.
  • generated.ts: Empty explicit-environment fallback; replaced by the build adapter.
  • index.ts, actions.tsx: Public provider entry points.

Shared composition and query state

The root provider delegates visual defaults and ordered additionalPlugins merging to StandardFoundationProvider in UI's optional components entry. It owns the Next App Router NuqsAdapter, so hosts must remove redundant wrappers. For an intentional outer adapter, pass queryState={false}. Legacy hosts using standalone Action/UI providers can import QueryProvider from @bitakit/next/query at their existing root boundary. The Web example uses this entry; Content Demo uses the root provider's default boundary.

src/query.ts owns the framework-specific query binding. src/generate.mjs re-exports Core's Node-only generateFoundationHost; no discovery implementation is duplicated. The existing generator uses Webpack pending resolution of its Turbopack alias issue.