UCD.js Docs

Package Layers

Package dependency layers across the UCD.js monorepo

The monorepo is organized into six dependency layers. Packages in a higher layer depend on packages in lower layers - never the other way around. This keeps the dependency graph acyclic and makes individual packages testable in isolation.

Layer 6 - User Interface

Layer 5 - Serving & Consumption

Layer 4 - Processing

Layer 3 - Persistence

Layer 2 - Infrastructure

Layer 1 - Schemas & Contracts

@ucdjs/env

@ucdjs/schemas

@ucdjs-internal/shared

@ucdjs/fs-backend

@ucdjs/path-utils

@ucdjs/lockfile

@ucdjs/ucd-store

@ucdjs/pipeline-core

@ucdjs/pipeline-graph

@ucdjs/pipeline-loader

@ucdjs/pipeline-executor

@ucdjs/pipeline-presets

@ucdjs/client

@ucdjs/pipeline-server

@ucdjs/cli

Layer 1 - Schemas & Contracts

The foundation. No workspace dependencies.

PackagePurpose
@ucdjs/schemasZod schemas for all data contracts: API responses, lockfiles, manifests, Unicode metadata
@ucdjs/envRuntime constants (UCDJS_API_BASE_URL), HTTP stat headers, requiredEnv()

@ucdjs/schemas is the single source of truth for every data shape in the system. If a package receives or emits structured data, its shape is defined here.

Layer 2 - Infrastructure

Low-level utilities with no business logic.

PackagePurpose
@ucdjs-internal/sharedInternal helpers: async utilities, fetch wrappers, path filters, API guards
@ucdjs/fs-backendFilesystem abstraction for Node.js, HTTP, and custom backends
@ucdjs/path-utilsPath manipulation utilities built on top of pathe

@ucdjs-internal/shared is intentionally marked internal - it may ship breaking changes in patch releases. Consumer packages should use @ucdjs/utils instead.

fs-backend implementations

Application

fs-backend interface
read / write / list / stat / copy

Node backend
(local disk)

HTTP backend
(read-only HTTP)

The backend abstraction keeps storage code environment-agnostic. The same lockfile and ucd-store code can run against a local filesystem in development or a remote HTTP endpoint in read-only contexts.

Layer 3 - Persistence

PackagePurpose
@ucdjs/lockfileManages .ucd-store.lock (version index) and {version}/snapshot.json (per-version file hashes)
@ucdjs/ucd-storeHigh-level store operations: mirror, sync, compare, analyze, validate

The lockfile is the canonical record of what has been mirrored. It is the only mutable output that both the write path (pipelines/sync) and the read path (client/API) agree on.

Layer 4 - Processing (Pipelines)

PackagePurpose
@ucdjs/pipeline-corePipeline DSL: definePipeline(), sources, routes, transforms, filters, and outputs
@ucdjs/pipeline-graphDAG representation of pipeline route dependencies
@ucdjs/pipeline-loaderDiscover and load pipeline definitions from the filesystem
@ucdjs/pipeline-executorExecute pipelines with concurrency, caching, logs, traces, and published-output ordering
@ucdjs/pipeline-presetsShared parsers, resolvers, routes, and pipeline factories for common UCD processing tasks

Routes inside a pipeline form a directed acyclic graph. The executor uses pipelines-graph to resolve the dependency order and run routes concurrently where the graph allows it.

Route execution model

events

Pipeline Definition
(pipelines-core)

Loader
(discover & bundle)

Executor
(DAG resolution + concurrency)

Outputs / Route Data

pipelines-server
(UI + WebSocket)

Layer 5 - Serving & Consumption

PackagePurpose
@ucdjs/clientHTTP client with .well-known auto-discovery and typed resource wrappers
@ucdjs/pipeline-serverFull-stack server for pipeline execution monitoring (React + H3 + LibSQL)

Layer 6 - User Interface

PackagePurpose
@ucdjs/cliucd binary - the highest-level integration point; wraps store, client, pipelines, and codegen

Internal vs public packages

Packages prefixed with @ucdjs-internal/ (shared, worker-utils, shared-ui) are allowed to make breaking changes in patch releases. Do not depend on them from external projects.

Stable publicInternal / volatile
@ucdjs/*@ucdjs-internal/*
Semver respectedMay break in patches
Safe to consume externallyWorkspace-only use

On this page