()
| 155 | console.log("bun.lock opentui versions are consistent") |
| 156 | |
| 157 | async function fixKnownLockfileIssues() { |
| 158 | const txt = await Bun.file(lockfile).text() |
| 159 | const stale = findStaleLockfileEntriesInText(txt) |
| 160 | if (stale.length === 0) return [] |
| 161 | if (stale.some((item) => !item.entry.startsWith("opentui-spinner/@opentui/"))) return [] |
| 162 | |
| 163 | const removed = txt |
| 164 | .split("\n") |
| 165 | .map((line) => line.match(/^ "(opentui-spinner\/@opentui\/[^\"]+)": /)?.[1]) |
| 166 | .filter((item): item is string => item !== undefined) |
| 167 | |
| 168 | if (removed.length === 0) return [] |
| 169 | |
| 170 | await Bun.write( |
| 171 | lockfile, |
| 172 | txt |
| 173 | .split("\n") |
| 174 | .filter((line) => !line.match(/^ "opentui-spinner\/@opentui\//)) |
| 175 | .join("\n"), |
| 176 | ) |
| 177 | return removed |
| 178 | } |
| 179 | |
| 180 | async function findStaleLockfileEntries() { |
| 181 | return findStaleLockfileEntriesInText(await Bun.file(lockfile).text()) |
no test coverage detected