@ionic/cli-utils
Version:
Ionic CLI Utils
76 lines (75 loc) • 3.59 kB
TypeScript
import { BaseConfig, BaseConfigOptions, PromptModule } from '@ionic/cli-framework';
import { IAilmentRegistry, IClient, IConfig, IIntegration, ILogger, IProject, IProjectConfig, ISession, IShell, InfoItem, IntegrationName, IonicContext, IonicEnvironmentFlags, PackageJson, ProjectIntegration, ProjectPersonalizationDetails, ProjectType } from '../../definitions';
import * as ζbuild from '../build';
import * as ζgenerate from '../generate';
import * as ζserve from '../serve';
export declare function determineProjectType(projectDir: string, projectName: string | undefined, projectConfig: {
[key: string]: any;
} | undefined, deps: ProjectDeps): Promise<ProjectType | undefined>;
export declare function createProjectFromType(filePath: string, name: string | undefined, deps: ProjectDeps, type: ProjectType): Promise<IProject>;
export declare class ProjectConfig extends BaseConfig<IProjectConfig> {
constructor(p: string, options?: BaseConfigOptions);
provideDefaults(): IProjectConfig;
}
export interface ProjectDeps {
readonly client: IClient;
readonly config: IConfig;
readonly flags: IonicEnvironmentFlags;
readonly log: ILogger;
readonly prompt: PromptModule;
readonly session: ISession;
readonly shell: IShell;
readonly ctx: IonicContext;
}
export declare abstract class Project implements IProject {
/**
* The file path to the configuration file.
*/
readonly filePath: string;
/**
* If provided, this is a multi-app project and will be configured to use
* the app identified by this string. Otherwise, this is a single-app
* project.
*/
readonly name: string | undefined;
protected readonly e: ProjectDeps;
readonly directory: string;
abstract readonly type: ProjectType;
protected originalConfigFile?: {
[key: string]: any;
};
constructor(
/**
* The file path to the configuration file.
*/
filePath: string,
/**
* If provided, this is a multi-app project and will be configured to use
* the app identified by this string. Otherwise, this is a single-app
* project.
*/
name: string | undefined, e: ProjectDeps);
readonly config: ProjectConfig;
abstract detected(): Promise<boolean>;
abstract requireBuildRunner(): Promise<ζbuild.BuildRunner<any>>;
abstract requireServeRunner(): Promise<ζserve.ServeRunner<any>>;
abstract requireGenerateRunner(): Promise<ζgenerate.GenerateRunner<any>>;
getBuildRunner(): Promise<ζbuild.BuildRunner<any> | undefined>;
getServeRunner(): Promise<ζserve.ServeRunner<any> | undefined>;
getGenerateRunner(): Promise<ζgenerate.GenerateRunner<any> | undefined>;
requireProId(): Promise<string>;
readonly packageJsonPath: string;
getPackageJson(pkgName?: string): Promise<[PackageJson | undefined, string | undefined]>;
requirePackageJson(pkgName?: string): Promise<PackageJson>;
getDocsUrl(): Promise<string>;
getSourceDir(sourceRoot?: string): Promise<string>;
getDistDir(): Promise<string>;
getInfo(): Promise<InfoItem[]>;
personalize(details: ProjectPersonalizationDetails): Promise<void>;
registerAilments(registry: IAilmentRegistry): Promise<void>;
createIntegration(name: IntegrationName): Promise<IIntegration>;
getIntegration(name: IntegrationName): Promise<Required<ProjectIntegration>>;
protected getIntegrations(): Promise<IIntegration[]>;
}
export declare function prettyProjectName(type?: string): string;
export declare function prettyProjectTooling(type?: string): string;