Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@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 HandlingServerError and ServerFunctionError types 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/shared

Structure

  • Config: EvConfig, ResolvedEvConfig, and defineConfig().
  • 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