Skip to content

Commit ca50703

Browse files
authored
Merge pull request #167 from objectstack-ai/copilot/refactor-object-components
2 parents ce0376a + ac7b1c5 commit ca50703

24 files changed

Lines changed: 134 additions & 1867 deletions

MIGRATION_GUIDE_OBJECTSTACK.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ The following packages now have ObjectStack dependencies:
1010

1111
- `@object-ui/types` → depends on `@objectstack/spec@^0.3.0`
1212
- `@object-ui/core` → depends on `@objectstack/client@^0.3.0` and `@objectstack/spec@^0.3.0`
13-
- `@object-ui/data-objectql` → depends on `@objectstack/client@^0.3.0`
1413

15-
### 2. New Data Source Adapter
14+
### 2. ObjectStack Adapter
1615

17-
A new `ObjectStackAdapter` is now available for seamless integration with ObjectStack Protocol servers.
16+
The `ObjectStackAdapter` in `@object-ui/core` provides seamless integration with ObjectStack Protocol servers.
1817

1918
## For Users
2019

2120
### Using the ObjectStack Adapter
2221

23-
If you want to connect to an ObjectStack backend:
22+
To connect to an ObjectStack backend:
2423

2524
```typescript
2625
import { createObjectStackAdapter } from '@object-ui/core';
@@ -153,7 +152,6 @@ If you encounter any issues:
153152
|---------|---------|------------------|-------------------|
154153
| @object-ui/types | 0.3.0+ | ^0.3.0 | - |
155154
| @object-ui/core | 0.3.0+ | ^0.3.0 | ^0.3.0 |
156-
| @object-ui/data-objectql | 0.3.0+ | - | ^0.3.0 |
157155

158156
## Next Steps
159157

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,16 @@ Object UI is a modular monorepo with packages designed for specific use cases:
261261
|---------|-------------|------|
262262
| **[@object-ui/cli](./packages/cli)** | CLI tool for building apps from JSON schemas | 25KB |
263263
| **[@object-ui/types](./packages/types)** | TypeScript definitions and protocol specs | 10KB |
264-
| **[@object-ui/core](./packages/core)** | Core logic, validation, registry (Zero React) | 20KB |
264+
| **[@object-ui/core](./packages/core)** | Core logic, validation, registry, ObjectStack adapter | 20KB |
265265
| **[@object-ui/react](./packages/react)** | React bindings and `SchemaRenderer` | 15KB |
266266
| **[@object-ui/components](./packages/components)** | Standard UI components (Tailwind + Shadcn) | 50KB |
267267
| **[@object-ui/designer](./packages/designer)** | Visual drag-and-drop schema editor | 80KB |
268-
| **[@object-ui/data-objectql](./packages/data-objectql)** | ObjectQL API adapter for data integration | 15KB |
269268
| **[vscode-extension](./packages/vscode-extension)** | VSCode extension for schema development | 32KB |
270269
271270
**Plugins** (lazy-loaded):
272271
- `@object-ui/plugin-charts` - Chart components (Chart.js)
273272
- `@object-ui/plugin-editor` - Rich text editor components
273+
- `@object-ui/plugin-object` - ObjectStack-aware table and form components
274274
275275
**Developer Tools**:
276276
- **[VSCode Extension](./packages/vscode-extension)** - IntelliSense, live preview, validation, and snippets for Object UI schemas
@@ -279,16 +279,16 @@ Object UI is a modular monorepo with packages designed for specific use cases:
279279
280280
Object UI is designed to work with any backend through its universal DataSource interface:
281281
282-
### ObjectQL Integration
282+
### ObjectStack Integration
283283
284284
```bash
285-
npm install @object-ui/data-objectql
285+
npm install @object-ui/core
286286
```
287287
288288
```typescript
289-
import { ObjectQLDataSource } from '@object-ui/data-objectql';
289+
import { createObjectStackAdapter } from '@object-ui/core';
290290
291-
const dataSource = new ObjectQLDataSource({
291+
const dataSource = createObjectStackAdapter({
292292
baseUrl: 'https://api.example.com',
293293
token: 'your-auth-token'
294294
});
@@ -297,8 +297,6 @@ const dataSource = new ObjectQLDataSource({
297297
<SchemaRenderer schema={schema} dataSource={dataSource} />
298298
```
299299
300-
[**ObjectQL Integration Guide →**](./docs/integration/objectql.md)
301-
302300
### Custom Data Sources
303301
304302
You can create adapters for any backend (REST, GraphQL, Firebase, etc.) by implementing the `DataSource` interface:

packages/core/src/adapters/objectstack-adapter.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,24 @@ export class ObjectStackAdapter<T = any> implements DataSource<T> {
185185
return options;
186186
}
187187

188+
/**
189+
* Get object schema/metadata from ObjectStack.
190+
*
191+
* @param objectName - Object name
192+
* @returns Promise resolving to the object schema
193+
*/
194+
async getObjectSchema(objectName: string): Promise<any> {
195+
await this.connect();
196+
197+
try {
198+
const schema = await this.client.meta.getObject(objectName);
199+
return schema;
200+
} catch (error) {
201+
console.error(`Failed to fetch schema for ${objectName}:`, error);
202+
throw error;
203+
}
204+
}
205+
188206
/**
189207
* Get access to the underlying ObjectStack client for advanced operations.
190208
*/

packages/data-objectql/CHANGELOG.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)