97cc4ed5fe
- Bundle chromadb into main.js via esbuild instead of externalizing it.
Obsidian's renderer cannot resolve bare require('chromadb') against a
plugin-local node_modules. By bundling, the client library is inlined and
works out of the box with just manifest.json + main.js.
- Remove eager cache initialization from OllamaClient constructor to avoid
unhandled promise rejections when chromadb/ChromaDB is unavailable.
- Fix 'Failed to execute fetch on Window: Illegal invocation' by wrapping
the default fetch fallback in an arrow function:
this.fetchFn = fetchFn ?? ((url, init) => fetch(url, init));
This preserves the window binding when fetch is called later.
- Update install.sh and README to remove the obsolete node_modules/chromadb
copy step.
- Update ollama-client-cache tests to reflect that cache initialization is
no longer eager.
40 lines
1.1 KiB
JSON
Executable File
40 lines
1.1 KiB
JSON
Executable File
{
|
|
"name": "ollama-plugin",
|
|
"version": "1.0.0",
|
|
"description": "Ollama integration plugin for Obsidian",
|
|
"main": "dist/main.js",
|
|
"scripts": {
|
|
"test": "jest",
|
|
"build": "tsc --noEmit && node -e \"require('esbuild').build({entryPoints:['src/main.ts'],bundle:true,platform:'node',target:'es2020',outfile:'main.js',external:['obsidian','cohere-ai','ollama','openai','@google/generative-ai','voyageai'],format:'cjs'})\"",
|
|
"watch": "tsc --watch",
|
|
"lint": "eslint src --ext .ts",
|
|
"format": "prettier --write ."
|
|
},
|
|
"keywords": [
|
|
"obsidian",
|
|
"ollama",
|
|
"chat",
|
|
"ai",
|
|
"plugin"
|
|
],
|
|
"author": "Anonymous",
|
|
"license": "MIT",
|
|
"devDependencies": {
|
|
"@types/jest": "^29.5.14",
|
|
"@types/node": "^20.11.19",
|
|
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
|
"@typescript-eslint/parser": "^8.59.2",
|
|
"esbuild": "^0.28.0",
|
|
"eslint": "^8.56.0",
|
|
"jest": "^29.7.0",
|
|
"jest-environment-jsdom": "^30.3.0",
|
|
"obsidian": "^1.4.11",
|
|
"prettier": "^3.2.5",
|
|
"ts-jest": "^29.1.2",
|
|
"typescript": "^5.3.3"
|
|
},
|
|
"dependencies": {
|
|
"chromadb": "^1.5.3"
|
|
}
|
|
}
|