New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

publint

Package Overview
Dependencies
Maintainers
0
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

publint - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc