venus-cli
Version:
the basic cli commands
129 lines (128 loc) • 3.67 kB
TypeScript
import { TrackerGroup, TrackerStream, Tracker } from 'are-we-there-yet';
export declare enum LogLevels {
silly = "silly",
verbose = "verbose",
info = "info",
http = "http",
success = "success",
warn = "warn",
error = "error"
}
export interface IStyleObject {
fg?: string;
bg?: string;
bold?: boolean;
inverse?: boolean;
underline?: boolean;
bell?: boolean;
}
export interface IMessageObject {
id: number;
level: string;
prefix: string;
message: string;
messageRaw: string;
}
export interface ILogger {
level: string;
record: IMessageObject[];
maxRecordSize: number;
prefixStyle: IStyleObject;
headingStyle: IStyleObject;
heading: string;
stream: any;
log(level: LogLevels | string, prefix: string, message: string, ...args: any[]): void;
silly(prefix: string, message: string, ...args: any[]): void;
verbose(prefix: string, message: string, ...args: any[]): void;
info(prefix: string, message: string, ...args: any[]): void;
notice(prefix: string, message: string, ...args: any[]): void;
success(prefix: string, message: string, ...args: any[]): void;
warn(prefix: string, message: string, ...args: any[]): void;
error(prefix: string, message: string, ...args: any[]): void;
enableColor(): void;
disableColor(): void;
enableProgress(): void;
disableProgress(): void;
enableUnicode(): void;
disableUnicode(): void;
pause(): void;
resume(): void;
newGroup(name: string): ILogger & TrackerGroup;
newStream(name: string): ILogger & TrackerStream;
newItem(name: string, todo: number, weight?: any): ILogger & Tracker;
addLevel(level: string, n: number, style?: IStyleObject, disp?: string): void;
}
export interface IGLobalOption {
loglevel: LogLevels;
}
export interface ICmdUpgradeParam extends IGLobalOption {
}
export interface ICmdMockParam extends IGLobalOption {
}
export interface ICmdBuildParam extends IGLobalOption {
module: string;
sourceMap?: boolean;
uglify?: boolean;
project?: string;
scaffoldType?: ScaffoldType;
}
export interface ICmdServeParam extends IGLobalOption {
module: string;
scaffoldType?: ScaffoldType;
}
export interface ICmdStaticParam extends IGLobalOption {
}
export interface ICmdTestParam extends IGLobalOption {
testNamePattern: string;
}
export interface ICmdUploadParam extends IGLobalOption {
}
export interface IZipParam extends IGLobalOption {
module: string;
scaffoldType?: ScaffoldType;
}
export declare type ScaffoldType = 'react' | 'inferno' | 'wxapp' | 'mp' | 'node' | 'rollup';
export interface ICmdCreateParam extends IGLobalOption {
scaffold: ScaffoldType;
lernaMode?: boolean;
}
export interface ICmdPublishParam extends IGLobalOption {
env: 'inte' | 'prod';
module: string;
filter: 'assets' | 'scripts' | 'all';
scaffoldType?: ScaffoldType;
}
export interface ILeonConfig {
uploadApi: string;
userToken: string;
pId: string;
bucketName: string;
}
export interface IFtpConfig {
host: string;
port: number;
user: string;
password: string;
}
export interface IQiniuConfig {
secretKey: string;
accessKey: string;
baseURL: string;
bucketName: string;
zone: 'z0' | 'z1' | 'z2' | 'na0';
}
export interface IPublishConfig {
leon?: ILeonConfig;
ftp?: IFtpConfig;
qiniu?: IQiniuConfig;
}
export interface IUploadParam {
projectId: number;
versionId: number;
publicFilePath: string;
modules: string[];
branchName: string;
requirements: string[];
comment: string;
createdBy?: string;
}