import { Tree } from 'broccoli'; import AddonBuilder from './addon'; import UnitTests from '../trees/unit-tests'; export interface BuilderOptions { environment: string; parent?: BaseBuilder; docs?: boolean; } export default class BaseBuilder { /** * Creates the appropriate builder instance for the given directory. * * @param dir * @param environment * @param parent */ static createFor(dir: string, options: BuilderOptions): BaseBuilder; dir: string; environment: string; addons: AddonBuilder[]; pkg: any; ejections: Map; processSelf: (tree: Tree, dir: string) => Tree; unitTestDir: string; packageFiles: string[]; private _cachedTree; protected debug: (msg: string) => void; protected options: BuilderOptions; readonly logicalDependencyPath: any[]; constructor(dir: string, options: BuilderOptions); /** * Look for addons in the node_modules folder. Only search packages explicitly * mentioned in package.json, and look for the `denali-addon` keyword in their * package.json's. Then create a Builder for each one. */ protected discoverAddons(options?: { include: string[]; }): AddonBuilder[]; /** * Which directories should be considered "source" directories to be fed into * the main build pipeline? */ protected sources(): (string | Tree)[]; /** * Which directories should be bundled into runtime bundles/fragments? */ protected bundledSources(): string[]; /** * Assemble the main build pipeline */ assembleTree(): any; /** * Create trees that copy top level files over. Broccoli can't pick up * top level files one-off, because Broccoli can't do one-off files. * Which means Broccoli would have to watch the root directory, which * includes the tmp directory where intermediate build steps are stored, * resulting in an infinite loop (watch triggers build, touches tmp, * triggers watch). */ packageFilesTree(): any; shouldBuildDocs(): boolean; docs(baseTree: Tree): Tree; /** * Compile the unit tests - see UnitTestsTree for more details */ compileUnitTests(compiledTree: Tree): UnitTests; unitTestBundleName(): any; /** * Wrapper method over assembleTree, used to cache the results */ toTree(): Tree; /** * Create a single base tree from the source directories. Multiple * consumers can use this base tree to ensure deduplication of the * starting point. */ protected toBaseTree(): Tree; /** * Compile the project. Defaults to running the process* hooks, but * can be extended to do more. */ protected compile(tree: Tree): Tree; /** * Run processSelf and processParent hooks */ protected processHooks(tree: Tree): Tree; bundle(tree: Tree): Tree; }