From bfebe35076fa6d2998fbf3a5d6085860df54ac26 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 13 Apr 2024 23:05:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20run=20biome=20check=20in=20binar?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- binary/biome.json | 15 ++++ binary/package-lock.json | 157 +++++++++++++++++++++++++++++++++++++++ binary/package.json | 1 + binary/src/IpcIde.ts | 2 +- binary/src/core.ts | 8 +- binary/src/index.ts | 2 +- binary/src/messenger.ts | 6 +- 7 files changed, 182 insertions(+), 9 deletions(-) create mode 100644 binary/biome.json diff --git a/binary/biome.json b/binary/biome.json new file mode 100644 index 000000000..6308ce822 --- /dev/null +++ b/binary/biome.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.6.4/schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "indentStyle": "space" + } +} diff --git a/binary/package-lock.json b/binary/package-lock.json index 2d1439878..642d698a4 100644 --- a/binary/package-lock.json +++ b/binary/package-lock.json @@ -22,6 +22,7 @@ "binary": "out/index.js" }, "devDependencies": { + "@biomejs/biome": "1.6.4", "@types/follow-redirects": "^1.14.4", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", @@ -74,6 +75,7 @@ "web-tree-sitter": "^0.21.0" }, "devDependencies": { + "@biomejs/biome": "1.6.4", "@types/follow-redirects": "^1.14.4", "@types/handlebars": "^4.1.0", "@types/jest": "^29.5.11", @@ -186,6 +188,161 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.6.4.tgz", + "integrity": "sha512-3groVd2oWsLC0ZU+XXgHSNbq31lUcOCBkCcA7sAQGBopHcmL+jmmdoWlY3S61zIh+f2mqQTQte1g6PZKb3JJjA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.21.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.6.4", + "@biomejs/cli-darwin-x64": "1.6.4", + "@biomejs/cli-linux-arm64": "1.6.4", + "@biomejs/cli-linux-arm64-musl": "1.6.4", + "@biomejs/cli-linux-x64": "1.6.4", + "@biomejs/cli-linux-x64-musl": "1.6.4", + "@biomejs/cli-win32-arm64": "1.6.4", + "@biomejs/cli-win32-x64": "1.6.4" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.6.4.tgz", + "integrity": "sha512-2WZef8byI9NRzGajGj5RTrroW9BxtfbP9etigW1QGAtwu/6+cLkdPOWRAs7uFtaxBNiKFYA8j/BxV5zeAo5QOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.6.4.tgz", + "integrity": "sha512-uo1zgM7jvzcoDpF6dbGizejDLCqNpUIRkCj/oEK0PB0NUw8re/cn1EnxuOLZqDpn+8G75COLQTOx8UQIBBN/Kg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.6.4.tgz", + "integrity": "sha512-wAOieaMNIpLrxGc2/xNvM//CIZg7ueWy3V5A4T7gDZ3OL/Go27EKE59a+vMKsBCYmTt7jFl4yHz0TUkUbodA/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.6.4.tgz", + "integrity": "sha512-Hp8Jwt6rjj0wCcYAEN6/cfwrrPLLlGOXZ56Lei4Pt4jy39+UuPeAVFPeclrrCfxyL1wQ2xPrhd/saTHSL6DoJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.6.4.tgz", + "integrity": "sha512-qTWhuIw+/ePvOkjE9Zxf5OqSCYxtAvcTJtVmZT8YQnmY2I62JKNV2m7tf6O5ViKZUOP0mOQ6NgqHKcHH1eT8jw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.6.4.tgz", + "integrity": "sha512-wqi0hr8KAx5kBO0B+m5u8QqiYFFBJOSJVSuRqTeGWW+GYLVUtXNidykNqf1JsW6jJDpbkSp2xHKE/bTlVaG2Kg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.6.4.tgz", + "integrity": "sha512-Wp3FiEeF6v6C5qMfLkHwf4YsoNHr/n0efvoC8jCKO/kX05OXaVExj+1uVQ1eGT7Pvx0XVm/TLprRO0vq/V6UzA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.6.4.tgz", + "integrity": "sha512-mz183Di5hTSGP7KjNWEhivcP1wnHLGmOxEROvoFsIxMYtDhzJDad4k5gI/1JbmA0xe4n52vsgqo09tBhrMT/Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.21.3" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.19.11", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", diff --git a/binary/package.json b/binary/package.json index d821cd3fe..4096236cd 100644 --- a/binary/package.json +++ b/binary/package.json @@ -29,6 +29,7 @@ "author": "", "license": "Apache-2.0", "devDependencies": { + "@biomejs/biome": "1.6.4", "@types/follow-redirects": "^1.14.4", "@types/uuid": "^9.0.8", "@vercel/ncc": "^0.38.1", diff --git a/binary/src/IpcIde.ts b/binary/src/IpcIde.ts index 5343a2430..2f6864f43 100644 --- a/binary/src/IpcIde.ts +++ b/binary/src/IpcIde.ts @@ -1,5 +1,5 @@ import { MessageIde } from "core/util/messageIde"; -import { IpcMessenger } from "./messenger"; +import type { IpcMessenger } from "./messenger"; export class IpcIde extends MessageIde { constructor(messenger: IpcMessenger) { diff --git a/binary/src/core.ts b/binary/src/core.ts index 8cded9f25..7d4fd9816 100644 --- a/binary/src/core.ts +++ b/binary/src/core.ts @@ -1,4 +1,4 @@ -import { ContextItemId, IDE } from "core"; +import type { ContextItemId, IDE } from "core"; import { CompletionProvider } from "core/autocomplete/completionProvider"; import { ConfigHandler } from "core/config/handler"; import { addModel, addOpenAIKey, deleteModel } from "core/config/util"; @@ -7,12 +7,12 @@ import TransformersJsEmbeddingsProvider from "core/indexing/embeddings/Transform import { CodebaseIndexer, PauseToken } from "core/indexing/indexCodebase"; import { logDevData } from "core/util/devdata"; import historyManager from "core/util/history"; -import { Message } from "core/util/messenger"; +import type { Message } from "core/util/messenger"; import { Telemetry } from "core/util/posthog"; import { streamDiffLines } from "core/util/verticalEdit"; import { v4 as uuidv4 } from "uuid"; -import { IpcMessenger } from "./messenger"; -import { Protocol } from "./protocol"; +import type { IpcMessenger } from "./messenger"; +import type { Protocol } from "./protocol"; export class Core { private messenger: IpcMessenger; diff --git a/binary/src/index.ts b/binary/src/index.ts index 4f6c8448e..e78210ce1 100644 --- a/binary/src/index.ts +++ b/binary/src/index.ts @@ -1,7 +1,7 @@ process.env.IS_BINARY = "true"; +import fs from "fs"; import { Command } from "commander"; import { getCoreLogsPath } from "core/util/paths"; -import fs from "fs"; import { IpcIde } from "./IpcIde"; import { Core } from "./core"; import { IpcMessenger } from "./messenger"; diff --git a/binary/src/messenger.ts b/binary/src/messenger.ts index f8f02a7f9..417a841f3 100644 --- a/binary/src/messenger.ts +++ b/binary/src/messenger.ts @@ -1,9 +1,9 @@ import { v4 as uuidv4 } from "uuid"; -import { getCoreLogsPath } from "core/util/paths"; import * as fs from "fs"; -import { Message } from "../../core/util/messenger"; -import { Protocol, ReverseProtocol } from "./protocol"; +import { getCoreLogsPath } from "core/util/paths"; +import type { Message } from "../../core/util/messenger"; +import type { Protocol, ReverseProtocol } from "./protocol"; export class IpcMessenger { typeListeners = new Map any)[]>();