Skip to content

Commit 492a2ae

Browse files
committed
refactor: clean up imports and update TypeScript configuration for better clarity
1 parent 61fe125 commit 492a2ae

File tree

8 files changed

+13
-21
lines changed

8 files changed

+13
-21
lines changed

apps/console/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BrowserRouter, Routes, Route, Navigate, useNavigate, useParams, useLocation } from 'react-router-dom';
1+
import { BrowserRouter, Routes, Route, Navigate, useNavigate, useLocation } from 'react-router-dom';
22
import { useState, useEffect } from 'react';
33
import { ObjectStackClient } from '@objectstack/client';
44
import { AppShell } from '@object-ui/layout';

apps/console/src/__tests__/ServerDefinitions.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
88
import { render, screen } from '@testing-library/react';
99
import '@testing-library/jest-dom';
10-
import { SchemaRenderer } from '@object-ui/react';
10+
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
1111
import type { AppSchema } from '@object-ui/types';
1212
import { startMockServer, stopMockServer } from '../mocks/server';
1313

@@ -131,7 +131,11 @@ describe('Server-Driven Definitions', () => {
131131
};
132132

133133
// Test that the schema can be rendered
134-
render(<SchemaRenderer schema={pageSchema} />);
134+
render(
135+
<SchemaRendererProvider dataSource={{}}>
136+
<SchemaRenderer schema={pageSchema} />
137+
</SchemaRendererProvider>
138+
);
135139

136140
expect(screen.getByText('Contact List')).toBeInTheDocument();
137141
});

apps/console/src/components/AppHeader.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import { useLocation, useParams } from 'react-router-dom';
1+
import { useLocation } from 'react-router-dom';
22
import {
33
Breadcrumb,
44
BreadcrumbItem,
55
BreadcrumbLink,
66
BreadcrumbList,
77
BreadcrumbPage,
88
BreadcrumbSeparator,
9-
Separator
109
} from '@object-ui/components';
1110

1211
export function AppHeader({ appName, objects }: { appName: string, objects: any[] }) {
1312
const location = useLocation();
14-
const { objectName } = useParams();
13+
1514

1615
// Find current object if we are on an object route
1716
// Note: This logic assumes simple paths for now.

apps/console/src/components/AppSidebar.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { useNavigate, useLocation, Link } from 'react-router-dom';
2+
import { useLocation, Link } from 'react-router-dom';
33
import {
44
Sidebar,
55
SidebarHeader,
@@ -17,6 +17,7 @@ import {
1717
DropdownMenuItem,
1818
DropdownMenuLabel,
1919
DropdownMenuSeparator,
20+
DropdownMenuGroup,
2021
Avatar,
2122
AvatarImage,
2223
AvatarFallback,
@@ -27,7 +28,6 @@ import {
2728
Plus,
2829
Settings,
2930
LogOut,
30-
User,
3131
LayoutDashboard,
3232
Database,
3333
Users,
@@ -56,8 +56,6 @@ function getIcon(name?: string) {
5656
}
5757

5858
export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: string, onAppChange: (name: string) => void }) {
59-
const navigate = useNavigate();
60-
const location = useLocation();
6159
const { isMobile } = useSidebar();
6260

6361
const apps = appConfig.apps || [];

apps/console/src/components/ObjectView.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ import { useParams } from 'react-router-dom';
33
import { ObjectGrid } from '@object-ui/plugin-grid';
44
import { Button } from '@object-ui/components';
55
import { Plus } from 'lucide-react';
6-
import {
7-
Breadcrumb,
8-
BreadcrumbItem,
9-
BreadcrumbLink,
10-
BreadcrumbList,
11-
BreadcrumbPage,
12-
BreadcrumbSeparator
13-
} from '@object-ui/components';
146

157
export function ObjectView({ dataSource, objects, onEdit }: any) {
168
const { objectName } = useParams();

apps/console/src/mocks/server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { ObjectQLPlugin } from '@objectstack/objectql';
1010
import { InMemoryDriver } from '@objectstack/driver-memory';
1111
import { setupServer } from 'msw/node';
1212
import { http, HttpResponse } from 'msw';
13-
// @ts-expect-error - Config file not in src directory
1413
import appConfig from '../../objectstack.config';
1514

1615
let kernel: ObjectKernel | null = null;

apps/console/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
/* Testing */
2424
"types": ["vitest/globals", "@testing-library/jest-dom"]
2525
},
26-
"include": ["src"],
26+
"include": ["src", "objectstack.config.ts"],
2727
"references": [{ "path": "./tsconfig.node.json" }]
2828
}

apps/console/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"allowSyntheticDefaultImports": true,
88
"strict": true
99
},
10-
"include": ["vite.config.ts", "vitest.setup.ts", "objectstack.config.ts"]
10+
"include": ["vite.config.ts", "vitest.setup.ts"]
1111
}

0 commit comments

Comments
 (0)