import { Tree } from 'broccoli'; import BaseBuilder from './base'; export default class AddonBuilder extends BaseBuilder { /** * Is this addon currently under test? */ underTest: boolean; processParent: (tree: Tree, dir: string) => Tree; bundledSources(): string[]; assembleTree(): Tree; /** * This method basically describes the scenarios in which an addon will build * (i.e. `shouldBuild()` returns true), but should not eject (return false * here). * * There are two scenarios where an addon should build but not eject: * * 1. It's the root builder (i.e. you run `$ denali build` in an addon). The * regular build process will handle landing everything in dist. * 2. It's the addon under test. The dummy app will land a copy of the compiled * addon in the dummy app's node_modules/ folder. * * For (2), it might seem okay to eject, but there are two problems: * * 1. The compiled dummy app inside `tmp/-dummy` can't lookup the addon * two directories up normally. * 2. If you run multiple command acceptance tests that build their copies * of the dummy app, they would each try to eject back to the project * root, resulting in race conditions as each tries to read/write to * the same top level `dist/` directory simultaneously. * * TODO: if you have more than one app symlinking in the same addon, you'll * end up with race conditions here if you have both app's servers running and * make a change to the shared addon. Each app's server will try to rebuild * and re-eject the shared addon, likely at the same time, resulting in race * conditions. */ shouldEject(): boolean; shouldBuild(): boolean; shouldBuildDocs(): boolean; isDevelopingAddon(): boolean; bundle(tree: Tree): Tree; unitTestBundleName(): any; }