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

@orria-labs/runtime

v1.0.0

Published

Core runtime, discovery, registry, codegen and CLI for Orria Runtime

Readme

@orria-labs/runtime

Core runtime для Orria Runtime: declarations, discovery, registry, runtime, codegen, bootstrap helpers и CLI orria-runtime.

  • npm: https://www.npmjs.com/package/@orria-labs/runtime

Что экспортирует пакет

  • declarations: defineAction, defineQuery, defineWorkflow, defineEvent
  • bootstrap: createApplication, defineTransportAdapter
  • discovery/registry/runtime: discoverManifest, createRegistry, getRegistryEntry, createRuntime
  • codegen: generateCoreArtifacts
  • helpers: createConfig, createDatabase, defineDatabaseAdapter
  • internals для adapters: importFreshModule, isOrriaTempModulePath, createPollingFileWatcher

Основная модель

Пакет строит приложение вокруг typed bus:

  • ctx.action.*
  • ctx.query.*
  • ctx.workflow.*
  • ctx.event.*

Bus-тип выводится из generated manifest, поэтому bootstrap обычно не требует явного createApplication<...>().

Bootstrap

import { createApplication } from "@orria-labs/runtime";
import { config } from "./config.ts";
import { database } from "./database.ts";
import { manifest } from "./generated/core/index.ts";

const app = await createApplication({
  config,
  database,
  manifest,
  setGlobalCtx: true,
});

createApplication(...) создаёт:

  • app.ctx
  • app.registry
  • app.runtime
  • app.adapter

Runtime pipeline

  • input/payload schema парсится перед вызовом handler
  • output schema парсится после handler
  • global middleware и declaration middleware исполняются единым pipeline
  • event публикуется в eventTransport и локально fan-out’ится в подписанные workflow

По умолчанию используется LocalEventTransport, но можно передать свой eventTransport в createApplication(...).

Bus metadata и unsafe

const method = app.ctx.action.user.create;

await method({ email: "[email protected]" });
await method.unsafe({ email: "[email protected]" });

method.$key;
method.$kind;
method.$definition;
method.$schema.input;
method.$schema.returns;
  • обычный вызов использует runtime schema parsing
  • .unsafe(...) пропускает schema parsing и работает с handler-level типами

Discovery и codegen

discoverManifest(...) ищет declarations по шаблонам:

  • src/modules/**/*.action.ts
  • src/modules/**/*.query.ts
  • src/modules/**/*.workflow.ts
  • src/modules/**/*.event.ts

generateCoreArtifacts(...) пишет:

  • src/generated/core/manifest.ts
  • src/generated/core/bus.d.ts
  • src/generated/core/index.ts

CLI

orria-runtime
orria-runtime help
orria-runtime version
orria-runtime generate --root . --modules src/modules --out src/generated/core
orria-runtime init --dir my-app --name my-app --adapters http,cli,cron

generate после core codegen автоматически запускает codegen всех установленных @orria-labs/* adapters.

Database helpers

Для минимального случая:

import { createDatabase } from "@orria-labs/runtime";

export const database = createDatabase(() => dbClient);

Для типизированного multi-region доступа:

import { defineDatabaseAdapter } from "@orria-labs/runtime";

export const database = defineDatabaseAdapter({
  default: "primary",
  clients: {
    primary: primaryClient,
    eu: euClient,
  },
});

Когда использовать напрямую

  • когда вы собираете transport adapter поверх core API
  • когда нужен отдельный build-time codegen
  • когда нужна runtime orchestration без HTTP/CLI/cron слоя

Ограничение

В core по-прежнему нет durable queue / outbox слоя. Актуальный backlog описан в ../../docs/TECH_DEBT.md.