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