Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Enhance metadata specifications and component system - #71

Merged
hotlong merged 9 commits into
mainfrom
copilot/improve-metadata-specifications
Jan 15, 2026
Merged

hotlong merged 9 commits into
mainfrom
copilot/improve-metadata-specifications

Conversation

Copilot AI commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

完善基础元数据规范和控件体系 (Enhance Metadata Specifications and Component System)

Based on the goal of developing complete projects using JSON, this PR improves the fundamental metadata specifications and component system.

Phase 1: Enhance Type Definitions ✅

  • Analyze current type system structure
  • Identify gaps in metadata specifications
  • Add missing common properties to BaseSchema (visible, hidden, disabled, name, label, description, placeholder, style, testId, ariaLabel)
  • Add comprehensive JSDoc documentation
  • Create CRUD operation schemas
  • Create API integration schemas

Phase 2: Component System Features ✅

  • Add CRUD component schema with full Create/Read/Update/Delete support
  • Add ActionSchema for button actions with API integration
  • Add DetailSchema for record detail views
  • Add filter, pagination, and toolbar configurations
  • Add EventHandler system for dynamic interactions
  • Add DataFetchConfig for automatic data loading
  • Add Expression system for dynamic values

Phase 3: Improve Protocol Specifications ✅

  • Create comprehensive JSON schema examples (user-management, api-integration)
  • Document component usage patterns (CRUD protocol, API integration)
  • Add validation schemas for runtime checking
  • Create CRUD protocol specification
  • Create API integration guide

Phase 4: Developer Experience ✅

  • Add schema validation utilities (validateSchema, assertValidSchema, isValidSchema)
  • Create schema builder helpers (Form, CRUD, Button, Input, Card, Grid, Flex builders)
  • Improve TypeScript type inference with composite projects
  • Add schema composition utilities via fluent builders

Phase 5: Documentation & Examples ✅

  • Update protocol documentation (CRUD, API integration)
  • Create comprehensive component catalog examples
  • Add real-world application examples (user management, API integration)
  • Create best practices guide

Key Features Added

1. Enhanced Type Definitions

  • Extended BaseSchema with conditional rendering properties (visibleOn, hiddenOn, disabledOn)
  • Added semantic properties (name, label, description, placeholder)
  • Added accessibility properties (ariaLabel, testId)
  • New CRUD operation schemas for complete data management
  • New API integration schemas for dynamic data and events

2. Schema Validation

import { validateSchema, assertValidSchema } from '@object-ui/core';

const result = validateSchema(mySchema);
if (!result.valid) {
  console.error(result.errors);
}

3. Schema Builders

import { crud, form, button } from '@object-ui/core/builder';

const userCRUD = crud()
  .resource('user')
  .api('/api/users')
  .columns([...])
  .enableCreate()
  .enableUpdate()
  .enableDelete()
  .pagination(20)
  .build();

4. Comprehensive Examples

  • user-management: Complete CRUD interface with filters, pagination, batch actions
  • api-integration: API calls, event handling, data fetching, conditional rendering

5. Documentation

  • CRUD Protocol: Complete specification for CRUD components
  • API Integration Guide: How to fetch data, submit forms, handle events
  • Best Practices: Comprehensive guide for building maintainable apps

Summary

✅ All 5 phases complete!

This PR delivers a comprehensive enhancement to Object UI's metadata specifications and component system, enabling developers to build complete, production-ready applications using pure JSON schemas with full type safety and excellent developer experience.

See ENHANCEMENT_SUMMARY.md for detailed documentation of all changes.

Migration Guide

No breaking changes. All changes are additive and backward compatible. Existing schemas continue to work as before. New features are opt-in.

Build Status

✅ All packages build successfully with pnpm build
✅ All packages lint successfully with pnpm lint (0 errors)
✅ TypeScript composite projects configured correctly
✅ Vercel build passing

Original prompt

根据使用json开发完整项目的目标,完善基础的元数据规范和控件体系。


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Jan 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectui-playground Ready Ready Preview, Comment Jan 15, 2026 6:58am

