Repository navigation
Add missing documentation files for mapping and block schemas - #353
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
aa54256
into
dependabot/npm_and_yarn/production-dependencies-29f96a6100
There was a problem hiding this comment.
Pull request overview
This PR adds missing reference documentation for the data mapping protocol and UI block/component props to fix link checker failures and bring them in line with existing reference pages.
Changes:
- Added
mapping.mdxdocumenting the ETL Mapping and FieldMapping schemas, including transform types and ETL-related options. - Added
block.mdxdocumenting the UI block/component props map and detailed prop tables for page and record-oriented components.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| content/docs/references/data/mapping.mdx | Adds reference docs for MappingSchema, FieldMappingSchema, and TransformType with property tables and usage examples. |
| content/docs/references/ui/block.mdx | Adds reference docs for ComponentPropsMap and the various Page*/Record* component prop schemas. |
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **name** | `string` | ✅ | Mapping unique name (lowercase snake_case) | | ||
| | **label** | `string` | optional | Human readable label | | ||
| | **sourceFormat** | `Enum<'csv' \| 'json' \| 'xml' \| 'sql'>` | optional | Source data format (default: 'csv') | | ||
| | **targetObject** | `string` | ✅ | Target Object Name | | ||
| | **fieldMapping** | `object[]` | ✅ | Column Mappings | | ||
| | **mode** | `Enum<'insert' \| 'update' \| 'upsert'>` | optional | Data operation mode (default: 'insert') | | ||
| | **upsertKey** | `string[]` | optional | Fields to match for upsert (e.g. email) | | ||
| | **extractQuery** | `object` | optional | Query to run for export only | |
There was a problem hiding this comment.
The Mapping properties table currently has || at the beginning of the header and row lines, unlike other reference docs that use a single |, which will cause the table to render incorrectly. Please normalize this to standard Markdown table syntax so the schema properties render properly.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **type** | `Enum<'line' \| 'card' \| 'pill'>` | optional | Tab type (default: 'line') | | ||
| | **position** | `Enum<'top' \| 'left'>` | optional | Tab position (default: 'top') | | ||
| | **items** | `object[]` | ✅ | Tab items | | ||
|
|
There was a problem hiding this comment.
The PageTabsProps properties table also uses || at the start of each row instead of a single |, which will break the table formatting in the rendered docs. Update this table to match the standard Markdown table syntax used elsewhere in the reference docs.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **label** | `string` | ✅ | Tab label | | ||
| | **icon** | `string` | optional | Tab icon | | ||
| | **children** | `any[]` | ✅ | Child components | |
There was a problem hiding this comment.
In the Tab Item Properties table, the header and data rows start with || rather than a single |, so the table will not render correctly. Please adjust these rows to use a single leading | to be consistent with the rest of the documentation.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **columns** | `Enum<'1' \| '2' \| '3' \| '4'>` | optional | Number of columns (default: '2') | | ||
| | **layout** | `Enum<'auto' \| 'custom'>` | optional | Layout mode (default: 'auto') | | ||
| | **sections** | `string[]` | optional | Section IDs to show (for custom layout) | |
There was a problem hiding this comment.
For the RecordDetailsProps properties table, each row begins with || instead of a single |, making the table inconsistent with others and potentially invalid Markdown. Please normalize these rows to use a single leading |.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **objectName** | `string` | ✅ | Related object name | | ||
| | **relationshipField** | `string` | ✅ | Field on related object that points to this record | | ||
| | **columns** | `string[]` | ✅ | Fields to display | | ||
| | **sort** | `string` | optional | Sort order | | ||
| | **limit** | `number` | optional | Maximum number of records (default: 5) | |
There was a problem hiding this comment.
The RecordRelatedListProps properties table also has rows starting with || rather than a single |, which will interfere with proper table rendering. Update the header and all data rows here to use a single leading | as in other reference tables.
| ```typescript | ||
| import { MappingSchema, FieldMappingSchema, TransformType } from '@objectstack/spec/data'; | ||
| import type { Mapping, FieldMapping } from '@objectstack/spec/data'; | ||
|
|
||
| // Validate data | ||
| const result = MappingSchema.parse(data); | ||
| ``` |
There was a problem hiding this comment.
The TypeScript Usage example imports MappingSchema, FieldMappingSchema, TransformType, Mapping, and FieldMapping from @objectstack/spec/data, but packages/spec/src/data/index.ts does not currently re-export mapping.zod.ts, so this import path will fail. Either update the data index to export these symbols or adjust the example to import directly from the mapping.zod module so that the snippet reflects the actual public API.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **title** | `string` | ✅ | Page title | | ||
| | **subtitle** | `string` | optional | Page subtitle | | ||
| | **icon** | `string` | optional | Icon name | | ||
| | **breadcrumb** | `boolean` | optional | Show breadcrumb (default: true) | | ||
| | **actions** | `string[]` | optional | Action IDs to show in header | |
There was a problem hiding this comment.
In the PageHeaderProps properties table, all rows begin with || rather than a single |, which is inconsistent with other docs and will prevent the Markdown table from rendering correctly. Please switch these rows (header, separator, and data) to use a single leading |.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **title** | `string` | optional | Card title | | ||
| | **bordered** | `boolean` | optional | Show border (default: true) | | ||
| | **actions** | `string[]` | optional | Action IDs | | ||
| | **children** | `any[]` | ✅ | Card content | |
There was a problem hiding this comment.
The PageCardProps properties table is using || at the beginning of each row instead of the standard single |, which is likely to break Markdown table rendering. This should be updated to use a single leading | for the header, separator, and all data rows.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **source** | `string \| string[]` | ✅ | Source column header(s) | | ||
| | **target** | `string \| string[]` | ✅ | Target object field(s) | | ||
| | **transform** | `Enum<'none' \| 'constant' \| 'lookup' \| 'split' \| 'join' \| 'javascript' \| 'map'>` | optional | Transformation type (default: 'none') | | ||
| | **params** | `object` | optional | Configuration for transform | |
There was a problem hiding this comment.
In the FieldMapping properties table, each row starts with || instead of the single leading | used elsewhere in the docs, which will prevent this table from rendering correctly as Markdown. Please update the header and data rows here to use a single | so the table formats consistently with other reference pages.
| | Property | Type | Required | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | **value** | `any` | optional | Value for constant transform | | ||
| | **object** | `string` | optional | Lookup Object for lookup transform | | ||
| | **fromField** | `string` | optional | Match on field (e.g. "name") for lookup | | ||
| | **toField** | `string` | optional | Value to take (e.g. "_id") for lookup | | ||
| | **autoCreate** | `boolean` | optional | Create if missing for lookup | | ||
| | **valueMap** | `Record<string, any>` | optional | Value mapping for map transform (e.g. { "Open": "draft" }) | | ||
| | **separator** | `string` | optional | Separator for split/join transforms | | ||
|
|
There was a problem hiding this comment.
The Transform Params Properties table also uses || at the start of each row, which is inconsistent with the rest of the documentation and likely breaks table rendering. Align this table with the standard Markdown table syntax by using a single leading | for the header, separator, and data rows.
Link checker failing on workflow run 21426667831 due to missing MDX files referenced in index pages.
Changes
content/docs/references/data/mapping.mdx- Documents ETL data mapping schema (field transforms, upsert modes, error policies)content/docs/references/ui/block.mdx- Documents UI component props map (page/record/nav/AI components)Both follow existing doc format: frontmatter, TypeScript usage, property tables with types and descriptions.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/objectstack-ai/spec/commits/fa54cc1af6ff4a575f4a13a913a1463d3876d607/check-runs/usr/bin/curl curl -s -H Authorization: token REDACTED ons lib/rustlib/x86_--eh-frame-hdr lib/rustlib/x86_-m 684c58fe.async_sdirname 684c58fe.async_s/usr/bin/lesspipe 684c58fe.async_s--as-needed 684c58fe.async_s-shared lib/�� 684c58fe.6eb2c2orelro lib/rustlib/x86_-o -1949cf8c6b5b557/tmp/cargo-installtUvwvB/release/deps/libconst_format_proc_macros-2be9e5547ea437/tmp/cargo-installtUvwvB/release/deps/clap_derive-a0906f06c25dcade.clap_derive.6290335fb4afbcdf-cgu.13.rcgu.o ib rlib aea84.rlib b8c66b1.rlib(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.