(pkg: PackageMetadata)
| 19 | * - Has bin field but no main, module, or exports fields |
| 20 | */ |
| 21 | export function isBinaryOnlyPackage(pkg: PackageMetadata): boolean { |
| 22 | // Check create-* patterns |
| 23 | if (isCreatePackage(pkg.name)) { |
| 24 | return true |
| 25 | } |
| 26 | |
| 27 | // Has bin but no entry points |
| 28 | const hasBin = |
| 29 | pkg.bin !== undefined && (typeof pkg.bin === 'string' || Object.keys(pkg.bin).length > 0) |
| 30 | const hasEntryPoint = !!pkg.main || !!pkg.module || !!pkg.exports |
| 31 | |
| 32 | return hasBin && !hasEntryPoint |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Check if a package uses the create-* naming convention. |
no test coverage detected