validate-peer-dependencies
Advanced tools
Comparing version 2.0.0 to 2.1.0
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"name": "validate-peer-dependencies", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Validate that the peerDependencies of a given package.json have been satisfied.", | ||
@@ -12,4 +13,6 @@ "repository": { | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
@@ -16,0 +19,0 @@ "scripts": { |
@@ -135,3 +135,3 @@ # validate-peer-dependencies | ||
```js | ||
```javascript | ||
'use strict'; | ||
@@ -153,2 +153,23 @@ | ||
Or alternatively, if it only makes sense for the addon to validate peer deps | ||
during a build, that would look like: | ||
```javascript | ||
'use strict'; | ||
const validatePeerDependencies = require('validate-peer-dependencies'); | ||
module.exports = { | ||
included(parent) { | ||
this._super.included.apply(this, arguments); | ||
validatePeerDependencies(__dirname, { | ||
resolvePeerDependenciesFrom: parent.root, | ||
}); | ||
return parent; | ||
} | ||
}; | ||
``` | ||
#### `handleFailure` | ||
@@ -155,0 +176,0 @@ |
245
298
20741