From 4996034b611c969ad36c2469d33fbfc2d72667e5 Mon Sep 17 00:00:00 2001 From: cryptosebek Date: Thu, 21 May 2026 16:21:12 -0600 Subject: [PATCH 1/2] Add bun support --- .gitignore | 1 + bunfig.toml | 3 +++ tests/render.test.ts | 14 ++++++++++---- tsconfig.json | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 bunfig.toml diff --git a/.gitignore b/.gitignore index 25d1823..eab4303 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules .DS_Store .pnpm-store npm-debug.log +bun.lock # Coverage coverage/ diff --git a/bunfig.toml b/bunfig.toml new file mode 100644 index 0000000..0c3983f --- /dev/null +++ b/bunfig.toml @@ -0,0 +1,3 @@ +[test] +root = "./tests" +coverage = false diff --git a/tests/render.test.ts b/tests/render.test.ts index 60cc904..94bf31a 100644 --- a/tests/render.test.ts +++ b/tests/render.test.ts @@ -7,11 +7,19 @@ import { setTaskListExpanded, } from "../.pi/extensions/workflow-orchestrator/render.js"; +// Portable frozen clock: works with both vitest and bun test runners. +const FROZEN_NOW = new Date("2026-03-15T12:00:00.000Z").getTime(); +let originalDateNow: () => number; + describe("render.ts", () => { let mockCtx: ExtensionContext; let mockUi: any; beforeEach(() => { + // Freeze Date.now() without relying on vitest fake timers + originalDateNow = Date.now; + Date.now = () => FROZEN_NOW; + mockUi = { setStatus: vi.fn(), setWidget: vi.fn(), @@ -30,16 +38,14 @@ describe("render.ts", () => { appendEntry: vi.fn(), }, } as unknown as ExtensionContext; - - vi.useFakeTimers(); - vi.setSystemTime(new Date("2026-03-15T12:00:00.000Z")); }); afterEach(() => { - vi.useRealTimers(); + Date.now = originalDateNow; vi.clearAllMocks(); }); + function createBaseState(overrides?: Partial): WorkflowState { return { runId: "test-run", diff --git a/tsconfig.json b/tsconfig.json index c217778..e8184e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "types": ["node"] + "types": ["node", "bun-types"] }, "include": [".pi/extensions/**/*.ts", "tests/**/*.ts"] } From 6c71317c47f3dc1926d01f2e1096a130e5b712a2 Mon Sep 17 00:00:00 2001 From: cryptosebek Date: Thu, 21 May 2026 16:21:29 -0600 Subject: [PATCH 2/2] Bump package deps --- package.json | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index bb9029a..de6f464 100644 --- a/package.json +++ b/package.json @@ -34,17 +34,18 @@ "@mariozechner/pi-ai": "^0.57.1", "@mariozechner/pi-coding-agent": "^0.57.1", "@mariozechner/pi-tui": "^0.57.1", - "@sinclair/typebox": "^0.34.48", - "@types/node": "^25.5.0", - "@typescript-eslint/eslint-plugin": "^8.38.0", - "@typescript-eslint/parser": "^8.38.0", + "@sinclair/typebox": "^0.34.49", + "@types/bun": "^1.3.14", + "@types/node": "^25.9.1", + "@typescript-eslint/eslint-plugin": "^8.59.4", + "@typescript-eslint/parser": "^8.59.4", "@vitest/coverage-v8": "^2.1.9", - "eslint": "^9.9.0", - "eslint-config-prettier": "^9.1.0", - "globals": "^17.4.0", + "eslint": "^9.39.4", + "eslint-config-prettier": "^9.1.2", + "globals": "^17.6.0", "markdownlint-cli": "^0.42.0", - "prettier": "^3.3.3", - "typescript": "^5.6.2", - "vitest": "^2.1.1" + "prettier": "^3.8.3", + "typescript": "^5.9.3", + "vitest": "^2.1.9" } }