Add schema manifest output and CLI#5
Conversation
Introduce committed JSON schema manifest generation for model-driven admin/CMS UIs. Adds a new generator (src/schema-manifest.js) and exports generateSchemaManifest/renderSchemaManifest from the public API and CLI. New config options schemaOutFile and schemaManifest (customizeField hook) are supported, and schemaOutFile is resolved in loadConfig. The sync flow writes the manifest when configured, and a new CLI subcommand jsondb schema manifest [--out <file>] is implemented. Type definitions, Vite plugin options, README, SPEC, and example config are updated, and comprehensive tests were added to verify UI inference, nested/array/relation handling, customizeField overrides/omissions, serialization diagnostics, and CLI output.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR adds schema manifest generation to jsondb, enabling local-first admin/CMS UIs to derive model-driven component metadata from project resources. A new ChangesSchema Manifest Generation
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant generateSchemaManifest
participant renderSchemaManifest
participant customizeField
participant FileSystem
User->>CLI: jsondb schema manifest --out ./schema.json
CLI->>generateSchemaManifest: config, {outFile: ./schema.json}
generateSchemaManifest->>renderSchemaManifest: resources, config
renderSchemaManifest->>customizeField: field context, defaultManifest
customizeField-->>renderSchemaManifest: customized or null manifest
renderSchemaManifest-->>generateSchemaManifest: final manifest object
generateSchemaManifest->>FileSystem: write schema.json
generateSchemaManifest-->>CLI: {manifest, content, outFiles}
CLI-->>User: Generated ./schema.json
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Introduce committed JSON schema manifest generation for model-driven admin/CMS UIs. Adds a new generator (src/schema-manifest.js) and exports generateSchemaManifest/renderSchemaManifest from the public API and CLI. New config options schemaOutFile and schemaManifest (customizeField hook) are supported, and schemaOutFile is resolved in loadConfig. The sync flow writes the manifest when configured, and a new CLI subcommand jsondb schema manifest [--out ] is implemented. Type definitions, Vite plugin options, README, SPEC, and example config are updated, and comprehensive tests were added to verify UI inference, nested/array/relation handling, customizeField overrides/omissions, serialization diagnostics, and CLI output.
Summary by CodeRabbit
New Features
schemaOutFileconfiguration option.schemaManifest.customizeFieldhook to customize or suppress per-field metadata output.jsondb schema manifest [--out]for direct manifest generation.jsondb syncwhen configured.Documentation