dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
39 lines (38 loc) • 2.35 kB
TypeScript
/**
* Extracts and transpiles the dt-app configuration from a TypeScript config file.
*
* This function compiles the provided app.config.ts file using esbuild, optionally performs
* TypeScript type checking, and loads the resulting configuration object. It handles both
* CommonJS and ESModule formats, creates temporary files during the process, and cleans
* up after execution.
*
* @param root Absolute path to the project root directory
* @param configFilePath Absolute path to the app.config.ts file to extract configuration from
* @param tsconfigPath Absolute path to the tsconfig.json file for type checking and compilation
* @param skipTypeCheck If true, skips TypeScript type checking on the config file
* @param format Output format for the compiled config file: 'cjs' (CommonJS) or 'esm' (ESModule). Defaults to 'cjs'
* @returns The dt-app configuration object exported from the config file
* @throws If compilation, type checking, or loading the config fails, throws an Error
* @internal
*/
export declare function extractDtAppConfigFromTs(root: string, configFilePath: string, tsconfigPath: string, skipTypeCheck: boolean, format?: 'cjs' | 'esm'): Promise<any>;
/**
* Extracts project dependencies from package.json to be used as external packages during bundling.
*
* This function reads the package.json file from the specified root directory and returns
* a list of all dependencies (both regular and dev dependencies) that should be treated
* as external during the build process. Currently only return dependencies when the
* format is esm.
*
* @param format - The module format being used for bundling. When format is not 'esm', an empty array is returned.
* @param root - The root directory path where the package.json file is located.
*
* @returns An array of package names from both dependencies and devDependencies sections
* of package.json. Returns an empty array if:
* - format is not 'esm'
* - package.json cannot be read or parsed
* - package.json doesn't exist at the specified location
*/
export declare function getProjectDependencies(format: 'cjs' | 'esm', root: string): string[];
/** Generates directory name where app.config.js file should be stored */
export declare function generateRandomDirectoryName(filePath: string, dir: string): string;