You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is useful if the app wants to make sure there's no unexpected assets from
177
182
the addon being included but still allow the addon to be included in the
@@ -190,7 +195,7 @@ module.exports = {
190
195
if (checker.hasSingleImplementation('<my-addon>')) {
191
196
/* do things when <my-addon> is unique */
192
197
}
193
-
}
198
+
},
194
199
};
195
200
```
196
201
@@ -209,8 +214,11 @@ module.exports = {
209
214
210
215
let checker =VersionChecker.forProject(this.project);
211
216
212
-
checker.assertSingleImplementation('<my-addon>', 'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!');
213
-
}
217
+
checker.assertSingleImplementation(
218
+
'<my-addon>',
219
+
'Please make sure <my-addon> has only one implementation, please correct and here is a helpful message!'
220
+
);
221
+
},
214
222
};
215
223
```
216
224
@@ -229,11 +237,10 @@ module.exports = {
229
237
let checker =VersionChecker.forProject(this.project);
230
238
231
239
checker.filterAddonsByName('<my-addon>'); // => an array of addon instances who have the name `<my-addon>`
232
-
}
240
+
},
233
241
};
234
242
```
235
243
236
-
237
244
### allAddons
238
245
239
246
An iterator which gives access to all addon instances
@@ -257,19 +264,19 @@ module.exports = {
257
264
258
265
### check
259
266
260
-
A utility to verify that addons are installed at appropriate versions. `npm`
267
+
A utility to verify that addons are installed at appropriate versions. `npm`
261
268
and `yarn` resolve conflicting transitive dependency requirements by installing
262
-
multiple versions. They do not include a mechanism for packages to declare
263
-
that a dependency must be unique. This is, however, a practical constraint
269
+
multiple versions. They do not include a mechanism for packages to declare
270
+
that a dependency must be unique. This is, however, a practical constraint
264
271
when building Ember applications (for example, we would not want to build an
265
272
application that shipped two versions of Ember Data). [Related discussion on npm](https://github.com/npm/rfcs/pull/23)
266
273
267
274
Every addon in the ember ecosystem implicitly depends on `ember-source`, and
268
275
most likely a specific version range. If that dependency is specified as a
269
276
`package.json` dependency, a mismatch between application and addon would
270
-
result in duplicating `ember-source`. Instead of failing the build, we would
277
+
result in duplicating `ember-source`. Instead of failing the build, we would
271
278
build an application with an unknown version of `ember-source`, subverting the
272
-
point of specifying dependency version ranges in the first place! The `check`
279
+
point of specifying dependency version ranges in the first place! The `check`
273
280
API provides a mechanism to avoid this and fail fast in the build step, instead
274
281
of building an invalid application with harder to debug runtime errors.
0 commit comments