+9
-6
| { | ||
| "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 |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
115096
0.72%2921
1.11%5
25%Updated