ember-cli-version-checker
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -0,1 +1,9 @@ | ||
## v3.1.0 (2019-02-28) | ||
#### :rocket: Enhancement | ||
* [#97](https://github.com/ember-cli/ember-cli-version-checker/pull/97) Perf fix: cache the resolutions identically to how require does. ([@stefanpenner](https://github.com/stefanpenner)) | ||
#### Committers: 1 | ||
- Stefan Penner ([@stefanpenner](https://github.com/stefanpenner)) | ||
## v3.0.1 (2019-01-09) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "ember-cli-version-checker", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Determine if your addon is being used by a minimum version of Ember CLI.", | ||
@@ -25,6 +25,7 @@ "homepage": "https://github.com/rwjblue/ember-cli-version-checker", | ||
"test": "mocha tests", | ||
"test:debug": "mocha debug tests", | ||
"changelog": "lerna-changelog" | ||
}, | ||
"dependencies": { | ||
"resolve": "^1.9.0", | ||
"resolve-package-path": "^1.0.6", | ||
"semver": "^5.6.0" | ||
@@ -35,8 +36,8 @@ }, | ||
"co": "^4.6.0", | ||
"eslint-config-prettier": "^3.1.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"lerna-changelog": "^0.8.2", | ||
"mocha": "^5.2.0", | ||
"mocha": "^6.0.2", | ||
"mocha-eslint": "^5.0.0", | ||
"prettier": "^1.7.4" | ||
"prettier": "^1.16.4" | ||
}, | ||
@@ -43,0 +44,0 @@ "engines": { |
'use strict'; | ||
const resolve = require('resolve'); | ||
const DependencyVersionChecker = require('./dependency-version-checker'); | ||
const getProject = require('./get-project'); | ||
const resolvePackage = require('resolve-package-path'); | ||
const ALLOWED_ERROR_CODES = [ | ||
// resolve package error codes | ||
'MODULE_NOT_FOUND', | ||
// Yarn PnP Error Codes | ||
'UNDECLARED_DEPENDENCY', | ||
'MISSING_PEER_DEPENDENCY', | ||
'MISSING_DEPENDENCY', | ||
]; | ||
let pnp; | ||
try { | ||
pnp = require('pnpapi'); | ||
} catch (error) { | ||
// not in Yarn PnP; not a problem | ||
} | ||
class NPMDependencyVersionChecker extends DependencyVersionChecker { | ||
module.exports = class NPMDependencyVersionChecker extends DependencyVersionChecker { | ||
constructor(parent, name) { | ||
@@ -30,28 +12,6 @@ super(parent, name); | ||
let addon = this._parent._addon; | ||
let target = this.name + '/package.json'; | ||
let basedir = addon.root || getProject(addon).root; | ||
let jsonPath; | ||
try { | ||
// the custom `pnp` code here can be removed when yarn 1.13 is the | ||
// current release this is due to Yarn 1.13 and resolve interoperating | ||
// together seemlessly | ||
jsonPath = pnp | ||
? pnp.resolveToUnqualified(target, basedir) | ||
: resolve.sync(target, { basedir }); | ||
} catch (e) { | ||
if (ALLOWED_ERROR_CODES.includes(e.code)) { | ||
jsonPath = null; | ||
} else { | ||
throw e; | ||
} | ||
} | ||
this._jsonPath = jsonPath; | ||
this._jsonPath = resolvePackage(this.name, basedir); | ||
this._type = 'npm'; | ||
} | ||
} | ||
module.exports = NPMDependencyVersionChecker; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16831
138
+ Addedresolve-package-path@^1.0.6
+ Addedpath-root@0.1.1(transitive)
+ Addedpath-root-regex@0.1.2(transitive)
+ Addedresolve-package-path@1.2.7(transitive)
- Removedresolve@^1.9.0