Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
},
"patchedDependencies": {
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
"@openrouter/ai-sdk-provider@1.5.4": "patches/@openrouter%2Fai-sdk-provider@1.5.4.patch"
"@openrouter/ai-sdk-provider@1.5.4": "patches/@openrouter%2Fai-sdk-provider@1.5.4.patch",
"@opentui/core@0.1.86": "patches/@opentui%2Fcore@0.1.86.patch"
}
}
4 changes: 2 additions & 2 deletions packages/opencode/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import solidPlugin from "../node_modules/@opentui/solid/scripts/solid-plugin"
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const dir = path.resolve(__dirname, "..")
const repoRoot = path.resolve(dir, "../..")

process.chdir(dir)

Expand Down Expand Up @@ -144,8 +145,7 @@ await $`rm -rf dist`

const binaries: Record<string, string> = {}
if (!skipInstall) {
await $`bun install --os="*" --cpu="*" @opentui/core@${pkg.dependencies["@opentui/core"]}`
await $`bun install --os="*" --cpu="*" @parcel/watcher@${pkg.dependencies["@parcel/watcher"]}`
await $`bun install --os="*" --cpu="*"`.cwd(repoRoot)
}
for (const item of targets) {
const name = [
Expand Down
48 changes: 48 additions & 0 deletions patches/@opentui%2Fcore@0.1.86.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/index-4sjb8n0n.js b/index-4sjb8n0n.js
index 052afc9d6..e19908fb2 100644
--- a/index-4sjb8n0n.js
+++ b/index-4sjb8n0n.js
@@ -16210,6 +16210,7 @@ class CliRenderer extends EventEmitter9 {
lastTime = 0;
frameCount = 0;
lastFpsTime = 0;
+ now = typeof performance !== "undefined" && typeof performance.now === "function" ? () => performance.now() : () => Date.now();
currentFps = 0;
targetFrameTime = 1000 / this.targetFps;
minTargetFrameTime = 1000 / this.maxFps;
@@ -16521,8 +16522,8 @@ Captured output:
}
if (!this.updateScheduled && !this.renderTimeout) {
this.updateScheduled = true;
- const now = Date.now();
- const elapsed = now - this.lastTime;
+ const now = this.now();
+ const elapsed = Math.max(now - this.lastTime, 0);
const delay = Math.max(this.minTargetFrameTime - elapsed, 0);
if (delay === 0) {
process.nextTick(() => this.activateFrame());
@@ -17398,7 +17399,7 @@ Captured output:
startRenderLoop() {
if (!this._isRunning)
return;
- this.lastTime = Date.now();
+ this.lastTime = this.now();
this.frameCount = 0;
this.lastFpsTime = this.lastTime;
this.currentFps = 0;
@@ -17414,12 +17415,12 @@ Captured output:
this.renderTimeout = null;
}
try {
- const now = Date.now();
- const elapsed = now - this.lastTime;
+ const now = this.now();
+ const elapsed = Math.max(now - this.lastTime, 0);
const deltaTime = elapsed;
this.lastTime = now;
this.frameCount++;
- if (now - this.lastFpsTime >= 1000) {
+ if (Math.max(now - this.lastFpsTime, 0) >= 1000) {
this.currentFps = this.frameCount;
this.frameCount = 0;
this.lastFpsTime = now;
Loading