How mbehr1/fishbone works
Project type and purpose
• It includes a backend-side VS Code extension (TypeScript) and a frontend-side embedded webview app (React) plus supporting documentation and tests.
File structure
Top-level directories and files:
• src/extension: VS Code extension code (activation, commands, providers, formatters, AI integrations, notebook, FS).
• src/test: unit and integration tests for the extension.
• docs/fishbone: Docusaurus site for public documentation.
• Configuration files: tsconfig.json, esbuild.mjs (build extension or bundle webview), .github/workflows (CI/CD), BUILD.md.
• Package manifests: package.json (root), src/webview/package.json (webview dependencies).
• Other: types/ (d.ts), static images, db.json for sample data, license, changelog.
README for additional insights
• Technologies: VS Code Extension API, TypeScript, React, Material-UI, fishbone-chart, js-yaml, jsonpath.
• External integrations: REST services, other extensions (dlt-logs).
Main components and their interactions
a. VS Code Host & Extension Host
• The extension registers commands (e.g. New Fishbone), file watchers for .fba files, language-configuration, grammar.
• It implements providers:
• FileSystemProvider to read/write .fba files
• NotebookProvider for fishbone as a notebook
• AIProvider for hints/history/DSL helpers
• Format/edit/render utilities
• It launches a WebviewPanel and communicates via VS Code’s message passing (postMessage).
b. Embedded Webview App (React)
• Calls back to extension host for backend tasks (e.g. REST queries).
c. External Services
• Optional REST endpoints (JIRA, custom servers), and DLT-logs extension APIs, for data fetching.
d. Persistence Layer
• Storage of .fba files (YAML or JSON inside), allowing undo/redo via VS Code’s built-in API.
e. Documentation Site
• Docusaurus “docs/fishbone” built and hosted via GitHub Pages, separate from core runtime.
Architectural patterns and design principles
• Modular separation: extension logic vs UI logic.
• Message-based communication between host and webview.
• Provider pattern: FileSystem, Notebook, AI.
• React component hierarchy for fishbone chart, summary table, dialogs.
• CI/CD pipelines via GitHub Actions for lint, tests, release, docs deployment.
• TypeScript for strong typing, custom type declarations in types/.