@tryloop/oats
Version:
🌾 OATS - OpenAPI TypeScript Sync. The missing link between your OpenAPI specs and TypeScript applications. Automatically watch, generate, and sync TypeScript clients from your API definitions.
40 lines • 1.39 kB
TypeScript
/**
* Environment Variable Manager for OATS
*
* Handles framework detection and environment variable injection
* for seamless backend URL configuration across different frontend frameworks
*/
import type { RuntimeConfig } from '../../types/config.types.js';
export interface FrameworkEnvConfig {
framework: string;
envPrefix: string;
description: string;
}
export declare class EnvManager {
private logger;
private static readonly FRAMEWORK_CONFIGS;
constructor();
/**
* Detect frontend framework from package.json
*/
detectFramework(projectPath: string): string;
/**
* Get the appropriate env prefix for a framework
*/
private getEnvPrefix;
/**
* Generate OATS environment variables for frontend service
*/
generateFrontendEnvVars(frontendPath: string, runtimeConfig: RuntimeConfig): Record<string, string>;
/**
* Get a user-friendly framework description
*/
getFrameworkDescription(framework: string): string;
/**
* Generate environment variables for any service type
* This can be extended for backend services, workers, etc.
*/
generateServiceEnvVars(serviceType: 'frontend' | 'backend' | 'worker', servicePath: string, runtimeConfig: RuntimeConfig): Record<string, string>;
}
export declare const envManager: EnvManager;
//# sourceMappingURL=env-manager.d.ts.map