mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-04 17:01:05 +02:00
b61d115566
Co-authored-by: estruyf <2900833+estruyf@users.noreply.github.com>
2.6 KiB
2.6 KiB
Development Guide - Front Matter Lite
Prerequisites
- Node.js (v18 or higher)
- npm or yarn
Setup
cd lite
npm install
Building
Development Build
npm run dev
This will watch for changes and rebuild automatically.
Production Build
npm run build
Testing
Local Testing
-
Build the extension:
npm run build -
Press F5 in VS Code to open the Extension Development Host
-
Test in a virtual workspace:
- Open the Command Palette (F1)
- Run "Open Remote Repository"
- Enter a GitHub repository URL
- Test the lite version features
Testing in github.dev
-
Package the extension:
npm install -g @vscode/vsce vsce package -
Navigate to github.dev in your browser
- Press
.on any GitHub repository - Install the extension manually
- Press
Architecture
The lite version is designed to work without Node.js-specific APIs:
- No Node.js fs module - Uses
vscode.workspace.fsinstead - No Node.js path module - Uses
vscode.Uri.joinPathinstead - No child_process - No external script execution
- Browser-compatible - Built as a web extension (target: 'webworker')
Key Differences from Full Extension
| Feature | Full Extension | Lite Version |
|---|---|---|
| File Operations | Node.js fs |
VS Code workspace.fs |
| Path Handling | Node.js path |
vscode.Uri |
| Scripts | child_process | Not available |
| Workspace | File system only | Virtual workspaces |
| Dashboard | Full React app | Simplified (planned) |
Contributing
When adding features to the lite version:
- Ensure compatibility with virtual workspaces
- Use only browser-compatible APIs
- Test in both github.dev and vscode.dev
- Document any limitations
Debugging
Enable the Output Channel "Front Matter Lite" to see debug messages:
- View > Output
- Select "Front Matter Lite" from the dropdown
Common Issues
Extension not loading
- Check the Output channel for errors
- Ensure the extension is built correctly
- Verify the package.json has the correct
browserentry point
Features not working in virtual workspace
- Confirm the workspace scheme is not 'file'
- Check browser console for errors
- Verify you're using VS Code FileSystem API