Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "publint", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Lint packaging errors", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -36,3 +36,3 @@ #!/usr/bin/env node | ||
const pkgDir = dir ? path.resolve(dir) : process.cwd() | ||
const logs = await lintDir(pkgDir, opts.level, opts.strict) | ||
const logs = await lintDir(pkgDir, opts.level, opts.strict, opts.pack) | ||
logs.forEach((l) => console.log(l)) | ||
@@ -89,3 +89,12 @@ }) | ||
const logs = depDir | ||
? await lintDir(depDir, opts.level, opts.strict, true) | ||
? await lintDir( | ||
depDir, | ||
opts.level, | ||
opts.strict, | ||
// Linting dependencies in node_modules also means that the dependency | ||
// is already packed, so we don't need to pack it again by passing `false`. | ||
// Otherwise if it's a local-linked dependency, we use the pack option. | ||
depDir.includes('node_modules') ? false : opts.pack, | ||
true | ||
) | ||
: [] | ||
@@ -122,5 +131,6 @@ // log this lint result | ||
* @param {import('./index.js').Options['strict']} strict | ||
* @param {import('./index.js').Options['pack']} pack | ||
* @param {boolean} [compact] | ||
*/ | ||
async function lintDir(pkgDir, level, strict, compact = false) { | ||
async function lintDir(pkgDir, level, strict, pack, compact = false) { | ||
/** @type {string[]} */ | ||
@@ -138,3 +148,3 @@ const logs = [] | ||
const pkgName = rootPkg.name || path.basename(pkgDir) | ||
const { messages } = await publint({ pkgDir, level, strict }) | ||
const { messages } = await publint({ pkgDir, level, strict, pack }) | ||
@@ -141,0 +151,0 @@ if (messages.length) { |
@@ -37,6 +37,10 @@ import path from 'node:path' | ||
let packageManager = (await detect({ cwd: pkgDir }))?.name | ||
// Deno is not supported in `@publint/pack` (doesn't have a pack command) | ||
if (packageManager === 'deno') { | ||
packageManager = 'npm' | ||
let packageManager = pack | ||
if (packageManager === 'auto') { | ||
let detected = (await detect({ cwd: pkgDir }))?.name ?? 'npm' | ||
// Deno is not supported in `@publint/pack` (doesn't have a pack command) | ||
if (detected === 'deno') { | ||
detected = 'npm' | ||
} | ||
packageManager = detected | ||
} | ||
@@ -43,0 +47,0 @@ |
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
90263
2290
0