Configuration

Meta Configuration System

Programmatic initialization via +xypriss.meta.ts for advanced setup tasks before standard configuration is applied.

The Meta Configuration system allows executing arbitrary code during the earliest phase of server initialization. This is critical for tasks like global state adjustment, environment patching, or pre-flight security checks.

File Discovery

The system searches for a meta file in the project root or hidden directories. Only the first one found is executed.

+xypriss.meta.ts (Root)
+xypriss.meta.js (Root)
.meta/+xypriss.meta.ts
.xypriss/+xypriss.meta.ts

Execution Methods

Immediate Execution (IIFE)

Any code at the top level of the file executes as soon as the file is imported.

The "run" Function

The recommended way to structure logic. The system invokes this automatically after import.

Implementation Example

typescript
// +xypriss.meta.ts

// 1. Executes immediately
console.log("Meta layer active.");
__sys__.__env__.set("BOOT_TIME", Date.now().toString());

/**
 * 2. Structured initialization logic
 * Called automatically by ConfigLoader
 */
export function run() {
    if (globalThis.__sys__) {
        // Perform advanced pre-flight checks
    }
}

Pre-Config

Runs before xypriss.config.jsonc is loaded.

Singleton

Guaranteed to run exactly once per process lifetime.

Fail-Safe

Errors are logged as warnings to prevent startup crashes.

System Overview

Return to the Hyper-System API documentation to explore native capabilities.