@nwire/scan
v0.7.1
Published
Nwire — system registry scanner. Walks AppDefinition[] manifests and writes the .nwire/ cache (actions, events, actors, projections, queries, modules, routes, event graph). Vite plugin + standalone function.
Readme
@nwire/scan
Walks
AppDefinition[]and produces the.nwire/cache — the framework's static-reflection layer.
What it does
Reads every action / event / actor / projection / query / workflow / module across all registered apps and emits a set of JSON files (actions.json, events.json, actors.json, projections.json, queries.json, routes.json, modules.json, graph.json, manifest.json). Studio reads these; the CLI reads these; codegen pipelines read these. Rebuilt from scratch on each invocation (a few ms for hundreds of definitions).
Install
pnpm add @nwire/scanQuick start
import { buildCache, writeCache } from "@nwire/scan";
import { allApps } from "../apps/apps";
const cache = buildCache(allApps);
await writeCache(cache, ".nwire");
//.nwire/manifest.json +.nwire/actions.json +... now on diskMost users invoke this via the CLI: nwire cache.
API surface
buildCache(apps)— returns the cache object.writeCache(cache, dir)— write the cache to disk.- Entry types:
ActionEntry,EventEntry,ActorEntry,ProjectionEntry,QueryEntry,RouteEntry,ModuleEntry, etc.
When to use
When building tooling that needs to introspect a Nwire app — Studio panels, codegen, generated docs, custom CLIs. Fits every level (tooling concern).
