diff --git a/README.md b/README.md index 7c1cda4..01f770e 100755 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Then copy the plugin into your vault: ```bash mkdir -p /path/to/vault/.obsidian/plugins/ollama-plugin cp manifest.json /path/to/vault/.obsidian/plugins/ollama-plugin/ +cp main.js /path/to/vault/.obsidian/plugins/ollama-plugin/ cp -r dist /path/to/vault/.obsidian/plugins/ollama-plugin/ cp -r node_modules/chromadb /path/to/vault/.obsidian/plugins/ollama-plugin/node_modules/ # optional: only needed for semantic cache ``` diff --git a/install.sh b/install.sh index fbba997..9817ee6 100755 --- a/install.sh +++ b/install.sh @@ -92,8 +92,9 @@ step "Installing into vault" mkdir -p "$PLUGIN_DIR" -# Copy manifest and built output +# Copy manifest, entry shim, and built output cp "$SCRIPT_DIR/manifest.json" "$PLUGIN_DIR/" +cp "$SCRIPT_DIR/main.js" "$PLUGIN_DIR/" cp -r "$SCRIPT_DIR/dist" "$PLUGIN_DIR/" # Copy only necessary runtime dependencies (obsidian and chromadb stubs) @@ -111,8 +112,9 @@ info "Plugin installed to $PLUGIN_DIR" step "Verifying installation" -if [ -f "$PLUGIN_DIR/manifest.json" ] && [ -f "$PLUGIN_DIR/dist/main.js" ]; then +if [ -f "$PLUGIN_DIR/manifest.json" ] && [ -f "$PLUGIN_DIR/main.js" ] && [ -f "$PLUGIN_DIR/dist/main.js" ]; then info "manifest.json ✓" + info "main.js ✓" info "dist/main.js ✓" else error "Installation verification failed — missing files in $PLUGIN_DIR" diff --git a/main.js b/main.js new file mode 100644 index 0000000..f3f2f23 --- /dev/null +++ b/main.js @@ -0,0 +1,3 @@ +// Shim entry point — re-exports the compiled plugin from dist/ +// Obsidian expects main.js at the plugin root alongside manifest.json. +module.exports = require('./dist/main.js'); diff --git a/manifest.json b/manifest.json index 73d92b5..819f066 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "author": "Anonymous", "authorUrl": "", "isDesktopOnly": true, - "main": "dist/main.js", + "main": "main.js", "authorization": [], "permissions": [], "defaultEnabled": true,