Shared utility types, errors, and constants for the evjs fullstack framework.
- Protocol Schemas — Shared types for the server function wire format.
- Unified Error Handling —
ServerErrorandServerFunctionErrortypes for consistent error propagation. - Config Definitions — Types and default values for
ev.config.ts. - Framework Discovery — Utils for resolving project root and discovered manifests.
npm install @evjs/shared- Config:
EvConfig,ResolvedEvConfig, anddefineConfig(). - Errors:
ServerError,ServerFunctionError. - Constants:
CONFIG_DEFAULTS.
This package contains shared logic and types used by both the client-side (@evjs/client) and server-side (@evjs/server) runtimes.
import { ServerError } from "@evjs/shared";
// Throwing structured errors
throw new ServerError("The requested user does not exist", {
status: 404,
data: { userId: "123" },
});The error then flows seamlessly through the transport layer to the client.
MIT