@skmtc/gen-shadcn-form@0.0.48
latest
skmtc/skmtc-generatorsShadcn Form generator for @skmtc/core
This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers




JSR Score
29%
Published
3 weeks ago (0.0.48)
import { toOperationEntry, type IsSupportedOperationConfigArgs } from 'jsr:@skmtc/core@^0.0.974' import type { EnrichmentSchema } from './enrichments.ts' import { toEnrichmentSchema } from './enrichments.ts' import { ShadcnForm } from './ShadcnForm.ts' import denoJson from '../deno.json' with { type: 'json' } export const ShadcnFormEntry = toOperationEntry<EnrichmentSchema>({ id: denoJson.name, isSupported({ operation }: IsSupportedOperationConfigArgs<EnrichmentSchema>) { return ( ['post', 'put', 'patch'].includes(operation.method) && Boolean(operation.requestBody?.resolve()?.toSchema()?.resolve().type === 'object') ) }, transform({ context, operation }) { context.insertOperation(ShadcnForm, operation) }, toPreviewModule: ({ operation }) => ({ name: ShadcnForm.toIdentifier(operation).name, exportPath: ShadcnForm.toExportPath(operation), group: 'forms' }), toEnrichmentSchema })