How lljj-x/vue-json-schema-form works
Project type and purpose
• This is a monorepo (managed by Lerna + Yarn) for “vue-json-schema-form,” a JSON-Schema-driven form generator library targeting Vue2 and Vue3 ecosystems. It contains:
• Core form engine and utilities under packages/lib
• Framework-specific adapters (Vue2/Vue3 + multiple UI frameworks) under packages/lib/vue2 & packages/lib/vue3
• Demo applications in packages/demo (v1, v2, v3)
• Documentation site under packages/docs
• CI/CD workflows in .github/workflows
• Root-level config: package.json, lerna.json, build scripts, .gitignore, etc.
File structure
• Top-level directories:
• packages/lib: core engine, utils, and UI-framework wrappers
• packages/demo: three demo variants (demo-common shared components + three demo apps)
• packages/docs: VuePress-based documentation & site assets/plugins
• packages/demo/demo-v2 & demo-v3: Webpack/Vue CLI demo apps for Playground, Schema-generator, Vue-editor
• Build & config files: Babel, PostCSS, ESLint, Vue CLI configs, demo scripts under each demo package
• CI workflows: automated docs deploy, demo build, publishing
README for additional insights
• Confirms supported UI frameworks (ElementUI, iView, Element Plus, Antdv, NaiveUI)
• Usage: user supplies JSON Schema → core engine + UI wrappers → rendered Vue form with full validation (AJV)
• Demo commands: yarn run demo:dev, entry points for Playground, Schema-generator, Vue-editor
a. Main components
• Core JSON-Schema Form Engine (packages/lib/utils, schema code)
• Vue2 Adapters (packages/lib/vue2/vue2-core)
• Vue2 UI Wrappers
• Element-Ui (vue2-form-element)
• Iview3 (vue2-form-iview3)
• Vue3 Adapters (packages/lib/vue3/vue3-core)
• Vue3 UI Wrappers
• Element-Plus (vue3-form-element)
• Antdv (vue3-form-ant)
• NaiveUI (vue3-form-naive)
• Demo Apps (packages/demo/*):
• Playground (index)
• Schema Generator
• H5 Vue-editor
• Docs Site (packages/docs): VuePress with custom plugins
• CI/CD Pipeline (.github/workflows)
• External Services: NPM Registry, CDN (EdgeOne)
b. Relationships & interactions
• Core Engine → imported by Vue2/Vue3 adapters
• Adapters + UI wrappers → published as npm packages
• Demo Apps & Docs → import published packages (or local packages during development)
• CI/CD → on commit: run build for lib, run demo build, deploy docs to GitHub Pages, publish packages
• End-users → pull npm packages → integrate into their Vue apps
c. Architectural patterns & design principles
• Monorepo modularization via Lerna: code reuse & isolation of concerns
• Adapter pattern: core engine is UI-agnostic; adapters wrap specific UI library widgets
• Plugin architecture in docs: VuePress custom plugins to demo components
• Single source of truth: JSON Schema defines both UI and validation rules
d. Relevant technologies & frameworks
• Lerna & Yarn Workspaces (monorepo management)
• Vue2 / Vue3
• ElementUI, iView, Element Plus, Ant Design Vue, NaiveUI
• AJV for JSON-Schema validation
• Babel, PostCSS, Webpack / Vue CLI for builds
• VuePress for docs
• GitHub Actions for CI/CD
Detailed capturing of architectural elements
• lerna.json orchestrating bootstrapping → dependency linking between packages
• Demo scripts under each demo-v2/scripts/* invoking Webpack entries
• How VuePress plugins under packages/docs/.vuepress/plugins hook into markdown rendering
• Schema flow: JSON Schema → core parser → fields map → renderers → UI components