From 665a8430864fb7a55dedea63a6cbdbe400218f80 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Wed, 15 Apr 2026 22:52:34 -0400 Subject: [PATCH] feat: unwrap Archive namespace to flat exports + barrel (#22722) --- packages/opencode/src/lsp/server.ts | 2 +- packages/opencode/src/util/archive.ts | 22 ++++++++++------------ packages/opencode/src/util/index.ts | 1 + 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 packages/opencode/src/util/index.ts diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index f4554ae3e6..769880ef03 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -8,7 +8,7 @@ import fs from "fs/promises" import { Filesystem } from "../util/filesystem" import { Instance } from "../project/instance" import { Flag } from "../flag/flag" -import { Archive } from "../util/archive" +import { Archive } from "../util" import { Process } from "../util/process" import { which } from "../util/which" import { Module } from "@opencode-ai/shared/util/module" diff --git a/packages/opencode/src/util/archive.ts b/packages/opencode/src/util/archive.ts index f65ceba547..cf25636841 100644 --- a/packages/opencode/src/util/archive.ts +++ b/packages/opencode/src/util/archive.ts @@ -1,17 +1,15 @@ import path from "path" import { Process } from "./process" -export namespace Archive { - export async function extractZip(zipPath: string, destDir: string) { - if (process.platform === "win32") { - const winZipPath = path.resolve(zipPath) - const winDestDir = path.resolve(destDir) - // $global:ProgressPreference suppresses PowerShell's blue progress bar popup - const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force` - await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) - return - } - - await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) +export async function extractZip(zipPath: string, destDir: string) { + if (process.platform === "win32") { + const winZipPath = path.resolve(zipPath) + const winDestDir = path.resolve(destDir) + // $global:ProgressPreference suppresses PowerShell's blue progress bar popup + const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force` + await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) + return } + + await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) } diff --git a/packages/opencode/src/util/index.ts b/packages/opencode/src/util/index.ts new file mode 100644 index 0000000000..157bb8e521 --- /dev/null +++ b/packages/opencode/src/util/index.ts @@ -0,0 +1 @@ +export * as Archive from "./archive"