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

@modular-react/cli-core

v1.1.0

Published

Shared command implementations and templates for the modular-react CLI binaries (@react-router-modules/cli, @tanstack-react-modules/cli, @modular-vue/cli).

Readme

@modular-react/cli-core

Internal foundation for the modular-react CLI binaries. The @react-router-modules/cli, @tanstack-react-modules/cli, and @modular-vue/cli binaries are thin preset wrappers around this package: the commands, prompts, project detection, file transforms, and framework-agnostic templates all live here.

If you're scaffolding a project, install one of the router-specific binaries — not this package.

What's in here

This package's public surface is intentionally tiny — buildCli, runCli, and the CliPreset types in src/index.ts. Everything else is internal machinery the commands rely on:

  • Command implementations under src/commands/: init (with an opt-in --with-catalog flag), create module, create store, create journey, and create catalog. Each is a factory that takes a CliPreset and returns a citty command. Wired together by buildCli.
  • Project layout detection (utils/resolve-project.ts) and scope detection (utils/detect-scope.ts).
  • File transforms (utils/transform.ts) that edit shell/src/main.tsx, shell/package.json, app-shared/src/index.ts, and pnpm-workspace.yaml to wire newly scaffolded pieces in. Anchored on comment markers and predictable shapes that the CLI's own templates emit.
  • Centralized runtime-package version pins in runtime-versions.ts — bump in one place to refresh every generated package.json.
  • Router-agnostic templates under src/templates/: workspace files, app-shared and shell package metadata, the shared http-client, journey package metadata (package.json + index + tsconfig), and the root catalog.config.ts. Framework-specific bodies (JSX/SFC source, stores, vite.config.ts, index.html, journey definition + persistence) come from the preset — see below.

Adding a router integration

Implement a CliPreset:

import { runCli, type CliPreset } from "@modular-react/cli-core";

const preset: CliPreset = {
  cliName: "your-router-modules",
  cliVersion: "0.1.0",
  cliDescription: "modular-react CLI (Your Router integration)",
  packages: {
    core: "@your-router-modules/core",
    runtime: "@your-router-modules/runtime",
    testing: "@your-router-modules/testing",
    journeys: "@your-router-modules/journeys", // journeys binding the scaffolded packages import
    router: "your-router",
    routerVersion: "^1.0.0",
  },
  docs: { shellPatterns: "shell-patterns-your-router.md" },
  scaffold: {
    entryMain: "main.tsx", // shell entry file name
    viewExt: "tsx", // extension for generated view/component files
  },
  templates: {
    appSharedIndex, // your `app-shared/src/index.ts` template
    shellMain, // your `shell/src/main.tsx` template
    shellRootLayout,
    shellShellLayout,
    shellSidebar,
    shellViteConfig, // your `shell/vite.config.ts` (plugin + dedupe list)
    shellIndexHtml, // your `shell/index.html`
    shellAuthStore, // your `shell/src/stores/auth.ts`
    shellConfigStore, // your `shell/src/stores/config.ts`
    shellHome, // your `shell/src/components/Home.*`
    moduleDescriptor, // your `defineModule({...})` template
    modulePage,
    moduleListPage,
    moduleDetailPanel,
    moduleTest,
    storeFile, // your `create store` scaffold
    journeyDefinition, // your journey definition body
    journeyPersistence, // your journey persistence adapter
  },
};

runCli(preset);

The router-agnostic bits (project layout, journey package metadata, package.json/tsconfig scaffolding, workspace + catalog wiring) come from this package automatically; the framework-specific bodies above are the only pieces a preset supplies.