Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/cli/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export async function dev(schemaPath: string, options: DevOptions) {
const cwd = process.cwd();

// Resolve the actual project root and schema file
let projectRoot = cwd;
let targetSchemaPath = schemaPath;
let _projectRoot = cwd;
const targetSchemaPath = schemaPath;
let hasPagesDir = false;
let pagesDir = '';
let appConfig: unknown = null;
Expand All @@ -33,15 +33,15 @@ export async function dev(schemaPath: string, options: DevOptions) {

if (existsSync(potentialPagesDir)) {
console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`));
projectRoot = fileDir;
_projectRoot = fileDir;
hasPagesDir = true;
pagesDir = potentialPagesDir;

// Try to load app.json as config
try {
appConfig = parseSchemaFile(absoluteSchemaPath);
console.log(chalk.blue('⚙️ Loaded App Config from app.json'));
} catch (e) {
} catch (_e) {
console.warn('Failed to parse app config');
}
}
Expand Down Expand Up @@ -170,7 +170,7 @@ export async function dev(schemaPath: string, options: DevOptions) {
// We might get the cjs entry, but for aliasing usually fine.
// Better yet, if we can find the package root, but require.resolve gives file.
// Let's just use what require.resolve gives.
// @ts-ignore
// @ts-expect-error - lucidePath is dynamically resolved
viteConfig.resolve.alias['lucide-react'] = lucidePath;
} catch (e) {
console.warn('⚠️ Could not resolve lucide-react automatically:', e);
Expand All @@ -192,7 +192,7 @@ export async function dev(schemaPath: string, options: DevOptions) {
],
},
};
} catch (e) {
} catch (_e) {
console.warn(chalk.yellow('⚠️ Failed to load PostCSS plugins from root node_modules. Styles might not work correctly.'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-kanban/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const KanbanRenderer: React.FC<KanbanRendererProps> = ({ schema }) => {

// Default: Return columns as-is (assuming they have 'cards' inside)
return columns;
}, [schema.columns, schema.data, schema.groupBy]);
}, [schema]);

return (
<Suspense fallback={<Skeleton className="w-full h-[600px]" />}>
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/SchemaRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { forwardRef } from 'react';
import { SchemaNode, ComponentRegistry } from '@object-ui/core';

export const SchemaRenderer = forwardRef<any, { schema: SchemaNode } & Record<string, any>>(({ schema, ...props }, ref) => {
export const SchemaRenderer = forwardRef<any, { schema: SchemaNode } & Record<string, any>>(({ schema, ...props }, _ref) => {
if (!schema) return null;
// If schema is just a string, render it as text
if (typeof schema === 'string') return <>{schema}</>;

// eslint-disable-next-line
const Component = ComponentRegistry.get(schema.type);

if (!Component) {
Expand All @@ -18,13 +17,14 @@ export const SchemaRenderer = forwardRef<any, { schema: SchemaNode } & Record<st
);
}

// Note: We don't forward the ref to the Component because components in the registry
// may not support refs. The SchemaRenderer itself can still receive refs for its own use.
return React.createElement(Component, {
schema,
...(schema.props || {}),
className: schema.className,
'data-obj-id': schema.id,
'data-obj-type': schema.type,
ref,
...props
});
});
Expand Down