| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 564cde3 commit 6e4db56
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,9 +35,9 @@ | |||
| 35 | 35 | "@types/cross-spawn": "6.0.6", | |
| 36 | 36 | "@octokit/rest": "22.0.0", | |
| 37 | 37 | "@hono/zod-validator": "0.4.2", | |
| 38 | - "@opentui/core": "0.2.13", | ||
| 39 | - "@opentui/keymap": "0.2.13", | ||
| 40 | - "@opentui/solid": "0.2.13", | ||
| 38 | + "@opentui/core": "0.2.14", | ||
| 39 | + "@opentui/keymap": "0.2.14", | ||
| 40 | + "@opentui/solid": "0.2.14", | ||
| 41 | 41 | "ulid": "3.0.1", | |
| 42 | 42 | "@kobalte/core": "0.13.11", | |
| 43 | 43 | "@types/luxon": "3.7.1", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,10 @@ test("replace slot mounts plugin content once", async () => { | |||
| 41 | 41 | ) | |
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | - await testRender(() => <App />) | ||
| 45 | - | ||
| 46 | - expect(mounts).toBe(1) | ||
| 44 | + const app = await testRender(() => <App />) | ||
| 45 | + try { | ||
| 46 | + expect(mounts).toBe(1) | ||
| 47 | + } finally { | ||
| 48 | + app.renderer.destroy() | ||
| 49 | + } | ||
| 47 | 50 | }) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,9 +22,9 @@ | |||
| 22 | 22 | "zod": "catalog:" | |
| 23 | 23 | }, | |
| 24 | 24 | "peerDependencies": { | |
| 25 | - "@opentui/core": ">=0.2.13", | ||
| 26 | - "@opentui/keymap": ">=0.2.13", | ||
| 27 | - "@opentui/solid": ">=0.2.13" | ||
| 25 | + "@opentui/core": ">=0.2.14", | ||
| 26 | + "@opentui/keymap": ">=0.2.14", | ||
| 27 | + "@opentui/solid": ">=0.2.14" | ||
| 28 | 28 | }, | |
| 29 | 29 | "peerDependenciesMeta": { | |
| 30 | 30 | "@opentui/core": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,7 @@ if (snapshotArg === "--snapshot=") { | |||
| 34 | 34 | ||
| 35 | 35 | const ver = raw.replace(/^v/, "") | |
| 36 | 36 | const root = path.resolve(import.meta.dir, "..") | |
| 37 | + const lockfile = path.join(root, "bun.lock") | ||
| 37 | 38 | const skip = new Set([".git", ".opencode", ".turbo", "dist", "node_modules"]) | |
| 38 | 39 | const keys = ["@opentui/core", "@opentui/keymap", "@opentui/solid"] as const | |
| 39 | 40 | ||
@@ -115,11 +116,77 @@ const out = ( | |||
| 115 | 116 | ).filter((item): item is string => item !== null) | |
| 116 | 117 | ||
| 117 | 118 | if (out.length === 0) { | |
| 118 | - console.log("No opentui deps found") | ||
| 119 | - process.exit(0) | ||
| 119 | + console.log(`No opentui manifest updates needed for ${ver}`) | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + if (out.length > 0) { | ||
| 123 | + console.log(`Updated opentui${snapshot ? " snapshot" : ""} to ${ver} in:`) | ||
| 124 | + for (const file of out) { | ||
| 125 | + console.log(`- ${file}`) | ||
| 126 | + } | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + console.log("Running bun install to update bun.lock...") | ||
| 130 | + const install = Bun.spawn([process.execPath, "install"], { | ||
| 131 | + cwd: root, | ||
| 132 | + stdout: "inherit", | ||
| 133 | + stderr: "inherit", | ||
| 134 | + }) | ||
| 135 | + const installCode = await install.exited | ||
| 136 | + if (installCode !== 0) process.exit(installCode) | ||
| 137 | + | ||
| 138 | + const fixed = await fixKnownLockfileIssues() | ||
| 139 | + if (fixed.length > 0) { | ||
| 140 | + console.log("Removed stale opentui-spinner peer lockfile entries:") | ||
| 141 | + for (const item of fixed) { | ||
| 142 | + console.log(`- ${item}`) | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + const stale = await findStaleLockfileEntries() | ||
| 147 | + if (stale.length > 0) { | ||
| 148 | + console.error(`bun.lock still contains stale opentui versions after upgrading to ${ver}:`) | ||
| 149 | + for (const item of stale) { | ||
| 150 | + console.error(`- ${item.entry}: ${item.pkg}@${item.version}`) | ||
| 151 | + } | ||
| 152 | + process.exit(1) | ||
| 153 | + } | ||
| 154 | + | ||
| 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()) | ||
| 120 | 182 | } | |
| 121 | 183 | ||
| 122 | - console.log(`Updated opentui${snapshot ? " snapshot" : ""} to ${ver} in:`) | ||
| 123 | - for (const file of out) { | ||
| 124 | - console.log(`- ${file}`) | ||
| 184 | + function findStaleLockfileEntriesInText(txt: string) { | ||
| 185 | + return Array.from(txt.matchAll(/^ "([^"]+)": \["(@opentui\/(?:core(?:-[^@"]+)?|keymap|solid))@([^"]+)"/gm)) | ||
| 186 | + .map((match) => ({ | ||
| 187 | + entry: match[1]!, | ||
| 188 | + pkg: match[2]!, | ||
| 189 | + version: match[3]!, | ||
| 190 | + })) | ||
| 191 | + .filter((item) => item.version !== ver) | ||
| 125 | 192 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments