chore: upgrade bun from 1.3.5 -> 1.3.6, also update types/bun from 1.3.4 -> 1.3.6 and fix type errs (#8499)
Co-authored-by: Github Action <action@github.com>pull/8522/head
parent
1f86aa8bb9
commit
50dfa9caf3
6
bun.lock
6
bun.lock
|
|
@ -505,7 +505,7 @@
|
||||||
"@tailwindcss/vite": "4.1.11",
|
"@tailwindcss/vite": "4.1.11",
|
||||||
"@tsconfig/bun": "1.0.9",
|
"@tsconfig/bun": "1.0.9",
|
||||||
"@tsconfig/node22": "22.0.2",
|
"@tsconfig/node22": "22.0.2",
|
||||||
"@types/bun": "1.3.4",
|
"@types/bun": "1.3.6",
|
||||||
"@types/luxon": "3.7.1",
|
"@types/luxon": "3.7.1",
|
||||||
"@types/node": "22.13.9",
|
"@types/node": "22.13.9",
|
||||||
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
||||||
|
|
@ -1773,7 +1773,7 @@
|
||||||
|
|
||||||
"@types/braces": ["@types/braces@3.0.5", "", {}, "sha512-SQFof9H+LXeWNz8wDe7oN5zu7ket0qwMu5vZubW4GCJ8Kkeh6nBWUz87+KTz/G3Kqsrp0j/W253XJb3KMEeg3w=="],
|
"@types/braces": ["@types/braces@3.0.5", "", {}, "sha512-SQFof9H+LXeWNz8wDe7oN5zu7ket0qwMu5vZubW4GCJ8Kkeh6nBWUz87+KTz/G3Kqsrp0j/W253XJb3KMEeg3w=="],
|
||||||
|
|
||||||
"@types/bun": ["@types/bun@1.3.4", "", { "dependencies": { "bun-types": "1.3.4" } }, "sha512-EEPTKXHP+zKGPkhRLv+HI0UEX8/o+65hqARxLy8Ov5rIxMBPNTjeZww00CIihrIQGEQBYg+0roO5qOnS/7boGA=="],
|
"@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="],
|
||||||
|
|
||||||
"@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
|
"@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
|
||||||
|
|
||||||
|
|
@ -2075,7 +2075,7 @@
|
||||||
|
|
||||||
"bun-pty": ["bun-pty@0.4.4", "", {}, "sha512-WK4G6uWsZgu1v4hKIlw6G1q2AOf8Rbga2Yr7RnxArVjjyb+mtVa/CFc9GOJf+OYSJSH8k7LonAtQOVeNAddRyg=="],
|
"bun-pty": ["bun-pty@0.4.4", "", {}, "sha512-WK4G6uWsZgu1v4hKIlw6G1q2AOf8Rbga2Yr7RnxArVjjyb+mtVa/CFc9GOJf+OYSJSH8k7LonAtQOVeNAddRyg=="],
|
||||||
|
|
||||||
"bun-types": ["bun-types@1.3.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-5ua817+BZPZOlNaRgGBpZJOSAQ9RQ17pkwPD0yR7CfJg+r8DgIILByFifDTa+IPDDxzf5VNhtNlcKqFzDgJvlQ=="],
|
"bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="],
|
||||||
|
|
||||||
"bun-webgpu": ["bun-webgpu@0.1.4", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.4", "bun-webgpu-darwin-x64": "^0.1.4", "bun-webgpu-linux-x64": "^0.1.4", "bun-webgpu-win32-x64": "^0.1.4" } }, "sha512-Kw+HoXl1PMWJTh9wvh63SSRofTA8vYBFCw0XEP1V1fFdQEDhI8Sgf73sdndE/oDpN/7CMx0Yv/q8FCvO39ROMQ=="],
|
"bun-webgpu": ["bun-webgpu@0.1.4", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.4", "bun-webgpu-darwin-x64": "^0.1.4", "bun-webgpu-linux-x64": "^0.1.4", "bun-webgpu-win32-x64": "^0.1.4" } }, "sha512-Kw+HoXl1PMWJTh9wvh63SSRofTA8vYBFCw0XEP1V1fFdQEDhI8Sgf73sdndE/oDpN/7CMx0Yv/q8FCvO39ROMQ=="],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"nodeModules": {
|
"nodeModules": {
|
||||||
"x86_64-linux": "sha256-1l4twtOi/7YYy1KFJME1XazAgTETAfbxB3EOv2qQeVs=",
|
"x86_64-linux": "sha256-GKdu7nan/9ioBtgL3cUeuVLNKUDio10LeQrn7BPgbng=",
|
||||||
"aarch64-darwin": "sha256-jdZI3BA/v35er4xgWkI2rHo54D1TDNVhMX83b5BcIvk="
|
"aarch64-darwin": "sha256-STLB1J65VjauvPM+BqCyTQQkHPoVmUhDvVEdH3WTJP4="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "AI-powered development tool",
|
"description": "AI-powered development tool",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "bun@1.3.5",
|
"packageManager": "bun@1.3.6",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
|
"dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts",
|
||||||
"typecheck": "bun turbo typecheck",
|
"typecheck": "bun turbo typecheck",
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
"packages/slack"
|
"packages/slack"
|
||||||
],
|
],
|
||||||
"catalog": {
|
"catalog": {
|
||||||
"@types/bun": "1.3.4",
|
"@types/bun": "1.3.6",
|
||||||
"@octokit/rest": "22.0.0",
|
"@octokit/rest": "22.0.0",
|
||||||
"@hono/zod-validator": "0.4.2",
|
"@hono/zod-validator": "0.4.2",
|
||||||
"ulid": "3.0.1",
|
"ulid": "3.0.1",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import { ConfigMarkdown } from "../config/markdown"
|
||||||
import { Log } from "../util/log"
|
import { Log } from "../util/log"
|
||||||
import { Global } from "@/global"
|
import { Global } from "@/global"
|
||||||
import { Filesystem } from "@/util/filesystem"
|
import { Filesystem } from "@/util/filesystem"
|
||||||
import { exists } from "fs/promises"
|
|
||||||
import { Flag } from "@/flag/flag"
|
import { Flag } from "@/flag/flag"
|
||||||
|
|
||||||
export namespace Skill {
|
export namespace Skill {
|
||||||
|
|
@ -77,7 +76,7 @@ export namespace Skill {
|
||||||
)
|
)
|
||||||
// Also include global ~/.claude/skills/
|
// Also include global ~/.claude/skills/
|
||||||
const globalClaude = `${Global.Path.home}/.claude`
|
const globalClaude = `${Global.Path.home}/.claude`
|
||||||
if (await exists(globalClaude)) {
|
if (await Filesystem.isDir(globalClaude)) {
|
||||||
claudeDirs.push(globalClaude)
|
claudeDirs.push(globalClaude)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import { Log } from "../util/log"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import fs from "fs/promises"
|
import fs from "fs/promises"
|
||||||
import { Global } from "../global"
|
import { Global } from "../global"
|
||||||
|
import { Filesystem } from "../util/filesystem"
|
||||||
import { lazy } from "../util/lazy"
|
import { lazy } from "../util/lazy"
|
||||||
import { Lock } from "../util/lock"
|
import { Lock } from "../util/lock"
|
||||||
import { $ } from "bun"
|
import { $ } from "bun"
|
||||||
|
|
@ -23,7 +24,7 @@ export namespace Storage {
|
||||||
const MIGRATIONS: Migration[] = [
|
const MIGRATIONS: Migration[] = [
|
||||||
async (dir) => {
|
async (dir) => {
|
||||||
const project = path.resolve(dir, "../project")
|
const project = path.resolve(dir, "../project")
|
||||||
if (!fs.exists(project)) return
|
if (!(await Filesystem.isDir(project))) return
|
||||||
for await (const projectDir of new Bun.Glob("*").scan({
|
for await (const projectDir of new Bun.Glob("*").scan({
|
||||||
cwd: project,
|
cwd: project,
|
||||||
onlyFiles: false,
|
onlyFiles: false,
|
||||||
|
|
@ -43,7 +44,7 @@ export namespace Storage {
|
||||||
if (worktree) break
|
if (worktree) break
|
||||||
}
|
}
|
||||||
if (!worktree) continue
|
if (!worktree) continue
|
||||||
if (!(await fs.exists(worktree))) continue
|
if (!(await Filesystem.isDir(worktree))) continue
|
||||||
const [id] = await $`git rev-list --max-parents=0 --all`
|
const [id] = await $`git rev-list --max-parents=0 --all`
|
||||||
.quiet()
|
.quiet()
|
||||||
.nothrow()
|
.nothrow()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
import { realpathSync } from "fs"
|
import { realpathSync } from "fs"
|
||||||
import { exists } from "fs/promises"
|
|
||||||
import { dirname, join, relative } from "path"
|
import { dirname, join, relative } from "path"
|
||||||
|
|
||||||
export namespace Filesystem {
|
export namespace Filesystem {
|
||||||
|
export const exists = (p: string) =>
|
||||||
|
Bun.file(p)
|
||||||
|
.stat()
|
||||||
|
.then(() => true)
|
||||||
|
.catch(() => false)
|
||||||
|
|
||||||
|
export const isDir = (p: string) =>
|
||||||
|
Bun.file(p)
|
||||||
|
.stat()
|
||||||
|
.then((s) => s.isDirectory())
|
||||||
|
.catch(() => false)
|
||||||
/**
|
/**
|
||||||
* On Windows, normalize a path to its canonical casing using the filesystem.
|
* On Windows, normalize a path to its canonical casing using the filesystem.
|
||||||
* This is needed because Windows paths are case-insensitive but LSP servers
|
* This is needed because Windows paths are case-insensitive but LSP servers
|
||||||
|
|
@ -31,7 +41,7 @@ export namespace Filesystem {
|
||||||
const result = []
|
const result = []
|
||||||
while (true) {
|
while (true) {
|
||||||
const search = join(current, target)
|
const search = join(current, target)
|
||||||
if (await exists(search).catch(() => false)) result.push(search)
|
if (await exists(search)) result.push(search)
|
||||||
if (stop === current) break
|
if (stop === current) break
|
||||||
const parent = dirname(current)
|
const parent = dirname(current)
|
||||||
if (parent === current) break
|
if (parent === current) break
|
||||||
|
|
@ -46,7 +56,7 @@ export namespace Filesystem {
|
||||||
while (true) {
|
while (true) {
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
const search = join(current, target)
|
const search = join(current, target)
|
||||||
if (await exists(search).catch(() => false)) yield search
|
if (await exists(search)) yield search
|
||||||
}
|
}
|
||||||
if (stop === current) break
|
if (stop === current) break
|
||||||
const parent = dirname(current)
|
const parent = dirname(current)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { describe, expect, test } from "bun:test"
|
||||||
|
import os from "node:os"
|
||||||
|
import path from "node:path"
|
||||||
|
import { mkdtemp, mkdir, rm } from "node:fs/promises"
|
||||||
|
import { Filesystem } from "../../src/util/filesystem"
|
||||||
|
|
||||||
|
describe("util.filesystem", () => {
|
||||||
|
test("exists() is true for files and directories", async () => {
|
||||||
|
const tmp = await mkdtemp(path.join(os.tmpdir(), "opencode-filesystem-"))
|
||||||
|
const dir = path.join(tmp, "dir")
|
||||||
|
const file = path.join(tmp, "file.txt")
|
||||||
|
const missing = path.join(tmp, "missing")
|
||||||
|
|
||||||
|
await mkdir(dir, { recursive: true })
|
||||||
|
await Bun.write(file, "hello")
|
||||||
|
|
||||||
|
const cases = await Promise.all([Filesystem.exists(dir), Filesystem.exists(file), Filesystem.exists(missing)])
|
||||||
|
|
||||||
|
expect(cases).toEqual([true, true, false])
|
||||||
|
|
||||||
|
await rm(tmp, { recursive: true, force: true })
|
||||||
|
})
|
||||||
|
|
||||||
|
test("isDir() is true only for directories", async () => {
|
||||||
|
const tmp = await mkdtemp(path.join(os.tmpdir(), "opencode-filesystem-"))
|
||||||
|
const dir = path.join(tmp, "dir")
|
||||||
|
const file = path.join(tmp, "file.txt")
|
||||||
|
const missing = path.join(tmp, "missing")
|
||||||
|
|
||||||
|
await mkdir(dir, { recursive: true })
|
||||||
|
await Bun.write(file, "hello")
|
||||||
|
|
||||||
|
const cases = await Promise.all([Filesystem.isDir(dir), Filesystem.isDir(file), Filesystem.isDir(missing)])
|
||||||
|
|
||||||
|
expect(cases).toEqual([true, false, false])
|
||||||
|
|
||||||
|
await rm(tmp, { recursive: true, force: true })
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue