1 | import { PromptModule } from '@ionic/cli-framework';
|
2 | import { BaseBuildOptions, BuildOptions, CommandLineInputs, CommandLineOptions, CommandMetadata, CommandMetadataOption, IConfig, ILogger, IProject, IShell, NpmClient, Runner } from '../definitions';
|
3 | export declare const BUILD_SCRIPT = "ionic:build";
|
4 | export declare const COMMON_BUILD_COMMAND_OPTIONS: readonly CommandMetadataOption[];
|
5 | export interface BuildRunnerDeps {
|
6 | readonly config: IConfig;
|
7 | readonly log: ILogger;
|
8 | readonly project: IProject;
|
9 | readonly prompt: PromptModule;
|
10 | readonly shell: IShell;
|
11 | }
|
12 | export declare abstract class BuildRunner<T extends BuildOptions<any>> implements Runner<T, void> {
|
13 | protected abstract readonly e: BuildRunnerDeps;
|
14 | abstract getCommandMetadata(): Promise<Partial<CommandMetadata>>;
|
15 | abstract createOptionsFromCommandLine(inputs: CommandLineInputs, options: CommandLineOptions): T;
|
16 | abstract buildProject(options: T): Promise<void>;
|
17 | getPkgManagerBuildCLI(): PkgManagerBuildCLI;
|
18 | createBaseOptionsFromCommandLine(inputs: CommandLineInputs, options: CommandLineOptions): BaseBuildOptions;
|
19 | determineEngineFromCommandLine(options: CommandLineOptions): string;
|
20 | beforeBuild(options: T): Promise<void>;
|
21 | run(options: T): Promise<void>;
|
22 | afterBuild(options: T): Promise<void>;
|
23 | }
|
24 | export declare abstract class BuildCLI<T extends object> {
|
25 | protected readonly e: BuildRunnerDeps;
|
26 | |
27 |
|
28 |
|
29 | abstract readonly name: string;
|
30 | |
31 |
|
32 |
|
33 | abstract readonly pkg: string;
|
34 | |
35 |
|
36 |
|
37 | abstract readonly program: string;
|
38 | |
39 |
|
40 |
|
41 |
|
42 | abstract readonly script?: string;
|
43 | |
44 |
|
45 |
|
46 | readonly global: boolean;
|
47 | private _resolvedProgram?;
|
48 | constructor(e: BuildRunnerDeps);
|
49 | readonly resolvedProgram: string;
|
50 | /**
|
51 | * Build the arguments for starting this Build CLI. Called by `this.run()`.
|
52 | */
|
53 | protected abstract buildArgs(options: T): Promise<string[]>;
|
54 | resolveScript(): Promise<string | undefined>;
|
55 | build(options: T): Promise<void>;
|
56 | protected runWrapper(options: T): Promise<void>;
|
57 | protected run(options: T): Promise<void>;
|
58 | protected resolveProgram(): Promise<string>;
|
59 | protected promptToInstall(): Promise<boolean>;
|
60 | }
|
61 | declare abstract class PkgManagerBuildCLI extends BuildCLI<BaseBuildOptions> {
|
62 | readonly abstract program: NpmClient;
|
63 | readonly global = true;
|
64 | readonly script = "ionic:build";
|
65 | protected resolveProgram(): Promise<string>;
|
66 | protected buildArgs(options: BaseBuildOptions): Promise<string[]>;
|
67 | }
|
68 | export declare class NpmBuildCLI extends PkgManagerBuildCLI {
|
69 | readonly name = "npm CLI";
|
70 | readonly pkg = "npm";
|
71 | readonly program = "npm";
|
72 | }
|
73 | export declare class YarnBuildCLI extends PkgManagerBuildCLI {
|
74 | readonly name = "Yarn";
|
75 | readonly pkg = "yarn";
|
76 | readonly program = "yarn";
|
77 | }
|
78 | export {};
|