- Add comprehensive properties to BaseSchema (visible, hidden, disabled, name, label, description, etc.)
- Create new crud.ts with CRUD operation schemas (CRUDSchema, DetailSchema, ActionSchema)
- Create new api.ts with API integration and event handling schemas
- Support complete CRUD interfaces with filters, pagination, toolbar
- Add event handler configuration for API calls, navigation, dialogs
- Add data fetching configuration for dynamic data loading
- Export all new types from index.ts

Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
@xuyushun441-sys

Copy link
Copy Markdown
Contributor

@copilot Continue

- Add schema-validator.ts with validateSchema, assertValidSchema, isValidSchema functions
- Add schema-builder.ts with fluent builders for Form, CRUD, Button, Input, Card, Grid, Flex
- Export validation and builder utilities from core package
- Add @object-ui/types dependency to core package
- Update tsconfig with composite projects and path mappings
- Create comprehensive BEST_PRACTICES.md guide
- Create user-management and api-integration example apps
- Create CRUD protocol documentation
- Create API integration guide
- Update examples README with new examples

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>

Copilot AI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Continue

I've completed the enhancement of the metadata specifications and component system! Here's what was added:

✅ Completed Work

1. Enhanced Type Definitions (commit 91c498c)

  • Extended BaseSchema with conditional rendering (visibleOn, hiddenOn, disabledOn)
  • Added CRUD operation schemas (CRUDSchema, ActionSchema, DetailSchema)
  • Added API integration schemas (EventHandler, DataFetchConfig, APIRequest)

2. Developer Tools (commit 4f68e0e)

  • Schema Validation: validateSchema(), assertValidSchema(), isValidSchema() functions
  • Schema Builders: Fluent API for building schemas programmatically
    const userCRUD = crud()
      .resource('user')
      .api('/api/users')
      .columns([...])
      .enableCreate()
      .enableUpdate()
      .pagination(20)
      .build();

3. Comprehensive Examples

  • user-management: Full CRUD interface with filters, pagination, batch actions (8.9KB JSON)
  • api-integration: API calls, events, data fetching, conditional rendering (11KB JSON)

4. Documentation

  • CRUD Protocol: Complete specification (8.8KB)
  • API Integration Guide: Data fetching, events, transformations (9.8KB)
  • Best Practices Guide: 11KB of patterns and recommendations

All phases 1-5 from the PR description are now complete. The system is ready for building complete JSON-driven applications!

- Add ENHANCEMENT_SUMMARY.md documenting all completed work
- Complete all 5 phases of the enhancement plan
- Added 2 new comprehensive examples (user-management, api-integration)
- Added 3 new documentation guides (CRUD, API, Best Practices)
- Added schema validation and builder utilities
- All changes are backward compatible

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance metadata specifications and controls system Enhance metadata specifications and component system Jan 15, 2026
Copilot AI requested a review from xuyushun441-sys January 15, 2026 05:17
@huangyiirene
huangyiirene requested review from Copilot and removed request for huangyiirene and xuyushun441-sys January 15, 2026 05:26
- Replace Function type with proper function signature in api.ts
- Remove generated .d.ts and .js files from src directory
- Update .gitignore to prevent generated files in src
- All packages now pass lint with 0 errors (only warnings remain)
- Fixes: utils?: Record<string, Function> -> utils?: Record<string, (...args: any[]) => any>

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>

Copilot AI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix pnpm lint

Fixed the pnpm lint! The issue was using the Function type in the API schemas, which ESLint prohibits.

What was fixed (commit 629f6e7):

  • Replaced Function type with proper function signature: (...args: any[]) => any
  • Removed accidentally committed generated .d.ts and .js files from src directory
  • Updated .gitignore to prevent generated files in src

Result:
✅ All packages pass pnpm lint with 0 errors
✅ Only warnings remain (mostly about any types which are intentional for flexible schemas)

