vite-plugin-vybcel
v0.2.1
Published
Vite plugin for Vybcel toolbar integration
Maintainers
Readme
Vybcel Vite Plugin
Vite plugin for seamless integration with Vybcel toolbar - providing real-time code syncing, deployment status, and auto-updates.
Features
- 🔄 Real-time sync - Changes are automatically synced to your Vybcel project
- 🚀 Auto-deploy - Instant deployments with Netlify integration
- 🛠️ Developer toolbar - In-browser controls for save, discard, and preview
- ✨ Auto-updates - Plugin updates itself automatically without breaking your workflow
- ⌨️ Keyboard shortcuts - Quick actions with Cmd/Ctrl+Shift+[S|D|P|U]
Installation
npm install @vybcel/vite-plugin
# or
pnpm add @vybcel/vite-plugin
# or
yarn add @vybcel/vite-pluginConfiguration
Basic Setup
Add the plugin to your vite.config.ts:
import { defineConfig } from "vite";
import { vybcelPlugin } from "@vybcel/vite-plugin";
export default defineConfig({
plugins: [
vybcelPlugin({
// Optional: custom WebSocket URL
websocketUrl: "ws://localhost:8080",
// Optional: enable/disable auto-updates
autoUpdate: true,
// Optional: custom update endpoint
updateEndpoint: "https://api.vybcel.com/v1/toolbar",
}),
],
});Project Configuration
Create a vybcel.config.json file in your project root:
{
"projectId": "your-project-id",
"websocketUrl": "ws://localhost:8080",
"toolbar": {
"enabled": true,
"position": "top",
"autoUpdate": true,
"updateChannel": "stable"
}
}Auto-Update System
The Vybcel plugin includes a sophisticated auto-update system that keeps your toolbar up-to-date without disrupting your development workflow.
Update Channels
stable(default) - Production-ready updates, thoroughly testedbeta- Early access to new features, may have minor issuesdev- Latest development builds, for testing new functionality
How Auto-Updates Work
- Periodic checks - Plugin checks for updates every 5 minutes
- WebSocket updates - Server can push critical updates instantly
- Hot reloading - Toolbar updates without refreshing your app
- Fallback system - Always falls back to local version if update fails
Update Notifications
When updates are available, you'll see:
- 🚀 Green notification - Successfully updated to new version
- ⚠️ Red notification - Critical update being applied
- 🔄 Blue notification - Toolbar reloading
Configuration Options
{
"toolbar": {
"autoUpdate": true, // Enable/disable auto-updates
"updateChannel": "stable" // Update channel: stable|beta|dev
}
}Plugin Options
vybcelPlugin({
autoUpdate: true, // Enable auto-updates
updateEndpoint: "https://api.vybcel.com/v1/toolbar", // Custom update server
});Manual Update Check
Force check for updates using the keyboard shortcut:
- Cmd/Ctrl + Shift + U - Check for updates manually
Keyboard Shortcuts
- Cmd/Ctrl + Shift + S - Save all pending changes
- Cmd/Ctrl + Shift + D - Discard all pending changes
- Cmd/Ctrl + Shift + P - Open preview in new tab
- Cmd/Ctrl + Shift + U - Check for toolbar updates
Toolbar States
The toolbar shows real-time status of your project:
- Green dot - Connected to Vybcel servers
- Red dot - Disconnected (check your connection)
- Deploy status - Shows current deployment state:
Ready- Latest changes are deployedBuilding...- Deployment in progressFailed- Build/deployment failedPending- Waiting for deployment
API Events
The plugin communicates with Vybcel servers via WebSocket and supports these events:
Client → Server
save_all_changes- Save pending changesdiscard_all_changes- Discard pending changestoolbar_check_updates- Check for updatestoolbar_update_acknowledged- Acknowledge update received
Server → Client
file_change_staged- File change detecteddeploy_status_update- Deployment status changedtoolbar_update_available- New toolbar version availabletoolbar_force_update- Critical update requiredtoolbar_reload- Reload toolbar requested
Troubleshooting
Toolbar Not Appearing
- Check
vybcel.config.jsonexists and has validprojectId - Verify toolbar is enabled:
"toolbar": { "enabled": true } - Check browser console for connection errors
Connection Issues
- Verify WebSocket URL is correct in config
- Check if Vybcel development server is running
- Ensure no firewall blocking WebSocket connections
Update Issues
- Try manual update check:
Cmd/Ctrl + Shift + U - Check browser console for update errors
- Temporarily disable auto-updates:
"autoUpdate": false - Clear browser cache and reload
Disabling Auto-Updates
To disable auto-updates completely:
In vybcel.config.json:
{
"toolbar": {
"autoUpdate": false
}
}Or in vite.config.ts:
vybcelPlugin({
autoUpdate: false,
});Or via environment variable:
VYBCEL_TOOLBAR=false npm run devDevelopment
Building the Plugin
pnpm install
pnpm buildTesting Auto-Updates
For testing the auto-update system:
- Build plugin with version bump
- Deploy to test update server
- Configure test project to use test update endpoint
- Trigger update via WebSocket or manual check
License
MIT
