@gdjiami/cli
Version:
CLI for build front end project.
52 lines (51 loc) • 1.84 kB
TypeScript
import { OutputFileSystem } from 'webpack';
export declare const IS_CI: boolean;
export declare function shouldUseYarn(): boolean;
export declare function choosePort(defaultPort: number): Promise<number>;
/**
* transform ',' separated string to string[]
* @param str
*/
export declare function transformString2Array(str: string): string[];
/**
* transform --group.foo=a,b or --group=a,b --group=b,c
*/
export declare function transformGroup(argv: string | string[] | {
[key: string]: string;
}): StringArrayObject;
export declare function writeJSON(path: string, data: object): void;
/**
* clear teminater
*/
export declare function clearConsole(): void;
export declare const noopFileSystem: OutputFileSystem;
export declare function prepareUrls(protocol: string, host: string, port: number): {
lanUrlForConfig: string | undefined;
lanUrlForTerminal: string | undefined;
localUrlForTerminal: string;
localUrlForBrowser: string;
};
export declare function inspect(variable: any, title?: string): void;
export declare function isModuleExistsInCwd(name: string): boolean;
export declare function resolveModuleInCwd(name: string): string;
export declare function getModuleVersion(name: string): Promise<any>;
export declare function requireInCwd(name: string): any;
/**
* interpolate ${variable} in string
*/
export declare function interpolate(str: string, local: {
[key: string]: string;
}): string;
export declare const logSymbols: {
success: string;
error: string;
warn: string;
info: string;
};
export declare const message: {
success: (text: string) => void;
error: (text: string) => void;
warn: (text: string) => void;
info: (text: string) => void;
custom: (title: string, text: string, color?: string) => void;
};