@github-actions

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Gzipped
components (index.js) 1719.04KB 345.21KB
core (index.js) 0.27KB 0.14KB
data-objectql (ObjectQLDataSource.js) 11.43KB 2.76KB
data-objectql (hooks.js) 5.43KB 1.32KB
data-objectql (index.js) 0.42KB 0.26KB
designer (index.js) 0.83KB 0.32KB
plugin-charts (AdvancedChartImpl-CGlEUqvZ.js) 47.44KB 11.16KB
plugin-charts (BarChart-C9og8_1e.js) 525.61KB 132.50KB
plugin-charts (ChartImpl-BO5n60y7.js) 4.87KB 1.95KB
plugin-charts (index-DR7MvR2L.js) 23.55KB 6.93KB
plugin-charts (index.js) 0.21KB 0.16KB
plugin-editor (MonacoImpl-DCiwKyYW.js) 18.97KB 5.77KB
plugin-editor (index-CpP31686.js) 21.90KB 6.66KB
plugin-editor (index.js) 0.19KB 0.15KB
plugin-kanban (KanbanImpl-CI3LQYrL.js) 76.88KB 20.43KB
plugin-kanban (index-DNMbL6y1.js) 23.20KB 6.83KB
plugin-kanban (index.js) 0.18KB 0.15KB
plugin-markdown (MarkdownImpl-DcFjhoD-.js) 256.34KB 64.33KB
plugin-markdown (index-D4WUb7Qy.js) 21.42KB 6.50KB
plugin-markdown (index.js) 0.19KB 0.15KB
react (SchemaRenderer.js) 1.00KB 0.51KB
react (index.js) 0.13KB 0.11KB
react (index.test.js) 0.14KB 0.14KB
types (api.js) 0.24KB 0.19KB
types (base.js) 0.24KB 0.19KB
types (complex.js) 0.17KB 0.16KB
types (crud.js) 0.24KB 0.20KB
types (data-display.js) 0.19KB 0.17KB
types (data.js) 0.23KB 0.18KB
types (disclosure.js) 0.18KB 0.17KB
types (feedback.js) 0.18KB 0.16KB
types (form.js) 0.17KB 0.16KB
types (index.js) 1.46KB 0.74KB
types (layout.js) 0.23KB 0.18KB
types (navigation.js) 0.17KB 0.16KB
types (overlay.js) 0.18KB 0.16KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@github-actions

Copy link
Copy Markdown
Contributor

✅ All checks passed!

  • ✅ Type check passed
  • ✅ Tests passed
  • ✅ Lint check completed

