فهرست منبع

upgrade opentui to 0.1.94 (#20357)

Sebastian 5 ماه پیش
والد
کامیت
18121300f3
4فایلهای تغییر یافته به همراه67 افزوده شده و 20 حذف شده
  1. 14 14
      bun.lock
  2. 2 2
      packages/opencode/package.json
  3. 47 0
      packages/opencode/test/cli/tui/slot-replace.test.tsx
  4. 4 4
      packages/plugin/package.json

+ 14 - 14
bun.lock

@@ -338,8 +338,8 @@
         "@opencode-ai/sdk": "workspace:*",
         "@opencode-ai/util": "workspace:*",
         "@openrouter/ai-sdk-provider": "2.3.3",
-        "@opentui/core": "0.1.93",
-        "@opentui/solid": "0.1.93",
+        "@opentui/core": "0.1.94",
+        "@opentui/solid": "0.1.94",
         "@parcel/watcher": "2.5.1",
         "@pierre/diffs": "catalog:",
         "@solid-primitives/event-bus": "1.1.2",
@@ -429,16 +429,16 @@
         "zod": "catalog:",
       },
       "devDependencies": {
-        "@opentui/core": "0.1.93",
-        "@opentui/solid": "0.1.93",
+        "@opentui/core": "0.1.94",
+        "@opentui/solid": "0.1.94",
         "@tsconfig/node22": "catalog:",
         "@types/node": "catalog:",
         "@typescript/native-preview": "catalog:",
         "typescript": "catalog:",
       },
       "peerDependencies": {
-        "@opentui/core": ">=0.1.93",
-        "@opentui/solid": ">=0.1.93",
+        "@opentui/core": ">=0.1.94",
+        "@opentui/solid": ">=0.1.94",
       },
       "optionalPeers": [
         "@opentui/core",
@@ -1461,21 +1461,21 @@
 
     "@opentelemetry/api": ["@opentelemetry/api@1.9.0", "", {}, "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="],
 
-    "@opentui/core": ["@opentui/core@0.1.93", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "marked": "17.0.1", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.93", "@opentui/core-darwin-x64": "0.1.93", "@opentui/core-linux-arm64": "0.1.93", "@opentui/core-linux-x64": "0.1.93", "@opentui/core-win32-arm64": "0.1.93", "@opentui/core-win32-x64": "0.1.93", "bun-webgpu": "0.1.5", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-HlTM16ZiBKN0mPBNMHSILkSrbzNku6Pg/ovIpVVkEPqLeWeSC2bfZS4Uhc0Ej1sckVVVoU9HKBJanfHvpP+pMg=="],
+    "@opentui/core": ["@opentui/core@0.1.94", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "marked": "17.0.1", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.94", "@opentui/core-darwin-x64": "0.1.94", "@opentui/core-linux-arm64": "0.1.94", "@opentui/core-linux-x64": "0.1.94", "@opentui/core-win32-arm64": "0.1.94", "@opentui/core-win32-x64": "0.1.94", "bun-webgpu": "0.1.5", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-NSkaY2C+p9Q3n6rvzXKGf8qoaF8/J12x/MUDJ+ADm4WnLwv4oX9AfaGkeALkgfq8hCW7Pg4DmWzGxqBBkV7o8w=="],
 
-    "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.93", "", { "os": "darwin", "cpu": "arm64" }, "sha512-4I2mwhXLqRNUv7tu88hA6cBGaGpLZXkAa8W0VqBiGDV+Tx337x4T+vbQ7G57OwKXT787oTrEOF9rOOrGLov6qw=="],
+    "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.94", "", { "os": "darwin", "cpu": "arm64" }, "sha512-XYg3GaUihqw+4z9MfnfUL2E96y552C35PsUO0Y8rqd71N5UsFwUNdxoUdko7lvzx93jyfh52Q0HRzNzFTxEiFg=="],
 
-    "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.93", "", { "os": "darwin", "cpu": "x64" }, "sha512-jvYMgcg47a5qLhSv1DnQiafEWBQ1UukGutmsYV1TvNuhWtuDXYLVy2AhKIHPzbB9JNrV0IpjbxUC8QnJaP3n8g=="],
+    "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.94", "", { "os": "darwin", "cpu": "x64" }, "sha512-IAt2XbBLn/EKpFln3cuW5mOxHsl3g/LqKfU2VvFxhGZeOOoxB+P1s8RXorfiOIDxVtWBejdj7pWqyzQxAL03Kg=="],
 
-    "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.93", "", { "os": "linux", "cpu": "arm64" }, "sha512-bvFqRcPftmg14iYmMc3d63XC9rhe4yF7pJRApH6klLBKp27WX/LU0iSO4mvyX7qhy65gcmyy4Sj9dl5jNJ+vlA=="],
+    "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.94", "", { "os": "linux", "cpu": "arm64" }, "sha512-O67zVoscWYfqu3kW7PpABaKrysLec4jS5kvRUQHJWGUjnPlpL0rEy/KYOwVCZGrWSO1u3NelIFaqlo/lqhqxnA=="],
 
