@smartfront/vite
v0.2.2
Published
Smartfront vite operations SDK
Readme
@smartfront/vite
Optional Vite convenience plugin for @operation comments. Explicit metadata works without a plugin and is recommended for other bundlers.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { smartfront } from '@smartfront/vite';
export default defineConfig({ plugins: [smartfront(), react()] });/**
* @operation updateStatus
* @description Update an item status
* @param {string} itemId
* @param {"active"|"archived"} status
*/
useSmartOperation('updateStatus', ({ itemId, status }) => store.updateStatus(itemId, status));The TypeScript AST identifies adjacent literal-name registrations, including Vue script setup, and injects normalized metadata into each call with source maps. Existing explicit options override comment metadata. No global registry or manual serialization is needed. Computed/aliased operation names should use explicit options.
Workspace build/test: npm run build -w @smartfront/vite, npm run test -w @smartfront/vite after building core.
