@ooopsstudio/services
v0.1.1
Published
Runtime service implementations and cross-service bridges for the Ooops System.
Readme
@ooopsstudio/services
Runtime service implementations and cross-service bridges for the Ooops System.
This package owns the concrete implementations for errors, logging, metrics, tracing, lifecycle, resilience, performance, and rate limiting.
Installation
pnpm add @ooopsstudio/services
# or
npm install @ooopsstudio/servicesUsage
import {createProductionLogging} from '@ooopsstudio/services/logging/public/production'
import {createProductionResilience} from '@ooopsstudio/services/resilience/public/production'
const logger = createProductionLogging()
const resilience = createProductionResilience({logger})
logger.info('System initialized')
await resilience
.wrap('fetch-profile', {
operationKind: 'external.http',
resource: 'api.users'
})
.withRetry('external.http')
.withTimeout(1500)
.build()(async(signal) => {
const response = await fetch('https://example.com/me', {signal})
return await response.json()
})Tree-shakeable public subpaths are available where they are intentionally supported:
@ooopsstudio/services/errors/*@ooopsstudio/services/errors/sinks@ooopsstudio/services/logging/analytics@ooopsstudio/services/logging/sinks@ooopsstudio/services/logging/public/*@ooopsstudio/services/metrics/public@ooopsstudio/services/metrics/public/*@ooopsstudio/services/metrics/sinks@ooopsstudio/services/performance/public/*@ooopsstudio/services/rate-limit/public@ooopsstudio/services/rate-limit/public/*@ooopsstudio/services/resilience/public/*@ooopsstudio/services/tracing/sinks@ooopsstudio/services/tracing/public/*@ooopsstudio/services/lifecycle/public/*@ooopsstudio/services/bridges/*
Package size regression checks are enforced at two levels:
- the narrow
@ooopsstudio/servicesroot facade - per-family preset bundles for
metrics,errors,logging,performance,rate-limit,resilience,tracing, andlifecycle
Default imports in docs should keep using the narrow family preset paths above instead of the package root.
External Sink Pattern
External observability backends are standardized at the service layer.
logging:@ooopsstudio/services/logging/sinksmetrics:@ooopsstudio/services/metrics/sinkserrors:@ooopsstudio/services/errors/sinkstracing:@ooopsstudio/services/tracing/sinks
Each sink-enabled family follows the same public construction pattern:
create<Service>Sink(config)resolve<Service>Sink({sink?, sinkConfig?})createNoop<Service>Sink()
Rules:
- Core DI ports stay minimal. Sinks are service-level APIs, not core contracts.
- Presets accept
sinkandsinkConfigso applications resolve env into provider config once. - Use sinks for runtime transport to external backends.
- Use bridges for cross-service coordination inside Ooops.
- Use browser telemetry adapters separately for browser-only SDKs.
Consumer apps should resolve env/config into sinkConfig objects and pass them into service presets instead of owning provider transports directly.
Tracing backends such as Tempo should be configured through the tracing sink layer:
import {createProductionTracing} from '@ooopsstudio/services/tracing'
const tracing = createProductionTracing({
sinkConfig: {
provider: 'otlp',
endpoint: 'http://tempo:4318/v1/traces'
}
})Architecture Overview
@ooopsstudio/services is part of the Ooops System monorepo — a modular infrastructure suite for reproducible web applications.
| Layer | Package | Purpose |
|-------|----------|----------|
| Core | @ooopsstudio/core | Contracts, ports, and runtime primitives |
| Services | @ooopsstudio/services | Runtime service implementations |
| SDK | @ooopsstudio/sdk | Developer utilities |
| Frameworks | @ooopsstudio/react, @ooopsstudio/svelte | Framework adapters |
Requirements
- Node: 20.x or later
- TypeScript: Strict mode
- Package Manager: pnpm 10+
License
MIT © Ooops Studio