@hotlong
hotlong merged commit ace3702 into main Jan 15, 2026
Copilot AI added a commit that referenced this pull request Feb 16, 2026
- Export TimelineConfig and TimelineConfigSchema from @object-ui/types (#64)
- Export NavigationConfig and NavigationConfigSchema from @object-ui/types
- Update ObjectTimeline to use spec-compliant startDateField with backward compat (#72)
- Add endDateField, groupByField, colorField, scale to ObjectTimeline
- Add navigation support to ObjectGallery via useNavigationOverlay (#66)
- Implement navigation.view property in useNavigationOverlay hook (#68)
- Implement emptyState spec property in ListView (#71)
- Add emptyState to ListViewSchema type
- Add tests for all new functionality

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI removed the request for review from Copilot March 23, 2026 18:55
os-sales added a commit that referenced this pull request Sep 8, 2026
… amend #8222's stale live-figure guidance

objectui#8458 — `zod-mirror-parity.test.ts`'s header said the objectui#7760 move
took "19 keys across 16 pairs". Every other figure in that paragraph is read by a
`headerFigures` pin and moved correctly with PR #8354; the pairs figure was the one
no spelling reached, so it compiled and tested green while wrong.

Re-derived rather than adopted: this file's own `ledgerEntryMembers('WiderThanDeclared')`
was sliced out of the source, transpiled and run over the file at `645ecb98c` and
`a480f797a` (PR #8354's parent and its merge), diffing entry -> key pairs. 19 keys
left and 3 entered, across 18 distinct entries — 13 emptied, 5 reduced. Both
movements close against figures already pinned at those revisions (52 - 19 + 3 = 36
keys; 34 - 13 + 2 = 23 entries). `16` is neither reading.

The figure is now pinned, following the precedent of the "N of the registered pairs
carry TYPE drift TODAY" spelling already in this file, and "pairs" is defined where
it stands: every entry the move TOUCHED, with `emptied` as the subset that lost its
whole content. The pin reads only the sentence — the movement is a HISTORICAL
reading of two fixed trees, so nothing compares it to the live ledger.

objectui#8248 — objectui#8222's exclusion note still called the seed decomposition a
LIVE figure, which objectui#8243 made historical. Per the maintainer ruling (decision
batch #71) the guidance clause is amended and the two measurement-record clauses are
untouched; the record-vs-guidance rule is written once, in the file header.

Test-only: the file is under `__tests__/`, excluded by the package build tsconfig
and absent from its published `files`. Declared with an empty-frontmatter changeset.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
os-sales added a commit that referenced this pull request Sep 8, 2026
… amend #8222's stale live-figure guidance

objectui#8458 — `zod-mirror-parity.test.ts`'s header said the objectui#7760 move
took "19 keys across 16 pairs". Every other figure in that paragraph is read by a
`headerFigures` pin and moved correctly with PR #8354; the pairs figure was the one
no spelling reached, so it compiled and tested green while wrong.

Re-derived rather than adopted: this file's own `ledgerEntryMembers('WiderThanDeclared')`
was sliced out of the source, transpiled and run over the file at `645ecb98c` and
`a480f797a` (PR #8354's parent and its merge), diffing entry -> key pairs. 19 keys
left and 3 entered, across 18 distinct entries — 13 emptied, 5 reduced. Both
movements close against figures already pinned at those revisions (52 - 19 + 3 = 36
keys; 34 - 13 + 2 = 23 entries). `16` is neither reading.

The figure is now pinned, following the precedent of the "N of the registered pairs
carry TYPE drift TODAY" spelling already in this file, and "pairs" is defined where
it stands: every entry the move TOUCHED, with `emptied` as the subset that lost its
whole content. The pin reads only the sentence — the movement is a HISTORICAL
reading of two fixed trees, so nothing compares it to the live ledger.

objectui#8248 — objectui#8222's exclusion note still called the seed decomposition a
LIVE figure, which objectui#8243 made historical. Per the maintainer ruling (decision
batch #71) the guidance clause is amended and the two measurement-record clauses are
untouched; the record-vs-guidance rule is written once, in the file header.

Test-only: the file is under `__tests__/`, excluded by the package build tsconfig
and absent from its published `files`. Declared with an empty-frontmatter changeset.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 9, 2026
…pairs figure, amend objectstack-ai#8222's stale live-figure guidance (objectstack-ai#8575)

objectui#8458 — `zod-mirror-parity.test.ts`'s header said the objectui#7760 move
took "19 keys across 16 pairs". Every other figure in that paragraph is read by a
`headerFigures` pin and moved correctly with PR objectstack-ai#8354; the pairs figure was the one
no spelling reached, so it compiled and tested green while wrong.

Re-derived rather than adopted: this file's own `ledgerEntryMembers('WiderThanDeclared')`
was sliced out of the source, transpiled and run over the file at `645ecb98c` and
`a480f797a` (PR objectstack-ai#8354's parent and its merge), diffing entry -> key pairs. 19 keys
left and 3 entered, across 18 distinct entries — 13 emptied, 5 reduced. Both
movements close against figures already pinned at those revisions (52 - 19 + 3 = 36
keys; 34 - 13 + 2 = 23 entries). `16` is neither reading.

The figure is now pinned, following the precedent of the "N of the registered pairs
carry TYPE drift TODAY" spelling already in this file, and "pairs" is defined where
it stands: every entry the move TOUCHED, with `emptied` as the subset that lost its
whole content. The pin reads only the sentence — the movement is a HISTORICAL
reading of two fixed trees, so nothing compares it to the live ledger.

objectui#8248 — objectui#8222's exclusion note still called the seed decomposition a
LIVE figure, which objectui#8243 made historical. Per the maintainer ruling (decision
batch objectstack-ai#71) the guidance clause is amended and the two measurement-record clauses are
untouched; the record-vs-guidance rule is written once, in the file header.

Test-only: the file is under `__tests__/`, excluded by the package build tsconfig
and absent from its published `files`. Declared with an empty-frontmatter changeset.


Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE

Co-authored-by: os-sales <sales@objectstack.ai>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 464b1015 Deployed Jan 15, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants