@evjs/shared
v0.1.11
Published
Shared types and utilities for the evjs framework
Downloads
812
Maintainers
Readme
@evjs/shared
Shared utility types, errors, and constants for the evjs fullstack framework.
Features
- 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.
Install
npm install @evjs/sharedStructure
- Config:
EvConfig,ResolvedEvConfig, anddefineConfig(). - Errors:
ServerError,ServerFunctionError. - Constants:
CONFIG_DEFAULTS.
Core Logic
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.
License
MIT