(cli)
| 58 | * @returns {Promise<void>} |
| 59 | */ |
| 60 | const runCli = async (cli) => { |
| 61 | if (cli.preprocess) { |
| 62 | cli.preprocess(); |
| 63 | } |
| 64 | |
| 65 | const pkgUrl = import.meta.resolve(`${cli.package}/package.json`); |
| 66 | const pkgPath = fileURLToPath(pkgUrl); |
| 67 | const pkg = (await import(pkgUrl, { with: { type: "json" } })).default; |
| 68 | |
| 69 | const binPath = path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName]); |
| 70 | |
| 71 | await import(pathToFileURL(binPath).href); |
| 72 | }; |
| 73 | |
| 74 | /** |
| 75 | * @typedef {object} CliOption |
no outgoing calls
no test coverage detected
searching dependent graphs…