@reliverse/rse
Version:
@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power
54 lines (53 loc) • 2.05 kB
TypeScript
/**
* Determines if we log additional debug info.
* Set to `true` for verbose output.
*/
export declare const mrseVerbose = false;
/**
* Helper to conditionally log verbose messages based on `mrseVerbose`.
* @param msg - The message to log.
* @param data - Optional additional data to log.
*/
export declare function logVerbose(msg: string, data?: unknown): void;
/**
* Configuration data for a single project.
*/
export interface GenCfg {
projectName: string;
projectTemplate: string;
getEnvExample: boolean;
projectPath?: string;
}
/**
* Shape of the JSONC config file (wrapper around GenCfg[]).
*/
export interface GenCfgJsonc {
genCfg: GenCfg[];
}
/**
* Gets the path to the env cache directory (used for storing .env.example files).
* @returns Absolute path to the `.reliverse/envs` directory.
*/
export declare function getEnvCacheDir(): string;
/**
* Ensures the env cache directory exists (creates if necessary).
* @returns The cache directory path.
*/
export declare function ensureEnvCacheDir(): Promise<string>;
/**
* Builds the full cache file path for a repository's `.env.example` file.
* @param repo - Owner/repo string.
* @param branch - The git branch (defaults to "main").
* @returns The absolute path to the cached `.env.example` file.
*/
export declare function getEnvCachePath(repo: string, branch?: string): string;
/**
* Downloads a `.env.example` file from a GitHub repository with optional caching.
* @param repo - The owner/repo string (e.g., "username/repo").
* @param filePath - The file path within the repo (usually ".env.example").
* @param branch - The git branch to use. Defaults to "main".
* @param useCache - Whether to use local caching. Defaults to true.
* @param useFresh - If true, bypasses existing cache. Defaults to false.
* @returns The file content as a string, or null if download fails.
*/
export declare function downloadFileFromGitHub(repo: string, filePath: string, branch?: string, useCache?: boolean, useFresh?: boolean): Promise<string | null>;