UNPKG

frontity

Version:

Frontity cli and entry point to other packages

69 lines (68 loc) 2.08 kB
/** * Validation for package name. * * @param name - The package name to be checked. * @returns Whether the given name is valid. */ export declare const isPackageNameValid: (name: string) => boolean; /** * Theme name validation. * * @param name - The theme name to be checked. * @returns Wheather the given name is valid. */ export declare const isThemeNameValid: (name: string) => boolean; /** * Namespace value validation. * * @param name - Namespace value. * @returns Weather the given name is valid. */ export declare const isNamespaceValid: (name: string) => boolean; /** * Takes a name, as string, and converts it to camelCase if it contains non alpha chars. * * @param name - The name value to be converted. * @returns The converted name. */ export declare const toCamelCase: (name: string) => string; /** * Logs an error to the console preformatted with the proper color. * * @param error - The error instance. * @param message - The optional message. */ export declare const errorLogger: (error: Error, message?: string) => never; /** * Checks if the given path is a valid frontity project. * * @param path - The path to check. * @returns If the path is a valid project root. */ export declare const isFrontityProjectRoot: (path: string) => Promise<boolean>; /** * Fetches the given package version. The latest one. * * @param pkg - The package name. * @returns The latest version. */ export declare const fetchPackageVersion: (pkg: string) => Promise<string>; /** * Utility function to log to console. * * @param msg - The message to be logged. * @param optionalParams - Optional parameters. */ export declare const log: (msg?: any, ...optionalParams: any[]) => void; /** * Checks if the current directory is a git repo. * * @returns True if the current directory is a git repo, false otherwise. */ export declare const isInGitRepository: () => boolean; /** * Checks if git is installed on the current machine. * * @returns True if the git command exists, false otherwise. */ export declare const hasGit: () => boolean;