open-index/open-npm huggingface dataset:
npm package: @modular-react/core
Description: Core primitives for modular React applications: types, slots, navigation, validation, and a lightweight store. No runtime React dependency — pure logic with React type declarations.
Latest version: 1.0.2

# @modular-react/core

Core primitives for modular React applications. Provides types, slot/navigation builders, validation, and a lightweight store, all with zero React runtime dependency.

This is the shared foundation that both `@react-router-modules/*` and `@tanstack-react-modules/*` build on.

## Installation

```bash
npm install @modular-react/core
```

## What's included

- **Types**: `ModuleDescriptor`, `LazyModuleDescriptor`, `NavigationItem`, `ModuleLifecycle`, `ReactiveService`, `SlotMap`, `SlotMapOf`, `ZoneMap`, `ZoneMapOf`, `Store`, `RegistryConfig`, `NavigationGroup`, `NavigationManifest`, `ModuleEntry`, `DynamicSlotFactory`, `SlotFilter`
- **Slots**: `buildSlotsManifest`, `collectDynamicSlotFactories`, `evaluateDynamicSlots`
- **Navigation**: `buildNavigationManifest`
- **Validation**: `validateNoDuplicateIds`, `validateDependencies`
- **Store**: `createStore` (a lightweight zustand-compatible store, no middleware)
- **Detection**: `isStore`, `isStoreApi` (alias), `isReactiveService`, `separateDeps`
- **Helpers**: `defineModule`, `defineSlots`, `buildDepsSnapshot`, `runLifecycleHooks`

## Usage

Most apps import from a router-specific package (`@react-router-modules/core` or `@tanstack-react-modules/core`) rather than directly from this package. Use this package when building router-agnostic tooling or extending the framework.

```typescript
import { buildSlotsManifest, createStore } from "@modular-react/core";
import type { ModuleDescriptor, Store } from "@modular-react/core";
```

See the [main documentation](https://github.com/kibertoad/modular-react#readme) for the full guide.
npm package: @modular-react/react
Description: React bindings for @modular-react/core: hooks, contexts, error boundaries, and scoped stores.
Latest version: 1.0.1

# @modular-react/react 

React bindings for the `@modular-react/core` package. Provides context providers, hooks, and components that the router-specific runtime packages use internally.

## Installation

```bash
npm install @modular-react/react
```

## What's included

- **Shared dependencies**: `SharedDependenciesContext`, `createSharedHooks` (factory that returns `useStore`, `useService`, `useReactiveService`, `useOptional`)
- **Scoped stores**: `createScopedStore` with `useScoped` hook
- **Slots**: `SlotsContext`, `useSlots`, `RecalculateSlotsContext`, `useRecalculateSlots`, `DynamicSlotsProvider`, `createSlotsSignal`
- **Navigation**: `NavigationContext`, `useNavigation`
- **Modules**: `ModulesContext`, `useModules`, `getModuleMeta`
- **Error boundary**: `ModuleErrorBoundary`
- **Re-exported from `@modular-react/core`**: all types, `createStore`, `isStore`, `isStoreApi`, `isReactiveService`, `separateDeps`, `defineModule`, `defineSlots`, slot/navigation/validation functions, and runtime helpers

## Usage

Most apps import hooks from a router-specific package (`@react-router-modules/core` or `@tanstack-react-modules/core`). The router-specific runtime packages re-export relevant items from this package.

```typescript
import { useSlots, useNavigation, useModules } from "@modular-react/react";
```

See the [main documentation](https://github.com/kibertoad/modular-react#readme) for the full guide.
npm package: @modular-react/testing
Description: Testing utilities for @modular-react modules: mock stores, module resolution, and slot evaluation.
Latest version: 1.0.1

# @modular-react/testing 

Router-agnostic testing utilities for modular-react modules. Resolve module contributions (slots, lifecycle) without rendering.

## Installation

```bash
npm install -D @modular-react/testing
```

## What's included

- **`resolveModule`**: resolves module contributions (slots, lifecycle) without rendering
- **`createMockStore`**: creates a store pre-populated with test state (uses `@modular-react/core`'s built-in store)
- **Types**: `ResolveModuleOptions`, `ResolveModuleResult`

## Usage

```typescript
import { resolveModule, createMockStore } from "@modular-react/testing";

const { slots, entry, onRegisterCalled } = resolveModule(myModule, {
  defaults: { commands: [], badges: [] },
  deps: { auth: { user: { isAdmin: true } } },
});

expect(slots.commands).toHaveLength(2);
expect(entry.id).toBe("my-module");
```

For rendering modules with a router, use the router-specific testing packages (`@react-router-modules/testing` or `@tanstack-react-modules/testing`).

See the [main documentation](https://github.com/kibertoad/modular-react#readme) for the full guide.