🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

publint

Package Overview
Dependencies
Maintainers
1
Versions
55
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.21
to
0.3.22
+9
-6
package.json
{
"name": "publint",
"version": "0.3.21",
"version": "0.3.22",
"description": "Lint packaging errors",

@@ -8,3 +8,2 @@ "type": "module",

"license": "MIT",
"bin": "./src/cli.js",
"exports": {

@@ -42,12 +41,13 @@ ".": {

"dependencies": {
"package-manager-detector": "^1.6.0",
"package-manager-detector": "^1.7.0",
"picocolors": "^1.1.1",
"sade": "^1.8.1",
"@publint/pack": "^0.1.4"
"@publint/pack": "^0.1.6"
},
"devDependencies": {
"@types/prompts": "^2.4.9",
"fs-fixture": "^2.13.0",
"fs-fixture": "^2.14.0",
"prompts": "^2.4.2",
"vitest": "^4.1.5"
"tinyexec": "^1.2.4",
"vitest": "^4.1.10"
},

@@ -61,3 +61,6 @@ "scripts": {

"typecheck": "tsc"
},
"bin": {
"publint": "./src/cli.js"
}
}
+10
-10
import path from 'node:path'
import { getPackDirectory, packAsList, unpack } from '@publint/pack'
import { getPackDirectory, packAsList, supportedPackageManagers, unpack } from '@publint/pack'
import { createNodeVfs } from './node/vfs-node.js'

@@ -75,15 +75,15 @@ import { core } from './shared/core.js'

async function detectPackageManager(pkgDir, pack) {
let packageManager = pack
if (packageManager === 'auto') {
if (pack === 'auto') {
const { detect } = await import('package-manager-detector/detect')
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'
const detected = (await detect({ cwd: pkgDir }))?.name ?? 'npm'
// @ts-expect-error ts struggles to narrow the type here
if (supportedPackageManagers.includes(detected)) {
// @ts-expect-error ts struggles to narrow the type here
return detected
} else {
return 'npm'
}
packageManager = detected
}
return packageManager
return pack
}

@@ -90,0 +90,0 @@

@@ -27,7 +27,36 @@ // extensions that publint is able to parse and lint. while there's partial support

'__tests__/',
// files
'e2e/',
'.circleci/',
'.github/',
'.husky/',
'.vscode/',
// config files
'.prettierrc',
'.prettierignore',
'prettier.config.js',
'.eslintrc',
'.eslintrc.js',
'.eslintignore',
'eslint.config.js',
'eslint.config.mjs',
'eslint.config.cjs',
// CI files
'.travis.yml',
'azure-pipelines.yml',
'appveyor.yml',
// git files
'.gitattributes',
'.gitignore',
// lockfiles
'package-lock.json',
'yarn.lock',
'pnpm-lock.yaml',
'bun.lock',
'bun.lockb',
// misc
'CONTRIBUTING.md',
'CODE_OF_CONDUCT.md',
'CODEOWNERS',
'Dockerfile',
'tsconfig.tsbuildinfo',
]

@@ -34,0 +63,0 @@

@@ -77,3 +77,5 @@ import { lintableFileExtensions } from './constants.js'

const GIT_URL_RE =
/^(?:(git\+https?|git\+ssh|https?|ssh|git):\/\/)?(?:[\w._-]+@)?([\w.-]+)(?::([\w\d-]+))?(\/[\w._/-]+)\/?$/
/^(?:(git\+https?|git\+ssh|https?|ssh|git):\/\/)?(?:[^@/]+@)?([\w.-]+)(?::([\w\d-]+))?(\/[^?#]+)\/?$/
// |----------------------------------------------||----------||-------||--------------||---------------|
// protocol (1) username host (2) port (3) pathname (4)
/**

@@ -80,0 +82,0 @@ * @param {string} url