@baseplate-dev/sync
Version:
Library for syncing Baseplate descriptions
43 lines • 1.2 kB
JavaScript
/**
* Context passed to TemplateFileExtractor operations.
*/
export class TemplateExtractorContext {
constructor({ configLookup, logger, outputDirectory, plugins, fileContainer, }) {
this.configLookup = configLookup;
this.logger = logger;
this.outputDirectory = outputDirectory;
this.plugins = plugins;
this.fileContainer = fileContainer;
}
getPlugin(name) {
const plugin = this.plugins.get(name);
if (!plugin) {
throw new Error(`Extractor plugin ${name} not found`);
}
return plugin;
}
/**
* Utility class for looking up extractor configs and templates.
*/
configLookup;
/**
* The logger to use.
*/
logger;
/**
* The output directory of the package.
*
* If undefined, it means that the extractor is running with metadata-only extraction (without
* the use of any generated project)
*/
outputDirectory;
/**
* The plugins available to the context.
*/
plugins;
/**
* The file container for managing generated files.
*/
fileContainer;
}
//# sourceMappingURL=template-extractor-context.js.map