# @modular-vue/runtime

> vue-router runtime for @modular-vue modules: createRegistry with module registration, dependency validation, lifecycle hooks, plugin machinery, and manifest resolution.

Latest version **1.4.1** (published 2026-07-19) · 0 weekly downloads

## Install

```sh
npm install @modular-vue/runtime
pnpm add @modular-vue/runtime
yarn add @modular-vue/runtime
bun add @modular-vue/runtime
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2026-07-19 |
| First published | 2026-07-18 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 106.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Maintainers | kibertoad |

## Links

- npm: https://www.npmjs.com/package/@modular-vue/runtime
- Repository: https://github.com/kibertoad/modular-react
- npm.io page: https://npm.io/package/@modular-vue/runtime

## Recent versions

- 1.4.1 (latest) — 2026-07-19
- 1.4.0 — 2026-07-19
- 1.3.0 — 2026-07-19
- 1.2.0 — 2026-07-18
- 1.1.0 — 2026-07-18
- 1.0.1 — 2026-07-18
- 1.0.0 — 2026-07-18

## README

# @modular-vue/runtime

Runtime registry for `@modular-vue` modules on vue-router. Collects registered
modules, validates their dependencies, runs lifecycle hooks, drives the plugin
machinery, and resolves the navigation manifest, slots, and module descriptors.

This is the registry half of the runtime. The router-owning `resolve()` entry,
the `Providers` context component, the `router.addRoute()` route-builder, and
the auth guard land alongside it in a following release; this package assembles
everything that does not need a router or a Vue render tree.

## Installation

```bash
npm install @modular-vue/runtime
```

## What's included

- **`createRegistry(config)`** — build a registry from `stores` / `services` /
  `reactiveServices` / `slots`.
- **`registry.register(module)`** / **`registry.registerLazy(descriptor)`** —
  register eager and lazily-loaded modules.
- **`registry.use(plugin)`** — attach a plugin; its `extend` surface is
  intersected onto the returned registry reference, so contributed methods
  (e.g. a future `registerJourney`) are typed on the same object.
- **`registry.resolveManifest(options?)`** — resolve all modules into a
  `ResolvedManifest`: `navigation`, `slots`, `modules`, `moduleDescriptors`,
  plugin `extensions` (+ the `journeys` alias), `onModuleExit`, and
  `recalculateSlots`. Idempotent — the first call does the work and caches the
  result; later calls return it and must pass no options.

## Usage

```ts
import { createRegistry } from "@modular-vue/runtime";
import { billingModule } from "@myorg/billing";

export const registry = createRegistry<AppDeps, AppSlots>({
  stores: { auth: authStore },
  services: { api },
  slots: { commands: [] },
});

registry.register(billingModule);

export const manifest = registry.resolveManifest();
// manifest.navigation, manifest.slots, manifest.moduleDescriptors, ...
```

## Validation

`resolveManifest()` runs the shared core validators before assembly:

- duplicate module IDs throw,
- modules whose `requires` are not provided by the registry throw,
- `optionalRequires` gaps warn (the module still loads),
- malformed entry/exit declarations throw.

Registration is locked once `resolveManifest()` runs — registering a module or
attaching a plugin afterwards throws.

---
_Source: https://npm.io/package/@modular-vue/runtime · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
