Explorar o código

#3679 - Fixes packaging to include correct tiktoken.wasm (lite) (#3697)

- also, additions to .gitignore and .vscodeignore to prevent the IntelliJ .idea and .qodo folders from being included for git and packaging.
vagadiya hai 9 meses
pai
achega
4550a91950
Modificáronse 4 ficheiros con 17 adicións e 2 borrados
  1. 4 0
      .gitignore
  2. 4 0
      .vscodeignore
  3. 8 1
      esbuild.js
  4. 1 1
      tsconfig.json

+ 4 - 0
.gitignore

@@ -36,3 +36,7 @@ logs
 
 # Vite development
 .vite-port
+
+# IntelliJ and Qodo plugin folders
+.idea/
+.qodo/

+ 4 - 0
.vscodeignore

@@ -68,3 +68,7 @@ assets/docs/**
 
 # Include .env file for telemetry
 !.env
+
+# Ignore IntelliJ and Qodo plugin folders
+.idea/**
+.qodo/**

+ 8 - 1
esbuild.js

@@ -34,10 +34,17 @@ const copyWasmFiles = {
 
 			// tiktoken WASM file
 			fs.copyFileSync(
-				path.join(nodeModulesDir, "tiktoken", "tiktoken_bg.wasm"),
+				path.join(nodeModulesDir, "tiktoken", "lite", "tiktoken_bg.wasm"),
 				path.join(distDir, "tiktoken_bg.wasm"),
 			)
 
+			// Also copy to the workers directory
+			fs.mkdirSync(path.join(distDir, "workers"), { recursive: true })
+			fs.copyFileSync(
+				path.join(nodeModulesDir, "tiktoken", "lite", "tiktoken_bg.wasm"),
+				path.join(distDir, "workers", "tiktoken_bg.wasm"),
+			)
+
 			// Main tree-sitter WASM file
 			fs.copyFileSync(
 				path.join(nodeModulesDir, "web-tree-sitter", "tree-sitter.wasm"),

+ 1 - 1
tsconfig.json

@@ -21,5 +21,5 @@
 		"useUnknownInCatchVariables": false
 	},
 	"include": ["src/**/*", "scripts/**/*", ".changeset/**/*"],
-	"exclude": ["node_modules", ".vscode-test", "webview-ui"]
+	"exclude": ["node_modules", ".vscode-test", "webview-ui", ".idea", ".qodo"]
 }