(args: Args)
| 82 | } |
| 83 | |
| 84 | function main(args: Args): void { |
| 85 | const pkgDir = args._[0] |
| 86 | if (!pkgDir) { |
| 87 | console.error('Usage: check_package_exports <pkg-dir>') |
| 88 | process.exit(1) |
| 89 | } |
| 90 | |
| 91 | const errors = validatePackageExports(pkgDir) |
| 92 | if (errors.length > 0) { |
| 93 | for (const err of errors) { |
| 94 | console.error(`FAIL: ${err}`) |
| 95 | } |
| 96 | process.exit(1) |
| 97 | } |
| 98 | |
| 99 | console.log('PASS: all package.json exports exist in package') |
| 100 | } |
| 101 | |
| 102 | if (import.meta.filename === process.argv[1]) { |
| 103 | main(minimist<Args>(process.argv.slice(2))) |
no test coverage detected