@thingjs/cli-common
Version:
The origin cli-utils is too big, and the most tools are for the service, and is not needed to install when install the cli.
47 lines (42 loc) • 1.73 kB
TypeScript
export { default as log } from 'npmlog';
type ConfigJson = {
copy: {
version: string;
files: {
name: string[];
source: string;
target: string;
}[];
};
};
declare function getConfigJson(cwd: string): Promise<ConfigJson>;
declare function getAllThingJSVersions(url?: string): Promise<string[]>;
declare function validateThingJSVersion(version: string): boolean;
declare function getLatestThingJSVersion(config?: ConfigJson): Promise<string>;
declare function installDefaultThingJS(cwd?: string): Promise<boolean>;
declare function installThingJSFiles(config: ConfigJson, currentVersion: string): Promise<boolean>;
declare function writeThingjsVersionToPkg(version: string, cwd?: string): Promise<boolean>;
/**
* 获取当前项目的thing.js版本
*/
declare function getCurProjectThingJSVersion(cwd: string): Promise<string | null>;
declare const thing: {
writeThingjsVersionToPkg: typeof writeThingjsVersionToPkg;
getAllThingJSVersions: typeof getAllThingJSVersions;
getLatestThingJSVersion: typeof getLatestThingJSVersion;
validateThingJSVersion: typeof validateThingJSVersion;
installDefaultThingJS: typeof installDefaultThingJS;
installThingJSFiles: typeof installThingJSFiles;
getCurProjectThingJSVersion: typeof getCurProjectThingJSVersion;
getConfigJson: typeof getConfigJson;
};
interface PrepareOption {
nodeVersion: string;
}
/**
* prepare for the commands of scaffolding
*/
declare function prepareCheck(option: PrepareOption): Promise<void>;
declare function checkUserHome(): void;
declare function checkNodeVersion(allowVersion: string): void;
export { checkNodeVersion, checkUserHome, prepareCheck, thing };