@definitelytyped/header-parser
Advanced tools
Comparing version 0.0.183 to 0.0.184
# @definitelytyped/header-parser | ||
## 0.0.184 | ||
### Patch Changes | ||
- f9e73605: Remove validation of `"pnpm"` field | ||
## 0.0.183 | ||
@@ -4,0 +10,0 @@ |
@@ -109,3 +109,2 @@ "use strict"; | ||
const ownersResult = validateOwners(); | ||
const pnpmResult = validatePnpm(); | ||
const licenseResult = getLicenseFromPackageJson(packageJson.license); | ||
@@ -149,5 +148,2 @@ if (typeof nameResult === "object") { | ||
} | ||
if (typeof pnpmResult === "object") { | ||
errors.push(...pnpmResult.errors); | ||
} | ||
if (Array.isArray(licenseResult)) { | ||
@@ -274,32 +270,2 @@ errors.push(...licenseResult); | ||
} | ||
function validatePnpm() { | ||
const errors = []; | ||
if (packageJson.pnpm) { | ||
if (typeof packageJson.pnpm !== "object" || packageJson.pnpm === null) { | ||
errors.push(`${typesDirectoryName}'s package.json has bad "pnpm": must be an object like { "overrides": { "@types/react": "^16" } }`); | ||
} | ||
else { | ||
for (const key in packageJson.pnpm) { | ||
if (key !== "overrides") { | ||
errors.push(`${typesDirectoryName}'s package.json has bad "pnpm": it should not include property "${key}", only "overrides".`); | ||
} | ||
} | ||
const overrides = packageJson.pnpm.overrides; | ||
if (overrides && typeof overrides === "object" && overrides !== null) { | ||
for (const key in overrides) { | ||
if (!key.startsWith("@types/")) { | ||
errors.push(`${typesDirectoryName}'s package.json has bad "pnpm": pnpm overrides may only override @types/ packages.`); | ||
} | ||
} | ||
} | ||
else { | ||
errors.push(`${typesDirectoryName}'s package.json has bad "pnpm": it must contain an "overrides" object.`); | ||
} | ||
} | ||
} | ||
if (errors.length) { | ||
return { errors }; | ||
} | ||
return undefined; | ||
} | ||
} | ||
@@ -306,0 +272,0 @@ exports.validatePackageJson = validatePackageJson; |
{ | ||
"name": "@definitelytyped/header-parser", | ||
"version": "0.0.183", | ||
"version": "0.0.184", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "Nathan Shively-Sanders <nathansa@microsoft.com>", |
Sorry, the diff of this file is not supported yet
34504
456