Browse Source

Remove isbinaryfile as this caused errors on some users computers

Saoud Rizwan 1 year ago
parent
commit
0a16aedf95
3 changed files with 4 additions and 24 deletions
  1. 2 15
      package-lock.json
  2. 1 2
      package.json
  3. 1 7
      src/utils/extract-text.ts

+ 2 - 15
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "claude-dev",
   "name": "claude-dev",
-  "version": "1.5.3",
+  "version": "1.5.33",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "claude-dev",
       "name": "claude-dev",
-      "version": "1.5.3",
+      "version": "1.5.33",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@anthropic-ai/bedrock-sdk": "^0.10.2",
         "@anthropic-ai/bedrock-sdk": "^0.10.2",
@@ -22,7 +22,6 @@
         "diff": "^5.2.0",
         "diff": "^5.2.0",
         "execa": "^9.3.0",
         "execa": "^9.3.0",
         "globby": "^14.0.2",
         "globby": "^14.0.2",
-        "isbinaryfile": "^5.0.2",
         "mammoth": "^1.8.0",
         "mammoth": "^1.8.0",
         "openai": "^4.54.0",
         "openai": "^4.54.0",
         "os-name": "^6.0.0",
         "os-name": "^6.0.0",
@@ -7370,18 +7369,6 @@
       "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
       "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
       "license": "MIT"
       "license": "MIT"
     },
     },
-    "node_modules/isbinaryfile": {
-      "version": "5.0.2",
-      "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.2.tgz",
-      "integrity": "sha512-GvcjojwonMjWbTkfMpnVHVqXW/wKMYDfEpY94/8zy8HFMOqb/VL6oeONq9v87q4ttVlaTLnGXnJD4B5B1OTGIg==",
-      "license": "MIT",
-      "engines": {
-        "node": ">= 18.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/gjtorikian/"
-      }
-    },
     "node_modules/isexe": {
     "node_modules/isexe": {
       "version": "2.0.0",
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
       "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",

+ 1 - 2
package.json

@@ -2,7 +2,7 @@
   "name": "claude-dev",
   "name": "claude-dev",
   "displayName": "Claude Dev",
   "displayName": "Claude Dev",
   "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
   "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
-  "version": "1.5.32",
+  "version": "1.5.33",
   "icon": "icon.png",
   "icon": "icon.png",
   "engines": {
   "engines": {
     "vscode": "^1.84.0"
     "vscode": "^1.84.0"
@@ -146,7 +146,6 @@
     "diff": "^5.2.0",
     "diff": "^5.2.0",
     "execa": "^9.3.0",
     "execa": "^9.3.0",
     "globby": "^14.0.2",
     "globby": "^14.0.2",
-    "isbinaryfile": "^5.0.2",
     "mammoth": "^1.8.0",
     "mammoth": "^1.8.0",
     "openai": "^4.54.0",
     "openai": "^4.54.0",
     "os-name": "^6.0.0",
     "os-name": "^6.0.0",

+ 1 - 7
src/utils/extract-text.ts

@@ -2,7 +2,6 @@ import * as path from "path"
 // @ts-ignore-next-line
 // @ts-ignore-next-line
 import pdf from "pdf-parse/lib/pdf-parse"
 import pdf from "pdf-parse/lib/pdf-parse"
 import mammoth from "mammoth"
 import mammoth from "mammoth"
-import { isBinaryFile } from "isbinaryfile"
 import fs from "fs/promises"
 import fs from "fs/promises"
 
 
 export async function extractTextFromFile(filePath: string): Promise<string> {
 export async function extractTextFromFile(filePath: string): Promise<string> {
@@ -20,12 +19,7 @@ export async function extractTextFromFile(filePath: string): Promise<string> {
 		case ".ipynb":
 		case ".ipynb":
 			return extractTextFromIPYNB(filePath)
 			return extractTextFromIPYNB(filePath)
 		default:
 		default:
-			const isBinary = await isBinaryFile(filePath)
-			if (!isBinary) {
-				return await fs.readFile(filePath, "utf8")
-			} else {
-				throw new Error(`Unsupported file type: ${fileExtension}`)
-			}
+			return await fs.readFile(filePath, "utf8")
 	}
 	}
 }
 }