-    "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.93", "", { "os": "linux", "cpu": "x64" }, "sha512-/wJXhwtNxdcpshrRl1KouyGE54ODAHxRQgBHtnlM/F4bB8cjzOlq2Yc+5cv5DxRz4Q0nQZFCPefwpg2U6ZwNdA=="],
+    "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.94", "", { "os": "linux", "cpu": "x64" }, "sha512-B0661VzQBcWBOcyuu3j093bD5R93bVl3nl9wlsLh7emxk5YpRRyuY6kxVnGIPhnUjL9vaScnWHv0qZCbQuK5eg=="],
 
-    "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.93", "", { "os": "win32", "cpu": "arm64" }, "sha512-g3PQobfM2yFPSzkBKRKFp8FgTG4ulWyJcU+GYXjyYmxQIT+ZbOU7UfR//ImRq3/FxUAfUC/MhC6WwjqccjEqBw=="],
+    "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.94", "", { "os": "win32", "cpu": "arm64" }, "sha512-LfeXOjDRmOyML5r7pjJKpfCyeI+x1cghPJYVI3EesIPPq44EvUowyQVAAmUSV2SX3Z0/Ngd+o+NAlsopNFkAFw=="],
 
-    "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.93", "", { "os": "win32", "cpu": "x64" }, "sha512-Spllte2W7q+WfB1zVHgHilVJNp+jpp77PkkxTWyMQNvT7vJNt9LABMNjGTGiJBBMkAuKvO0GgFNKxrda7tFKrQ=="],
+    "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.94", "", { "os": "win32", "cpu": "x64" }, "sha512-TuWstdGUTXy628Vkipeo6tSREWENCP/pJ9qrfQHqxh5h7M85tQevojYuWQYAlKCejx+tBQh0+oqV7oBHEdty2w=="],
 
-    "@opentui/solid": ["@opentui/solid@0.1.93", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.93", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.10", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.11" } }, "sha512-Qx+4qoLSjnRGoo/YY4sZJMyXj09Y5kaAMpVO+65Ax58MMj4TjABN4bOOiRT2KV7sKOMTjxiAgXAIaBuqBBJ0Qg=="],
+    "@opentui/solid": ["@opentui/solid@0.1.94", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.94", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.10", "entities": "7.0.1", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.11" } }, "sha512-UKXZ9jDZCahQPV5wmBWxMpG7HrCsGSPAp+S3AegUSDOItM6ehmC8d9ZHoEWtfeqeLtpGQKM34jzXwqx4Gck/fg=="],
 
     "@oslojs/asn1": ["@oslojs/asn1@1.0.0", "", { "dependencies": { "@oslojs/binary": "1.0.0" } }, "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA=="],
 

+ 2 - 2
packages/opencode/package.json

@@ -102,8 +102,8 @@
     "@opencode-ai/sdk": "workspace:*",
     "@opencode-ai/util": "workspace:*",
     "@openrouter/ai-sdk-provider": "2.3.3",
-    "@opentui/core": "0.1.93",
-    "@opentui/solid": "0.1.93",
+    "@opentui/core": "0.1.94",
+    "@opentui/solid": "0.1.94",
     "@parcel/watcher": "2.5.1",
     "@pierre/diffs": "catalog:",
     "@solid-primitives/event-bus": "1.1.2",

+ 47 - 0
packages/opencode/test/cli/tui/slot-replace.test.tsx

@@ -0,0 +1,47 @@
+/** @jsxImportSource @opentui/solid */
+import { expect, test } from "bun:test"
+import { createSlot, createSolidSlotRegistry, testRender, useRenderer } from "@opentui/solid"
+import { onMount } from "solid-js"
+
+type Slots = {
+  prompt: {}
+}
+
+test("replace slot mounts plugin content once", async () => {
+  let mounts = 0
+
+  const Probe = () => {
+    onMount(() => {
+      mounts += 1
+    })
+
+    return <box />
+  }
+
+  const App = () => {
+    const renderer = useRenderer()
+    const reg = createSolidSlotRegistry<Slots>(renderer, {})
+    const Slot = createSlot(reg)
+
+    reg.register({
+      id: "plugin",
+      slots: {
+        prompt() {
+          return <Probe />
+        },
+      },
+    })
+
+    return (
+      <box>
+        <Slot name="prompt" mode="replace">
+          <box />
+        </Slot>
+      </box>
+    )
+  }
+
+  await testRender(() => <App />)
+
+  expect(mounts).toBe(1)
+})

+ 4 - 4
packages/plugin/package.json

@@ -21,8 +21,8 @@
     "zod": "catalog:"
   },
   "peerDependencies": {
-    "@opentui/core": ">=0.1.93",
-    "@opentui/solid": ">=0.1.93"
+    "@opentui/core": ">=0.1.94",
+    "@opentui/solid": ">=0.1.94"
   },
   "peerDependenciesMeta": {
     "@opentui/core": {
@@ -33,8 +33,8 @@
     }
   },
   "devDependencies": {
-    "@opentui/core": "0.1.93",
-    "@opentui/solid": "0.1.93",
+    "@opentui/core": "0.1.94",
+    "@opentui/solid": "0.1.94",
     "@tsconfig/node22": "catalog:",
     "@types/node": "catalog:",
     "typescript": "catalog:",