MCPcopy
hub / github.com/ember-cli/ember-cli / addAddon

Method addAddon

tests/helpers/fixturify-project.js:187–201  ·  view source on GitHub ↗

* Add an addon to this object's `dependencies` list. The addon files will be written in * this object's `node_modules/ ` directory when this object is written out. * * @param {String} name name of the addon * @param {String} version version of the addon, defaults to '0.0.0'

(name, version = '0.0.0', optionsOrCallback)

Source from the content-addressed store, hash-verified

185 * @returns {FixturifyProject} the newly-created addon
186 */
187 addAddon(name, version = '0.0.0', optionsOrCallback) {
188 const options = getOptionsObjectWithCallbackFunction({ allowCachingPerBundle: false }, optionsOrCallback);
189
190 return this.addDependency(name, version, {
191 ...options,
192 callback: (addon) => {
193 prepareAddon(addon, options);
194
195 // call original `options.callback` if it exists
196 if (typeof options.callback === 'function') {
197 options.callback(addon);
198 }
199 },
200 });
201 }
202
203 /**
204 * Add an addon to this object's `devDependencies` list. The addon files will be written in

Callers 5

addEngineMethod · 0.95
proxy-test.jsFile · 0.80

Calls 4

addDependencyMethod · 0.95
prepareAddonFunction · 0.85
callbackMethod · 0.80

Tested by

no test coverage detected