FabNote is a VS Code extension for opening and editing .fbn files with a custom editor powered by @creatorsn/powereditor3. Architecturally, it is a VS Code extension host plus a Vue 3 + Vite webview frontend. When a .fbn file is opened, the extension loads the built frontend from media/ and renders the editing experience inside VS Code.
- Chinese overview: docs/README.zh.md
- Chinese development and release guide: docs/开发与发布.md
- Registers
.fbnas theFabNotefile type - Opens
.fbnfiles with a VS Code Custom Editor - Uses a Vue 3 + Vite webview frontend
- Uses
@creatorsn/powereditor3for the editor experience - Includes a custom
.fbnfile icon - Provides a
Preview FabNotecommand to open the current file in the custom editor
fabnote/
|- extension.js VS Code extension entry
|- package.json Extension manifest and metadata
|- media/ Built webview assets loaded by the extension
|- webview-ui/ Vue 3 + Vite frontend project
|- utils/file-icons/ Icon assets for .fbn files
|- docs/ Project docs and screenshots
|- test/ VS Code extension tests
- Node.js 18+ or 20+
- Yarn 1.x
- VS Code 1.102.0+
The extension root and webview-ui/ are separate Node projects, so install both:
yarn
cd webview-ui
yarnFor daily development, use F5 in VS Code instead of yarn test.
Important: if you changed anything under webview-ui/, you must run yarn build first so the latest frontend is written to media/. Only after that should you press F5. Otherwise the Extension Development Host will still load stale assets.
Steps:
- Open the repository root in VS Code
- If the frontend changed, run
cd webview-ui && yarn build - Press
F5 - Choose
Run Extensionfrom.vscode/launch.json - Wait for the new
Extension Development Hostwindow
F5 is for extension debugging and manual verification. yarn test is for automated tests and exits after running.
FabNote loads assets from the root media/ directory, so frontend changes must be built first:
cd webview-ui
yarn buildThis uses webview-ui/vite.config.js to emit the build output directly into media/.
In the Extension Development Host:
- Open or create a
.fbnfile - If it does not automatically open with the custom editor, run
Preview FabNote - The extension will call
vscode.openWithwithfbnPreview.customEditor
If the file is empty, the extension loads built-in sample content as initial data.
yarn lint
yarn testyarn lint: lint extension-side codeyarn test: run VS Code extension tests
yarn dev
yarn build
yarn previewyarn dev: run the standalone Vite dev serveryarn build: build and overwrite rootmedia/yarn preview: preview the production build
The repository does not currently define a package script for publishing, so use vsce directly:
npx @vscode/vsce packageThis generates a file like fabnote-0.0.3.vsix in the repository root.
To install the local package:
code --install-extension fabnote-0.0.3.vsixIf your publisher and PAT are already configured:
npx @vscode/vsce publishTypical release flow:
- Update
versioninpackage.json - Rebuild the frontend with
cd webview-ui && yarn build - Run
yarn lint - Optionally run
yarn test - Run
npx @vscode/vsce packageornpx @vscode/vsce publish
If you need to log in first:
npx @vscode/vsce login CreatorSN- Entry point: extension.js
- Registers
fbnPreview.customEditorwithregisterCustomEditorProvider - Reads file content and sends it to the webview
- Receives edited content back from the webview
- Saves the content back into the
.fbnfile
media/is generated output and should not be edited manually- The repository already contains a packaged artifact:
fabnote-0.0.3.vsix - webview-ui/README.md is still the default frontend template README and can be cleaned up later if needed
