UNPKG

2.33 kBTypeScriptView Raw
1import { ApplicationContract } from '@ioc:Adonis/Core/Application';
2import * as sink from '../../../index';
3/**
4 * Exposes the API to execute the instructions of a package, defined inside
5 * the `package.json` file.
6 */
7export declare class Instructions {
8 private packageName;
9 private projectRoot;
10 private application;
11 private verbose;
12 /**
13 * Path to the package package.json file
14 */
15 private packagePath;
16 private markdownDisplay;
17 private logger;
18 constructor(packageName: string, projectRoot: string, application: ApplicationContract, verbose?: boolean);
19 /**
20 * Formats object to string
21 */
22 private formatObject;
23 /**
24 * Formats array to string
25 */
26 private formatArray;
27 /**
28 * Returns the suffix for the logger statements
29 */
30 private getSuffix;
31 /**
32 * Returns the absolute path to the package
33 */
34 private getPackagePath;
35 /**
36 * Load package json file from the package root directory
37 */
38 private loadPackageJsonFile;
39 /**
40 * Copies templates to the user project
41 */
42 private copyTemplates;
43 /**
44 * Set environment variables
45 */
46 private setEnvVariables;
47 /**
48 * Adds the types to the tsconfig.json file
49 */
50 private setTypes;
51 /**
52 * Adds the meta files to `.adonisrc.json` file
53 */
54 private setMetaFiles;
55 /**
56 * Adds the preloads to `.adonisrc.json` file
57 */
58 private setPreloads;
59 /**
60 * Set commands inside the adonisrc.json file
61 */
62 private setCommands;
63 /**
64 * Set aliases inside the adonisrc.json file
65 */
66 private setAliases;
67 /**
68 * Sets providers or ace providers inside the `.adonisrc.json` file
69 */
70 private setProviders;
71 /**
72 * Executes the instructions fn exposed by the package inside package.json file.
73 */
74 private runInstructions;
75 /**
76 * Renders the markdown file if defined inside the package.json file.
77 */
78 private renderMarkdownFile;
79 /**
80 * Preset markdown display for avoiding prompt
81 */
82 setDisplay(display: 'browser' | 'terminal'): this;
83 /**
84 * Define a custom logger to use
85 */
86 useLogger(logger: typeof sink.logger): this;
87 /**
88 * Execute the instructions file
89 */
90 execute(): Promise<boolean>;
91}