* 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)
| 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 |
no test coverage detected