Extends:

EmberApp → EmberAddon

EmberAddon is used during addon development.

Constructor Summary

Public Constructors
public
EmberAddon([defaults], [options={}])

EmberAddon is used during addon development.

Method Summary

Public Methods
public
concatFiles(tree, options):
public
public
import(asset, [options])
public
toTree(additionalTrees): Tree
Private Methods
private
private
private
private
_addonInstalled(addonName): Boolean
private
_concatFiles(tree, options):
private
private
private
_contentForAppBoot(content, config)
private
_contentForConfigModule(content, config)
private
_contentForHead(content, config)
private
private
_filterAppTree( ): Tree
private
_getAssetPath(asset): (String | Undefined)
private
_import(assetPath, options, directory, subdirectory, extension)
private
private
_initOptions(options)
private
_initProject(options)
private
private
private
private
private
private
private
private
private
private
private
private
private
private
addonLintTree(type, tree): Tree
private
addonPostprocessTree(type, tree): Tree
private
addonPreprocessTree(type, tree): Tree
private
private
private
private
contentFor(config, match, type): String
private
index( ): Tree
private
private
javascript( ): Tree
private
private
otherAssets( ): Tree
private
private
publicTree( ): Tree
private
private
styles( ): Tree
private
testFiles( ): Tree
private
testIndex( ): Tree
private

Public Constructors

lib/broccoli/ember-addon.js:11

public EmberAddon([defaults], [options={}])

Parameters:

Name Type Attribute Description
defaults Object
  • optional
options Object
  • optional
  • default: {}

Configuration options

Public Methods

lib/broccoli/ember-app.js:437

public concatFiles(tree, options):

Inherited from EmberApp

Deprecated: This method is deprecated.

Provides a broccoli files concatenation filter that's configured properly for this application.

Parameters:

Name Type Attribute Description
tree Object
options Object

Return:

lib/broccoli/ember-app.js:1602

public dependencies( ): Object

Inherited from EmberApp

Return:

Object Alias to the project's dependencies function
lib/broccoli/ember-app.js:1611

public import(asset, [options])

Inherited from EmberApp
Imports an asset into the application.

Parameters:

Name Type Attribute Description
asset Object | String
Either a path to the asset or an object with environment names and paths as key-value pairs.
options Object
  • optional
Options object
options.type String
  • optional
  • default: 'vendor'

Either 'vendor' or 'test'

options.prepend Boolean
  • optional
  • default: false

Whether or not this asset should be prepended

options.destDir String
  • optional

Destination directory, defaults to the name of the directory the asset is in

options.outputFile String
  • optional

Specifies the output file for given import. Defaults to assets/vendor.{js,css}

options.using Array
  • optional

Specifies the array of transformations to be done on the asset. Can do an amd shim and/or custom transformation

lib/broccoli/ember-app.js:1800

public toTree(additionalTrees): Tree

Inherited from EmberApp
Returns the merged tree for this application

Parameters:

Name Type Attribute Description
additionalTrees Array
Array of additional trees to merge

Return:

Tree Merged tree for this application

Private Methods

lib/broccoli/ember-app.js:479

private _addonDisabledByBlacklist(addon): Boolean

Inherited from EmberApp

Parameters:

Name Type Attribute Description
addon Addon

Return:

lib/broccoli/ember-app.js:490

private _addonDisabledByWhitelist(addon): Boolean

Inherited from EmberApp

Parameters:

Name Type Attribute Description
addon Addon

Return:

lib/broccoli/ember-app.js:467

private _addonEnabled(addon): Boolean

Inherited from EmberApp
Checks the result of addon.isEnabled() if it exists, defaults to true otherwise.

Parameters:

Name Type Attribute Description
addon Addon

Return:

lib/broccoli/ember-app.js:1367

private _addonInstalled(addonName): Boolean

Inherited from EmberApp

Parameters:

Name Type Attribute Description
addonName String
The name of the addon we are checking to see if it's installed

Return:

lib/broccoli/ember-app.js:452

private _concatFiles(tree, options):

