@vibeli/vite-plugin
v1.1.0
Published
Vibeli Vite plugin — codegen, zod, bootstrap injection, runtime-log capture, dev notifiers
Readme
@vibeli/vite-plugin
Vite plugin for Vibeli apps: codegen (entity declarations → types + zod), bootstrap
injection, and dev-only editor notifiers. Mirrors the role of @base44/vite-plugin,
plus our codegen.
Install
npm install -D @vibeli/vite-pluginUse
// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import vibeli from '@vibeli/vite-plugin'
export default defineConfig({
plugins: [
vibeli({
codegen: true, // entities/*.json → ./.vibeli/types.d.ts
zodValidators: true, // also emit ./.vibeli/schemas.js
hmrNotifier: true, // dev-only editor bridges (never in the prod bundle)
navigationNotifier: true,
}),
react(),
],
})- Codegen: validates
entities/*.jsonand regenerates./.vibeli/types.d.ts(+ zod) onbuildStartand on change in dev. An invalid declaration fails the build (§3A.6), not a broken type. - Bootstrap: the virtual module
virtual:vibeli/bootstrapexports{ appId, gatewayUrl, contractVersion }(contractVersion from the SDK'sCONTRACT_VERSION). PassappId/gatewayUrlas options or viaVIBELI_APP_ID/VIBELI_GATEWAY_URL. - Notifiers are
apply: 'serve'— dev-only, never shipped.
The generated types make the design invariants compile errors: writing a
server-owned field (created_by) or filtering a non-filterable field will not
type-check.
