UNPKG

2.52 kBTypeScriptView Raw
1import { CraftProjectConfig, GithubGlobalConfig } from './schemas/project_config';
2import { BaseArtifactProvider } from './artifact_providers/base';
3import { BaseStatusProvider } from './status_providers/base';
4export declare const CONFIG_FILE_NAME = ".craft.yml";
5/**
6 * The default prefix for the release branch.
7 */
8export declare const DEFAULT_RELEASE_BRANCH_NAME = "release";
9/**
10 * Searches the current and parent directories for the configuration file
11 *
12 * Returns "undefined" if no file was found.
13 */
14export declare function findConfigFile(): string | undefined;
15/**
16 * Returns project configuration (.craft.yml) file path
17 *
18 * Throws an error if the file cannot be found.
19 */
20export declare function getConfigFilePath(): string;
21/**
22 * Returns the path to the directory that contains the configuration file
23 *
24 * Returns "undefined" if no configuration file can be found.
25 */
26export declare function getConfigFileDir(): string | undefined;
27/**
28 * Reads JSON schema for project configuration
29 */
30export declare function getProjectConfigSchema(): any;
31/**
32 * Parses and validate passed configuration object
33 *
34 * Throw an error is the object cannot be properly parsed as configuration.
35 *
36 * @param rawConfig Raw project configuration object
37 */
38export declare function validateConfiguration(rawConfig: Record<string, any>): CraftProjectConfig;
39/**
40 * Returns the parsed configuration file contents
41 */
42export declare function getConfiguration(): CraftProjectConfig;
43/**
44 * Checks that the current "craft" version is compatible with the configuration
45 *
46 * "minVersion" configuration parameter specifies the minimal version of "craft"
47 * that can work with the given configuration.
48 */
49export declare function checkMinimalConfigVersion(): void;
50/**
51 * Return the parsed global Github configuration
52 */
53export declare function getGlobalGithubConfig(): GithubGlobalConfig;
54/**
55 * Gets git tag prefix from configuration
56 */
57export declare function getGitTagPrefix(): string;
58/**
59 * Create an artifact provider instance from the spec in the configuration file
60 *
61 * @returns An instance of artifact provider (which may be the dummy
62 * NoneArtifactProvider if artifact storage is disabled).
63 */
64export declare function getArtifactProviderFromConfig(): BaseArtifactProvider;
65/**
66 * Create a status provider instance from the spec in the configuration file
67 *
68 * @returns An instance of status provider
69 */
70export declare function getStatusProviderFromConfig(): BaseStatusProvider;
71//# sourceMappingURL=config.d.ts.map
\No newline at end of file