Inherited from EmberApp
Delegates to broccoli-concat with the sourceMapConfig option set to options.sourcemaps.

Parameters:

Name Type Attribute Description
tree Object
options Object

Return:

lib/broccoli/ember-app.js:845

private _configReplacePatterns( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1170

private _configTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1909

private _contentForAppBoot(content, config)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
content Array
config Object
lib/broccoli/ember-app.js:1892

private _contentForConfigModule(content, config)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
content Array
config Object
lib/broccoli/ember-app.js:1878

private _contentForHead(content, config)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
content Array
config Object
lib/broccoli/ember-app.js:1869

private _contentForTestBodyFooter(content)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
content Array
lib/broccoli/ember-app.js:781

private _filterAppTree( ): Tree

Inherited from EmberApp
Filters styles and templates from the app tree.

Return:

Tree
lib/broccoli/ember-app.js:1740

private _getAssetPath(asset): (String | Undefined)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
asset (Object | String)

Return:

(String | Undefined) assetPath
lib/broccoli/ember-app.js:1661

private _import(assetPath, options, directory, subdirectory, extension)

Inherited from EmberApp

Parameters:

Name Type Attribute Description
assetPath String
options Object
directory String
subdirectory String
extension String
lib/broccoli/ember-app.js:553

private _importAddonTransforms( )

Inherited from EmberApp
Calls the importTransforms hook on addons.
lib/broccoli/ember-app.js:197

private _initOptions(options)

Inherited from EmberApp
Initializes the options property from the options parameter and a set of default values from Ember CLI.

Parameters:

Name Type Attribute Description
options Object
lib/broccoli/ember-app.js:179

private _initProject(options)

Inherited from EmberApp
Initializes the project property from options.project or the closest Ember CLI project from the current working directory.

Parameters:

Name Type Attribute Description
options Object
lib/broccoli/ember-app.js:163

private _initTestsAndHinting(options)

Inherited from EmberApp
Initializes the tests and hinting properties. Defaults to false unless ember test was used or this is *not* a production build.

Parameters:

Name Type Attribute Description
options Object
lib/broccoli/ember-app.js:333

private _initVendorFiles( )

Inherited from EmberApp
lib/broccoli/ember-app.js:517

private _notifyAddonIncluded( )

Inherited from EmberApp
Calls the included hook on addons.
lib/broccoli/ember-app.js:1011

private _podTemplatePatterns( ): Array

Inherited from EmberApp

Return:

Array An array of regular expressions.
lib/broccoli/ember-app.js:910

private _processedAppTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1040

private _processedBowerTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1194

private _processedEmberCLITree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1126

private _processedExternalTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:933

private _processedSrcTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:977

private _processedTemplatesTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1021

private _processedTestsTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:1098

private _processedVendorTree( ):

Inherited from EmberApp

Return:

lib/broccoli/ember-app.js:323

private _resolveLocal( )

Inherited from EmberApp
Resolves a path relative to the project's root
lib/broccoli/ember-app.js:701

private addonLintTree(type, tree): Tree

Inherited from EmberApp
Runs addon lintTree hooks and returns a single tree containing all their output.

Parameters:

Name Type Attribute Description
type String
Type of tree
tree Tree
Tree to process

Return:

Tree Processed tree
lib/broccoli/ember-app.js:627

private addonPostprocessTree(type, tree): Tree

Inherited from EmberApp
Runs addon post-processing on a given tree and returns the processed tree. This enables addons to do process immediately **after** the preprocessor for a given type is run, but before concatenation occurs. If an addon wishes to apply a transform before the preprocessors run, they can instead implement the preprocessTree hook. To utilize this addons implement postprocessTree hook. An example, would be to apply some broccoli transform on all JS files, but only after the existing pre-processors have run. `js module.exports = { name: 'my-cool-addon', postprocessTree(type, tree) { if (type === 'js') { return someBroccoliTransform(tree); } return tree; } } `

Parameters:

Name Type Attribute Description
type String
Type of tree
tree Tree
Tree to process

Return:

Tree Processed tree
lib/broccoli/ember-app.js:665

private addonPreprocessTree(type, tree): Tree

Inherited from EmberApp
Runs addon pre-processing on a given tree and returns the processed tree. This enables addons to do process immediately **before** the preprocessor for a given type is run. If an addon wishes to apply a transform after the preprocessors run, they can instead implement the postprocessTree hook. To utilize this addons implement preprocessTree hook. An example, would be to remove some set of files before the preprocessors run. `js var stew = require('broccoli-stew'); module.exports = { name: 'my-cool-addon', preprocessTree(type, tree) { if (type === 'js' && type === 'template') { return stew.rm(tree, someGlobPattern); } return tree; } } `

Parameters:

Name Type Attribute Description
type String
Type of tree
tree Tree
Tree to process

Return:

Tree Processed tree
lib/broccoli/ember-app.js:609

private addonTreesFor(type): Array

Inherited from EmberApp
Returns a list of trees for a given type, returned by all addons.

Parameters:

Name Type Attribute Description
type String
Type of tree

Return:

Array List of trees
lib/broccoli/ember-app.js:1231

private appAndDependencies( ): Tree

Inherited from EmberApp
Returns the tree for the app and its dependencies

Return:

Tree Merged tree
lib/broccoli/ember-app.js:1289

private appTests( )

Inherited from EmberApp
lib/broccoli/ember-app.js:1817

private contentFor(config, match, type): String

Inherited from EmberApp
Returns the content for a specific type (section) for index.html. Currently supported types: - 'head' - 'config-module' - 'head-footer' - 'test-header-footer' - 'body-footer' - 'test-body-footer' Addons can also implement this method and could also define additional types (eg. 'some-addon-section').

Parameters:

Name Type Attribute Description
config Object
Application configuration
match RegExp
Regular expression to match against
type String
Type of content

Return:

String The content.
lib/broccoli/ember-app.js:737

private index( ): Tree

Inherited from EmberApp
Returns the tree for app/index.html

Return:

Tree Tree for app/index.html
lib/broccoli/ember-app.js:598

private initializeAddons( )

Inherited from EmberApp
Loads and initializes addons for this project. Calls initializeAddons on the Project.
lib/broccoli/ember-app.js:1377

private javascript( ): Tree

Inherited from EmberApp
Returns the tree for javascript files

Return:

Tree Merged tree
lib/broccoli/ember-app.js:1314

private lintTestsTrees( ): Array

Inherited from EmberApp
Runs the app, tests and templates trees through the chain of addons that produces lint trees. Those lint trees are afterwards funneled into the tests folder, babel-ified and returned as an array.

Return:

lib/broccoli/ember-app.js:1577

private otherAssets( ): Tree

Inherited from EmberApp
Returns the tree for the additional assets which are not in one of the default trees.

Return:

Tree Merged tree for other assets
lib/broccoli/ember-app.js:720

private populateLegacyFiles( )

Inherited from EmberApp
Imports legacy imports in this.vendorFiles
lib/broccoli/ember-app.js:889

private publicTree( ): Tree

Inherited from EmberApp
Returns the tree for /public

Return:

Tree Tree for /public
lib/broccoli/ember-app.js:501

private shouldIncludeAddon(addon): Boolean

Inherited from EmberApp
Returns whether an addon should be added to the project

Parameters:

Name Type Attribute Description
addon Addon

Return:

lib/broccoli/ember-app.js:1405

private styles( ): Tree

Inherited from EmberApp
Returns the tree for styles

Return:

Tree Merged tree for styles
lib/broccoli/ember-app.js:1483

private testFiles( ): Tree

Inherited from EmberApp
Returns the tree for test files

Return:

Tree Merged tree for test files
lib/broccoli/ember-app.js:866

private testIndex( ): Tree

Inherited from EmberApp
Returns the tree for /tests/index.html

Return:

Tree Tree for /tests/index.html
Inherited from EmberApp
Returns an array of trees for this application

Return:

Array An array of trees