flow-typed
Advanced tools
Comparing version 3.6.0 to 3.6.1
@@ -161,2 +161,6 @@ "use strict"; | ||
await P.all(defsDirItems.map(async item => { | ||
// If a user opens definitions dir in finder it will create `.DS_Store` | ||
// which will need to be excluded while parsing | ||
if (item === '.DS_Store') return; | ||
const itemPath = _node.path.join(defsDir, item); | ||
@@ -172,2 +176,4 @@ | ||
await P.all(defsDirItems.map(async item => { | ||
if (item === '.DS_Store') return; | ||
const itemPath = _node.path.join(defsDir, scope, item); | ||
@@ -181,3 +187,3 @@ | ||
} else { | ||
const error = `Expected only directories in the 'definitions/npm/@<scope>' directory!`; | ||
const error = `Expected only directories in the 'definitions/npm/@<scope>' directory! Please remove or change ${itemPath}`; | ||
throw new _ValidationError.ValidationError(error); | ||
@@ -191,3 +197,3 @@ } | ||
} else { | ||
const error = `Expected only directories in the 'definitions/npm' directory!`; | ||
const error = `Expected only directories in the 'definitions/npm' directory! Please remove or change ${itemPath}`; | ||
throw new _ValidationError.ValidationError(error); | ||
@@ -246,3 +252,3 @@ } | ||
if (flowDirs.length === 0) { | ||
throw new _ValidationError.ValidationError(`No libdef files found for ${pkgDirPath}!`); | ||
throw new _ValidationError.ValidationError(`No libdef files found in ${pkgDirPath}!`); | ||
} | ||
@@ -292,3 +298,3 @@ | ||
if (pkgName !== 'ERROR') { | ||
const error = 'No libdef file found!'; | ||
const error = `No libdef file found in ${flowDirPath}`; | ||
throw new _ValidationError.ValidationError(error); | ||
@@ -295,0 +301,0 @@ } |
@@ -18,2 +18,3 @@ "use strict"; | ||
exports.parseSignedCodeVersion = parseSignedCodeVersion; | ||
exports.pkgVersionMatch = pkgVersionMatch; | ||
@@ -238,2 +239,4 @@ var _cacheRepoUtils = require("../cacheRepoUtils"); | ||
function pkgVersionMatch(pkgSemverRaw, libDefSemverRaw) { | ||
var _semver$coerce$versio, _semver$coerce; | ||
// The package version should be treated as a semver implicitly prefixed by | ||
@@ -297,6 +300,19 @@ // `^` or `~`. Depending on whether or not the minor value is defined. | ||
const pkgBelowLower = _semver2.default.gtr(libDefLower, pkgSemver); | ||
const pkgBelowLower = _semver2.default.gtr(libDefLower, pkgSemver); // semver.coerce explanation: | ||
// We compare a libdef version against a package version | ||
// to check if it matches the range, if pkgAboveUpper would be true | ||
// that means it doesn't match. | ||
// | ||
// Mismatches occur when for example libdef is defined as is 8.5.x | ||
// which makes it's upper <8.6.0 | ||
// pkgSemver is ^8.5.1 who's range will reach a max of <9.0.0 | ||
// therefore libDefUpper is less than maximum pkgSemver range. | ||
// | ||
// coerce will transform any semver passed in to an explicit | ||
// version, in this case, ^8.5.1 becomes 8.5.1 which allows | ||
// 8.6.0 (libdef) to be above 8.5.1 (pkg). | ||
const pkgAboveUpper = _semver2.default.ltr(libDefUpper, pkgSemver); | ||
const pkgAboveUpper = _semver2.default.ltr(libDefUpper, (_semver$coerce$versio = (_semver$coerce = _semver2.default.coerce(pkgSemver)) === null || _semver$coerce === void 0 ? void 0 : _semver$coerce.version) !== null && _semver$coerce$versio !== void 0 ? _semver$coerce$versio : pkgSemver); | ||
if (pkgBelowLower || pkgAboveUpper) { | ||
@@ -480,3 +496,3 @@ return false; | ||
const scopeDirItems = await _node.fs.readdir(itemPath); | ||
const settled = await P.all(scopeDirItems.map(async itemName => { | ||
const settled = await P.all(scopeDirItems.filter(item => item !== '.DS_Store').map(async itemName => { | ||
const itemPath = _node.path.join(npmDefsDirPath, scope, itemName); | ||
@@ -513,2 +529,6 @@ | ||
const proms = dirItems.map(async itemName => { | ||
// If a user opens definitions dir in finder it will create `.DS_Store` | ||
// which will need to be excluded while parsing | ||
if (itemName === '.DS_Store') return; | ||
try { | ||
@@ -515,0 +535,0 @@ return await getSingleLibdef(itemName, npmDefsDirPath, validating); |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"main": "dist/cli.js", | ||
@@ -33,3 +33,3 @@ "bin": "dist/cli.js", | ||
"@octokit/rest": "^18.12.0", | ||
"colors": "^1.4.0", | ||
"colors": "1.4.0", | ||
"flowgen": "^1.10.0", | ||
@@ -36,0 +36,0 @@ "fs-extra": "^8.1.0", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
793691
32
19894
3
Updatedcolors@1.4.0