Skip to content

Commit c70afff

Browse files
committed
feat: enhance configuration and layout registration with namespaces and debugging logs
1 parent 3cd16b1 commit c70afff

4 files changed

Lines changed: 40 additions & 6 deletions

File tree

apps/console/objectstack.shared.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import { defineConfig } from './src/config';
2-
import crmConfig from '@object-ui/example-crm/objectstack.config';
3-
import todoConfig from '@object-ui/example-todo/objectstack.config';
4-
import kitchenSinkConfig from '@object-ui/example-kitchen-sink/objectstack.config';
2+
import crmConfigImport from '@object-ui/example-crm/objectstack.config';
3+
import todoConfigImport from '@object-ui/example-todo/objectstack.config';
4+
import kitchenSinkConfigImport from '@object-ui/example-kitchen-sink/objectstack.config';
5+
6+
const crmConfig = (crmConfigImport as any).default || crmConfigImport;
7+
const todoConfig = (todoConfigImport as any).default || todoConfigImport;
8+
const kitchenSinkConfig = (kitchenSinkConfigImport as any).default || kitchenSinkConfigImport;
9+
10+
// Debug check for definition loading
11+
console.log('DEBUG: CRM Objects Count:', crmConfig.objects?.length);
12+
if (crmConfig.objects?.length) {
13+
console.log('DEBUG: CRM Objects:', crmConfig.objects.map((o: any) => o.name || o.id));
14+
} else {
15+
// console.log('DEBUG: CRM Config content:', JSON.stringify(crmConfig, null, 2));
16+
}
517

618
export const sharedConfig = {
719
// ============================================================================

apps/console/vite.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,17 @@ export default defineConfig({
8989
inline: [/@objectstack/]
9090
}
9191
}
92+
},
93+
server: {
94+
proxy: {
95+
'/api': {
96+
target: 'http://localhost:3000',
97+
changeOrigin: true
98+
},
99+
'/graphql': {
100+
target: 'http://localhost:3000',
101+
changeOrigin: true
102+
}
103+
}
92104
}
93105
});

packages/components/src/renderers/navigation/sidebar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ ComponentRegistry.register('sidebar-header',
7575
<SidebarHeader {...props}>{renderChildren(schema.body)}</SidebarHeader>
7676
),
7777
{
78+
namespace: 'ui',
7879
label: 'Sidebar Header',
7980
defaultChildren: [
8081
{ type: 'text', content: 'Sidebar Header' }
@@ -87,6 +88,7 @@ ComponentRegistry.register('sidebar-content',
8788
<SidebarContent {...props}>{renderChildren(schema.body)}</SidebarContent>
8889
),
8990
{
91+
namespace: 'ui',
9092
label: 'Sidebar Content',
9193
defaultChildren: [
9294
{ type: 'sidebar-group' }
@@ -123,6 +125,7 @@ ComponentRegistry.register('sidebar-menu',
123125
<SidebarMenu {...props}>{renderChildren(schema.body)}</SidebarMenu>
124126
),
125127
{
128+
namespace: 'ui',
126129
label: 'Sidebar Menu',
127130
defaultChildren: [
128131
{ type: 'sidebar-menu-item' },
@@ -136,6 +139,7 @@ ComponentRegistry.register('sidebar-menu-item',
136139
<SidebarMenuItem {...props}>{renderChildren(schema.body)}</SidebarMenuItem>
137140
),
138141
{
142+
namespace: 'ui',
139143
label: 'Sidebar Menu Item',
140144
defaultChildren: [
141145
{ type: 'sidebar-menu-button' }
@@ -171,6 +175,7 @@ ComponentRegistry.register('sidebar-footer',
171175
<SidebarFooter {...props}>{renderChildren(schema.body)}</SidebarFooter>
172176
),
173177
{
178+
namespace: 'ui',
174179
label: 'Sidebar Footer',
175180
defaultChildren: [
176181
{ type: 'text', content: 'Footer' }
@@ -183,6 +188,7 @@ ComponentRegistry.register('sidebar-inset',
183188
<SidebarInset {...props}>{renderChildren(schema.body)}</SidebarInset>
184189
),
185190
{
191+
namespace: 'ui',
186192
label: 'Sidebar Inset',
187193
defaultChildren: [
188194
{ type: 'div', className: 'p-4', body: [{ type: 'text', content: 'Main content area' }] }

packages/layout/src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export * from './SidebarNav';
1818

1919
export function registerLayout() {
2020
ComponentRegistry.register('page-header', PageHeader, {
21+
namespace: 'layout',
2122
label: 'Page Header',
2223
category: 'Layout',
2324
inputs: [
@@ -27,22 +28,25 @@ export function registerLayout() {
2728
});
2829

2930
// Alias for protocol compliance
30-
ComponentRegistry.register('page:header', PageHeader);
31+
ComponentRegistry.register('page:header', PageHeader, { namespace: 'layout' });
3132

3233
// Page Card
3334
ComponentRegistry.register('page:card', PageCard, {
35+
namespace: 'layout',
3436
label: 'Page Card',
3537
category: 'Layout',
3638
isContainer: true
3739
});
3840

3941
ComponentRegistry.register('app-shell', AppShell, {
40-
label: 'App Shell',
41-
category: 'Layout',
42+
namespace: 'layout',
43+
label: 'App Shell',
44+
category: 'Layout',
4245
});
4346

4447
// Core Page Renderer
4548
ComponentRegistry.register('page', Page, {
49+
namespace: 'layout',
4650
label: 'Standard Page',
4751
category: 'Layout',
4852
isContainer: true

0 commit comments

Comments
 (0)