Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "publint", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Lint packaging errors", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -186,3 +186,3 @@ import { | ||
// check file existance for other known package fields | ||
// check file existence for other known package fields | ||
const knownFields = ['types', 'jsnext:main', 'jsnext', 'unpkg', 'jsdelivr'] | ||
@@ -198,3 +198,3 @@ for (const field of knownFields) { | ||
// check file existance for browser field | ||
// check file existence for browser field | ||
if (browser) { | ||
@@ -288,2 +288,11 @@ crawlBrowser(browser) | ||
/** | ||
* @param {string} exports | ||
*/ | ||
async function getExportsFiles(exports) { | ||
const exportsPath = vfs.pathJoin(pkgDir, exports) | ||
const isGlob = exports.includes('*') | ||
return isGlob ? await exportsGlob(exportsPath, vfs) : [exportsPath] | ||
} | ||
function crawlExports( | ||
@@ -314,7 +323,4 @@ exports, | ||
const exportsPath = vfs.pathJoin(pkgDir, exports) | ||
const isGlob = exports.includes('*') | ||
const exportsFiles = isGlob | ||
? await exportsGlob(exportsPath, vfs) | ||
: [exportsPath] | ||
const exportsFiles = await getExportsFiles(exports) | ||
@@ -420,6 +426,11 @@ if (isGlob && !exportsFiles.length) { | ||
if (key === 'types') { | ||
// only check file existance | ||
// only check file existence | ||
promiseQueue.push(async () => { | ||
const typesPath = vfs.pathJoin(pkgDir, exports[key]) | ||
await readFile(typesPath, currentPath.concat(key)) | ||
const typesFiles = await getExportsFiles(exports[key]) | ||
const typesPath = currentPath.concat(key) | ||
const pq = createPromiseQueue() | ||
for (const typesFile of typesFiles) { | ||
pq.push(async () => await readFile(typesFile, typesPath)) | ||
} | ||
await pq.wait() | ||
}) | ||
@@ -426,0 +437,0 @@ } else { |
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
32042
866